From 1b72fc0dd1d7004de54ab0886e0323cb1b96198d Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期三, 10 一月 2024 16:38:53 +0800
Subject: [PATCH] 批次上料

---
 guns-vip-main/src/main/webapp/assets/modular/kb/materialRegistration/materialRegistration.js |   44 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 37 insertions(+), 7 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..b1da3de 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,7 +127,7 @@
      */
     MaterialShortage.initColumn = function () {
         return [[
-            {type: 'numbers'},
+            {type: 'checkbox', fixed: 'left'},
             {field: 'id', hide: true, title: 'ID'},
             {field: 'workOrderNo', sort: true, title: '宸ュ崟鍙�', width: 150},
             // {field: 'loadingCode', sort: true, title: '涓婃枡宸ヤ綅', width: 105},
@@ -154,10 +154,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 +361,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 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 updateOrderBatchInfoResult = updateOrderBatchInfo.start();
+        if(updateOrderBatchInfoResult.data === "0"){
+            Feng.error("鎵规涓嶅悓鏃犳硶褰曞叆");
+            return;
+        }
         Feng.success("褰曞叆鎴愬姛")
         clean()
         initMaterialShortage()

--
Gitblit v1.9.3