From 3d04f62e6c9124e2d37b5d09191a02fc6390d16f Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 13 十月 2023 17:07:10 +0800
Subject: [PATCH] bug修复

---
 src/views/sales/contractManage/AddContractManageDialog.vue |   54 +++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 41 insertions(+), 13 deletions(-)

diff --git a/src/views/sales/contractManage/AddContractManageDialog.vue b/src/views/sales/contractManage/AddContractManageDialog.vue
index 712268d..b3114e0 100644
--- a/src/views/sales/contractManage/AddContractManageDialog.vue
+++ b/src/views/sales/contractManage/AddContractManageDialog.vue
@@ -38,11 +38,9 @@
                 </el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="鍚堝悓鍚嶇О" prop="name">
+                <el-form-item label="鍚堝悓鍚嶇О" prop="contractName">
                   <div class="custom-name">
-                    <el-input v-model="editConfig.infomation.name"></el-input>
-                    <!-- <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div> -->
-                    <!-- <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div> -->
+                    <el-input v-model="editConfig.infomation.contractName"></el-input>
                   </div>
                 </el-form-item>
               </el-col>
@@ -116,12 +114,18 @@
                       value-key="number"
                       @select="handleSelectClient('quotation', $event)"
                       style="width: 100%"
+                      placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О"
+                      :disabled="isAddQuatation"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('quotation')">
+                    <div v-if="!isAddQuatation" class="common-select-btn" @click="selClientClick('quotation')">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
                     <div
-                      v-if="editConfig.infomation.quotation_number && editConfig.infomation.quotation_number.length > 0"
+                      v-if="
+                        editConfig.infomation.quotation_number &&
+                        editConfig.infomation.quotation_number.length > 0 &&
+                        !isAddQuatation
+                      "
                       class="common-select-btn"
                       @click="clearupClient('quotation')"
                     >
@@ -233,6 +237,7 @@
 import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
 import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog"
 import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
+import { getQuotationList } from "@/api/sales/quotation"
 export default {
   name: "AddContractManageDialog",
   mixins: [codeMixin],
@@ -252,10 +257,10 @@
   computed: {
     clientList() {
       return this.$store.state.getClientName.clientList
-    },
-    quotationList() {
-      return this.$store.state.getClientName.quotationList
     }
+    // quotationList() {
+    //   return this.$store.state.getClientName.quotationList
+    // }
   },
   data() {
     return {
@@ -282,12 +287,14 @@
         infomation: {}
       },
       clientId: this.editCommonConfig.infomation.clientId,
-      quotationId: this.editCommonConfig.infomation.quotationId
+      quotationId: this.editCommonConfig.infomation.quotationId,
+      isAddQuatation: true,
+      quotationList: []
     }
   },
   created() {
     this.$store.dispatch("geClient")
-    this.$store.dispatch("geQuotation")
+    // this.$store.dispatch("geQuotation")
     this.getCommonData()
     this.formInfo()
   },
@@ -357,7 +364,7 @@
       console.log(data)
       let params = {
         id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
-        name: data.name || "",
+        contractName: data.contractName || "",
         client_id: this.clientId || 0,
         file: "",
         member_id: data.memberId || 0,
@@ -371,6 +378,21 @@
     },
     handleClose() {
       this.editConfig.visible = false
+    },
+    // 鑾峰彇鎶ヤ环鍗�
+    getQuotation(id) {
+      getQuotationList({
+        page: 0,
+        pageSize: 0,
+        search_map: {
+          client_id: id
+        }
+      }).then((res) => {
+        if (res.code == 200) {
+          console.log(res)
+          this.quotationList = res.data.list
+        }
+      })
     },
     // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶
     querySearchAsync(queryString, cb, value) {
@@ -397,6 +419,8 @@
       if (value === "client") {
         this.editConfig.infomation.client_name = item.name
         this.clientId = item.id
+        this.isAddQuatation = false
+        this.getQuotation(item.id)
       } else if (value === "quotation") {
         this.editConfig.infomation.quotation_number = item.number
         this.quotationId = item.id
@@ -418,6 +442,8 @@
       if (value === "client") {
         this.editConfig.infomation.client_name = row.name
         this.clientId = row.id
+        this.isAddQuatation = false
+        this.getQuotation(row.id)
       } else if (value === "quotation") {
         this.editConfig.infomation.quotation_number = row.number
         this.quotationId = row.id
@@ -427,9 +453,11 @@
     clearupClient(value) {
       console.log(value)
       if (value === "client") {
-        console.log("ss88888")
         this.editConfig.infomation.client_name = ""
         this.clientId = 0
+        this.isAddQuatation = true
+        this.editConfig.infomation.quotation_number = ""
+        this.quotationId = 0
       } else if (value === "quotation") {
         this.editConfig.infomation.quotation_number = ""
         this.quotationId = 0

--
Gitblit v1.8.0