| | |
| | | showEditModel(data); |
| | | }else if (layEvent === 'createTask') { |
| | | pakoutPreview(data.id); |
| | | }else if (layEvent === 'createAdjust') { |
| | | createAdjust(data.id); |
| | | }else if (layEvent === 'export') { |
| | | export1(data.id); |
| | | }else if (layEvent === 'del') { |
| | |
| | | var offset = $a.offset(); |
| | | var top = offset.top; |
| | | var left = offset.left; |
| | | layer.open({ |
| | | admin.open({ |
| | | type: 1, |
| | | title: false, |
| | | area: '1000px', |
| | | offset: [top + 'px', (left - 700 + $a.outerWidth()) + 'px'], |
| | | shade: .01, |
| | | shadeClose: true, |
| | | fixed: false, |
| | | content: '<table id="lookSSXMTable" lay-filter="lookSSXMTable"></table>', |
| | | success: function (layero) { |
| | | title: '单据明细', |
| | | height: '450px', |
| | | content: $('#orderItem').html(), |
| | | area: '78%', |
| | | success: function (layero, dIndex) { |
| | | table.render({ |
| | | elem: '#lookSSXMTable', |
| | | headers: {token: localStorage.getItem('token')}, |
| | | url: baseUrl+'/checkOrderDetl/list/auth', |
| | | elem: '#itemTable', |
| | | headers: { token: localStorage.getItem('token') }, |
| | | url: baseUrl + '/checkOrderDetl/list/auth', |
| | | where: { |
| | | order_id: data.id |
| | | }, |
| | | page: true, |
| | | height: '450px;', |
| | | cellMinWidth: 100, |
| | | cols: [[ |
| | | {type: 'numbers'}, |
| | |
| | | {field: 'anfme', title: '数量'}, |
| | | {field: 'workQty', title: '盘点数量'}, |
| | | {field: 'diffQty', title: '差异数量', style: 'font-weight: bold'}, |
| | | // {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', title: '规格'}, |
| | | {field: 'status$', title: '状态'} |
| | | ]], |
| | |
| | | response: { |
| | | statusCode: 200 |
| | | }, |
| | | done: (res) => { |
| | | if(res.code == 403){ |
| | | window.top.location.href = baseUrl+"/"; |
| | | } |
| | | done: function () { |
| | | $(layero).find('.layui-table-view').css('margin', '0'); |
| | | }, |
| | | size: '' |
| | |
| | | var isDuplicate = false; |
| | | for (var j = 0; j < xxDataList.length; j++) { |
| | | if (xxDataList[j].locNo === data[i].locNo && xxDataList[j].matnr === data[i].matnr && xxDataList[j].batch === data[i].batch) { |
| | | isDuplicate = true; |
| | | duplicateCount++; |
| | | break; |
| | | if (xxDataList[j].diffQty !== 0){ |
| | | isDuplicate = true; |
| | | duplicateCount++; |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | if (data[j].diffQty !== 0){ |
| | | isDuplicate = true; |
| | | duplicateCount++; |
| | | } |
| | | // 如果不重复,则添加到列表 |
| | | if (!isDuplicate) { |
| | |
| | | insTbSSXM.reload({data: xxDataList, page: {curr: 1}}); |
| | | // 提示添加结果 |
| | | if (duplicateCount > 0) { |
| | | layer.msg('成功添加 ' + addedCount + ' 条数据,' + duplicateCount + ' 条重复数据已忽略', {icon: 1}); |
| | | layer.msg('成功添加 ' + addedCount + ' 条数据,' + duplicateCount + ' 条数据已忽略', {icon: 1}); |
| | | } else if (addedCount > 0) { |
| | | layer.msg('成功添加 ' + addedCount + ' 条数据', {icon: 1}); |
| | | } |
| | |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/checkOrder/complete/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 createAdjust(orderId) { |
| | | layer.confirm('确定要生成调整单吗?', { |
| | | shade: .1, |
| | | skin: 'layui-layer-admin' |
| | | }, function (i) { |
| | | layer.close(i); |
| | | layer.load(2); |
| | | $.ajax({ |
| | | url: baseUrl+"/adjustOrder/create/test", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | orderId: orderId |
| | |
| | | layer.close(layerIndex); |
| | | layer.msg(res.msg, {icon: 1}); |
| | | insTb.reload({where: null}); |
| | | insTb2.reload({where: null, page: {curr: 1}}); |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/"; |
| | | } else { |