From 72f6f5abb7d6a90c9edfb69db63907ef3e17ef03 Mon Sep 17 00:00:00 2001
From: zuozhengqing <a13193816592@163.com>
Date: 星期三, 22 十一月 2023 11:31:27 +0800
Subject: [PATCH] 销售明细单添加确认订单前确认是否选择项目
---
src/views/client/followupRecords/AddFollowupRecordsDialog.vue | 80 +++++++++++++++++++++++++---------------
1 files changed, 50 insertions(+), 30 deletions(-)
diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
index 8fdce8a..1fbdcef 100644
--- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
+++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue
@@ -24,7 +24,20 @@
<el-row>
<el-col :span="12" v-if="isUnflod">
<el-form-item label="璺熻繘璁板綍缂栧彿" prop="number">
- <WordInput
+ <el-input
+ v-if="
+ 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"
@@ -35,7 +48,7 @@
<span v-else-if="method == 0" style="color: #f56c6c"
>璇蜂紭鍏堥厤缃紪鐮佽鑼� <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">
@@ -95,7 +108,12 @@
value-key="name"
@select="handleSelectClient('contact', $event)"
style="width: 100%"
- ></el-autocomplete>
+ >
+ // 瑙e喅鍖归厤涓嶅埌鎻愮ず鏃犲尮閰嶆暟鎹�
+ <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>
@@ -341,7 +359,7 @@
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 codeMixin from "@/components/makepager/mixin/codeMixin"
import { getContactList } from "@/api/client/contacts"
import { mapActions } from "vuex"
import { getSaleChanceList } from "@/api/sales/salesOpportunity"
@@ -379,22 +397,13 @@
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 {
dialogWidth: "50%",
editConfig: this.editContactsConfig,
rules: {
- number: [{ required: true, message: "璇疯緭鍏ヨ窡杩涜褰曠紪鍙�", trigger: "blur" }],
+ number: [{ required: true, validator: this.validateCheckCode, trigger: ["blur", "change"] }],
member_id: [{ required: true, message: "璇烽�夋嫨璐熻矗浜�", trigger: "change" }],
record: [{ required: true, message: "璇疯緭鍏ヨ窡杩涜褰�", trigger: "blur" }],
client_name: [{ required: true, validator: this.checkClient, trigger: "change" }],
@@ -449,26 +458,24 @@
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) {
if (val) {
this.formInfo()
}
- },
- "editContactsConfig.infomation.codeStandID"() {
- this.formInfo()
}
},
methods: {
@@ -514,7 +521,6 @@
// 淇濆瓨
saveClick(formName) {
this.$refs[formName].validate((valid) => {
- this.validateFormNumber()
if (valid) {
const params = this.saveParams()
if (this.editConfig.title === "鏂板缓") {
@@ -558,8 +564,7 @@
sale_chance_id: this.saleChanceId || 0,
sales_leads_id: this.saleLeadId || 0,
topic: data.topic || "",
- codeStandID: data.ID,
- codeRule: this.codeRule
+ codeStandID: data.ID
}
}
let params = {}
@@ -596,7 +601,13 @@
} 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) {
@@ -614,6 +625,7 @@
pageSize: 15
}).then((res) => {
if (res.code === 200) {
+ console.log(res, "鑱旂郴浜�")
this.contactNamelist = res.data.list
}
})
@@ -632,7 +644,9 @@
},
async handleSelectClient(value, item) {
if (value === "client") {
- console.log(item, "item")
+ 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
@@ -657,6 +671,7 @@
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
@@ -669,9 +684,9 @@
this.editConfig.infomation.contact_name = row.name
this.contactId = row.id
} else if (value === "client") {
- // this.editConfig.infomation.client_name = row.name;
- // this.clientId = row.id;
- // this.isChance = false;
+ 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
@@ -692,6 +707,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
@@ -729,7 +747,9 @@
} else {
callback(new Error("璇烽�夋嫨瀹㈡埛鍚嶇О"))
}
- }
+ },
+ // 闃绘鍙偣鍑讳簨浠�
+ stopClick() {}
}
}
</script>
--
Gitblit v1.8.0