Commit faf8450e by 李伟康

commit 盯防

1 parent ad01a0b8
Showing 24 changed files with 777 additions and 185 deletions
......@@ -4,61 +4,116 @@ import RequestMethods from "./request.methods"
const path = "dj.api.smartcarlife."
// 查询员工预警列表
export function staffWarningMsgListWithPage(data) {
export function staffWarningMsgListWithPage (data) {
data.method = `${path}warningmsg.staffWarningMsgListWithPage`
return request(data, RequestMethods.POST)
}
// 预警明细
export function warningMsgDetailListWithPage(data) {
export function warningMsgDetailListWithPage (data) {
data.method = `${path}warningmsg.warningMsgDetailListWithPage`
return request(data, RequestMethods.POST)
}
// 查询枚举 Type 1.预警类型 2.预警事项
export function findAllData(data) {
export function findAllData (data) {
data.method = `${path}warningmsg.findAllData`
return request(data, RequestMethods.POST)
}
// 查询相关警情的所有督导或销售 1.督导 2.销售
export function findAllPersonRelations(data) {
export function findAllPersonRelations (data) {
data.method = `${path}warningmsg.findAllPersonRelations`
return request(data, RequestMethods.POST)
}
// 根据预警id查询预警的跟进信息
export function findByMsgId(data) {
export function findByMsgId (data) {
data.method = `${path}warningmsg.findByMsgId`
return request(data, RequestMethods.POST)
}
// 保存跟进记录
export function saveFollowRecord(data) {
export function saveFollowRecord (data) {
data.method = `${path}warningmsg.saveFollowRecord`
return request(data, RequestMethods.POST)
}
// 导出预警明细
export function warningMsgDetailListWithPageExport(data) {
export function warningMsgDetailListWithPageExport (data) {
data.method = `${path}warningmsg.warningMsgDetailListWithPageExport`
return request(data, RequestMethods.POST)
}
// 查询门店预警列表
export function merchantWarningMsgListWithPage(data) {
export function merchantWarningMsgListWithPage (data) {
data.method = `${path}warningmsg.merchantWarningMsgListWithPage`
return request(data, RequestMethods.POST)
}
// 店效盯防首页
export function getShopGuardIndexBoard(data) {
export function getShopGuardIndexBoard (data) {
data.method = 'dj.api.smartcarlife.risk.manage.home.page'
return request(data, RequestMethods.POST)
}
/** 店效盯防-风险榜 */
export function getMerchantPerformanceList(data) {
export function getMerchantPerformanceList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.performance.page'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-门店基础信息
*/
export function getMerchantBaseInfo (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.base.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-门店产值信息
*/
export function getMerchantBaseDetail (data) {
data.method = 'dj.api.smartcarlife.risk.manage.merchant.performance.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-产值详情
*/
export function getMerchantOutputDetail (data) {
data.method = 'dj.api.smartcarlife.risk.manage.output.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-门店详情-人效指标-分页查询质检批次列表
*
*/
export function getReceptionDetailPage (data) {
data.method = 'dj.api.smartcarlife.inspection.receptionDetailPage'
return request(data, RequestMethods.POST)
}
/**
* / 查询质检批次列表导出
*/
export function getReceptionDetailReport (data) {
data.method = 'dj.api.smartcarlife.inspection.receptionDetailReport'
return request(data, RequestMethods.POST)
}
/**
* 预警驻店人员
*
*/
export function getWarningMsgStaffList (data) {
data.method = 'dj.api.smartcarlife.warningmsg.warningMsgStaffList'
return request(data, RequestMethods.POST)
}
/**
* 接待明细驻店人员
*
*/
export function getReceptionStaffList (data) {
data.method = 'dj.api.smartcarlife.inspection.receptionStaffList'
return request(data, RequestMethods.POST)
}
\ No newline at end of file
......@@ -338,4 +338,8 @@ $prefix: d2;
.remark-popper-class{
width: 50%;
}
.shop-tooltip {
max-width: 236px;
}
\ No newline at end of file
......@@ -128,13 +128,10 @@ export default {
params = {
}
if (e == 'dateType') this.date = []
if (dateType == 'year') {
params.allYear = true
} else {
let { startDate, endDate } = dateGroup.find(i => i.value == dateType)
params.startDate = startDate
params.endDate = endDate
}
if (dateType == 'year') params.allYear = true
let { startDate, endDate } = dateGroup.find(i => i.value == dateType)
params.startDate = startDate
params.endDate = endDate
this.$emit('search', params)
},
}
......
......@@ -16,6 +16,7 @@
<script type='text/ecmascript-6'>
import SearchBox from '../SearchBox'
import * as echarts from 'echarts'
import { getMerchantOutputDetail } from '@api/earlyWarningManager'
export default {
components: {
SearchBox
......@@ -29,17 +30,33 @@ export default {
},
data () {
return {
chart: null
chart: null,
searchTime: {},
}
},
mounted () {
},
methods: {
async getBoardData (params) {
this.searchTime = params
this.getMerchantOutputDetail()
console.log(params)
this.chart = echarts.init(document.getElementById(this.pageData.pageId))
this.drawChart()
// this.chart = echarts.init(document.getElementById(this.pageData.pageId))
// this.drawChart()
},
async getMerchantOutputDetail () {
let { businessType, queryType } = this.pageData,
{ searchTime } = this
const res = await getMerchantOutputDetail({
businessType,
queryType,
// ...searchTime
startDate: '2024-04-19',
endDate: '2024-10-19',
})
console.log(res, '===========')
},
drawChart () {
let { pageData } = this
......
......@@ -32,7 +32,11 @@
</el-carousel>
<div class="table">
<div class="table-title">行为预警明细</div>
<behavior-table />
<behavior-table
v-if="initStatus"
:searchTime="searchTime"
:pageData="pageData"
/>
</div>
</div>
</template>
......@@ -44,8 +48,25 @@ export default {
BehaviorTable
},
name: '',
props: {
searchTime: {
type: Object,
default: () => { }
},
pageData: {
type: Object,
default: () => { }
},
show: Boolean
},
watch: {
show (n) {
if (n) this.initStatus = true
}
},
data () {
return {
initStatus: false,
staffList: [
new Array(4).fill(1),
new Array(3).fill(1)
......
......@@ -99,7 +99,7 @@ import { mapActions, mapState } from 'vuex'
import { Util, deepClone, downLoadFile } from '@/common/util'
import detailDialog from '@/views/earlyWarningManager/staff/components/detailDialog'
import handleDialog from '@/views/earlyWarningManager/staff/components/handleDialog'
import { findAllData, findAllPersonRelations, warningMsgDetailListWithPage, warningMsgDetailListWithPageExport } from '@api/earlyWarningManager'
import { findAllData, findAllPersonRelations, warningMsgDetailListWithPage, warningMsgDetailListWithPageExport, getWarningMsgStaffList } from '@api/earlyWarningManager'
import { businessOpt, priorityOpt, warnStageyOpt, statusOpt, priorityShowText, filterOpt } from '@/common/constants.js'
export default {
name: 'Details',
......@@ -108,15 +108,20 @@ export default {
handleDialog
},
props: {
paramsObj: {
searchTime: {
type: Object,
default: {}
default: () => { }
},
pageData: {
type: Object,
default: () => { }
}
},
data () {
return {
searchForm: {
monitorType: 1, // 预警数据 1.员工 2.门店
staffId:'',
staffName: '',
staffPhone: '',
ruleType: '',
......@@ -133,6 +138,14 @@ export default {
searchType: ''
},
showFormData: [{
label: '驻店人员',
name: 'staffId',
type: 'select',
isClear: true,
optionList: [],
optionId: 'staffId',
optionLabel: 'staffName',
}, {
label: '预警类型',
name: 'ruleType',
type: 'select',
......@@ -341,14 +354,6 @@ export default {
})
},
mounted () {
console.log('this.paramsObj', this.paramsObj)
if (this.paramsObj) {
this.params_obj = deepClone(this.paramsObj)
this.searchForm.staffName = this.params_obj.staffName
this.searchForm.merchantName = this.params_obj.merchantName
this.searchForm.bussinessType = this.params_obj.bussinessType
this.searchForm.statusList = this.params_obj.statusList
}
this.getBaseData()
},
......@@ -360,14 +365,14 @@ export default {
...mapActions('d2admin/user', ['actionSetDownloadList']),
async getBaseData () {
/**预警类型 */
this.findAllData(1)
// 督导
this.findAllPersonRelations(1)
// 销售
this.findAllPersonRelations(2)
// 盯防负责人
this.findAllPersonRelations(3)
/**驻店人员 */
this.getWarningMsgStaffList()
this.getOptionsList()
},
beforeSearchFn () {
......@@ -420,7 +425,7 @@ export default {
},
getOptionsList () {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (item.type === 'select' && item.optionsName) {
if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部' && item.label != '状态'
) {
......@@ -491,6 +496,15 @@ export default {
if (obj.flag) {
this.$refs.detailListTable.refreshTable()
}
},
async getWarningMsgStaffList () {
let { merchantId } = this.pageData
const res = await getWarningMsgStaffList({
merchantNo: merchantId,
monitorType: 1
})
this.showFormData[0].optionList = res || []
console.log(res, '预警驻店人员')
}
}
}
......
......@@ -32,20 +32,42 @@
</el-carousel>
<div class="table">
<div class="table-title">接待明细</div>
<reception-table />
<reception-table
v-if="initStatus"
:searchTime="searchTime"
:pageData="pageData"
/>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import ReceptionTable from './ReceptionTable.vue'
export default {
components: {
ReceptionTable
},
props: {
searchTime: {
type: Object,
default: () => { }
},
pageData: {
type: Object,
default: () => { }
},
show: Boolean
},
name: '',
watch: {
show (n) {
if (n) this.initStatus = true
}
},
data () {
return {
initStatus: false,
staffList: [
new Array(4).fill(1),
new Array(3).fill(1)
......@@ -55,6 +77,7 @@ export default {
mounted () {
},
methods: {
}
}
</script>
......
......@@ -12,6 +12,8 @@
v-show="activeName == i.id"
:show="activeName == i.id"
:pageId="`human-${pageId}`"
:searchTime="searchTime"
:pageData="pageData"
/>
</template>
</div>
......@@ -35,7 +37,15 @@ export default {
type: String,
default: ''
},
show: Boolean
show: Boolean,
searchTime: {
type: Object,
default: () => { }
},
pageData: {
type: Object,
default: () => { }
},
},
name: '',
watch: {
......
<template>
<div :class="i.class">
<div class="title">
{{ i.title
}}<span>
<template v-if="i.class == 'arrow'">
{{ boardData[i.valueKey] }}
</template>
<template v-else>
<template v-if="i.abnormalKey">
({{
{
0: "正常",
1: "异常"
}[boardData[i.abnormalKey]]
}})
</template>
</template>
</span>
</div>
<template v-if="i.class == 'block'">
<div class="value">
{{ boardData[i.valueKey]
}}<template v-if="i.lastValueKey"><span>({{ boardData[i.lastValueKey] }})</span></template>
</div>
</template>
<div class="percent">
环比<span>{{ boardData[i.percentKey] }}%</span>
</div>
<template v-if="i.hasAdd">
<div class="add">
</div>
</template>
<template v-if="i.hasEqual">
<div class="equal">
</div>
</template>
</div>
</template>
<script type="text/ecmascript-6">
export default {
props: {
i: {
type: Object,
default: () => { }
},
boardData: {
type: Object,
default: () => { }
}
},
name: '',
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang="scss">
.block {
position: relative;
width: 100%;
height: 68px;
border-radius: 8px;
background: rgb(246, 252, 254);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.title {
line-height: 17px;
font-size: 12px;
color: #5a5e66;
display: flex;
align-items: center;
margin-bottom: 2px;
span {
font-size: 10px;
}
}
.value {
color: rgb(52, 123, 255);
font-size: 16px;
font-weight: 500;
line-height: 16px;
display: flex;
align-items: center;
margin-bottom: 3px;
span {
font-size: 12px;
font-weight: 400;
line-height: 12px;
color: #f24724b3;
}
}
.percent {
color: #999ea8;
font-size: 10px;
font-weight: 500;
line-height: 14px;
span {
font-size: 12px;
font-weight: 400;
line-height: 12px;
}
}
}
.arrow {
position: relative;
width: 54.33%;
height: 54px;
background-image: url("@/assets/funnel-arrow.png");
background-size: 100% 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
.title {
color: #347bff;
font-size: 10px;
font-weight: 500;
line-height: 14px;
display: flex;
align-items: center;
span {
font-size: 12px;
line-height: 12px;
}
}
.percent {
color: #999ea8;
font-size: 10px;
font-weight: 500;
line-height: 14px;
span {
font-size: 12px;
font-weight: 400;
line-height: 12px;
}
}
}
.add {
position: absolute;
top: 50%;
left: -9.24%;
transform: translateY(-50%);
width: 9.24%;
aspect-ratio: 1/1;
background-image: url("@/assets/funnel+.png");
background-size: 100% 100%;
}
.equal {
position: absolute;
top: 50%;
left: -9.24%;
transform: translateY(-50%);
width: 9.24%;
aspect-ratio: 1/1;
background-image: url("@/assets/funnel=.png");
background-size: 100% 100%;
}
</style>
......@@ -11,32 +11,45 @@
<script type='text/ecmascript-6'>
import * as echarts from 'echarts'
import dayjs from 'dayjs'
export default {
name: '',
props: {
pageId: {
type: String,
default: ''
}
},
outputTrend: {
type: Array,
default: () => []
},
show: Boolean
},
data () {
return {
chart: null
}
},
watch: {
outputTrend: {
immediate: true,
handler (newval) {
if (!this.show) return
this.chart = echarts.init(document.getElementById(this.pageId))
this.drawChart(newval)
}
}
},
mounted () {
this.chart = echarts.init(document.getElementById(this.pageId))
this.drawChart()
},
methods: {
drawChart () {
let base = +new Date(2001, 0, 1);
let oneDay = 1000 * 3600 * 24;
let data = [[base, Math.random() * 300]];
for (let i = 1; i < 5000; i++) {
let now = new Date((base += oneDay));
data.push([+now, Math.round((Math.random() - 0.5) * 20 + data[i - 1][1])]);
}
drawChart (list) {
let data = []
list.map(e => {
if (!e.output) e.output = Math.round(Math.random() * 10000)
data.push([dayjs(e.countDate).format("YYYY-MM-DD"), e.output])
})
let option = {
tooltip: {
trigger: 'axis',
......@@ -55,8 +68,16 @@ export default {
return obj;
},
formatter: params => {
// console.log(params)
let str = '';
let [item] = params
if(!item) return
let{ dataIndex } = item,
{output,customerPrice,drainageRate,conversionRate} = list[dataIndex]
let str = `
产值:${output}<br>
客单价:${customerPrice}<br>
订单数:45单<br>
触客率:${drainageRate}%<br>
转化率:${conversionRate}%`;
return str;
}
},
......@@ -66,23 +87,12 @@ export default {
},
xAxis: {
type: 'time',
boundaryGap: false
boundaryGap: false,
},
yAxis: {
type: 'value',
boundaryGap: [0, '100%']
},
dataZoom: [
{
type: 'inside',
start: 0,
end: 20
},
{
start: 0,
end: 20
}
],
series: [
{
name: 'Fake Data',
......@@ -104,7 +114,6 @@ export default {
}
]
};
option && this.chart.setOption(option)
}
}
......
......@@ -12,14 +12,23 @@
</template>
</div>
</div>
<div class="store-chart">
<div class="funnel">
<funnel />
<funnel
:businessType="pageData.businessType"
:boardData="boardData"
/>
</div>
<div class="line">
<line-chart :pageId="`store-${pageId}`" />
<line-chart
:pageId="`store-${pageId}`"
:outputTrend="boardData.outputTrend"
:show="show"
/>
</div>
</div>
</div>
</template>
......@@ -27,6 +36,7 @@
import BoardItem from '../../shopGuardIndex/BoardItem'
import Funnel from './Funnel'
import LineChart from './LineChart'
import { getMerchantBaseDetail } from '@/api/earlyWarningManager'
export default {
components: {
BoardItem,
......@@ -37,12 +47,23 @@ export default {
pageId: {
type: String,
default: ''
}
},
pageData: {
type: Object,
default: () => { }
},
searchTime: {
type: Object,
default: () => { }
},
show: Boolean
},
name: '',
data () {
return {
boardData: {},
boardData: {
outputTrend: []
},
boardList: [
{
name: '总产值',
......@@ -72,13 +93,40 @@ export default {
value: 'touchNum',
percent: 'touchNumRatio',
},
]
],
initStatus: false
}
},
watch: {
show (n) {
if (n && !this.initStatus) this.getMerchantBaseDetail()
},
searchTime (n) {
if (this.show && this.initStatus) this.getMerchantBaseDetail()
}
},
mounted () {
},
methods: {
async getMerchantBaseDetail () {
const { merchantId, businessType } = this.pageData,
{ searchTime } = this
const res = await getMerchantBaseDetail({
merchantId: 44205761,
businessType: 2,
// ...searchTime
startDate: '2024-04-19',
endDate: '2024-10-19',
// allYear: true
})
Object.keys(res).map(key => {
if (res[key] != null && key != 'outputTrend') res[key] = res[key].toLocaleString()
})
this.initStatus = true
this.boardData = res
}
}
}
</script>
......
......@@ -4,18 +4,54 @@
<div class="icon"></div>
<div class="info">
<div class="merchant-name flex">
恒河猴
<div class="tag">自营</div>
{{baseInfo.merchantName}}
<div :class="['tag',{'grey':baseInfo.directSale == 0}]">{{
{
0:'非直营',
1:'直营'
}[baseInfo.directSale] }}</div>
</div>
<div class="text flex">
<div class="merchant-id">4456</div>
<div class="year">2024.5展业</div>
<div class="supervision-name">
<div class="merchant-id">{{baseInfo.merchantId}}</div>
<div class="year">{{baseInfo.startBusiness}}展业</div>
<div class="supervision-name flex">
<div class="supervision-icon"></div>
嚯嚯嚯
{{baseInfo.supervisionName}}
</div>
</div>
</div>
<template v-if="pageData.showTips">
<div class="label-box">
<div class="label-tab flex">
<template v-for="(i,index) in labelList">
<div
:key="index"
:class="['label-tab-item flex',{active: index == labelIndex}]"
@click="labelIndex = index"
>
{{i.label}}
</div>
</template>
</div>
<div class="label-title flex">
<i class="el-icon-warning"></i>
异常{{labelList[labelIndex].label}}
</div>
<el-tooltip
placement="bottom-end"
popper-class="shop-tooltip"
>
<div
slot="content"
v-html="pageData[labelList[labelIndex].key]"
></div>
<div
class="two-line"
v-html="pageData[labelList[labelIndex].key]"
></div>
</el-tooltip>
</div>
</template>
</div>
<div class="tab">
<el-tabs v-model="activeName">
......@@ -29,7 +65,7 @@
</div>
<div class="search-component">
<search-box
@search="getBoardData"
@search="searchTime = $event"
:hasConfig="false"
/>
</div>
......@@ -43,6 +79,8 @@
:show="activeName == i.id"
@openWindow="$emit('openWindow',$event)"
:pageId="`${pageData.pageId}_${i.id}`"
:pageData="pageData"
:searchTime="searchTime"
/>
</template>
</div>
......@@ -54,6 +92,9 @@ import Store from './Store/index'
import Human from './Human/index'
import Product from './Product/index'
import SearchBox from '../SearchBox'
import { getMerchantBaseInfo } from '@api/earlyWarningManager'
import dayjs from 'dayjs'
export default {
components: { Store, Human, Product, SearchBox },
name: '',
......@@ -65,7 +106,7 @@ export default {
},
data () {
return {
activeName: '1',
activeName: '',
tabList: [
{
label: '店效指标',
......@@ -82,20 +123,47 @@ export default {
componentName: 'Product',
id: '3'
}
]
],
baseInfo: {},
labelList: [
{
label: '事件标签',
key: 'eventLabel'
},
{
label: '店效标签',
key: 'shopEfficiencyLabel'
}
],
labelIndex: 0,
searchTime:{}
}
},
mounted () {
this.getMerchantBaseInfo()
this.activeName = this.tabList[0].id
},
methods: {
getBoardData (params) {
console.log(params)
}
getMerchantBaseInfo () {
let { merchantId, businessType } = this.pageData,
startDate = dayjs().startOf('month').format("YYYY-MM-DD"),
endDate = dayjs().startOf('month').format("YYYY-MM-DD"),
supervisionName = []
getMerchantBaseInfo({ merchantId, businessType, startDate, endDate }).then(res => {
res.startBusiness = dayjs(res.startBusiness).format("YYYY-MM")
res.supervisionList.map(item => {
supervisionName.push(item.supervisionName)
})
res.supervisionName = supervisionName.join('、')
this.baseInfo = res
})
},
}
}
</script>
<style scoped lang='scss'>
.shop-detail-box {
height: 100%;
overflow-y: auto;
......@@ -105,20 +173,82 @@ export default {
}
padding: 0 20px;
.shop-info {
height: 104px;
min-height: 104px;
background-color: #fff;
display: flex;
box-sizing: border-box;
padding: 16px 20px;
position: relative;
.label-box {
position: absolute;
width: 556px;
height: 80px;
background: #f47f131a;
top: 16px;
right: 16px;
box-sizing: border-box;
padding: 8px;
.label-title {
color: #888888;
font-size: 12px;
font-weight: 500;
line-height: 20px;
.el-icon-warning {
margin: 0 8px 0 3px;
font-size: 14px;
color: #f47f13;
}
}
.two-line {
color: #888888;
font-size: 12px;
line-height: 20px;
padding-left: 25px;
display: -webkit-box;
-webkit-box-orient: vertical;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
cursor: pointer;
}
.label-tab {
width: 124px;
height: 24px;
border-radius: 2px;
background: #f9fafb;
position: absolute;
top: 0;
right: 0;
box-sizing: border-box;
border: 2px solid #f9fafb;
&-item {
width: 60px;
height: 20px;
color: #666666;
font-size: 11px;
justify-content: center;
cursor: pointer;
}
.active {
background: #fff;
color: #185efe;
}
}
}
.icon {
width: 48px;
height: 48px;
border-radius: 4px;
overflow: hidden;
margin-right: 16px;
background-color: #096;
background: url("@/assets/d+.png");
background-size: 100% 100%;
}
.info {
width: 36%;
.merchant-name {
color: #1d2129;
font-size: 16px;
......@@ -136,6 +266,10 @@ export default {
font-size: 12px;
margin-left: 16px;
}
.grey{
color: #a8a8a8;
background: #f6f6f6;
}
}
.text {
color: #888888;
......@@ -151,12 +285,19 @@ export default {
color: #185efe;
font-size: 12px;
margin-right: 16px;
flex-shrink: 0;
}
.year {
margin-right: 16px;
flex-shrink: 0;
}
.supervision-icon {
margin-right: 4px;
flex-shrink: 0;
width: 14px;
height: 14px;
background: url("@/assets/supervision-icon.png");
background-size: 100% 100%;
}
}
}
......@@ -183,8 +324,8 @@ export default {
z-index: 2;
width: fit-content;
margin-left: auto;
.search-box{
padding:0 10px 20px 0;
.search-box {
padding: 0 10px 20px 0;
}
}
}
......
......@@ -44,7 +44,7 @@
class="board-item"
:item="item"
:data="boardData"
@click="$emit('openWindow',item)"
@click="openWindow(item)"
/>
</template>
</div>
......@@ -95,35 +95,40 @@ export default {
name: '产值',
value: 'output',
percent: 'outputRatio',
unit: '(元)'
unit: '(元)',
queryType: 1
},
{
name: '展业门店数',
value: 'storeNum',
percent: 'storeNumRatio',
queryType: 6
},
{
name: '客单价',
value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio',
unit: '(元)'
unit: '(元)',
queryType: 2
},
{
name: '店均产值',
value: 'storeAverageOutput',
percent: 'storeAverageOutputRatio',
unit: '(元)'
unit: '(元)',
queryType: 7
},
{
name: '交车数',
value: 'deliveryNum',
percent: 'deliveryNumRatio',
queryType: 8
},
{
name: '触客数',
value: 'touchNum',
percent: 'touchNumRatio',
queryType: 9
},
],
timeObject: {}
......@@ -145,11 +150,13 @@ export default {
let { timeObject, businessType } = this
let params = {
businessType,
...timeObject
...timeObject,
startDate: '2024-04-19',
endDate: '2024-10-19',
}
const res = await getShopGuardIndexBoard(params)
Object.keys(res).map(key => {
if (res[key]) {
if (res[key] != null) {
if (key == 'outputCompletionProgress' || key == 'grossProfitMargin') res[key] = res[key] + '%'
else res[key] = res[key].toLocaleString()
if (key == 'budget') res[key] = '¥' + res[key]
......@@ -161,6 +168,13 @@ export default {
changeBusinessType () {
this.getBoardData()
this.$emit('changeBusinessType', this.businessType)
},
openWindow (e) {
let { businessType } = this
this.$emit('openWindow', {
...e,
businessType
})
}
}
}
......
......@@ -11,7 +11,7 @@
</div>
<div :class="['percent',`${percentColor(data[item.percent])}`]">
环比<div class="percent-value">{{formatted(data[item.percent])}}</div>
<template v-if="data[item.percent]">
<template v-if="data[item.percent] != null">
<div :class="['icon',`${percentClass(data[item.percent])}`]"></div>
</template>
</div>
......@@ -53,7 +53,7 @@ export default {
} else if (num < 0) {
return 'el-icon-caret-bottom'
} else {
return ''
return 'minus'
}
},
percentColor (num) {
......@@ -117,6 +117,12 @@ export default {
.icon {
margin-left: 6px;
}
.minus {
width: 7.5px;
height: 2.5px;
border-radius: 0.6px;
background: #888888;
}
}
.red {
.percent-value,
......
......@@ -38,10 +38,7 @@ export default {
storeWarn
},
props:{
businessType: {
type: String,
default: ''
}
businessType: [String, Number]
},
data () {
return {
......
......@@ -12,7 +12,7 @@
</div>
<div class="btns">
<el-button
<!-- <el-button
size="mini"
type="primary"
@click="handleSearch"
......@@ -22,7 +22,7 @@
plain
type="info"
@click="handleReset"
>重置</el-button>
>重置</el-button> -->
<el-button
size="mini"
type="primary"
......@@ -55,7 +55,6 @@ import dayjs from 'dayjs'
import { deepClone } from "@/common/util"
import FilterItem from './FilterItem.vue'
import { getMerchantPerformanceList } from '@api/earlyWarningManager'
import { getListApi } from "@api/publicAccount"
export default {
components: {
FilterItem
......@@ -66,10 +65,7 @@ export default {
type: String,
default: '1'
},
businessType: {
type: String,
default: ''
},
businessType: [String, Number],
show: Boolean
},
data () {
......@@ -100,8 +96,7 @@ export default {
searchForm: {
countDate: dayjs().subtract(1, 'month').format("YYYY-MM")
},
// getListApi: getMerchantPerformanceList,
getListApi,
getListApi: getMerchantPerformanceList,
searchFormSearch: {},
tableParams: {
listName: "list",
......@@ -129,12 +124,16 @@ export default {
},
]
},
initStatus: false
}
},
watch: {
businessType (n) {
this.handleSearch()
if (this.show) this.handleSearch()
},
show (n) {
if (n && !this.initStatus) this.handleSearch()
}
},
created () {
},
......@@ -155,6 +154,7 @@ export default {
this.clearSort(orderBy)
this.searchForm.orderBy = orderBy
this.searchForm.asc = asc
this.handleSearch()
}
},
handleSearch () {
......@@ -168,7 +168,10 @@ export default {
beforeSearchFn () {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.getParams())
resolve()
if (this.show) {
this.initStatus = true
resolve()
}
})
},
getParams () {
......@@ -182,7 +185,9 @@ export default {
...e,
pageId: `merchant-${e.merchantId}`,
componentName: 'shop-detail',
tabTitle: `${e.merchantName}门店详情`
tabTitle: `${e.merchantName}门店详情`,
showTips: true,
businessType: this.businessType
})
}
}
......
......@@ -22,7 +22,7 @@ export default {
name: '',
data () {
return {
businessType: ''
businessType: 4
}
},
mounted () {
......
......@@ -119,7 +119,7 @@ export default {
} else this.$router.go(-1)
},
openWindow (data) {
console.log(data)
// console.log(data)
let id = data.pageId,
windowList = [...this.tab, ...this.dropdownList],
windowItem = windowList.find((e) => e.id == id)
......
......@@ -4,21 +4,29 @@
<d2-container class="m-t-40">
<!-- <div class="d2-container-content"
style="padding: 10px 20px;"> -->
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px" />
<div
class="header"
slot="header"
>
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px"
/>
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
</el-button>
<el-button size="small"
@click="handleReset">
<el-button
size="small"
@click="handleReset"
>
重置
</el-button>
</div>
......@@ -28,54 +36,78 @@
<d2-table-header>
<auth-button category="Button" />
</d2-table-header>
<d2-table ref="detailListTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
<template slot="priorityHtml"
slot-scope="scope">
<d2-table
ref="detailListTable"
:search-form="searchForm"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
<template
slot="priorityHtml"
slot-scope="scope"
>
<span :class="baseData.priorityShowClass[scope.scope.priorityLevel]">
{{ baseData.priorityShowText[scope.scope.priorityLevel] }}
</span>
</template>
<template slot="stageHtml"
slot-scope="scope">
<template
slot="stageHtml"
slot-scope="scope"
>
<span :class="baseData.stageShowClass[scope.scope.stage]">
{{ scope.scope.stageName }}
</span>
</template>
<template slot="typeHtml"
slot-scope="scope">
<template
slot="typeHtml"
slot-scope="scope"
>
<span :class="baseData.businessOptShowClass[scope.scope.businessType]">
{{ scope.scope.bussinessTypeName }}
</span>
</template>
<div slot="auth-button"
slot-scope="scope">
<div
slot="auth-button"
slot-scope="scope"
>
<!-- 查看 -->
<span style="margin-right: 10px;">
<auth-button :data="scope.scope"
:show-btn-ids="['9150202']" />
<auth-button
:data="scope.scope"
:show-btn-ids="['9150202']"
/>
</span>
<!-- 处理 -->
<span style="margin-right: 10px;"
v-if="scope.scope.status == 1 || scope.scope.status == 2">
<auth-button :data="scope.scope"
:show-btn-ids="['9150203']" />
<span
style="margin-right: 10px;"
v-if="scope.scope.status == 1 || scope.scope.status == 2"
>
<auth-button
:data="scope.scope"
:show-btn-ids="['9150203']"
/>
</span>
<el-button
type="text"
@click="openWindow(scope.scope)"
>门店档案</el-button>
</div>
</d2-table>
</div>
<!-- 详细信息 -->
<detail-dialog :visible.sync="detailVisible"
v-if="detailVisible"
:params-obj="recordInfo" />
<detail-dialog
:visible.sync="detailVisible"
v-if="detailVisible"
:params-obj="recordInfo"
/>
<!-- 处理 -->
<handle-dialog :visible.sync="handleVisible"
v-if="handleVisible"
:params-obj="recordInfo"
@dialogClose="closeHandleDialog" />
<handle-dialog
:visible.sync="handleVisible"
v-if="handleVisible"
:params-obj="recordInfo"
@dialogClose="closeHandleDialog"
/>
</d2-container>
<!-- </div> -->
</template>
......@@ -94,7 +126,7 @@ export default {
default: {}
}
},
data() {
data () {
return {
searchForm: {
monitorType: 2, // 预警数据 1.员工 2.门店
......@@ -379,7 +411,7 @@ export default {
},
computed: {
},
mounted() {
mounted () {
console.log('this.paramsObj', this.paramsObj)
if (this.paramsObj) {
this.params_obj = deepClone(this.paramsObj)
......@@ -392,7 +424,7 @@ export default {
methods: {
async getBaseData() {
async getBaseData () {
this.findAllData(2)
// 督导
this.findAllPersonRelations(1)
......@@ -403,7 +435,7 @@ export default {
this.getOptionsList()
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
if (this.searchForm.warnCycle) {
this.searchForm.warningStartDate = Util.dateFormate(this.searchForm.warnCycle[0], 'YYYY-MM-DD')
......@@ -422,10 +454,10 @@ export default {
resolve()
})
},
keyDowmGetList() {
keyDowmGetList () {
this.$refs.detailListTable.refreshTable()
},
handleReset() {
handleReset () {
this.searchForm = {
monitorType: 2, // 预警数据 1.员工 2.门店
ruleType: '',
......@@ -446,7 +478,7 @@ export default {
this.getOptionsList()
this.$refs.detailListTable.refreshTable()
},
getOptionsList() {
getOptionsList () {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (
......@@ -466,7 +498,7 @@ export default {
})
},
findAllData(type) {
findAllData (type) {
const params = { type: type }
findAllData(params).then((res) => {
console.log(res)
......@@ -482,7 +514,7 @@ export default {
})
},
findAllPersonRelations(sourceType) {
findAllPersonRelations (sourceType) {
const params = { sourceType: sourceType }
findAllPersonRelations(params).then((res) => {
if (sourceType == 1) { // 督导
......@@ -496,28 +528,39 @@ export default {
})
},
handleExport() {
handleExport () {
var params = this.searchForm
warningMsgDetailListWithPageExport(params).then((res) => {
res && downLoadFile(res)
})
},
handleDetail(row) {
handleDetail (row) {
this.recordInfo = row
this.detailVisible = true
},
handleDeal(row) {
handleDeal (row) {
this.recordInfo = row
this.handleVisible = true
},
closeHandleDialog(obj) {
closeHandleDialog (obj) {
this.handleVisible = !this.handleVisible
if (obj.flag) {
this.$refs.detailListTable.refreshTable()
}
},
openWindow (e) {
console.log(e)
this.$emit('openWindow', {
...e,
pageId: `merchant-${e.merchantId4s}`,
componentName: 'shop-detail',
tabTitle: `${e.merchantName4s}门店详情`,
merchantId: e.merchantId4s,
})
}
}
}
......
<!-- 门店预警管理 -->
<template>
<div class="staffWarn">
<div class="header"
slot="header">
<el-tabs v-model="activeName"
@tab-click="handleClickTabs">
<el-tab-pane label="预警看板"
name="noticeBoard" />
<el-tab-pane label="预警明细"
name="details" />
<div
class="header"
slot="header"
>
<el-tabs
v-model="activeName"
@tab-click="handleClickTabs"
>
<el-tab-pane
label="预警看板"
name="noticeBoard"
/>
<el-tab-pane
label="预警明细"
name="details"
/>
</el-tabs>
<div>
<notice-board v-if="activeName === 'noticeBoard'"
@gotoDetail="gotoDetail" />
<staff-detail v-if="activeName === 'details'"
:params-obj="recordInfo" />
<div v-if="initStatus">
<notice-board
v-if="activeName === 'noticeBoard'"
@gotoDetail="gotoDetail"
/>
<staff-detail
v-if="activeName === 'details'"
:params-obj="recordInfo"
@openWindow="$emit('openWindow',$event)"
/>
</div>
</div>
</div>
......@@ -25,28 +38,35 @@ import noticeBoard from './noticeBoard'
import staffDetail from './details'
export default {
name: 'StaffIndex',
data() {
data () {
return {
userInfo: this.$store.state.d2admin.user.info,
activeName: 'noticeBoard',
recordInfo: {}
recordInfo: {},
initStatus: false
}
},
props: {
show: Boolean
},
components: {
noticeBoard,
staffDetail
},
mounted() {
watch: {
show (val) {
if (val) this.initStatus = true
}
},
mounted () {
},
methods: {
handleClickTabs() {
handleClickTabs () {
this.recordInfo = {}
},
gotoDetail(params) {
gotoDetail (params) {
this.activeName = 'details'
this.recordInfo = params
console.log(params)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!