|  |  |  | 
|---|
|  |  |  | where: {order_id: 9999999999}, | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'checkbox'} | 
|---|
|  |  |  | ,{type: 'numbers', title: '#'} | 
|---|
|  |  |  | ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl', width: 160} | 
|---|
|  |  |  | ,{field: 'orderNo', align: 'center',title: '单据编号', templet: '#orderNoTpl'} | 
|---|
|  |  |  | ,{field: 'locNo', align: 'center',title: '库位'} | 
|---|
|  |  |  | ,{field: 'matnr', align: 'center',title: '商品编码', width: 160} | 
|---|
|  |  |  | ,{field: 'maktx', align: 'center',title: '商品名称', width: 200} | 
|---|
|  |  |  | 
|---|
|  |  |  | // ,{field: 'itemNum', align: 'center',title: '品项数'} | 
|---|
|  |  |  | // ,{field: 'count', align: 'center',title: '数量'} | 
|---|
|  |  |  | // ,{field: 'weight', align: 'center',title: '重量'} | 
|---|
|  |  |  | ,{field: 'profit$', align: 'center',title: '盈亏',templet: '#profitTpl'} | 
|---|
|  |  |  | ,{field: 'status$', align: 'center',title: '状态'} | 
|---|
|  |  |  | // ,{field: 'createBy$', align: 'center',title: '添加人员'} | 
|---|
|  |  |  | // ,{field: 'createTime$', align: 'center',title: '添加时间'} | 
|---|
|  |  |  | 
|---|
|  |  |  | $('#showFormBtn').on('click', function () { | 
|---|
|  |  |  | // 弹框内容 | 
|---|
|  |  |  | var content = ` | 
|---|
|  |  |  | <form class="layui-form" id="billForm" style="padding: 20px;"> | 
|---|
|  |  |  | <div class="layui-form-item" style="margin-bottom: 20px;"> | 
|---|
|  |  |  | <label class="layui-form-label" style="width: 80px; font-size: 14px; text-align: left">单据编号:</label> | 
|---|
|  |  |  | <div class="layui-input-block" style="margin-left: 110px;"> | 
|---|
|  |  |  | <input type="text" id="billNumber" class="layui-input" placeholder="请输入单据编号" style="height: 38px; font-size: 14px; padding: 0 15px; width: 100%;" required> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <form class="layui-form" id="billForm" style="padding: 20px;"> | 
|---|
|  |  |  | <div class="layui-form-item" style="margin-bottom: 20px;"> | 
|---|
|  |  |  | <label class="layui-form-label" style="width: 80px; font-size: 14px;">库区:</label> | 
|---|
|  |  |  | <div class="layui-input-block" style="margin-left: 110px;"> | 
|---|
|  |  |  | 
|---|
|  |  |  | var billNumber = $('#billNumber').val(); | 
|---|
|  |  |  | var warehouseArea = $('#warehouseArea').val(); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 表单验证 | 
|---|
|  |  |  | if (!billNumber) { | 
|---|
|  |  |  | layer.msg('请输入单据编号'); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | console.log(111) | 
|---|
|  |  |  | console.log(billNumber) | 
|---|
|  |  |  | // 发送 Ajax 请求到后端 | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl+"/inventoryCheckOrder/add/auth", // 替换为你的后端接口地址 | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | contentType: 'application/json;charset=UTF-8', | 
|---|
|  |  |  | method: 'POST', | 
|---|
|  |  |  | data: JSON.stringify({ orderNo: billNumber,area: warehouseArea }), | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | if (res.code === 200){ | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 1}); | 
|---|
|  |  |  | } else if (res.code === 403){ | 
|---|
|  |  |  | top.location.href = baseUrl+"/"; | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | error: function () { | 
|---|
|  |  |  | layer.msg('请求失败'); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 表格2头工具栏点击事件 */ | 
|---|
|  |  |  | table.on('toolbar(orderDetlTable)', function (obj) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // console.log(obj.config.where.order_id); | 
|---|
|  |  |  | var checkStatus = table.checkStatus(obj.config.id).data; | 
|---|
|  |  |  | if (obj.event === 'pakoutPreview') { // 添加 | 
|---|
|  |  |  | if (checkStatus.length === 0) { | 
|---|
|  |  |  | 
|---|
|  |  |  | return d.id; | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | doDelSensor({ids: ids}); | 
|---|
|  |  |  | } else if (obj.event === 'submitERP') { // 提交erp | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/mobile/checkOut/submit/auth", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | // contentType: 'application/json;charset=UTF-8', | 
|---|
|  |  |  | data: { | 
|---|
|  |  |  | orderId: obj.config.where.order_id | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | method: 'GET', | 
|---|
|  |  |  | success: function (res) { | 
|---|
|  |  |  | notice.destroy(); | 
|---|
|  |  |  | if (res.code === 200) { | 
|---|
|  |  |  | 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 { | 
|---|
|  |  |  | layer.msg(res.msg, {icon: 2}) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /* 表格2工具条点击事件 */ | 
|---|
|  |  |  | 
|---|
|  |  |  | function pakoutPreview(ids) { | 
|---|
|  |  |  | let loadIndex = layer.load(2); | 
|---|
|  |  |  | $.ajax({ | 
|---|
|  |  |  | url: baseUrl + "/out/pakout/preview/auth", | 
|---|
|  |  |  | url: baseUrl + "/out/pakout/preview/auth/sxk", | 
|---|
|  |  |  | headers: {'token': localStorage.getItem('token')}, | 
|---|
|  |  |  | contentType: 'application/json;charset=UTF-8', | 
|---|
|  |  |  | data: JSON.stringify(ids), | 
|---|