Commit d34f6dee by 李伟康

feat(earlyWarningManager): 添加留言策略类型并实现详情查看功能

- 在策略类型选项中新增留言类型(类型7)
- 为留言策略创建独立的表单配置STRATEGY_FORM_7和显示组件
- 实现策略分析页面点击查看详情的功能跳转
- 优化策略详情页面样式布局,支持不同类型策略的差异化展示
- 修复数据字段引用错误,将strategyTotalCount改为strategyCount
- 添加删除按钮显示逻辑的时间判断优化
1 parent c22d646f
...@@ -118,14 +118,14 @@ ...@@ -118,14 +118,14 @@
<div slot="content" class="tooltip-content-max"> <div slot="content" class="tooltip-content-max">
<div v-if="scope.scope.strategyTypeStatisticsResponse && Array.isArray(scope.scope.strategyTypeStatisticsResponse) && scope.scope.strategyTypeStatisticsResponse.length > 0"> <div v-if="scope.scope.strategyTypeStatisticsResponse && Array.isArray(scope.scope.strategyTypeStatisticsResponse) && scope.scope.strategyTypeStatisticsResponse.length > 0">
<div v-for="(item, index) in scope.scope.strategyTypeStatisticsResponse" :key="index"> <div v-for="(item, index) in scope.scope.strategyTypeStatisticsResponse" :key="index">
{{ item.strategyTypeName }}:{{ item.strategyTotalCount }} {{ item.strategyTypeName }}:{{ item.strategyCount }}
</div> </div>
</div> </div>
<div v-else>{{scope.columnsObj.formatter(scope.scope) || '暂无数据'}}</div> <div v-else>{{scope.columnsObj.formatter(scope.scope) || '暂无数据'}}</div>
</div> </div>
<span class="two-line-ellipsis" style="color: #2A58AD;">{{ scope.columnsObj.formatter(scope.scope) }}</span> <span class="two-line-ellipsis" style="color: #2A58AD;cursor: pointer;" @click="handleViewDetail(scope.scope)">{{ scope.columnsObj.formatter(scope.scope) }}</span>
</el-tooltip> </el-tooltip>
<span v-else style="color: #2A58AD;">{{ scope.columnsObj.formatter(scope.scope) }}</span> <span v-else style="color: #2A58AD;cursor: pointer;" @click="handleViewDetail(scope.scope)">{{ scope.columnsObj.formatter(scope.scope) }}</span>
</div> </div>
<!-- 线上运营 --> <!-- 线上运营 -->
<div slot="onlineOperator" slot-scope="scope"> <div slot="onlineOperator" slot-scope="scope">
...@@ -761,6 +761,33 @@ export default { ...@@ -761,6 +761,33 @@ export default {
this.loading.onlineOperData = false; this.loading.onlineOperData = false;
} }
}, },
handleViewDetail(e) {
// 构建查询参数
const query = {
merchantNo: e.merchantId4s,
storeName: e.merchantName4s
};
// 添加时间范围类型
if (this.timeRangeType && this.timeRangeType.value !== undefined) {
query.timeRangeType = this.timeRangeType.value;
}
// 添加日期范围
if (this.dateRange) {
if (this.dateRange.startDate) {
query.startDate = this.dateRange.startDate;
}
if (this.dateRange.endDate) {
query.endDate = this.dateRange.endDate;
}
}
this.$router.push({
path: '/storeSignboard',
query
});
},
} }
}; };
</script> </script>
......
import dayjs from "dayjs" import dayjs from "dayjs"
const STRATEGYTYPEOPTIONS = { const STRATEGYTYPEOPTIONS = {
0: '学习', 0: '学习',
1: '优秀案例分享', 1: '优秀案例分享',
2: '带教', 2: '带教',
3: '任务下发', 3: '任务下发',
4: '销售精英到店提拉', 4: '销售精英到店提拉',
5: '强力促销', 5: '强力促销',
6: '最终盘点与低客单产品购入', 6: '最终盘点与低客单产品购入',
7: '留言'
} }
const DATE_RANGE = { const DATE_RANGE = {
label: '执行周期', label: '执行周期',
format: (val) => { format: (val) => {
let { startDate, endDate } = val let {
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}` startDate,
} endDate
} = val
return `${dayjs(startDate).format('YYYY-MM-DD')}至 ${dayjs(endDate).format('YYYY-MM-DD')}`
}
} }
const TITLE = { const TITLE = {
label: '标题', label: '标题',
key: 'title', key: 'title',
} }
const CREATED = { const CREATED = {
label: '操作人', label: '操作人',
key: 'createdBy', key: 'createdBy',
} }
const CREATED_DATE = { const CREATED_DATE = {
label: '操作时间', label: '操作时间',
format: (val) => { format: (val) => {
return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss') return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')
} }
} }
const STRATEGY_FORM_01 = [ const STRATEGY_FORM_01 = [
TITLE, TITLE,
DATE_RANGE, DATE_RANGE,
CREATED, CREATED,
CREATED_DATE CREATED_DATE
] ]
const STRATEGY_FORM_2456 = [ const STRATEGY_FORM_2456 = [
CREATED, CREATED,
DATE_RANGE, DATE_RANGE,
{ {
label: '执行人', label: '执行人',
format: (val) => { format: (val) => {
let { executePersons } = val let {
return executePersons.map(item => item.username).join('、') executePersons
}, } = val
hide: (val) => { return executePersons.map(item => item.username).join('、')
let { strategyType } = val },
return [5, 6].includes(strategyType) hide: (val) => {
} let {
}, strategyType
CREATED_DATE } = val
return [5, 6].includes(strategyType)
}
},
CREATED_DATE
] ]
const STRATEGY_FORM_3 = [ const STRATEGY_FORM_3 = [
CREATED, CREATED,
TITLE, TITLE,
CREATED_DATE, CREATED_DATE,
{ {
label: '副标题', label: '副标题',
key: 'subTitle', key: 'subTitle',
class: 'bespread', class: 'bespread',
}, },
{ {
label: '执行时间', label: '执行时间',
key: 'startDate', key: 'startDate',
}, },
]
const STRATEGY_FORM_7 = [{
label: '留言人',
key: 'createdBy',
},
{
label: '处理人',
format: (val) => {
let {
executePersons
} = val
return executePersons.map(item => item.username).join('、')
},
},
] ]
export { export {
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
}
\ No newline at end of file \ No newline at end of file
STRATEGYTYPEOPTIONS,
STRATEGY_FORM_01,
STRATEGY_FORM_2456,
STRATEGY_FORM_3,
STRATEGY_FORM_7
}
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
> >
<div class="content"> <div class="content">
<!-- <el-scrollbar class="content"> --> <!-- <el-scrollbar class="content"> -->
<div class="detail-info"> <div :class="['detail-info', { 'detail-info-7': detailInfo.strategyType == 7 }]">
<template v-for="(item,index) in strategyDetailFormList"> <template v-for="(item, index) in strategyDetailFormList">
<div <div
:class="['info-item',item.class]" :class="['info-item', item.class]"
:key="index" :key="index"
v-if="!item.hide || !item.hide(detailInfo)" v-if="!item.hide || !item.hide(detailInfo)"
> >
...@@ -38,15 +38,15 @@ ...@@ -38,15 +38,15 @@
</div> </div>
</template> </template>
</div> </div>
<template v-if="[0,1].includes(detailInfo.strategyType)"> <template v-if="[0, 1].includes(detailInfo.strategyType)">
<study-view <study-view
:info="detailInfo" :info="detailInfo"
@openReceptionDialog="$emit('openReceptionDialog',$event)" @openReceptionDialog="$emit('openReceptionDialog', $event)"
></study-view> ></study-view>
</template> </template>
<template v-if="[5,6].includes(detailInfo.strategyType)"> <template v-if="[5, 6].includes(detailInfo.strategyType)">
<div class="order-info"> <div class="order-info">
<template v-for="(item,index) in orderFormList"> <template v-for="(item, index) in orderFormList">
<div <div
class="info-item flex" class="info-item flex"
:key="index" :key="index"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<div class="label">{{ item.label }}:</div> <div class="label">{{ item.label }}:</div>
<div class="value"> <div class="value">
<template v-if="item.format">{{ item.format(detailInfo) }}</template> <template v-if="item.format">{{ item.format(detailInfo) }}</template>
<template v-else>{{ detailInfo[item.key] != null ? detailInfo[item.key] : '-' }}</template> <template v-else>{{ detailInfo[item.key] != null ? detailInfo[item.key] : '-' }}</template>
</div> </div>
</div> </div>
</template> </template>
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
> >
<template #statusHtml="scope"> <template #statusHtml="scope">
<div class="online-status"> <div class="online-status">
<span :class="['dot',{un:scope.scope.readStatus == 0}]"></span> <span :class="['dot', { un: scope.scope.readStatus == 0 }]"></span>
{{ { {{ {
0: '未查看', 0: '未查看',
1: '已查看' 1: '已查看'
...@@ -111,6 +111,7 @@ import { ...@@ -111,6 +111,7 @@ import {
STRATEGY_FORM_01, STRATEGY_FORM_01,
STRATEGY_FORM_2456, STRATEGY_FORM_2456,
STRATEGY_FORM_3, STRATEGY_FORM_3,
STRATEGY_FORM_7
} from './contant' } from './contant'
import StudyView from './StudyView.vue'; import StudyView from './StudyView.vue';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
...@@ -191,19 +192,23 @@ export default { ...@@ -191,19 +192,23 @@ export default {
} }
}, },
strategyDetailFormList () { strategyDetailFormList () {
const { strategyType } = this.detailInfo, let { strategyType } = this.detailInfo,
list = [2, 4, 5, 6].includes(strategyType) list = [2, 4, 5, 6].includes(strategyType)
? STRATEGY_FORM_2456 : ? STRATEGY_FORM_2456 :
[0, 1].includes(strategyType) [0, 1].includes(strategyType)
? STRATEGY_FORM_01 ? STRATEGY_FORM_01
: STRATEGY_FORM_3 || [] : STRATEGY_FORM_3
return [ if (strategyType == 7) list = STRATEGY_FORM_7
else list = [
{ {
label: '执行策略', label: '执行策略',
format: item => { format: item => {
return STRATEGYTYPEOPTIONS[item.strategyType] return STRATEGYTYPEOPTIONS[item.strategyType]
} }
}, },
...list
]
return [
...list, ...list,
{ {
label: '策略说明', label: '策略说明',
...@@ -286,19 +291,23 @@ export default { ...@@ -286,19 +291,23 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
::v-deep.strategy-drawer { ::v-deep.strategy-drawer {
.el-drawer__header { .el-drawer__header {
padding: 0; padding: 0;
margin: 0; margin: 0;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
.el-drawer__close-btn { .el-drawer__close-btn {
padding: 0 20px; padding: 0 20px;
.el-dialog__close { .el-dialog__close {
font-weight: 700; font-weight: 700;
font-size: 24px; font-size: 24px;
} }
} }
&-title { &-title {
height: 26px; height: 26px;
line-height: 26px; line-height: 26px;
...@@ -307,12 +316,15 @@ export default { ...@@ -307,12 +316,15 @@ export default {
padding: 17px 20px; padding: 17px 20px;
font-weight: bold; font-weight: bold;
} }
&-content { &-content {
height: calc(100vh - 61px); height: calc(100vh - 61px);
.content { .content {
height: calc(100% - 61px); height: calc(100% - 61px);
padding: 0 20px; padding: 0 20px;
overflow-y: auto; overflow-y: auto;
.detail-info { .detail-info {
margin: 20px 0 16px; margin: 20px 0 16px;
background: #fafafa; background: #fafafa;
...@@ -321,16 +333,19 @@ export default { ...@@ -321,16 +333,19 @@ export default {
flex-wrap: wrap; flex-wrap: wrap;
gap: 20px 0; gap: 20px 0;
} }
.info-item { .info-item {
display: flex; display: flex;
width: 50%; width: 50%;
color: #666666; color: #666666;
font-size: 14px; font-size: 14px;
.label { .label {
width: 150px; width: 150px;
text-align: right; text-align: right;
line-height: 19px; line-height: 19px;
} }
.value { .value {
color: #333333; color: #333333;
width: calc(100% - 150px); width: calc(100% - 150px);
...@@ -343,9 +358,11 @@ export default { ...@@ -343,9 +358,11 @@ export default {
width: 100%; width: 100%;
word-break: break-all; word-break: break-all;
} }
.order-info { .order-info {
.info-item { .info-item {
margin-bottom: 20px; margin-bottom: 20px;
.value { .value {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
...@@ -353,14 +370,18 @@ export default { ...@@ -353,14 +370,18 @@ export default {
} }
} }
} }
.task { .task {
padding-bottom: 20px; padding-bottom: 20px;
&-content { &-content {
width: 100%; width: 100%;
.label { .label {
width: 170px; width: 170px;
line-height: 19px; line-height: 19px;
} }
.value { .value {
width: calc(100% - 170px); width: calc(100% - 170px);
height: 140px; height: 140px;
...@@ -373,11 +394,13 @@ export default { ...@@ -373,11 +394,13 @@ export default {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
line-height: 20px; line-height: 20px;
p { p {
margin: 0 !important; margin: 0 !important;
} }
} }
} }
&-title { &-title {
height: 50px; height: 50px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
...@@ -387,6 +410,7 @@ export default { ...@@ -387,6 +410,7 @@ export default {
margin: 16px 0; margin: 16px 0;
} }
} }
.online-status { .online-status {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -400,11 +424,19 @@ export default { ...@@ -400,11 +424,19 @@ export default {
margin-right: 8px; margin-right: 8px;
background: #2cca74; background: #2cca74;
} }
.un { .un {
background: #eb4e4e; background: #eb4e4e;
} }
} }
.detail-info-7 {
background-color: #fff;
.info-item {
width: 100%;
}
}
} }
.footer { .footer {
padding: 14px 0; padding: 14px 0;
border-top: 1px solid #e5e5e5; border-top: 1px solid #e5e5e5;
......
...@@ -70,7 +70,8 @@ import { ...@@ -70,7 +70,8 @@ import {
STRATEGYTYPEOPTIONS, STRATEGYTYPEOPTIONS,
STRATEGY_01, STRATEGY_01,
STRATEGY_2456, STRATEGY_2456,
STRATEGY_3 STRATEGY_3,
STRATEGY_7
} from './contant' } from './contant'
import { import {
deleteStrategy deleteStrategy
...@@ -98,7 +99,8 @@ export default { ...@@ -98,7 +99,8 @@ export default {
list = [0, 1].includes(strategyType) list = [0, 1].includes(strategyType)
? STRATEGY_01 : [2, 4, 5, 6].includes(strategyType) ? ? STRATEGY_01 : [2, 4, 5, 6].includes(strategyType) ?
STRATEGY_2456 : { STRATEGY_2456 : {
3: STRATEGY_3 3: STRATEGY_3,
7: STRATEGY_7
}[strategyType] || [] }[strategyType] || []
return [ return [
...list, ...list,
......
...@@ -7,6 +7,7 @@ const STRATEGYTYPEOPTIONS = { ...@@ -7,6 +7,7 @@ const STRATEGYTYPEOPTIONS = {
4: '销售精英到店提拉', 4: '销售精英到店提拉',
5: '强力促销', 5: '强力促销',
6: '最终盘点与低客单产品购入', 6: '最终盘点与低客单产品购入',
7: '留言'
} }
const DATE_RANGE = { const DATE_RANGE = {
label: '执行周期', label: '执行周期',
...@@ -63,10 +64,18 @@ const STRATEGY_3 = [ ...@@ -63,10 +64,18 @@ const STRATEGY_3 = [
} }
}, },
] ]
const STRATEGY_7 = [
{
label: '留言人',
key: 'createdBy',
},
STAFF_FORMAT('处理人')
]
export { export {
STRATEGYTYPEOPTIONS, STRATEGYTYPEOPTIONS,
STRATEGY_01, STRATEGY_01,
STRATEGY_2456, STRATEGY_2456,
STRATEGY_3 STRATEGY_3,
STRATEGY_7,
} }
\ No newline at end of file \ No newline at end of file
...@@ -93,8 +93,9 @@ export default { ...@@ -93,8 +93,9 @@ export default {
}) })
if (data && data.list) { if (data && data.list) {
let { list } = data let { list } = data
list.map(e => { list.map(e => {
e.showDel = dayjs().diff(dayjs(e.startDate),'s') < 0 e.showDel = dayjs().diff(dayjs(e.startDate), 's') < 0
e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD') e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD')
e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>') e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!