From 4959a25a7cac2a514a9b8fb2471101c067fd72e4 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期四, 18 四月 2024 17:22:54 +0800
Subject: [PATCH] 产品 启用多单位的时候如果没有设置显示弹框

---
 src/views/productManage/product/index.vue                     |    2 +-
 src/views/productManage/product/components/UnitMoreDialog.vue |    5 ++++-
 src/views/productManage/product/AddProductDialog.vue          |   24 ++++++++++++++++--------
 3 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index 574c1a8..a923d07 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -615,6 +615,7 @@
       ref="unitMoreDialog"
       @saveUnitMore="saveUnitMore"
       :workList="unitList"
+      :unitRight='editConfig.infomation.unit'
       :dataList="editConfig.infomation.moreUnitList"
       title="鍚敤澶氬崟浣�"
     ></UnitMoreDialog>
@@ -820,18 +821,25 @@
     // 鍚敤澶氬崟浣嶇殑寮�鍏�
     moreUnitChange(){
       let string=false;
-      if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
-        for(let i in this.editConfig.infomation.moreUnitList){
-          if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
-            string=true;
-            break;
+      if(this.editConfig.infomation.unit){
+        if(this.editConfig.infomation.moreUnitList&&this.editConfig.infomation.moreUnitList.length>0){
+          for(let i in this.editConfig.infomation.moreUnitList){
+            if(this.editConfig.infomation.moreUnitList[i].unit&&this.editConfig.infomation.moreUnitList[i].amount){
+              string=true;
+              break;
+            }
           }
         }
-      }
-      if(!string){
+        if(!string){
+          this.editConfig.infomation.moreUnit=false
+          this.$message.error('璇峰厛閰嶇疆澶氬崟浣嶏紒')
+          this.$refs.unitMoreDialog.editDialogVisible = true;
+        }
+      }else{
         this.editConfig.infomation.moreUnit=false
-        this.$message.error('璇峰厛閰嶇疆澶氬崟浣嶏紒')
+        this.$message.error('璇峰厛閫夋嫨鍗曚綅锛�')
       }
+      
     },
     handleConfirmSave(dataList) {
       saveUnitDict({ data: dataList }).then((res) => {
diff --git a/src/views/productManage/product/components/UnitMoreDialog.vue b/src/views/productManage/product/components/UnitMoreDialog.vue
index fd1d60b..2fb9ce6 100644
--- a/src/views/productManage/product/components/UnitMoreDialog.vue
+++ b/src/views/productManage/product/components/UnitMoreDialog.vue
@@ -72,7 +72,7 @@
                 ></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="2" class="col-name">鍖�</el-col>
+            <el-col :span="2" class="col-name">{{unitRight||'--'}}</el-col>
             <el-col :span="5" v-if="index==0"> 
               <el-form-item
                 label=""
@@ -122,6 +122,9 @@
     workList: {
       type: [Array],
     },
+    unitRight:{
+      type: String,
+    },
   },
   data() {
     return {
diff --git a/src/views/productManage/product/index.vue b/src/views/productManage/product/index.vue
index dc395f6..c6919d0 100644
--- a/src/views/productManage/product/index.vue
+++ b/src/views/productManage/product/index.vue
@@ -311,7 +311,7 @@
       this.editConfig.autoEdit = true
       this.editConfig.title = "缂栬緫"
       let imageSrc = row.attachmentList?.length > 0 ? row.attachmentList[0].FileUrl : ""
-      this.editConfig.infomation = { ...row, imageSrc: imageSrc }
+      this.editConfig.infomation = { ...row, imageSrc: imageSrc,moreUnitList:row.moreUnitList?row.moreUnitList:[] }
       this.editConfig.visible = true
     },
     // 鍒囨崲鍒楄〃灞曠幇褰㈠紡

--
Gitblit v1.8.0