Commit 7da28ed7 by 李伟康

commit 盯防

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