From acdff03246ce648082192dfb069c3a006a7fbee6 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期三, 09 八月 2023 18:46:06 +0800
Subject: [PATCH] 客户管理模块 批量删除、推进、跟进接口联调
---
src/views/client/client/AddClientManageDialog.vue | 182 ++++++++++++++++++++++-----------------------
1 files changed, 88 insertions(+), 94 deletions(-)
diff --git a/src/views/client/client/AddClientManageDialog.vue b/src/views/client/client/AddClientManageDialog.vue
index 53bb234..7200b7d 100644
--- a/src/views/client/client/AddClientManageDialog.vue
+++ b/src/views/client/client/AddClientManageDialog.vue
@@ -5,6 +5,8 @@
:visible.sync="editConfig.visible"
:width="dialogWidth"
:before-close="handleClose"
+ append-to-body
+ custom-class="iframe-dialog"
>
<el-form
ref="form"
@@ -23,7 +25,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="瀹㈡埛鍚嶇О" prop="name">
- <div class="client-name">
+ <div class="custom-name">
<el-input v-model="editConfig.infomation.name"></el-input>
<div class="common-select-btn"><i class="el-icon-house" title="宸ュ晢鏌ヨ"></i></div>
<div class="common-select-btn"><i class="el-icon-search" title="鏌ラ噸"></i></div>
@@ -126,7 +128,11 @@
</el-col> -->
<el-col :span="12">
<el-form-item label="涓嬫鍥炶鏃ユ湡" prop="next_visit_time">
- <el-date-picker v-model="editConfig.infomation.next_visit_time" type="date" placeholder="閫夋嫨鏃ユ湡">
+ <el-date-picker
+ v-model="editConfig.infomation.next_visit_time"
+ type="datetime"
+ placeholder="閫夋嫨鏃ユ湡"
+ >
</el-date-picker>
</el-form-item>
</el-col>
@@ -134,7 +140,7 @@
<el-form-item label="鏈�鏅氭湇鍔″埌鏈熸棩" prop="latest_service_time">
<el-date-picker
v-model="editConfig.infomation.latest_service_time"
- type="date"
+ type="datetime"
placeholder="閫夋嫨鏃ユ湡"
>
</el-date-picker>
@@ -153,12 +159,17 @@
</el-col>
<el-col :span="12">
<el-form-item label="鑱旂郴浜烘墜鏈�" prop="contact_phone">
- <el-input v-model="editConfig.infomation.contact_phone"></el-input>
+ <el-input
+ v-model="editConfig.infomation.contact_phone"
+ maxlength="11"
+ show-word-limit
+ oninput="value=value.replace(/[^\d]/g,'')"
+ ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="鑱旂郴浜鸿亴鍔�" prop="contact_duties">
- <el-input v-model="editConfig.infomation.contact_duties"></el-input>
+ <el-form-item label="鑱旂郴浜鸿亴鍔�" prop="position">
+ <el-input v-model="editConfig.infomation.position"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
@@ -466,7 +477,7 @@
<div slot="footer" class="dialog-footer">
<!-- <el-button type="primary" size="small" @click="editConfig.visible = false">淇濆苟鎻愪氦瀹℃壒</el-button> -->
<el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
- <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
+ <el-button size="small" @click="handleClose">鍙栨秷</el-button>
</div>
</el-dialog>
</div>
@@ -474,7 +485,6 @@
<script>
import { getAllData, getAddClient, getUpdateClient } from "@/api/client/client"
-import { dateFormat } from "@/common/config/index"
export default {
name: "AddClientManageDialog",
props: {
@@ -484,36 +494,8 @@
return {
visible: false,
title: "鏂板缓",
- infomation: {
- name: "",
- number: "AC6521",
- client_status_id: "",
- member_id: "5",
- client_type_id: "",
- clientSource: "",
- client_level_id: "",
- service_member_id: "",
- next_visit_time: "",
- latest_service_time: "",
- contact_name: "",
- contact_phone: "",
- contact_duties: "",
- contact_wechat: "1",
- contact_email: "",
- industry_id: "",
- representative: "",
- registration_time: "",
- registered_capital_id: "",
- enterprise_nature_id: "",
- enterprise_scale_id: "",
- business_scope: "",
- country_id: "",
- province_id: "",
- city_id: "",
- region_id: "",
- detail_address: "",
- remark: ""
- }
+ isSalesOpportunity: false,
+ infomation: {}
}
}
}
@@ -532,7 +514,16 @@
name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
client_status_id: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鐘舵��", trigger: "change" }],
member_id: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
- approvalOpinion: [{ required: true, message: "璇疯緭鍏ュ鎵规剰瑙�", trigger: "blur" }]
+ approvalOpinion: [{ required: true, message: "璇疯緭鍏ュ鎵规剰瑙�", trigger: "blur" }],
+ contact_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"
+ }
+ ]
},
memberOptions: [],
clientStatusOptions: [], // 瀹㈡埛鐘舵��
@@ -558,7 +549,6 @@
getCommonData() {
getAllData()
.then((res) => {
- console.log(res)
this.memberOptions = res.data.member
this.clientSourceOptions = res.data.client_origin
this.clientStatusOptions = res.data.client_status
@@ -579,6 +569,9 @@
},
handleClose() {
this.editConfig.visible = false
+ if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.sales_leads_id) {
+ this.$parent.handleClose()
+ }
},
// 淇濆瓨
saveClick(formName) {
@@ -597,7 +590,13 @@
message: "娣诲姞鎴愬姛",
type: "success"
})
- this.$parent.getData()
+ if (this.editConfig.isSalesOpportunity) {
+ this.$emit("salesOpportunityClick", this.editConfig.infomation)
+ } else if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.sales_leads_id) {
+ this.$parent.handleClose()
+ } else {
+ this.$parent.getData()
+ }
}
})
.catch((err) => {
@@ -637,18 +636,18 @@
client_status_id: data.client_status_id || 0,
client_type_id: data.client_type_id || 0,
contact: {
- birthday: "1970-01-01 08:00:00",
+ birthday: "",
city_id: 0,
client_id: 0,
country_id: 0,
- desc: "string",
+ desc: "",
email: data.contact_email || "",
is_first: true,
member_id: 0,
name: data.contact_name || "",
- number: "string",
+ number: "",
phone: data.contact_phone || "",
- position: data.contact_duties || "",
+ position: data.position || "",
province_id: 0,
region_id: 0,
wechat: data.contact_wechat || ""
@@ -658,7 +657,7 @@
enterprise_nature_id: data.enterprise_nature_id || 0,
enterprise_scale_id: data.enterprise_scale_id || 0,
industry_id: data.industry_id || 0,
- latest_service_time: dateFormat("YYYY-mm-dd HH:MM:ss", data.latest_service_time) || "",
+ latest_service_time: data.latest_service_time || "",
member_id: parseInt(data.member_id) || 0,
name: data.name || "",
next_visit_time: data.next_visit_time || "",
@@ -669,7 +668,8 @@
registration_time: data.registration_time || "",
remark: data.remark || "",
representative: data.representative || "",
- service_member_id: data.service_member_id || 0
+ service_member_id: data.service_member_id || 0,
+ sales_leads_id: data.sales_leads_id || 0
}
return params
},
@@ -689,62 +689,56 @@
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss" scoped>
-.add-client-manage {
- .basic-info {
- .basic-info-title {
- background-color: #f4f8fe;
- padding-left: 10px;
- font-size: 15px;
- font-weight: bold;
- color: #666;
- height: 42px;
- line-height: 42px;
- }
- .basic-info-view {
- margin-top: 10px;
- padding-right: 40px;
- .client-name {
- display: flex;
- .common-select-btn {
- margin-left: 5px;
- font-size: 18px;
+::v-deep {
+ .iframe-dialog .el-dialog__body {
+ .basic-info {
+ .basic-info-title {
+ background-color: #f4f8fe;
+ padding-left: 10px;
+ font-size: 15px;
+ font-weight: bold;
+ color: #666;
+ height: 42px;
+ line-height: 42px;
+ }
+ .basic-info-view {
+ margin-top: 10px;
+ padding-right: 40px;
+ .custom-name,
+ .common-select {
+ display: flex;
+ .common-select-btn {
+ margin-left: 5px;
+ font-size: 18px;
+ cursor: pointer;
+ }
+ }
+ .common-select {
+ .common-select-sel {
+ width: 270px;
+ }
}
}
- .common-select {
+ .annex-view {
display: flex;
- .common-select-sel {
- width: 270px;
- }
- .common-select-btn {
- margin-left: 5px;
- font-size: 16px;
- cursor: pointer;
+ color: #6166d3;
+ .setFormat {
+ margin-left: 10px;
}
}
}
- // .address-view {
- // margin-top: 10px;
- // padding-right: 40px;
- // }
- .annex-view {
+ .unflod-collapse {
display: flex;
+ height: 30px;
+ justify-content: center;
+ align-items: center;
color: #6166d3;
- .setFormat {
- margin-left: 10px;
- }
}
- }
- .unflod-collapse {
- display: flex;
- height: 30px;
- justify-content: center;
- align-items: center;
- color: #6166d3;
- }
- .dialog-footer {
- background-color: #f5f5f5;
- height: 55px;
- line-height: 55px;
+ .dialog-footer {
+ background-color: #f5f5f5;
+ height: 55px;
+ line-height: 55px;
+ }
}
}
</style>
--
Gitblit v1.8.0