|  |  |  | 
|---|
|  |  |  | </style> | 
|---|
|  |  |  | <script> | 
|---|
|  |  |  | // 这里是需要在页面渲染之前执行的代码 | 
|---|
|  |  |  | document.addEventListener("DOMContentLoaded", function() { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | document.addEventListener("DOMContentLoaded", function () { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //获取table默认显示数 | 
|---|
|  |  |  | pageCntFirst(); | 
|---|
|  |  |  | //判断是否开启table列表列宽调整功能。 | 
|---|
|  |  |  | GetIsSetColW(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | </head> | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | {{ GetBtn7(d) }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <!-- #endregion --> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <script type="text/html" id="toolbarDemo"> | 
|---|
|  |  |  | <button style="margin-right: 5px;" class="layui-btn layui-btn-sm layuiadmin-btn-list addClass" lay-event="add" > | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 搜索方法 | 
|---|
|  |  |  | form.on('submit(LAY-app-contlist-search)', function (data) { | 
|---|
|  |  |  | bindTable(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | bindTable(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 页面加载绑定Table | 
|---|
|  |  |  | bindTable(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 添加导入按钮单机事件 | 
|---|
|  |  |  | table.on('toolbar(Box-list)', function (obj) { | 
|---|
|  |  |  | switch (obj.event) { | 
|---|
|  |  |  | 
|---|
|  |  |  | icon: 2, | 
|---|
|  |  |  | time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | }, function () { doing = true }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | break; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | default: break; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | // 查询录入的箱支关系 | 
|---|
|  |  |  | //#region 自定义表头 | 
|---|
|  |  |  | var TotalColsArr = [[ | 
|---|
|  |  |  | {field: 'BoxNo',title: '箱号',align: 'center',fixed: 'left',width: 220, "disabled": true}, | 
|---|
|  |  |  | {field: 'BoxNo2',title: '盒号',align: 'center',fixed: 'left'}, | 
|---|
|  |  |  | {field: 'BoxNo3',title: '支号',align: 'center',fixed: 'left',width: 220, "disabled": true}, | 
|---|
|  |  |  | {field: 'SkuNo',title: '物料编码',align: 'center',fixed: 'left',width: 140, "disabled": true}, | 
|---|
|  |  |  | {field: 'SkuName',title: '物料名称',align: 'center',fixed: 'left',width: 240, "disabled": true}, | 
|---|
|  |  |  | {field: 'LotNo',title: '批次号',align: 'center',width: 155,}, | 
|---|
|  |  |  | {field: 'Qty',title: '数量',align: 'center',width: 100,}, | 
|---|
|  |  |  | {field: 'LotText',title: '批次描述',align: 'center',width: 165}, | 
|---|
|  |  |  | {field: 'ProductionTime',title: '生产日期',align: 'center',width: 160,templet: '#templetProductionTime'}, | 
|---|
|  |  |  | {field: 'ExpirationTime',title: '过期日期',align: 'center',width: 160,templet: '#templetExpirationTime'}, | 
|---|
|  |  |  | {field: 'SupplierLot',title: '供货批次',align: 'center',width: 155}, | 
|---|
|  |  |  | {field: 'InspectMark',title: '抽检标记',align: 'center',templet: '#templetInspectMark',width: 90}, | 
|---|
|  |  |  | {field: 'BitBoxMark',title: '零箱标记',align: 'center',templet: '#templetBitBoxMark',width: 90}, | 
|---|
|  |  |  | {field: 'Origin',title: '来源',align: 'center',}, | 
|---|
|  |  |  | {field: 'CreateUserName',title: '创建人',align: 'center',width: 100}, | 
|---|
|  |  |  | {field: 'CreateTime',title: '创建时间',align: 'center',width: 160,templet: '#templetCreateTime'}, | 
|---|
|  |  |  | {field:'caozuo',title: '操作',fixed: 'right',width: 100,align: 'center',toolbar: '#toolbarDemoList', "disabled": true} | 
|---|
|  |  |  | ]]; | 
|---|
|  |  |  | var TotalColsSysArr=encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 | 
|---|
|  |  |  | { field: 'BoxNo', title: '箱号', align: 'center', fixed: 'left', width: 220, "disabled": true }, | 
|---|
|  |  |  | { field: 'BoxNo2', title: '盒号', align: 'center', fixed: 'left' }, | 
|---|
|  |  |  | { field: 'BoxNo3', title: '支号', align: 'center', fixed: 'left', width: 220, "disabled": true }, | 
|---|
|  |  |  | { field: 'SkuNo', title: '物料编码', align: 'center', fixed: 'left', width: 140, "disabled": true }, | 
|---|
|  |  |  | { field: 'SkuName', title: '物料名称', align: 'center', fixed: 'left', width: 240, "disabled": true }, | 
|---|
|  |  |  | { field: 'LotNo', title: '批次号', align: 'center', width: 155, }, | 
|---|
|  |  |  | { field: 'Qty', title: '数量', align: 'center', width: 100, }, | 
|---|
|  |  |  | { field: 'LotText', title: '批次描述', align: 'center', width: 165 }, | 
|---|
|  |  |  | { field: 'ProductionTime', title: '生产日期', align: 'center', width: 160, templet: '#templetProductionTime' }, | 
|---|
|  |  |  | { field: 'ExpirationTime', title: '过期日期', align: 'center', width: 160, templet: '#templetExpirationTime' }, | 
|---|
|  |  |  | { field: 'SupplierLot', title: '供货批次', align: 'center', width: 155 }, | 
|---|
|  |  |  | { field: 'InspectMark', title: '抽检标记', align: 'center', templet: '#templetInspectMark', width: 90 }, | 
|---|
|  |  |  | { field: 'BitBoxMark', title: '零箱标记', align: 'center', templet: '#templetBitBoxMark', width: 90 }, | 
|---|
|  |  |  | { field: 'Origin', title: '来源', align: 'center', }, | 
|---|
|  |  |  | { field: 'CreateUserName', title: '创建人', align: 'center', width: 100 }, | 
|---|
|  |  |  | { field: 'CreateTime', title: '创建时间', align: 'center', width: 160, templet: '#templetCreateTime' }, | 
|---|
|  |  |  | { field: 'caozuo', title: '操作', fixed: 'right', width: 100, align: 'center', toolbar: '#toolbarDemoList', "disabled": true } | 
|---|
|  |  |  | ]]; | 
|---|
|  |  |  | var TotalColsSysArr = encodeURIComponent(encodeURIComponent(JSON.stringify(TotalColsArr)))//将表头数据进行url编码 | 
|---|
|  |  |  | //#endregion | 
|---|
|  |  |  | function bindTable() { | 
|---|
|  |  |  | //#region 原始非自定义列 | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //#region 自定义表头 | 
|---|
|  |  |  | var colsJson | 
|---|
|  |  |  | var param1={ | 
|---|
|  |  |  | Href:'BllAsn/GetBllBoxInfoList' | 
|---|
|  |  |  | var param1 = { | 
|---|
|  |  |  | Href: 'BllAsn/GetBllBoxInfoList' | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function(res) { | 
|---|
|  |  |  | if (res.code == 0){ | 
|---|
|  |  |  | if(res.data=='' || res.data==undefined || res.data==null){ | 
|---|
|  |  |  | colsJson=TotalColsArr | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | colsJson= eval(res.data); | 
|---|
|  |  |  | sendData(IP + "/Sys/GetTableColsByUserId", param1, 'post', function (res) { | 
|---|
|  |  |  | if (res.code == 0) { | 
|---|
|  |  |  | if (res.data == '' || res.data == undefined || res.data == null) { | 
|---|
|  |  |  | colsJson = TotalColsArr | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | colsJson = eval(res.data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | colsJson=TotalColsArr | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | colsJson = TotalColsArr | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var param = { | 
|---|
|  |  |  | BoxNo: $("#BoxNo").val(), | 
|---|
|  |  |  | 
|---|
|  |  |  | ProductionTime: $("#ProductionTime").val(), | 
|---|
|  |  |  | InspectMark: $("#InspectMark").val(), | 
|---|
|  |  |  | BitBoxMark: $("#BitBoxMark").val(), | 
|---|
|  |  |  | // Origin: "录入", | 
|---|
|  |  |  | Origin: "录入;导入;赋码", | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | table.render({ | 
|---|
|  |  |  | elem: '#Box-list', | 
|---|
|  |  |  | 
|---|
|  |  |  | done: function (res) { | 
|---|
|  |  |  | setRight(); | 
|---|
|  |  |  | //自定义列宽 | 
|---|
|  |  |  | SetTableColW('Box-list','BllAsn/GetBllBoxInfoList',TotalColsSysArr); | 
|---|
|  |  |  | SetTableColW('Box-list', 'BllAsn/GetBllBoxInfoList', TotalColsSysArr); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | cols: colsJson | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | $(function () { | 
|---|
|  |  |  | $(".addClass").hide(); | 
|---|
|  |  |  | $(".DaoRuClass").hide(); | 
|---|
|  |  |  | $(".delClass").hide(); | 
|---|
|  |  |  | $(".delClass").hide(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | sendData(IP + "/Basis/GetRoleRightList", {}, 'get', function (res) { | 
|---|
|  |  |  | if (res.code == 0) { //成功 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (res.data[k].MenuName == "删除箱支录入") { | 
|---|
|  |  |  | $(function () { | 
|---|
|  |  |  | $(".delClass").show(); | 
|---|
|  |  |  | $(".delClass").show(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | doing = true | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } else { //不成功 | 
|---|
|  |  |  | if(res.msg==undefined){ | 
|---|
|  |  |  | if (res.msg == undefined) { | 
|---|
|  |  |  | layer.msg("后台正在导入中,请稍后查看结果", { | 
|---|
|  |  |  | icon: 2, | 
|---|
|  |  |  | time: 3000 //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | }, function () { bindTable();doing = true }); | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | }, function () { bindTable(); doing = true }); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, { | 
|---|
|  |  |  | icon: 2, | 
|---|
|  |  |  | time: 2000 //2秒关闭(如果不配置,默认是3秒) | 
|---|
|  |  |  | }, function () { bindTable();doing = true }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, function () { bindTable(); doing = true }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | //#region 自定义表头 | 
|---|
|  |  |  | //自定义表头 | 
|---|
|  |  |  | active = { | 
|---|
|  |  |  | customCols: function(){ | 
|---|
|  |  |  | customCols: function () { | 
|---|
|  |  |  | layer.open({ | 
|---|
|  |  |  | type: 2, | 
|---|
|  |  |  | title: '自定义列', | 
|---|
|  |  |  | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetBllBoxInfoList&ColsSysArr='+TotalColsSysArr, | 
|---|
|  |  |  | content: '../SystemSettings/HeaderSetting.html?Href=BllAsn/GetBllBoxInfoList&ColsSysArr=' + TotalColsSysArr, | 
|---|
|  |  |  | maxmin: false, | 
|---|
|  |  |  | resize: false, | 
|---|
|  |  |  | area: ['970px', '650px'] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | $('.layui-btn').on('click', function() { | 
|---|
|  |  |  | $('.layui-btn').on('click', function () { | 
|---|
|  |  |  | var type = $(this).data('type'); | 
|---|
|  |  |  | active[type] ? active[type].call(this) : ''; | 
|---|
|  |  |  | }); | 
|---|