| | |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl'}, |
| | | {field: 'po', title: '单据编号', templet: '#orderNoTpl'}, |
| | | {field: 'docType$', align: 'center', title: '类型', minWidth: 160, width: 160}, |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200}, |
| | |
| | | } else if (layEvent === 'del') { |
| | | doDel(data.id); |
| | | } else if (layEvent === 'complete') { |
| | | doModify(data.id, data.orderNo, 4); |
| | | doModify(data.id, data.orderNo, 6); |
| | | } else if (layEvent === 'continueExecution') { |
| | | doModify99(data.id, data.orderNo, 99); |
| | | } else if (layEvent === 'look') { |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '商品编码', width: 160}, |
| | | {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'specs', title: '规格'}, |
| | | {field: 'batch', title: '批号'}, |
| | | {field: 'anfme', title: '待完结数量'}, |
| | | {field: 'qty', title: '待上报数量', style: 'font-weight: bold'}, |
| | | {field: 'workQty', title: '已上报数量'}, |
| | | {field: 'matnr', title: 'sku', width: 160}, |
| | | {field: 'maktx', title: '名称', width: 80}, |
| | | {field: 'supp', title: 'po'}, |
| | | {field: 'sku', title: 'upc'}, |
| | | {field: 'anfme', title: '数量', width: 80}, |
| | | {field: 'qty', title: '上报数量', style: 'font-weight: bold'}, |
| | | {field: 'workQty', title: '历史上报数量'}, |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | |
| | | |
| | | // 修改订单状态 |
| | | function doModify(orderId, orderNo, settle) { |
| | | layer.confirm('确定要手动完结吗?', { |
| | | layer.confirm('确定要彻底结束单据吗?(将转为历史档案)', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | console.log(orderId); |
| | | console.log(settle); |
| | | $.ajax({ |
| | | url: baseUrl+"/order/update/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | id: orderId, |
| | | orderNo: orderNo, |
| | | settle: settle |
| | | }, |
| | | method: 'POST', |
| | | success: function (res) { |
| | | layer.closeAll('loading'); |
| | | if (res.code === 200){ |
| | | if (insTbCount === 0) { |
| | | insTb.reload({page: {curr: 1}}); |
| | | } else { |
| | | $(".layui-laypage-btn")[0].click(); |
| | | } |
| | | layer.msg(res.msg, {icon: 1}); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | }else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | } |
| | | |
| | | // 修改订单状态 |
| | | function doModify99(orderId, orderNo, settle) { |
| | | layer.confirm('确定要继续执行吗?(会将未执行数量重新生成执行单据)', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | |
| | | var traceCharts = echarts.init(document.getElementById('wrkTraceCharts')); |
| | | var traceOptions = { |
| | | title: { |
| | | text: '作业/完结/上报', x: 'center', y: '38%', |
| | | text: '总量/待上报/已上报', x: 'center', y: '38%', |
| | | textStyle: {fontSize: 18, color: '#262626', fontWeight: 'normal'}, |
| | | subtextStyle: {fontSize: 36, color: '#10B4E8'}, |
| | | itemGap: 20 |
| | |
| | | // 赋值 |
| | | traceCharts.setOption({ |
| | | title: { |
| | | subtext: res.data.totalQty+"/"+res.data.wrkQty+"/"+res.data.endQty |
| | | subtext: res.data.totalQty+"/"+res.data.endQty+"/"+res.data.wrkQty |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [ |
| | | {name: '已作业', value: res.data.wrkQty}, |
| | | {name: '未作业', value: res.data.totalQty-res.data.wrkQty-res.data.lackQty}, |
| | | {name: '已作业', value: res.data.wrkQty+res.data.endQty}, |
| | | {name: '未作业', value: res.data.totalQty-res.data.wrkQty-res.data.endQty-res.data.lackQty}, |
| | | {name: '库存不足', value: res.data.lackQty}, |
| | | ] |
| | | } |