From 195ebd54302cf7884e23a3f1464ae2f27309327b Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期一, 13 十一月 2023 14:48:15 +0800
Subject: [PATCH] 就绪状态可以取消调拨

---
 src/views/overview/AddOverviewDialog.vue |   42 +++++++++++++++++++++++++++++++++++++++---
 1 files changed, 39 insertions(+), 3 deletions(-)

diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue
index 9451937..2097ac0 100644
--- a/src/views/overview/AddOverviewDialog.vue
+++ b/src/views/overview/AddOverviewDialog.vue
@@ -37,8 +37,10 @@
             :isValidateClick="isValidateClick"
             :isDelClick="isDelClick"
             :list="list"
+            :showCancel="showCancel"
             @delClick="delClick"
             @validateClick="validateClick"
+            @btnCancel="btnCancel"
           />
         </div>
         <div class="basic-info">
@@ -309,6 +311,7 @@
   addOperation,
   updateOperation,
   updateStatus,
+  stateCancel,
   deleteOperation,
   getListTransfer,
   getLogisticCompanyList
@@ -361,7 +364,8 @@
         { label: "鑽夌", status: "todo", value: 1 },
         { label: "姝e湪绛夊緟", status: "todo", value: 2 },
         { label: "灏辩华", status: "todo", value: 3 },
-        { label: "瀹屾垚", status: "todo", value: 4 }
+        { label: "瀹屾垚", status: "todo", value: 4 },
+        { label: "宸插彇娑�", status: "todo", value: 5 }
       ],
       showButton: true,
       activeName: "first",
@@ -388,7 +392,8 @@
         waybillNumber:'',
         weight:0,
         logisticWeight:0,
-      }
+      },
+      showCancel:false, // 鍙栨秷鏄惁鍙互鏄剧ず
     }
   },
   created() {
@@ -466,8 +471,12 @@
         this.showFooter = false
         if (this.editConfig.infomation.status === "瀹屾垚") {
           this.isValidateClick = false
-        } else {
+        }else if(this.editConfig.infomation.status === 3){
           this.isValidateClick = true
+          this.showCancel=true
+        }else{
+          this.isValidateClick = true
+
         }
       } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "瀹屾垚") {
         this.showButton = true
@@ -486,6 +495,7 @@
         this.showEdit = true
         this.showFooter = false
         this.isValidateClick = true
+        this.showCancel=true
       }
       if (this.editConfig.title === "鏂板缓") {
         this.list[0].status = "active"
@@ -752,6 +762,32 @@
           this.$parent.getData()
         }
       })
+    },
+
+    // 鍙栨秷
+    btnCancel(){
+      this.$confirm('纭畾鍙栨秷鍚楋紵', '鎻愮ず', {
+        confirmButtonText: '纭畾',
+        cancelButtonText: '鍙栨秷',
+        type: 'warning'
+      }).then(() => {
+        stateCancel(this.editConfig.infomation.id).then((res) => {
+          console.log(res)
+          this.editConfig.visible = false
+          if (res.code === 200) {
+            this.$message.success("鍙栨秷璋冩嫧")
+            this.$parent.getData()
+          }
+        })
+        this.list.map((item) => {
+          if (item.label==="宸插彇娑�") {
+            item.status = "active"
+          } else {
+            item.status = "todo"
+          }
+        })
+      }).catch(() => {         
+      });
     }
   }
 }

--
Gitblit v1.8.0