| | |
| | | // cols.push.apply(cols, detlCols); |
| | | cols.push({field: 'modiUser$', align: 'center',title: '修改人员',hide: true} |
| | | ,{field: 'modiTime$', align: 'center',title: '修改时间'} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:100} |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:160} |
| | | |
| | | ) |
| | | return cols; |
| | |
| | | } |
| | | }); |
| | | break; |
| | | case 'edit': |
| | | case 'inspection': |
| | | var model = top.reObject(data).model; |
| | | if (model === undefined) { |
| | | layer.msg("无数据"); |
| | | } |
| | | this.$confirm( |
| | | '确认向MES校准是否合格?', |
| | | '确认修改', |
| | | { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | dangerouslyUseHTMLString: true |
| | | } |
| | | ).then(() => { |
| | | // 调用后台API上报数据 |
| | | layer.confirm('确认向MES校准是否合格', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | $.ajax({ |
| | | url: baseUrl + "/actual/shipment/locDetl/report/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | |
| | | model: model // 传递组货单号 |
| | | }, |
| | | method: 'POST', |
| | | success: (res) => { |
| | | this.reportLoading = false; |
| | | if (typeof done === 'function') { |
| | | done(); |
| | | 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}); |
| | | } |
| | | if (res.code === 200 || res.success) { |
| | | this.$message({ |
| | | message: `组货单号 ${groupOrderNo} 上报成功`, |
| | | type: 'success', |
| | | duration: 3000 |
| | | }); |
| | | // 上报成功后关闭弹窗并刷新数据 |
| | | setTimeout(() => { |
| | | this.closeDetailDialog(); |
| | | this.getTableDataA(); // 刷新主表数据 |
| | | }, 1500); |
| | | } else { |
| | | this.$message.error(res.message || '上报失败'); |
| | | } |
| | | }, |
| | | error: (error) => { |
| | | this.reportLoading = false; |
| | | if (typeof done === 'function') { |
| | | done(); |
| | | } |
| | | console.error('上报失败:', error); |
| | | this.$message.error('上报失败,请检查网络连接'); |
| | | } |
| | | }); |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消修改' |
| | | }); |
| | | }) |
| | | }); |
| | | break; |
| | | case 'locNo': |
| | |
| | | }) |
| | | } |
| | | |
| | | // 同步库存至MES |
| | | form.on('submit(synchronize)', function (data) { |
| | | layer.confirm('确认向MES同步库存?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | $.ajax({ |
| | | url: baseUrl + "/synchronize/mes/locDetl/report/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | 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}); |
| | | } |
| | | } |
| | | }) |
| | | }); |
| | | }); |
| | | |
| | | // 复选框事件 |
| | | form.on('checkbox(detailCheckbox)', function (data) { |
| | | var el = data.elem; |