From e0fac38b26845f25de479783e0c76cf12a5311e0 Mon Sep 17 00:00:00 2001 From: cl <418351270@qq.com> Date: 星期五, 19 一月 2024 10:31:28 +0800 Subject: [PATCH] 修改数据采集 --- guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js | 58 +++++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 45 insertions(+), 13 deletions(-) diff --git a/guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js b/guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js index 6f2896d..f5b7be0 100644 --- a/guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js +++ b/guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js @@ -127,17 +127,19 @@ */ MaterialShortage.initColumn = function () { return [[ - {type: 'numbers'}, + {type: 'checkbox', fixed: 'left'}, + {field: 'id', hide: true, title: 'ID'}, - {field: 'workOrderNo', sort: true, title: '宸ュ崟鍙�', width: 150}, + /* {field: 'workOrderNo', sort: true, title: '宸ュ崟鍙�', width: 150},*/ // {field: 'loadingCode', sort: true, title: '涓婃枡宸ヤ綅', width: 105}, {field: 'locationCode', sort: true, title: '宸ヤ綅缂栧彿', width: 100}, //{field: 'loadingCode', sort: true, title: '鎵爜宸ヤ綅缂栧彿', width: 105}, {field: 'materialCode', sort: true, title: '鐗╂枡缂栫爜', width: 170}, - {field: 'spareField1', sort: true, title: '涓婃枡鏁伴噺'}, - {field: 'spareField2', sort: true, title: '鍗曚綅'}, - {field: 'loadingCode', sort: true, title: '鐗╂枡鎵规',width: 120}, - {field: 'state', sort: true, title: '鏄惁涓婃枡', width: 105,templet: '#stateTpl'}, + {field: 'batch', sort: true, title: '鐗╂枡鎵规',width: 120}, + {field: 'quantity', sort: true, title: '涓婃枡鏁伴噺',width: 120}, + {field: 'residueQuantity', sort: true, title: '鍓╀綑鏁伴噺',width: 120}, + {field: 'unit', sort: true, title: '鍗曚綅'}, + {field: 'status', sort: true, title: '鏄惁涓婃枡', width: 105,templet: '#stateTpl'}, // {field: 'orderStatus', sort: true, title: '鐘舵��',align:'center',width:80,templet: '#orderStatusTpl'}, ]]; @@ -154,10 +156,36 @@ url: Feng.ctxPath + '/productionOrderBatchInfo/boardList', // page: true, height: 345, + toolbar: '#toolbarDemo', cellMinWidth: 80, where:queryData, cols: MaterialShortage.initColumn() }); + } + + // 宸ュ叿鏍忎簨浠� + table.on('toolbar(materialShortageTable)', function(obj){ + var id = obj.config.id; + var checkStatus = table.checkStatus(id); + switch(obj.event){ + case 'getCheckData': + var data = checkStatus.data; + console.log(data.length) + console.log(data) + if(data.length!==1){ + Feng.error("璇锋纭�夋嫨涓�鏉℃暟鎹�") + return + } + resetting(data[0].id) + break; + }; + }); + + function resetting(data){ + var resetting = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/resetting?id=" + data); + var resettingResult = resetting.start(); + initMaterialShortage() + Feng.success("閲嶇疆鎴愬姛") } // 鐢熶骇宸ュ崟璁剧疆鎸夐挳鐐瑰嚮浜嬩欢 @@ -335,14 +363,18 @@ Feng.error("璇疯緭鍏ュ畬鏁撮暱搴︿俊鎭�"); return } - var checkLocationCode = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/checkLocationCode?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()); - var checkLocationCodeResult = checkLocationCode.start(); - if(checkLocationCodeResult.data === 0){ - Feng.error("鏉$爜淇℃伅寮傚父") - return - } - var updateOrderBatchInfo = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/updateOrderBatchInfo?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()+ "&spareField1="+ number + "&loadingCode="+ batch); + // var checkLocationCode = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/checkLocationCode?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()); + // var checkLocationCodeResult = checkLocationCode.start(); + // if(checkLocationCodeResult.data === 0){ + // Feng.error("鏉$爜淇℃伅寮傚父") + // return + // } + var updateOrderBatchInfo = new $ax(Feng.ctxPath + "/productionOrderBatchInfo/updateOrderBatchInfo?materialCode=" + barCode.substring(0, 14) + "&workOrderNo="+ $('#workOrderNo').val()+ "&quantity="+ number + "&batch="+ batch+ "&residueQuantity="+ number); var updateOrderBatchInfoResult = updateOrderBatchInfo.start(); + if(updateOrderBatchInfoResult.data === "0"){ + Feng.error("鎵规涓嶅悓鏃犳硶褰曞叆"); + return; + } Feng.success("褰曞叆鎴愬姛") clean() initMaterialShortage() -- Gitblit v1.9.3