From 17816296ced79718931ae694b0e635f278495229 Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 27 二月 2024 17:18:37 +0800 Subject: [PATCH] 销售报价单列表增加报价名称,客户名称,业务机会,报价单状态,合计 --- src/views/client/followupRecords/AddFollowupRecordsDialog.vue | 59 +++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 43 insertions(+), 16 deletions(-) diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue index 2b93c08..62460d3 100644 --- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue +++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue @@ -108,7 +108,12 @@ value-key="name" @select="handleSelectClient('contact', $event)" style="width: 100%" - ></el-autocomplete> + > + // 瑙e喅鍖归厤涓嶅埌鎻愮ず鏃犲尮閰嶆暟鎹� + <template v-if="noData" slot-scope="{ item }"> + <div class="default" @click.stop="stopClick">{{ item.name }}</div> + </template> + </el-autocomplete> <div class="common-select-btn" @click="selClientClick('contact')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> @@ -392,15 +397,6 @@ clientList() { return this.$store.state.getClientName.clientList } - // contactNamelist() { - // return this.$store.state.getClientName.contactNamelist - // }, - // saleChancelist() { - // return this.$store.state.getClientName.saleChancelist - // }, - // saleLeadlist() { - // return this.$store.state.getClientName.saleLeadlist - // } }, data() { return { @@ -408,7 +404,7 @@ editConfig: this.editContactsConfig, rules: { number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }], - member_id: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }], + member_id: [{ required: true, validator: this.validateMemberId, trigger: "change" }], record: [{ required: true, message: "璇疯緭鍏ヨ窡杩涜褰�", trigger: "blur" }], client_name: [{ required: true, validator: this.checkClient, trigger: "change" }], contact_name: [{ required: true, message: "璇烽�夋嫨鑱旂郴浜哄鍚�", trigger: "change" }], @@ -462,17 +458,22 @@ saleChanceId: this.editContactsConfig.infomation.sale_chance_id, saleLeadId: this.editContactsConfig.infomation.sales_leads_id, saleChancelist: [], - isChance: true + isChance: true, + noData: false // 鏄惁鍖归厤鍒版暟鎹簡 } }, created() { + this.getChanceList(this.editConfig.infomation.client_id) + if(this.editContactsConfig.title==="缂栬緫"){ + this.isChance=false + } this.$store.dispatch("geClient") - // this.$store.dispatch("geContact") - // this.$store.dispatch("geChance") - // this.$store.dispatch("geLead") this.getCommonData() this.getContactInfoList() this.formInfo() + if (this.editContactsConfig.title === "鏂板缓" && this.editContactsConfig.infomation?.client_name?.length > 0) { + this.getContactList(this.editContactsConfig.infomation) + } }, watch: { "editContactsConfig.visible"(val) { @@ -496,6 +497,15 @@ console.log(res) this.clientStatusOptions = res.data.client_status this.memberOptions = res.data.member + if (this.editConfig.title === "鏂板缓") { + let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") + this.memberOptions.map((item) => { + if (item.username == username) { + this.$set(this.editConfig.infomation, "member_id", item.id) + } + }) + } + // this.dataProcess() }) }, @@ -604,7 +614,13 @@ } else { restaurants = this.saleLeadlist } - var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants + var results = queryString ? restaurants?.filter(this.createStateFilter(queryString)) : restaurants + console.log(results) + this.noData = false + if (results == undefined || results?.length <= 0) { + results = [{ name: "鏃犲尮閰嶆暟鎹�" }] + this.noData = true + } cb(results) }, createStateFilter(queryString) { @@ -668,6 +684,7 @@ if (value === "client") { this.editSelectClientConfig.editVisible = true } else if (value === "contact") { + this.editSelectContactConfig.clientId = this.clientId || 0 this.editSelectContactConfig.editVisible = true } else if (value === "chance") { this.editSelectChanceConfig.editVisible = true @@ -743,6 +760,16 @@ } else { callback(new Error("璇烽�夋嫨瀹㈡埛鍚嶇О")) } + }, + // 闃绘鍙偣鍑讳簨浠� + stopClick() {}, + // 閿�鍞礋璐d汉鑷畾涔夋牎楠岃鍒� + validateMemberId(rule, value, callback) { + if (this.editConfig.infomation?.member_id > 0) { + callback() + } else { + callback(new Error("璇疯緭鍏ヨ礋璐d汉")) + } } } } -- Gitblit v1.8.0