From 4a2ae34a3cf85f5e8b0409b858cfbb12ef8b5ee2 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 02 八月 2023 11:18:51 +0800
Subject: [PATCH] 注掉暂不支持内容
---
src/views/client/contacts/AddContactsDialog.vue | 124 ++++++++++++++++++++++++++++-------------
1 files changed, 85 insertions(+), 39 deletions(-)
diff --git a/src/views/client/contacts/AddContactsDialog.vue b/src/views/client/contacts/AddContactsDialog.vue
index 031c837..94b7394 100644
--- a/src/views/client/contacts/AddContactsDialog.vue
+++ b/src/views/client/contacts/AddContactsDialog.vue
@@ -5,6 +5,7 @@
:visible.sync="editConfig.visible"
:width="dialogWidth"
:before-close="handleClose"
+ :close-on-click-modal="false"
>
<el-form
ref="form"
@@ -31,18 +32,31 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О" prop="client_id">
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
<div class="custom-name">
- <el-input v-model="editConfig.infomation.client_id"></el-input>
- <div class="common-select-btn">
- <i class="el-icon-circle-plus-outline"></i>
+ <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>
<el-col :span="12">
<el-form-item label="鎵嬫満" prop="phone">
- <el-input v-model="editConfig.infomation.phone"></el-input>
+ <el-input
+ v-model="editConfig.infomation.phone"
+ maxlength="11"
+ show-word-limit
+ oninput="value=value.replace(/[^\d]/g,'')"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -162,12 +176,12 @@
<div v-if="isUnflod" class="basic-info-view">
<el-row>
<el-col :span="24">
- <el-form-item label="澶囨敞" prop="notes">
+ <el-form-item label="澶囨敞" prop="desc">
<el-input
type="textarea"
:autosize="{ minRows: 2, maxRows: 4 }"
placeholder="璇疯緭鍏ュ唴瀹�"
- v-model="editConfig.infomation.notes"
+ v-model="editConfig.infomation.desc"
></el-input>
</el-form-item>
</el-col>
@@ -212,6 +226,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>
@@ -219,6 +239,7 @@
<script>
import { getAddContact, getUpdateContact } from "@/api/client/contacts"
import { getAllData } from "@/api/client/client"
+import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
name: "AddContactsDialog",
props: {
@@ -228,31 +249,17 @@
return {
visible: false,
title: "鏂板缓",
- infomation: {
- name: "",
- number: "LEA50",
- client_id: "",
- phone: "",
- position: "",
- member_id: "5",
- is_first: false,
- wechat: "1",
- birthday: "",
- email: "",
- nextFollowupDate: "",
- country_id: "",
- province_id: "",
- city_id: "",
- region_id: "",
- postalCode: "",
- notes: ""
- }
+ infomation: {}
}
}
}
},
- components: {},
- computed: {},
+ components: { SelectClientDialog },
+ computed: {
+ clientList() {
+ return this.$store.state.getClientName.clientList
+ }
+ },
data() {
return {
dialogWidth: "80%",
@@ -260,7 +267,16 @@
rules: {
name: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }],
- member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
+ member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }],
+ phone: [
+ { required: false, message: "", trigger: "blur" },
+ { len: 11, message: "闀垮害鍦�11涓瓧绗�", trigger: "blur" },
+ {
+ pattern: /^1(3\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
+ message: "璇疯緭鍏ユ纭殑鎵嬫満鍙�",
+ trigger: "blur"
+ }
+ ]
},
businessSourceOptions: [
{ value: "1", label: "鍚庡彴娉ㄥ唽" },
@@ -278,10 +294,16 @@
cityOptions: [], // 鍩庡競
regionOptions: [], // 鍖哄煙
unflodCollapseStr: "鏀惰捣",
- isUnflod: true
+ isUnflod: true,
+ editSelectClientConfig: {
+ editVisible: false,
+ title: "",
+ infomation: {}
+ }
}
},
created() {
+ this.$store.dispatch("geClient")
this.getCommonData()
},
methods: {
@@ -351,9 +373,10 @@
saveParams() {
let data = this.editConfig.infomation
let params = {
+ id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
birthday: data.birthday || "",
city_id: data.city_id || 0,
- client_id: 0,
+ client_id: parseInt(data.client_id) || 0,
country_id: data.country_id || 0,
desc: data.desc || "",
email: data.email || "",
@@ -368,6 +391,33 @@
wechat: data.wechat || ""
}
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() {},
@@ -403,22 +453,18 @@
.basic-info-view {
margin-top: 10px;
padding-right: 40px;
- .custom-name {
+ .custom-name,
+ .common-select {
display: flex;
.common-select-btn {
margin-left: 5px;
- font-size: 16px;
+ font-size: 18px;
+ cursor: pointer;
}
}
.common-select {
- display: flex;
.common-select-sel {
width: 270px;
- }
- .common-select-btn {
- margin-left: 5px;
- font-size: 16px;
- cursor: pointer;
}
}
}
--
Gitblit v1.8.0