|  |  | 
 |  |  |         cellMinWidth: 50, | 
 |  |  |         toolbar: '#toolbar', | 
 |  |  |         cols: [[ | 
 |  |  |             {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'}, | 
 |  |  |             {field: 'anfme', align: 'center',title: '数量'}, | 
 |  |  |             {field: 'matNo', align: 'center', title: '物料编码'}, | 
 |  |  |             {field: 'barcode', align: 'center', title: '条码'}, | 
 |  |  |             {field: 'matName', align: 'center', title: '物料名称'}, | 
 |  |  |             {field: 'str1', align: 'center', title: '物料单位'}, | 
 |  |  |             {field: 'str2', align: 'center', title: '物料规格'}, | 
 |  |  |             {fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80} | 
 |  |  |             {fixed: 'left', field: 'count', title: '实际数量', align: 'center', edit:'text', width: 120,  style:'color: blue;font-weight: bold'} | 
 |  |  |             ,{field: 'anfme', align: 'center',title: '数量'} | 
 |  |  |             ,{field: 'matnr', align: 'center',title: '物料'} | 
 |  |  |             // ,{field: 'lgnum', align: 'center',title: '仓库号'} | 
 |  |  |             // ,{field: 'tbnum', align: 'center',title: '转储请求编号'} | 
 |  |  |             // ,{field: 'tbpos', align: 'center',title: '行项目'} | 
 |  |  |             // ,{field: 'zmatid', align: 'center',title: '物料标签ID'} | 
 |  |  |             ,{field: 'maktx', align: 'center',title: '物料描述'} | 
 |  |  |             // ,{field: 'werks', align: 'center',title: '工厂'} | 
 |  |  |             ,{field: 'altme', align: 'center',title: '单位'} | 
 |  |  |             ,{field: 'zpallet', align: 'center',title: '托盘条码'} | 
 |  |  |             // ,{field: 'bname', align: 'center',title: '用户ID'} | 
 |  |  |             ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:80} | 
 |  |  |         ]], | 
 |  |  |         done: function (res, curr, count) { | 
 |  |  |             limit(); | 
 |  |  | 
 |  |  |  | 
 |  |  |     // 页面修改 | 
 |  |  |     table.on('edit(chooseData)', function (obj) { | 
 |  |  |         updateMatCodeData(obj.data.matNo, Number(obj.value)); | 
 |  |  |         updateMatCodeData(obj.data.matnr, Number(obj.value)); | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 监听头工具栏事件 | 
 |  |  | 
 |  |  |                 } | 
 |  |  |                 layer.confirm('确定调整'+currLocNo+'库位的明细吗?', {shadeClose: true}, function(){ | 
 |  |  |                     $.ajax({ | 
 |  |  |                         url: baseUrl+"/full/store/put/start", | 
 |  |  |                         url: baseUrl+"/locDdetl/adjust/start", | 
 |  |  |                         headers: {'token': localStorage.getItem('token')}, | 
 |  |  |                         data: JSON.stringify({ | 
 |  |  |                             devpNo: $('#putSiteSelect').val(), | 
 |  |  |                             locNo: currLocNo, | 
 |  |  |                             list: matCodeData | 
 |  |  |                         }), | 
 |  |  |                         contentType:'application/json;charset=UTF-8', | 
 |  |  | 
 |  |  |                         async: false, | 
 |  |  |                         success: function (res) { | 
 |  |  |                             if (res.code === 200){ | 
 |  |  |                                 layer.msg("入库启动成功,目标库位:" + res.data); | 
 |  |  |                                 matCodeData = []; | 
 |  |  |                                 tableIns.reload({data: matCodeData,done:function (res) { limit(); getInBound();}}); | 
 |  |  |                                 layer.msg(currLocNo + res.msg); | 
 |  |  |                                 init(currLocNo) | 
 |  |  |                             } else if (res.code === 403){ | 
 |  |  |                                 top.location.href = baseUrl+"/"; | 
 |  |  |                             }else { | 
 |  |  | 
 |  |  |         switch (obj.event) { | 
 |  |  |             case 'remove': | 
 |  |  |                 for (var i = matCodeData.length - 1; i >= 0; i--) { | 
 |  |  |                     if (matCodeData[i].matNo === data.matNo) { | 
 |  |  |                     if (matCodeData[i].matnr === data.matnr) { | 
 |  |  |                         matCodeData.splice(i, 1); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  | 
 |  |  |             layer.msg("请输入库位号"); | 
 |  |  |             return; | 
 |  |  |         } | 
 |  |  |         http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) { | 
 |  |  |             matCodeData = []; | 
 |  |  |             let data = res.data.records; | 
 |  |  |             for (var i = 0; i<data.length; i++) { | 
 |  |  |                 matCodeData.push({ | 
 |  |  |                     count: data[i].anfme, | 
 |  |  |                     anfme: data[i].anfme, | 
 |  |  |                     matNo: data[i].matnr, | 
 |  |  |                     matName: data[i].maktx, | 
 |  |  |  | 
 |  |  |                 }) | 
 |  |  |             } | 
 |  |  |             locTips(true, locNo); | 
 |  |  |             tableReload(); | 
 |  |  |         }) | 
 |  |  |         init(locNo); | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     // 重置事件 | 
 |  |  |     form.on('submit(reset)', function (data) { | 
 |  |  |         reset(); | 
 |  |  |     }); | 
 |  |  |  | 
 |  |  |     function init(locNo) { | 
 |  |  |         http.post(baseUrl + "/locDetl/list/auth", {locNo: locNo,limit: 1000}, function (res) { | 
 |  |  |             matCodeData = []; | 
 |  |  |             let data = res.data.records; | 
 |  |  |             for (var i = 0; i<data.length; i++) { | 
 |  |  |                 data[i]["count"] = data[i].anfme; | 
 |  |  |                 data[i]["removeBtn"] = false; | 
 |  |  |                 matCodeData.push(data[i]); | 
 |  |  |             } | 
 |  |  |             locTips(true, locNo); | 
 |  |  |             tableReload(); | 
 |  |  |         }) | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     function reset() { | 
 |  |  |         clearFormVal($('#search-box')); | 
 |  |  |         matCodeData = []; | 
 |  |  |         tableReload(); | 
 |  |  |         locTips(false); | 
 |  |  |     }); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     // 重载表格 | 
 |  |  |     function tableReload() { | 
 |  |  | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |     function updateMatCodeData(matNo, count) { | 
 |  |  |     function updateMatCodeData(matnr, count) { | 
 |  |  |         if (isNaN(count)) { | 
 |  |  |             layer.msg("请输入数字"); | 
 |  |  |         } else { | 
 |  |  |             if (count > 0) { | 
 |  |  |             if (count >= 0) { | 
 |  |  |                 for (var i=0;i<matCodeData.length;i++){ | 
 |  |  |                     if (matCodeData[i]["matNo"] === matNo){ | 
 |  |  |                     if (matCodeData[i]["matnr"] === matnr){ | 
 |  |  |                         matCodeData[i]["count"] = count; | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  | 
 |  |  |         el.css("border-color", "#b8b8b8"); | 
 |  |  |     }, 1000); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | // 添加表格数据 | 
 |  |  | function addTableData(data) { | 
 |  |  |     let applyData = []; | 
 |  |  |     for (var i=0;i<data.length;i++){ | 
 |  |  |         let pass = false; | 
 |  |  |         for (var j=0;j<matCodeData.length;j++){ | 
 |  |  |             if (data[i].matNo === matCodeData[j].matnr) { | 
 |  |  |                 pass = true; | 
 |  |  |                 break; | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         if (!pass) { | 
 |  |  |             applyData.push({ | 
 |  |  |                 count: initCountVal, | 
 |  |  |                 anfme: initAnfmeVal, | 
 |  |  |                 removeBtn: true, | 
 |  |  |                 matnr: data[i].matNo, | 
 |  |  |                 maktx: data[i].matName, | 
 |  |  |                 altme: data[i].str1, | 
 |  |  |             }) | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |     matCodeData.push.apply(matCodeData,applyData); | 
 |  |  |     tableIns.reload({data: matCodeData}); | 
 |  |  |     layer.close(matCodeLayerIdx); | 
 |  |  | } |