From 24cc28bb458f16af7aef99b1f9c3115996a2a3fa Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期五, 12 四月 2024 16:23:50 +0800
Subject: [PATCH] 开始回数和结束回数不显示的问题修改

---
 src/views/productManage/productRegisterForm/components/addProductDialog.vue |   35 ++++++++++++++++-------------------
 1 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/src/views/productManage/productRegisterForm/components/addProductDialog.vue b/src/views/productManage/productRegisterForm/components/addProductDialog.vue
index 12f66da..54923a2 100644
--- a/src/views/productManage/productRegisterForm/components/addProductDialog.vue
+++ b/src/views/productManage/productRegisterForm/components/addProductDialog.vue
@@ -225,7 +225,7 @@
   created() {
   },
   watch:{
-    "form": {
+    "editDialogVisible": {
       handler() {
         this.getInfo()
       },
@@ -238,17 +238,13 @@
   },
   methods: {
     getInfo(){
-      this.proForm={
-          createTime: this.form.createTime,
-          groupNumber: this.form.groupNumber,
-          workshopId: this.form.workshopId,
-          spec: this.form.spec,
-          marketId: this.form.marketId,
-          tareWeight: "",
-          netWeight: "",
-          carNumber: this.form.carNumber,
-          pieceNumber: this.form.pieceNumber,
-          pieces: this.form.pieces,
+        this.proForm.createTime=this.form.createTime
+        this.proForm.groupNumber=this.form.groupNumber
+        this.proForm.workshopId=this.form.workshopId
+        this.proForm.spec=this.form.spec
+        this.proForm.marketId=this.form.marketId
+        if(!this.proForm.carNumber){
+          this.proForm.carNumber=this.form.carNumber
         }
         this.$forceUpdate();
     },
@@ -266,15 +262,12 @@
               }
             }
           });
-          if(this.proForm.groupNumber){
-            this.changeForm()
-          }
       }else{
         this.workshopGroupList =[]
       }
     },
     changeForm(val){
-      if(this.proForm.createTime&&this.proForm.groupNumber&&this.proForm.marketId&&this.proForm.spec&&this.proForm.workshopId){
+      if(this.editDialogVisible&&this.proForm.createTime&&this.proForm.groupNumber&&this.proForm.marketId&&this.proForm.spec&&this.proForm.workshopId){
         changeYieldRegister({
           createTime: this.proForm.createTime,
           groupNumber: this.proForm.groupNumber,
@@ -283,12 +276,16 @@
           workshopId: this.proForm.workshopId,
         }).then((res) => {
           if (res.code == 200) {
-            console.log(res,'res')
+            if(res.data){
+              if(Object.keys(res.data).length>0){
+                this.$emit('changeForm',this.proForm,val,res.data)
+              }
+            }
           }
         });
+      }else{
+        this.$emit('changeForm',this.proForm,val,{})
       }
-      
-      this.$emit('changeForm',this.proForm,val)
     },
     changeTableInput(){
       if(this.proForm.pieces&&this.proForm.carNumber&&this.proForm.pieceNumber){

--
Gitblit v1.8.0