From e0efd928e914e1a768635fb6b9fe303f3e329f01 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期六, 18 十一月 2023 15:10:03 +0800
Subject: [PATCH]  fix:调拨状态调整

---
 src/views/overview/AddOverviewDialog.vue |   73 ++++++++++++++++++++++++++++++++----
 1 files changed, 64 insertions(+), 9 deletions(-)

diff --git a/src/views/overview/AddOverviewDialog.vue b/src/views/overview/AddOverviewDialog.vue
index 9451937..c12633b 100644
--- a/src/views/overview/AddOverviewDialog.vue
+++ b/src/views/overview/AddOverviewDialog.vue
@@ -18,7 +18,7 @@
             <i class="el-icon-s-tools"></i>
             <span>鍔ㄤ綔</span>
           </span>
-          <el-button v-if="showEdit" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
+          <el-button v-if="showEdit" :disabled="this.editConfig.infomation.status===5" plain size="mini" style="margin-left: 15px" @click="editClick">缂栬緫</el-button>
         </div>
       </div>
       <!-- 鍐呭 -->
@@ -36,9 +36,12 @@
             :showButton="showButton"
             :isValidateClick="isValidateClick"
             :isDelClick="isDelClick"
+            :isCancel="isCancel"
             :list="list"
+            :showCancel="showCancel"
             @delClick="delClick"
             @validateClick="validateClick"
+            @btnCancel="btnCancel"
           />
         </div>
         <div class="basic-info">
@@ -309,6 +312,7 @@
   addOperation,
   updateOperation,
   updateStatus,
+  stateCancel,
   deleteOperation,
   getListTransfer,
   getLogisticCompanyList
@@ -357,12 +361,6 @@
       companyOptions: [], // 鍏徃
       memberOptions: [{ id: 1, name: "绠$悊鍛�" }],
       toLocationOptions: [], //  婧愪綅缃� 浠撳簱浣嶇疆
-      list: [
-        { label: "鑽夌", status: "todo", value: 1 },
-        { label: "姝e湪绛夊緟", status: "todo", value: 2 },
-        { label: "灏辩华", status: "todo", value: 3 },
-        { label: "瀹屾垚", status: "todo", value: 4 }
-      ],
       showButton: true,
       activeName: "first",
       productTableList: {},
@@ -371,6 +369,7 @@
       isNoProduct: true, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑�
+      isCancel:false, //楠岃瘉鎸夐挳鏄惁鍙偣鍑�
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨
       currentState: "todo", // 褰撳墠鐘舵��
       detailTableList: {},
@@ -388,10 +387,13 @@
         waybillNumber:'',
         weight:0,
         logisticWeight:0,
-      }
+      },
+      showCancel:false, // 鍙栨秷鏄惁鍙互鏄剧ず
+      list:[],
     }
   },
   created() {
+    this.setStatusList()
     this.setTableForm()
     this.setBottonView()
     this.setDetailTableForm()
@@ -404,6 +406,25 @@
     this.getLogisticCompanyList()
   },
   methods: {
+    setStatusList(){
+      console.log(this.editConfig.infomation,"edit")
+      if(this.editConfig.infomation.status===5){
+        this.list=[
+          { 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: 5 }
+        ]
+      }else{
+        this.list=[
+          { label: "鑽夌", status: "todo", value: 1 },
+          { label: "姝e湪绛夊緟", status: "todo", value: 2 },
+          { label: "灏辩华", status: "todo", value: 3 },
+          { label: "瀹屾垚", status: "todo", value: 4 }
+        ]
+      }
+    },
     // 鑾峰彇鍏徃鍒楄〃
     async getCompanyList() {
       await getCompanyList().then((res) => {
@@ -466,7 +487,13 @@
         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 if(this.editConfig.infomation.status===5){
+          this.isCancel=true
+          this.isValidateClick=true
+        }else{
           this.isValidateClick = true
         }
       } else if (this.editConfig.infomation.status === 4 || this.editConfig.infomation.status === "瀹屾垚") {
@@ -476,6 +503,7 @@
         this.showFooter = false
         this.isValidateClick = false
       } else if (this.editConfig.infomation.status === 5) {
+        this.isCancel=true
         this.showButton = true
         this.showEdit = false
         this.showFooter = false
@@ -486,6 +514,7 @@
         this.showEdit = true
         this.showFooter = false
         this.isValidateClick = true
+        this.showCancel=true
       }
       if (this.editConfig.title === "鏂板缓") {
         this.list[0].status = "active"
@@ -752,6 +781,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