From 91726f605850e37f58ba3446c8765e00add359e6 Mon Sep 17 00:00:00 2001
From: admin <841110950@qq.com>
Date: 星期一, 30 八月 2021 10:16:26 +0800
Subject: [PATCH] 1.0.5

---
 src/main/webapp/static/js/waitMatout/waitMatout.js |   41 +++++++++++++++++------------------------
 1 files changed, 17 insertions(+), 24 deletions(-)

diff --git a/src/main/webapp/static/js/waitMatout/waitMatout.js b/src/main/webapp/static/js/waitMatout/waitMatout.js
index 40a9fbc..8025c27 100644
--- a/src/main/webapp/static/js/waitMatout/waitMatout.js
+++ b/src/main/webapp/static/js/waitMatout/waitMatout.js
@@ -61,7 +61,7 @@
     table.on('tool(waitMatout)', function (obj) {
         var data = obj.data;
         var layEvent = obj.event;
-        console.log(obj)
+        var checkStatus = table.checkStatus(obj.config);
         if (layEvent === 'edit') {
             showEditModel(data);
         } else if (layEvent === 'del') {
@@ -133,23 +133,9 @@
     // 鏄剧ず琛ㄥ崟寮圭獥
     function showEditModel(expTpe) {
 
-        //matOut ajax
-        // var DataList = [];
-        // $.ajax({
-        //     url: baseUrl+"/waitMatout/list/auth2?billNo=" + expTpe.billNo,
-        //     headers: {'token': localStorage.getItem('token')},
-        //     contentType:'application/json;charset=UTF-8',
-        //     method: 'POST',
-        //     success: function (res) {
-        //         console.log(res)
-        //         var list=res.data.records;
-        //         for (let i = 0; i < list.length; i++) {
-        //             DataList.push(list[i]);
-        //         }
-        //     }
-        // })
-        // console.log(DataList)
 
+        var mlist=null
+        var oldQtys=[]
         admin.open({
             type: 1,
             title: (expTpe ? '淇敼' : '娣诲姞') + '鍗曟嵁',
@@ -165,7 +151,6 @@
                 }
                 // 琛ㄥ崟鎻愪氦浜嬩欢
                 form.on('submit(waitMatoutEditSubmit)', function (data) {
-                    console.log(data)
                     // 缁勮鏁版嵁
                     if (xxDataList.length <= 0) {
                         layer.tips('璇锋坊鍔犲崟鎹槑缁�', '#matAddBtnComment', {tips: [1, '#ff4c4c']});
@@ -173,10 +158,13 @@
                     }
                     var param = [];
                     var nList = admin.util.deepClone(xxDataList);
-                    console.log(nList)
                     for (var xi = 0; xi < nList.length; xi++) {
-                        if (nList[xi].outQty > 0 ) {
-
+                        // console.log('宸插嚭搴擄細'+nList[xi].outQty)
+                        // console.log('鏃ф暟閲忥細'+oldQtys[xi])
+                        // console.log('鏁伴噺锛�'+nList[xi].qty)
+                        if (nList[xi].outQty > 0 && oldQtys[xi]!=nList[xi].qty) {
+                            layer.msg("宸插嚭搴撴棤娉曚慨鏀�", {icon: 2})
+                            return false;
                         } else if (nList[xi].qty > 0) {
                             param.push({
                                 billNo: data.field.billNo,
@@ -191,6 +179,9 @@
                                 outQty: nList[xi].outQty,
                                 qty: nList[xi].qty,
                             })
+                        }else if (nList[xi].qty == 0){
+                            layer.msg('鏄庣粏淇敼鏁伴噺涓嶅悎娉�', {icon: 2});
+                            return false;
                         }
                     }
                     if (param.length === 0) {
@@ -242,7 +233,11 @@
                         {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80}
                     ]],
                     done: function (res) {
-                        var list= res.data
+                        mlist= res.data
+                        for (let i = 0; i < mlist.length; i++) {
+                            var waitOut=mlist[i]
+                            oldQtys.push(waitOut.qty)
+                        }
                         $(layero).find('.layui-table-view').css('margin', '0');
                     },
                     size: ''
@@ -290,7 +285,6 @@
                 });
                 // 鏁伴噺淇敼
                 table.on('edit(formSSXMTable)', function (obj) {
-                    debugger;
                     if (obj.field=='memo'){
                         let vle = obj.value;
                         for (var i=0;i<xxDataList.length;i++) {
@@ -355,7 +349,6 @@
                                             success: function (res) {
                                                 if (res.code === 200){
                                                     var mat = res.data;
-                                                    console.log(mat)
                                                     xxDataList.push({
                                                         matNo: mat.matNo,
                                                         matName: mat.matName,

--
Gitblit v1.9.1