Commit e756cda9 by 李伟康

commit 盯防

1 parent fe721437
......@@ -223,7 +223,6 @@ export function updateKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateKpiMetric'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-更多看板-数据指标
*/
......@@ -246,4 +245,12 @@ export function getBoardMerchantList (data) {
export function getBoardDetail (data) {
data.method = 'dj.api.smartcarlife.risk.manage.code.detail.list'
return request(data, RequestMethods.POST)
}
\ No newline at end of file
}
/**
* 店效盯防-修改登录人指标隐藏显示
*/
export function updateOneKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateOneKpiMetri'
return request(data, RequestMethods.POST)
}
......@@ -380,3 +380,12 @@ export function get4sAndServiceMerchantListApi(data) {
data.method = `${path}merchant.merchantAndService.page`
return request(data, "post")
}
/**
*
* 获取车品牌列表
*/
export function getCarBrandList (data = {}) {
data.method = 'dj.api.smartcarlife.common.car.brand.list'
return request(data, RequestMethods.POST)
}
......@@ -105,7 +105,7 @@
<script type='text/ecmascript-6'>
import sortablejs from "sortablejs"
import { getKpiMetric, updateKpiMetric } from '@/api/earlyWarningManager'
import { getKpiMetric, updateKpiMetric, updateOneKpiMetric} from '@/api/earlyWarningManager'
export default {
name: '',
......@@ -219,14 +219,15 @@ export default {
})
})
console.log(userKpiMetricAddRequestDTOS, '-------')
const res = await updateKpiMetric({
const apiFun = searchFlag ? updateOneKpiMetric : updateKpiMetric
const res = await apiFun({
userKpiMetricAddRequestDTOS,
scope
})
if (res) {
this.$message.success('保存成功')
this.dialogShow = false
// this.$emit('update')
this.$emit('update')
}
} catch (error) {
if (typeof error === 'string') this.$message.error(error)
......
......@@ -235,7 +235,11 @@ export default {
}
}
if (this.hasStatisticalPeriod) {
console.log(this.statisticalPeriod)
params.dateType = {
'day':0,
'week':1,
'month':2,
}[this.statisticalPeriod]
}
params.startDate = startDate
params.endDate = endDate
......
......@@ -55,9 +55,6 @@ export default {
businessType () {
return this.pageData.businessType
},
queryType () {
return this.pageData.queryType
}
},
watch: {
businessType: {
......@@ -78,45 +75,33 @@ export default {
this.initStatus = true
},
async getData () {
let { searchTime, businessType, queryType } = this
let { searchTime: { startDate, endDate, dateType }, businessType } = this
this.chart = echarts.init(document.getElementById(this.pageData.pageId))
if (queryType) {
const res = await getMerchantOutputDetail({
const { merchantId, code } = this.pageData,
res = await getBoardDetail({
businessType,
queryType,
...searchTime
merchantId,
startDate,
dateType,
endDate,
code: 'A048'
})
this.drawChart(res, queryType)
} else {
const { merchantId } = this.pageData,
res = await getBoardDetail({
businessType,
merchantId,
...searchTime
})
console.log(res, 'lll')
}
this.drawChart(res)
},
drawChart (list, queryType) {
drawChart (list) {
this.chart.clear()
let { pageData } = this,
let { pageData: { name } } = this,
_this = this,
{ allYear } = this.searchTime,
{ allYear, dateType } = this.searchTime,
timeList = [],
data = [],
//1-产值,2-客单价,3-订单数,4-引流率,5-转化率,6-展业门店数,7-店均产值,8-交车数,9-触客数)
queryKey = {
1: 'output',
6: 'storeNum',
2: 'customerPrice',
7: 'storeAverageOutput',
8: 'deliveryNumber',
9: 'touchCustomers'
}[queryType]
data = []
list.map(e => {
// if (!e[queryKey]) e[queryKey] = Math.round(Math.random() * 10000)
data.push([dayjs(e.countDate).format("YYYY-MM-DD"), e[queryKey] || 0])
timeList.push(e.countDate)
let { startDate, endDate } = e,
axisLabel = dayjs(startDate).format("YYYY-MM-DD"),
weekStr = `${dayjs(startDate).format('MM/DD')}~${dayjs(endDate).format('MM/DD')}`
if (dateType == 1) axisLabel = weekStr
data.push([axisLabel, e.value || 0])
timeList.push(dateType == 1 ? weekStr : e.startDate)
})
let option = {
......@@ -126,20 +111,18 @@ export default {
let [item] = params
if (!item) return
let { dataIndex, axisValue } = item,
{ output, customerPrice, orderNumber, drainageRate, conversionRate } = list[dataIndex]
return `
${dayjs(axisValue).format(allYear ? 'YYYY-MM' : 'YYYY-MM-DD')}<br>
{ value } = list[dataIndex],
title = dayjs(axisValue).format(allYear ? 'YYYY年MM月' : 'MM-DD')
if (dateType == 1) title = axisValue
return `${title}<br>
<div class="tooltips">
<i class="circle"></i>产值:${output?.toLocaleString() || 0}<br>
客单价:${customerPrice?.toLocaleString() || 0}<br>
订单数:${orderNumber || 0}<br>
引流率:${drainageRate || 0}%<br>
转化率:${conversionRate || 0}%</div>`;
<i class="circle"></i>${name}:${value?.toLocaleString() || 0}
</div>`;
}
},
title: {
left: '20',
text: `${pageData.name}趋势图`
text: `${name}趋势图`
},
grid: {
left: 100,
......
......@@ -25,7 +25,7 @@ export const tooltipConfig = {
// }
}
export const xAxisConfig = (params) => {
let { allYear } = params.searchTime,
let { allYear, dateType } = params.searchTime,
xaxis = {
type: 'category',
boundaryGap: false,
......@@ -40,6 +40,7 @@ export const xAxisConfig = (params) => {
formatter: function (value, index) {
let str = ''
str = allYear ? dayjs(value).format('MM月') : dayjs(value).format('MM/DD')
if (dateType == 1) str = value
return str
}
......@@ -55,8 +56,10 @@ export const dataZoomSliderConfig = (params, timeList) => {
left: 100,
right: 100,
labelFormatter (value) {
let { allYear } = params.searchTime
return allYear ? dayjs(timeList[value]).format('YYYY年MM月') : dayjs(timeList[value]).format('YYYY-MM-DD')
let { allYear, dateType } = params.searchTime,
str = allYear ? dayjs(timeList[value]).format('YYYY年MM月') : dayjs(timeList[value]).format('YYYY-MM-DD')
if(dateType == 1) str = timeList[value]
return str
}
}
}
\ No newline at end of file
......@@ -10,7 +10,10 @@
/>
</el-tabs>
<template v-if="activeName == '1'">
<el-button class="edit-board" @click="dialogShow = true">
<el-button
class="edit-board"
@click="dialogShow = true"
>
<span class="el-icon-edit-outline"></span>
编辑指标
</el-button>
......@@ -27,13 +30,14 @@
@openWindow="$emit('openWindow',$event)"
:pageId="i.id"
:search-form="searchForm"
:refreshFlag.sync="i.refreshFlag"
/>
</template>
</div>
<pointer-config
:show.sync="dialogShow"
:scope="1"
@update="$emit('update')"
@update="search"
/>
</div>
</template>
......@@ -76,6 +80,9 @@ export default {
methods: {
search () {
this.$refs[`component-${this.activeName}`][0].search()
this.tabList.map(e => {
if (e.id != this.activeName) e.refreshFlag = true
})
}
}
}
......
<template>
<div class="data-list">
<template v-for="(item,index) in boardList">
<board-item
:key="index"
class="board-item"
:item="item"
:data="boardData"
@click="openWindow(item)"
>
<div class="board-tips">
<el-tooltip placement="top">
<div slot="content">多行信息<br />第二行信息</div>
<div class="board-tips-icon">?</div>
</el-tooltip>
</div>
</board-item>
<div class="data-list-box">
<template v-if="boardList.length">
<div class="data-list">
<template v-for="(item,index) in boardList">
<board-item
:key="index"
class="board-item"
:item="item"
:data="item.data"
@click="openWindow(item)"
>
<div class="board-tips">
<el-tooltip placement="top">
<div slot="content">{{item.definition}}</div>
<div class="board-tips-icon">?</div>
</el-tooltip>
</div>
</board-item>
</template>
</div>
</template>
<template v-else>
<div class="no-data">
暂无数据
</div>
</template>
</div>
</template>
......@@ -32,63 +43,37 @@ export default {
name: '',
data () {
return {
boardData: {
},
boardList: [
{
name: '总产值',
value: 'output',
percent: 'outputRatio',
unit: '(元)'
},
{
name: '客单价',
value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio',
unit: '(元)'
},
{
name: '交车数',
value: 'deliveryNum',
percent: 'deliveryNumRatio',
},
{
name: '触客数',
value: 'touchCustomers',
percent: 'touchCustomersRatio',
},
{
name: '转化数',
value: 'conversionNum',
percent: 'conversionNumRatio',
},
],
boardList: [],
}
},
mounted () {
},
methods: {
async search () {
this.boardList.map((e, index) => {
e.componentName = 'boardDetail'
e.pageId = `data-board-${index}`
e.tabTitle = `${e.name}详情`
})
return
this.boardList = this.$options.data.call(this).boardList
let { businessType } = this.searchForm
const res = await getBoardList({
...this.searchForm
...this.searchForm,
scope: 1
})
res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${e.code}`,
tabTitle: `${e.name}详情`,
definition: e.definition,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio'
})
})
console.log(res)
},
openWindow (e) {
let { businessType } = this.searchForm
console.log(e)
this.$emit('openWindow', {
...e,
businessType
})
this.$emit('openWindow', e)
}
}
}
......@@ -123,4 +108,13 @@ export default {
}
}
}
.no-data {
background: white;
padding: 20px 0;
min-height: 60px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
}
</style>
\ No newline at end of file
......@@ -48,7 +48,7 @@
<script type='text/ecmascript-6'>
import SearchBox from '../SearchBox'
import dataGroup from './dataGroup.vue'
import { listShop4sByRef } from "@api/merchant"
import { listShop4sByRef, getCarBrandList } from "@api/merchant"
export default {
name: '',
components: {
......@@ -108,10 +108,10 @@ export default {
type: 'select',
multiple: true,
isClear: true,
optionList: [
],
optionId: 'value',
optionLabel: 'name',
collapseTags: true,
optionList: [],
optionId: 'id',
optionLabel: 'label',
},
{
label: '门店范围',
......@@ -137,6 +137,7 @@ export default {
},
mounted () {
this.getServiceStore()
this.getCarBrandList()
},
methods: {
getServiceStore (merchantId) {
......@@ -153,12 +154,30 @@ export default {
})
})
},
async getCarBrandList () {
const res = await getCarBrandList({ containsChildren: true }),
brandList = []
console.log(res)
res.map(e => {
if (e && e.children && e.children.length) {
e.children.map(i => {
brandList.push(i)
})
}
})
this.showFormData.map(item => {
if (item.name == 'secondBrandIdList') {
item.optionList = brandList || []
}
})
},
handleReset () {
this.searchForm = this.$options.data.call(this).searchForm
this.$refs.timeRef.handleReset()
this.$nextTick(() => this.search())
},
setTimeData (e) {
delete e.allYear
this.searchForm = {
...this.searchForm,
...e
......
......@@ -10,11 +10,18 @@
ref="table"
:table-params="tableParams"
:tableData="tableData"
:table-total="tableTotal"
:hasPage="false"
:has-num="false"
@pageChange="pageChange"
noDataText="暂无门店数据"
>
<template
slot="sortableHtml"
slot-scope="scope"
>
<div class="sortableHtml">
{{scope.scope[scope.prop]}}
</div>
</template>
<div
slot="auth-button"
slot-scope="scope"
......@@ -31,7 +38,7 @@
<script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin'
import { getBoardMerchantList } from '@api/earlyWarningManager'
import dayjs from 'dayjs'
export default {
mixins: [onShowMixin],
name: '',
......@@ -52,83 +59,92 @@ export default {
tableColumns: [
{
label: '门店名称',
prop: 'merchantName4s',
prop: 'merchantName',
width: '150'
}, {
label: '商户号',
prop: 'merchantId4s',
prop: 'merchantId',
width: '100'
}, {
label: '是否直营',
prop: 'customerName',
formatter (row) {
//直营(0-非直营,1-直营)
return {
0: '非直营',
1: '直营'
}[row.directSale]
}
}, {
label: '展业时间',
prop: 'carModel',
formatter (row) {
return row.startBusiness ? dayjs(row.startBusiness).format('YYYY-MM-DD') : '-'
}
}, {
label: '督导',
width: '130',
width: 'supervisionList',
formatter (row) {
let result = {
1: "成交",
0: "战败"
}[row.receptionStatus]
return result || "-"
return "-"
}
}, {
label: '归属业务',
prop: 'orderFinishFlag',
prop: 'businessType',
width: '130',
formatter (row) {
return row.orderFinishFlag ? '成交' : '战败'
return {
2: '轻改',
3: '权益',
4: '延保',
}[row.businessType]
}
}, {
label: '主营品牌',
prop: "score",
prop: "brandList",
formatter (row) {
return row.score != null ? row.score : '-'
return
}
}, {
label: '业务性质',
prop: "defencePoint",
prop: "businessScenario",
formatter (row) {
return row.defencePoint != null ? row.defencePoint : '-'
return {
1: '直营渠道',
2: '直营4S店',
4: '投资收购-利丰',
5: '投资收购-内蒙古',
6: '服务商投资',
}[row.businessScenario] || '-'
}
}, {
label: '门店范围',
prop: "customerTypeName",
width: '130',
}, {
label: '产值',
width: '150',
prop: "startTime",
sortable:true
prop: "output",
sortable: true,
addHtml: 'sortableHtml'
}, {
label: '订单数',
width: '150',
prop: "endTime",
sortable:true
prop: "orderNumber",
sortable: true,
addHtml: 'sortableHtml'
}, {
label: '客单价',
width: '130',
prop: "seconds",
sortable:true
prop: "customerUnitPrice",
sortable: true,
addHtml: 'sortableHtml'
}, {
label: '渗透率',
prop: "axbOpenFlag",
prop: "penetrationRate",
width: 130,
sortable:true,
formatter (row) {
return row.axbOpenFlag ? "是" : "否"
}
sortable: true,
addHtml: 'sortableHtml'
},
{
label: '触客转化率',
prop: "isFinishFlag",
sortable:true,
prop: "touchConversionRate",
sortable: true,
width: 130,
formatter (row) {
return row.finishFlag ? "是" : "否"
}
addHtml: 'sortableHtml'
}
]
},
......@@ -138,25 +154,25 @@ export default {
},
methods: {
async search () {
return
const { total, list } = await getBoardMerchantList({
...this.page,
this.tableData = []
const res = await getBoardMerchantList({
...this.searchForm
})
this.tableData = list
this.tableTotal = total
console.log(res)
this.tableData = res
// this.tableTotal = total
},
handleDetail (e) {
this.$emit('openWindow', {
...e,
pageId: `merchant-${e.merchantId4s}`,
pageId: `merchant-${e.merchantId}`,
componentName: 'shop-detail',
tabTitle: `${e.merchantName4s}门店详情`,
merchantId: e.merchantId4s,
merchantName: e.merchantName4s
tabTitle: `${e.merchantName}门店详情`,
merchantId: e.merchantId,
merchantName: e.merchantName
})
},
pageChange(e){
pageChange (e) {
this.page = e
this.search()
}
......
......@@ -4,9 +4,10 @@ export default {
initStatus: false,
}
},
props:{
props: {
show: Boolean,
searchForm:Object
searchForm: Object,
refreshFlag: Boolean
},
mounted () {
let search = this.search
......@@ -18,9 +19,10 @@ export default {
show: {
async handler (newVal) {
if (newVal) {
if (!this.initStatus) {
if (!this.initStatus || this.refreshFlag) {
await this.search()
this.initStatus = true
this.$emit('update:refreshFlag', false)
}
}
},
......
export const KpiList = {
'A014': {
}
}
\ No newline at end of file
......@@ -38,7 +38,7 @@
import BoardItem from '../../shopGuardIndex/BoardItem'
import Funnel from './Funnel'
import LineChart from './LineChart'
import { getMerchantBaseDetail } from '@/api/earlyWarningManager'
import { getMerchantBaseDetail, getBoardList } from '@/api/earlyWarningManager'
import onShowMixin from '../onShowMixin'
export default {
mixins: [onShowMixin],
......@@ -53,49 +53,21 @@ export default {
boardData: {
outputTrend: []
},
boardList: [
{
name: '总产值',
value: 'output',
percent: 'outputRatio',
unit: '(元)'
},
{
name: '客单价',
value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio',
unit: '(元)'
},
{
name: '交车数',
value: 'deliveryNum',
percent: 'deliveryNumRatio',
},
{
name: '触客数',
value: 'touchCustomers',
percent: 'touchCustomersRatio',
},
{
name: '转化数',
value: 'conversionNum',
percent: 'conversionNumRatio',
},
],
boardList: [],
}
},
watch: {
pageData: {
handler (newVal) {
let { businessType, merchantId, merchantName } = newVal
this.boardList.map((e, index) => {
e.businessType = businessType
e.componentName = 'boardDetail'
e.pageId = `board-${merchantId}-${index}`
e.tabTitle = `${e.name}(${merchantName})`
})
// let { businessType, merchantId, merchantName } = newVal
// this.boardList.map((e, index) => {
// e.businessType = businessType
// e.componentName = 'boardDetail'
// e.pageId = `board-${merchantId}-${index}`
// e.tabTitle = `${e.name}(${merchantName})`
// })
},
immediate: true,
deep: true
......@@ -117,6 +89,33 @@ export default {
if (res[key] == null) res[key] = '-'
})
this.boardData = res
this.getBoardList()
},
async getBoardList () {
this.boardList = this.$options.data.call(this).boardList
let { merchantId, merchantName, businessType } = this.pageData,
{ searchTime: { startDate, endDate } } = this
const res = await getBoardList({
businessType,
merchantId,
startDate,
endDate,
scope: 2
})
res.map(e => {
this.boardList.push({
componentName: 'boardDetail',
pageId: `board-${e.code}`,
tabTitle: `${e.name}(${merchantName})`,
definition: e.definition,
code: e.code,
name: e.name,
businessType,
data: e,
value: 'value',
percent: 'ratio'
})
})
},
openWindow (e) {
this.$emit('openWindow', e)
......
......@@ -107,48 +107,48 @@ export default {
value: 'output',
percent: 'outputRatio',
unit: '(元)',
queryType: 1
code: 'A014'
},
{
name: '展业门店数',
value: 'storeNum',
percent: 'storeNumRatio',
queryType: 6
code: 'A045'
},
{
name: '客单价',
value: 'customerUnitPrice',
percent: 'customerUnitPriceRatio',
unit: '(元)',
queryType: 2
code: 'A020'
},
{
name: '店均产值',
value: 'storeAverageOutput',
percent: 'storeAverageOutputRatio',
unit: '(元)',
queryType: 7
code: 'A044'
},
{
name: '交车数',
value: 'deliveryNum',
percent: 'deliveryNumRatio',
queryType: 8
code: 'A001'
},
{
name: '触客数',
value: 'touchNum',
percent: 'touchNumRatio',
queryType: 9
code: 'A004'
},
],
timeObject: {}
}
},
mounted () {
this.boardList.map((e, index) => {
this.boardList.map(e => {
e.componentName = 'boardDetail'
e.pageId = `board-${index}`
e.pageId = `board-${e.code}`
e.tabTitle = `${e.name}详情`
})
},
......@@ -177,7 +177,6 @@ export default {
this.$emit('changeBusinessType', this.businessType)
},
openWindow (e) {
console.log(e)
let { businessType } = this
this.$emit('openWindow', {
...e,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!