Commit faf8450e by 李伟康

commit 盯防

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