0302-海宁管户报表优化+客群代码初稿
This commit is contained in:
4
ruoyi-ui/.gitignore
vendored
4
ruoyi-ui/.gitignore
vendored
@@ -21,6 +21,4 @@ selenium-debug.log
|
||||
|
||||
dist.zip
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
|
||||
vue.config.js
|
||||
yarn.lock
|
||||
@@ -14,4 +14,12 @@ export function gridCmpmCustManagerResult(data) {
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取管户报表星级列表
|
||||
export function getCustLevelList() {
|
||||
return request({
|
||||
url: '/grid/cmpm/custManager/custLevel/list',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 统计卡片 -->
|
||||
<div :gutter="24" class="sum-box">
|
||||
<el-card class="box-card">
|
||||
<div class="my-span-checklist-title">
|
||||
总资产余额
|
||||
</div>
|
||||
<div class="my-span-checklist-main">
|
||||
<span>{{ cardInfo.custAumBal }}</span>
|
||||
<span>{{ formatYi(cardInfo.custAumBal) }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
@@ -14,7 +15,7 @@
|
||||
总资产余额较上月变动
|
||||
</div>
|
||||
<div class="my-span-checklist-main">
|
||||
<span>{{ cardInfo.aumBalCompLm }}</span>
|
||||
<span>{{ formatYi(cardInfo.aumBalCompLm) }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
@@ -22,7 +23,7 @@
|
||||
总资产余额月日均
|
||||
</div>
|
||||
<div class="my-span-checklist-main">
|
||||
<span>{{ cardInfo.custAumMonthAvg }}</span>
|
||||
<span>{{ formatYi(cardInfo.custAumMonthAvg) }}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
@@ -66,6 +67,33 @@
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<!-- 搜索区域 -->
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="90px">
|
||||
<el-form-item label="客户星级" prop="custLevel">
|
||||
<el-select v-model="queryParams.custLevel" placeholder="请选择" clearable style="width: 150px">
|
||||
<el-option
|
||||
v-for="level in custLevelOptions"
|
||||
:key="level"
|
||||
:label="level"
|
||||
:value="level"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="星级状态" prop="statusType">
|
||||
<el-select v-model="queryParams.statusType" placeholder="请选择" clearable style="width: 150px">
|
||||
<el-option label="本月" value="current" />
|
||||
<el-option label="上月" value="last" />
|
||||
<el-option label="上升" value="rise" />
|
||||
<el-option label="下降" value="fall" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-card class="header-statics" style="display: none">
|
||||
<ul class="statics-cnt">
|
||||
<li>
|
||||
@@ -122,7 +150,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { gridCmpmCustManagerList, gridCmpmCustManagerResult } from '@/api/gridSearch/accountManageReport/index'
|
||||
import { gridCmpmCustManagerList, gridCmpmCustManagerResult, getCustLevelList } from '@/api/gridSearch/accountManageReport/index'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@@ -137,19 +165,50 @@ import { gridCmpmCustManagerList, gridCmpmCustManagerResult } from '@/api/gridSe
|
||||
},
|
||||
tableData: [],
|
||||
loading: false,
|
||||
custLevelOptions: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
pageSize: 10,
|
||||
custLevel: null,
|
||||
statusType: null
|
||||
},
|
||||
total: 0,
|
||||
topData: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// 从 URL 参数获取筛选条件
|
||||
const { custLevel, statusType } = this.$route.query
|
||||
if (custLevel) {
|
||||
this.queryParams.custLevel = custLevel
|
||||
}
|
||||
if (statusType) {
|
||||
this.queryParams.statusType = statusType
|
||||
}
|
||||
this.loadCustLevelOptions()
|
||||
this.getData()
|
||||
this.getSum()
|
||||
},
|
||||
methods: {
|
||||
/** 加载客户星级选项 */
|
||||
loadCustLevelOptions() {
|
||||
getCustLevelList().then(res => {
|
||||
this.custLevelOptions = res.data || []
|
||||
}).catch(() => {
|
||||
this.custLevelOptions = []
|
||||
})
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getData()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.queryParams.custLevel = null
|
||||
this.queryParams.statusType = null
|
||||
this.handleQuery()
|
||||
},
|
||||
getData() {
|
||||
this.loading = true;
|
||||
gridCmpmCustManagerList(this.queryParams).then(res => {
|
||||
@@ -183,10 +242,21 @@ import { gridCmpmCustManagerList, gridCmpmCustManagerResult } from '@/api/gridSe
|
||||
},
|
||||
toSum(obj) {
|
||||
let sum = 0
|
||||
Object.keys(obj).map(key => {
|
||||
sum = sum + obj[key] * 1
|
||||
Object.keys(obj).forEach(key => {
|
||||
// 只计算2星级及以上的:key中包含"2星"、"3星"、"4星"、"5星"
|
||||
if (key.includes('2星') || key.includes('3星') || key.includes('4星') || key.includes('5星')) {
|
||||
sum += obj[key]
|
||||
}
|
||||
})
|
||||
return sum
|
||||
},
|
||||
/** 格式化为亿元 */
|
||||
formatYi(value) {
|
||||
if (value === null || value === '' || value === undefined) return '-'
|
||||
const num = parseFloat(value)
|
||||
if (isNaN(num)) return '-'
|
||||
// 换算为亿元,保留2位小数
|
||||
return (num / 100000000).toFixed(2) + '亿元'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
</div>
|
||||
<div class="top_num">
|
||||
<span style="font-size: 14px;">较上月变动</span>
|
||||
<span v-if="String(item.inc).includes('-')" style=" font-size: 14px;color: #EF3F35">{{ changeData(item.inc)
|
||||
<span v-if="String(item.inc).includes('-')" style=" font-size: 14px;color: #00B453">{{ changeData(item.inc)
|
||||
}}<i class="el-icon-caret-bottom"></i></span>
|
||||
<span v-else style=" font-size: 14px;color: #00B453">{{ changeData(item.inc) }}<i
|
||||
<span v-else style=" font-size: 14px;color: #EF3F35">{{ changeData(item.inc) }}<i
|
||||
class="el-icon-caret-top"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -30,18 +30,24 @@
|
||||
<div class="vt-main top-vt-main">
|
||||
<div class="top_num">
|
||||
<span>上月值</span>
|
||||
<span style="font-size: 14px;">{{ item.yiAmt }}</span>
|
||||
<span style="font-size: 14px; cursor: pointer; color: #409EFF;" @click="goToCustManager(item.itemNm, 'last')">{{ item.yiAmt }}</span>
|
||||
</div>
|
||||
<div class="top_num">
|
||||
<span>当月值</span>
|
||||
<span style="font-size: 14px;">{{ item.inc }}</span>
|
||||
<span style="font-size: 14px; cursor: pointer; color: #409EFF;" @click="goToCustManager(item.itemNm, 'current')">{{ item.inc }}</span>
|
||||
</div>
|
||||
<div class="top_num">
|
||||
<span style="font-size: 14px;">较上月变动</span>
|
||||
<span v-if="String(item.curAmt).includes('-')" style=" font-size: 14px;color: #EF3F35">{{ item.curAmt
|
||||
}}<i class="el-icon-caret-bottom"></i></span>
|
||||
<span v-else style=" font-size: 14px;color: #00B453">{{ item.curAmt }}<i
|
||||
class="el-icon-caret-top"></i></span>
|
||||
<span v-if="String(item.curAmt).includes('-')"
|
||||
style="font-size: 14px; color: #00B453; cursor: pointer;"
|
||||
@click="goToCustManager(item.itemNm, 'fall')">
|
||||
{{ item.curAmt }}<i class="el-icon-caret-bottom"></i>
|
||||
</span>
|
||||
<span v-else
|
||||
style="font-size: 14px; color: #EF3F35; cursor: pointer;"
|
||||
@click="goToCustManager(item.itemNm, 'rise')">
|
||||
{{ item.curAmt }}<i class="el-icon-caret-top"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -875,6 +881,23 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 跳转到管户报表页面 */
|
||||
goToCustManager(itemNm, statusType) {
|
||||
// 从 itemNm 中提取星级,如 "3星客户" → "3星","基础客户" → "基础"
|
||||
// 使用正则匹配以"星"或"基础"或"长尾"开头的内容
|
||||
let custLevel = itemNm.replace('客户', '').trim()
|
||||
// 如果没有"客户"后缀,直接使用整个名称
|
||||
if (custLevel === itemNm) {
|
||||
custLevel = itemNm
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/gridSearch/accountManageReport',
|
||||
query: {
|
||||
custLevel: custLevel,
|
||||
statusType: statusType
|
||||
}
|
||||
})
|
||||
},
|
||||
getData() {
|
||||
this.loading = true
|
||||
if (this.selectedTab === '3') {
|
||||
|
||||
Reference in New Issue
Block a user