Browse Source

设备积分列表;按社区清空人员积分

feature/codeMove
Jackwang 3 years ago
parent
commit
f90352f9e2
  1. 110
      src/views/modules/points/community-points.vue

110
src/views/modules/points/community-points.vue

@ -0,0 +1,110 @@
<template>
<el-card shadow="never" class="aui-card--fill">
<div class="mod-sys__user">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item label="社区名称">
<el-input v-model="dataForm.communityName" placeholder="社区名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="dataListLoading"
:data="communityPointsList"
border
@selection-change="dataListSelectionChangeHandle"
@sort-change="dataListSortChangeHandle"
style="width: 100%;">
<el-table-column type="index"
width="50"
label="序号" align="center"></el-table-column>
<el-table-column prop="communityName" label="社区名称" header-align="center" align="center" :formatter="realNameFormat"></el-table-column>
<el-table-column prop="points" label="积分" header-align="center" align="center"></el-table-column>
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
<template slot-scope="scope">
<el-button type="text"
size="small"
@click="clearPoint(scope.row.communityId)">积分清零</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-sizes="[10, 20, 50, 100]"
:page-size="limit"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@size-change="pageSizeChangeHandle"
@current-change="pageCurrentChangeHandle">
</el-pagination>
</div>
</el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
mixins: [mixinViewModule],
data () {
return {
dataForm: {
communityName: ''
},
communityPointsList:[],
page: 1, //
limit: 10, //
total: 0, //
dataListLoading: false, // loading
dataListSelections: [], //
addOrUpdateVisible: false // visible
}
},
created () {
this.getDataList()
},
methods: {
getDataList(){
//
var param = {
'communityName': this.dataForm.communityName,
'page': this.page,
'limit': this.limit
}
this.$http.get(`/app-user/user/getCommunityPointList`, { params: param }).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.communityPointsList = res.data.list
this.total = res.data.total
}).catch(() => { })
},
clearPoint(communityId){
this.$confirm('此操作将清空该社区下所有人员的积分, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
fullscreen: true,
text: '加载中,请稍后',
background:'rgba(0, 0, 0, 0.8)'
});
this.$http['post']('/app-user/user/resetPointsByCommunityId', { communityId: communityId}).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
loading.close();
this.getDataList()
}).catch(() => {})
}).catch(() => {
});
}
},
components: {
}
}
</script>
Loading…
Cancel
Save