From da3dbb56388ae49097e50ded584ed2abb7f5022d Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 17 十月 2023 14:16:25 +0800
Subject: [PATCH] bug修复(5243)
---
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue | 56 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
index 5e5f9aa..7f09501 100644
--- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
+++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -93,12 +93,18 @@
"
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')"
>
@@ -572,6 +578,7 @@
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],
@@ -594,9 +601,6 @@
},
clientList() {
return this.$store.state.getClientName.clientList
- },
- contactNamelist() {
- return this.$store.state.getClientName.contactNamelist
}
},
data() {
@@ -640,17 +644,22 @@
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) {
@@ -703,6 +712,7 @@
// 淇濆瓨
saveClick(formName) {
this.$refs[formName].validate((valid) => {
+ this.validateFormNumber()
if (valid) {
console.log(this.editConfig.infomation)
const params = this.saveParams()
@@ -777,6 +787,19 @@
}
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 = []
@@ -796,9 +819,16 @@
handleSelectClient(value, item) {
if (value === "client") {
this.clientId = item.id
+ this.editConfig.infomation.client_name = item.name
+ this.editConfig.infomation.contact_name = ''
+ this.contactId = 0
+ this.isContact = false
+ this.getContactList(item.id)
} else if (value === "contact") {
+ this.editConfig.infomation.contact_name = item.name
this.contactId = item.id
}
+ this.refresh()
},
selClientClick(value) {
if (value === "client") {
@@ -814,6 +844,10 @@
} else if (value === "client") {
this.editConfig.infomation.client_name = row.name
this.clientId = row.id
+ this.editConfig.infomation.contact_name = ''
+ this.contactId = 0
+ this.isContact = false
+ this.getContactList(row.id)
}
this.refresh()
},
@@ -832,6 +866,9 @@
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
@@ -848,9 +885,8 @@
},
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 = ""
}
--
Gitblit v1.8.0