From 6887629cbd7c09407d25a6199d8ddd878d17da4f Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期二, 24 十月 2023 17:50:11 +0800 Subject: [PATCH] 客户管理,跟进记录,线索,发票,合同管理,总单,报价单,退款单,明细单,机会,退货单,子单,客户服务单,服务合同,服务回访单连天 --- src/views/client/followupRecords/AddFollowupRecordsDialog.vue | 157 ++++++++++++++++++++++++++++++++------------------- 1 files changed, 98 insertions(+), 59 deletions(-) diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue index 4e4b6a1..5758864 100644 --- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue +++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue @@ -24,12 +24,23 @@ <el-row> <el-col :span="12" v-if="isUnflod"> <el-form-item label="璺熻繘璁板綍缂栧彿" prop="number"> - <WordInput + <el-input v-if=" - codenumer && - (explain != '' || isIdDisabled) && - method == 0 + editConfig.title == '缂栬緫' || + (editConfig.title == '鏂板缓' && + codenumer && + (explain != '' || isIdDisabled)) " + :disabled="editConfig.title == '缂栬緫'" + v-model="editConfig.infomation.number" + placeholder="璇疯緭鍏ョ紪鐮�" + > + </el-input> + <span v-else-if="editConfig.title == '鏂板缓'" style="color: #f56c6c" + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span + > + <!-- <WordInput + v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" :codenumer="codenumer" :sum="sum" :disabled="this.editConfig.title !== '鏂板缓' || isIdDisabled" @@ -37,12 +48,9 @@ @codeList="codeList" /> <span v-else-if="method == 0" style="color: #f56c6c" - >璇蜂紭鍏堥厤缃紪鐮佽鑼� - <el-button type="text" @click="numberClick"> - 閰嶇疆瑙勮寖 - </el-button></span + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span > - <span v-else>鑷姩鐢熸垚</span> + <span v-else>鑷姩鐢熸垚</span> --> </el-form-item> </el-col> <el-col :span="12"> @@ -78,7 +86,7 @@ </div> </el-form-item> </el-col> - <el-col v-if="isUnflod" :span="12"> + <el-col v-if="isUnflod && !isDetail" :span="12"> <el-form-item label="瀹㈡埛鐘舵��" prop="client_status_id"> <div class="common-select"> <el-select @@ -217,7 +225,7 @@ </div> </el-form-item> </el-col> - <el-col :span="12"> + <el-col :span="12" v-if="!isDetail"> <el-form-item label="閿�鍞嚎绱�" prop="sales_leads_name"> <div class="custom-name"> <!-- <el-input v-model="editConfig.infomation.sales_leads_id"></el-input> --> @@ -397,12 +405,11 @@ import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"; import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"; import SelectLeadDialog from "@/views/other/commonDialog/SelectLeadDialog"; -import codeMixin from "./mixin/codeMixin"; -import { getContactList } from "@/api/client/contacts" +import codeMixin from "@/components/makepager/mixin/codeMixin"; +import { getContactList } from "@/api/client/contacts"; import { mapActions } from "vuex"; import { getSaleChanceList } from "@/api/sales/salesOpportunity"; -import { getSalesLeadsList } from "@/api/client/salesLead" - +import { getSalesLeadsList } from "@/api/client/salesLead"; export default { name: "AddFollowupRecordsDialog", @@ -418,6 +425,10 @@ }; }, }, + isDetail: { + type: Boolean, + default: false, + }, }, components: { SelectClientDialog, @@ -432,15 +443,15 @@ clientList() { return this.$store.state.getClientName.clientList; }, - contactNamelist() { - return this.$store.state.getClientName.contactNamelist; - }, + // contactNamelist() { + // return this.$store.state.getClientName.contactNamelist + // }, // saleChancelist() { // return this.$store.state.getClientName.saleChancelist // }, - saleLeadlist() { - return this.$store.state.getClientName.saleLeadlist; - }, + // saleLeadlist() { + // return this.$store.state.getClientName.saleLeadlist + // } }, data() { return { @@ -448,7 +459,7 @@ editConfig: this.editContactsConfig, rules: { number: [ - { required: true, message: "璇疯緭鍏ヨ窡杩涜褰曠紪鍙�", trigger: "blur" }, + { required: true, validator: this.validateCheckCode, trigger: ["blur",'change'] }, ], member_id: [ { required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }, @@ -457,7 +468,7 @@ { required: true, message: "璇疯緭鍏ヨ窡杩涜褰�", trigger: "blur" }, ], client_name: [ - { required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }, + { required: true, validator: this.checkClient, trigger: "change" }, ], contact_name: [ { required: true, message: "璇烽�夋嫨鑱旂郴浜哄鍚�", trigger: "change" }, @@ -494,19 +505,19 @@ editVisible: false, title: "", infomation: {}, - search_map:{} + search_map: {}, }, editSelectChanceConfig: { editVisible: false, title: "", infomation: {}, - search_map:{}, + search_map: {}, }, editSelectLeadConfig: { editVisible: false, title: "", infomation: {}, - search_map:{}, + search_map: {}, }, clientId: this.editContactsConfig.infomation.client_id, contactId: this.editContactsConfig.infomation.contact_id, @@ -518,9 +529,9 @@ }, created() { this.$store.dispatch("geClient"); - this.$store.dispatch("geContact"); + // this.$store.dispatch("geContact") // this.$store.dispatch("geChance") - this.$store.dispatch("geLead"); + // this.$store.dispatch("geLead") this.getCommonData(); this.getContactInfoList(); this.formInfo(); @@ -531,12 +542,9 @@ this.formInfo(); } }, - "editContactsConfig.infomation.codeStandID"() { - this.formInfo(); - }, }, methods: { - ...mapActions(["getContactFilter","getLeadFilter"]), + ...mapActions(["getContactFilter", "getLeadFilter"]), formInfo() { this.objCode.type = "璺熻繘璁板綍缂栫爜"; this.objCode.codeStandID = ""; @@ -550,7 +558,7 @@ console.log(res); this.clientStatusOptions = res.data.client_status; this.memberOptions = res.data.member; - this.dataProcess(); + // this.dataProcess() }); }, async getContactInfoList() { @@ -622,7 +630,6 @@ sales_leads_id: this.saleLeadId || 0, topic: data.topic || "", codeStandID: data.ID, - codeRule: this.codeRule, }, }; let params = {}; @@ -671,32 +678,42 @@ ); }; }, - async handleSelectClient(value, item) { - if (value === "client") { - console.log(item,"item") - this.editSelectContactConfig.search_map.client_id=item.id - this.editSelectChanceConfig.search_map.client_id=item.id - this.editSelectLeadConfig.search_map.name=item.name - await getContactList({ - search_map:{ - client_id:item.id + // 鑱旂郴浜哄垪琛� + async getContactList(item) { + await getContactList({ + search_map: { + client_id: item.id, }, page: 1, - pageSize: 15 - }).then((res) => { - if (res.code === 200) { - this.getContactFilter(res.data.list); - } - }); - await getSalesLeadsList({ - search_map:{ - name:item.name - }, - }).then((res) => { - if (res.code === 200) { - this.getLeadFilter(res.data.list); - } - }); + pageSize: 15, + }).then((res) => { + if (res.code === 200) { + this.contactNamelist = res.data.list; + } + }); + }, + // 閿�鍞嚎绱� + async getSalesLeadsList(item) { + await getSalesLeadsList({ + search_map: { + name: item.name, + }, + }).then((res) => { + if (res.code === 200) { + this.saleLeadlist = res.data.list; + } + }); + }, + async handleSelectClient(value, item) { + if (value === "client") { + this.editConfig.infomation.contact_name = ""; + this.editConfig.infomation.sales_leads_name = ""; + this.editConfig.infomation.sale_chance_name = ""; + this.editSelectContactConfig.search_map.client_id = item.id; + this.editSelectChanceConfig.search_map.client_id = item.id; + this.editSelectLeadConfig.search_map.name = item.name; + this.getContactList(item); + this.getSalesLeadsList(item); this.clientId = item.id; this.editConfig.infomation.client_name = item.name; this.isChance = false; @@ -728,8 +745,16 @@ this.editConfig.infomation.contact_name = row.name; this.contactId = row.id; } else if (value === "client") { - this.editConfig.infomation.client_name = row.name; + this.editConfig.infomation.contact_name = ""; + this.editConfig.infomation.sales_leads_name = ""; + this.editConfig.infomation.sale_chance_name = ""; + 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); } else if (value === "chance") { @@ -743,6 +768,9 @@ // 娓呴櫎宸查�夋嫨鐢ㄦ埛 clearupClient(value) { if (value === "client") { + this.editConfig.infomation.contact_name = ""; + this.editConfig.infomation.sales_leads_name = ""; + this.editConfig.infomation.sale_chance_name = ""; this.editConfig.infomation.client_name = ""; this.clientId = 0; this.isChance = true; @@ -773,6 +801,17 @@ this.isUnflod = true; } }, + // 瀹㈡埛鍚嶇О鍗曠嫭鏍¢獙 + checkClient(rule, value, callback) { + if ( + this.editConfig.infomation.client_name && + this.editConfig.infomation.client_name.length > 0 + ) { + callback(); + } else { + callback(new Error("璇烽�夋嫨瀹㈡埛鍚嶇О")); + } + }, }, }; </script> -- Gitblit v1.8.0