From 6b429de2d970f581fef27fbc2eb4d891bd97e055 Mon Sep 17 00:00:00 2001
From: songshankun <songshankun@foxmail.com>
Date: 星期一, 25 九月 2023 17:37:18 +0800
Subject: [PATCH] style: 销售子单模块样式调整
---
src/views/client/client/AddClientManageDialog.vue | 94 ++++++++++++++++++++++++++--------------------
1 files changed, 53 insertions(+), 41 deletions(-)
diff --git a/src/views/client/client/AddClientManageDialog.vue b/src/views/client/client/AddClientManageDialog.vue
index 25552c5..5c15e02 100644
--- a/src/views/client/client/AddClientManageDialog.vue
+++ b/src/views/client/client/AddClientManageDialog.vue
@@ -27,8 +27,8 @@
<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-house" title="宸ュ晢鏌ヨ"></i></div>
- <div class="common-select-btn"><i class="el-icon-search" title="鏌ラ噸"></i></div>
+ <!-- <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> -->
</div>
</el-form-item>
</el-col>
@@ -490,7 +490,7 @@
</template>
<script>
-import { getAllData, getAddClient, getUpdateClient } from "@/api/client/client"
+import { getAllData, getAddClient, getUpdateClient, checkNameClient } from "@/api/client/client"
import { getCityList } from "@/api/common/address"
export default {
name: "AddClientManageDialog",
@@ -518,7 +518,13 @@
dialogWidth: "80%",
editConfig: this.editClientManageConfig,
rules: {
- name: [{ required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" }],
+ name: [
+ { required: true, message: "璇疯緭鍏ュ鎴峰悕绉�", trigger: "blur" },
+ {
+ validator: this.checkNameClient,
+ trigger: "blur"
+ }
+ ],
client_status_id: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鐘舵��", trigger: "change" }],
member_id: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
approvalOpinion: [{ required: true, message: "璇疯緭鍏ュ鎵规剰瑙�", trigger: "blur" }],
@@ -528,6 +534,14 @@
{
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"
+ }
+ ],
+ contact_email: [
+ { required: false, message: "", trigger: "blur" },
+ {
+ pattern: /^[a-zA-Z0-9_\\.]+@[a-zA-Z0-9-]+[\\.a-zA-Z]+$/,
+ message: "璇疯緭鍏ユ纭殑閭鏍煎紡",
trigger: "blur"
}
]
@@ -546,7 +560,8 @@
provinceOptions: [], // 鐪佷唤
cityOptions: [], // 鍩庡競
regionOptions: [], // 鍖哄煙
- approvalWorkflowOptions: [] // 瀹℃壒娴佺▼
+ approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
+ clientName: this.editClientManageConfig.infomation.name
}
},
created() {
@@ -595,43 +610,29 @@
const params = this.saveParams()
console.log(params)
if (this.editConfig.title === "鏂板缓") {
- getAddClient(params)
- .then((res) => {
- console.log(res)
- this.editConfig.visible = false
- if (res.code === 200) {
- this.$message({
- message: "娣诲姞鎴愬姛",
- type: "success"
- })
- 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) => {
- console.log(err)
- })
- } else {
- getUpdateClient(params)
- .then((res) => {
- console.log(res)
- this.editConfig.visible = false
- if (res.code === 200) {
- this.$message({
- message: "缂栬緫鎴愬姛",
- type: "success"
- })
+ getAddClient(params).then((res) => {
+ console.log(res)
+ this.editConfig.visible = false
+ if (res.code === 200) {
+ this.$message.success("娣诲姞鎴愬姛")
+ 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) => {
- console.log(err)
- })
+ }
+ })
+ } else {
+ getUpdateClient(params).then((res) => {
+ console.log(res)
+ this.editConfig.visible = false
+ if (res.code === 200) {
+ this.$message.success("缂栬緫鎴愬姛")
+ this.$parent.getData()
+ }
+ })
}
} else {
console.log("error submit")
@@ -683,7 +684,8 @@
remark: data.remark || "",
representative: data.representative || "",
service_member_id: data.service_member_id || 0,
- sales_leads_id: data.sales_leads_id || 0
+ sales_leads_id: data.sales_leads_id || 0,
+ contact_id: data.contact_id || 0
}
return params
},
@@ -711,6 +713,16 @@
}
}
})
+ },
+ // 鏌ラ噸
+ async checkNameClient(rule, value, callback) {
+ if (this.editConfig.title === "鏂板缓" || this.clientName !== this.editConfig.infomation.name) {
+ await checkNameClient({ name: value }).then((res) => {
+ if (res.data.code === 700001) {
+ return callback(new Error("瀹㈡埛鍚嶇О閲嶅"))
+ }
+ })
+ }
}
}
}
--
Gitblit v1.8.0