Commit 8457cbaa by Jaxon

Merge branch 'SAAS+V5.8.3' of http://192.168.3.233:8090/saas_plus/dj-car-life-sy…

…stem into feature/marketing-sop-push-strategy
2 parents 7f46e36a a60e5744
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
"private": true, "private": true,
"scripts": { "scripts": {
"备注": "去掉nomock配置命令", "备注": "去掉nomock配置命令",
"serve": "vue-cli-service serve", "serve": "set NODE_OPTIONS=--max-old-space-size=4096&& vue-cli-service serve",
"start": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve", "start": "npm run serve",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && npm run serve", "dev": "npm run serve",
"build": "vue-cli-service build --no-module", "build": "vue-cli-service build --no-module",
"build:nomock": "vue-cli-service build --mode nomock", "build:nomock": "vue-cli-service build --mode nomock",
"lint": "vue-cli-service lint --fix", "lint": "vue-cli-service lint --fix",
......
<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;
......
...@@ -52,7 +52,7 @@ export function formatCarModel(row = {}) { ...@@ -52,7 +52,7 @@ export function formatCarModel(row = {}) {
return carModel; return carModel;
} }
const parts = [row.carBrand, row.carSeriesName, row.carTypeName] const parts = [row.carBrand, row.carSeriesName, row.carTypeName]
.map((item) => (item || "").trim()) .map(item => (item || "").trim())
.filter(Boolean); .filter(Boolean);
return parts.length ? parts.join("-") : ""; return parts.length ? parts.join("-") : "";
} }
...@@ -92,10 +92,8 @@ export function formatGroupStatus(row = {}) { ...@@ -92,10 +92,8 @@ export function formatGroupStatus(row = {}) {
} }
export function formatDeliveryTime(row = {}) { export function formatDeliveryTime(row = {}) {
const time = row.deliveryDate const time = row.deliveryDate;
|| row.deliveryTime
|| row.buyTimeStr
|| (row.order && row.order.installUpgradeTime);
return formatDateValue(time); return formatDateValue(time);
} }
...@@ -115,7 +113,7 @@ export function formatCustomerStatus(row = {}, statusList = CUSTOMER_STATUS_LIST ...@@ -115,7 +113,7 @@ export function formatCustomerStatus(row = {}, statusList = CUSTOMER_STATUS_LIST
if (customerStatus == null || customerStatus === "") { if (customerStatus == null || customerStatus === "") {
return "-"; return "-";
} }
const matched = statusList.find((item) => Number(item.confId) === Number(customerStatus)); const matched = statusList.find(item => Number(item.confId) === Number(customerStatus));
return matched ? matched.confLabel : "-"; return matched ? matched.confLabel : "-";
} }
...@@ -187,7 +185,7 @@ function buildProfileCarModel(res = {}) { ...@@ -187,7 +185,7 @@ function buildProfileCarModel(res = {}) {
return carModel; return carModel;
} }
const parts = [res.carBrand, res.carSeriesName] const parts = [res.carBrand, res.carSeriesName]
.map((item) => (item || "").trim()) .map(item => (item || "").trim())
.filter(Boolean); .filter(Boolean);
return parts.length ? parts.join("-") : ""; return parts.length ? parts.join("-") : "";
} }
...@@ -211,34 +209,38 @@ export function mapProfileResponse(res = {}, snapshotRow = {}) { ...@@ -211,34 +209,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 +248,9 @@ export function mapProfileResponse(res = {}, snapshotRow = {}) { ...@@ -246,9 +248,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,
}; };
} }
......
...@@ -55,13 +55,12 @@ ...@@ -55,13 +55,12 @@
:key="item.tagName" :key="item.tagName"
:label="item.tagName" :label="item.tagName"
:value="item.tagName" /> :value="item.tagName" />
<div class="select-footer"> <el-option key="manage-tag"
<el-button size="mini" style="color: #2A58AD;cursor: pointer !important;"
type="text" disabled
@click.stop="openTagManage"> :value="null">
管理标签 <span @click.stop="openTagManage">管理标签</span>
</el-button> </el-option>
</div>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -219,6 +218,16 @@ export default { ...@@ -219,6 +218,16 @@ export default {
StoreListDialog, StoreListDialog,
}, },
mixins: [reportTrackPageMixin], mixins: [reportTrackPageMixin],
beforeRouteEnter(to, from, next) {
if (to.query.activityId && to.query.type) {
to.meta.title = "再次创建";
} else if (to.query.activityId) {
to.meta.title = "编辑活动";
} else {
to.meta.title = "新增活动";
}
next();
},
data() { data() {
return { return {
...@@ -535,7 +544,7 @@ export default { ...@@ -535,7 +544,7 @@ export default {
// 有门店被删除或替换,且存在已选车系或套餐时提示 // 有门店被删除或替换,且存在已选车系或套餐时提示
if (removedIds.length > 0 && (this.selectedSeries.length || this.directPackages.length)) { if (removedIds.length > 0 && (this.selectedSeries.length || this.directPackages.length)) {
this.$confirm("适用门店已变更,已添加的车系及商品/套餐将被清除。", "确认变更?", { this.$confirm("已添加的商品或套餐需要重新设置,确定继续?", "适用门店移除", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
...@@ -557,7 +566,7 @@ export default { ...@@ -557,7 +566,7 @@ export default {
removeStore(store) { removeStore(store) {
// 有已选车系或套餐时提示 // 有已选车系或套餐时提示
if (this.selectedSeries.length || this.directPackages.length) { if (this.selectedSeries.length || this.directPackages.length) {
this.$confirm("适用门店已变更,已添加的车系及商品/套餐将被清除。", "确认移除?", { this.$confirm("已添加的商品或套餐需要重新设置,确定继续?", "适用门店移除", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
...@@ -953,13 +962,13 @@ export default { ...@@ -953,13 +962,13 @@ export default {
for (const series of this.selectedSeries) { for (const series of this.selectedSeries) {
const count = (this.seriesPackages[series.id] || []).length; const count = (this.seriesPackages[series.id] || []).length;
if (count > MAX_LIMIT) { if (count > MAX_LIMIT) {
this.$message.warning(`${series.name} 的套餐/商品数量不能超过${MAX_LIMIT}条(当前${count}条)`); this.$message.warning(`${series.name}最多添加100个商品及套餐`);
return false; return false;
} }
} }
} else { } else {
if (this.directPackages.length > MAX_LIMIT) { if (this.directPackages.length > MAX_LIMIT) {
this.$message.warning(`套餐/商品数量不能超过${MAX_LIMIT}条(当前${this.directPackages.length}条)`); this.$message.warning(`最多添加100个商品及套餐`);
return false; return false;
} }
} }
...@@ -1132,10 +1141,8 @@ export default { ...@@ -1132,10 +1141,8 @@ export default {
carSeriesMode, carSeriesMode,
carSeriesList, carSeriesList,
}; };
eventRequest({ requestJson: JSON.stringify(params) }).then((res) => {
console.log("提交参数:", params); this.$message.success("操作成功");
eventRequest(params).then((res) => {
this.$message.success(this.pageType == "edit" ? "编辑成功" : "新增成功");
this.submitting = false; this.submitting = false;
this.$router.replace("/marketingActivity"); this.$router.replace("/marketingActivity");
}).catch(() => { }).catch(() => {
......
...@@ -635,6 +635,7 @@ export default { ...@@ -635,6 +635,7 @@ export default {
// 上传组件 // 上传组件
.upload-cell { .upload-cell {
overflow: hidden;
position: relative; position: relative;
width: 60px; width: 60px;
height: 60px; height: 60px;
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
class="sub-table-wrapper"> class="sub-table-wrapper">
<div class="sub-table-header"> <div class="sub-table-header">
<span class="sh-col sh-col-name">产品名称</span> <span class="sh-col sh-col-name">产品名称</span>
<span class="sh-col sh-col-name">产品别名</span> <span class="sh-col sh-col-name">商品别名</span>
<span class="sh-col sh-col-id">产品ID</span> <span class="sh-col sh-col-id">产品ID</span>
<span class="sh-col sh-col-price">现售价</span> <span class="sh-col sh-col-price">现售价</span>
<span class="sh-col sh-col-min">最低售价</span> <span class="sh-col sh-col-min">最低售价</span>
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
class="sub-table-wrapper"> class="sub-table-wrapper">
<div class="sub-table-header"> <div class="sub-table-header">
<span class="sh-col sh-col-name">产品名称</span> <span class="sh-col sh-col-name">产品名称</span>
<span class="sh-col sh-col-name">产品别名</span> <span class="sh-col sh-col-name">商品别名</span>
<span class="sh-col sh-col-id">产品ID</span> <span class="sh-col sh-col-id">产品ID</span>
<span class="sh-col sh-col-price">现售价</span> <span class="sh-col sh-col-price">现售价</span>
<span class="sh-col sh-col-min">最低售价</span> <span class="sh-col sh-col-min">最低售价</span>
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
<!-- 子商品表头 --> <!-- 子商品表头 -->
<div class="sub-table-header"> <div class="sub-table-header">
<span class="sh-col sh-col-name">产品名称</span> <span class="sh-col sh-col-name">产品名称</span>
<span class="sh-col sh-col-name">产品别名</span> <span class="sh-col sh-col-name">商品别名</span>
<span class="sh-col sh-col-id">产品ID</span> <span class="sh-col sh-col-id">产品ID</span>
<span class="sh-col sh-col-price">现售价</span> <span class="sh-col sh-col-price">现售价</span>
<span class="sh-col sh-col-min">最低售价</span> <span class="sh-col sh-col-min">最低售价</span>
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" <el-table-column align="center"
label="产品别名" label="商品别名"
width="180"> width="180">
<template #default="scope"> <template #default="scope">
{{ emptyFilter(scope.row.goodsAlias) }} {{ emptyFilter(scope.row.goodsAlias) }}
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<el-select v-model="form.brandId" <el-select v-model="form.brandId"
placeholder="请选择品牌" placeholder="请选择品牌"
style="width: 100%" style="width: 100%"
filterable
@change="handleBrandChange"> @change="handleBrandChange">
<el-option v-for="item in brandList" <el-option v-for="item in brandList"
:key="item.id" :key="item.id"
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
<el-select v-model="form.subBrandId" <el-select v-model="form.subBrandId"
placeholder="请选择子品牌" placeholder="请选择子品牌"
style="width: 100%" style="width: 100%"
filterable
:disabled="!form.brandId" :disabled="!form.brandId"
@change="handleSubBrandChange"> @change="handleSubBrandChange">
<el-option v-for="item in subBrandList" <el-option v-for="item in subBrandList"
...@@ -39,6 +41,7 @@ ...@@ -39,6 +41,7 @@
<el-select v-model="form.seriesId" <el-select v-model="form.seriesId"
placeholder="请选择车系" placeholder="请选择车系"
style="width: 100%" style="width: 100%"
filterable
:disabled="!form.subBrandId"> :disabled="!form.subBrandId">
<el-option v-for="item in seriesList" <el-option v-for="item in seriesList"
:key="item.id" :key="item.id"
......
...@@ -172,10 +172,16 @@ export default { ...@@ -172,10 +172,16 @@ export default {
// 删除标签 // 删除标签
handleDeleteTag(row) { handleDeleteTag(row) {
this.$confirm("确认删除标签?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
}).then(() => {
deleteActivityTag({ tagId: row.tagId }).then((res) => { deleteActivityTag({ tagId: row.tagId }).then((res) => {
this.$message.success("删除成功"); this.$message.success("删除成功");
this.emitChange(); this.emitChange();
}); });
});
}, },
// 新增标签 // 新增标签
......
...@@ -287,7 +287,7 @@ export default { ...@@ -287,7 +287,7 @@ export default {
mockStatus: "NOT_STARTED", mockStatus: "NOT_STARTED",
// 门店分页 // 门店分页
storePageNum: 1, storePageNum: 1,
storePageSize: 5, storePageSize: 10,
// 操作日志分页 // 操作日志分页
logPageNum: 1, logPageNum: 1,
logPageSize: 10, logPageSize: 10,
......
<template> <template>
<glsk-form-dialog <glsk-form-dialog v-if="visible"
v-if="visible" default-width="320px"
:selectVisible="visible"
:dialogConfig="dialogConfig"
label-width="120px"
dialog-width="520px" dialog-width="520px"
defaultWidth="320px" label-width="120px"
:formRules="formRules" :base-data="baseData"
:editData="editData" :dialog-config="dialogConfig"
:editFormData="editFormData" :edit-data="editData"
:baseData="baseData" :edit-form-data="editFormData"
:form-rules="formRules"
:select-visible="visible"
@handleClose="$emit('update:visible', false)" @handleClose="$emit('update:visible', false)"
@handleConfirm="handleConfirm" @handleConfirm="handleConfirm" />
/>
</template> </template>
<script> <script>
import { import {
createTagDimension, createTagDimension,
updateTagDimension,
queryTagDimensionDetail, queryTagDimensionDetail,
updateTagDimension,
} from "@api/tagManagement"; } from "@api/tagManagement";
export default { export default {
...@@ -41,10 +39,6 @@ export default { ...@@ -41,10 +39,6 @@ export default {
type: Array, type: Array,
default: () => [], default: () => [],
}, },
defaultCategoryId: {
type: [Number, String],
default: "",
},
}, },
data() { data() {
return { return {
...@@ -92,7 +86,7 @@ export default { ...@@ -92,7 +86,7 @@ export default {
placeholder: "请选择所属标签类别", placeholder: "请选择所属标签类别",
filterable: true, filterable: true,
optionsName: "categoryOptions", optionsName: "categoryOptions",
optionId: "value", optionId: "id",
optionLabel: "fullPath", optionLabel: "fullPath",
optionList: [], optionList: [],
disabled: this.categoryReadonly, disabled: this.categoryReadonly,
...@@ -119,13 +113,27 @@ export default { ...@@ -119,13 +113,27 @@ export default {
}, },
categoryOptions: { categoryOptions: {
handler(val) { handler(val) {
this.baseData.categoryOptions = val || []; this.baseData.categoryOptions = (val || []).map(item => ({
...item,
id: item.id != null ? item.id : item.value,
fullPath: item.fullPath || item.categoryName || "",
}));
}, },
immediate: true, immediate: true,
deep: true, deep: true,
}, },
}, },
methods: { methods: {
resolveCategoryId(categoryId) {
if (categoryId == null || categoryId === "") {
return "";
}
const options = this.baseData.categoryOptions || [];
const matched = options.find(
item => String(item.id) === String(categoryId),
);
return matched ? matched.id : categoryId;
},
async initForm() { async initForm() {
if (this.isEdit) { if (this.isEdit) {
try { try {
...@@ -135,7 +143,7 @@ export default { ...@@ -135,7 +143,7 @@ export default {
this.editData = { this.editData = {
id: detail.id, id: detail.id,
dimensionName: detail.dimensionName || "", dimensionName: detail.dimensionName || "",
categoryId: detail.categoryId, categoryId: this.resolveCategoryId(detail.categoryId),
}; };
} catch (err) { } catch (err) {
this.$message.error(err.message || "获取维度详情失败"); this.$message.error(err.message || "获取维度详情失败");
...@@ -143,14 +151,14 @@ export default { ...@@ -143,14 +151,14 @@ export default {
this.editData = { this.editData = {
id: row.id, id: row.id,
dimensionName: row.dimensionName || "", dimensionName: row.dimensionName || "",
categoryId: row.categoryId, categoryId: this.resolveCategoryId(row.categoryId),
}; };
} }
} else { } else {
this.editData = { this.editData = {
id: "", id: "",
dimensionName: "", dimensionName: "",
categoryId: this.defaultCategoryId || "", categoryId: "",
}; };
} }
}, },
......
...@@ -84,6 +84,7 @@ export default { ...@@ -84,6 +84,7 @@ export default {
{ {
label: "标签枚举值名称", label: "标签枚举值名称",
name: "enumName", name: "enumName",
labelRequired: true,
type: "input", type: "input",
placeholder: "请输入", placeholder: "请输入",
maxlength: 20, maxlength: 20,
...@@ -95,6 +96,7 @@ export default { ...@@ -95,6 +96,7 @@ export default {
{ {
label: "命中客户分", label: "命中客户分",
name: "score", name: "score",
labelRequired: true,
type: "input", type: "input",
placeholder: "请输入0~100的整数", placeholder: "请输入0~100的整数",
maxlength: 3, maxlength: 3,
......
...@@ -32,6 +32,13 @@ ...@@ -32,6 +32,13 @@
</el-button> </el-button>
</template> </template>
</d2-table> </d2-table>
<div class="footer-actions">
<el-button size="medium"
type="primary"
@click="handleBack">
返回
</el-button>
</div>
</div> </div>
<EnumFormDialog :dimension-data="dimensionDetail" <EnumFormDialog :dimension-data="dimensionDetail"
...@@ -186,6 +193,9 @@ export default { ...@@ -186,6 +193,9 @@ export default {
handleEnumFormSuccess() { handleEnumFormSuccess() {
this.refreshTable(); this.refreshTable();
}, },
handleBack() {
this.$router.push({ name: "tagManagement" });
},
}, },
}; };
</script> </script>
...@@ -211,5 +221,11 @@ export default { ...@@ -211,5 +221,11 @@ export default {
.d2-container-content { .d2-container-content {
padding: 16px 20px; padding: 16px 20px;
} }
.footer-actions {
margin-top: 8px;
padding: 16px 0 8px;
text-align: center;
}
} }
</style> </style>
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
:visible.sync="categoryDialogVisible" :visible.sync="categoryDialogVisible"
@success="handleCategorySuccess" /> @success="handleCategorySuccess" />
<DimensionFormDialog :category-options="dimensionCategoryOptions" <DimensionFormDialog :category-options="dimensionCategoryOptions"
:default-category-id="selectedCategoryId"
:dimension-data="currentDimension" :dimension-data="currentDimension"
:mode="dimensionDialogMode" :mode="dimensionDialogMode"
:visible.sync="dimensionDialogVisible" :visible.sync="dimensionDialogVisible"
...@@ -213,6 +212,31 @@ export default { ...@@ -213,6 +212,31 @@ export default {
this.$refs.dimensionTable.refreshTable(); this.$refs.dimensionTable.refreshTable();
} }
}, },
findCategoryInTree(list, id) {
for (const item of list || []) {
if (String(item.id) === String(id)) {
return item;
}
if (item.children && item.children.length) {
const found = this.findCategoryInTree(item.children, id);
if (found) {
return found;
}
}
}
return null;
},
syncSelectedCategory() {
if (this.selectedCategoryId === "" || this.selectedCategoryId == null) {
this.selectedCategory = null;
return;
}
const found = this.findCategoryInTree(
this.categoryTree,
this.selectedCategoryId,
);
this.selectedCategory = found;
},
handleAddCategory() { handleAddCategory() {
this.categoryDialogMode = "add"; this.categoryDialogMode = "add";
this.currentCategory = {}; this.currentCategory = {};
...@@ -260,15 +284,20 @@ export default { ...@@ -260,15 +284,20 @@ export default {
}, },
}); });
}, },
handleCategorySuccess() { async handleCategorySuccess() {
this.loadCategoryTree(); await this.loadCategoryTree();
this.loadCategoryLeafOptions(); this.syncSelectedCategory();
this.loadDimensionCategoryOptions(); await Promise.all([
this.loadCategoryLeafOptions(),
this.loadDimensionCategoryOptions(),
]);
this.refreshTable();
}, },
handleDimensionSuccess() { async handleDimensionSuccess() {
await this.loadCategoryTree();
this.syncSelectedCategory();
await this.loadDimensionCategoryOptions();
this.refreshTable(); this.refreshTable();
this.loadCategoryTree();
this.loadDimensionCategoryOptions();
}, },
}, },
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!