<template>
|
<div class="box-card">
|
<v-header title="报到党员总计数据"></v-header>
|
<!-- 统计区 -->
|
<div class="fl-fw mr-b-10">
|
<div class="fl-f mr-r-30">
|
<div class="left-lable-dian"></div>
|
<div class="fl-co mr-l-10 fz-7">
|
<span>报到党员总数</span>
|
<span class="mr-t-10 fc-red">{{
|
StatusObject.partyMemberTotal || 0
|
}}</span>
|
</div>
|
</div>
|
<div class="fl-f mr-r-30">
|
<div class="left-lable-dian"></div>
|
<div class="fl-co mr-l-10 fz-7">
|
<span>机关单位党员</span>
|
<span class="mr-t-10 fc-red">{{ StatusObject.organTotal || 0 }}</span>
|
</div>
|
</div>
|
<div class="fl-f mr-r-30">
|
<div class="left-lable-dian"></div>
|
<div class="fl-co mr-l-10 fz-7">
|
<span>企事业单位党员</span>
|
<span class="mr-t-10 fc-red">{{
|
StatusObject.businessTotal || 0
|
}}</span>
|
</div>
|
</div>
|
</div>
|
<!-- 按钮区 -->
|
<div class="tool">
|
<el-radio-group v-model="unitCheckType" @change="unitCheck">
|
<el-radio-button :label="1">按单位归属统计</el-radio-button>
|
<el-radio-button :label="2"> 按单位统计 </el-radio-button>
|
</el-radio-group>
|
</div>
|
<!-- 正文 -->
|
<div>
|
<v-tool-table :trs="trs" :tds="tds">
|
<template v-slot:partyMemberTotal="item">
|
<el-button
|
type="text"
|
@click="handleClick('partyMemberTotal', item.scope)"
|
>{{ item.scope.partyMemberTotal }}</el-button
|
>
|
</template>
|
<template v-slot:organTotal="item">
|
<el-button
|
type="text"
|
@click="handleClick('organTotal', item.scope)"
|
>{{ item.scope.organTotal }}</el-button
|
>
|
</template>
|
<template v-slot:businessTotal="item">
|
<el-button
|
type="text"
|
@click="handleClick('businessTotal', item.scope)"
|
>{{ item.scope.businessTotal }}</el-button
|
>
|
</template>
|
<template v-slot:count="item">
|
<el-button type="text" @click="handleClick('count', item.scope)">{{
|
item.scope.count
|
}}</el-button>
|
</template>
|
</v-tool-table>
|
</div>
|
<div class="page">
|
<v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { mapState } from "vuex";
|
export default {
|
props: {},
|
components: {},
|
data() {
|
return {
|
os: {},
|
total: 0,
|
paged: { page: 0, total: 0, r: 0, limit: 10 },
|
trs: [],
|
tds: [],
|
isZuZhibuUser: false,
|
StatusObject: {},
|
unitCheckType: 1,
|
};
|
},
|
computed: {
|
...mapState({ vuex_page: "pageReset" }),
|
},
|
watch: {
|
vuex_page: {
|
handler(n) {
|
if (n.page === this.$route.path) {
|
this.paged.page = 1;
|
this.unitCheckHandle(this.unitCheckType);
|
}
|
},
|
deep: true,
|
},
|
},
|
methods: {
|
// 分页点击
|
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.unitCheckHandle(this.unitCheckType);
|
},
|
unitCheck(val){
|
this.paged.page = 1;
|
this.paged.limit = 10;
|
this.unitCheckHandle(val);
|
},
|
unitCheckHandle(val) {
|
if (val === 1) {
|
this.trs = [
|
{ text: "序号", val: "index" },
|
{ text: "单位归属", val: "belongTo" },
|
{ text: "合计报到党员", val: "btn", slot: "partyMemberTotal" },
|
{ text: "机关单位报到党员", val: "btn", slot: "organTotal" },
|
{ text: "企事业单位报到党员", val: "btn", slot: "businessTotal" },
|
];
|
this.initLeft();
|
} else {
|
this.trs = [
|
{ text: "序号", val: "index" },
|
{ text: "单位名称", val: "name" },
|
{ text: "单位性质", val: "natureName" },
|
{ text: "单位归属", val: "belongTo" },
|
{ text: "服务社区", val: "helpCommunityName" },
|
{ text: "下沉服务小区(网格)院落", val: "villageName" },
|
{ text: "已报到党员", val: "btn", slot: "count" },
|
];
|
this.initRight();
|
}
|
},
|
// 获取数据
|
initLeft() {
|
let v = demo.copy(
|
Object.assign(this.os, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
})
|
);
|
if (!this.isZuZhibuUser && demo.$session.get("user").communityId != 0) {
|
v.communityId = demo.$session.get("user").communityId;
|
}
|
this.$api.post("checkUnit/pbStatistics/belong", v, (e) => {
|
this.paged.total = e.total;
|
e.records.map((item, index) => {
|
item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
|
});
|
this.paged.r++;
|
this.tds = e.records || [];
|
});
|
},
|
initRight() {
|
let v = demo.copy(
|
Object.assign(this.os, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
})
|
);
|
if (!this.isZuZhibuUser && demo.$session.get("user").communityId != 0) {
|
v.communityId = demo.$session.get("user").communityId;
|
}
|
this.$api.post("checkUnit/pbStatistics/unit", v, (e) => {
|
e.records.map((item, index) => {
|
item.index = (this.paged.page - 1) * this.paged.limit + index + 1;
|
});
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
});
|
},
|
handleClick(type, row) {
|
switch (type) {
|
case "businessTotal": {
|
this.$router.push(
|
"/menberDetails?labelCheckType=1&name=企事业单位党员&belongTo=" +
|
row.belongTo
|
);
|
break;
|
}
|
case "organTotal": {
|
this.$router.push(
|
"/menberDetails?labelCheckType=1&name=机关单位党员&belongTo=" +
|
row.belongTo
|
);
|
break;
|
}
|
case "partyMemberTotal": {
|
this.$router.push(
|
"/menberDetails?labelCheckType=1&name=全部党员&belongTo=" +
|
row.belongTo
|
);
|
break;
|
}
|
case "count": {
|
this.$router.push(
|
"/menberDetails?labelCheckType=2&name=全部党员&belongTo=" +
|
row.belongTo +
|
"&workUnitName=" +
|
row.name +
|
"&checkUnitId=" +
|
row.id
|
);
|
break;
|
}
|
default: {
|
break;
|
}
|
}
|
},
|
getTopData() {
|
let obj = {};
|
if (demo.$session.get("user").communityId != 0) {
|
obj.communityId = demo.$session.get("user").communityId;
|
}
|
this.$api.get("checkUnit/pbStatistics/top", obj, (e) => {
|
this.StatusObject = e;
|
});
|
},
|
},
|
mounted() {
|
this.getTopData();
|
this.isZuZhibuUser = demo.$session.get("user").account == "zuzhibu";
|
},
|
};
|
</script>
|
<style lang='less' scoped>
|
.tab-content {
|
}
|
.left-lable-dian {
|
width: 12px;
|
height: 12px;
|
border-radius: 50%;
|
background-color: rgb(24, 135, 240);
|
}
|
</style>
|