|
@@ -1,17 +1,11 @@
|
|
|
<template>
|
|
|
<div class="content" v-loading="loading">
|
|
|
- <!-- <div class="company">
|
|
|
- <i class="el-icon-office-building icon"> </i>
|
|
|
- <span class="company-name"> {{ detailsData.corporateName }} </span>
|
|
|
- </div> -->
|
|
|
<div class="line">
|
|
|
- <span class="title_">客户代码:</span
|
|
|
- ><span>{{ detailsData.customerCode }}</span>
|
|
|
- <span class="title_" style="margin: 0 6px">|</span>
|
|
|
- <span class="title_"> 客户类型:</span
|
|
|
- ><span>{{ dictValueLabel(detailsData.status, customerStatus) }}</span>
|
|
|
+ <span class="title_" v-if="detailsData.customerCode">客户代码:{{ detailsData.customerCode }}</span>
|
|
|
+ <span class="title_" v-if="detailsData.customerCode && detailsData.status" style="margin: 0 6px">|</span>
|
|
|
+ <span class="title_" v-if="detailsData.status">客户类型:{{ dictValueLabel(detailsData.status, customerStatus) }}</span>
|
|
|
</div>
|
|
|
- <div class="line">
|
|
|
+ <div class="line" v-if="detailsData.source">
|
|
|
<span class="title_">客户来源:</span>
|
|
|
<span>{{ dictValueLabel(detailsData.source, customerSource) }}</span>
|
|
|
</div>
|
|
@@ -26,90 +20,46 @@
|
|
|
<div class="contacts" v-if="detailsData.customerUserList.length > 0">
|
|
|
<div style="display: flex; justify-content: space-between">
|
|
|
<span> 相关联系人: </span>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- icon="Plus"
|
|
|
- circle
|
|
|
- style="margin-top: -15px"
|
|
|
- @click="handleAddUserList(detailsData)"
|
|
|
- />
|
|
|
+ <el-button type="primary" size="small" style="padding: 0px" text @click="handleAddUserList(detailsData)">添加</el-button>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <div
|
|
|
- v-for="(item, index) in detailsData.customerUserList"
|
|
|
- :key="index"
|
|
|
- class="item"
|
|
|
- v-show="!(index > 1)"
|
|
|
- >
|
|
|
+ <div v-for="(item, index) in detailsData.customerUserList" :key="index" class="item" v-show="!(index > 1)">
|
|
|
<div class="img">
|
|
|
- <i
|
|
|
- class="iconfont icon-iconm_kehd"
|
|
|
- style="font-size: 26px; color: #cccccc; margin-top: 2px"
|
|
|
- ></i>
|
|
|
+ <i class="iconfont icon-iconm_kehd" style="font-size: 26px; color: #cccccc; margin-top: 2px"></i>
|
|
|
</div>
|
|
|
<div class="details">
|
|
|
<div>
|
|
|
<span> {{ item.name }} </span>
|
|
|
- <!-- <span> {{ item.position }} </span> -->
|
|
|
</div>
|
|
|
<div class="information">
|
|
|
- <div class="first">
|
|
|
- <span class="val">Tel:</span>{{ getPhone(item) }}
|
|
|
- </div>
|
|
|
- <div style="display: flex; justify-content: space-between">
|
|
|
+ <div class="first"><span class="val">Tel:</span>{{ getPhone(item) }}</div>
|
|
|
+ <div style="display: flex; justify-content: space-between; height: 18px; line-height: 18px">
|
|
|
<span class="val" style="flex: 1">Email:</span>{{ item.email }}
|
|
|
<img
|
|
|
src="@/assets/images/portrait/icon_email.png"
|
|
|
alt=""
|
|
|
- style="cursor: pointer; margin-left: 10px"
|
|
|
+ style="cursor: pointer; margin-left: 10px; transform: translateY(-1px)"
|
|
|
@click="handleSendEmail(item)"
|
|
|
- v-show="item.email"
|
|
|
- />
|
|
|
+ v-show="item.email" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div
|
|
|
- style="float: right"
|
|
|
- v-if="
|
|
|
- detailsData.customerUserList &&
|
|
|
- detailsData.customerUserList.length > 1
|
|
|
- "
|
|
|
- >
|
|
|
+ <div style="float: right" v-if="detailsData.customerUserList && detailsData.customerUserList.length > 1">
|
|
|
<el-button type="primary" link size="small">更多联系人</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog
|
|
|
- :title="'添加联系人'"
|
|
|
- v-if="dialogVisible"
|
|
|
- v-model="dialogVisible"
|
|
|
- width="800"
|
|
|
- v-loading="loadingOperation"
|
|
|
- >
|
|
|
- <byForm
|
|
|
- :formConfig="formConfig"
|
|
|
- :formOption="formOption"
|
|
|
- v-model="formData.data"
|
|
|
- :rules="rules"
|
|
|
- ref="submit"
|
|
|
- >
|
|
|
+ <el-dialog :title="'添加联系人'" v-if="dialogVisible" v-model="dialogVisible" width="800" v-loading="loadingOperation">
|
|
|
+ <byForm :formConfig="formConfig" :formOption="formOption" v-model="formData.data" :rules="rules" ref="submit">
|
|
|
<template #person>
|
|
|
<div style="width: 100%">
|
|
|
- <!-- <el-button type="primary" @click="clickAddPerson">添 加</el-button> -->
|
|
|
- <el-table
|
|
|
- :data="formData.data.customerUserList"
|
|
|
- style="width: 100%; margin-top: 16px"
|
|
|
- >
|
|
|
+ <el-table :data="formData.data.customerUserList" style="width: 100%; margin-top: 16px">
|
|
|
<el-table-column label="联系人" width="160">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item
|
|
|
- :prop="'customerUserList.' + $index + '.name'"
|
|
|
- :rules="rules.name2"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
+ <el-form-item :prop="'customerUserList.' + $index + '.name'" :rules="rules.name2" :inline-message="true">
|
|
|
<el-input v-model="row.name" placeholder="请输入联系人" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -118,35 +68,15 @@
|
|
|
<el-table-column label="电子邮箱">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item
|
|
|
- :prop="'customerUserList.' + $index + '.email'"
|
|
|
- :rules="rules.email"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="row.email"
|
|
|
- placeholder="请输入电子邮箱"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'customerUserList.' + $index + '.email'" :rules="rules.email" :inline-message="true">
|
|
|
+ <el-input v-model="row.email" placeholder="请输入电子邮箱" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="操作"
|
|
|
- width="120"
|
|
|
- fixed="right"
|
|
|
- >
|
|
|
+ <el-table-column align="center" label="操作" width="120" fixed="right">
|
|
|
<template #default="{ row, $index }">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- @click="clickInformationMore(row, $index)"
|
|
|
- >更多</el-button
|
|
|
- >
|
|
|
- <!-- <el-button type="primary" link @click="clickDelete($index)"
|
|
|
- >删除</el-button
|
|
|
- > -->
|
|
|
+ <el-button type="primary" link @click="clickInformationMore(row, $index)">更多</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -155,28 +85,12 @@
|
|
|
</byForm>
|
|
|
<template #footer>
|
|
|
<el-button @click="dialogVisible = false" size="large">取 消</el-button>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- @click="submitForm()"
|
|
|
- size="large"
|
|
|
- :loading="submitLoading"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitForm()" size="large" :loading="submitLoading">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <el-dialog
|
|
|
- title="更多联系方式"
|
|
|
- v-if="openPerson"
|
|
|
- v-model="openPerson"
|
|
|
- width="700"
|
|
|
- >
|
|
|
- <el-form
|
|
|
- :label-position="'top'"
|
|
|
- :model="formPerson.data"
|
|
|
- :rules="rulesPerson"
|
|
|
- ref="person"
|
|
|
- >
|
|
|
+ <el-dialog title="更多联系方式" v-if="openPerson" v-model="openPerson" width="700">
|
|
|
+ <el-form :label-position="'top'" :model="formPerson.data" :rules="rulesPerson" ref="person">
|
|
|
<el-form-item label="联系人" prop="name">
|
|
|
<el-input v-model="formPerson.data.name" />
|
|
|
</el-form-item>
|
|
@@ -185,32 +99,14 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="更多联系方式">
|
|
|
<div style="width: 100%">
|
|
|
- <el-button type="primary" @click="clickAddMoreInformation"
|
|
|
- >添 加</el-button
|
|
|
- >
|
|
|
- <el-table
|
|
|
- :data="formPerson.data.contact"
|
|
|
- style="width: 100%; margin-top: 16px"
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="clickAddMoreInformation">添 加</el-button>
|
|
|
+ <el-table :data="formPerson.data.contact" style="width: 100%; margin-top: 16px">
|
|
|
<el-table-column label="类型" width="180">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item
|
|
|
- :prop="'contact.' + $index + '.type'"
|
|
|
- :rules="rulesPerson.type"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-select
|
|
|
- v-model="row.type"
|
|
|
- placeholder="请选择类型"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in contactType"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'contact.' + $index + '.type'" :rules="rulesPerson.type" :inline-message="true">
|
|
|
+ <el-select v-model="row.type" placeholder="请选择类型" style="width: 100%">
|
|
|
+ <el-option v-for="item in contactType" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
@@ -219,32 +115,15 @@
|
|
|
<el-table-column label="联系号码">
|
|
|
<template #default="{ row, $index }">
|
|
|
<div style="width: 100%">
|
|
|
- <el-form-item
|
|
|
- :prop="'contact.' + $index + '.contactNo'"
|
|
|
- :rules="rulesPerson.contactNo"
|
|
|
- :inline-message="true"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- v-model="row.contactNo"
|
|
|
- placeholder="请输入联系号码"
|
|
|
- />
|
|
|
+ <el-form-item :prop="'contact.' + $index + '.contactNo'" :rules="rulesPerson.contactNo" :inline-message="true">
|
|
|
+ <el-input v-model="row.contactNo" placeholder="请输入联系号码" />
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- label="操作"
|
|
|
- width="120"
|
|
|
- fixed="right"
|
|
|
- >
|
|
|
+ <el-table-column align="center" label="操作" width="120" fixed="right">
|
|
|
<template #default="{ $index }">
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- link
|
|
|
- @click="clickInformationDelete($index)"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" link @click="clickInformationDelete($index)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -253,17 +132,14 @@
|
|
|
</el-form>
|
|
|
<template #footer>
|
|
|
<el-button @click="openPerson = false" size="large">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitPerson()" size="large"
|
|
|
- >确 定</el-button
|
|
|
- >
|
|
|
+ <el-button type="primary" @click="submitPerson()" size="large">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
-
|
|
|
+
|
|
|
<script setup>
|
|
|
-import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
-import useUserStore from "@/store/modules/user";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
const props = defineProps({
|
|
|
customerId: {
|
|
@@ -328,31 +204,20 @@ const customerSource = ref([]);
|
|
|
const customerStatus = ref([]);
|
|
|
const contactType = ref([]);
|
|
|
const getDict = () => {
|
|
|
- proxy
|
|
|
- .getDictOne([
|
|
|
- "customer_tag",
|
|
|
- "customer_source",
|
|
|
- "customer_status",
|
|
|
- "contact_type",
|
|
|
- ])
|
|
|
- .then((res) => {
|
|
|
- // customerTag.value = res["customer_tag"].map((x) => ({
|
|
|
- // label: x.dictValue,
|
|
|
- // value: x.dictKey,
|
|
|
- // }));
|
|
|
- customerSource.value = res["customer_source"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- customerStatus.value = res["customer_status"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- contactType.value = res["contact_type"].map((x) => ({
|
|
|
- label: x.dictValue,
|
|
|
- value: x.dictKey,
|
|
|
- }));
|
|
|
- });
|
|
|
+ proxy.getDictOne(["customer_source", "customer_status", "contact_type"]).then((res) => {
|
|
|
+ customerSource.value = res["customer_source"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ customerStatus.value = res["customer_status"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ contactType.value = res["contact_type"].map((x) => ({
|
|
|
+ label: x.dictValue,
|
|
|
+ value: x.dictKey,
|
|
|
+ }));
|
|
|
+ });
|
|
|
};
|
|
|
getDict();
|
|
|
onMounted(() => {
|
|
@@ -378,25 +243,6 @@ const handleAddUserList = (res) => {
|
|
|
];
|
|
|
dialogVisible.value = true;
|
|
|
};
|
|
|
-
|
|
|
-const clickAddPerson = () => {
|
|
|
- if (
|
|
|
- formData.data.customerUserList &&
|
|
|
- formData.data.customerUserList.length > 0
|
|
|
- ) {
|
|
|
- formData.data.customerUserList.push({
|
|
|
- name: "",
|
|
|
- email: "",
|
|
|
- });
|
|
|
- } else {
|
|
|
- formData.data.customerUserList = [
|
|
|
- {
|
|
|
- name: "",
|
|
|
- email: "",
|
|
|
- },
|
|
|
- ];
|
|
|
- }
|
|
|
-};
|
|
|
const moreIndex = ref(-1);
|
|
|
const clickInformationMore = (item, index) => {
|
|
|
moreIndex.value = index;
|
|
@@ -408,11 +254,6 @@ const clickInformationMore = (item, index) => {
|
|
|
formPerson.data = proxy.deepClone(item);
|
|
|
openPerson.value = true;
|
|
|
};
|
|
|
-
|
|
|
-const clickDelete = (index) => {
|
|
|
- formData.data.customerUserList.splice(index, 1);
|
|
|
-};
|
|
|
-
|
|
|
const clickAddMoreInformation = () => {
|
|
|
if (formPerson.data.contact && formPerson.data.contact.length > 0) {
|
|
|
formPerson.data.contact.push({
|
|
@@ -433,7 +274,6 @@ const clickInformationDelete = (index) => {
|
|
|
};
|
|
|
const person = ref(null);
|
|
|
const submit = ref(null);
|
|
|
-
|
|
|
const submitPerson = () => {
|
|
|
person.value.validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -443,13 +283,9 @@ const submitPerson = () => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
const submitForm = () => {
|
|
|
submit.value.handleSubmit(() => {
|
|
|
- if (
|
|
|
- formData.data.customerUserList &&
|
|
|
- formData.data.customerUserList.length > 0
|
|
|
- ) {
|
|
|
+ if (formData.data.customerUserList && formData.data.customerUserList.length > 0) {
|
|
|
submitLoading.value = true;
|
|
|
const data = {
|
|
|
customerId: detailsData.value.id,
|
|
@@ -473,7 +309,6 @@ const submitForm = () => {
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
const getPhone = (res) => {
|
|
|
if (res.contactJson) {
|
|
|
let contactJson = JSON.parse(res.contactJson);
|
|
@@ -483,7 +318,7 @@ const getPhone = (res) => {
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
-
|
|
|
+
|
|
|
<style lang="scss" scoped>
|
|
|
.content {
|
|
|
font-size: 12px;
|
|
@@ -522,9 +357,10 @@ const getPhone = (res) => {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
flex-wrap: wrap;
|
|
|
- // overflow: auto;
|
|
|
.first {
|
|
|
margin-right: 10px;
|
|
|
+ height: 18px;
|
|
|
+ line-height: 18px;
|
|
|
}
|
|
|
.val {
|
|
|
color: #999999;
|
|
@@ -549,4 +385,7 @@ const getPhone = (res) => {
|
|
|
// object-fit: contain;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
+::v-deep(.el-button--small) {
|
|
|
+ --el-button-size: 20px;
|
|
|
+}
|
|
|
</style>
|