<template>
|
<div class="page_member">
|
<v-header title="报到党员管理" search :bar="bar" @on-search="onSearch"></v-header>
|
<!-- 按钮区 -->
|
<div class="tool">
|
<el-button size="medium" type="primary" @click="add">新增</el-button>
|
<el-button size="medium" type="primary" @click="out" v-if="isZuZhibuUser">导出</el-button>
|
<!-- <el-button size="medium" type="primary" @click="send">导入</el-button>
|
<el-button size="medium" type="primary" @click="out">导出</el-button> -->
|
</div>
|
<!-- 正文 -->
|
<div class="cen">
|
<!-- list列表 -->
|
<!-- <div class="list">
|
<p class="text_overflow">党组织名称</p>
|
<v-tool-scroll ids="member-list-scroll" class="lists">
|
<ul>
|
<li
|
v-for="(i, j) in list"
|
:key="j"
|
class="text_overflow"
|
:class="{ active: listIndex === j }"
|
@click.stop="onList(i, j)"
|
>
|
{{ i.name }}
|
</li>
|
</ul>
|
</v-tool-scroll>
|
</div> -->
|
<!-- 表格+分页 -->
|
<div class="tab_data">
|
<div class="tab">
|
<v-tool-table scroll :trs="trs" :tds="tds">
|
<template v-slot:type="{ scope }">
|
{{ scope.type === 1 ? '预备党员' : '正式党员' }}
|
</template>
|
<template v-slot:btn="item">
|
<div class="table_flex">
|
<span @click="edit(item.scope)" v-if="backstageType != 1">编辑</span>
|
<span @click="detail(item.scope)">查看</span>
|
<span @click="del(item.scope)" v-if="backstageType != 1">删除</span>
|
</div>
|
</template>
|
<template v-slot:pic="item">
|
<div class="table_flex">
|
<img :src="item.scope.photoPath || '/static/image/dh.jpg'" @click="onScaleImage(item.scope)" />
|
</div>
|
</template>
|
<template v-slot:acc="item">
|
<div class="table_flex">
|
<b class="col_primary unline">{{ item.scope.phone }}</b>
|
</div>
|
</template>
|
</v-tool-table>
|
</div>
|
<div class="page">
|
<v-tool-page :item="paged" @on-page="onPage"></v-tool-page>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex';
|
import { watermark, removewatermark } from '../../../utils/watermark';
|
import { getPhoneEncty, getCardEncty } from '../../../utils/common';
|
export default {
|
props: {},
|
components: {},
|
data() {
|
return {
|
bar: [
|
{
|
title: '关键字',
|
name: 'keyWord',
|
plac: '姓名、手机号、常住社区、工作单位',
|
width: '350px !important',
|
},
|
{
|
title: '职能特长及服务意愿',
|
name: 'specialtyName',
|
type: 'select',
|
list: [
|
{ label: '党建指导', value: '党建指导', checkType: false },
|
{ label: '政策宣讲', value: '政策宣讲', checkType: false },
|
{ label: '教育培训', value: '教育培训', checkType: false },
|
{ label: '就业服务', value: '就业服务', checkType: false },
|
{ label: '志愿服务', value: '志愿服务', checkType: false },
|
{ label: '维修服务', value: '维修服务', checkType: false },
|
{ label: '家政服务', value: '家政服务', checkType: false },
|
{ label: '其他', value: '其他', checkType: false },
|
],
|
},
|
{
|
title: '所属党组织',
|
name: 'orgName',
|
type: 'select',
|
plac: '请选择',
|
list: [],
|
},
|
],
|
skillList: [],
|
total: 0,
|
os: { keyWord: '', account: '', name: '' },
|
paged: { page: 0, total: 0, r: 0, limit: 10 },
|
listIndex: -1,
|
trs: [
|
// {
|
// text: "账号",
|
// val: "btn",
|
// slot: "acc",
|
// color: true,
|
// table_status: [{ val: 0, key: "#38f" }],
|
// },
|
{ text: '序号', val: 'id' },
|
{ text: '党员姓名', val: 'name' },
|
{ text: '所属党组织', val: 'orgName' },
|
{ text: '单位归属', val: 'belongTo' },
|
// { text: "党员照片", val: "btn", slot: "pic" },
|
// { text: "党员类型", val: "btn", slot: "type" },
|
{ text: '手机号', val: 'phone' },
|
{ text: '微信昵称', val: 'nickName' },
|
{ text: '常住社区', val: 'communityName' },
|
{ text: '小区院落', val: 'villageName' },
|
{ text: '职能特长及服务意愿', val: 'specialtyName' },
|
{ text: '工作单位', val: 'checkUnitName' },
|
// { text: "报到社区", val: "communityName" },
|
// {
|
// text: "状态",
|
// val: "status",
|
// },
|
{ text: '操作', val: 'btn' },
|
],
|
tds: [],
|
list: [],
|
isZuZhibuUser: false,
|
backstageType: '',
|
};
|
},
|
computed: {
|
...mapState({ vuex_page: 'pageReset' }),
|
},
|
watch: {
|
vuex_page: {
|
handler(n) {
|
if (n.page === this.$route.path) {
|
this.paged.page = 1;
|
this.init();
|
}
|
},
|
deep: true,
|
},
|
},
|
methods: {
|
// 所属党组织 list
|
getOrgNameList() {
|
// comPbCheckUnit/orgList
|
this.$api.get(
|
'checkUnit/orgList',
|
{},
|
(res) => {
|
const data = res.map((i) => {
|
return { label: i.orgName, value: i.orgName };
|
});
|
for (let i = 0; i < this.bar.length; i++) {
|
if (this.bar[i].name == 'orgName') {
|
this.bar[i].list = data;
|
break;
|
}
|
}
|
},
|
(err) => {
|
console.log(err);
|
}
|
);
|
},
|
// 查看大图
|
onScaleImage(v) {
|
this.$store.dispatch('setImage', {
|
time: Date.now(),
|
title: v.name,
|
pic: v.photoPath,
|
tool: true,
|
});
|
},
|
// 分页点击
|
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.os, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
})
|
);
|
console.log(v);
|
if (!this.isZuZhibuUser) {
|
v.communityId = demo.$session.get('user').communityId;
|
}
|
this.$api.post('communitypartybuilding/pagepartyorganization', v, (e) => {
|
this.paged.total = e.total;
|
this.paged.r++;
|
this.tds = e.records || [];
|
this.tds.forEach((item) => {
|
item.phone = getPhoneEncty(item.phone);
|
});
|
});
|
},
|
// 删除
|
del(v) {
|
let t = this;
|
t.$js.model('删除党员', '是否删除党员[' + v.name + ']', (res) => {
|
if (res) {
|
t.$api.del('communitypartybuilding/deletepartybuildingmember', v, (e) => {
|
demo.toast('删除成功');
|
t.$nextTick(() => {
|
t.init();
|
});
|
});
|
}
|
});
|
},
|
// 档案
|
detail(v) {
|
demo.$session.set('member-detail', v);
|
this.$router.push(this.$nav.url('/com_member_detail/' + v.id));
|
},
|
_open(type, title, data) {
|
let data2 = {
|
type,
|
title,
|
data,
|
};
|
this.$store.dispatch('setFixed', {
|
event: 'add',
|
data: {
|
type,
|
title,
|
data,
|
},
|
time: Date.now(),
|
});
|
},
|
// 编辑
|
edit(v) {
|
// v.orgId = v.orgId || "";
|
// this._open("member-add", "编辑", v);
|
this.$router.push('/addMember?id=' + v.id);
|
},
|
// 新增
|
add() {
|
// this._open("member-add", "新增", { id: 0 });
|
this.$router.push('/addMember');
|
},
|
// 导入
|
send() {
|
this._open('member-import');
|
},
|
out() {
|
this.$prompt('请输入密码', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
inputPattern: /^[\s\S]*.*[^\s][\s\S]*$/,
|
inputErrorMessage: '请输入密码',
|
inputPlaceholder: '请输入密码',
|
inputType: 'password',
|
}).then(({ value }) => {
|
console.log(value);
|
if (value === 'l9KzHTaMwEs5WKFE') {
|
let v = demo.copy(
|
Object.assign(this.os, {
|
pageNum: this.paged.page,
|
pageSize: this.paged.limit,
|
})
|
);
|
this.$api.post('communitypartybuilding/member/export', v, (e) => {
|
window.location.href = e;
|
});
|
} else {
|
demo.toast('密码错误');
|
}
|
});
|
},
|
// 查询
|
onSearch(v) {
|
console.log(v);
|
this.os = v;
|
this.paged.page = 1;
|
// this.listIndex = -1;
|
this.init();
|
},
|
// 点击党组织
|
onList(i, j) {
|
this.listIndex = j;
|
this.os.orgName = i.name;
|
this.init();
|
},
|
setlist() {
|
// this.$api.get(
|
// "communitypartybuilding/listpartyorganization",
|
// {
|
// communityId: demo.$session.get("user").communityId,
|
// },
|
// (e) => {
|
// this.list = e;
|
// }
|
// );
|
// this.$api.party((e) => {
|
// this.list = e;
|
// });
|
},
|
},
|
created() {
|
this.isZuZhibuUser = demo.$session.get('user').account == 'zuzhibu';
|
},
|
destroyed() {
|
removewatermark();
|
},
|
mounted() {
|
const USER_INFO = demo.$session.get('user');
|
this.backstageType = demo.$session.get('user').backstageType;
|
watermark({
|
watermark_txt: `${USER_INFO.title}-“${USER_INFO.account} ${USER_INFO.name}”`,
|
});
|
this.setlist();
|
this.getOrgNameList();
|
// this.$api.post(
|
// "neighbor/pageNeighborTopicByAdmin",
|
// { pageNum: 1, pageSize: 9999 },
|
// (e) => {
|
// e.records.forEach((item) => {
|
// item.label = item.name;
|
// item.value = item.name;
|
// });
|
// this.bar[1].list = e.records;
|
// }
|
// );
|
},
|
};
|
</script>
|
<style lang='less' scoped>
|
.page_member {
|
overflow-y: auto;
|
.tool {
|
margin: 5px 0 15px;
|
}
|
.cen {
|
display: flex;
|
height: 500px;
|
> div {
|
height: 100%;
|
position: relative;
|
}
|
.list {
|
width: 160px;
|
p {
|
background-color: #f2f2f2;
|
font-size: 14px;
|
font-weight: 650;
|
}
|
.lists {
|
height: calc(~'100% - 40px');
|
}
|
p,
|
li {
|
height: 40px;
|
line-height: 40px;
|
}
|
li {
|
cursor: pointer;
|
transition: all 0.2s;
|
font-size: 13px;
|
text-indent: 5px;
|
}
|
li.active {
|
background-color: #1890ff;
|
color: #fff;
|
}
|
}
|
.tab_data {
|
.tab {
|
height: calc(~'100% - 50px');
|
}
|
.page {
|
height: 50px;
|
box-sizing: border-box;
|
padding-top: 10px;
|
}
|
}
|
}
|
}
|
</style>
|