|
@@ -63,40 +63,43 @@
|
|
|
<span style="margin-left:5px;cursor: pointer;">
|
|
|
<el-popover placement="top-start" :width="300" trigger="hover">
|
|
|
<template #default>
|
|
|
- <div v-if="row.flags" style="font-size:12px">
|
|
|
+ <div v-if="row.customerId &&row.customerInfo" style="font-size:12px">
|
|
|
<div style="display:flex;align-items:center">
|
|
|
<el-icon size="26" :color="'#409eff'" style="vertical-align:middle">
|
|
|
<UserFilled />
|
|
|
</el-icon>
|
|
|
- <span style="margin:0 20px" class="public-color">客户名称</span>
|
|
|
- <span class="public-color">1279230601@qq.com</span>
|
|
|
+ <span style="margin:0 20px" class="public-color"
|
|
|
+ v-if="row.customerInfo.customerUserList &&row.customerInfo.customerUserList.length>0">{{row.customerInfo.customerUserList[0].name}}</span>
|
|
|
+ <span class="public-color"
|
|
|
+ v-if="row.customerInfo.customerUserList &&row.customerInfo.customerUserList.length>0">{{row.customerInfo.customerUserList[0].email}}</span>
|
|
|
</div>
|
|
|
<div style="border-top:1px solid #eee;border-bottom:1px solid #eee;margin-top:20px;padding-bottom:10px">
|
|
|
<div style="margin-top:10px">
|
|
|
- 国家:
|
|
|
+ 国家:{{row.customerInfo.countryName}}
|
|
|
</div>
|
|
|
<div style="margin-top:10px">
|
|
|
- 公司:
|
|
|
+ 公司:{{row.customerInfo.name}}
|
|
|
</div>
|
|
|
<div style="margin-top:10px">
|
|
|
- 职位:
|
|
|
+ 电话:{{row.phoneNumber}}
|
|
|
</div>
|
|
|
<div style="margin-top:10px">
|
|
|
- 电话:
|
|
|
+ 类型:{{dictValueLabel(row.customerInfo.status, customerStatus)}}
|
|
|
</div>
|
|
|
<div style="margin-top:10px">
|
|
|
- 来源:
|
|
|
+ 来源:{{dictValueLabel(row.customerInfo.source, customerSource)}}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="display:flex;align-items:center;margin-top:10px;justify-content:space-between">
|
|
|
- <span class="cursor-class" @click="addCustomer('edit')">
|
|
|
+ <span class="cursor-class" @click="addCustomer('edit',row.customerId)">
|
|
|
<el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
<Edit />
|
|
|
</el-icon><span class="public-color">编辑客户</span></span>
|
|
|
- <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
+ <!-- <span class="cursor-class" @click="handleReply('10')"><el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
<ChatRound />
|
|
|
- </el-icon><span class="public-color">回复</span></span>
|
|
|
- <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
+ </el-icon><span class="public-color">回复</span></span> -->
|
|
|
+ <span class="cursor-class" @click="handleGoWrite({email:row.fromEmail},'0')"><el-icon :size="16" color="#409eff"
|
|
|
+ class="icon-class">
|
|
|
<EditPen />
|
|
|
</el-icon><span class="public-color">写信</span></span>
|
|
|
</div>
|
|
@@ -106,8 +109,8 @@
|
|
|
<el-icon size="26" style="vertical-align:middle">
|
|
|
<UserFilled />
|
|
|
</el-icon>
|
|
|
- <span style="margin:0 20px">客户名称</span>
|
|
|
- <span>1279230601@qq.com</span>
|
|
|
+ <span style="margin:0 20px">{{row.fromEmail}}</span>
|
|
|
+ <!-- <span>1279230601@qq.com</span> -->
|
|
|
</div>
|
|
|
<div
|
|
|
style="border-top:1px solid #eee;margin-top:20px;display:flex;align-items:center;justify-content:space-between;padding-top:10px">
|
|
@@ -115,25 +118,26 @@
|
|
|
<el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
<Plus />
|
|
|
</el-icon><span class="public-color">添加为客户</span></span>
|
|
|
- <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
+ <!-- <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
<ChatRound />
|
|
|
- </el-icon><span class="public-color">回复</span></span>
|
|
|
- <span class="cursor-class"><el-icon :size="16" color="#409eff" class="icon-class">
|
|
|
+ </el-icon><span class="public-color">回复</span></span> -->
|
|
|
+ <span class="cursor-class" @click="handleGoWrite({email:row.fromEmail},'0')"><el-icon :size="16" color="#409eff"
|
|
|
+ class="icon-class">
|
|
|
<EditPen />
|
|
|
</el-icon><span class="public-color">写信</span></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #reference>
|
|
|
- <el-icon size="18" :color="row.flags?'#409eff':''" style="vertical-align:middle">
|
|
|
+ <el-icon size="18" :color="row.customerId?'#409eff':''" style="vertical-align:middle">
|
|
|
<UserFilled />
|
|
|
</el-icon>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
|
|
|
</span>
|
|
|
- <span style="margin-left:5px;cursor: pointer;">
|
|
|
- <el-icon size="18" :color="row.isAttachments?'#409eff':''" style="vertical-align:middle">
|
|
|
+ <span style="margin-left:5px;cursor: pointer;" v-if="row.isAttachments">
|
|
|
+ <el-icon size="18" :color="'#409eff'" style="vertical-align:middle">
|
|
|
<Paperclip />
|
|
|
</el-icon>
|
|
|
</span>
|
|
@@ -238,6 +242,8 @@ const tableData = reactive({
|
|
|
});
|
|
|
const mailKeyword = ref("");
|
|
|
const unReadCount = computed(() => mailStore.currentMenu.unReadCount);
|
|
|
+const customerSource = computed(() => mailStore.customerSource);
|
|
|
+const customerStatus = computed(() => mailStore.customerStatus);
|
|
|
const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
@@ -284,11 +290,30 @@ const getList = () => {
|
|
|
keyword: mailKeyword.value,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- tableData.data = res.rows.map((x) => ({ ...x, isCheck: false }));
|
|
|
- mailStore.mailDataList = res.rows.map((x) => ({
|
|
|
- ...x,
|
|
|
- isCheck: false,
|
|
|
- }));
|
|
|
+ for (let i = 0; i < res.rows.length; i++) {
|
|
|
+ const row = res.rows[i];
|
|
|
+ row.isCheck = false;
|
|
|
+ if (
|
|
|
+ row.customerId &&
|
|
|
+ row.customerInfo &&
|
|
|
+ row.customerInfo.customerUserList &&
|
|
|
+ row.customerInfo.customerUserList.length > 0
|
|
|
+ ) {
|
|
|
+ if (row.customerInfo.customerUserList[0].contactJson) {
|
|
|
+ row.customerInfo.customerUserList[0].contactJson = JSON.parse(
|
|
|
+ row.customerInfo.customerUserList[0].contactJson
|
|
|
+ );
|
|
|
+ let arr = row.customerInfo.customerUserList[0].contactJson.filter(
|
|
|
+ (x) => x.type == "mobile"
|
|
|
+ );
|
|
|
+ if (arr && arr.length > 0) {
|
|
|
+ row.phoneNumber = arr[0].contactNo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tableData.data = res.rows;
|
|
|
+ mailStore.mailDataList = tableData.data;
|
|
|
tableData.pagination.total = res.total;
|
|
|
loading.value = false;
|
|
|
});
|
|
@@ -302,14 +327,30 @@ const getList = () => {
|
|
|
keyword: mailKeyword.value,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- tableData.data = res.rows.map((x) => ({
|
|
|
- ...x,
|
|
|
- isCheck: false,
|
|
|
- }));
|
|
|
- mailStore.mailDataList = res.rows.map((x) => ({
|
|
|
- ...x,
|
|
|
- isCheck: false,
|
|
|
- }));
|
|
|
+ for (let i = 0; i < res.rows.length; i++) {
|
|
|
+ const row = res.rows[i];
|
|
|
+ row.isCheck = false;
|
|
|
+ if (
|
|
|
+ row.customerId &&
|
|
|
+ row.customerInfo &&
|
|
|
+ row.customerInfo.customerUserList &&
|
|
|
+ row.customerInfo.customerUserList.length > 0
|
|
|
+ ) {
|
|
|
+ if (row.customerInfo.customerUserList[0].contactJson) {
|
|
|
+ row.customerInfo.customerUserList[0].contactJson = JSON.parse(
|
|
|
+ row.customerInfo.customerUserList[0].contactJson
|
|
|
+ );
|
|
|
+ let arr = row.customerInfo.customerUserList[0].contactJson.filter(
|
|
|
+ (x) => x.type == "mobile"
|
|
|
+ );
|
|
|
+ if (arr && arr.length > 0) {
|
|
|
+ row.phoneNumber = arr[0].contactNo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tableData.data = res.rows;
|
|
|
+ mailStore.mailDataList = tableData.data;
|
|
|
tableData.pagination.total = res.total;
|
|
|
loading.value = false;
|
|
|
});
|
|
@@ -323,14 +364,30 @@ const getList = () => {
|
|
|
keyword: mailKeyword.value,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- tableData.data = res.rows.map((x) => ({
|
|
|
- ...x,
|
|
|
- isCheck: false,
|
|
|
- }));
|
|
|
- mailStore.mailDataList = res.rows.map((x) => ({
|
|
|
- ...x,
|
|
|
- isCheck: false,
|
|
|
- }));
|
|
|
+ for (let i = 0; i < res.rows.length; i++) {
|
|
|
+ const row = res.rows[i];
|
|
|
+ row.isCheck = false;
|
|
|
+ if (
|
|
|
+ row.customerId &&
|
|
|
+ row.customerInfo &&
|
|
|
+ row.customerInfo.customerUserList &&
|
|
|
+ row.customerInfo.customerUserList.length > 0
|
|
|
+ ) {
|
|
|
+ if (row.customerInfo.customerUserList[0].contactJson) {
|
|
|
+ row.customerInfo.customerUserList[0].contactJson = JSON.parse(
|
|
|
+ row.customerInfo.customerUserList[0].contactJson
|
|
|
+ );
|
|
|
+ let arr = row.customerInfo.customerUserList[0].contactJson.filter(
|
|
|
+ (x) => x.type == "mobile"
|
|
|
+ );
|
|
|
+ if (arr && arr.length > 0) {
|
|
|
+ row.phoneNumber = arr[0].contactNo;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tableData.data = res.rows;
|
|
|
+ mailStore.mailDataList = tableData.data;
|
|
|
tableData.pagination.total = res.total;
|
|
|
loading.value = false;
|
|
|
});
|
|
@@ -618,6 +675,55 @@ const addCustomer = (type, id = "") => {
|
|
|
modalType.value = type;
|
|
|
addCustomerDialog.value = true;
|
|
|
};
|
|
|
+const handleReply = (pageType) => {
|
|
|
+ // pageType 10为回复 20为转发 30为全部回复 40为再次编辑 0为写信
|
|
|
+ let title = "";
|
|
|
+ if (pageType === "10") {
|
|
|
+ title = "回复";
|
|
|
+ } else if (pageType === "20") {
|
|
|
+ title = "转发";
|
|
|
+ } else if (pageType === "30") {
|
|
|
+ title = "全部回复";
|
|
|
+ } else if (pageType === "40") {
|
|
|
+ title = "再次编辑";
|
|
|
+ }
|
|
|
+ const menu = {
|
|
|
+ title: title,
|
|
|
+ type: mailStore.selectMail.type,
|
|
|
+ id: "write",
|
|
|
+ pageType: pageType,
|
|
|
+ details: {},
|
|
|
+ };
|
|
|
+ const index = mailStore.mailMenuList.findIndex((x) => x.id === menu.id);
|
|
|
+ if (index >= 0) {
|
|
|
+ mailStore.mailMenuList[index] = menu;
|
|
|
+ } else {
|
|
|
+ mailStore.mailMenuList.push(menu);
|
|
|
+ }
|
|
|
+ mailStore.currentMenu = menu;
|
|
|
+ mailStore.currentId = menu.id;
|
|
|
+};
|
|
|
+
|
|
|
+const handleGoWrite = (mail = {}, pageType = "0") => {
|
|
|
+ const menu = {
|
|
|
+ title: "写信",
|
|
|
+ type: mailStore.selectMail.type,
|
|
|
+ id: "write",
|
|
|
+ pageType,
|
|
|
+ };
|
|
|
+ if (mail) {
|
|
|
+ menu.reMail = mail;
|
|
|
+ }
|
|
|
+ const index = mailStore.mailMenuList.findIndex((x) => x.id === menu.id);
|
|
|
+ if (index >= 0) {
|
|
|
+ mailStore.mailMenuList[index] = menu;
|
|
|
+ } else {
|
|
|
+ mailStore.mailMenuList.push(menu);
|
|
|
+ }
|
|
|
+ mailStore.currentMenu = menu;
|
|
|
+ mailStore.currentId = menu.id;
|
|
|
+};
|
|
|
+
|
|
|
defineExpose({
|
|
|
initFn: init,
|
|
|
});
|