From d7d388e53fd71f9a02c71302a007d443e54a27ef Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 27 二月 2024 16:59:48 +0800
Subject: [PATCH] 销售机会报价单是否显示列表弹框的逻辑修改选择报价单赋对应的销售机会客户名称选择销售机会赋对应客户名称

---
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |   39 +++++++++++++++++++++++++++++----------
 1 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 7bcbdaf..2b20ee5 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -115,8 +115,9 @@
                       @select="handleSelectClient('chance', $event)"
                       :disabled="isNameChanceEdit || isView"
                     ></el-autocomplete>
+                    <!-- &&editConfig.infomation.client_name -->
                     <div
-                      v-if="!isNameChanceEdit && !isView&&editConfig.infomation.client_name"
+                      v-if="!isNameChanceEdit && !isView"
                       class="common-select-btn"
                       @click="selClientClick('chance')"
                     >
@@ -181,6 +182,7 @@
                     }
                   ]"
                 >
+                <!-- isAddQuatation || -->
                   <div class="custom-name">
                     <el-autocomplete
                       v-model="editConfig.infomation.quotation_number"
@@ -192,21 +194,22 @@
                       value-key="number"
                       @select="handleSelectClient('quotation', $event)"
                       style="width: 100%"
-                      placeholder="璇峰厛閫夋嫨閿�鍞満浼�"
-                      :disabled="isAddQuatation || isView"
+                      placeholder="璇峰厛閫夋嫨閿�鍞姤浠峰崟"
+                      :disabled=" isView"
                     ></el-autocomplete>
+                    <!-- !isAddQuatation && editConfig.infomation.sale_chance_name &&-->
                     <div
-                      v-if="!isAddQuatation && !isView&&editConfig.infomation.sale_chance_name"
+                      v-if=" !isView"
                       class="common-select-btn"
                       @click="selClientClick('quotation')"
                     >
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
+                    <!-- !isAddQuatation && -->
                     <div
                       v-if="
                         editConfig.infomation.quotation_number &&
                         editConfig.infomation.quotation_number.length > 0 &&
-                        !isAddQuatation &&
                         !isView
                       "
                       class="common-select-btn"
@@ -927,7 +930,9 @@
       if (value === "client") {
         this.editSelectClientConfig.editVisible = true
       } else if (value === "chance") {
-        this.editSelectChanceConfig.clientId = this.clientId
+        if(this.clientId){
+          this.editSelectChanceConfig.clientId = this.clientId
+        }
         this.editSelectChanceConfig.editVisible = true
       } else if (value === "subbill") {
         this.editSelCommonConfig.title = "閿�鍞瓙鍗�"
@@ -935,11 +940,17 @@
         this.editSelCommonConfig.clientId = this.clientId
       } else if (value === "quotation") {
         this.editSelCommonConfig.title = "鎶ヤ环鍗�"
+        if(this.saleChanceId&&this.clientId){
+          this.editSelCommonConfig.clientId = this.clientId
+          // 姝e悜閫夋嫨瀹㈡埛 閿�鍞満浼�  鎶ヤ环鍗�
+          this.editSelCommonConfig.isRequest = false
+          this.editSelCommonConfig.count=this.count
+          this.editSelCommonConfig.tableInfomation = [...this.quotationList]
+        }else{
+           // 鍙嶅悜閫夋嫨
+          this.editSelCommonConfig.isRequest = true;
+        }
         this.editSelCommonConfig.editVisible = true
-        this.editSelCommonConfig.clientId = this.clientId
-        this.editSelCommonConfig.isRequest = false
-        this.editSelCommonConfig.count=this.count
-        this.editSelCommonConfig.tableInfomation = [...this.quotationList]
       }
     },
     selClient(row, value) {
@@ -952,6 +963,8 @@
         this.getSubOrderList(row)
       } else if (value === "chance") {
         this.editConfig.infomation.sale_chance_name = row.name
+        this.editConfig.infomation.client_name = row.client.name
+        this.clientId = row.client.id
         this.saleChanceId = row.id
         this.isAddQuatation = false
         this.getQuotation(row.id)
@@ -962,6 +975,12 @@
         this.productTableList.tableData = row.products
         // this.tableData = row.products
         this.editConfig.infomation.quotation_number = row.number
+        //鍙嶅悜 瀹㈡埛鍚嶇О
+        this.editConfig.infomation.client_name = row.client.name
+        this.clientId = row.client.id
+        //鍙嶅悜 閿�鍞満浼�
+        this.editConfig.infomation.sale_chance_name = row.sale_chance.name
+        this.saleChanceId = row.sale_chance.id
         this.quotationId = row.id
       }
     },

--
Gitblit v1.8.0