var problemlObj = { ProblemID: undefined, CPID: undefined, XMID: undefined, PersonProperty: undefined, Choose: undefined, Count: 0, Data: undefined } function viewModel(View) { var that = this; this.View = View || 'project'; //当前默认的环节点 var currentWorkFlowId = ""; if (RYXZ == 1) { //中联本部人员(默认技术支持处理) currentWorkFlowId = 4; } else if (RYXZ == 2) { //中联渠道人员(默认查询项目处理问题) currentWorkFlowId = 3; } else if (RYXZ == 3) { //中联产品操作人员(默认显示机构处理) currentWorkFlowId = 1; } else if (RYXZ == 4) { //医院管理员(显示卫计委处理) currentWorkFlowId = 2; } else { //默认显示项目处理 currentWorkFlowId = 3; } //初始化所有组件 this.inits = function (val) { if (val != undefined) { currentWorkFlowId = val; } else { //currentWorkFlowId = 3;//加载项目人员问题 currentWorkFlowId = false; } //获取相关的下拉列表控件值 com.GetCom(currentWorkFlowId); var that = this; //绑定查询事件 $('#btnSelect').bind('click', function () { var dg = $('#dgProblems'); var params = com.GetQueryParams(); params.insideProblem = that.View == 'product' ? true : false //重新加载数据 dg.datagrid('load', params); }); //清空查询条件 $("#btnClear").bind('click', function () { $('#XMID').combobox("setValue", ""); $('#CPID').combobox("setValues", []); $('#WTXZ').combobox("setValue", ""); $('#JJDM').combobox("setValue", ""); $('#BBID').combobox("setValue", ""); $('#JJBB').combobox("setValue", ""); $('#DDID').combobox("setValue", ""); $('#JJBBZT').combobox("setValue", ""); $('#JGID').combobox("setValue", ""); $('#YFCLRID').combobox("setValue", ""); $('#SLRID').combobox("setValue", ""); $('#CSCLRID').combobox("setValue", ""); $('#HJID').combobox("setValues", []); $('#DJR').textbox("setValue", ""); $('#KsCx').textbox("setValue", ""); $('#dbStartDate').datebox("setValue", ""); $('#dbEndDate').datebox("setValue", ""); $('#zzStartDate').datebox("setValue", ""); $('#zzEndDate').datebox("setValue", ""); $('#CPMKID').combobox("setValue", ""); $('#ckclose').checkbox('uncheck'); $('#terminissues').checkbox('uncheck'); //重置是否选择解决版本radio var radio = document.getElementsByName("LX"); for (var i = 0; i < radio.length; i++) { if (2 == radio[i].value) { $(radio[i]).next().click(); } } //$('#myprob').checkbox('uncheck'); //$('#myregist').checkbox('uncheck'); //$('#myassign').checkbox('uncheck'); //$('#myapply').checkbox('uncheck'); }); //刷新 $('#btnRefresh').bind('click', function () { that.Refresh(); }); //监听查询文本的回车键,如果有回车就查询 $('#KsCx').textbox('textbox').keydown(function (e) { if (e.keyCode == 13) { that.Refresh(); } }); } //初始化datagrid this.initdatagrid = function (val, ModuleType) { if (val) { currentflowId = [val]; } else { currentflowId = []; } var showReceiveProblem = false; //仅已受理的问题 if ($('#ckRecevie').length > 0) { showReceiveProblem = $('#ckRecevie').checkbox('options').checked; } //仅显示我的问题(我处理的) var myProblem = $('#myprob').checkbox('options').checked; //与我相关选项 var myProblemCombox = ""; if ($('#myregist').checkbox('options').checked) { myProblemCombox += '1,' } if ($('#myassign').checkbox('options').checked) { myProblemCombox += '4,' } if ($('#myapply').checkbox('options').checked) { myProblemCombox += '5,' } //先读取的默认关注产品和模块 $.post("/Problem/GetMyConfigAll", function (data) { var priductid = "" var productModuleId = "" if (data != null) { priductid = data.ProductID productModuleId = data.ModuleID } var dg = $('#dgProblems'); var dgColoum = [{ field: '问题性质', title: '性质', width: 60, align: 'center', formatter: function (val, row, index) { switch (val) { case 1: return "Bug"; break; case 2: return "咨询"; break; case 3: return "需求"; break; case 4: return "优化"; break; case 5: return "环境"; break; case 6: return "接口"; break; } } }, { field: '产品', title: '产品类型', width: 100, align: 'center' }, { field: '问题标题', title: '【问题标题】', width: 300, halign: 'center', formatter: function (val, row, index) { val = "" + val + ""; if (row.附件数量 > 0) { return " " + val; } else { return "    " + val; } } }, { field: '模块', title: '模块', width: 100, align: 'center' }, { field: '登记人', title: '登记人', width: 60, align: 'center' }, { field: '受理人', title: '受理人', sortable: true, width: 60, align: 'center' }, { field: '联系电话', title: '联系电话', width: 90, align: 'center' }, { field: '登记日期', title: '登记日期', sortable: true, width: 140, align: 'center' }, { field: '滞留时间', title: '滞留时间', sortable: true, width: 80, formatter: function (val, row, index) { var rd = val % 24; if (val >= 24) { return parseInt(val / 24) + '天' + rd.toFixed(1) + '时'; } else { return rd + '小时'; } } }, { field: '版本号', title: '版本号', width: 120, align: 'center' }, { field: '解决版本', title: '解决版本', width: 120, align: 'center' }, { field: '解决版本状态', title: '解决版本状态', sortable: true, width: 100, align: 'center', formatter: function (val, row, index) { if (row.解决版本状态 == 1) { return '登记'; } if (row.解决版本状态 == 2) { return '修改' } if (row.解决版本状态 == 3) { return '测试'; } if (row.解决版本状态 == 4) { return '待发布'; } if (row.解决版本状态 == 5) { return '终止'; } if (row.解决版本状态 == 6) { return '已发布'; } } }, { field: '研发处理人', title: '研发处理人', sortable: true, width: 100, align: 'center' }, { field: '测试处理人', title: '测试处理人', sortable: true, width: 100, align: 'center' }, { field: '当前环节', title: '当前环节', sortable: true, width: 90, halign: 'center' }, { field: '项目', title: '项目', width: 100, align: 'center' }, { field: '机构', title: '医疗机构', width: 100, align: 'center' }, { field: '反馈人', title: '反馈人', width: 60, align: 'center' }, { field: '受理时间', title: '受理时间', sortable: true, width: 150, align: 'center' }, { field: '指派人', title: '被指派人', sortable: true, width: 60, align: 'center' }, { field: '指派时间', title: '指派时间', sortable: true, width: 150, align: 'center' }, { field: '渠道', title: '分公司(渠道)', width: 100, align: 'center' }, { field: '总耗时', title: '已耗小时', sortable: true, width: 80, formatter: function (val, row, index) { var rd = val % 24; if (val >= 24) { return parseInt(val / 24) + '天' + rd.toFixed(1) + '时'; } else { return rd + '小时'; } } }, { field: '技术支持分类', title: '技术支持分类', sortable: true, width: 120, align: 'center' }, { field: '紧急补丁时间', title: '紧急补丁时间', sortable: true, width: 90, align: 'center' }, ]; //如果为项目模块 if (ModuleType == 1) { var addcoloum1 = { field: '是否验证', title: '是否验收', width: 70, halign: 'center', sortable: true, align: 'center', formatter: function (val, row, index) { if (val == 1) { return "是(" + row.验证人姓名 + ")"; } else { return "否"; } } }; var addcoloum2 = { field: '问题分类', title: '问题分类', width: 70, halign: 'center', align: 'center' } dgColoum.splice(4, 0, addcoloum1) dgColoum.splice(5, 0, addcoloum2) } //如果为当前流程环节为技术支持 else if (ModuleType == 4) { var addcoloum1 = { field: '最后提交人', title: '最后提交人', width: 90, halign: 'center', sortable: true, align: 'center', }; dgColoum.splice(7, 0, addcoloum1) } dg.datagrid({ fit: true, width: '100%', toolbar: '#toolbar', pageSize: 20, pageList: [10, 20, 30, 40, 50, 1000], rownumbers: true, pagination: true, border: false, checkbox: true, checkOnSelect: false, remoteSort: true, singleSelect: true, //单行选择 loadMsg: "正在查询数据,请稍候...", url: '/Problem/QueryProblems', method: 'post', queryParams: { workflowNode: currentflowId, showReceiveProblem: showReceiveProblem, myProblem: myProblem, myProblemCombox: myProblemCombox, productId: priductid, productModuleId: productModuleId, insideProblem: that.View == 'product' ? true : false }, frozenColumns: [ [{ field: '状态', title: '状态', width: 50, align: 'center', formatter: function (val, row, index) { var imgtext = ""; //if (row.是否终止 == 1 || row.是否解决 == 1) { // imgtext += " "; //} if (row.重复次数 != 0) { imgtext += " "; } if (row.关联编号 != null) { // imgtext += " "; imgtext += "子版 "; } else if (row.关联数量 != null && row.关联数量 > 0) { // imgtext += "源版 "; imgtext += "源版 "; } if (row.是否回退 == 1) { imgtext += " "; } if (row.紧急代码 == 2) { imgtext += " "; } else if (row.紧急代码 == 3) { imgtext += " "; } else if (row.紧急代码 == 4) { imgtext += " "; } //显示问题类型(1:项目问题,2:产品问题) if (row.问题类型 == 2) { imgtext += " "; } //显示完成/终止的问题 if (row.是否终止 == 1) { imgtext += " "; } else if (row.是否解决 == 1) { imgtext += " "; } //记录维保过期问题 if (row.应用状态 != 1) { imgtext += " "; } return imgtext; } }, //状态包括:是否解决,紧急,终止 { field: '编号', title: '编号', sortable: true, width: 60, align: 'center' } ] ], columns: [dgColoum], onSelect: function (rowIndex, rowData) { if (rowData.应用状态 != 1) { $('#btnDeal').linkbutton({ disabled: true }); var tips="未维护" if (rowData.服务结束时间 != null) { tips = rowData.服务结束时间; } $('#btnDeal').tooltip({ position: 'top', content: "当前客户已脱保,脱保日期:" + tips }); } else { $('#btnDeal').linkbutton({ disabled: false }); $('#btnDeal').tooltip({ position: 'top', content:"" }); } //选择一行记录,加载对应的处理过程与沟通信息 com.GetMainProcess(rowData["ID"]); com.DealProcess(rowData["ID"]); com.getResourceData(rowData["ID"]); var item1 = $('#MoreItem').menu('getItem', $('#btn_acceptance')[0]); var item2 = $('#MoreItem').menu('getItem', $('#btn_repeal')[0]); if (rowData.是否解决 == 0 && rowData.是否终止 == 0) { $('#MoreItem').menu('disableItem', item1.target); $('#MoreItem').menu('disableItem', item2.target); } else { $('#MoreItem').menu('enableItem', item1.target); $('#MoreItem').menu('enableItem', item2.target); } if (rowData.是否验证 == 1) { $('#MoreItem').menu('disableItem', item1.target); } }, rowStyler: function (index, row) { if (row.是否终止 == 1) { return 'background-color:#ff9292;'; // rowStyle是一个已经定义了的ClassName(类名) } else if (row.是否解决 == 1) { return 'background-color:#a3ffa3;'; // rowStyle是一个已经定义了的ClassName(类名) } else if (row.是否回退 == 1) { return 'background-color:rgba(0, 150, 136, 0.73)'; // rowStyle是一个已经定义了的ClassName(类名) } }, onDblClickRow: function (rowIndex, rowData) { sessionStorage.setItem("WTID", rowData.ID); checkproblem(); }, onClickRow: function (index, rowData) { sessionStorage.setItem("WTID", rowData.ID); $(".dot .menu-icon").removeClass("fa fa-dot-circle-o color_blue") $(".dot .menu-icon").addClass("fa fa-circle-o color_blue") $(".dot" + rowData.解决版本状态 + " .menu-icon").addClass("fa fa-dot-circle-o color_blue") } }); }) } //刷新(技术支持) this.Refresh = function () { var dg = $('#dgProblems'); //获取查询参数 var params = com.GetQueryParams(); params.insideProblem = that.View == 'product' ? true : false //重新加载 dg.datagrid('reload', params); } } //技术支持列表页面 function superViewModel() { this.type = ''; //初始化没有支持的问题列表 this.initNotSuperGrid = function (type) { this.type = type; var dg = $('#dgnoSuperList'); dg.datagrid({ singleSelect: true, fit: true, border: false, striped: true, remoteSort: false, toolbar: '#noSuperToolbar', rownumbers: true, pagination: true, pageSize: 20, loadMsg: "正在查询数据,请稍候...", method: 'post', url: '/Support/GetNeedProcessList?type=' + type, columns: [ [{ field: '紧急代码', title: '状态', width: 50, align: 'center', formatter: function (val, row, index) { var prop = row.问题性质; var imgtext = ""; switch (prop) { case 1: imgtext = ""; break; case 2: imgtext = ""; break; case 3: imgtext = ""; break; case 4: imgtext = ""; break; } //显示优先级 if (row.紧急代码 == 2) { imgtext += " "; } else if (row.紧急代码 == 3) { imgtext += " "; } else if (row.紧急代码 == 4) { imgtext += " "; } //显示处理操作按钮 imgtext += " "; return imgtext; } }, { field: '问题标题', title: '问题标题', sortable: true, width: 250, formatter: function (val, row, index) { val = "" + val + ""; if (row.附件数量 > 0) { return " " + val; } else { return "    " + val; } } }, { field: '编号', title: '编号', sortable: true, width: 60, align: 'center' }, { field: '渠道', title: '来源渠道', sortable: true, width: 100, align: 'center' }, { field: '产品', title: '来源产品', sortable: true, width: 80, align: 'center' }, { field: '反馈人', title: '反馈人', sortable: true, width: 60, align: 'center' }, { field: '登记人', title: '登记人', sortable: true, width: 60, align: 'center' }, { field: '登记日期', title: '登记日期', sortable: true, width: 160, align: 'center' } ] ], onSelect: function (rowIndex, rowData) { //选择一行记录,加载对应的处理过程与沟通信息 com.GetMainProcess(rowData["ID"]); com.DealProcess(rowData["ID"]); } }); //设置分页信息总分近钮不可见 var pager = dg.datagrid().datagrid('getPager'); pager.pagination({ layout: ['sep', 'first', 'prev', 'next', 'last', 'info'], displayMsg: '共:{total}项' }); } //初始化绑定按钮事件 this.inits = function (pid, mid) { var that = this; //绑定受理问题按钮 $('#btnProcess').bind('click', function () { FastReceiveProblem(null); }); //刷新未处理的问题 $('#btnRefreshProcess').bind('click', function () { com.RefreshNoProcessList(); }); //根据产品过滤问题 var productid = ""; $('#ccProduct').combobox({ onChange(newValue, oldValue) { var dg = $('#dgnoSuperList'); productid = newValue.join(","); dg.datagrid('load', { productid: newValue.join(","), productModuleId: productModuleId, type: that.type }); $('#CPID').combobox('setValues', newValue); $('#btnRefresh').trigger('click'); }, onLoadSuccess: function (row, data) { if (pid != '') { //设置为我的关注模块 $('#ccProduct').combobox('setValues', [pid]); } } }); //根据产品模块过滤问题 var productModuleId = ""; $('#ccProductModule').combobox({ onChange(newValue, oldValue) { productModuleId = newValue.join(","); var dg = $('#dgnoSuperList'); dg.datagrid('load', { productid: productid, productModuleId: newValue.join(","), type: that.type }); $('#CPMKID').combobox('setValues', newValue); $('#btnRefresh').trigger('click'); }, onLoadSuccess: function (row, data) { if (mid != '') { //设置为我的关注模块 $('#ccProductModule').combobox('setValues', [mid]); } } }); } } //共公处理方法 var com = { //加载问题处理过程 DealProcess: function (ID) { var url = "/Problem/GetClc?ID=" + ID; $.post(url, {}, function (data) { $("#timeLine").empty(); $.each(data, function (idx, json) { if (json != undefined) { var attfile = ""; if (json.附件 != undefined) { attfile = ""; } json.描述 = json.描述 != undefined ? json.描述 : "无"; if (json.描述 != "无") { var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' }; json.描述 = json.描述.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) { return arrEntities[t] }); if (json.描述.length == 0) { json.描述 = "内有图片,点击该过程即可查看"; } } if (json.描述.length > 25) { json.描述 = json.描述.substring(0, 25) + "..."; } var html = "
  • " + json.处理状态 + " " + attfile + "

    " + json.处理人员 + "(" + json.职务 + ")
    " + json.记录时间 + (json.耗时 != undefined ? "(" + json.耗时 + ")小时" : "") + "
    " + "描述:" + (json.描述) + "

  • "; $("#timeLine").append(html); } }); }); }, //获取问题过程主流程 GetMainProcess: function (ID) { var url = "/Problem/GetMainProcess/" + ID; $.post(url, {}, function (data) { $("#timeLineMain").empty(); data = data.reverse(); $.each(data, function (idx, json) { if (json) { var attfile = ""; json.LinkDeatil = json.LinkDeatil ? "描述:" + json.LinkDeatil : ""; if (json.LinkDeatil) { var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' }; json.LinkDeatil = json.LinkDeatil.replace(/<[^>]+>/g, "").replace(/&(lt|gt|nbsp|amp|quot);/ig, function (all, t) { return arrEntities[t] }); if (json.LinkDeatil.length == 0) { json.LinkDeatil = "内有图片,点击该过程即可查看"; } if (json.LinkDeatil.length > 25) { json.LinkDeatil = json.LinkDeatil.substring(0, 25) + "..."; } } var detail = ""; if (json.LinkUserName) { detail = "

    " + (json.LinkUserName ? json.LinkUserName + '(' + json.job + ')' : '') + "
    " + (json.LinkTime ? json.LinkTime : '') + "
    " + (json.LinkDeatil) + "

    "; } //图标转换 var Icon = ""; switch (json.StatusID) { case 1: Icon = ""; break; case 3: Icon = "ဇ"; break; case 7: Icon = "စ"; break; case 11: Icon = ""; break; default: Icon = ""; break; } var html = "
  • " + Icon + "

    " + json.LinkName + "

    " + detail + "
  • "; $("#timeLineMain").append(html); } }); }); }, ///获取流程图标 0 登记新问题 1 机构处理 2 卫计委处理 3 项目处理 4 技术支持处理 5 研发处理 6 测试处理 FindIcon: function (title) { if (title == "登记新问题") { return ""; } else if (title == "机构处理") { return ""; } else if (title == "卫计委处理") { return ""; } else if (title == "项目处理") { return ""; } else if (title == "技术支持处理") { return ""; } else if (title == "研发处理") { return ""; } else if (title == "测试处理") { return ""; } else if (title == "完成") { return ""; } else { return ''; } }, //给查询条件赋值 GetCom: function (currentWorkFlowId) { //从Cookie中获取默认选择项 var Mycheck_PC = JSON.parse(getCookie("Mycheck_PC")) || {}; //项目 $("#XMID").combobox({ url: '/Problem/GetProjectByInfo', valueField: 'ID', textField: '名称', onChange: function (newValue, oldValue) { if (newValue.length == 36) { //项目所属的机构 $("#JGID").combobox({ url: '/Problem/GetStationByID/' + newValue, valueField: 'ID', textField: '名称', onLoadSuccess: function (data) { } }) } } }) $("#CPID").combobox({ url: '/Product/GetAllProducts', valueField: "ID", textField: "名称", multiple: true, onChange: function (cur, old) { //只选择一个产品触发 if (cur.length == 1) { //登记版本 $("#BBID").combobox({ url: '/Problem/GetVersionById?id=' + cur[0] + "&type=0", valueField: '版本号', textField: '版本号' }); //解决版本 $("#JJBB").combobox({ url: '/Problem/GetVersionById?id=' + cur[0] + "&type=0", valueField: '版本号', textField: '版本号' }); } } }); $("#CPMKID").combobox({ url: '/Problem/GetAllModual', valueField: "ID", textField: "名称", multiple: true, }); $("#WTXZ").combobox({ url: '/Problem/XZinfo', valueField: "ID", textField: "问题性质" }); $("#JJBBZT").combobox({ url: "/Problem/GetBaseCode?type=35DB8B88-36B5-49FE-A879-D49DB88BC03B", valueField: "代码", textField: "显示名" }); //研发处理人 $("#YFCLRID").combobox({ url: "/Problem/GetUserInfoByChannelId", valueField: 'ID', textField: '姓名' }) $("#SLRID").combobox({ url: "/Problem/GetFKR", valueField: 'ID', textField: '姓名' }) //测试处理人 $("#CSCLRID").combobox({ url: "/Problem/GetUserInfoByChannelId", valueField: 'ID', textField: '姓名' }) $("#JJDM").combobox({ url: '/Problem/JJCDinfo', valueField: "ID", textField: "紧急程度" }); $("#HJID").combobox({ url: '/Problem/LCHJ', valueField: "ID", textField: "流程环节", multiple: true, onBeforeLoad: function () { if (currentWorkFlowId) $(this).combobox('setValues', [currentWorkFlowId]); } }); $("#FaCx").combobox({ url: '/Problem/FanSelect', valueField: "ID", textField: "方案名" }) //迭代 $('#DDID').combobox({ url: '/Problem/GetLterationList', valueField: 'ID', textField: '名称', }); $('#myprob').checkbox({ checked: Mycheck_PC.myprob || false, onChange(checked) { Mycheck_PC.myprob = checked; setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2) $('#btnSelect').click(); } }); $('#myregist').checkbox({ checked: Mycheck_PC.myregist || false, onChange(checked) { Mycheck_PC.myregist = checked; setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2) $('#btnSelect').click(); } }); $('#myassign').checkbox({ checked: Mycheck_PC.myassign || false, onChange(checked) { Mycheck_PC.myassign = checked; setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2) $('#btnSelect').click(); } }); $('#myapply').checkbox({ checked: Mycheck_PC.myapply || false, onChange(checked) { Mycheck_PC.myapply = checked; setCookie("Mycheck_PC", JSON.stringify(Mycheck_PC), 2) $('#btnSelect').click(); } }); }, //获取当前界面的查询条件 GetQueryParams: function () { var data = {}; //项目ID var projectid = $('#XMID').combobox('getValue'); data.projectId = projectid; //机构id var orgId = $('#JGID').combobox('getValue'); data.orgId = orgId; //产品id var pid = $('#CPID').combobox('getValues').join(","); data.productId = pid; //产品模块id var pmid = $('#CPMKID').combobox('getValues').join(","); data.productModuleId = pmid; //问题性质 var property = $('#WTXZ').combobox('getValue'); data.property = property; //紧急程度 var priority = $('#JJDM').combobox('getValue'); data.priority = priority; //流程环节 var workflowNode = $('#HJID').combobox('getValues').join(","); data.workflowNode = workflowNode; //解决版本状态 data.JJBBZT = $('#JJBBZT').combobox('getValues').join(","); //研发处理人id data.YFCLRID = $('#YFCLRID').combobox('getValues').join(","); //受理人id data.SLRID = $('#SLRID').combobox('getValues').join(","); //测试处理人id data.CSCLRID = $('#CSCLRID').combobox('getValues').join(","); //登记人 var RegistPerson = $('#DJR').textbox('getValue'); data.RegistPerson = RegistPerson; //查询信息(根据问题编号与标题查询) var queryText = $('#KsCx').textbox('getValue'); data.queryText = queryText; //快速检索是否包含查询条件 var IncludeSearchContent = $('#IncludeSearchContent').checkbox('options').checked; data.IncludeSearchContent = IncludeSearchContent; //仅显示我的问题(我处理的) var myProblem = $('#myprob').checkbox('options').checked; data.myProblem = myProblem; //与我相关选项 var mySelect = ""; if ($('#myregist').checkbox('options').checked) { mySelect += '1,' } if ($('#myassign').checkbox('options').checked) { mySelect += '4,' } if ($('#myapply').checkbox('options').checked) { mySelect += '5,' } data.myProblemCombox = mySelect; //仅已受理的问题 if ($('#ckRecevie').length > 0) { var showReceiveProblem = $('#ckRecevie').checkbox('options').checked; data.showReceiveProblem = showReceiveProblem; } //是否显示已关闭的问题 var showCloseProblem = $('#ckclose').checkbox('options').checked; data.showCloseProblem = showCloseProblem; //只显示终止的问题 if ($('#terminissues').length > 0) { var showTerminIssues = $('#terminissues').checkbox('options').checked; data.showTerminIssues = showTerminIssues; } //获取查询日期 var startDate = $('#dbStartDate').datebox('getValue'); data.startDate = startDate; //获取查询结束日期 var endDate = $('#dbEndDate').datebox('getValue'); data.endDate = endDate; //获取终止/解决查询日期 var zzstartDate = $('#zzStartDate').datebox('getValue'); data.zzstartDate = zzstartDate; //获取终止/解决查询结束日期 var zzendDate = $('#zzEndDate').datebox('getValue'); data.zzendDate = zzendDate; //迭代任务 data.lteration = $('#DDID').combobox('getValue'); //产品登记版本 data.version = $('#BBID').combobox('getValue'); //产品解决版本 data.solutionversion = $('#JJBB').combobox('getValue'); //是否指定解决版本 data.whether = $('input[name="LX"]:checked').val(); return data; }, //刷新未处理的问题 RefreshNoProcessList: function () { //刷新待处理列表 $('#dgnoSuperList').datagrid('reload'); //刷新已处理列表 $('#dgProblems').datagrid('reload'); }, //刷新已处理列表 RefreshOnDeal: function () { //刷新已处理列表 $('#dgProblems').datagrid('reload'); }, ///刷新待处理列表 RefreshNoDeal: function () { $('#dgnoSuperList').datagrid('reload'); }, //加载资源信息 getResourceData: function (ID) { $('#resource').datagrid({ toolbar: '#btn_func', singleSelect: true, url: '/Problem/ResourceData?proid=' +ID, fit: true, columns: [ [{ field: 'DECODE类型', title: '类型', width: 70 }, { field: '内容', width: 116, title: '内容', minWdith: 116 }, { field: '资源ID', title: '资源ID', width: 120, minWdith: 120 }, { field: '添加时间', title: '添加时间', width: 142, } ] ] }) } } //关闭窗体 function Close() { ZLPMS.CloseTopWindow(true) } //导出Excel function GetExcel(type) { //var data = $('#dgProblems').datagrid('getData'); var params = com.GetQueryParams(); params.type = type == 3 ? type : 0; params.page = 0; params.rows = 0; var location = top.ZLPMS.Loading("导出中,请稍等..."); $.post("/Problem/QueryProblems", params, function (data) { top.ZLPMS.UnLoading(location); var jsonData = data.rows; //删除ID if (type == 1) { for (var t in jsonData) { delete jsonData[t].ID; delete jsonData[t].ROWNO; delete jsonData[t].受理人ID; delete jsonData[t].环节ID; delete jsonData[t].受理人ID; delete jsonData[t].问题类型; /* delete jsonData[t].问题性质;*/ switch (jsonData[t].问题性质) { case 1: jsonData[t].问题性质 = "缺陷" break case 2: jsonData[t].问题性质 = "咨询" break case 3: jsonData[t].问题性质 = "需求" break case 4: jsonData[t].问题性质 = "优化" break case 5: jsonData[t].问题性质 = "环境" break case 6: jsonData[t].问题性质 = "接口" break } } } else { for (var t in jsonData) { delete jsonData[t].ID; delete jsonData[t].ROWNO; delete jsonData[t].受理人ID; delete jsonData[t].环节ID; delete jsonData[t].受理人ID; delete jsonData[t].问题类型; /* delete jsonData[t].问题性质;*/ switch (jsonData[t].问题性质) { case 1: jsonData[t].问题性质 = "缺陷" break case 2: jsonData[t].问题性质 = "咨询" break case 3: jsonData[t].问题性质 = "需求" break case 4: jsonData[t].问题性质 = "优化" break case 5: jsonData[t].问题性质 = "环境" break case 6: jsonData[t].问题性质 ="接口" break } switch (jsonData[t].解决版本状态) { case 1: jsonData[t].解决版本状态 = "登记" break case 2: jsonData[t].解决版本状态 = "修改" break case 3: jsonData[t].解决版本状态 = "测试" break case 4: jsonData[t].解决版本状态 = "待发布" break case 5: jsonData[t].解决版本状态 = "终止" break case 6: jsonData[t].解决版本状态 = "已发布" break } jsonData[t].是否终止 = jsonData[t].是否终止 == 1 ? '是' : '否'; jsonData[t].是否验证 = jsonData[t].是否验证 == 1 ? '是' : '否'; jsonData[t].是否解决 = jsonData[t].是否解决 == 1 ? '是' : '否'; jsonData[t].是否受理 = jsonData[t].是否受理 == 1 ? '是' : '否'; jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否'; jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否'; } } //获取标题 var name = ''; for (let Title in jsonData[0]) { //增加\t为了不让表格显示科学计数法或者其他格式 name += `${Title}`; } name += ''; let str = ''; //循环遍历,每行加入tr标签,每个单元格加td标签 for (let i = 0; i < jsonData.length; i++) { str += ''; for (let item in jsonData[i]) { //增加\t为了不让表格显示科学计数法或者其他格式 str += `${jsonData[i][item] + '\t'}`; } str += ''; } str = name + str; let worksheet = '问题记录' let uri = 'data:application/vnd.ms-excel;base64,'; //下载的表格模板数据 let template = ` ${str}
    `; //下载模板 window.location.href = uri + base64(template) }) } //自定义导出设置 function ExcelSet() { top.ZLPMS.OpenNewWindow("导出Excel设置", "/Problem/ExcelSet_Window/", '500px', '520px', function () { GetExcel(1) }); } function base64(s) { return window.btoa(unescape(encodeURIComponent(s))) } function ShowConnect(id) { $.post("/Problem/ShowConnect/" + id, function (data) { var html = "" for (var i = 0; i < data.length; i++) { html += data[i].编号版本 + "
    " } //配置一个透明的询问框 layer.msg(html, { time: 200000, //20s后自动关闭 btnAlign: 'c', btn: ['关闭'] }); }) } //导出Excel function ExportExcelV2(type) { //var data = $('#dgProblems').datagrid('getData'); var params = com.GetQueryParams(); params.type = type == 3 ? type : 0; params.page = 0; params.rows = 0; var location = top.ZLPMS.Loading("导出中,请稍等..."); $.post("/Problem/QueryProblemsV2", params, function (data) { top.ZLPMS.UnLoading(location); var jsonData = data.rows; //删除ID if (type == 1) { for (var t in jsonData) { /* delete jsonData[t].问题性质;*/ switch (jsonData[t].问题性质) { case 1: jsonData[t].问题性质 = "缺陷" break case 2: jsonData[t].问题性质 = "咨询" break case 3: jsonData[t].问题性质 = "需求" break case 4: jsonData[t].问题性质 = "优化" break case 5: jsonData[t].问题性质 = "环境" break case 6: jsonData[t].问题性质 = "接口" break } } } else { for (var t in jsonData) { delete jsonData[t].ID; delete jsonData[t].ROWNO; delete jsonData[t].受理人ID; delete jsonData[t].环节ID; delete jsonData[t].受理人ID; delete jsonData[t].问题类型; /* delete jsonData[t].问题性质;*/ switch (jsonData[t].问题性质) { case 1: jsonData[t].问题性质 = "缺陷" break case 2: jsonData[t].问题性质 = "咨询" break case 3: jsonData[t].问题性质 = "需求" break case 4: jsonData[t].问题性质 = "优化" break case 5: jsonData[t].问题性质 = "环境" break case 6: jsonData[t].问题性质 = "接口" break } switch (jsonData[t].解决版本状态) { case 1: jsonData[t].解决版本状态 = "登记" break case 2: jsonData[t].解决版本状态 = "修改" break case 3: jsonData[t].解决版本状态 = "测试" break case 4: jsonData[t].解决版本状态 = "待发布" break case 5: jsonData[t].解决版本状态 = "终止" break case 6: jsonData[t].解决版本状态 = "已发布" break } jsonData[t].是否终止 = jsonData[t].是否终止 == 1 ? '是' : '否'; jsonData[t].是否验证 = jsonData[t].是否验证 == 1 ? '是' : '否'; jsonData[t].是否解决 = jsonData[t].是否解决 == 1 ? '是' : '否'; jsonData[t].是否受理 = jsonData[t].是否受理 == 1 ? '是' : '否'; jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否'; jsonData[t].是否回退 = jsonData[t].是否回退 == 1 ? '是' : '否'; } } //获取标题 var name = ''; for (let Title in jsonData[0]) { //增加\t为了不让表格显示科学计数法或者其他格式 name += `${Title}`; } name += ''; let str = ''; //循环遍历,每行加入tr标签,每个单元格加td标签 for (let i = 0; i < jsonData.length; i++) { str += ''; for (let item in jsonData[i]) { //增加\t为了不让表格显示科学计数法或者其他格式 str += `${jsonData[i][item] + '\t'}`; } str += ''; } str = name + str; let worksheet = '问题记录' let uri = 'data:application/vnd.ms-excel;base64,'; //下载的表格模板数据 let template = ` ${str}
    `; //下载模板 window.location.href = uri + base64(template) }) } //自定义导出设置V2版本 function ExportExcel(source) { top.ZLPMS.OpenNewWindow("导出Excel设置", "/Problem/ExcelSet_Window/", '500px', '520px', function () { if (source==3) {//产品问题导出 ExportExcelV2(1) } }); }