黔西南积分

This commit is contained in:
liuye
2023-01-03 11:54:23 +08:00
parent e19b9bcc4a
commit 1a9be3bc1a
6 changed files with 802 additions and 775 deletions

View File

@@ -8,7 +8,7 @@
<span v-for="(item,index) in timeCheck" :key="index" :class="type == index? 'active':''"
@click="timeChange(index)">{{ item }}</span>
</div>
<el-cascader ref="cascader1" v-model="girdArr" :options="girdOptions" placeholder="所属网格" size="small"
<el-cascader ref="cascader1" v-model="girdArr" :options="girdOptions" placeholder="所属部门" size="small"
:props="defaultProps" :show-all-levels="false" @change="gridChange" clearable></el-cascader>
</div>
</div>
@@ -22,11 +22,11 @@
<i class="el-icon-warning-outline"></i>
</el-tooltip>
</h2>
<p class="color1">{{ data.nowIntegral || 0 }}</p>
<p class="color1">{{ data['积分余额汇总'] }}</p>
</div>
<div class="card">
<h2>发放积分</h2>
<p class="color1">{{ data.addIntegral || 0 }}</p>
<p class="color1">{{ data['发放积分'] }}</p>
</div>
<div class="card">
<h2>消耗积分</h2>
@@ -42,7 +42,7 @@
</div>
</div>
<div class="right_Box">
<p>网格积分排行</p>
<p>部门积分排行</p>
<div>
<div id="chart2" style="height: 300px; width: 100%;" v-show="girdSortListX.length && girdSortListY.length"></div>
<ai-empty v-show="!girdSortListX.length && !girdSortListY.length" style="height: 200px; width: 100%;" id="empty"></ai-empty>
@@ -56,40 +56,22 @@
<template #content>
<ai-search-bar>
<template #left>
<el-cascader ref="cascader2" v-model="girdIdArr" :options="girdOptions" placeholder="所属网格" size="small"
<el-cascader ref="cascader2" v-model="girdIdArr" :options="girdOptions" placeholder="所属部门" size="small"
:props="defaultProps" :show-all-levels="false" clearable @change="gridChangeOpt"></el-cascader>
<ai-select v-model="search.integralType" placeholder="请选择类型" @change="current=1, getTableData()"
:selectList="dict.getDict('integralType')"/>
<ai-select v-model="search.scoreType" placeholder="请选择类型" @change="current=1, getTableData()"
:selectList="dict.getDict('srScoreType')"/>
<el-date-picker v-model="time" size="small" type="daterange" value-format="yyyy-MM-dd"
range-separator="" start-placeholder="开始日期" end-placeholder="结束日期" @change="onChange">
</el-date-picker>
</template>
<template #right>
<el-input size="small" placeholder="请输入姓名" v-model="search.userName" clearable
@clear="current = 1, search.userName = '', getTableData()" suffix-icon="iconfont iconSearch"
<el-input size="small" placeholder="请输入姓名" v-model="search.name" clearable
@clear="current = 1, search.name = '', getTableData()" suffix-icon="iconfont iconSearch"
v-throttle="() => {(current = 1), getTableData();}" />
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="total" :current.sync="current" :size.sync="size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="eventDesc" label='事件' align="center" width="400px" show-overflow-tooltip>
<template slot-scope="{ row }">
<span v-if="row.integralRuleId">{{ row.integralRuleName }}</span>
<span v-else>{{ row.eventDesc }}</span>
</template>
</el-table-column>
<el-table-column slot="integralType" label="类型" align="center">
<template slot-scope="{ row }">
<span v-if="row.integralRuleId">{{ row.eventType }}</span>
<span v-else>{{ row.integralRuleName }}</span>
</template>
</el-table-column>
<el-table-column slot="changeIntegral" label="积分变动" align="center">
<template slot-scope="{ row }">
<span v-if="row.integralType == 3">{{ row.changeIntegral | formatTime }}</span>
<span v-if="row.integralType == 0">{{ row.integralCalcType == 0 ? '-' : '+' }}{{ row.changeIntegral }}</span>
</template>
</el-table-column>
<el-table-column slot="options" label="操作" align="center">
<template slot-scope="{ row }">
<el-button type="text" @click="open(row.id)">详情</el-button>
@@ -103,20 +85,12 @@
<ai-detail>
<template #content>
<ai-wrapper>
<ai-info-item label="姓名" :value="details.integralUserName" />
<ai-info-item label="所属网格" :value="details.girdName"/>
<ai-info-item label="事件" isLine :value="details.eventDesc">
<span v-if="details.integralRuleId">{{ details.integralRuleName }}</span>
<span v-else>{{ details.eventDesc }}</span>
</ai-info-item>
<ai-info-item label="姓名" :value="details.name" />
<ai-info-item label="所属部门" :value="details.departName"/>
<ai-info-item label="事件" isLine :value="details.eventDesc"></ai-info-item>
<ai-info-item label="时间" isLine :value="details.createTime"/>
<ai-info-item label="积分变动" v-if="details.integralType == 3">
{{ details.changeIntegral | formatTime }}
</ai-info-item>
<ai-info-item label="积分变动" v-if="details.integralType == 0">
{{ details.changeIntegral > 0 ? '+' : '-' }}{{ details.changeIntegral }}
</ai-info-item>
<ai-info-item label="积分余额" :value="details.nowIntegral"/>
<ai-info-item label="变动积分" :value="details.changeScore"/>
<ai-info-item label="积分余额" :value="details.nowScore"/>
<ai-info-item label="凭证" isLine v-if="fileDownLoad.length">
<ai-file-list :fileList="fileDownLoad" style="width: 200px;" :fileOps="{name: 'name'}"></ai-file-list>
</ai-info-item>
@@ -156,9 +130,9 @@ export default {
tableData: [],
search: {
current: 1,
userName: '',
girdId: '',
integralType: '',
name: '',
departId: '',
scoreType: '',
startTime: '',
endTime: '',
},
@@ -180,7 +154,7 @@ export default {
girdArr: [],
girdOptions: [],
defaultProps: {
label: 'girdName',
label: 'name',
value: 'id',
children: 'children',
checkStrictly: true,
@@ -197,24 +171,23 @@ export default {
...mapState(['user']),
colConfigs() {
return [
{ prop: "integralUserName", label: '姓名', align: "left", width: "200px" },
{ prop: "girdName", label: '所属网格', align: "center", width: "180px" },
{ slot: "eventDesc"},
{ slot: "integralType", label: '类型' },
{ slot: "changeIntegral", label: '积分变动', align: "center", },
{ prop: "nowIntegral", label: '剩余积分', align: "center", },
{ prop: "name", label: '姓名', align: "left", width: "200px" },
{ prop: "departName", label: '所属部门', align: "center", width: "180px" },
{ prop: "eventDesc", label: '事件', align: "center",'show-overflow-tooltip': true},
{ prop: "scoreType", label: '类型', align: "center", width: "240px", dict: "srScoreType"},
{ slot: "changeScore", label: '变动积分', align: "center", },
{ prop: "nowScore", label: '剩余积分', align: "center", },
{ prop: "createTime", label: '时间', align: "center", },
{ slot: "options" }
{ slot: "options" },
]
}
},
created() {
this.time = [dayjs().subtract(7,'week').format('YYYY-MM-DD'),dayjs().format('YYYY-MM-DD')]
this.getTableData()
this.$dict.load('epidemicDangerousAreaLevel','integralType','integralRuleEvent','integralRuleEventType').then(() => {
this.$dict.load('epidemicDangerousAreaLevel','integralType','integralRuleEvent','integralRuleEventType', 'srScoreType').then(() => {
this.getStatistics()
this.getGridList()
this.getRanking()
this.search.startTime = this.time?.[0]
this.search.endTime = this.time?.[1]
this.getTableData()
@@ -223,48 +196,35 @@ export default {
methods: {
// 统计接口
getStatistics() {
this.instance.post('/app/appintegraluser/allGirdIntegral',null, {
this.instance.post('/app/appscoredetail/totalityStatistics',null, {
params: {
type: this.type,
girdId: this.girdId,
departId: this.girdId,
startTime: this.startTime,
endTime: this.endTime,
}
}).then(res => {
if(res?.data) {
this.data = res.data
}
})
},
// 人员、网格排行
getRanking() {
this.instance.post('/app/appintegraluser/userAndGirdIntegralSort',null,{
params: {
type: this.type,
girdId: this.girdId,
startTime: this.startTime,
endTime: this.endTime
}
}).then((res) => {
if(res?.data) {
this.userSortListX = res.data.userSortList.map(e=> e.userName).reverse()
this.userSortListY = res.data.userSortList.map(e=> e.changeIntegral).reverse()
this.girdSortListX = res.data.girdSortList.map(e=> e.girdName).reverse()
this.girdSortListY = res.data.girdSortList.map(e=> e.changeIntegral).reverse()
this.userSortListX = res.data.userSortList.map(e=> e.name).reverse()
this.userSortListY = res.data.userSortList.map(e=> e.score).reverse()
this.girdSortListX = res.data.departSortList.map(e=> e.name).reverse()
this.girdSortListY = res.data.departSortList.map(e=> e.score).reverse()
this.getColEcherts1(this.userSortListX,this.userSortListY)
this.getColEcherts2(this.girdSortListX,this.girdSortListY)
}
})
},
// 积分明细
getTableData() {
this.instance.post('/app/appintegraluser/girdIntegralDetail',null,{
this.instance.post('/app/appscoredetail/list',null,{
params: {
...this.search,
current: this.current,
size: this.size,
total: this.total,
departId: this.search.girdId
}
}).then(res => {
if(res?.data) {
@@ -419,11 +379,10 @@ export default {
this.girdId = val?.[val.length - 1]
this.$refs.cascader1.dropDownVisible = false;
this.getStatistics()
this.getRanking()
},
// 所有网格
getGridList() {
this.instance.post(`/app/appgirdinfo/listAll3`).then((res) => {
this.instance.post(`/app/wxcp/wxdepartment/listAll`).then((res) => {
if (res?.code == 0) {
this.girdOptions = this.toTree(res.data)
}
@@ -441,7 +400,7 @@ export default {
map[item.id] = item;
});
data.forEach(item => {
let parent = map[item.parentGirdId];
let parent = map[item.parentid];
if (parent) {
(parent.children || (parent.children = [])).push(item);
} else {
@@ -457,7 +416,6 @@ export default {
}
this.type = index
this.getStatistics()
this.getRanking()
},
open(id) {
@@ -472,7 +430,7 @@ export default {
},
getDetail(id) {
this.instance.post(`/app/appintegraldetail/queryDetailById?id=${id}`).then(res=> {
this.instance.post(`/app/appscoredetail/queryDetailById?id=${id}`).then(res=> {
if(res?.data) {
this.details = res.data
if(res.data.enclosure) {
@@ -494,7 +452,6 @@ export default {
this.endTime = this.timeList?.[1]
this.dialogDate = false
this.getStatistics()
this.getRanking()
},
},