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 | 181 ++++++++++++++++++++++++++++----------------
1 files changed, 115 insertions(+), 66 deletions(-)
diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
index 9bc0695..7f09501 100644
--- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
+++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -9,6 +9,7 @@
custom-class="iframe-dialog"
>
<el-form
+ v-if="refreshFlag"
ref="form"
:model="editConfig.infomation"
:rules="rules"
@@ -23,33 +24,38 @@
<div class="basic-info-title">鏈轰細鍩烘湰淇℃伅</div>
<div class="basic-info-view">
<el-row>
-<!-- <el-col :span="12">-->
-<!-- <el-form-item label="閿�鍞満浼氱紪鍙�" prop="number">-->
-<!-- <el-input v-model="editConfig.infomation.number"></el-input>-->
-<!-- </el-form-item>-->
-<!-- </el-col>-->
- <el-col :span="12">
- <el-form-item label="閿�鍞満浼氱紪鍙�" prop="number">
- <WordInput
- v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0"
- :codenumer="codenumer"
- :sum="sum"
- :disabled="editConfig.infomation.id || isIdDisabled"
- :inputValue="inputValue"
- @codeList="codeList"
- />
- <span v-else-if="method == 0" style="color: #f56c6c"
- >璇蜂紭鍏堥厤缃紪鐮佽鑼�
- <el-button type="text" @click="numberClick">
- 閰嶇疆瑙勮寖
- </el-button
- ></span
- >
- <span v-else>鑷姩鐢熸垚</span>
- </el-form-item>
- </el-col>
+ <!-- <el-col :span="12">-->
+ <!-- <el-form-item label="閿�鍞満浼氱紪鍙�" prop="number">-->
+ <!-- <el-input v-model="editConfig.infomation.number"></el-input>-->
+ <!-- </el-form-item>-->
+ <!-- </el-col>-->
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
+ <el-form-item label="閿�鍞満浼氱紪鍙�" prop="number">
+ <WordInput
+ v-if="codenumer && (explain != '' || isIdDisabled) && method == 0"
+ :codenumer="codenumer"
+ :sum="sum"
+ :disabled="editConfig.title !== '鏂板缓' || isIdDisabled"
+ :inputValue="inputValue"
+ @codeList="codeList"
+ />
+ <span v-else-if="method == 0" style="color: #f56c6c"
+ >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
+ >
+ <span v-else>{{ editConfig.title === "鏂板缓" ? "鑷姩鐢熸垚" : editConfig.infomation.number }}</span>
+ </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
v-model="editConfig.infomation.client_name"
@@ -74,15 +80,7 @@
</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">
@@ -95,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')"
>
@@ -110,7 +114,7 @@
</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"
@@ -132,7 +136,7 @@
</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"
@@ -572,11 +576,12 @@
import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
import SelectContactDialog from "@/views/other/commonDialog/SelectContactDialog"
import { getCityList } from "@/api/common/address"
-import WordInput from "@/components/wordInput.vue";
-import codeMixin from "@/views/client/followupRecords/mixin/codeMixin";
+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],
+ mixins: [codeMixin],
props: {
editCommonConfig: {
type: Object,
@@ -589,30 +594,30 @@
}
}
},
- components: {WordInput, SelectClientDialog, SelectContactDialog },
+ components: { WordInput, SelectClientDialog, SelectContactDialog },
computed: {
searchCommonHeight() {
return this.$refs.searchCommonView.offsetHeight
},
clientList() {
return this.$store.state.getClientName.clientList
- },
- contactNamelist() {
- return this.$store.state.getClientName.contactNamelist
}
},
data() {
return {
+ refreshFlag: true,
dialogWidth: "50%",
editConfig: this.editCommonConfig,
rules: {
number: [{ required: true, message: "璇疯緭鍏ラ攢鍞満浼氱紪鍙�", trigger: "blur" }],
name: [{ required: true, message: "璇疯緭鍏ユ満浼氬悕绉�", trigger: "blur" }],
+
member_id: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
sale_stage_id: [{ required: true, message: "璇烽�夋嫨閿�鍞樁娈�", trigger: "change" }],
currency: [{ required: true, message: "璇烽�夋嫨甯佺", trigger: "change" }],
expected_time: [{ required: true, message: "璇烽�夋嫨棰勮鎴愪氦鏃ユ湡", trigger: "change" }],
- projected_amount: [{ required: true, message: "璇疯緭鍏ラ璁″悎鍚岄噾棰�", trigger: "blur" }]
+ projected_amount: [{ required: true, message: "璇疯緭鍏ラ璁″悎鍚岄噾棰�", trigger: "blur" }],
+ client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛", trigger: "change" }]
},
businessSourceOptions: [],
memberOptions: [],
@@ -639,35 +644,40 @@
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();
+ this.formInfo()
+ if (this.editConfig.title === '缂栬緫'){
+ this.isContact = false
+ this.getContactList(this.editConfig.infomation.contact_id)
+ }
},
- watch:{
- 'editConfig.visible'(val){
- if(val){
+ watch: {
+ "editConfig.visible"(val) {
+ if (val) {
this.formInfo()
}
},
- 'editConfig.infomation.codeStandID'(){
+ "editConfig.infomation.codeStandID"() {
this.formInfo()
}
},
methods: {
- formInfo(){
- this.objCode.codeStandID = ''
- if(this.editConfig.infomation.codeStandID){
- this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
+ formInfo() {
+ this.objCode.codeStandID = ""
+ if (this.editConfig.infomation.codeStandID) {
+ this.objCode.codeStandID = this.editConfig.infomation.codeStandID
}
- this.getRCodeStandardList();
+ this.getRCodeStandardList()
},
getCommonData() {
this.editConfig.infomation.country_id = 1
@@ -702,6 +712,7 @@
// 淇濆瓨
saveClick(formName) {
this.$refs[formName].validate((valid) => {
+ this.validateFormNumber()
if (valid) {
console.log(this.editConfig.infomation)
const params = this.saveParams()
@@ -771,10 +782,23 @@
remark: data.remark || "",
detail_address: data.detail_address || "",
- codeStandID:data.ID,
- codeRule:this.codeRule,
+ codeStandID: data.ID,
+ codeRule: this.codeRule
}
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) {
@@ -795,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") {
@@ -813,17 +844,36 @@
} 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()
+ },
+ /**
+ * 寮哄埗鍒锋柊form缁勪欢
+ * 澶栭儴鏇存敼琛ㄥ崟鍊间笉浼氳Е鍙戣〃鍗曟牎楠�,瀵艰嚧鍗充娇鏈夊�煎琚〃鍗曟牎楠岄樆濉炰綇
+ */
+ refresh() {
+ this.refreshFlag = false
+ requestAnimationFrame(() => {
+ this.refreshFlag = true
+ })
},
// 娓呴櫎宸查�夋嫨鐢ㄦ埛
clearupClient(value) {
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
}
+ this.refresh()
},
// 娣诲姞闄勪欢
addAnnexClick() {},
@@ -835,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 = ""
}
@@ -879,8 +928,8 @@
flex: 1;
}
}
- .custom-name{
- .el-autocomplete{
+ .custom-name {
+ .el-autocomplete {
flex: 1;
}
}
--
Gitblit v1.8.0