From ea2b5a4a2779a2a94c4846b110c5507a248ffeb5 Mon Sep 17 00:00:00 2001 From: zuozhengqing <a13193816592@163.com> Date: 星期三, 20 三月 2024 19:50:25 +0800 Subject: [PATCH] 销售明细发货添加确认完成,格式化列表状态展示 --- src/views/client/followupRecords/AddFollowupRecordsDialog.vue | 81 +++++++++++++++++++++++++++++++++------- 1 files changed, 66 insertions(+), 15 deletions(-) diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue index 1fbdcef..18e2d13 100644 --- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue +++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue @@ -9,6 +9,7 @@ custom-class="iframe-dialog" > <el-form + v-if="refreshFlag" ref="form" :model="editConfig.infomation" :rules="rules" @@ -167,6 +168,7 @@ <el-col v-if="isUnflod" :span="12"> <el-form-item label="閿�鍞満浼�" prop="sale_chance_name"> <div class="custom-name"> + <!-- :disabled="isChance" --> <el-autocomplete v-model="editConfig.infomation.sale_chance_name" :fetch-suggestions=" @@ -177,17 +179,17 @@ value-key="name" @select="handleSelectClient('chance', $event)" style="width: 100%" - placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О" - :disabled="isChance" + placeholder="璇烽�夋嫨閿�鍞満浼�" ></el-autocomplete> - <div v-if="!isChance" class="common-select-btn" @click="selClientClick('chance')"> + <!-- v-if="!isChance" --> + <div class="common-select-btn" @click="selClientClick('chance')"> <i class="el-icon-circle-plus-outline"></i> </div> + <!-- &&!isChance --> <div v-if=" editConfig.infomation.sale_chance_name && - editConfig.infomation.sale_chance_name.length > 0 && - !isChance + editConfig.infomation.sale_chance_name.length > 0 " class="common-select-btn" @click="clearupClient('chance')" @@ -400,11 +402,12 @@ }, data() { return { + refreshFlag: true, dialogWidth: "50%", 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" }], @@ -463,6 +466,10 @@ } }, created() { + this.getChanceList(this.editConfig.infomation.client_id) + if(this.editContactsConfig.title==="缂栬緫"){ + this.isChance=false + } this.$store.dispatch("geClient") this.getCommonData() this.getContactInfoList() @@ -488,11 +495,30 @@ } this.getRCodeStandardList() }, + /** + * 寮哄埗鍒锋柊form缁勪欢 + * 澶栭儴鏇存敼琛ㄥ崟鍊间笉浼氳Е鍙戣〃鍗曟牎楠�,瀵艰嚧鍗充娇鏈夊�煎琚〃鍗曟牎楠岄樆濉炰綇 + */ + refresh() { + this.refreshFlag = false + requestAnimationFrame(() => { + this.refreshFlag = true + }) + }, getCommonData() { getAllData().then((res) => { 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() }) }, @@ -577,13 +603,22 @@ }, // 鑾峰彇閿�鍞満浼� getChanceList(id) { - getSaleChanceList({ - page: 1, - pageSize: 15, - search_map: { + let params={} + if(id){ + params={ + page: 0, + pageSize: 0, + } + params.search_map={ client_id: id } - }).then((res) => { + }else{ + params={ + page: 0, + pageSize: 0, + } + } + getSaleChanceList(params).then((res) => { if (res.code == 200) { this.saleChancelist = res.data.list } @@ -662,6 +697,9 @@ } else if (value === "chance") { this.saleChanceId = item.id this.editConfig.infomation.sale_chance_name = item.name + this.editConfig.infomation.client_name = item.client.name + this.clientId = item.client.id + this.getChanceList(this.clientId) } else { this.saleLeadId = item.id this.editConfig.infomation.sales_leads_name = item.name @@ -674,6 +712,7 @@ this.editSelectContactConfig.clientId = this.clientId || 0 this.editSelectContactConfig.editVisible = true } else if (value === "chance") { + this.editSelectChanceConfig.clientId = this.clientId this.editSelectChanceConfig.editVisible = true } else { this.editSelectLeadConfig.editVisible = true @@ -690,15 +729,18 @@ this.editSelectContactConfig.search_map.client_id = row.id this.editSelectChanceConfig.search_map.client_id = row.id this.editSelectLeadConfig.search_map.name = row.name - this.getContactList(row) - this.getSalesLeadsList(row) this.clientId = row.id this.editConfig.infomation.client_name = row.name this.isChance = false - this.getChanceList(row.id) + this.getContactList(row) + this.getSalesLeadsList(row) + this.getChanceList(this.clientId) } else if (value === "chance") { this.editConfig.infomation.sale_chance_name = row.name this.saleChanceId = row.id + this.editConfig.infomation.client_name = row.client.name + this.clientId = row.client.id + this.getChanceList(this.clientId) } else { this.editConfig.infomation.sales_leads_name = row.name this.saleLeadId = row.id @@ -725,6 +767,7 @@ this.editConfig.infomation.sales_leads_name = "" this.saleLeadId = 0 } + this.refresh() }, // 娣诲姞闄勪欢 addAnnexClick() {}, @@ -749,7 +792,15 @@ } }, // 闃绘鍙偣鍑讳簨浠� - stopClick() {} + stopClick() {}, + // 閿�鍞礋璐d汉鑷畾涔夋牎楠岃鍒� + validateMemberId(rule, value, callback) { + if (this.editConfig.infomation?.member_id > 0) { + callback() + } else { + callback(new Error("璇疯緭鍏ヨ礋璐d汉")) + } + } } } </script> -- Gitblit v1.8.0