| | |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'orderNo', title: '单据编号', templet: '#orderNoTpl'}, |
| | | // {type: 'numbers'}, |
| | | {field: 'itemName', align: 'center', title: '组货单号'}, |
| | | {field: 'cstmrName', align: 'center', title: '客户名称'}, |
| | | {field: 'orderNo', title: '流水号', templet: '#orderNoTpl'}, |
| | | {field: 'docType$', align: 'center', title: '类型', minWidth: 160, width: 160}, |
| | | {field: 'tkType', align: 'center', title: 'TK', minWidth: 160, width: 160,hide: true}, |
| | | {align: 'center', title: '明细', toolbar: '#tbLook', minWidth: 160, width: 160}, |
| | | {field: 'createTime$', title: '创建时间', minWidth: 200, width: 200}, |
| | | {field: 'settle$', align: 'center', title: '状态', templet: '#settleTpl', minWidth: 160, width: 160}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: true}, |
| | | {field: 'memo', align: 'center',title: '备注', hide: false}, |
| | | {align: 'center', title: '操作', toolbar: '#operate'} |
| | | ]], |
| | | request: { |
| | |
| | | priReduce(data.id); |
| | | } else if (layEvent === 'del') { |
| | | doDel(data.id); |
| | | } else if (layEvent === 'complete') {//转实际组货单 |
| | | } else if (layEvent === 'inspection') { |
| | | doModify(data.id, data.orderNo, 12); |
| | | } else if (layEvent === 'abandoned') { |
| | | doAbandoned(data.id); |
| | | } else if (layEvent === 'complete') { |
| | | doModify(data.id, data.orderNo, 11); |
| | | } else if (layEvent === 'look') { |
| | | var $a = $(obj.tr).find('a[lay-event="look"]'); |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '1020px', |
| | | offset: [top + 'px', (left - 530 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/order/pakout/orderDetl/list/auth', |
| | | where: { |
| | | order_id: data.id |
| | | }, |
| | | page: true, |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | | {field: 'matnr', title: '规格', width: 160}, |
| | | // {field: 'maktx', title: '商品名称', width: 160}, |
| | | {field: 'batch', align: 'center', title: '箱号', width: 160}, |
| | | {field: 'model', align: 'center',title: '卷号', width: 160}, |
| | | // {field: 'anfme', align: 'center', title: '数量'}, |
| | | // {field: 'workQty', title: '作业数量'}, |
| | | |
| | | // {field: 'unit', title: '单位'}, |
| | | // { |
| | | // field: 'createTime$', title: '创建时间', sort: true, templet: function (d) { |
| | | // return util.toDateString(d.createTime); |
| | | // }, width: 180 |
| | | // }, |
| | | // {field: 'inQty', title: '已入库量'}, |
| | | // {field: 'color', title: '颜色'}, |
| | | // {field: 'specs', align: 'center', title: '接头'}, |
| | | {field: 'danger$', align: 'center', title: '待判', width: 80}, |
| | | {field: 'manu', title: '货位', align: 'center', width: 100}, |
| | | {field: 'memo', align: 'center', title: '备注'}, |
| | | {field: 'status$', align: 'center', title: '状态', style: 'font-weight: bold'}, |
| | | // {field: 'source$', align: 'center', title: '是否确认', style: 'font-weight: bold'} |
| | | ]], |
| | | request: { |
| | | pageName: 'curr', |
| | | pageSize: 'limit' |
| | | }, |
| | | parseData: function (res) { |
| | | return { |
| | | 'code': res.code, |
| | | 'msg': res.msg, |
| | | 'count': res.data.total, |
| | | 'data': res.data.records |
| | | } |
| | | }, |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: function () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | }) |
| | | }); |
| | | } |
| | | function doAbandoned(orderId) { |
| | | layer.confirm('确定要废弃计划组货单吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/order/pakout/order/abandoned/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | orderId: orderId |
| | | }, |
| | | 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 doModify(orderId, orderNo, settle) { |
| | | layer.confirm('确定要生成实际组货单,同一个组货单号,只能存在一个实际组货单,谨慎操作!!!', { |
| | | layer.confirm('符合出库条件货物将直接出库!!!谨慎操作!!!', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |