From cf8ba6b7a9d9f05aa2eaf41ffb2f58c3beb50278 Mon Sep 17 00:00:00 2001
From: 王佳豪 <g675230687@126.com>
Date: 星期五, 07 五月 2021 13:19:32 +0800
Subject: [PATCH] 1.通知出库-平仓出库允许分批出

---
 src/main/webapp/views/pakStore/outStockNormalDetail.html |   43 ++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/src/main/webapp/views/pakStore/outStockNormalDetail.html b/src/main/webapp/views/pakStore/outStockNormalDetail.html
index 937ec75..f845a2d 100644
--- a/src/main/webapp/views/pakStore/outStockNormalDetail.html
+++ b/src/main/webapp/views/pakStore/outStockNormalDetail.html
@@ -33,13 +33,14 @@
     var orderData = parent.getOrderData();
     var locData = [];
     var table;
+    var sourceData = [];
 
     function getCol() {
         var cols = [
             {type: 'checkbox'}
             , {field: 'warehouseName', align: 'center', title: '搴撳尯鍚嶇О'}
             , {field: 'warehouse', align: 'center', title: '搴撲綅缂栧彿'}
-            , {field: 'anfme', align: 'center', title: '鏁伴噺'}
+            , {field: 'anfme', align: 'center', title: '鏁伴噺', edit: 'text'}
         ];
         cols.push.apply(cols, locNormalCols);
         cols.push({field: 'modiUser$', align: 'center', title: '淇敼浜哄憳', hide: true}
@@ -81,14 +82,50 @@
                 if (res.code === 403) {
                     top.location.href = baseUrl + "/";
                 }
-                locData = res.data;
+                if (res.code === 200) {
+                    locData = res.data;
+                    sourceData = [];
+                    if (res.data && res.data.length > 0) {
+                        res.data.map(function (item) {
+                            var obj = {
+                                anfme: item.anfme,
+                                id: item.id,
+                                matnr: item.matnr,
+                                supplier: item.supplier,
+                            }
+                            sourceData.push(obj);
+                        });
+                    }
+                }
+            }
+        });
+
+        // 椤甸潰淇敼
+        table.on('edit(stockOut)', function (obj) {
+            if (obj.field === 'anfme') {
+                if (isNaN(obj.value)) {
+                    layer.msg("璇疯緭鍏ユ暟瀛�");
+                    locDetlTableIns.reload();
+                }
+                // 鍗曞厓鏍肩紪杈戜箣鍓嶇殑鍊艰繘琛屾瘮杈�
+                for (var i = 0; i < sourceData.length; i++) {
+                    if (obj.data.id == sourceData[i].id) {
+                        if (Number(obj.value) > sourceData[i].anfme) {
+                            layer.msg("鏁伴噺涓嶅彲澶т簬搴撳瓨閲�");
+                            locDetlTableIns.reload();
+                        }
+                    }
+                }
+                if (obj.value <= 0) {
+                    layer.msg("鏁伴噺涓嶅彲灏忎簬绛変簬闆�");
+                    locDetlTableIns.reload();
+                }
             }
         });
     });
 
     /* 鍚姩鍑哄簱 */
     function outbound() {
-        locData
         var checkStatus = table.checkStatus('stockOut');
         var checkData = checkStatus.data;
         var obj = {

--
Gitblit v1.9.1