From abb175b29054b9708af27136c035b1b7351dcd20 Mon Sep 17 00:00:00 2001
From: 懒羊羊 <15939171744@163.com>
Date: 星期二, 14 十一月 2023 13:18:48 +0800
Subject: [PATCH] 优化

---
 guns-vip-main/src/main/webapp/assets/modular/pm/salesOrder/salesOrder.js |   46 +++++++++++++++++++++++-----------------------
 1 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/guns-vip-main/src/main/webapp/assets/modular/pm/salesOrder/salesOrder.js b/guns-vip-main/src/main/webapp/assets/modular/pm/salesOrder/salesOrder.js
index cbbe037..aa93dd7 100644
--- a/guns-vip-main/src/main/webapp/assets/modular/pm/salesOrder/salesOrder.js
+++ b/guns-vip-main/src/main/webapp/assets/modular/pm/salesOrder/salesOrder.js
@@ -99,10 +99,25 @@
 
     $('#split').click(function (){
         var checkRows = table.checkStatus(SalesOrder.tableId);
+        console.log(checkRows.data);
+        console.log(checkRows);
+        console.log(checkRows.data.state);
+
         if (checkRows.data.length !== 1) {
             Feng.error("璇烽�夋嫨涓�鏉¤鎷嗗垎鐨勮鍗�");
+            return;
         }
-        window.location.href = Feng.ctxPath + '/salesOrder/split?id=' + checkRows.data[0].id
+        if (checkRows.data[0].state === "1") {
+            window.location.href = Feng.ctxPath + '/salesOrder/split?id=' + checkRows.data[0].id
+        }else {
+            Feng.error("宸叉媶鍒嗕笅鍙戣鍗曠姝㈤噸澶嶆媶鍒�");
+            return;
+        }
+        // if (checkRows.data.state !== "1") {
+        //     Feng.error("宸叉媶鍒嗕笅鍙戣鍗曠姝㈤噸澶嶆媶鍒�");
+        //     return;
+        // }
+        // window.location.href = Feng.ctxPath + '/salesOrder/split?id=' + checkRows.data[0].id
 
     });
 
@@ -193,9 +208,13 @@
     // 缁戝畾涓嬪彂
     $('#distribute').click(function () {
         var checkRows = table.checkStatus(SalesOrder.tableId);
-        if(checkRows.data[0].state === "3"){
-            Feng.error("璇ュ伐鍗曞凡涓嬪彂瀹屾瘯锛�");
-            return;
+        console.log(checkRows);
+        console.log("checkRows.length=========="+checkRows.data.length)
+        if(checkRows.data.length === 1){
+            if(checkRows.data[0].state === "3"){
+                Feng.error("璇ュ伐鍗曞凡涓嬪彂瀹屾瘯锛�");
+                return;
+            }
         }
         if (checkRows.data.length !== 1) {
             Feng.error("璇烽�夋嫨涓�鏉¤涓嬪彂鐨勮鍗�");
@@ -204,25 +223,6 @@
         var checkRows = table.checkStatus(SalesOrder.tableId);
         console.log(checkRows.data);
         window.location.href = Feng.ctxPath + '/salesOrder/bindParam?id=' + checkRows.data[0].id
-        // layer.open({
-        //     type: 2,
-        //     area: ['1000px', '600px'],
-        //     title: '涓嬪彂璁㈠崟',
-        //     content:  Feng.ctxPath + '/salesOrder/bindParam',
-        //     success: function (layero, index) {
-        //         // let body = layer.getChildFrame('body', index);
-        //         // body.find('form').find('#salesOrderList').val(checkRows.data);
-        //         // 鑾峰彇瀛愰〉闈㈢殑iframe
-        //         var iframe = window['layui-layer-iframe'+index];
-        //         // 鍚戝瓙椤甸潰鐨勫叏灞�鍑芥暟child浼犲弬
-        //         iframe.child(checkRows.data);
-        //     },
-        //     end: function () {
-        //         table.reload(SalesOrder.tableId, {
-        //             where: null, page: {curr: 1}
-        //         });
-        //     }
-        // });
     });
 
     // 宸ュ叿鏉$偣鍑讳簨浠�

--
Gitblit v1.9.3