Commit 751a0a30 by 李伟康

commit 盯防

1 parent 7da28ed7
...@@ -222,4 +222,28 @@ export function getKpiMetric (data) { ...@@ -222,4 +222,28 @@ export function getKpiMetric (data) {
export function updateKpiMetric (data) { export function updateKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateKpiMetric' data.method = 'dj.riskmanage.api.kpiMetric.updateKpiMetric'
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
}
/**
* 店效盯防-更多看板-数据指标
*/
export function getBoardList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.notice.board.items.detail'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-更多看板-门店列表
*/
export function getBoardMerchantList (data) {
data.method = 'dj.api.smartcarlife.risk.manage.notice.board.merchant.list'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-指标详情(趋势图)
*/
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 \ No newline at end of file
...@@ -6,7 +6,10 @@ ...@@ -6,7 +6,10 @@
class="dialog" class="dialog"
@handleClick="handleClick" @handleClick="handleClick"
> >
<div class="dialog-content"> <div
class="dialog-content"
v-loading="loading"
>
<div class="search-box"> <div class="search-box">
<div class="label">指标名称:</div> <div class="label">指标名称:</div>
<el-input <el-input
...@@ -14,11 +17,13 @@ ...@@ -14,11 +17,13 @@
size="small" size="small"
maxlength="10" maxlength="10"
v-model="searchValue" v-model="searchValue"
clearable
></el-input> ></el-input>
<el-button <el-button
class="btn" class="btn"
type="primary" type="primary"
size="small" size="small"
@click="getDataConfig"
>查询</el-button> >查询</el-button>
</div> </div>
<el-table <el-table
...@@ -33,6 +38,7 @@ ...@@ -33,6 +38,7 @@
class-name="draggable-icon" class-name="draggable-icon"
width="40" width="40"
align="center" align="center"
v-if="!searchFlag"
> >
<div class="icon"></div> <div class="icon"></div>
</el-table-column> </el-table-column>
...@@ -40,6 +46,7 @@ ...@@ -40,6 +46,7 @@
type="index" type="index"
width="60" width="60"
align="center" align="center"
v-if="!searchFlag"
> >
</el-table-column> </el-table-column>
<template v-for="(item,index) in tableParams.tableColumns"> <template v-for="(item,index) in tableParams.tableColumns">
...@@ -52,29 +59,7 @@ ...@@ -52,29 +59,7 @@
:key="index" :key="index"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<div <template v-if="item.formatter">
v-if="item.addHtml"
class="input-box"
>
<template v-if="scope.row.isEdit">
<el-input
v-model="scope.row[item.addHtml]"
:maxlength="item.maxlength"
:placeholder="item.placeholder"
:ref="`${scope.row.id}`"
size="mini"
:class="scope.row.className"
@blur="handleInput($event, scope.row, item)"
></el-input>
</template>
<template v-else>
{{ scope.row[item.addHtml]?scope.row[item.addHtml].toLocaleString() : ''}}
</template>
<template v-if="item.unit">
<div class="unit">{{item.unit}}</div>
</template>
</div>
<template v-else-if="item.formatter">
<span <span
v-if="item.html" v-if="item.html"
v-html="item.formatter(scope.row)" v-html="item.formatter(scope.row)"
...@@ -99,7 +84,7 @@ ...@@ -99,7 +84,7 @@
@click="hide(scope)" @click="hide(scope)"
:key="btnKey" :key="btnKey"
>{{scope.row.hiddenFlag == 1?'显示':'隐藏'}}</el-button> >{{scope.row.hiddenFlag == 1?'显示':'隐藏'}}</el-button>
<template v-if="tableData.length > 1"> <template v-if="tableData.length > 1 && !searchFlag">
<span <span
class="icon el-icon-top" class="icon el-icon-top"
@click="changeSort(scope.$index,0)" @click="changeSort(scope.$index,0)"
...@@ -125,11 +110,13 @@ import { getKpiMetric, updateKpiMetric } from '@/api/earlyWarningManager' ...@@ -125,11 +110,13 @@ import { getKpiMetric, updateKpiMetric } from '@/api/earlyWarningManager'
export default { export default {
name: '', name: '',
props: { props: {
show: Boolean show: Boolean,
scope: Number
}, },
data () { data () {
return { return {
btnKey: Date.now(), btnKey: Date.now(),
loading: true,
searchValue: '', searchValue: '',
dialogShow: false, dialogShow: false,
dialogConfig: { dialogConfig: {
...@@ -146,79 +133,31 @@ export default { ...@@ -146,79 +133,31 @@ export default {
width: "1080px" width: "1080px"
} }
}, },
tableData: [ tableData: [],
{
id: 1,
businessType: 4,
outputTarget: '1',
grossProfit: '',
grossMargin: ''
},
{
id: 2,
businessType: 3,
outputTarget: '2',
grossProfit: '',
grossMargin: ''
},
{
id: 3,
businessType: 2,
outputTarget: '3',
grossProfit: '',
grossMargin: ''
}
],
tableParams: { tableParams: {
tableOption: { tableOption: {
width: '100' width: '100'
}, },
tableColumns: [ tableColumns: [
{ {
label: '业务类型',
minWidth: 110, minWidth: 110,
formatter: (cellValue) => { prop: 'name'
return {
2: '轻改',
3: '权益',
4: '延保'
}[cellValue.businessType]
},
},
{
label: '产值目标',
addHtml: 'outputTarget',
minWidth: 135,
maxlength: 10,
placeholder: '请输入',
max: 9999999999
},
{
label: '毛利润',
addHtml: 'grossProfit',
minWidth: 135,
maxlength: 10,
placeholder: '请输入',
max: 9999999999
}, },
{ {
label: '毛利润率',
addHtml: 'grossMargin',
unit: '%',
minWidth: 135, minWidth: 135,
maxlength: 5, prop: 'definition'
placeholder: '请输入',
max: 100,
decimals: true
}, },
] ]
}, },
searchFlag: false
} }
}, },
watch: { watch: {
show (n) { show (n) {
this.dialogShow = n this.dialogShow = n
if (n) { if (n) {
this.tableData = []
this.searchValue = ''
this.init() this.init()
} }
}, },
...@@ -238,32 +177,51 @@ export default { ...@@ -238,32 +177,51 @@ export default {
this.getDataConfig() this.getDataConfig()
}, },
async getDataConfig () { async getDataConfig () {
const { searchValue, uuid } = this, try {
res = await getKpiMetric({ const { searchValue, uuid, scope } = this,
name: searchValue, res = await getKpiMetric({
uuid scope,
}) name: searchValue,
console.log(res, '===') uuid
this.$nextTick(() => { })
this.searchFlag = searchValue ? true : false
let el = this.$refs.table.$el.querySelector(`.el-table__body-wrapper > table > tbody`) this.tableData = res || []
console.log(res, '===')
this.loading = false
this.$nextTick(() => { this.$nextTick(() => {
new sortablejs(el, {
handle: '.draggable-icon', let el = this.$refs.table.$el.querySelector(`.el-table__body-wrapper > table > tbody`)
ghostClass: "sortable-drag", this.$nextTick(() => {
onEnd: (e) => { new sortablejs(el, {
const { oldIndex, newIndex } = e handle: '.draggable-icon',
this.changeSort(oldIndex, newIndex) ghostClass: "sortable-drag",
} onEnd: (e) => {
const { oldIndex, newIndex } = e
this.changeSort(oldIndex, newIndex)
}
})
}) })
}) })
}) } catch (error) {
this.loading = false
}
}, },
async handleClick () { async handleClick () {
try { try {
let userKpiMetricAddRequestDTOS = [] let userKpiMetricAddRequestDTOS = [],
{ scope, tableData, uuid, searchFlag } = this
tableData.map((e, index) => {
userKpiMetricAddRequestDTOS.push({
id: e.id,
loginUuid: uuid,
sort: searchFlag ? e.defaultSortOrder : index + 1,
hiddenFlag: e.hiddenFlag
})
})
console.log(userKpiMetricAddRequestDTOS, '-------')
const res = await updateKpiMetric({ const res = await updateKpiMetric({
userKpiMetricAddRequestDTOS userKpiMetricAddRequestDTOS,
scope
}) })
if (res) { if (res) {
this.$message.success('保存成功') this.$message.success('保存成功')
...@@ -287,8 +245,13 @@ export default { ...@@ -287,8 +245,13 @@ export default {
<style scoped lang='scss'> <style scoped lang='scss'>
.dialog { .dialog {
::v-deep.el-dialog__body {
max-height: 60vh !important;
overflow-y: auto;
}
&-content { &-content {
padding: 5px 0; // padding: 5px 0;
.search-box { .search-box {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,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' import { getMerchantOutputDetail, getBoardDetail } from '@api/earlyWarningManager'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig' import { tooltipConfig, xAxisConfig, dataZoomSliderConfig } from '../chartConfig'
...@@ -54,13 +54,16 @@ export default { ...@@ -54,13 +54,16 @@ export default {
computed: { computed: {
businessType () { businessType () {
return this.pageData.businessType return this.pageData.businessType
},
queryType () {
return this.pageData.queryType
} }
}, },
watch: { watch: {
businessType: { businessType: {
handler (newVal) { handler (newVal) {
if (this.show) { if (this.show) {
if (newVal && this.initStatus) this.getMerchantOutputDetail() if (newVal && this.initStatus) this.getData()
} else this.initStatus = false } else this.initStatus = false
} }
} }
...@@ -71,20 +74,28 @@ export default { ...@@ -71,20 +74,28 @@ export default {
methods: { methods: {
async getBoardData (params) { async getBoardData (params) {
this.searchTime = params this.searchTime = params
this.getMerchantOutputDetail() this.getData()
this.initStatus = true this.initStatus = true
}, },
async getMerchantOutputDetail () { async getData () {
let { queryType } = this.pageData, let { searchTime, businessType, queryType } = this
{ searchTime, businessType } = this
const res = await getMerchantOutputDetail({
businessType,
queryType,
...searchTime
})
this.chart = echarts.init(document.getElementById(this.pageData.pageId)) this.chart = echarts.init(document.getElementById(this.pageData.pageId))
this.drawChart(res, queryType) if (queryType) {
const res = await getMerchantOutputDetail({
businessType,
queryType,
...searchTime
})
this.drawChart(res, queryType)
} else {
const { merchantId } = this.pageData,
res = await getBoardDetail({
businessType,
merchantId,
...searchTime
})
console.log(res, 'lll')
}
}, },
drawChart (list, queryType) { drawChart (list, queryType) {
this.chart.clear() this.chart.clear()
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
</div> </div>
<pointer-config <pointer-config
:show.sync="dialogShow" :show.sync="dialogShow"
:scope="1"
@update="$emit('update')" @update="$emit('update')"
/> />
</div> </div>
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin' import onShowMixin from './onShowMixin'
import BoardItem from '../shopGuardIndex/BoardItem' import BoardItem from '../shopGuardIndex/BoardItem'
import { getBoardList } from '@api/earlyWarningManager'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
components: { components: {
...@@ -67,16 +69,22 @@ export default { ...@@ -67,16 +69,22 @@ export default {
mounted () { mounted () {
}, },
methods: { methods: {
search () { async search () {
console.log(this.searchForm, 'list')
this.boardList.map((e, index) => { this.boardList.map((e, index) => {
e.componentName = 'boardDetail' e.componentName = 'boardDetail'
e.pageId = `board-${index}` e.pageId = `data-board-${index}`
e.tabTitle = `${e.name}详情` e.tabTitle = `${e.name}详情`
}) })
return
const res = await getBoardList({
...this.searchForm
})
console.log(res)
}, },
openWindow (e) { openWindow (e) {
let { businessType } = this.searchForm let { businessType } = this.searchForm
console.log(e)
this.$emit('openWindow', { this.$emit('openWindow', {
...e, ...e,
businessType businessType
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:form-data="showFormData" :form-data="showFormData"
label-width="100px" label-width="100px"
> >
<template slot="time"> <template slot="dateGroup">
<search-box <search-box
ref="timeRef" ref="timeRef"
class="search-box" class="search-box"
...@@ -60,8 +60,8 @@ export default { ...@@ -60,8 +60,8 @@ export default {
loading: false, loading: false,
searchForm: { searchForm: {
businessType: 4, businessType: 4,
businessNature: '', businessScenarioList: [],
carBrand: '', secondBrandIdList: [],
merchantRange: 1, merchantRange: 1,
// merchantId: '', // merchantId: '',
...@@ -84,7 +84,7 @@ export default { ...@@ -84,7 +84,7 @@ export default {
}, },
{ {
label: '业务性质', label: '业务性质',
name: 'businessNature', name: 'businessScenarioList',
type: 'select', type: 'select',
multiple: true, multiple: true,
isClear: true, isClear: true,
...@@ -100,17 +100,15 @@ export default { ...@@ -100,17 +100,15 @@ export default {
optionLabel: 'confName', optionLabel: 'confName',
}, },
{ {
addHtml: 'time' addHtml: 'dateGroup'
}, },
{ {
label: '主营品牌', label: '主营品牌',
name: 'carBrand', name: 'secondBrandIdList',
type: 'select', type: 'select',
multiple: true,
isClear: true, isClear: true,
optionList: [ optionList: [
{ value: 2, name: '轻改' },
{ value: 3, name: '权益' },
{ value: 4, name: '延保' },
], ],
optionId: 'value', optionId: 'value',
optionLabel: 'name', optionLabel: 'name',
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import onShowMixin from './onShowMixin' import onShowMixin from './onShowMixin'
import { warningMsgDetailListWithPage } from '@api/earlyWarningManager' import { getBoardMerchantList } from '@api/earlyWarningManager'
export default { export default {
mixins: [onShowMixin], mixins: [onShowMixin],
...@@ -100,19 +100,23 @@ export default { ...@@ -100,19 +100,23 @@ export default {
}, { }, {
label: '产值', label: '产值',
width: '150', width: '150',
prop: "startTime" prop: "startTime",
sortable:true
}, { }, {
label: '订单数', label: '订单数',
width: '150', width: '150',
prop: "endTime" prop: "endTime",
sortable:true
}, { }, {
label: '客单价', label: '客单价',
width: '130', width: '130',
prop: "seconds", prop: "seconds",
sortable:true
}, { }, {
label: '渗透率', label: '渗透率',
prop: "axbOpenFlag", prop: "axbOpenFlag",
width: 130, width: 130,
sortable:true,
formatter (row) { formatter (row) {
return row.axbOpenFlag ? "是" : "否" return row.axbOpenFlag ? "是" : "否"
} }
...@@ -120,6 +124,7 @@ export default { ...@@ -120,6 +124,7 @@ export default {
{ {
label: '触客转化率', label: '触客转化率',
prop: "isFinishFlag", prop: "isFinishFlag",
sortable:true,
width: 130, width: 130,
formatter (row) { formatter (row) {
return row.finishFlag ? "是" : "否" return row.finishFlag ? "是" : "否"
...@@ -133,9 +138,10 @@ export default { ...@@ -133,9 +138,10 @@ export default {
}, },
methods: { methods: {
async search () { async search () {
const { total, list } = await warningMsgDetailListWithPage({ return
const { total, list } = await getBoardMerchantList({
...this.page, ...this.page,
monitorType: 2, // 预警数据 1.员工 2.门店 ...this.searchForm
}) })
this.tableData = list this.tableData = list
this.tableTotal = total this.tableTotal = total
......
...@@ -101,6 +101,7 @@ ...@@ -101,6 +101,7 @@
></quality-detail> ></quality-detail>
<pointer-config <pointer-config
:show.sync="dialogShow" :show.sync="dialogShow"
:scope="2"
@update="$emit('update')" @update="$emit('update')"
/> />
</div> </div>
......
...@@ -124,7 +124,7 @@ export default { ...@@ -124,7 +124,7 @@ export default {
} else this.$router.go(-1) } else this.$router.go(-1)
}, },
openWindow (data) { openWindow (data) {
// console.log(data) console.log(data)
// data.merchantId = 44211895 // data.merchantId = 44211895
// data.merchantId = 44210895 // data.merchantId = 44210895
// data.merchantId = 44209510 // data.merchantId = 44209510
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!