Commit 75682f3a by 李伟康

```

feat(api): 新增策略中心相关API接口

- 新增策略详细查询学习前后指标API
- 新增策略详细查询录音记录概览API
- 新增门店分析历史兜底指标API

feat(components): d2-table组件增加选择事件支持

- 添加select和select-all事件监听
- 新增handleSelectRow和handleSelectAll方法
- 暴露选择相关的emit事件

feat(strategy): 策略中心新增多项功能特性

- 新增策略效果分析学习前后指标查询
- 添加历史兜底目标查看功能
- 优化多选表格组件交互体验
- 完善驻店员工管理功能
- 重构人员选择和删除逻辑
- 优化表单验证和加载状态显示

fix(strategy): 修复策略中心多处问题

- 修复标签删除方法参数错误
- 修复数据绑定和类型定义问题
- 修复表格选择状态同步问题
- 优化代码结构和性能表现
```
1 parent 53e2be46
Showing 24 changed files with 401 additions and 205 deletions
......@@ -623,3 +623,30 @@ export function deleteStrategy (data = {}) {
return request(data, RequestMethods.POST)
}
/**
策略中心-策略详细查询学习前后的指标
*/
export function getStrategyLearningEffectAnalysis (data = {}) {
data.method = "dj.api.strategy.monitor.findLearningEffectAnalysis"
return request(data, RequestMethods.POST)
}
/**
策略中心-策略详细-查询录音记录概览(学习前后传状态)
*/
export function getStrategyRecordStaticByCondition (data = {}) {
data.method = "dj.api.strategy.monitor.findRecordStaticByCondition"
return request(data, RequestMethods.POST)
}
/**
策略中心-门店分析-历史兜底指标
*/
export function getStrategyMerchantAnalysisIndexHistory (data = {}) {
data.method = "dj.api.strategy.merchant.analysis.index.history"
return request(data, RequestMethods.POST)
}
\ No newline at end of file
......@@ -15,6 +15,8 @@
:span-method="arraySpanMethod"
v-bind="$attrs"
v-scroll="scroll"
@select="handleSelectRow"
@select-all="handleSelectAll"
>
<el-table-column
v-if="tableParams.mutiSelectUniqueKey && tableParams.mutiSelectName"
......@@ -797,7 +799,15 @@ export default {
},
scroll(e) {
this.$emit("scroll", e)
}
},
//当用户手动勾选数据行的 Checkbox 时触发的事件 selection, row
handleSelectRow(selection, row){
this.$emit("selectRow", selection, row)
},
// 当用户手动勾选数据行的 Checkbox 时触发的事件 selection
handleSelectAll(selection){
this.$emit("selectAll", selection)
},
}
}
</script>
......
......@@ -47,6 +47,8 @@
:pagerCount="5"
@setTableFinishFun="setTableFinishFun"
@selectionTable="selectionTable"
@selectRow="selectRow"
@selectAll="selectAll"
:before-search-fn="beforeSearchFn"
>
<template #titleHtml="scope">
......@@ -217,7 +219,7 @@ export default {
searchForm: {
title: ''
},
searchFormSearch:{},
searchFormSearch: {},
tableParams: {
listName: "list",
mutiSelectUniqueKey: "courseId",
......@@ -397,9 +399,9 @@ export default {
color: #666666;
font-size: 12px;
padding: 0 11px;
i{
i {
font-size: 14px;
color: #F59619;
color: #f59619;
margin-right: 8px;
}
}
......
......@@ -50,6 +50,8 @@
:pagerCount="5"
@setTableFinishFun="setTableFinishFun"
@selectionTable="selectionTable"
@selectRow="selectRow"
@selectAll="selectAll"
:before-search-fn="beforeSearchFn"
>
</d2-table>
......@@ -169,7 +171,6 @@ export default {
params.receptionDate = dayjs(params.receptionDate).format("YYYY-MM-DD")
}
params.merchantId = merchantIds[0]
console.log(JSON.parse(JSON.stringify(params)))
return params
},
}
......
......@@ -42,6 +42,8 @@
:pagerCount="5"
@setTableFinishFun="setTableFinishFun"
@selectionTable="selectionTable"
@selectRow="selectRow"
@selectAll="selectAll"
:before-search-fn="beforeSearchFn"
>
</d2-table>
......
......@@ -66,7 +66,7 @@
<el-tag
closable
:key="ind"
@close="removeTag (i,ind,item)"
@close="removeTag (ind,item)"
>{{ i[item.tagNameKey] }}</el-tag>
</template>
</div>
......@@ -147,6 +147,7 @@
type="primary"
@click="confirm"
:size="size"
:loading="loading"
>
确定
</el-button>
......@@ -155,28 +156,28 @@
<MultipleStaff
ref="staffTagRef"
:visible="staffTagVisible"
:chooseData="staffList"
:chooseData="formData.staffList"
@dialogClose="staffTagVisible = false"
@choose="formatMultipleList($event, 'staffList')"
></MultipleStaff>
<MultipleStaff
ref="staffTagRef"
:visible="staffTag1Visible"
:chooseData="staffList_1"
:chooseData="formData.staffList_1"
@dialogClose="staffTag1Visible = false"
@choose="formatMultipleList($event, 'staffList_1')"
></MultipleStaff>
<MultipleRecording
ref="recordingTagRef"
:visible="recordingTagVisible"
:chooseData="recordingList"
:chooseData="formData.recordingList"
@dialogClose="recordingTagVisible = false"
@choose="formatMultipleList($event, 'recordingList')"
></MultipleRecording>
<MultipleCourse
ref="courseTagRef"
:visible="courseTagVisible"
:chooseData="courseList"
:chooseData="formData.courseList"
@dialogClose="courseTagVisible = false"
@choose="formatMultipleList($event, 'courseList')"
></MultipleCourse>
......@@ -256,16 +257,13 @@ export default {
recordingList: [],
pushTime: ''
},
recordingList: {},
staffList: {},
staffList_1: {},
courseList: {},
staffTagVisible: false,
staffTag1Visible: false,
courseTagVisible: false,
recordingTagVisible: false,
viewKey: Date.now(),
positionTypeList: []
positionTypeList: [],
loading: false
}
},
computed: {
......@@ -379,16 +377,10 @@ export default {
const { strategyType } = this
if (strategyType == 3) {
if (this.formData.staffList.length) {
if (!val.includes(0)) {
this.formData.staffList = []
this.staffList = {}
}
if (!val.includes(0)) this.formData.staffList = []
}
if (this.formData.staffList_1.length) {
if (!val.includes(1)) {
this.formData.staffList_1 = []
this.staffList_1 = {}
}
if (!val.includes(1)) this.formData.staffList_1 = []
}
}
},
......@@ -407,10 +399,6 @@ export default {
methods: {
init () {
this.formData = this.$options.data.call(this).formData
this.recordingList = {}
this.staffList = {}
this.staffList_1 = {}
this.courseList = {}
this.$refs?.addRef?.resetFields()
this.viewKey = Date.now()
},
......@@ -418,17 +406,9 @@ export default {
this.strategyType = null
this.$emit('update:dialogVisible', false)
},
removeTag (i, index, item) {
let { key, tagKey } = item,
list = this[key]
removeTag (index, item) {
let { key } = item
this.formData[key].splice(index, 1)
Object.keys(list).map(key => {
if (list[key]) {
let ind = list[key].findIndex(k => k[tagKey] == i[tagKey])
if (ind != -1) list[key].splice(ind, 1)
}
})
this[key] = list
},
openMultipleTag (item) {
let { componentName } = item
......@@ -447,18 +427,12 @@ export default {
return `${dayjs().add(2, 'h').format('HH:mm')}:00 - 23:59:59`
},
formatMultipleList (list, listKey) {
let _list = []
this[listKey] = list
Object.keys(list).map(key => {
if (list[key]) list[key].map(item => {
_list.push(item)
})
})
this.formData[listKey] = _list
this.formData[listKey] = list
this.$refs.addRef.validateField(listKey)
},
confirm () {
try {
this.loading = true
let { paramsInfo, formData, strategyType, merchantList, biz } = this,
{ title,
subTitle,
......@@ -524,19 +498,16 @@ export default {
}
console.log(params)
const data = await batchCreateStrategy(params)
this.loading = false
if (data) {
this.$emit('refresh')
this.$message.success('操作成功')
this.close()
} else this.$message.error('操作失败')
// if() {
// this.close()
// }
// else
//
}
})
} catch (error) {
this.loading = false
console.log(error)
}
......
......@@ -5,8 +5,8 @@ export default {
default: false
},
chooseData: {
type: Object,
default: () => { }
type: Array,
default: () => []
}
},
inject: [
......@@ -22,8 +22,6 @@ export default {
return this.visible
},
set (val) {
this.pageChooseList = {}
this.delList = []
this.chooseList = []
this.close()
}
......@@ -48,14 +46,11 @@ export default {
visible: {
handler (val) {
if (val) {
this.chooseList = []
this.delList = []
this.searchForm = this.$options.data.call(this).searchForm
let multipleTable = this.multipleTable()
if (multipleTable) multipleTable.page.currentPage = 1
this.pageChooseList = this.deepClone(this.chooseData)
this.chooseList = this.deepClone(this.chooseData)
this.viewKey = Date.now()
// if (Object.keys(this.chooseData).length) this.$nextTick(() => this.handleReset())
}
},
immediate: true,
......@@ -75,9 +70,7 @@ export default {
confirm_name: "确定",
},
searchFormSearch: {},
pageChooseList: {},
chooseList: [],
delList: []
}
},
methods: {
......@@ -95,12 +88,16 @@ export default {
this.$emit('dialogClose')
},
remove (i, index) {
this.delList.push(i)
this.chooseList.splice(index, 1)
this.multipleTable().tableRef.toggleRowSelection(i, false)
let tableData = this.multipleTable().data
tableData.map(j => {
if (i[this.targetId] === j[this.targetId]) {
this.multipleTable().tableRef.toggleRowSelection(j, false)
}
})
},
async submit () {
this.$emit('choose', this.pageChooseList)
this.$emit('choose', this.chooseList)
this.close()
},
handleReset () {
......@@ -112,48 +109,53 @@ export default {
this.multipleTable().page.currentPage = 1
this.multipleTable().refreshTable()
},
setTableFinishFun (data, listIndex) {
setTableFinishFun (data) {
this.$nextTick(() => {
let { pageChooseList, delList, targetId } = this
pageChooseList[listIndex] && pageChooseList[listIndex].map(item => {
let { chooseList, targetId } = this
chooseList.map(item => {
let index = data.findIndex(i => i[targetId] === item[targetId])
if (index > -1) this.multipleTable().tableRef.toggleRowSelection(data[index], true)
})
if (delList.length) {
data.map(item => {
let index = delList.findIndex(i => i[targetId] === item[targetId])
if (index > -1) {
this.multipleTable().tableRef.toggleRowSelection(item, false)
delList.splice(index, 1)
}
})
}
})
},
selectionTable (list, listIndex) {
selectionTable (list) {
this.$nextTick(() => {
let { targetId, chooseList } = this
if (this.formatTag) list = list.map(e => {
return this.formatTag(e)
})
this.pageChooseList[listIndex] = list
let { pageChooseList } = this,
chooseList = []
Object.keys(pageChooseList).map(key => {
if (pageChooseList[key]) {
pageChooseList[key].map(item => {
chooseList.push(item)
})
}
})
this.chooseList = chooseList
// 合并列表后基于 targetId 去重
const mergedList = [...chooseList, ...list]
this.chooseList = [...new Map(
mergedList.map(item => [item[targetId], item])
).values()]
})
},
selectRow (list, row) {
let { targetId } = this,
index = list.findIndex(i => i[targetId] === row[targetId])
if (index == -1) {
let delIndex = this.chooseList.findIndex(i => i[targetId] === row[targetId])
if (delIndex > -1) this.chooseList.splice(delIndex, 1)
}
},
selectAll (list) {
if (!list.length) {
let tableData = this.multipleTable().data,
{ targetId } = this
// 使用 Set 存储 tableData 中的所有 targetId
const tableDataIds = new Set(tableData.map(item => item[targetId]));
// 保留 chooseList 中不在 tableData 的项目
this.chooseList = this.chooseList.filter(item =>
!tableDataIds.has(item[targetId])
);
}
},
multipleTable () {
return this.$refs.multipleTable
},
clearChooseList () {
this.delList = this.chooseList
this.pageChooseList = {}
this.chooseList = []
this.multipleTable().clearMutiSelect()
}
}
......
<template>
<div class="business-overview">
<div
class="business-overview"
v-loading="loading"
>
<div class="business-overview-title">
展业概况
<div :class="['business-overview-status',{'normal':businessOverviewDetail.status == 0}]">{{ businessOverviewText }}</div>
......@@ -60,7 +63,7 @@ export default {
return {
stopBusinessVisible: false,
businessOverviewDetail: {},
loading: false
};
},
computed: {
......@@ -75,8 +78,8 @@ export default {
let nodeDate = '',
timelineList = this.businessOverviewDetail.timelineList
if (timelineList) {
lastNode = timelineList.at(-1)
if(lastNode.nodeType != 6) nodeDate = lastNode.nodeDate
let lastNode = timelineList.at(-1)
if (lastNode.nodeType != 6) nodeDate = lastNode.nodeDate
else nodeDate = timelineList.at(-2).nodeDate
}
console.log(dayjs(nodeDate).format('YYYY-MM-DD'))
......@@ -84,11 +87,12 @@ export default {
}
},
mounted () {
},
methods: {
init(){
init () {
this.loading = true
this.getStrategyMerchantTimeline()
},
openStopBusinessDialog () {
......@@ -118,6 +122,7 @@ export default {
}[item.nodeType]
})
this.businessOverviewDetail = data
this.loading = false
console.log(data, 'BusinessOverview/index.vue(查询门店展业时间线)')
}
}
......
......@@ -5,23 +5,41 @@
class="detail-content"
:config="config"
>
<div class="content">
<div class="content">
<d2-table
class="table"
ref="table"
:search-form="formSearch"
:table-params="tableParams"
:table-data="list"
:has-page="false"
:has-num="false"
>
</d2-table>
<div class="block"></div>
</div>
</basedialog>
</template>
<script>
import {
getStrategyStaffList,
getStrategyMerchantAnalysisIndexHistory,
} from "@api/earlyWarningManager"
export default {
name: "HistoryTarget",
inject: [
'GET_PARAMS_INFO',
],
props: {
visible: {
type: Boolean,
default: false
},
index: {
type: Number,
default: 0
}
},
computed: {
dialogShow: {
......@@ -32,6 +50,18 @@ export default {
this.close()
}
},
merchantId () {
let [merchantId] = this.GET_PARAMS_INFO().merchantIds
return merchantId
}
},
watch: {
visible: function (val) {
if (val) {
this.list = []
this.getList()
}
}
},
mounted () {
......@@ -49,12 +79,59 @@ export default {
width: "600px"
}
},
formSearch: {},
tableParams: {
tableColumns: [
{
label: "月份",
prop: 'recordYearMonth',
minWidth: 64,
},
{
label: "渗透率兜底目标",
minWidth: 80,
formatter: (row) => {
return row[
{
0: 'ewPenetrationRate',
1: 'ewAxbPenetrationRate',
2: 'batteryPenetrationRate',
3: 'ewLtPenetrationRate'
}[this.index]
] + '%'
}
},
{
label: "转化率兜底目标",
minWidth: 80,
formatter: (row) => {
return row[
{
0: 'ewConRate',
1: 'ewAxbConRate',
2: 'batteryConversionRate',
3: 'ewLtConRate'
}[this.index]
] + '%'
}
},
]
},
list:[]
}
},
methods: {
close () {
this.$emit('dialogClose')
},
async getList () {
const { merchantId } = this,
data = await getStrategyMerchantAnalysisIndexHistory({
bizs: 1,
merchantId
})
this.list = data
}
}
}
</script>
......@@ -87,10 +164,13 @@ export default {
}
.detail-content {
.content {
display: flex;
height: 592px;
box-sizing: border-box;
padding: 20px;
overflow-y: auto;
.table {
width: 100%;
}
}
}
</style>
......@@ -11,7 +11,7 @@
v-if="hasEHi"
type="text"
class="target"
@click="handleTargetConfig(item)"
@click="handleTargetConfig(index)"
>历史兜底目标</el-button>
</div>
<div class="content">
......@@ -36,6 +36,7 @@
</template>
<HistoryTarget
:visible.sync="historyTargetVisible"
:index="historyTargetIndex"
@dialogClose="historyTargetVisible = false"
/>
</div>
......@@ -143,16 +144,21 @@ export default {
default () {
return {}
}
},
isHarmony: {
type: Boolean,
default: false
}
},
data () {
return {
historyTargetIndex: 0,
historyTargetVisible: false
}
},
computed: {
overviewList () {
let { hasEHi } = this,
let { hasEHi, isHarmony } = this,
list = this.deepClone(overviewList)
if (hasEHi) list.map((e, index) => {
e.list.push({
......@@ -163,7 +169,7 @@ export default {
2: 'batteryWarrantyEcoCoefficient',
3: 'tireWarrantyEcoCoefficient',
}[index],
hide: !this.GET_HARMONY()
hide: !isHarmony
})
})
return list
......@@ -172,7 +178,8 @@ export default {
mounted () {
},
methods: {
handleTargetConfig (i) {
handleTargetConfig (index) {
this.historyTargetIndex = index
this.historyTargetVisible = true
}
}
......
......@@ -6,7 +6,7 @@
>
<div
class="btn flex"
@click="leftScroll"
@click="scrollTo(-400)"
>
<i class="el-icon-arrow-left"></i>
</div>
......@@ -17,7 +17,7 @@
>
<div
class="btn flex"
@click="rightScroll"
@click="scrollTo(400)"
>
<i class="el-icon-arrow-left"></i>
</div>
......@@ -73,17 +73,10 @@ export default {
handleScroll () {
this.checkScrollPosition();
},
leftScroll () {
scrollTo (x) {
const scrollbar = this.$refs.timelineScrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.scrollBy({ left: -400, behavior: 'smooth' });
}
this.$nextTick(this.checkScrollPosition);
},
rightScroll () {
const scrollbar = this.$refs.timelineScrollbar;
if (scrollbar && scrollbar.wrap) {
scrollbar.wrap.scrollBy({ left: 400, behavior: 'smooth' });
scrollbar.wrap.scrollBy({ left: x, behavior: 'smooth' });
}
this.$nextTick(this.checkScrollPosition);
}
......@@ -153,7 +146,7 @@ export default {
}
.timeline-scrollbar {
width: 100%;
::v-deep .el-scrollbar__wrap{
::v-deep .el-scrollbar__wrap {
// overflow:auto hidden !important;
// margin-bottom: 0 !important;
}
......
......@@ -4,6 +4,7 @@
:dialog-config="dialogConfig.config"
class="detail-content"
@handleClick="submit"
:btnLoding="btnLoding"
>
<el-form
ref="form"
......@@ -21,7 +22,7 @@
v-model="formData.staffName"
class="input-width"
placeholder="请输入人员姓名"
maxlength="20"
maxlength="15"
></el-input>
</el-form-item>
<el-form-item
......@@ -97,6 +98,7 @@ export default {
width: "640px"
}
},
btnLoding: false
}
},
methods: {
......@@ -106,6 +108,7 @@ export default {
this.$emit('dialogClose')
},
submit () {
this.btnLoding = true
this.$refs.form.validate(async (valid) => {
if (valid) {
const { merchantIds } = this.paramsInfo,
......@@ -116,8 +119,8 @@ export default {
staffPhone,
merchantId: merchantIds[0],
})
this.btnLoding = false
if (data) {
this.$emit('refresh')
this.$message.success('操作成功')
this.close()
} else this.$message.error('操作失败')
......
......@@ -35,7 +35,7 @@
禁用
<div
class="disabled-btn flex"
@click.stop="disabledStaff(item)"
@click.stop="disabledStaff(i)"
>
</div>
</div>
......
......@@ -9,7 +9,10 @@
@click="historyVisible = true"
>历史人员记录</el-button>
</div>
<div class="staff-box flex">
<div
class="staff-box flex"
v-loading="staffTimeLoading"
>
<template v-if="staffTimelineIList.length">
<scroll-x-view>
<div class="timeline">
......@@ -17,7 +20,8 @@
:class="['timeline-item flex',{'active-item':index == currentIndex}]"
v-for="(item, index) in staffTimelineIList"
:key="index"
@click="changeStaff(item)"
@click="changeStaff(index)"
:ref="`staffItemRef${index}`"
>
<img
src="@/assets/strategy/default-avatar.png"
......@@ -62,7 +66,10 @@
新增驻店员工
</div>
</div>
<div class="staff-info flex">
<div
class="staff-info flex"
v-loading="staffInfoLoading"
>
<template v-for="(item,index) in formList">
<div
class="staff-info-item flex"
......@@ -81,7 +88,10 @@
</template>
</div>
<div class="staff-overview-content">
<div class="staff-overview-item left">
<div
class="staff-overview-item left"
v-loading="staffLeftLoading"
>
<div class="content">
<img
:src="`${IMG_URL}staff.webp`"
......@@ -113,10 +123,7 @@
</div>
</template>
</div>
<div
class="summary-box"
:key="viewKey"
>
<div class="summary-box">
<!-- <div class="help flex">
帮助
<img
......@@ -162,7 +169,10 @@
/>
</template>
</div>
<div class="staff-overview-item right">
<div
class="staff-overview-item right"
v-loading="staffRightLoading"
>
<div class="content">
<over-view-list :viewData="viewData"></over-view-list>
</div>
......@@ -181,7 +191,6 @@
<add-staff
:visible.sync="addStaffVisible"
@dialogClose="addStaffVisible = false"
@refresh="getStrategyStaffListAnalysis"
></add-staff>
</div>
</template>
......@@ -234,7 +243,7 @@ export default {
},
],
staffTimelineIList: [],
currentIndex: 0,
currentIndex: -1,
leftWarningInfoList: [],
rightWarningInfoList: [],
historyVisible: false,
......@@ -319,7 +328,10 @@ export default {
],
viewData: {},
summaryInfo: {},
viewKey: Date.now()
staffTimeLoading: true,
staffInfoLoading: true,
staffLeftLoading: true,
staffRightLoading: true,
}
},
computed: {
......@@ -331,6 +343,7 @@ export default {
},
methods: {
init () {
this.currentIndex = -1
this.getStrategyStaffListAnalysis()
},
disabledStaff (item) {
......@@ -353,44 +366,66 @@ export default {
})
},
async getStrategyStaffListAnalysis (refresh = true) {
let params = this.paramsInfo,
data = await getStrategyStaffListAnalysis(params)
this.staffTimelineIList = data
if (data && data.length && refresh) {
let [item] = data
this.changeStaff(item)
try {
this.staffTimeLoading = true
let params = this.paramsInfo,
data = await getStrategyStaffListAnalysis(params)
this.staffTimelineIList = data
this.staffTimeLoading = false
if (data && data.length && refresh) this.$nextTick(() => this.changeStaff())
} catch (error) {
this.staffTimeLoading = false
}
console.log(data, 'StaffOverview/index.vue(查询驻店员工列表)')
},
changeStaff (item) {
let { staffTimelineIList } = this
this.currentIndex = staffTimelineIList.findIndex(e => e.staffId == item.staffId)
changeStaff (index = 0) {
if (index == this.currentIndex) return
let [item] = this.staffTimelineIList,
ref = this.$refs[`staffItemRef${index}`]
console.log(ref ,'===========')
if(ref && ref[0]) {
}
this.currentIndex = index
this.setStaffWarningInfo(item)
this.getStrategyStaffSummaryDuration(item)
this.getStrategyMerchantAnalysisEmployeeSummary(item)
this.getStrategyMerchantAnalysisGoodsSummaryWithWarn(item)
},
async getStrategyMerchantAnalysisGoodsSummaryWithWarn (item) {
const params = this.paramsInfo,
summaryGoodsData = await getStrategyMerchantAnalysisGoodsSummaryWithWarn({
...params,
staffUuids: [item.staffId]
})
this.viewData = summaryGoodsData || {}
console.log(summaryGoodsData, 'SummaryOverview/index.vue(查询门店商品销售情况)')
try {
this.staffRightLoading = true
const params = this.paramsInfo,
summaryGoodsData = await getStrategyMerchantAnalysisGoodsSummaryWithWarn({
...params,
staffUuids: [item.staffId]
})
this.viewData = summaryGoodsData || {}
this.staffRightLoading = false
console.log(summaryGoodsData, 'SummaryOverview/index.vue(查询门店商品销售情况)')
} catch (error) {
this.staffRightLoading = false
}
},
async getStrategyMerchantAnalysisEmployeeSummary (item) {
let params = this.paramsInfo,
data = await getStrategyMerchantAnalysisEmployeeSummary({
...params,
staffUuids: [item.staffId],
staffPhone: item.staffPhone
})
this.summaryInfo = data
console.log(data, 'StaffOverview/index.vue(查询门店员工分析)')
try {
this.staffLeftLoading = true
let params = this.paramsInfo,
data = await getStrategyMerchantAnalysisEmployeeSummary({
...params,
staffUuids: [item.staffId],
staffPhone: item.staffPhone
})
this.summaryInfo = data
this.staffLeftLoading = false
console.log(data, 'StaffOverview/index.vue(查询门店员工分析)')
} catch (error) {
this.staffLeftLoading = false
}
},
async getStrategyStaffSummaryDuration (item) {
try {
this.staffInfoLoading = true
let params = this.paramsInfo,
data = await getStrategyStaffSummaryDuration({
...params,
......@@ -398,8 +433,10 @@ export default {
staffPhone: item.staffPhone
})
this.staffDurationInfo = data
this.staffInfoLoading = false
console.log(data, 'StaffOverview/index.vue(查询驻店员工驻店时长)')
} catch (error) {
this.staffInfoLoading = false
console.log(error)
}
},
......
......@@ -168,10 +168,12 @@ export default {
if (data.carBrandResponses && data.carBrandResponses.length) {
let carBrandText = []
data.carBrandResponses.map(e => {
if (e.children && e.children.length) e.children.map(i => {
carBrandText.push(`${e.label}-${i.label}`)
})
else carBrandText.push(e.label)
if (e) {
if (e.children && e.children.length) e.children.map(i => {
carBrandText.push(`${e.label}-${i.label}`)
})
else carBrandText.push(e.label)
}
})
data.carBrandText = carBrandText.join('/')
}
......
......@@ -25,7 +25,9 @@ const CREATED = {
}
const CREATED_DATE = {
label: '操作时间',
key: 'createdDate',
format: (val) => {
return dayjs(val.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
}
const STRATEGY_FORM_01 = [
TITLE,
......
......@@ -13,6 +13,7 @@
<div
class="strategy-drawer-content"
:key="viewKey"
v-loading="loading"
>
<div class="content">
<!-- <el-scrollbar class="content"> -->
......@@ -25,8 +26,13 @@
>
<div class="label">{{ item.label }}:</div>
<div class="value">
<template v-if="item.format">{{ item.format(detailInfo) }}</template>
<template v-else>{{ detailInfo[item.key] || '-' }}</template>
<template v-if="item.html">
<div v-html="detailInfo[item.key]"></div>
</template>
<template v-else>
<template v-if="item.format">{{ item.format(detailInfo) }}</template>
<template v-else>{{ detailInfo[item.key] || '-' }}</template>
</template>
</div>
</div>
</template>
......@@ -171,6 +177,7 @@ export default {
},
]
},
loading: false
}
},
computed: {
......@@ -200,7 +207,8 @@ export default {
{
label: '策略说明',
class: 'bespread',
key: 'description'
key: 'descriptionText',
html: true
}
]
},
......@@ -241,6 +249,7 @@ export default {
},
methods: {
init () {
this.loading = true
const { strategyType, id } = this.item,
targetName = [0, 1].includes(strategyType) ? 'queryStrategyStudyDetailById' : 'queryStrategyTaskDetailById'
this[targetName](id)
......@@ -250,15 +259,18 @@ export default {
const data = await queryStrategyStudyDetailById({
id
})
this.detailInfo = data
console.log(data, 'data')
this.setData(data)
},
async queryStrategyTaskDetailById (strategyId) {
const data = await queryStrategyTaskDetailById({
strategyId
})
this.setData(data)
},
setData (data) {
data.descriptionText = data.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
this.detailInfo = data
console.log(data, 'data')
this.loading = false
},
close () {
this.$emit('update:dialogVisible', false)
......
......@@ -9,7 +9,11 @@
> <i class="el-icon-plus"></i>添加策略</el-button>
</div>
</div>
<el-scrollbar class="strategy-list">
<el-scrollbar
class="strategy-list"
:key="viewKey"
v-loading="loading"
>
<template v-for="(i,index) in list">
<strategy-item
:key="index"
......@@ -22,7 +26,10 @@
></strategy-item>
</template>
</el-scrollbar>
<add-strategy :dialogVisible.sync="addStrategyVisible" @refresh="getStrategyList"></add-strategy>
<add-strategy
:dialogVisible.sync="addStrategyVisible"
@refresh="getStrategyList"
></add-strategy>
<strategy-detail
:dialogVisible.sync="strategyDetailVisible"
:item="currentItem"
......@@ -52,7 +59,9 @@ export default {
list: [],
addStrategyVisible: false,
strategyDetailVisible: false,
currentItem: {}
currentItem: {},
viewKey: Date.now(),
loading: false
}
},
computed: {
......@@ -62,10 +71,10 @@ export default {
},
mounted () {
},
methods: {
init(){
init () {
this.getStrategyList()
},
toDetail (item) {
......@@ -73,20 +82,27 @@ export default {
this.strategyDetailVisible = true
},
async getStrategyList () {
let { merchantIds } = this.paramsInfo,
data = await getStrategyList({
merchantId: merchantIds[0],
biz: 1,
pageNum: 1,
pageSize: 999999
})
if (data && data.list) {
let {list} = data
list.map(e =>{
e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD')
e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
})
this.list = list
try {
this.loading = true
let { merchantIds } = this.paramsInfo,
data = await getStrategyList({
merchantId: merchantIds[0],
biz: 1,
pageNum: 1,
pageSize: 999999
})
if (data && data.list) {
let { list } = data
list.map(e => {
e.createdDateText = dayjs(e.createdDate).format('YYYY-MM-DD')
e.descriptionText = e.description.replace(/<\/?br\s*\/?>|\\n|\n/g, '<br>')
})
this.list = list
this.loading = false
this.viewKey = Date.now()
}
} catch (error) {
this.loading = false
}
console.log(data, 'StrategyList/index.vue 策略列表')
......
......@@ -5,7 +5,10 @@
</div>
<div class="summary-overview-content">
<div class="summary-overview-item left">
<div class="content">
<div
class="content"
v-loading="summaryLeftLoading"
>
<img
:src="`${IMG_URL}summary.webp`"
class="bg"
......@@ -27,7 +30,7 @@
环比{{ formatMom(summaryInfo[i.percentKey])}}
<template v-if="formatIsRatio(summaryInfo[i.percentKey])">
<img
:class="['arrow',{just:formatIsRatio(summaryInfo[i.percentKey]) === 'just01'}]"
class="arrow"
:src="getIconSrc(formatIsRatio(summaryInfo[i.percentKey]))"
/>
</template>
......@@ -52,7 +55,7 @@
环比{{ formatMom(summaryInfo.penetrationRateMom) }}
<template v-if="formatIsRatio(summaryInfo.penetrationRateMom)">
<img
:class="['arrow',{just:formatIsRatio(summaryInfo.penetrationRateMom) === 'just01'}]"
class="arrow"
:src="getIconSrc(formatIsRatio(summaryInfo.penetrationRateMom))"
/>
</template>
......@@ -77,7 +80,7 @@
环比{{ formatMom(summaryInfo[j.percentKey]) }}
<template v-if="formatIsRatio(summaryInfo[j.percentKey])">
<img
:class="['arrow',{just:formatIsRatio(summaryInfo[j.percentKey]) === 'just01'}]"
class="arrow"
:src="getIconSrc(formatIsRatio(summaryInfo[j.percentKey]))"
/>
</template>
......@@ -97,7 +100,10 @@
</template>
</div>
<div class="summary-overview-item right">
<div class="content">
<div
class="content"
v-loading="summaryRightLoading"
>
<over-view-list
hasEHi
:viewData="viewData"
......@@ -239,7 +245,9 @@ export default {
},
],
viewData: {},
isHarmony: false
isHarmony: false,
summaryLeftLoading: true,
summaryRightLoading: true
}
},
computed: {
......@@ -257,18 +265,34 @@ export default {
this.isHarmony = data
},
init () {
this.getStrategyBusinessAnalysisStoreSpecialBrand()
this.getStrategyMerchantAnalysisStoreDetailSummary()
this.getStrategyMerchantAnalysisGoodsSummaryWithWarn()
this.getStrategyMerchantListWarningInfo()
this.getStrategyBusinessAnalysisStoreSpecialBrand()
},
async getStrategyMerchantAnalysisStoreDetailSummary () {
let params = this.paramsInfo,
data = await getStrategyMerchantAnalysisStoreDetailSummary(params)
this.summaryInfo = data
console.log(data, 'SummaryOverview/index.vue(查询门店经营概况)')
const summaryGoodsData = await getStrategyMerchantAnalysisGoodsSummaryWithWarn(params)
this.viewData = summaryGoodsData || {}
console.log(summaryGoodsData, 'SummaryOverview/index.vue(查询门店商品销售情况)')
try {
this.summaryLeftLoading = true
let params = this.paramsInfo,
data = await getStrategyMerchantAnalysisStoreDetailSummary(params)
this.summaryInfo = data
this.summaryLeftLoading = false
console.log(data, 'SummaryOverview/index.vue(查询门店经营概况)')
} catch (error) {
this.summaryLeftLoading = false
}
},
async getStrategyMerchantAnalysisGoodsSummaryWithWarn () {
try {
this.summaryRightLoading = true
const params = this.paramsInfo,
summaryGoodsData = await getStrategyMerchantAnalysisGoodsSummaryWithWarn(params)
this.viewData = summaryGoodsData || {}
this.summaryRightLoading = false
console.log(summaryGoodsData, 'SummaryOverview/index.vue(查询门店商品销售情况)')
} catch (error) {
this.summaryRightLoading = false
}
},
async getStrategyMerchantListWarningInfo () {
let params = this.paramsInfo,
......
......@@ -121,11 +121,11 @@ export default {
if (merchantNo) {
console.log('接收到的 merchantNo:', merchantNo);
// 可以根据 merchantNo 更新 merchantInfo 或进行其他操作
// this.paramsInfo.merchantIds = [merchantNo]
// this.$nextTick(() => this.init())
this.paramsInfo.merchantIds = [merchantNo]
this.$nextTick(() => this.init())
}
this.paramsInfo.merchantIds = [44210895 || 44211227 || merchantNo]
this.$nextTick(() => this.init())
// this.paramsInfo.merchantIds = [ 44211227 || 44210895 || merchantNo]
// this.$nextTick(() => this.init())
history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.preventBack)
},
......@@ -171,10 +171,10 @@ export default {
console.log(this.paramsInfo)
this.paramsInfo = {
...this.paramsInfo,
// ...e
cycleType: 3,
startTime: '2001-01-01',
endTime: '2026-01-01'
...e
// cycleType: 3,
// startTime: '2025-01-01',
// endTime: '2026-01-01'
}
this.requireInterface()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!