积分整合

This commit is contained in:
aixianling
2022-05-13 17:29:46 +08:00
parent aef1ebc8c9
commit dfa29e1677
2 changed files with 132 additions and 248 deletions

View File

@@ -28,31 +28,20 @@
:instance="instance" :instance="instance"
url="/app/appvillagerintegraldetail/export" url="/app/appvillagerintegraldetail/export"
:disabled="!Boolean(tableData.length)" :disabled="!Boolean(tableData.length)"
:params="{familyId:detailInfo.id,bizType:doType}" :params="{familyId:detailInfo.id,type}"
fileName="余额变动明细"> fileName="余额变动明细">
<span class="iconfont iconExported">导出</span> <el-button type="text" icon="iconfont iconExported">导出</el-button>
</ai-download> </ai-download>
</template> </template>
<template #content> <template #content>
<el-select v-model="doType" placeholder="请选择类型" size='small' clearable @change="page.current=1,getList()"> <ai-search-bar>
<el-option <template #left>
v-for="(item,i) in dict.getDict('integralDetailType')" <ai-select v-model="type" placeholder="请选择类型" @change="page.current=1,getList()"
:label="item.dictName" :selectList="dict.getDict('integralDetailType')"/>
:key="i" </template>
:value="item.dictValue"> </ai-search-bar>
</el-option> <ai-table :tableData="tableData" :col-configs="colConfigs"
</el-select> :total="page.total" border :dict="dict" :current.sync="page.current" :size.sync="page.size" @getList="getList"/>
<ai-table
style="margin-top: 16px;"
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:border="true"
:stripe="false"
:current.sync="page.current"
:size.sync="page.size"
@getList="getList">
</ai-table>
</template> </template>
</ai-card> </ai-card>
</template> </template>
@@ -62,7 +51,6 @@
<script> <script>
export default { export default {
name: 'balance', name: 'balance',
props: { props: {
detailInfo: { detailInfo: {
type: Object, type: Object,
@@ -79,61 +67,31 @@ export default {
size: 10, size: 10,
total: 0 total: 0
}, },
doType: '', type: "",
tableData: [] tableData: []
} }
}, },
created() { created() {
this.dict.load('integralDetailType') this.dict.load('integralDetailType')
this.getList() this.getList()
}, },
computed: { computed: {
colConfigs() { colConfigs() {
const _this = this
return [ return [
{ {prop: 'doTime', label: '时间', width: 200},
prop: 'doTime', {prop: "type", label: "类型", dict: "integralDetailType", align: 'center'},
label: '时间' {prop: 'changeIntegral', align: 'center', label: '变动积分', formart: v => v > 0 ? `+${v}` : `-${v}`},
}, {prop: 'nowIntegral', align: 'center', label: '剩余积分'},
{ {prop: 'eventDesc', label: '事件', width: 500}
prop: 'bizType',
align: 'center',
label: '类型',
render(h, {row}) {
return h('span', {}, _this.dict.getLabel('integralDetailType', row.bizType))
}
},
{
prop: 'changeIntegral',
align: 'center',
label: '变动积分',
formart: v => v > 0 ? `+${v}` : v
},
{
prop: 'nowIntegral',
align: 'center',
label: '剩余积分'
},
{
prop: 'description',
label: '事件类型',
}
] ]
} }
}, },
methods: { methods: {
getList() { getList() {
this.instance.post('/app/appvillagerintegraldetail/list', null, { this.instance.post('/app/appvillagerintegraldetail/list', null, {
params: { params: {...this.page, familyId: this.detailInfo.id}
...this.page,
familyId: this.detailInfo.id,
bizType: this.doType
}
}).then(res => { }).then(res => {
if (res.code === 0) { if (res?.data) {
this.tableData = res.data.records this.tableData = res.data.records
this.page.total = res.data.total this.page.total = res.data.total
} }
@@ -148,11 +106,6 @@ export default {
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
::v-deep .ai-card__body {
padding: 12px 16px 20px !important;
}
.detail-info { .detail-info {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -187,25 +140,5 @@ export default {
} }
} }
} }
.iconExported {
color: #5088FF;
font-size: 12px;
cursor: pointer;
}
.info {
padding: 16px 0 16px 0;
}
.do_type {
height: 56px;
}
.fs-14 {
::v-deep .el-table--small {
font-size: 14px !important;
}
}
} }
</style> </style>

View File

@@ -1,7 +1,7 @@
<template> <template>
<ai-detail class="family_detail"> <ai-detail class="family_detail">
<template slot="title"> <template slot="title">
<ai-title title="个人积分明细" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$emit('goBack')" ></ai-title> <ai-title title="个人积分明细" :isShowBack="true" :isShowBottomBorder="true" @onBackClick="$emit('goBack')"></ai-title>
</template> </template>
<template slot="content"> <template slot="content">
<div class="detail-info"> <div class="detail-info">
@@ -19,37 +19,15 @@
</div> </div>
</div> </div>
<ai-card title="余额变动明细"> <ai-card title="余额变动明细">
<template slot="right">
<!-- <ai-download
:instance="instance"
url="/app/appvillagerintegraldetail/export"
:disabled="!Boolean(tableData.length)"
:params="{familyName:detailInfo.name,doType:doType}"
fileName="余额变动明细">
<span class="iconfont iconExported">导出</span>
</ai-download> -->
</template>
<template #content> <template #content>
<el-select v-model="doType" placeholder="请选择类型" size='small' clearable @change="page.current=1,getList()"> <ai-search-bar>
<el-option <template #left>
v-for="(item,i) in dict.getDict('integralDetailType')" <ai-select v-model="type" placeholder="请选择类型" @change="page.current=1,getList()"
:label="item.dictName" :selectList="dict.getDict('integralDetailType')"/>
:key="i" </template>
:value="item.dictValue"> </ai-search-bar>
</el-option> <ai-table :tableData="tableData" :col-configs="colConfigs"
</el-select> :total="page.total" border :dict="dict" :current.sync="page.current" :size.sync="page.size" @getList="getList"/>
<ai-table class="fs-14"
style="margin-top: 16px;"
:tableData="tableData"
:col-configs="colConfigs"
:total="page.total"
:current.sync="page.current"
:size.sync="page.size"
:isShowPagination="false"
tableSize="small"
:border="true"
@getList="getList">
</ai-table>
</template> </template>
</ai-card> </ai-card>
</template> </template>
@@ -57,7 +35,7 @@
</template> </template>
<script> <script>
export default { export default {
name: 'balance', name: 'balance',
props: { props: {
@@ -69,7 +47,7 @@
dict: Object dict: Object
}, },
data () { data() {
return { return {
page: { page: {
current: 1, current: 1,
@@ -77,63 +55,36 @@
total: 0 total: 0
}, },
info: {}, info: {},
doType: '', type: '',
tableData: [] tableData: []
} }
}, },
created () { created() {
this.dict.load('integralDetailType') this.dict.load('integralDetailType')
this.getList() this.getList()
}, },
computed: { computed: {
colConfigs () { colConfigs() {
const _this = this
return [ return [
{ {prop: 'doTime', label: '时间', width: 200},
prop: 'doTime', {prop: "type", label: "类型", dict: "integralDetailType", align: 'center'},
align: 'center', {prop: 'changeIntegral', align: 'center', label: '变动积分', formart: v => v > 0 ? `+${v}` : `-${v}`},
label: '时间', {prop: 'nowIntegral', align: 'center', label: '剩余积分'},
align:'left' {prop: 'eventDesc', label: '事件', width: 500}
},
{
prop: 'doType',
align: 'center',
label: '类型',
render (h, {row}) {
return h('span',{}, _this.dict.getLabel('integralDetailType', row.bizType))
}
},
{
prop: 'changeIntegral',
align: 'center',
label: '变动积分'
},
{
prop: 'nowIntegral',
align: 'center',
label: '剩余积分'
},
{
prop: 'description',
align: 'center',
label: '事件类型',
align:'left'
}
] ]
} }
}, },
methods: { methods: {
getList () { getList() {
this.instance.post(`/app/appresident/detail?id=${this.detailInfo.id}`).then(res => { this.instance.post(`/app/appresident/detail?id=${this.detailInfo.id}`).then(res => {
if (res.code === 0) { if (res?.data) {
this.info = res.data.resident this.info = res.data.resident
this.instance.post(`/app/appvillagerintegraldetail/IntegralList?bizType=${this.doType}&type=1&residentId=${res.data.resident.id}`, null, { let {type, info: {id: residentId}} = this
params: this.page this.instance.post(`/app/appvillagerintegraldetail/IntegralList`, null, {
params: {...this.page, queryType: 1, type, residentId}
}).then(res => { }).then(res => {
if (res.code === 0) { if (res?.data) {
this.tableData = res.data.records this.tableData = res.data.records
} }
}) })
@@ -141,18 +92,14 @@
}) })
} }
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.family_detail{ .family_detail {
height: 100%; height: 100%;
background-color: #fff; background-color: #fff;
::v-deep .ai-card__body {
padding: 12px 16px 20px!important;
}
.detail-info { .detail-info {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -187,21 +134,25 @@
} }
} }
} }
.iconExported{
color:#5088FF; .iconExported {
color: #5088FF;
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
} }
.info{
.info {
padding: 16px 0 16px 0; padding: 16px 0 16px 0;
} }
.do_type{
.do_type {
height: 56px; height: 56px;
} }
.fs-14{
::v-deep .el-table--small{ .fs-14 {
font-size: 14px!important; ::v-deep .el-table--small {
} font-size: 14px !important;
} }
} }
}
</style> </style>