New file |
| | |
| | | // 导出为excel(通用) |
| | | function ExportExcel(HModName, ins, option, table) { |
| | | var ModRightNameCheck = HModName + "_ExportExcel"; |
| | | |
| | | //逻辑审核方法 |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名 |
| | | data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { |
| | | table.exportFile(ins.config.id, option.data, "xls"); |
| | | } else { |
| | | layer.alert("当前模块没有导出权限!", { icon: 5 }); |
| | | } |
| | | }, error: function () { |
| | | layer.alert("接口请求失败!", { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | // 设置不可编辑列 / 隐藏列 设置可编辑列 |
| | | function setUneditableCol(option, editable, hideCols) { |
| | | if (Array.isArray(editable) !== true) { |
| | | return |
| | | } |
| | | let UneditableColStyle = 'background-color: #eeeeee;' |
| | | option.cols[0].forEach(item => { |
| | | if (editable.includes(item.field) !== true) { |
| | | item.edit = '' |
| | | if (item.style !== undefined) { |
| | | item.style += ';' + UneditableColStyle |
| | | } else { |
| | | item.style = UneditableColStyle |
| | | } |
| | | |
| | | } else { |
| | | item.edit = 'text' |
| | | } |
| | | |
| | | if (hideCols.includes(item.field) === true) { |
| | | item.hide = true |
| | | } |
| | | }); |
| | | return option |
| | | } |
| | | |
| | | // 设置不可编辑列 / 隐藏列 通过设置不可编辑 |
| | | function setUneditableCol_WithUneditable(option, uneditable, hideCols) { |
| | | if (Array.isArray(uneditable) !== true) { |
| | | return |
| | | } |
| | | let UneditableColStyle = 'background-color: #eeeeee;' |
| | | option.cols[0].forEach(item => { |
| | | if (uneditable.includes(item.field) === true || item.title === '序号') { |
| | | item.edit = '' |
| | | if (item.style !== undefined) { |
| | | item.style += ';' + UneditableColStyle |
| | | } else { |
| | | item.style = UneditableColStyle |
| | | } |
| | | |
| | | } else { |
| | | item.edit = 'text' |
| | | } |
| | | |
| | | if (hideCols.includes(item.field) === true) { |
| | | item.hide = true |
| | | } |
| | | }); |
| | | return option |
| | | } |
| | | |
| | | // 打开手工同步模块 |
| | | function get_ResCnzManual(layer, HBillType = 0, get_FastQuery) { |
| | | layer.open({ |
| | | type: 2 |
| | | , skin: "layui-layer-rim" //加上边框 |
| | | , title: "手工同步" //标题 |
| | | , closeBtn: 1 //窗体右上角关闭 的 样式 |
| | | , shift: 2 //弹出动画 |
| | | , area: ["60%", "90%"] //窗体大小 |
| | | , maxmin: true //设置最大最小按钮是否显示 |
| | | , content: ['../../基础资料/公用基础资料/Gy_ManualSynchronization.html?BillType=' + HBillType, "yes"] |
| | | , btn: ["取消"] |
| | | , btn1: function (index, laero) { |
| | | |
| | | } |
| | | , end: function () { |
| | | //刷新表格数据 |
| | | get_FastQuery(); |
| | | //更新表格缓存的数据 |
| | | layer.close(index);//关闭弹窗 |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 页面HTML解析完成后执行 |
| | | function onCreated(callback) { |
| | | document.addEventListener('DOMContentLoaded', callback) |
| | | } |
| | | |
| | | // 页面资源加载完成后执行 |
| | | function onLoad(callback) { |
| | | window.addEventListener('load', callback) |
| | | } |