Commit b02ae757 by 张立顺

fix bug

1 parent 68bf0df9
<template> <template>
<d2-container v-loading="pageLoading" class="customer-group-rel-page"> <d2-container v-loading="pageLoading" class="customer-group-rel-page">
<div class="page-content"> <div class="page-content">
<CustomerBasicInfoCard <CustomerBasicInfoCard :basic-info="groupData.basicInfo"
:customer-row="customerRow" :customer-row="customerRow" />
:basic-info="groupData.basicInfo"
/>
<section class="detail-card"> <section class="detail-card">
<h3 class="detail-card__title"> <h3 class="detail-card__title">
群关联 群关联
</h3> </h3>
<div <div v-for="item in groupFieldList"
v-for="item in groupFieldList"
:key="item.prop" :key="item.prop"
class="field-row" class="field-row">
>
<span class="field-label">{{ item.label }}:</span> <span class="field-label">{{ item.label }}:</span>
<span class="field-value">{{ displayGroupInfo[item.prop] || "-" }}</span> <span class="field-value">{{ displayGroupInfo[item.prop] || "-" }}</span>
</div> </div>
</section> </section>
<div class="footer-actions"> <div class="footer-actions">
<el-button type="primary" size="medium" @click="handleBack"> <el-button size="medium"
type="primary"
@click="handleBack">
返回 返回
</el-button> </el-button>
</div> </div>
...@@ -75,7 +73,7 @@ export default { ...@@ -75,7 +73,7 @@ export default {
} }
this.customerRow = resolveCustomerRowFromRoute( this.customerRow = resolveCustomerRowFromRoute(
this.$route, this.$route,
loadCustomerSnapshot() loadCustomerSnapshot(),
); );
this.loadGroupInfo(); this.loadGroupInfo();
}, },
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
<p>今日邀约详情</p> <p>今日邀约详情</p>
</div> </div>
<div class="appoint-table-content"> <div class="appoint-table-content">
<table <table cellpadding="0"
cellpadding="0"
cellspacing="0"> cellspacing="0">
<tr class="appoint-table-header"> <tr class="appoint-table-header">
<td>邀约时间</td> <td>邀约时间</td>
...@@ -14,26 +13,24 @@ ...@@ -14,26 +13,24 @@
<td>服务状态</td> <td>服务状态</td>
</tr> </tr>
<template v-if="detailData.length"> <template v-if="detailData.length">
<tr <tr v-for="(item, index) in detailData"
v-for="(item, index) in detailData"
:key="index"> :key="index">
<td>{{ item.time }}</td> <td>{{ item.time }}</td>
<td class="flex"> <td class="flex">
<img <img class="detail-header"
class="detail-header"
:src="item.info.sex === 1 ? './images/header-man-grey.png' : './images/header-woman.png'"> :src="item.info.sex === 1 ? './images/header-man-grey.png' : './images/header-woman.png'">
<template class="detail-info"> <template class="detail-info">
<p>{{ item.info.name }}</p> <p>{{ item.info.name }}</p>
<p>{{ item.info.project }}</p> <p>{{ item.info.project }}</p>
</template> </template>
<template class="detail-phone"> <template class="detail-phone">
<p <p v-show="!item.info.phone"
class="secret-phone" class="secret-phone">
v-show="!item.info.phone">
<span class="one-tip">手机号码已加密</span> <span class="one-tip">手机号码已加密</span>
<span <span class="two-tip"
class="two-tip" @click="handleGetPhone(item, index)">
@click="handleGetPhone(item, index)">获取虚拟手机号</span> 获取虚拟手机号
</span>
</p> </p>
<p v-show="item.info.phone"> <p v-show="item.info.phone">
{{ item.info.phone }} {{ item.info.phone }}
...@@ -57,126 +54,132 @@ ...@@ -57,126 +54,132 @@
<script> <script>
export default { export default {
name: 'AppointTable', name: "AppointTable",
data() { data() {
return { return {
hoursList: [ hoursList: [
{ hour: '9:00' }, { hour: '10:00' }, { hour: "9:00" },
{ hour: '11:00' }, { hour: '12:00' }, { hour: "10:00" },
{ hour: '13:00' }, { hour: '14:00' }, { hour: "11:00" },
{ hour: '15:00' }, { hour: '16:00' }, { hour: "12:00" },
{ hour: '17:00' }, { hour: '18:00' }], { hour: "13:00" },
{ hour: "14:00" },
{ hour: "15:00" },
{ hour: "16:00" },
{ hour: "17:00" },
{ hour: "18:00" },
],
detailData: [{ detailData: [{
time: '上午9:00', time: "上午9:00",
info: { info: {
header: '', header: "",
name: '张三', name: "张三",
// 1 - 男; 2 - 女 // 1 - 男; 2 - 女
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}, { }, {
time: '上午9:00', time: "上午9:00",
info: { info: {
header: '', header: "",
name: '张兰', name: "张兰",
sex: 2, sex: 2,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 1 status: 1,
}, { }, {
time: '上午10:00', time: "上午10:00",
info: { info: {
header: '', header: "",
name: '张一二', name: "张一二",
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}, { }, {
time: '上午10:00', time: "上午10:00",
info: { info: {
header: '', header: "",
name: '张一二', name: "张一二",
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}, { }, {
time: '上午10:00', time: "上午10:00",
info: { info: {
header: '', header: "",
name: '张一二', name: "张一二",
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}, { }, {
time: '上午10:00', time: "上午10:00",
info: { info: {
header: '', header: "",
name: '张一二', name: "张一二",
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}, { }, {
time: '上午10:00', time: "上午10:00",
info: { info: {
header: '', header: "",
name: '张一二', name: "张一二",
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}, { }, {
time: '上午10:00', time: "上午10:00",
info: { info: {
header: '', header: "",
name: '张一二', name: "张一二",
sex: 1, sex: 1,
project: '预约项目', project: "预约项目",
phone: '' phone: "",
}, },
// 0 - 未到店; 1 - 完成服务 // 0 - 未到店; 1 - 完成服务
status: 0 status: 0,
}] }],
} };
}, },
mounted() { }, mounted() { },
methods: { methods: {
handleGetPhone(targetItem, targetIndex) { handleGetPhone(targetItem, targetIndex) {
this.$confirm('客户手机号码已加密,是否获取虚拟号码?', '提示', { this.$confirm("客户手机号码已加密,是否获取虚拟号码?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { }).then(() => {
this.detailData[targetIndex].info.phone = '13088889999' this.detailData[targetIndex].info.phone = "13088889999";
}).catch(err => { }).catch((err) => {
console.log(err) console.log(err);
}) });
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.appoint-table { .appoint-table {
width: 49%; width: 49%;
...@@ -245,7 +248,7 @@ export default { ...@@ -245,7 +248,7 @@ export default {
} }
.two-tip { .two-tip {
color: #ffffff; color: #ffffff;
background-color: #4ECB73; background-color: #4ecb73;
} }
} }
.secret-phone:hover { .secret-phone:hover {
......
...@@ -14,34 +14,36 @@ ...@@ -14,34 +14,36 @@
</div> </div>
<p class="date-y-line" /> <p class="date-y-line" />
</template> </template>
<el-button icon="el-icon-d-arrow-left" <el-button class="arrow-left-icon"
icon="el-icon-d-arrow-left"
type="text" type="text"
class="arrow-left-icon"
:disabled="currentWeek === 1" :disabled="currentWeek === 1"
@click="handleWeek(false)" /> @click="handleWeek(false)" />
<template> <template>
<div class="date-picker"> <div class="date-picker">
<div class="wrapper" <div v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)"
v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)" :key="index"
:key="index"> class="wrapper">
<span> <span>
<p v-for="(info, infoIndex) in appointData[index].infoList" <p v-for="(info, infoIndex) in appointData[index].infoList"
:key="infoIndex"> :key="infoIndex">
<el-popover placement="bottom-start" <el-popover open-delay="600"
placement="bottom-start"
title="" title=""
width="200"
open-delay="600"
trigger="hover" trigger="hover"
width="200"
:disabled="info.status === 0"> :disabled="info.status === 0">
<div> <div>
<p>1、客户姓名,时间,项目</p> <p>1、客户姓名,时间,项目</p>
<p>2、客户姓名,时间,项目</p> <p>2、客户姓名,时间,项目</p>
<p>余位数:8</p> <p>余位数:8</p>
</div> </div>
<el-button :class="{'col-width': true, 'hour-template': true, 'status-full': info.status === 2, 'status-remain': info.status === 1 }" <el-button slot="reference"
slot="reference" class="col-width hour-template"
:class="{ 'status-full': info.status === 2, 'status-remain': info.status === 1 }"
@click="handleAppoint(item, infoIndex)"> @click="handleAppoint(item, infoIndex)">
{{ appointStatusList[info.status] }}</el-button> {{ appointStatusList[info.status] }}
</el-button>
</el-popover> </el-popover>
</p> </p>
</span> </span>
...@@ -49,13 +51,14 @@ ...@@ -49,13 +51,14 @@
</div> </div>
<p class="date-x-line" /> <p class="date-x-line" />
<div class="date-picker"> <div class="date-picker">
<div class="wrapper" <div v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)"
v-for="(item, index) in dateList.slice(currentWeek * 7 - 7, currentWeek * 7)" :key="index"
:key="index"> class="wrapper">
<el-button type="text" <el-button class="date-btn col-width"
:class="{'date-btn': true, 'col-width': true, 'active': item.active}" type="text"
:class="{ active: item.active }"
@click="handleSelectDate(index)"> @click="handleSelectDate(index)">
<p>{{ item.date.split('/')[1] + '.' + item.date.split('/')[2] }}</p> <p>{{ `${item.date.split('/')[1]}.${item.date.split('/')[2]}` }}</p>
<p>{{ weekList[item.week] }}</p> <p>{{ weekList[item.week] }}</p>
</el-button> </el-button>
</div> </div>
...@@ -70,38 +73,39 @@ ...@@ -70,38 +73,39 @@
</template> </template>
<script> <script>
import { appointDays } from '@/common/format' import { appointDays } from "@/common/format";
export default { export default {
name: 'TimeDate', name: "TimeDate",
props: {
appointData: {
type: Array,
default: () => [],
},
hoursList: {
type: Array,
default: () => [],
},
},
data() { data() {
return { return {
// 7天为一个周期,预约时间为35天,一共5个周期,当前周期 // 7天为一个周期,预约时间为35天,一共5个周期,当前周期
currentWeek: 1, currentWeek: 1,
// 日期 // 日期
dateIndex: 0, dateIndex: 0,
weekList: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], weekList: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
dateList: new Array(appointDays).fill(null).map((item, index) => { dateList: new Array(appointDays).fill(null).map((item, index) => {
var date = new Date(new Date().setDate(new Date().getDate() + index)) let date = new Date(new Date().setDate(new Date().getDate() + index));
return { return {
date: date.toLocaleDateString(), date: date.toLocaleDateString(),
week: date.getDay(), week: date.getDay(),
active: !index active: !index,
} };
}), }),
// 时间 // 时间
appointStatusList: ['空', '余', '满'] appointStatusList: ["空", "余", "满"],
} };
},
props: {
appointData: {
type: Array,
default: () => []
},
hoursList: {
type: Array,
default: () => []
}
}, },
mounted() { }, mounted() { },
...@@ -117,12 +121,12 @@ export default { ...@@ -117,12 +121,12 @@ export default {
// this.$emit('handleAppoint', { date: date.date, hour: this.hoursList[hourIndex].hour }) // this.$emit('handleAppoint', { date: date.date, hour: this.hoursList[hourIndex].hour })
}, },
handleWeek(isAdd) { handleWeek(isAdd) {
isAdd ? this.currentWeek++ : this.currentWeek-- isAdd ? this.currentWeek++ : this.currentWeek--;
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./css/timeDateStyle.scss"; @import "./css/timeDateStyle.scss";
</style> </style>
<template> <template>
<d2-container v-loading="pageLoading" class="customer-portrait-page"> <d2-container v-loading="pageLoading" class="customer-portrait-page">
<div class="page-content"> <div class="page-content">
<CustomerBasicInfoCard <CustomerBasicInfoCard :basic-info="portraitData.basicInfo"
:customer-row="customerRow" :customer-row="customerRow" />
:basic-info="portraitData.basicInfo"
/>
<section class="detail-card"> <section class="detail-card">
<h3 class="detail-card__title"> <h3 class="detail-card__title">
消费力标签({{ consumptionScore }}分) 消费力标签({{ consumptionScore }}分)
</h3> </h3>
<template v-if="consumptionDimensions.length"> <template v-if="consumptionDimensions.length">
<div <div v-for="(dimension, index) in consumptionDimensions"
v-for="(dimension, index) in consumptionDimensions"
:key="`consumption-${index}`" :key="`consumption-${index}`"
class="field-row" class="field-row">
>
<span class="field-label">{{ dimension.dimensionName }}:</span> <span class="field-label">{{ dimension.dimensionName }}:</span>
<div class="tag-list"> <div class="tag-list">
<template v-if="dimension.tags.length"> <template v-if="dimension.tags.length">
<el-tag <el-tag v-for="(tag, tagIndex) in dimension.tags"
v-for="(tag, tagIndex) in dimension.tags"
:key="`consumption-tag-${index}-${tagIndex}`" :key="`consumption-tag-${index}-${tagIndex}`"
size="small"
class="tag-item" class="tag-item"
> size="small">
{{ tag }} {{ tag }}
</el-tag> </el-tag>
</template> </template>
...@@ -42,20 +36,16 @@ ...@@ -42,20 +36,16 @@
产品标签({{ productScore }}分) 产品标签({{ productScore }}分)
</h3> </h3>
<template v-if="productDimensions.length"> <template v-if="productDimensions.length">
<div <div v-for="(dimension, index) in productDimensions"
v-for="(dimension, index) in productDimensions"
:key="`product-${index}`" :key="`product-${index}`"
class="field-row" class="field-row">
>
<span class="field-label">{{ dimension.dimensionName }}:</span> <span class="field-label">{{ dimension.dimensionName }}:</span>
<div class="tag-list"> <div class="tag-list">
<template v-if="dimension.tags.length"> <template v-if="dimension.tags.length">
<el-tag <el-tag v-for="(tag, tagIndex) in dimension.tags"
v-for="(tag, tagIndex) in dimension.tags"
:key="`product-tag-${index}-${tagIndex}`" :key="`product-tag-${index}-${tagIndex}`"
size="small"
class="tag-item" class="tag-item"
> size="small">
{{ tag }} {{ tag }}
</el-tag> </el-tag>
</template> </template>
...@@ -72,47 +62,35 @@ ...@@ -72,47 +62,35 @@
<h3 class="detail-card__title"> <h3 class="detail-card__title">
行为标签({{ behaviorScore }}分) 行为标签({{ behaviorScore }}分)
</h3> </h3>
<el-table <el-table class="behavior-table"
:data="behaviorTagList"
border
size="small" size="small"
class="behavior-table" border
> :data="behaviorTagList">
<el-table-column <el-table-column align="center"
label="序号" label="序号"
type="index" type="index"
width="60" width="60" />
align="center" <el-table-column align="center"
/>
<el-table-column
label="标签维度" label="标签维度"
prop="dimensionName"
min-width="200" min-width="200"
align="center" prop="dimensionName" />
/> <el-table-column align="center"
<el-table-column
label="枚举值" label="枚举值"
min-width="120" min-width="120">
align="center" <template #default="scope">
> <el-tag v-if="scope.row.enumName"
<template slot-scope="scope">
<el-tag
v-if="scope.row.enumName"
size="small"
class="tag-item" class="tag-item"
> size="small">
{{ scope.row.enumName }} {{ scope.row.enumName }}
</el-tag> </el-tag>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column align="left"
label="依据" label="依据"
prop="basis"
min-width="320" min-width="320"
align="left" prop="basis">
> <template #default="scope">
<template slot-scope="scope">
<span class="basis-text">{{ scope.row.basis || "-" }}</span> <span class="basis-text">{{ scope.row.basis || "-" }}</span>
</template> </template>
</el-table-column> </el-table-column>
...@@ -120,7 +98,9 @@ ...@@ -120,7 +98,9 @@
</section> </section>
<div class="footer-actions"> <div class="footer-actions">
<el-button type="primary" size="medium" @click="handleBack"> <el-button size="medium"
type="primary"
@click="handleBack">
返回 返回
</el-button> </el-button>
</div> </div>
...@@ -185,7 +165,7 @@ export default { ...@@ -185,7 +165,7 @@ export default {
} }
this.customerRow = resolveCustomerRowFromRoute( this.customerRow = resolveCustomerRowFromRoute(
this.$route, this.$route,
loadCustomerSnapshot() loadCustomerSnapshot(),
); );
this.loadPortrait(); this.loadPortrait();
}, },
...@@ -197,12 +177,12 @@ export default { ...@@ -197,12 +177,12 @@ export default {
id: this.customerId, id: this.customerId,
}); });
this.applyPortraitData( this.applyPortraitData(
mapProfileResponse(res || {}, this.customerRow) mapProfileResponse(res || {}, this.customerRow),
); );
} catch (err) { } catch (err) {
this.$message.error(err.message || "加载客户画像失败"); this.$message.error(err.message || "加载客户画像失败");
this.applyPortraitData( this.applyPortraitData(
mapProfileResponse({}, this.customerRow) mapProfileResponse({}, this.customerRow),
); );
} finally { } finally {
this.pageLoading = false; this.pageLoading = false;
......
...@@ -211,34 +211,38 @@ export function mapProfileResponse(res = {}, snapshotRow = {}) { ...@@ -211,34 +211,38 @@ export function mapProfileResponse(res = {}, snapshotRow = {}) {
}; };
const consumptionTag = res.consumptionTag || {}; const consumptionTag = res.consumptionTag || {};
// 接口字段名与 categoryName 语义对调:产品数据在 behaviorTag,行为数据在 productTag const productTag = res.productTag || {};
const apiProductTag = res.behaviorTag || {}; const behaviorTag = res.behaviorTag || {};
const apiBehaviorTag = res.productTag || {};
const consumptionDimensions = (consumptionTag.dimensions || []).map((dimension) => ({ const consumptionDimensions = (consumptionTag.dimensions || []).map((dimension) => ({
dimensionName: dimension.dimensionName || "-", dimensionName: dimension.dimensionName || "-",
tags: (dimension.enumValues || []).map((item) => item.enumName).filter(Boolean), tags: (dimension.enumValues || []).map((item) => item.enumName).filter(Boolean),
})); }));
const productDimensions = (apiProductTag.dimensions || []).map((dimension) => ({ const productDimensions = [];
dimensionName: dimension.dimensionName || "-",
tags: (dimension.enumValues || []).map((item) => item.enumName).filter(Boolean), const dealTags = (productTag.dealEnumValues || [])
})); .map((item) => item.enumName)
.filter(Boolean);
if (dealTags.length) {
productDimensions.push({ dimensionName: "已成交品类", tags: dealTags });
}
const noDealTags = (productTag.noDealEnumValues || [])
.map((item) => item.enumName)
.filter(Boolean);
if (noDealTags.length) {
productDimensions.push({ dimensionName: "未成交品类", tags: noDealTags });
}
const behaviorTagList = []; const behaviorTagList = [];
const behaviorCategory = apiBehaviorTag.categoryName || "行为标签"; (behaviorTag.dimensions || []).forEach((dimension) => {
(apiBehaviorTag.dealEnumValues || []).forEach((item) => { (dimension.enumValues || []).forEach((enumValue) => {
behaviorTagList.push({ behaviorTagList.push({
dimensionName: behaviorCategory, dimensionName: dimension.dimensionName || "-",
enumName: item.enumName || "", enumName: enumValue.enumName || "",
basis: item.scoreBasis || "", basis: enumValue.scoreBasis || "",
});
}); });
(apiBehaviorTag.noDealEnumValues || []).forEach((item) => {
behaviorTagList.push({
dimensionName: behaviorCategory,
enumName: item.enumName || "",
basis: item.scoreBasis || "",
}); });
}); });
...@@ -246,9 +250,9 @@ export function mapProfileResponse(res = {}, snapshotRow = {}) { ...@@ -246,9 +250,9 @@ export function mapProfileResponse(res = {}, snapshotRow = {}) {
basicInfo, basicInfo,
consumptionScore: consumptionTag.totalScore || 0, consumptionScore: consumptionTag.totalScore || 0,
consumptionDimensions, consumptionDimensions,
productScore: apiProductTag.totalScore || 0, productScore: productTag.totalScore || 0,
productDimensions, productDimensions,
behaviorScore: apiBehaviorTag.totalScore || 0, behaviorScore: behaviorTag.totalScore || 0,
behaviorTagList, behaviorTagList,
}; };
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!