居民积分

This commit is contained in:
yanran200730
2023-04-06 10:32:25 +08:00
parent 46f49f4686
commit 8288b7d26a
5 changed files with 761 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
<template>
<div class="AppActivitiesManagement">
<keep-alive :include="['List']">
<component ref="component" :is="component" :permissions="permissions " @change="onChange" :params="params" :instance="instance" :dict="dict"></component>
</keep-alive>
</div>
</template>
<script>
import List from './components/List'
import Detail from './components/Detail'
export default {
name: 'AppResidentIntegrating',
label: '居民积分',
props: {
instance: Function,
dict: Object,
permissions: Function
},
data () {
return {
component: 'List',
params: {},
include: []
}
},
components: {
List,
Detail
},
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
if (data.type === 'List') {
this.component = 'List'
this.params = data.params
this.$nextTick(() => {
if (data.isRefresh) {
this.$refs.component.getList()
}
})
}
}
}
}
</script>
<style lang="scss">
.AppActivitiesManagement {
height: 100%;
background: #F3F6F9;
overflow: auto;
}
</style>

View File

@@ -0,0 +1,140 @@
<template>
<ai-detail>
<template slot="title">
<ai-title title="详情" isShowBack isShowBottomBorder @onBackClick="cancel(false)">
</ai-title>
</template>
<template slot="content">
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="120px">
<ai-info-item label="姓名" isLine :value="info.userName"></ai-info-item>
<ai-info-item label="个人积分" isLine :value="info.integral || 0"></ai-info-item>
<ai-info-item label="已用积分" isLine :value="info.usedIntegral || 0"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card>
<ai-title slot="title" title="余额变动明细"/>
<template #content>
<ai-search-bar>
<template #left>
<ai-select v-model="search.type" placeholder="请选择类型" @change="search.current = 1, getList()" :selectList="dict.getDict('integralType')"/>
</template>
<template #right>
<ai-download
:instance="instance"
:url="`/app/appintegraluser/changeIntegralExport?id=${params.id}`"
:params="search"
fileName="余额变动明细"
:disabled="tableData.length == 0">
<el-button size="small">导出</el-button>
</ai-download>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :total="total" :current.sync="search.current" :size.sync="search.size"
@getList="getList" :col-configs="colConfigs" :dict="dict">
<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.integralType == 2">{{ row.integralCalcType == 0 ? '-' : '+' }}{{ row.changeIntegral }}</span>
</template>
</el-table-column>
<el-table-column slot="integralType" label="类型" align="center">
<template slot-scope="{ row }">
<span v-if="row.integralType == 0">积分调整</span>
<span v-else>{{ row.eventType }}</span>
</template>
</el-table-column>
<el-table-column slot="eventDesc" label='事件' align="center" width="400px" show-overflow-tooltip>
<template slot-scope="{ row }">
<span>{{ row.eventDesc || row.eventName }}</span>
</template>
</el-table-column>
</ai-table>
</template>
</ai-card>
</template>
</ai-detail>
</template>
<script>
export default {
name: 'Detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data () {
return {
info: {},
id: '',
search: {
current: 1,
size: 10,
type: ''
},
total: 0,
tableData: []
}
},
computed: {
colConfigs() {
return [
{prop: "doTime", label: '时间', align: "left", width: "200px"},
{slot: "integralType", label: '类型', align: "center", width: "240px", dict: "integralType"},
{slot: "changeIntegral"},
{prop: "nowIntegral", label: '剩余积分', align: "center", width: "200px"},
{slot: "eventDesc"},
]
}
},
created () {
console.log(this.params.id)
this.dict.load('integralType').then(() => {
this.getInfo()
this.getList()
})
},
methods: {
getInfo (id) {
this.instance.post(`/app/appintegraluser/girdDetail?id=${this.params.id}`).then(res => {
if (res.code === 0) {
this.info = res.data
}
})
},
getList () {
this.instance.post(`/app/appintegraluser/getChangeDetail`, null, {
params: {
...this.search,
id: this.params.id
}
}).then(res => {
if (res.code === 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,139 @@
<template>
<ai-list class="notice">
<ai-title slot="title" title="居民积分" v-model="search.areaId" isShowBottomBorder isShowArea :hideLevel="hideLevel - 1" @change="search.current = 1, getList()"></ai-title>
<template slot="content">
<ai-search-bar class="search-bar">
<template #left>
<ai-download
:instance="instance"
url="/app/appwechatuserqujing/export"
:params="search"
fileName="居民积分"
:disabled="tableData.length == 0">
<el-button icon="iconfont iconExported" :disabled="tableData.length == 0">导出</el-button>
</ai-download>
</template>
<template #right>
<el-input
v-model="search.title"
class="search-input"
size="small"
v-throttle="() => {search.current = 1, getList()}"
placeholder="姓名/身份证/手机号/微信昵称"
clearable
@clear="search.current = 1, search.title = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@getList="getList">
<el-table-column slot="options" width="100px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.integralUserId)">详情</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
</template>
<script>
import { mapState } from 'vuex'
export default {
name: 'List',
props: {
instance: Function,
dict: Object
},
data() {
return {
search: {
current: 1,
size: 10,
title: '',
areaId: ''
},
total: 0,
colConfigs: [
{ prop: 'realName', label: '姓名', align: 'left', width: '200px' },
{ prop: 'phone', label: '手机号', align: 'center' },
{ prop: 'idNumber', label: '身份证号', align: 'center' },
{ prop: 'areaName', label: '所属地区', align: 'center' },
{ prop: 'girdName', label: '所属网格', align: 'center' },
{ prop: 'integral', label: '积分总分', align: 'center' },
{ prop: 'usedIntegral', label: '已用积分', align: 'center' }
],
tableData: []
}
},
computed: {
...mapState(['user']),
hideLevel () {
return this.user.info.areaList.length || 0
},
params () {
return {
...this.search
}
}
},
created() {
this.search.areaId = this.user.info.areaId
this.getList()
},
methods: {
getList () {
this.instance.post(`/app/appwechatuserqujing/listByFdAppletUser`, null, {
params: {
...this.search,
areaId: this.search.areaId
}
}).then(res => {
if (res.code == 0) {
this.tableData = res.data.records
this.total = res.data.total
}
})
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appcontentinfo/deleteIntegralApply?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('下架成功!')
this.getList()
}
})
})
},
toDetail(id) {
this.$emit('change', {
type: 'Detail',
params: {
id: id || ''
}
})
}
}
}
</script>
<style lang="scss" scoped>
</style>