<template>
|
<div class='man_pop'>
|
<v-header
|
title="小程序用户管理"
|
></v-header>
|
<el-form :inline="true" class="demo-form-inline">
|
<el-form-item label="关键字" style="width: 480px" >
|
<el-input style="width:400px" size="small" v-model="bar.keyWord" placeholder="请输入姓名、居民手机号、居住小区等关键词进行查找"></el-input>
|
</el-form-item>
|
<el-form-item label="实名认证">
|
<el-radio-group v-model="bar.isRealNamed" size="medium">
|
<el-radio-button label="1">是</el-radio-button>
|
<el-radio-button label="2">否</el-radio-button>
|
</el-radio-group>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="small" type="primary" @click="onSearch">查询</el-button>
|
<el-button @click="Reset" size="small">重置</el-button>
|
</el-form-item>
|
</el-form>
|
<div class="add">
|
<!-- <div class="upload-box">-->
|
<!-- <el-upload-->
|
<!-- name="multipartFile"-->
|
<!-- accept=".xls, .xlsx"-->
|
<!-- :headers={Authorization:Authorization}-->
|
<!-- class="upload-demo"-->
|
<!-- :show-file-list="false"-->
|
<!-- action="/api/communitymanager/importuser"-->
|
<!-- :on-success="success"-->
|
<!-- :on-error="error"-->
|
<!-- multiple-->
|
<!-- >-->
|
<!-- <el-button-->
|
<!-- type="primary"-->
|
<!-- size="small"-->
|
<!-- >导入-->
|
<!-- </el-button>-->
|
<!-- </el-upload>-->
|
<!-- </div>-->
|
<!-- <el-button-->
|
<!-- type="primary"-->
|
<!-- @click="listareas"-->
|
<!-- size="small"-->
|
<!-- >下载模板-->
|
<!-- </el-button>-->
|
<el-button
|
type="primary"
|
size="small"
|
@click="Export"
|
>导出
|
</el-button>
|
</div>
|
<div class="tab">
|
<v-tool-table
|
:trs="trs"
|
:tds="tds"
|
>
|
<!-- <template v-slot:isRegister="item">-->
|
<!-- <b>{{item.scope.isRegister ==0?'否':'是'}}</b>-->
|
<!-- </template>-->
|
|
<template v-slot:idCard="item">
|
<b>{{item.scope.idCard?'是':'否'}}</b>
|
</template>
|
<template v-slot:sex="item">
|
<b>{{item.scope.sex ==1?'男':'女'}}</b>
|
</template>
|
<template v-slot:politicalOutlook="item">
|
<b>{{['','党员','团员','群众'][item.scope.politicalOutlook]}}</b>
|
</template>
|
<template v-slot:btn="item">
|
<div class="table_flex">
|
<!-- {{item.scope.id}} -->
|
<span
|
class="col_primary"
|
@click.stop="onDetail(item.scope.userId)"
|
>查看详情</span>
|
<span
|
class="col_primary"
|
@click="onTags(item.scope)"
|
>设置标签</span>
|
<span
|
class="col_primary"
|
@click="onincome(item.scope.userId)"
|
>收入明细</span>
|
<span
|
class="col_primary"
|
@click="onexpenditure(item.scope.userId)"
|
>支出明细</span>
|
<span
|
@click="onSum(item.scope)"
|
class="col_primary"
|
>线下奖励支出</span>
|
</div>
|
</template>
|
<!-- <template v-slot:indent="item">-->
|
<!-- <b>{{+(item.scope.comMngStructHouseVOS || {}).identity === 1 ? '是' : '否'}}</b>-->
|
<!-- </template>-->
|
<!-- <template v-slot:time="item">-->
|
<!-- <b>{{is_time(item.scope.createAt)}}</b>-->
|
<!-- </template>-->
|
</v-tool-table>
|
</div>
|
<v-tool-page
|
:item="paged"
|
@on-page="onPage"
|
></v-tool-page>
|
<!---->
|
<el-dialog
|
title="下载模板"
|
:modal="false"
|
:close-on-click-modal="false"
|
:visible.sync="centerDialogVisible"
|
width="30%"
|
center>
|
<div class="dialog-box">
|
<div style="max-width:600px">
|
<el-select v-model="value" filterable placeholder="请选择">
|
<el-option
|
v-for="item in options" pageuser
|
:key="item.id"
|
:label="item.areaName"
|
:value="item.id">
|
</el-option>
|
</el-select>
|
</div>
|
<div @click="quarters" class="text-link">小区管理</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="centerDialogVisible = false">取 消</el-button>
|
<el-button type="primary" @click="exportuser()">确 定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import {mapState} from "vuex";
|
|
export default {
|
props: {},
|
components: {},
|
data() {
|
return {
|
centerDialogVisible: false,
|
Authorization: '',
|
options: [],//下载模板小区选择
|
value: '',//小区选择
|
bar:{
|
keyWord:'',
|
isRealNamed:[]
|
},
|
trs: [
|
{text: "序号", val: "userId", width: "50px"},
|
{ text: "用户昵称", val: "nickName" },
|
{text: "姓名", val: "name"},
|
{text: "居民手机号", val: "phone"},
|
// { text: "身份证号", val: "idCard" },
|
// { text: "职业", val: "job" },
|
{text: "居住小区", val: "communityName"},
|
// { text: "是否为租户", val: "btn", slot: "indent" },
|
{text: "标签", val: "tags"},
|
{ text: "实名认证", val: "btn", slot: "idCard" },
|
// {text: "是否注册", val: "btn", slot: "isRegister"},
|
{text: "性别", val: "btn", slot: 'sex'},
|
{text: "年龄", val: "age"},
|
{text: "累计收入", val: "incomeAmount"},
|
{text: "钱包余额", val: "availableAmount"},
|
{text: "积分余额", val: "integralSum"},
|
{text: "政治面貌", val: "btn", slot: 'politicalOutlook'},
|
{text: "操作", val: "btn",width:"150px"},
|
],
|
tds: [],
|
paged: {page: 0, total: 0, r: 0, limit: 10},
|
os: {},
|
search: {},
|
};
|
},
|
computed: {
|
...mapState({vuex_page: "pageReset"}),
|
},
|
watch: {
|
vuex_page: {
|
handler(n) {
|
// console.log(n)
|
// if (n.page === this.$route.path) {
|
// this.paged.pageNum = 1
|
// }
|
this.init();
|
},
|
deep: true,
|
},
|
},
|
methods: {
|
onSum(e) {
|
this.$store.dispatch("setFixed", {
|
event: "add",
|
data: { type: "fin-sum", data: e },
|
timeout: Date.now(),
|
});
|
},
|
success(e) {
|
//导入成功
|
demo.toast(e.msg);
|
this.init()
|
},
|
error(err) {
|
demo.toast("导入失败");
|
// console.log(err)
|
},
|
Export(){
|
//导出
|
this.$api.post('communitymanager/export',this.search,e=>{
|
location.href = e
|
})
|
},
|
listareas() {
|
//选择导入小区
|
this.centerDialogVisible = true
|
this.$api.get("communitymanager/listareas", '', e => {
|
this.options = e
|
});
|
},
|
exportuser() {
|
//下载模板
|
if (this.value == '') {
|
return demo.toast("请选择小区");
|
}
|
this.$api.get("communitymanager/exportuser", {id: this.value}, e => {
|
location.href = e
|
})
|
},
|
quarters() {
|
//去小区管理
|
this.$router.push({path: this.$nav.url('/man_bui_village')})
|
},
|
is_time(v) {
|
return demo.timeout(new Date(v).getTime(), "alls", "-");
|
},
|
onDetail(id) {
|
this.$router.push(this.$nav.url("/man_populations/" + id));
|
},
|
onincome(id) {
|
this.$router.push({
|
path:'/man_income',
|
query:{id:id}
|
})
|
},
|
onexpenditure(id) {
|
this.$router.push({
|
path:'/man_expenditure',
|
query:{id:id}
|
})
|
},
|
// 标签
|
onTags(item) {
|
this.$store.dispatch("setFixed", {
|
event: "add",
|
data: {
|
type: "pop-set",
|
title: "设置标签[" + item.name + "]",
|
data: {
|
id: item.userId,
|
tags: item.tags,
|
},
|
},
|
time: Date.now(),
|
});
|
},
|
Reset(){
|
//重置
|
this.bar.isRealNamed = []
|
this.bar.keyWord = ''
|
this.onSearch()
|
},
|
onSearch(v) {
|
// if (v.time && v.time.length && v.time[1]) {
|
// v.createBegin = v.time[0];
|
// v.createEnd = v.time[1];
|
// }
|
this.search = demo.copy(v);
|
// delete this.search.time;
|
this.paged.page = 1;
|
this.init();
|
},
|
// 分页点击
|
onPage(v) {
|
if (v.page === this.paged.page && v.page && !v.reset) {
|
return 0;
|
}
|
this.paged.page = v.page;
|
this.paged.limit = v.limit;
|
this.init();
|
},
|
// 获取数据
|
init() {
|
let v = demo.copy(
|
Object.assign(this.bar, {
|
isRealNamed:this.bar.isRealNamed.length!==0?this.bar.isRealNamed[0]:'',
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
})
|
);
|
this.$api.post("communitymanager/pageuser", v, (e) => {
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
});
|
},
|
},
|
mounted() {
|
this.Authorization = 'Bearer ' + demo.$session.get('token') || ''
|
},
|
};
|
</script>
|
<style lang='less' scoped>
|
.upload-box {
|
margin: 0 10px;
|
}
|
|
.man_pop {
|
overflow-y: auto;
|
.form{
|
|
}
|
.tab {
|
margin-bottom: 10px;
|
}
|
}
|
|
.add {
|
text-align: right;
|
padding-bottom: 20px;
|
}
|
|
.dialog-box {
|
display: flex;
|
justify-content: center;
|
}
|
|
.text-link {
|
cursor: pointer;
|
margin-left: 20px;
|
color: #409EFF;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
</style>
|