| | |
| | | value-key="name" |
| | | @select="handleSelectClient('contact', $event)" |
| | | style="width: 100%" |
| | | ></el-autocomplete> |
| | | > |
| | | // 解决匹配不到提示无匹配数据 |
| | | <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> |
| | |
| | | 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 { |
| | |
| | | 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" }], |
| | |
| | | saleChanceId: this.editContactsConfig.infomation.sale_chance_id, |
| | | saleLeadId: this.editContactsConfig.infomation.sales_leads_id, |
| | | saleChancelist: [], |
| | | isChance: true |
| | | isChance: true, |
| | | noData: false // 是否匹配到数据了 |
| | | } |
| | | }, |
| | | created() { |
| | | 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) { |
| | |
| | | console.log(res) |
| | | this.clientStatusOptions = res.data.client_status |
| | | this.memberOptions = res.data.member |
| | | if (this.editContactsConfig.title === "新建") { |
| | | let username = document.cookie.replace(/(?:(?:^|.*;\s*)username\s*=\s*([^;]*).*$)|^.*$/, "$1") |
| | | this.memberOptions.map((item) => { |
| | | if (item.username == username) { |
| | | this.editConfig.infomation.member_id = item.id |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // this.dataProcess() |
| | | }) |
| | | }, |
| | |
| | | } 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) { |
| | |
| | | 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 |
| | |
| | | } else { |
| | | callback(new Error("请选择客户名称")) |
| | | } |
| | | }, |
| | | // 阻止可点击事件 |
| | | stopClick() {}, |
| | | // 销售负责人自定义校验规则 |
| | | validateMemberId(rule, value, callback) { |
| | | console.log(this.editConfig.infomation.member_id, "销售负责人自定义校验规则") |
| | | if (this.editConfig.infomation?.member_id > 0) { |
| | | callback() |
| | | } else { |
| | | callback(new Error("请输入负责人")) |
| | | } |
| | | } |
| | | } |
| | | } |