From dd3d892936eff96a4418cfaa8f3c4219dfa23f1d Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期一, 24 七月 2023 14:30:19 +0800 Subject: [PATCH] config修改 --- src/views/client/followupRecords/AddFollowupRecordsDialog.vue | 101 ++++++++++++++++++++++++++++++++------------------ 1 files changed, 65 insertions(+), 36 deletions(-) diff --git a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue index 3828cfd..0302ab4 100644 --- a/src/views/client/followupRecords/AddFollowupRecordsDialog.vue +++ b/src/views/client/followupRecords/AddFollowupRecordsDialog.vue @@ -23,9 +23,18 @@ <el-col :span="12"> <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name"> <div class="custom-name"> - <el-input v-model="editConfig.infomation.client_name"></el-input> - <div class="common-select-btn"><i class="el-icon-circle-plus-outline"></i></div> - <div class="common-select-btn"><i class="el-icon-edit-outline"></i></div> + <el-autocomplete + v-model="editConfig.infomation.client_name" + :fetch-suggestions="querySearchAsync" + value-key="name" + @select="handleSelectClient" + ></el-autocomplete> + <div class="common-select-btn" @click="selClientClick"> + <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> + </div> + <div class="common-select-btn" @click="clearupClient"> + <i class="el-icon-edit-outline" title="娓呴櫎"></i> + </div> </div> </el-form-item> </el-col> @@ -181,6 +190,12 @@ <el-button type="primary" size="small" @click="saveClick('form')">淇� 瀛�</el-button> <el-button size="small" @click="editConfig.visible = false">鍙� 娑�</el-button> </div> + <!-- 閫夋嫨瀹㈡埛 --> + <SelectClientDialog + v-if="editSelectClientConfig.editVisible" + :edit-common-config="editSelectClientConfig" + @selClient="selClient" + /> </el-dialog> </div> </template> @@ -188,6 +203,7 @@ <script> import { getAllData } from "@/api/client/client" import { getAddFollowRecord, getUpdateFollowRecord } from "@/api/client/followupRecords" +import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" export default { name: "AddFollowupRecordsDialog", props: { @@ -197,30 +213,18 @@ return { visible: false, title: "鏂板缓", - infomation: { - client_name: "", - number: "", - client_status_id: "", - contact_id: "", - member_id: "", - topic: "", - record: "", - phoneNumber: "", - sale_chance_id: "", - sales_leads_id: "", - follow_time: "", - next_follow_time: "", - purpose: "", - content: "" - } + infomation: {} } } } }, - components: {}, + components: { SelectClientDialog }, computed: { searchCommonHeight() { return this.$refs.searchCommonView.offsetHeight + }, + clientList() { + return this.$store.state.getClientName.clientList } }, data() { @@ -236,10 +240,16 @@ clientStatusOptions: [], // 瀹㈡埛鐘舵�� memberOptions: [], unflodCollapseStr: "鏀惰捣", - isUnflod: true + isUnflod: true, + editSelectClientConfig: { + editVisible: false, + title: "", + infomation: {} + } } }, created() { + this.$store.dispatch("geClient") this.getCommonData() }, methods: { @@ -331,6 +341,33 @@ } return params }, + // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶 + querySearchAsync(queryString, cb) { + var restaurants = this.clientList + var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants + cb(results) + }, + createStateFilter(queryString) { + return (state) => { + return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + } + }, + handleSelectClient(item) { + this.editConfig.infomation.client_id = item.id + }, + selClientClick() { + this.editSelectClientConfig.editVisible = true + }, + selClient(row) { + console.log(row) + this.editConfig.infomation.client_name = row.name + this.editConfig.infomation.client_id = row.id + }, + // 娓呴櫎宸查�夋嫨鐢ㄦ埛 + clearupClient() { + this.editConfig.infomation.client_name = "" + this.editConfig.infomation.client_id = 0 + }, // 娣诲姞闄勪欢 addAnnexClick() {}, // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 @@ -365,28 +402,20 @@ .basic-info-view { margin-top: 10px; padding-right: 40px; - .custom-name { - display: flex; - .common-select-btn { - margin-left: 5px; - font-size: 16px; - } - } + .custom-name, .common-select { display: flex; - .common-select-sel { - width: 270px; - } .common-select-btn { margin-left: 5px; - font-size: 16px; + font-size: 18px; cursor: pointer; } } - } - .address-view { - margin-top: 10px; - padding-right: 40px; + .common-select { + .common-select-sel { + width: 270px; + } + } } .annex-view { display: flex; -- Gitblit v1.8.0