Commit d34f6dee by 李伟康

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

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