From e4a393c219c3c48cbf0e4af615b316facb82eb62 Mon Sep 17 00:00:00 2001
From: wujian <14790700720@163.com>
Date: 星期三, 04 九月 2024 09:09:50 +0800
Subject: [PATCH] change-1

---
 jcdm-ui/src/views/main/om/productionOrde/index.vue |   64 +++++++++++++++++++++-----------
 1 files changed, 42 insertions(+), 22 deletions(-)

diff --git a/jcdm-ui/src/views/main/om/productionOrde/index.vue b/jcdm-ui/src/views/main/om/productionOrde/index.vue
index c1b0c2c..0a0619e 100644
--- a/jcdm-ui/src/views/main/om/productionOrde/index.vue
+++ b/jcdm-ui/src/views/main/om/productionOrde/index.vue
@@ -109,7 +109,7 @@
           plain
           icon="el-icon-edit"
           size="mini"
-          :disabled="single"
+          :disabled="create"
           @click="CreatehandleUpdate"
         >鐢熸垚</el-button>
       </el-col>
@@ -360,6 +360,7 @@
       ids: [],
       // 闈炲崟涓鐢�
       single: true,
+      create: false,
       // 闈炲涓鐢�
       multiple: true,
       move: true,
@@ -676,6 +677,14 @@
       console.log('this.single1111',this.single)
       console.log('selecion',selection)
       this.ids = selection.map(item => item.id)
+      const statusList = selection.map(item => item.orderStatus)
+      console.log('statusList',statusList)
+      console.log('statusList.filter( x => x !== "1").length',statusList.filter( x => x !== "1").length)
+      if (statusList.filter( x => x !== "1").length >0){
+        this.create = true
+      } else {
+        this.create = false
+      }
       if (selection.length >1){
         this.single = false
         this.multiple = true
@@ -721,24 +730,30 @@
       this.titleName = "娣诲姞鐢熶骇璁㈠崟";
     },
     /** 鍚屾鎸夐挳鎿嶄綔 */
-    CreatehandleUpdate(Row) {
-      this.initWorkshop();
-      this.reset();
-      const id = Row.id || this.ids
-      getProductionOrdes(id).then(response => {
-        console.log(response.data)
-        console.log(response.data.productCode)
-        this.materialQueryParams.materialCode = response.data.productCode;
-        listMaterial(this.materialQueryParams).then(response => {
-          this.markNo = response.rows[0].mark
-          this.form.typeL = response.rows[0].typeL;
+    CreatehandleUpdate() {
+      console.log('this.ids',this.ids)
+      if (this.ids.length === 0){
+        this.$message.error('璇峰嬀閫夋暟鎹�');
+      }else {
+        this.initWorkshop();
+        this.reset();
+        const id = this.ids
+        getProductionOrdes(id).then(response => {
+          console.log(response.data)
+          console.log(response.data.productCode)
+          this.materialQueryParams.materialCode = response.data.productCode;
+          listMaterial(this.materialQueryParams).then(response => {
+            this.markNo = response.rows[0].mark
+            this.form.typeL = response.rows[0].typeL;
+          });
+          this.form = response.data;
+          this.form.idNums=id;
+          this.Createopen = true;
+          this.titleName = "鐢熸垚绠变綋鏉$爜";
+          // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
         });
-        this.form = response.data;
-        this.form.idNums=id;
-        this.Createopen = true;
-        this.titleName = "鐢熸垚绠变綋鏉$爜";
-        // return Array.from({ length: parseInt(this.actualQty) }, (_, index) => index + 1);
-      });
+      }
+
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
@@ -832,10 +847,15 @@
       }, `productionOrde_${new Date().getTime()}.xlsx`)
     },
     goToPage() {
-      this.showDetailFlag=true
-      console.log('this.showDetailFlag',this.showDetailFlag)
-      //鏇存柊瀹為檯鐢熶骇鏃ユ湡
-      //updateOrderInfo(this.singleSelect)
+      if (this.ids.length === 0){
+        this.$message.error('璇峰嬀閫夋暟鎹�');
+      }else {
+        this.showDetailFlag=true
+        console.log('this.showDetailFlag',this.showDetailFlag)
+        //鏇存柊瀹為檯鐢熶骇鏃ユ湡
+        //updateOrderInfo(this.singleSelect)
+      }
+
     },
   }
 };

--
Gitblit v1.9.3