Commit 7da28ed7 by 李伟康

commit 盯防

1 parent 990b91b8
......@@ -207,4 +207,19 @@ export function getPersonStaffReceptionList (data) {
export function getPersonStaffWarning (data) {
data.method = 'dj.riskmanage.api.personefficiency.staffwarning'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-查询登录人指标集合
*/
export function getKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.findAllKpiMetric'
return request(data, RequestMethods.POST)
}
/**
* 店效盯防-修改登录人指标集合
*/
export function updateKpiMetric (data) {
data.method = 'dj.riskmanage.api.kpiMetric.updateKpiMetric'
return request(data, RequestMethods.POST)
}
\ No newline at end of file
......@@ -97,17 +97,20 @@
<el-button
type="text"
@click="hide(scope)"
>{{scope.type == 1?'显示':'隐藏'}}</el-button>
<span
class="icon el-icon-top"
@click="changeSort(scope.$index,0)"
v-if="scope.$index != 0"
></span>
<span
class="icon el-icon-bottom"
@click="changeSort(scope.$index,tableData.length - 1)"
v-if="scope.$index != tableData.length - 1"
></span>
:key="btnKey"
>{{scope.row.hiddenFlag == 1?'显示':'隐藏'}}</el-button>
<template v-if="tableData.length > 1">
<span
class="icon el-icon-top"
@click="changeSort(scope.$index,0)"
v-if="scope.$index != 0"
></span>
<span
class="icon el-icon-bottom"
@click="changeSort(scope.$index,tableData.length - 1)"
v-if="scope.$index != tableData.length - 1"
></span>
</template>
</template>
</el-table-column>
</el-table>
......@@ -117,6 +120,8 @@
<script type='text/ecmascript-6'>
import sortablejs from "sortablejs"
import { getKpiMetric, updateKpiMetric } from '@/api/earlyWarningManager'
export default {
name: '',
props: {
......@@ -124,6 +129,7 @@ export default {
},
data () {
return {
btnKey: Date.now(),
searchValue: '',
dialogShow: false,
dialogConfig: {
......@@ -220,6 +226,11 @@ export default {
this.$emit('update:show', n)
}
},
computed: {
uuid () {
return this.$store.state.d2admin.user.info.detail.uuid
}
},
mounted () {
},
methods: {
......@@ -227,7 +238,14 @@ export default {
this.getDataConfig()
},
async getDataConfig () {
const { searchValue, uuid } = this,
res = await getKpiMetric({
name: searchValue,
uuid
})
console.log(res, '===')
this.$nextTick(() => {
let el = this.$refs.table.$el.querySelector(`.el-table__body-wrapper > table > tbody`)
this.$nextTick(() => {
new sortablejs(el, {
......@@ -242,32 +260,23 @@ export default {
})
},
async handleClick () {
// try {
// let { tableData } = this,
// { targetDate } = this
// tableData.map(e => {
// if (e.isEdit) {
// e.outputTarget = e.origin_outputTarget
// e.grossProfit = e.origin_grossProfit
// e.grossMargin = e.origin_grossMargin
// }
// e.targetDate = targetDate
// })
// const res = await saveOrUpdateDataConfig({
// targetConfigList: tableData
// })
// if (res) {
// this.$message.success('保存成功')
this.dialogShow = false
this.$emit('update')
// }
// } catch (error) {
// if (error) this.$message.error(error)
// }
try {
let userKpiMetricAddRequestDTOS = []
const res = await updateKpiMetric({
userKpiMetricAddRequestDTOS
})
if (res) {
this.$message.success('保存成功')
this.dialogShow = false
// this.$emit('update')
}
} catch (error) {
if (typeof error === 'string') this.$message.error(error)
}
},
hide (scope) {
console.log(scope)
scope.row.hiddenFlag = scope.row.hiddenFlag == 1 ? 0 : 1
this.btnKey = Date.now()
},
changeSort (oldIndex, newIndex) {
this.tableData.splice(newIndex, 0, this.tableData.splice(oldIndex, 1)[0])
......
......@@ -124,7 +124,7 @@ export default {
watch: {
date: {
handler (val) {
if (val.length) {
if (val && val.length) {
let [startDate, endDate] = val
let dayNum = dayjs(endDate).diff(dayjs(startDate), 'day') + 1
if (dayNum <= 7) {
......@@ -178,17 +178,22 @@ export default {
// + (type == 'start' ? ' 00:00:00' : ' 23:59:59')
},
changeDate (e) {
let [startDate, endDate] = e
const date1 = dayjs(startDate),
date2 = dayjs(endDate),
day = date2.diff(date1, 'day') + 1
if (day > 93) {
this.$message.error('自定义时间范围限制为93天')
return
if (e && e.length) {
let [startDate, endDate] = e
const date1 = dayjs(startDate),
date2 = dayjs(endDate),
day = date2.diff(date1, 'day') + 1
if (day > 93) {
this.$message.error('自定义时间范围限制为93天')
return
}
this.form.dateType = ''
this.$emit('search', this.getSearchTime())
} else {
this.form = this.$options.data.call(this).form
this.search()
}
this.form.dateType = ''
this.$emit('search', this.getSearchTime())
},
search (e) {
let { form: {
......@@ -219,7 +224,7 @@ export default {
},
startDate = '',
endDate = ''
if (date.length) {
if (date && date.length) {
startDate = this.formatDate(date[0])
endDate = this.formatDate(date[1])
} else {
......@@ -229,14 +234,14 @@ export default {
endDate = dateItem.endDate
}
}
if(this.hasStatisticalPeriod){
if (this.hasStatisticalPeriod) {
console.log(this.statisticalPeriod)
}
params.startDate = startDate
params.endDate = endDate
return params
},
handleReset(){
handleReset () {
this.form = this.$options.data.call(this).form
this.search('dateType')
}
......
......@@ -42,13 +42,13 @@ export default {
type: Object,
default: () => { }
},
show:Boolean
show: Boolean
},
data () {
return {
chart: null,
searchTime: {},
dialogShow:false
dialogShow: false
}
},
computed: {
......@@ -56,7 +56,7 @@ export default {
return this.pageData.businessType
}
},
watch:{
watch: {
businessType: {
handler (newVal) {
if (this.show) {
......
......@@ -6,6 +6,7 @@
class="board-item"
:item="item"
:data="boardData"
@click="openWindow(item)"
>
<div class="board-tips">
<el-tooltip placement="top">
......@@ -68,6 +69,18 @@ export default {
methods: {
search () {
console.log(this.searchForm, 'list')
this.boardList.map((e, index) => {
e.componentName = 'boardDetail'
e.pageId = `board-${index}`
e.tabTitle = `${e.name}详情`
})
},
openWindow (e) {
let { businessType } = this.searchForm
this.$emit('openWindow', {
...e,
businessType
})
}
}
}
......@@ -82,12 +95,12 @@ export default {
.board-item {
border-radius: 4px;
background: #f8faff;
cursor: pointer;
}
.board-tips {
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
&-icon {
width: 14px;
height: 14px;
......
......@@ -189,7 +189,10 @@ export default {
.radio-group {
width: fit-content;
flex-shrink: 0;
margin-left: 17px;
margin-right: 8px;
}
.date-picker {
width: 217px;
}
}
}
......
......@@ -13,6 +13,7 @@
:table-total="tableTotal"
:has-num="false"
@pageChange="pageChange"
noDataText="暂无门店数据"
>
<div
slot="auth-button"
......
......@@ -8,6 +8,7 @@
class="board-item"
:item="item"
:data="boardData"
@click="openWindow(item)"
/>
</template>
</div>
......@@ -82,10 +83,26 @@ export default {
percent: 'conversionNumRatio',
},
],
}
},
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})`
})
},
immediate: true,
deep: true
}
},
mounted () {
},
methods: {
async getData () {
......@@ -100,6 +117,9 @@ export default {
if (res[key] == null) res[key] = '-'
})
this.boardData = res
},
openWindow (e) {
this.$emit('openWindow', e)
}
}
}
......@@ -119,6 +139,7 @@ export default {
gap: 0 16px;
padding: 0 20px 20px;
.board-item {
cursor: pointer;
height: 163px;
border-radius: 4px;
background: #f8faff;
......
......@@ -177,6 +177,7 @@ 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!