function AcceptancProblem(id) { //问题id this.id = id; var that = this; this.inits = function () { //加载问题信息 $.ajax({ url: '/Problem/CheckProblem', data: { id: this.id }, method: 'post', success: function (data) { $('#code').text(data[0].编号); $('#property').text(data[0].问题性质); $('#company').text(data[0].渠道); $('#project').text(data[0].项目); $('#org').text(data[0].机构); $('#productAndVersion').text(data[0].产品 + '/' + data[0].版本号); $('#module').text(data[0].模块); $('#prior').text(data[0].紧急代码); var priordate = data[0].要求时间 == null ? '无' : data[0].要求时间; $('#priordate').text(priordate); var priordesc = data[0].紧急描述 == null ? '无' : data[0].紧急描述; $('#priorDesc').text(priordesc); var feedback = data[0].反馈人 == null ? '无' : data[0].反馈人; $('#feedbackAndRegisterPerson').text(feedback + '/' + data[0].登记人); $('#registertime').text(data[0].登记日期); $('#title').text(data[0].问题标题); $('#content').html(data[0].问题描述); //附件记录(附件id|文件类型,1:图像,2:其它) var attach_ids = data[0].附件 if (attach_ids != null) {//包括了附件 var ids = attach_ids.split(','); var imghtml = ''; for (var i = 0; i < ids.length; i++) { var imgid = ids[i].split('|'); var id = imgid[0]; var ft = imgid[1]; if (ft == '1') {//图像类型,显示缩略图 o原图,s缩略图,m大图 imghtml += ' '; } else {//非图像类型,显示下载附件 imghtml += '下载附件' + (i + 1) + ''; } } //添加附件html $('#attach').html(imghtml); } //放大图片 var img = $('#content').find("img"); if (img) { img.bind("click", function () { var src = $(this).attr("src") top.ZLPMS.OpenNewWindow("查看图片", "/Problem/ViewImg?src=" + src, "850px", "620px") }) } } }); //初始化富文本编辑器 var um = UM.getEditor('tbRemark', { toolbar: [ 'source | undo redo | emotion forecolor backcolor | removeformat |', 'insertorderedlist insertunorderedlist | selectall cleardoc paragraph | fontsize', '| justifyleft justifycenter justifyright justifyjustify |', '| horizontal print preview'] }); //关闭窗口 $('#btnClose').bind('click', function () { ZLPMS.CloseTopWindow(); }); $(function () { //加载问题分类 $('#ProblemType').combotreegrid({ width: '40%', panelWidth: 680, panelHeight: 200, label: '问题分类:', labelPosition: 'left', url: '/ClassifyManage/GetTreeGrid', method: 'GET', idField: 'ID', treeField: '名称', editable: true, columns: [[ { field: '编码', title: '编码', width: 55, align: 'center' }, { field: '名称', title: '名称', width: 170, align: 'center' }, { field: '说明', title: '说明', width: 380, align: 'center', halign: 'center' }, { field: '分值', title: '分值', width: 70, align: 'center', halign: 'center', formatter: function (val, row, index) { return (val || 0) + "分"; } } ]] }); }); $('#Solve').radiobutton({ onChange: function (checked) { if (checked) { $('#ProblemType').combotreegrid({ disabled: false }); } else { $('#ProblemType').combotreegrid({ disabled: true }); } } }); //确定按钮 //确定按钮事件 $('#btnFinish').bind('click', function () { var val=that.GetPara(); $.post('/Problem/AcceptancProblem', val, function (data) { if (data == '1') { top.ZLPMS.Msg('验证完成'); ZLPMS.CloseTopWindow(true); } else { top.ZLPMS.Msg('数据发生异常,请重新填写'); } }) }); } //获取用户录入内容 this.GetPara = function () { var para = {}; //是否验证通过 var IsSolve = $('#Solve').radiobutton('options').checked; //问题分类 var TypeID = $('#ProblemType').combotreegrid('getValue'); //描述说明 var ProcessRemark = escape(UM.getEditor('tbRemark').getContent()); var ProblemId=that.id; para={ Verification: IsSolve, ProblemTypeID:TypeID, ProcessRemark:ProcessRemark, ProblemID:ProblemId }; return para }; } //查看附件大图 function OpenImage(id) { //top.ZLPMS.OpenNewWindow(null, '/Problem/ViewProblemImage?id=' + id + '&type=m', '80%', '90%'); top.ZLPMS.OpenNewWindow(null, '/SysCom/ImageView?id=' + id + '&type=m', '70%', '80%'); } //下载附件文件 function downloadfile(id) { window.open('/Problem/ViewProblemImage?id=' + id); }