党员积分 界面完成

This commit is contained in:
aixianling
2022-04-18 16:21:15 +08:00
parent ec93e7cc0d
commit d04eb1a4a7
3 changed files with 238 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<template>
<section class="AppPartyScore">
<component :is="currentPage" v-bind="$props"/>
</section>
</template>
<script>
import PsList from "./psList";
import PsDetail from "./psDetail";
export default {
name: "AppPartyScore",
components: {PsDetail, PsList},
label: "党员积分",
props: {
instance: Function,
dict: Object,
permissions: Function
},
computed: {
currentPage() {
return this.$route.query.id ? PsDetail : PsList
}
},
created() {
this.dict.load("residentType")
}
}
</script>
<style lang="scss" scoped>
.AppPartyScore {
height: 100%;
}
</style>

View File

@@ -0,0 +1,101 @@
<template>
<section class="psDetail">
<ai-detail>
<ai-title slot="title" title="积分详情" isShowBottomBorder isShowBack @onBackClick="back"/>
<template #content>
<el-row type="flex">
<ai-card hideTitle class="staCard fill">
<template #content>
<div class="color-999" v-text="`姓名`"/>
<b v-text="detail.name"/>
</template>
</ai-card>
<ai-card hideTitle class="staCard fill">
<template #content>
<div class="color-999" v-text="`个人积分`"/>
<b class="color-26f" v-text="detail.name||0"/>
</template>
</ai-card>
<ai-card hideTitle class="staCard fill">
<template #content>
<div class="color-999" v-text="`家庭积分`"/>
<b class="color-26f" v-text="detail.name||0"/>
</template>
</ai-card>
</el-row>
<ai-card title="余额变动明细">
<template #content>
<ai-table :tableData="detail.list" :isShowPagination="false" :col-configs="colConfigs" :dict="dict"/>
</template>
</ai-card>
</template>
</ai-detail>
</section>
</template>
<script>
export default {
name: "psDetail",
props: {
instance: Function,
dict: Object,
},
data() {
return {
detail: {},
colConfigs: [
{label: "时间", prop: "createTime", width: 120},
{label: "类型", prop: "createTime", align: 'center'},
{label: "变动积分", prop: "createTime", align: 'center'},
{label: "剩余积分", prop: "createTime", align: 'center'},
{label: "调整说明", prop: "createTime"},
]
}
},
methods: {
getDetail() {
let {id} = this.$route.query
this.instance.post("/app/apppartyintegralinfo/list", null, {
params: {id}
}).then(res => {
if (res?.data) {
this.detail = res.data
}
})
},
back() {
this.$router.push({})
}
},
created() {
this.getDetail()
}
}
</script>
<style lang="scss" scoped>
.psDetail {
height: 100%;
.color-999 {
color: #999;
}
.color-26f {
color: #26f;
}
.staCard {
font-size: 14px;
b {
margin-top: 8px;
font-size: 24px;
}
& + .staCard {
margin-left: 16px;
}
}
}
</style>

View File

@@ -0,0 +1,102 @@
<template>
<section class="psList">
<ai-list>
<ai-title slot="title" title="党员积分" isShowBottomBorder/>
<template #content>
<ai-table :tableData="tableData" :total="page.total" :current.sync="page.current" :size.sync="page.size"
@getList="getTableData" :col-configs="colConfigs" :dict="dict">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{row}">
<el-button type="text" @click="getFamilyByPartyId(row.id)">家庭成员</el-button>
<el-button type="text" @click="showDetail(row.id)">详情</el-button>
</template>
</el-table-column>
</ai-table>
</template>
</ai-list>
<ai-dialog :visible.sync="dialog" title="家庭成员" :customFooter="true" width="780px" @close="familyList=[]">
<ai-table :tableData="familyList" :isShowPagination="false" :col-configs="familyCols" :dict="dict"/>
<div class="dialog-footer" slot="footer">
<el-button @click="dialog=false"> </el-button>
</div>
</ai-dialog>
</section>
</template>
<script>
import {mapState} from "vuex";
export default {
name: "psList",
props: {
instance: Function,
dict: Object,
},
computed: {
...mapState(['user']),
colConfigs() {
return [
{label: "姓名", prop: "name"},
{label: "个人积分", prop: "idNumber", align: "center"},
{label: "家庭积分", prop: "phone", align: "center"},
{slot: "options"}
]
},
familyCols() {
return [
{label: '与户主关系', prop: 'householdRelation', align: 'center', slot: 'householdRelation', width: 165},
{label: '类型', prop: 'residentType', align: 'center', dict: "residentType"},
{label: '姓名', prop: 'name', align: 'center'},
{label: '身份证号', render: (h, {row}) => h('p', this.idCardNoUtil.hideId(row.idNumber)), width: 165},
{label: '联系电话', prop: 'phone', align: 'center', width: 120}
]
}
},
data() {
return {
search: {name: "", ids: ""},
page: {current: 1, size: 10, total: 0},
tableData: [],
dialog: false,
familyList: [],
}
},
methods: {
back() {
this.$router.push({})
},
getTableData() {
this.instance.post("/app/apppartyintegralinfo/list", null, {
params: {...this.page, ...this.search}
}).then(res => {
if (res?.data) {
this.tableData = res.data?.records
this.page.total = res.data.total
}
})
},
showDetail(id) {
this.$router.push({query: {id}})
},
getFamilyByPartyId(partyId) {
this.instance.post("/app/apppartyintegralinfo/list", null, {
params: {...this.list, partyId}
}).then(res => {
if (res?.data) {
this.familyList = res.data?.records
this.dialog = true
}
})
}
},
created() {
this.getTableData()
}
}
</script>
<style lang="scss" scoped>
.psList {
height: 100%;
}
</style>