Commit 48b9f0a7 by 李伟康

```

feat(api): 新增删除策略API接口

新增deleteStrategy函数用于删除策略功能
```
1 parent 8a26797e
...@@ -612,4 +612,14 @@ export function getStrategyMerchantListWarningInfo (data = {}) { ...@@ -612,4 +612,14 @@ export function getStrategyMerchantListWarningInfo (data = {}) {
export function getStrategyMerchantDetail (data = {}) { export function getStrategyMerchantDetail (data = {}) {
data.method = "dj.api.strategy.find.merchant.detail" data.method = "dj.api.strategy.find.merchant.detail"
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
}
\ No newline at end of file \ No newline at end of file
}
/**
删除策略
*/
export function deleteStrategy (data = {}) {
data.method = "dj.api.strategy.info.delete"
return request(data, RequestMethods.POST)
}
...@@ -488,7 +488,11 @@ export default { ...@@ -488,7 +488,11 @@ export default {
courseList, courseList,
} }
if (merchantList.length) params.merchantList = merchantList if (merchantList.length) params.merchantList = merchantList
else params.merchantList = paramsInfo.merchantIds else params.merchantList = [
{
merchantId: paramsInfo.merchantIds[0]
}
]
if (dateRange.length) { if (dateRange.length) {
let [startDate, endDate] = dateRange let [startDate, endDate] = dateRange
params.strategyInfo.startDate = dayjs(startDate).format('YYYY-MM-DD') + ' 00:00:00' params.strategyInfo.startDate = dayjs(startDate).format('YYYY-MM-DD') + ' 00:00:00'
......
...@@ -74,7 +74,11 @@ export default { ...@@ -74,7 +74,11 @@ export default {
minDate () { minDate () {
let nodeDate = '', let nodeDate = '',
timelineList = this.businessOverviewDetail.timelineList timelineList = this.businessOverviewDetail.timelineList
if (timelineList) nodeDate = timelineList.at(-1).nodeDate if (timelineList) {
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')) console.log(dayjs(nodeDate).format('YYYY-MM-DD'))
return dayjs(nodeDate).format('YYYY-MM-DD') return dayjs(nodeDate).format('YYYY-MM-DD')
} }
......
<template> <template>
<div :class="['warning-item flex',`bg-${type}`]"> <div :class="['warning-item flex',`bg-${item.type || 1}`]">
<img <img
:src="icon" :src="icon"
class="warning-icon" class="warning-icon"
> >
生态系数预警:整车延保生态系数低于1.0 <div class="warning-text text-hide">{{ item.text }}</div>
</div> </div>
</template> </template>
...@@ -19,9 +19,9 @@ const type_1 = require('@/assets/strategy/icon-strategy-type01.png'), ...@@ -19,9 +19,9 @@ const type_1 = require('@/assets/strategy/icon-strategy-type01.png'),
export default { export default {
name: 'EarlyWarningTips', name: 'EarlyWarningTips',
props: { props: {
type: { item: {
type: Number, type: Object,
default: 1 default: () => ({})
} }
}, },
computed: { computed: {
...@@ -33,7 +33,7 @@ export default { ...@@ -33,7 +33,7 @@ export default {
4: type_4, 4: type_4,
5: type_5, 5: type_5,
6: type_6 6: type_6
}[this.type] }[this.item.type] || ''
} }
}, },
data () { data () {
...@@ -62,10 +62,20 @@ export default { ...@@ -62,10 +62,20 @@ export default {
background: #2c66f714; background: #2c66f714;
box-sizing: border-box; box-sizing: border-box;
padding: 0 8px; padding: 0 8px;
word-break: break-all;
.warning-icon { .warning-icon {
width: 18px; width: 18px;
height: 18px; height: 18px;
margin-right: 6px; margin-right: 6px;
} }
.warning-text {
width: calc(100% - 24px);
}
}
.bg-1 {
background: #f2472414;
}
.bg-2 {
background: #ff9d0a14;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
:is-show.sync="dialogShow" :is-show.sync="dialogShow"
:dialog-config="dialogConfig.config" :dialog-config="dialogConfig.config"
class="detail-content" class="detail-content"
@handleClick="submit"
:config="config" :config="config"
> >
<div class="content"> <div class="content">
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
<div class="title flex"> <div class="title flex">
{{ item.title }} {{ item.title }}
<el-button <el-button
v-if="hasEHi"
type="text" type="text"
class="target" class="target"
@click="handleTargetConfig(item)" @click="handleTargetConfig(item)"
...@@ -21,10 +22,13 @@ ...@@ -21,10 +22,13 @@
:style="{width: `calc(100% / ${item.list.length})`}" :style="{width: `calc(100% / ${item.list.length})`}"
> >
<div class="label">{{ i.label }}</div> <div class="label">{{ i.label }}</div>
<div class="value">{{ viewData[i.key] == null ?'-' : viewData[i.key]}}</div> <div class="value">
<template v-if="i.subKey"> <template v-if="viewData[i.key] == null || i.hide">-</template>
<div class="sub-value">兜底目标{{ viewData[i.subKey] }}</div> <template v-else>
</template> {{ viewData[i.key] }}<template v-if="i.unit">{{ i.unit }}</template>
</template>
</div>
<div :class="['sub-value',{show:i.subKey && viewData[i.subKey] != null}]">兜底目标{{ viewData[i.subKey] }}%</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -50,12 +54,14 @@ const overviewList = [ ...@@ -50,12 +54,14 @@ const overviewList = [
{ {
label: '渗透率', label: '渗透率',
key: 'vehicleWarrantyPenetrationRate', key: 'vehicleWarrantyPenetrationRate',
subKey: 'vehicleWarrantyPenetrationBottomTarget' subKey: 'vehicleWarrantyPenetrationBottomTarget',
unit: '%'
}, },
{ {
label: '转化率', label: '转化率',
key: 'vehicleWarrantyConversionRate', key: 'vehicleWarrantyConversionRate',
subKey: 'vehicleWarrantyConversionBottomTarget' subKey: 'vehicleWarrantyConversionBottomTarget',
unit: '%'
} }
] ]
}, },
...@@ -69,12 +75,14 @@ const overviewList = [ ...@@ -69,12 +75,14 @@ const overviewList = [
{ {
label: '渗透率', label: '渗透率',
key: 'safetyPackagePenetrationRate', key: 'safetyPackagePenetrationRate',
subKey: 'safetyPackagePenetrationBottomTarget' subKey: 'safetyPackagePenetrationBottomTarget',
unit: '%'
}, },
{ {
label: '转化率', label: '转化率',
key: 'safetyPackageConversionRate', key: 'safetyPackageConversionRate',
subKey: 'safetyPackageConversionBottomTarget' subKey: 'safetyPackageConversionBottomTarget',
unit: '%'
} }
], ],
}, },
...@@ -88,12 +96,14 @@ const overviewList = [ ...@@ -88,12 +96,14 @@ const overviewList = [
{ {
label: '渗透率', label: '渗透率',
key: 'batteryWarrantyPenetrationRate', key: 'batteryWarrantyPenetrationRate',
subKey: 'batteryWarrantyPenetrationBottomTarget' subKey: 'batteryWarrantyPenetrationBottomTarget',
unit: '%'
}, },
{ {
label: '转化率', label: '转化率',
key: 'batteryWarrantyConversionRate', key: 'batteryWarrantyConversionRate',
subKey: 'batteryWarrantyConversionBottomTarget' subKey: 'batteryWarrantyConversionBottomTarget',
unit: '%'
} }
], ],
}, },
...@@ -107,12 +117,14 @@ const overviewList = [ ...@@ -107,12 +117,14 @@ const overviewList = [
{ {
label: '渗透率', label: '渗透率',
key: 'tireWarrantyPenetrationRate', key: 'tireWarrantyPenetrationRate',
subKey: 'tireWarrantyPenetrationBottomTarget' subKey: 'tireWarrantyPenetrationBottomTarget',
unit: '%'
}, },
{ {
label: '转化率', label: '转化率',
key: 'tireWarrantyConversionRate', key: 'tireWarrantyConversionRate',
subKey: 'tireWarrantyConversionBottomTarget' subKey: 'tireWarrantyConversionBottomTarget',
unit: '%'
} }
], ],
} }
...@@ -120,7 +132,7 @@ const overviewList = [ ...@@ -120,7 +132,7 @@ const overviewList = [
export default { export default {
name: 'OverViewList', name: 'OverViewList',
components: { HistoryTarget }, components: { HistoryTarget },
inject: ['deepClone'], inject: ['deepClone', 'GET_HARMONY'],
props: { props: {
hasEHi: { hasEHi: {
type: Boolean, type: Boolean,
...@@ -142,20 +154,20 @@ export default { ...@@ -142,20 +154,20 @@ export default {
overviewList () { overviewList () {
let { hasEHi } = this, let { hasEHi } = this,
list = this.deepClone(overviewList) list = this.deepClone(overviewList)
if (hasEHi) list.map((e,index) => { if (hasEHi) list.map((e, index) => {
e.list.push({ e.list.push({
label: '生态系数', label: '生态系数',
key: { key: {
0: 'vehicleWarrantyEcoCoefficient', 0: 'vehicleWarrantyEcoCoefficient',
1: 'safetyPackageEcoCoefficient', 1: 'safetyPackageEcoCoefficient',
2: 'batteryWarrantyEcoCoefficient', 2: 'batteryWarrantyEcoCoefficient',
3: 'tireWarrantyEcoCoefficient' 3: 'tireWarrantyEcoCoefficient',
}[index] }[index],
hide: !this.GET_HARMONY()
}) })
}) })
return list return list
},
}
}, },
mounted () { mounted () {
}, },
...@@ -205,6 +217,10 @@ export default { ...@@ -205,6 +217,10 @@ export default {
font-size: 13px; font-size: 13px;
margin-top: 4px; margin-top: 4px;
line-height: 15px; line-height: 15px;
opacity: 0;
}
.show {
opacity: 1;
} }
} }
} }
......
...@@ -5,14 +5,55 @@ ...@@ -5,14 +5,55 @@
class="detail-content" class="detail-content"
:config="config" :config="config"
> >
<el-scrollbar class="content"> <div class="content">
<template v-for="(item,index) in list">
<div
class="list-box"
:key="index"
>
<div :class="['line',{'first-line':index == 0},{'last-line':index == list.length - 1}]">
<div class="icon"></div>
</div>
<div class="title">{{ item.yearMonth }}</div>
<div class="staff-list flex">
<template v-for="(i,ind) in item.staffList">
<div
class="staff-item flex"
:key="ind"
>
<div class="staff-icon">
<img src="@/assets/strategy/default-avatar.png">
<template v-if="i.temporarySupport">
<div class="temporary-support flex">临时支援</div>
</template>
</div>
</el-scrollbar> <div class="staff-info">
<div class="name text-hide">{{ i.staffName }}</div>
<template v-if="i.deletedFlag == 'N'">
<div class="deleted flex">
禁用
<div
class="disabled-btn flex"
@click.stop="disabledStaff(item)"
>
</div>
</div>
</template>
</div>
</div>
</template>
</div>
</div>
</template>
</div>
</basedialog> </basedialog>
</template> </template>
<script> <script>
import { import {
disableStrategyStaff,
getStrategyMerchantAnalysisEmployeeHistory, getStrategyMerchantAnalysisEmployeeHistory,
} from "@api/earlyWarningManager" } from "@api/earlyWarningManager"
...@@ -64,6 +105,7 @@ export default { ...@@ -64,6 +105,7 @@ export default {
width: "600px" width: "600px"
} }
}, },
list: []
} }
}, },
methods: { methods: {
...@@ -76,9 +118,26 @@ export default { ...@@ -76,9 +118,26 @@ export default {
bizs: 1, bizs: 1,
merchantId: merchantIds[0] merchantId: merchantIds[0]
}) })
console.log(data) this.list = data
},
} disabledStaff (item) {
this.$confirm("对员工进行禁用操作后,对应的账户无法再使用;历史已产生的业务数据不受影响。", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
}).then(async () => {
const data = await disableStrategyStaff({
staffUuid: item.staffUUid
})
if (data) {
this.getStrategyMerchantAnalysisEmployeeHistory()
this.$message.success('操作成功')
this.close()
} else this.$message.error('操作失败')
}).catch(() => {
})
},
} }
} }
</script> </script>
...@@ -111,10 +170,142 @@ export default { ...@@ -111,10 +170,142 @@ export default {
} }
.detail-content { .detail-content {
.content { .content {
display: flex; width: 100%;
height: 558px; height: 558px;
box-sizing: border-box; box-sizing: border-box;
padding: 20px; padding: 16px 20px 0 0;
overflow-y: auto;
.line {
position: absolute;
top: 4px;
left: 20px;
width: 16px;
height: calc(100% - 4px);
&::after {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
content: "";
width: 1.5px;
height: 100%;
background: #d4deef;
}
.icon {
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
width: 10px;
height: 10px;
background: #2a58ad;
border-radius: 100%;
z-index: 2;
}
}
.first-line {
.icon {
width: 16px;
height: 16px;
background: #2a58ad33;
&::after {
width: 10px;
height: 10px;
border: 2px solid #2a58ad;
background: #ffffff;
border-radius: 100%;
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
}
}
&::after {
top: 16px;
height: calc(100% - 16px);
}
}
.last-line {
&::after {
display: none;
}
}
.list-box {
position: relative;
width: 100%;
box-sizing: border-box;
padding-left: 50px;
.title {
color: #333333;
font-size: 16px;
font-weight: 500;
line-height: 22px;
margin-bottom: 8px;
}
.staff-list {
width: 100%;
flex-wrap: wrap;
gap: 14px 0;
padding-bottom: 16px;
.staff-item {
width: 25%;
.staff-icon {
position: relative;
width: 48px;
height: 48px;
margin-right: 8px;
border-radius: 8px;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
.temporary-support {
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 15px;
background: #000000b3;
color: #ffffff;
font-size: 9px;
font-weight: 500;
justify-content: center;
}
}
.staff-info {
width: calc(100% - 56px);
font-size: 14px;
line-height: 17px;
.name {
margin-bottom: 6px;
color: #333333;
}
.deleted {
color: #2a58ad;
cursor: pointer;
}
.disabled-btn {
width: 14px;
height: 14px;
background: #2a58ad33;
border-radius: 50%;
margin-left: 5px;
justify-content: center;
&::after {
content: "";
width: 7.7px;
height: 2.1px;
background: #2a58ad;
display: block;
}
}
}
}
}
}
} }
} }
</style> </style>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
> >
</div> </div>
<div class="info "> <div class="info ">
<div class="name text-hide">{{merchantDetailInfo.merchantName}}</div> <div class="name text-hide">{{merchantDetailInfo.merchantName||'-'}}</div>
<div class="control flex"> <div class="control flex">
<div class="scene flex"> <div class="scene flex">
<img <img
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</div> </div>
</template> </template>
<div class="btn-list flex"> <div class="btn-list flex">
<template v-if="item.status == 0 || index == 0"> <template v-if="item.pushFlag != 1">
<el-button <el-button
:size="size" :size="size"
class="btn-default" class="btn-default"
...@@ -72,6 +72,9 @@ import { ...@@ -72,6 +72,9 @@ import {
STRATEGY_2456, STRATEGY_2456,
STRATEGY_3 STRATEGY_3
} from './contant' } from './contant'
import {
deleteStrategy
} from '@/api/earlyWarningManager'
export default { export default {
name: 'StrategyItem', name: 'StrategyItem',
props: { props: {
...@@ -123,7 +126,14 @@ export default { ...@@ -123,7 +126,14 @@ export default {
type: "warning", type: "warning",
closeOnClickModal: false closeOnClickModal: false
}).then(async () => { }).then(async () => {
this.$emit('refresh') const data = await deleteStrategy({
id: item.id
})
if (data) {
this.$emit('refresh')
this.$message.success('操作成功')
this.close()
} else this.$message.error('操作失败')
}).catch(() => { }).catch(() => {
}) })
} }
......
...@@ -18,26 +18,45 @@ ...@@ -18,26 +18,45 @@
:style="{width: i.width}" :style="{width: i.width}"
> >
<div class="label">{{ i.label }}</div> <div class="label">{{ i.label }}</div>
<div class="value">{{ summaryInfo[i.key]}}</div> <div class="value">
<template v-if="i.isRate">{{formatMom( summaryInfo[i.key])}}</template>
<template v-else>{{ formatNumber(summaryInfo[i.key])}}</template>
</div>
<template v-if="i.percentKey"> <template v-if="i.percentKey">
<div class="sub-value">{{ summaryInfo[i.percentKey] }}</div> <div class="sub-value flex">
环比{{ formatMom(summaryInfo[i.percentKey])}}
<template v-if="formatIsRatio(summaryInfo[i.percentKey])">
<img
:class="['arrow',{just:formatIsRatio(summaryInfo[i.percentKey]) === 'just01'}]"
:src="getIconSrc(formatIsRatio(summaryInfo[i.percentKey]))"
/>
</template>
</div>
</template> </template>
</div> </div>
</template> </template>
</div> </div>
<div class="summary-box"> <div class="summary-box">
<div class="help flex"> <!-- <div class="help flex">
帮助 帮助
<img <img
src="@/assets/strategy/data-info.png" src="@/assets/strategy/data-info.png"
class="help-icon" class="help-icon"
> >
</div> </div> -->
<div class="summary-item flex fixed-summary"> <div class="summary-item flex fixed-summary">
<div class="label flex"> <div class="label flex">
渗透率<div class="num">{{ summaryInfo.penetrationRate }}</div> 渗透率<div class="num">{{ formatMom(summaryInfo.penetrationRate) }}</div>
</div>
<div class="sub-value">
环比{{ formatMom(summaryInfo.penetrationRateMom) }}
<template v-if="formatIsRatio(summaryInfo.penetrationRateMom)">
<img
:class="['arrow',{just:formatIsRatio(summaryInfo.penetrationRateMom) === 'just01'}]"
:src="getIconSrc(formatIsRatio(summaryInfo.penetrationRateMom))"
/>
</template>
</div> </div>
<div class="sub-value">环比{{ summaryInfo.penetrationRateMom }}</div>
</div> </div>
<template v-for="(i,index) in summaryList"> <template v-for="(i,index) in summaryList">
<div <div
...@@ -51,10 +70,18 @@ ...@@ -51,10 +70,18 @@
> >
<div class="label flex"> <div class="label flex">
{{ j.label }} {{ j.label }}
<div class="num">{{ summaryInfo[i.key] }}</div> <div class="num">{{ formatMom(summaryInfo[j.key]) }}</div>
</div>
<div class="value">{{ formatDash(summaryInfo[j.key])}}</div>
<div class="sub-value">
环比{{ formatMom(summaryInfo[j.percentKey]) }}
<template v-if="formatIsRatio(summaryInfo[j.percentKey])">
<img
:class="['arrow',{just:formatIsRatio(summaryInfo[j.percentKey]) === 'just01'}]"
:src="getIconSrc(formatIsRatio(summaryInfo[j.percentKey]))"
/>
</template>
</div> </div>
<div class="value">{{ summaryInfo[i.key] }}</div>
<div class="sub-value">环比{{ summaryInfo[i.percentKey] }}</div>
</div> </div>
</template> </template>
</div> </div>
...@@ -65,7 +92,7 @@ ...@@ -65,7 +92,7 @@
<template v-for="(item,index) in leftWarningInfoList"> <template v-for="(item,index) in leftWarningInfoList">
<EarlyWarningTips <EarlyWarningTips
:key="index" :key="index"
:data="item" :item="item"
/> />
</template> </template>
</div> </div>
...@@ -74,12 +101,13 @@ ...@@ -74,12 +101,13 @@
<over-view-list <over-view-list
hasEHi hasEHi
:viewData="viewData" :viewData="viewData"
:isHarmony="isHarmony"
></over-view-list> ></over-view-list>
</div> </div>
<template v-for="(item,index) in rightWarningInfoList"> <template v-for="(item,index) in rightWarningInfoList">
<EarlyWarningTips <EarlyWarningTips
:key="index" :key="index"
:data="item" :item="item"
/> />
</template> </template>
</div> </div>
...@@ -88,17 +116,20 @@ ...@@ -88,17 +116,20 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { get } from 'sortablejs';
import EarlyWarningTips from '../EarlyWarningTips.vue' import EarlyWarningTips from '../EarlyWarningTips.vue'
import OverViewList from '../OverViewList.vue'; import OverViewList from '../OverViewList.vue';
import { import {
getStrategyMerchantAnalysisStoreDetailSummary, getStrategyMerchantAnalysisStoreDetailSummary,
getStrategyMerchantAnalysisGoodsSummaryWithWarn, getStrategyMerchantAnalysisGoodsSummaryWithWarn,
getStrategyMerchantListWarningInfo getStrategyMerchantListWarningInfo,
getStrategyBusinessAnalysisStoreSpecialBrand
} from '@/api/earlyWarningManager' } from '@/api/earlyWarningManager'
export default { export default {
name: 'SummaryOverview', name: 'SummaryOverview',
inject: ['IMG_URL', 'GET_PARAMS_INFO', 'GET_HARMONY'], inject: ['IMG_URL', 'GET_PARAMS_INFO',
'formatIsRatio', 'formatMom',
'formatDash', 'getIconSrc',
'formatNumber'],
components: { components: {
EarlyWarningTips, EarlyWarningTips,
OverViewList OverViewList
...@@ -106,8 +137,8 @@ export default { ...@@ -106,8 +137,8 @@ export default {
data () { data () {
return { return {
leftWarningInfoList: new Array(5), leftWarningInfoList: [],
rightWarningInfoList: new Array(3), rightWarningInfoList: [],
summaryInfo: {}, summaryInfo: {},
topView: [ topView: [
{ {
...@@ -123,6 +154,7 @@ export default { ...@@ -123,6 +154,7 @@ export default {
}, },
{ {
label: '达成率', //(仅月周期展示) ? label: '达成率', //(仅月周期展示) ?
isRate: true,
key: 'achievementRate', key: 'achievementRate',
width: '80px' width: '80px'
}, },
...@@ -206,41 +238,55 @@ export default { ...@@ -206,41 +238,55 @@ export default {
] ]
}, },
], ],
isHarmony: false, viewData: {},
viewData: {} isHarmony: false
} }
}, },
computed: { computed: {
paramsInfo () { paramsInfo () {
return this.GET_PARAMS_INFO() return this.GET_PARAMS_INFO()
}, },
isHarmony () {
return this.GET_HARMONY()
}
}, },
mounted () { mounted () {
}, },
methods: { methods: {
async getStrategyBusinessAnalysisStoreSpecialBrand () {
const params = this.paramsInfo,
data = await getStrategyBusinessAnalysisStoreSpecialBrand(params)
this.isHarmony = data
},
init () { init () {
this.getStrategyMerchantAnalysisStoreDetailSummary() this.getStrategyMerchantAnalysisStoreDetailSummary()
this.getStrategyMerchantListWarningInfo() this.getStrategyMerchantListWarningInfo()
this.getStrategyBusinessAnalysisStoreSpecialBrand()
}, },
async getStrategyMerchantAnalysisStoreDetailSummary () { async getStrategyMerchantAnalysisStoreDetailSummary () {
let params = this.paramsInfo, let params = this.paramsInfo,
data = await getStrategyMerchantAnalysisStoreDetailSummary(params) data = await getStrategyMerchantAnalysisStoreDetailSummary(params)
this.summaryInfo = data this.summaryInfo = data
console.log(data, 'SummaryOverview/index.vue(查询门店经营概况)') console.log(data, 'SummaryOverview/index.vue(查询门店经营概况)')
if (!this.isHarmony) { //是否鸿蒙 是才查商品 const summaryGoodsData = await getStrategyMerchantAnalysisGoodsSummaryWithWarn(params)
const summaryGoodsData = await getStrategyMerchantAnalysisGoodsSummaryWithWarn(params) this.viewData = summaryGoodsData || {}
this.viewData = summaryGoodsData || {} console.log(summaryGoodsData, 'SummaryOverview/index.vue(查询门店商品销售情况)')
console.log(summaryGoodsData, 'SummaryOverview/index.vue(查询门店商品销售情况)')
}
}, },
async getStrategyMerchantListWarningInfo () { async getStrategyMerchantListWarningInfo () {
let params = this.paramsInfo, let params = this.paramsInfo,
data = await getStrategyMerchantListWarningInfo(params) data = await getStrategyMerchantListWarningInfo(params),
console.log(data, 'SummaryOverview/index.vue(查询门店预警信息)') leftWarningInfoList = [],
rightWarningInfoList = []
data.forEach((e, index) => {
if ((index + 1) % 2 == 0) rightWarningInfoList.push({
type: e.startsWith('兜底预警') ? 1 : 2,
text: e
})
else leftWarningInfoList.push({
type: e.startsWith('兜底预警') ? 1 : 2,
text: e
})
})
this.leftWarningInfoList = leftWarningInfoList;
this.rightWarningInfoList = rightWarningInfoList;
} }
} }
} }
...@@ -251,6 +297,10 @@ export default { ...@@ -251,6 +297,10 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.arrow {
width: 13px;
height: 13px;
}
.summary-overview { .summary-overview {
padding: 0 20px 20px; padding: 0 20px 20px;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
...@@ -348,7 +398,7 @@ export default { ...@@ -348,7 +398,7 @@ export default {
position: absolute; position: absolute;
top: 55px; top: 55px;
right: 12px; right: 12px;
width: 95px; min-width: 95px;
flex-direction: column; flex-direction: column;
font-size: 13px; font-size: 13px;
.label { .label {
......
...@@ -45,9 +45,9 @@ import StaffOverview from './components/StaffOverview/index.vue'; ...@@ -45,9 +45,9 @@ import StaffOverview from './components/StaffOverview/index.vue';
import { deepClone } from "@/common/util" import { deepClone } from "@/common/util"
import qualityDetail from '@/views/residentManage/components/qualityDetail' import qualityDetail from '@/views/residentManage/components/qualityDetail'
import newQualityDetail from '@/views/residentManage/components/newQualityDetail' import newQualityDetail from '@/views/residentManage/components/newQualityDetail'
import { const rise = require('@/assets/strategy/rise.png')
getStrategyBusinessAnalysisStoreSpecialBrand const just01 = require('@/assets/strategy/just01.png')
} from '@/api/earlyWarningManager' const decline = require('@/assets/strategy/decline.png')
export default { export default {
components: { components: {
StrategyList, StrategyList,
...@@ -65,7 +65,12 @@ export default { ...@@ -65,7 +65,12 @@ export default {
IMG_URL: this.IMG_URL, IMG_URL: this.IMG_URL,
deepClone, deepClone,
GET_PARAMS_INFO: () => this.paramsInfo, GET_PARAMS_INFO: () => this.paramsInfo,
GET_HARMONY: () => this.isHarmony GET_HARMONY: () => this.isHarmony,
formatMom: this.formatMom,
formatDash: this.formatDash,
formatIsRatio: this.formatIsRatio,
getIconSrc: this.getIconSrc,
formatNumber: this.formatNumber
} }
}, },
data () { data () {
...@@ -116,18 +121,20 @@ export default { ...@@ -116,18 +121,20 @@ export default {
if (merchantNo) { if (merchantNo) {
console.log('接收到的 merchantNo:', merchantNo); console.log('接收到的 merchantNo:', merchantNo);
// 可以根据 merchantNo 更新 merchantInfo 或进行其他操作 // 可以根据 merchantNo 更新 merchantInfo 或进行其他操作
this.paramsInfo.merchantIds = [44211227 || merchantNo] // this.paramsInfo.merchantIds = [merchantNo]
this.$nextTick(() => this.init()) // this.$nextTick(() => this.init())
} }
this.paramsInfo.merchantIds = [44210895 || 44211227 || merchantNo]
this.$nextTick(() => this.init())
history.pushState(null, null, document.URL) history.pushState(null, null, document.URL)
window.addEventListener('popstate', this.preventBack) window.addEventListener('popstate', this.preventBack)
}, },
methods: { methods: {
init () { init () {
this.storeSignboardInfoRef.init() this.storeSignboardInfoRef.init()
this.businessOverviewRef.init() this.businessOverviewRef.init()
this.strategyListRef.init() this.strategyListRef.init()
}, },
preventBack () { preventBack () {
if (this.isQualityVisible || this.isNewQualityVisible) { if (this.isQualityVisible || this.isNewQualityVisible) {
...@@ -137,14 +144,11 @@ export default { ...@@ -137,14 +144,11 @@ export default {
} }
this.$router.go(-1) this.$router.go(-1)
}, },
async requireInterface (flag = false) { async requireInterface () {
if (flag) {
const data = await getStrategyBusinessAnalysisStoreSpecialBrand(params)
this.isHarmony = data
}
this.summaryOverviewRef.init() this.summaryOverviewRef.init()
this.staffOverviewRef.init() this.staffOverviewRef.init()
}, },
openReceptionDialog ({ list, row, currentNum }) { openReceptionDialog ({ list, row, currentNum }) {
this.currentNum = currentNum this.currentNum = currentNum
this.qualityDetailList = list this.qualityDetailList = list
...@@ -168,7 +172,7 @@ export default { ...@@ -168,7 +172,7 @@ export default {
this.paramsInfo = { this.paramsInfo = {
...this.paramsInfo, ...this.paramsInfo,
// ...e // ...e
cycleType: 4, cycleType: 3,
startTime: '2001-01-01', startTime: '2001-01-01',
endTime: '2026-01-01' endTime: '2026-01-01'
} }
...@@ -179,8 +183,48 @@ export default { ...@@ -179,8 +183,48 @@ export default {
...this.paramsInfo, ...this.paramsInfo,
merchantIds: [e] merchantIds: [e]
} }
this.requireInterface(true) this.requireInterface()
this.init() this.init()
},
formatIsRatio: (v) => {
const s = typeof v === "string" ? v.trim() : v;
if (s === null || s === undefined || (typeof s === "string" && s === ""))
return "";
const n =
typeof s === "number"
? s
: parseFloat((s).replace(/[^\d.\-]/g, ""));
if (isNaN(n)) return "";
return n < 0 ? "decline" : n === 0 ? "just01" : "rise";
},
formatMom: (val) => {
if (val === null || val === undefined) return "-"
const s = String(val).trim();
if (s === "") return "-";
if (s.includes("%") || s.includes("%")) return s
return `${s}%`;
},
formatDash: (val) => {
if (val === null || val === undefined) return "-";
if (typeof val === "string" && val.trim() === "") return "-";
return val;
},
getIconSrc: (name) => {
return {
rise,
decline,
just01,
}[name] ?? ""
},
formatNumber (val) {
if (val === null || val === undefined) return "-"
// 转换为数字并验证有效性
const num = Number(val);
if (isNaN(num)) return val;
// 使用 toFixed(2) 确保两位小数,并保留千位分隔符
const [integerPart, decimalPart] = num.toFixed(2).split('.');
const formattedInteger = Number(integerPart).toLocaleString();
return `${formattedInteger}.${decimalPart}`;
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!