|  |  |  | 
|---|
|  |  |  | btnPrint(data.id, data.orderNo, 4); | 
|---|
|  |  |  | } else if (layEvent === 'manPrint') { | 
|---|
|  |  |  | addPakOut(data.orderNo); | 
|---|
|  |  |  | }else if (layEvent === 'examine') { | 
|---|
|  |  |  | examine(data); | 
|---|
|  |  |  | }else if (layEvent === 'look') { | 
|---|
|  |  |  | var $a = $(obj.tr).find('a[lay-event="look"]'); | 
|---|
|  |  |  | var offset = $a.offset(); | 
|---|
|  |  |  | 
|---|
|  |  |  | cols: [[   //工具条明细 | 
|---|
|  |  |  | {type: 'numbers'}, | 
|---|
|  |  |  | {field: 'matnr', title: '商品编码', width: 160}, | 
|---|
|  |  |  | {field: 'maktx', title: '商品名称', width: 160}, | 
|---|
|  |  |  | {field: 'maktx', title: '商品名称'}, | 
|---|
|  |  |  | {field: 'locNo', title: '库位号'}, | 
|---|
|  |  |  | {field: 'batch', title: '批次'}, | 
|---|
|  |  |  | {field: 'anfme', title: '数量'}, | 
|---|
|  |  |  | {field: 'realAnfme', title: '真实数量',style: 'color: blue;font-weight: bold', edit: true}, | 
|---|
|  |  |  | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, | 
|---|
|  |  |  | {field: 'type$', title: '状态'}, | 
|---|
|  |  |  | {field: 'owner$', title: '货主'}, | 
|---|
|  |  |  | {field: 'payment$', title: '货物状态'}, | 
|---|
|  |  |  | {align: 'center', title: '操作', toolbar: '#formSSXMTableBar3', minWidth: 80, width: 80, fixed: 'right'} | 
|---|
|  |  |  | {field: 'type$', title: '状态'} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | request: { | 
|---|
|  |  |  | pageName: 'curr', | 
|---|
|  |  |  | 
|---|
|  |  |  | printExcel(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | //单据明细表 审核按钮 | 
|---|
|  |  |  | table.on('tool(lookSSXMTable)', function (obj) { | 
|---|
|  |  |  | var data = obj.data; | 
|---|
|  |  |  | var layEvent = obj.event; | 
|---|
|  |  |  | if (layEvent === 'examine') { | 
|---|
|  |  |  | examine(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // //单据明细表 审核按钮 | 
|---|
|  |  |  | // table.on('tool(lookSSXMTable)', function (obj) { | 
|---|
|  |  |  | //     var data = obj.data; | 
|---|
|  |  |  | //     var layEvent = obj.event; | 
|---|
|  |  |  | //     if (layEvent === 'examine') { | 
|---|
|  |  |  | //         examine(data); | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function showWrkTrace(orderId) { | 
|---|
|  |  |  | console.log(orderId); | 
|---|
|  |  |  | 
|---|
|  |  |  | layer.close(dIndex); | 
|---|
|  |  |  | $(".layui-laypage-btn")[0].click(); | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | insTb.reload(); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | 
|---|
|  |  |  | {field: 'matnr', title: '商品编码', width: 160}, | 
|---|
|  |  |  | {field: 'maktx', title: '商品名称', width: 160}, | 
|---|
|  |  |  | {field: 'locNo', title: '库位号'}, | 
|---|
|  |  |  | {field: 'owner$', title: '货主'}, | 
|---|
|  |  |  | {field: 'payment$', title: '货物状态'}, | 
|---|
|  |  |  | {field: 'anfme', title: '库存数量'}, | 
|---|
|  |  |  | {field: 'realAnfme', title: '真实数量'}, | 
|---|
|  |  |  | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, | 
|---|
|  |  |  | {field: 'type$', title: '状态'}, | 
|---|
|  |  |  | {field: 'type$', title: '状态'} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | {align: 'center', title: '操作', toolbar: '#formSSXMTableBarr', minWidth: 80, width: 80, fixed: 'right'} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | done: function (res) { | 
|---|
|  |  |  | $(layero).find('.layui-table-view').css('margin', '0'); | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function examine(data){ | 
|---|
|  |  |  | console.log(data) | 
|---|
|  |  |  | layer.confirm('请确定真实数量以及差异数量!', { | 
|---|
|  |  |  | shade: .1, | 
|---|
|  |  |  | skin: 'layui-layer-admin' | 
|---|
|  |  |  | }, function (i) { | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/orderCheck/mxamine", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | contentType:'application/json;charset=UTF-8', | 
|---|
|  |  |  | data: JSON.stringify(data), | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | async: false, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.msg(res.msg); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | layer.msg(res.msg); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // function examine(data){ | 
|---|
|  |  |  | //     console.log(data) | 
|---|
|  |  |  | //     layer.confirm('请确定真实数量以及差异数量!', { | 
|---|
|  |  |  | //         shade: .1, | 
|---|
|  |  |  | //         skin: 'layui-layer-admin' | 
|---|
|  |  |  | //     }, function (i) { | 
|---|
|  |  |  | //         $.ajax({ | 
|---|
|  |  |  | //             url: baseUrl + "/orderCheck/mxamine", | 
|---|
|  |  |  | //             headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | //             contentType:'application/json;charset=UTF-8', | 
|---|
|  |  |  | //             data: JSON.stringify(data), | 
|---|
|  |  |  | //             method: 'POST', | 
|---|
|  |  |  | //             async: false, | 
|---|
|  |  |  | //             success: function (res) { | 
|---|
|  |  |  | //                 if (res.code === 200){ | 
|---|
|  |  |  | //                     layer.msg(res.msg); | 
|---|
|  |  |  | //                 }else { | 
|---|
|  |  |  | //                     layer.msg(res.msg); | 
|---|
|  |  |  | //                 } | 
|---|
|  |  |  | //             } | 
|---|
|  |  |  | //         }); | 
|---|
|  |  |  | // | 
|---|
|  |  |  | // | 
|---|
|  |  |  | //     }); | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 页面修改 | 
|---|
|  |  |  | table.on('edit(lookSSXMTable)', function (obj) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | function examine(expTpe) { | 
|---|
|  |  |  | admin.open({ | 
|---|
|  |  |  | type: 1, | 
|---|
|  |  |  | title: '审核盘点单', | 
|---|
|  |  |  | content: $('#editDialog2').html(), | 
|---|
|  |  |  | area: '1300px', | 
|---|
|  |  |  | success: function (layero, dIndex) { | 
|---|
|  |  |  | $(layero).children('.layui-layer-content').css('overflow', 'visible'); | 
|---|
|  |  |  | var isExpAdd = !expTpe; | 
|---|
|  |  |  | // 回显数据 | 
|---|
|  |  |  | form.val('editForm2', expTpe); | 
|---|
|  |  |  | if (expTpe) { | 
|---|
|  |  |  | $('#orderNo').attr("disabled", "disabled"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 表单提交事件 | 
|---|
|  |  |  | form.on('submit(examine)', function (data) { | 
|---|
|  |  |  | let nList = admin.util.deepClone(xxDataList); | 
|---|
|  |  |  | layer.load(2); | 
|---|
|  |  |  | console.log(data); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/orderCheck/examine", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | data: JSON.stringify({ | 
|---|
|  |  |  | orderNo: data.field.orderNo, | 
|---|
|  |  |  | list: nList | 
|---|
|  |  |  | }), | 
|---|
|  |  |  | contentType: 'application/json;charset=UTF-8', | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | layer.closeAll('loading'); | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | layer.close(dIndex); | 
|---|
|  |  |  | $(".layui-laypage-btn")[0].click(); | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | insTb.reload(); | 
|---|
|  |  |  | } else if (res.code === 403) { | 
|---|
|  |  |  | top.location.href = baseUrl + "/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return false; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | // 明细表格 | 
|---|
|  |  |  | var xxDataList = []; | 
|---|
|  |  |  | var tbOptions = { | 
|---|
|  |  |  | elem: '#formSSXMTable2', | 
|---|
|  |  |  | headers: {token: localStorage.getItem('token')}, | 
|---|
|  |  |  | data: xxDataList, | 
|---|
|  |  |  | page: true, | 
|---|
|  |  |  | height: '350px;', | 
|---|
|  |  |  | cellMinWidth: 100, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'numbers'}, | 
|---|
|  |  |  | {field: 'matnr', title: '商品编码', width: 160}, | 
|---|
|  |  |  | {field: 'maktx', title: '商品名称', width: 160}, | 
|---|
|  |  |  | {field: 'locNo', title: '库位号'}, | 
|---|
|  |  |  | {field: 'anfme', title: '库存数量'}, | 
|---|
|  |  |  | {field: 'realAnfme', title: '真实数量'}, | 
|---|
|  |  |  | {field: 'diffAnfme', title: '差异数量', style: 'font-weight: bold'}, | 
|---|
|  |  |  | {field: 'type$', title: '状态'} | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ]], | 
|---|
|  |  |  | done: function (res) { | 
|---|
|  |  |  | $(layero).find('.layui-table-view').css('margin', '0'); | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | size: '' | 
|---|
|  |  |  | }; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!isExpAdd) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/orderCheck/detl/all/auth?orderNo=" + expTpe.orderNo, | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | method: 'GET', | 
|---|
|  |  |  | async: false, | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | console.log(res.data); | 
|---|
|  |  |  | xxDataList = res.data; | 
|---|
|  |  |  | tbOptions.data = xxDataList; | 
|---|
|  |  |  | } else if (res.code === 403) { | 
|---|
|  |  |  | top.location.href = baseUrl + "/"; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | var insTbSSXM = table.render(tbOptions); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|