| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="机会名称" prop="name"> |
| | | <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> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="客户名称" prop="client_name" ref="clientName"> |
| | | <div class="custom-name"> |
| | | <el-autocomplete |
| | |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="机会名称" prop="name"> |
| | | <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> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-form-item label="联系人姓名" prop="contact_name"> |
| | | <div class="custom-name"> |
| | |
| | | " |
| | | value-key="name" |
| | | @select="handleSelectClient('contact', $event)" |
| | | placeholder="请先选择客户名称" |
| | | :disabled="isContact" |
| | | ></el-autocomplete> |
| | | <div class="common-select-btn" @click="selClientClick('contact')"> |
| | | <div v-if="!isContact" class="common-select-btn" @click="selClientClick('contact')"> |
| | | <i class="el-icon-circle-plus-outline" title="选择"></i> |
| | | </div> |
| | | <div |
| | | v-if="editConfig.infomation.contact_name && editConfig.infomation.contact_name.length > 0" |
| | | v-if=" |
| | | editConfig.infomation.contact_name && |
| | | editConfig.infomation.contact_name.length > 0 && |
| | | !isContact |
| | | " |
| | | class="common-select-btn" |
| | | @click="clearupClient('contact')" |
| | | > |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="商机来源" prop="sales_sources_id"> |
| | | <el-form-item label="机会来源" prop="sales_sources_id"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.sales_sources_id" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="商机类型" prop="sale_type_id"> |
| | | <el-form-item label="机会类型" prop="sale_type_id"> |
| | | <div class="common-select"> |
| | | <el-select |
| | | v-model="editConfig.infomation.sale_type_id" |
| | |
| | | import { getCityList } from "@/api/common/address" |
| | | import WordInput from "@/components/wordInput.vue" |
| | | import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" |
| | | import { getContactList } from "@/api/client/contacts" |
| | | export default { |
| | | name: "AddSalesOpportunityDialog", |
| | | mixins: [codeMixin], |
| | |
| | | }, |
| | | clientList() { |
| | | return this.$store.state.getClientName.clientList |
| | | }, |
| | | contactNamelist() { |
| | | return this.$store.state.getClientName.contactNamelist |
| | | } |
| | | }, |
| | | data() { |
| | |
| | | restaurants: [], |
| | | clientId: this.editCommonConfig.infomation.client_id, |
| | | contactId: this.editCommonConfig.infomation.contact_id, |
| | | objCode: { name: "", page: 0, pageSize: 0, type: "销售机会编码", codeStandID: "" } |
| | | objCode: { name: "", page: 0, pageSize: 0, type: "销售机会编码", codeStandID: "" }, |
| | | isContact: true, |
| | | contactNamelist: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$store.dispatch("geClient") |
| | | this.$store.dispatch("geContact") |
| | | if (this.editConfig.title !== "新建" && this.editConfig.infomation.province_id !== 0) { |
| | | this.getCityList(this.editConfig.infomation.province_id, "edit") |
| | | } |
| | | this.getCommonData() |
| | | this.formInfo() |
| | | if (this.editConfig.title === '编辑'){ |
| | | this.isContact = false |
| | | this.getContactList(this.editConfig.infomation.contact_id) |
| | | } |
| | | }, |
| | | watch: { |
| | | "editConfig.visible"(val) { |
| | |
| | | } |
| | | return params |
| | | }, |
| | | // 获取联系人列表 |
| | | getContactList(id) { |
| | | getContactList({ |
| | | clientId: id, |
| | | page: 0, |
| | | pageSize: 0, |
| | | search_map: {} |
| | | }).then((res) => { |
| | | if (res.code == 200) { |
| | | this.contactNamelist = res.data.list |
| | | } |
| | | }) |
| | | }, |
| | | // 选择用户相关方法 |
| | | querySearchAsync(queryString, cb, value) { |
| | | var restaurants = [] |
| | |
| | | handleSelectClient(value, item) { |
| | | if (value === "client") { |
| | | this.clientId = item.id |
| | | this.isContact = false |
| | | this.getContactList(item.id) |
| | | } else if (value === "contact") { |
| | | this.contactId = item.id |
| | | } |
| | |
| | | if (value === "contact") { |
| | | this.editConfig.infomation.contact_name = row.name |
| | | this.contactId = row.id |
| | | this.isContact = false |
| | | this.getContactList(row.id) |
| | | } else if (value === "client") { |
| | | this.editConfig.infomation.client_name = row.name |
| | | this.clientId = row.id |
| | |
| | | if (value === "client") { |
| | | this.editConfig.infomation.client_name = "" |
| | | this.clientId = 0 |
| | | this.isContact = true |
| | | this.editConfig.infomation.contact_name = "" |
| | | this.contactId = 0 |
| | | } else if (value === "contact") { |
| | | this.editConfig.infomation.contact_name = "" |
| | | this.contactId = 0 |
| | |
| | | }, |
| | | async getCityList(val, value) { |
| | | await getCityList({ province_id: val }).then((res) => { |
| | | console.log(res) |
| | | if (res.data.code === 200) { |
| | | this.cityOptions = res.data.data.list |
| | | if (res.code === 200) { |
| | | this.cityOptions = res.data.list |
| | | if (value === "sel") { |
| | | this.editConfig.infomation.city_id = "" |
| | | } |