From db53a1ad9668d7bbada1217c8fa5531fc541d386 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 12 四月 2024 17:48:01 +0800
Subject: [PATCH] 产量登记表保存使用车间编码

---
 src/views/productManage/productRegisterForm/addProductRegisterPage.vue |   41 +++++++++++++++++++++++++----------------
 1 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue
index d5ecb79..1ee4194 100644
--- a/src/views/productManage/productRegisterForm/addProductRegisterPage.vue
+++ b/src/views/productManage/productRegisterForm/addProductRegisterPage.vue
@@ -91,9 +91,9 @@
                 </el-form-item>
               </el-col>
               <el-col :span="3">
-                <el-form-item label="杞﹂棿" prop="workshopId">
+                <el-form-item label="杞﹂棿" prop="workshopNumber">
                   <el-select
-                    v-model="ruleForm.workshopId"
+                    v-model="ruleForm.workshopNumber"
                     placeholder="璇烽�夋嫨"
                     class="select-width"
                     @change='getGroupNumber'
@@ -639,7 +639,7 @@
         circle: "",
         marketId: "",
         fallingSilkCocoonNumber: "",
-        workshopId: "",
+        workshopNumber: "",
         bucketCocoonNumber: "",
         groupNumber: "",
         vehicleSpeed: "",
@@ -672,7 +672,7 @@
         marketId:  [
           { required: true, message: "璇烽�夋嫨", trigger:  ["change", "blur"] },
         ],
-        workshopId:  [
+        workshopNumber:  [
           { required: true, message: "璇烽�夋嫨", trigger:  ["change", "blur"] },
         ],
         groupNumber:  [
@@ -710,7 +710,7 @@
         circle: "",
         marketId: "",
         fallingSilkCocoonNumber: "",
-        workshopId: "",
+        workshopNumber: "",
         bucketCocoonNumber: "",
         groupNumber: "",
         vehicleSpeed: "",
@@ -743,7 +743,7 @@
                   JSON.stringify(response.data ? response.data : {})
                 );
                 this.ruleForm = config;
-                this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'')
+                this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'')
                 this.tableDataItems=config.items
                   ? config.items
                   : [];
@@ -792,7 +792,6 @@
           }
         }
       }
-      console.log(this.tableData,'==this.tableData')
       this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:''
     },
     // 琛ㄦ牸鐨勮绠楅棶棰�
@@ -887,7 +886,7 @@
                   JSON.stringify(data ? data : {})
                 );
                 this.ruleForm = config;
-                this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'')
+                this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'')
                 this.tableDataItems=config.items
                   ? config.items
                   : [];
@@ -971,7 +970,7 @@
       }).then((res) => {
         if (res.code == 200) {
           this.nameList = res.data || [];
-          this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'')
+          this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'')
         }
       });
       //瑙勬牸
@@ -992,24 +991,31 @@
       });
     },
     getGroupNumber(val){
-      if(this.ruleForm.workshopId){
+      if(this.ruleForm.workshopNumber){
         //缁勫埆
-        getWorkshopManageGroup({number:this.ruleForm.workshopId}).then((res) => {
+        getWorkshopManageGroup({number:this.ruleForm.workshopNumber}).then((res) => {
            if (res.code == 200) {
-              this.workshopGroupList=[]
               let workshopGroupList = res.data || {};
+              this.workshopGroupList=[]
+              this.ruleForm.groupNumber=''
               if(Object.keys(workshopGroupList).length>0){
                 for(let i in workshopGroupList){
                   this.workshopGroupList.push(workshopGroupList[i])
                 }
-               this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber)
+                // 缂栬緫
+                if(val){
+                  this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber)
+                }
               }
+            }else{
+              this.workshopGroupList=[]
+              this.ruleForm.groupNumber=''
             }
           });
           if(this.ruleForm.groupNumber&&this.ruleForm.marketId){
             let workshopName=''
             for(let i in this.nameList){
-              if( this.nameList[i].number==this.ruleForm.workshopId){
+              if( this.nameList[i].number==this.ruleForm.workshopNumber){
                 workshopName= this.nameList[i].name
                 break;
               }
@@ -1044,6 +1050,10 @@
                if(val){
                 this.getTableEdit()
                }
+              }else{
+                this.tableData=[]
+                this.ruleForm.level=''
+                this.ruleForm.carNumber=''
               }
             });
           }
@@ -1079,7 +1089,7 @@
         circle: "",
         marketId: "",
         fallingSilkCocoonNumber: "",
-        workshopId: "",
+        workshopNumber: "",
         bucketCocoonNumber: "",
         groupNumber: "",
         vehicleSpeed: "",
@@ -1133,7 +1143,6 @@
           form.theorySilkAmount=Number(form.theorySilkAmount)
           form.total=Number(form.total)
           form.vehicleSpeed=Number(form.vehicleSpeed)
-          form.workshopId	=Number(form.workshopId)
           for(let i in tableData){
             let listItems1={
               allYield:Number(tableData[i].allYield1)||0, //浜ч噺

--
Gitblit v1.8.0