初始化

This commit is contained in:
aixianling
2021-12-14 18:36:19 +08:00
parent 9afa4101b6
commit a8dff862d2
327 changed files with 88702 additions and 0 deletions

View File

@@ -0,0 +1,594 @@
<template>
<section class="AppPartyOrganization">
<ai-list v-if="hasPartyOrg">
<ai-title slot="title" title="党组织管理" isShowBottomBorder/>
<template slot="left">
<ai-tree-menu title="组织目录" @mouseleave.native="showContextmenu=false" searchPlaceholder="请输入党组织名称"
@search="v=>orgTreeRef.filter(v)">
<ai-party-tree :instance="instance" :root="user.info.organizationId"
:expand-on-click-node="false" highlight-current
ref="orgTree" default-first-option
:current-node-key="selectedOrg.id||user.info.organizationId"
:filter-node-method="(v,data)=>data.name.indexOf(v)>-1"
@node-contextmenu="handleContextmenu"
@node-click="handleNodeClick"/>
<ul class="contextmenu" v-if="showContextmenu" :style="contextmenuPos">
<li v-for="(op,i) in editOps" :key="i" @click="op.foo(op)">{{ op.label }}</li>
</ul>
<template #bottom>
<div class="bottomBar">
<span v-for="(op,i) in editOps" :key="i" class="iconfont" :class="op.icon" @click="op.foo(op)"
:title="op.label"/>
</div>
</template>
<!--编辑党组织-->
<ai-dialog :visible.sync="dialog" :title="currentEditOp.label" width="520px"
:close-on-click-modal="false" @close="orgForm={}" @onConfirm="submitOrg">
<el-form :model="orgForm" label-width="100px" :rules="rules" ref="orgForm" size="small">
<div class="tipInfo"><span class="iconfont iconModal_Warning"/> 添加党组织后请在党员管理中添加该组织的成员</div>
<el-form-item label="上级党组织" v-if="!!orgForm.parentName">
{{ orgForm.parentName }}
</el-form-item>
<el-form-item label="党组织名称" prop="name">
<el-input v-model="orgForm.name" placeholder="请输入..." clearable/>
</el-form-item>
<el-form-item label="组织级别" prop="partyType">
<ai-select placeholder="组织级别" v-model="orgForm.partyType" :selectList="dict.getDict('orgPartyType')"/>
</el-form-item>
<el-form-item label="组织类型" prop="orgType">
<ai-select placeholder="组织类型" v-model="orgForm.orgType" :selectList="dict.getDict('orgType')"/>
</el-form-item>
<el-form-item label="建立时间" prop="createTime">
<el-date-picker v-model="orgForm.createTime" type="date" placeholder="选择日期"
format="yyyy-MM-dd"
:value-format="'yyyy-MM-dd' + ' 00:00:00'"/>
</el-form-item>
</el-form>
</ai-dialog>
</ai-tree-menu>
</template>
<template v-if="!!selectedOrg.id" #content>
<ai-wrapper>
<el-row v-if="!!selectedOrg.name" align="middle" type="flex">
<span class="iconfont iconParent"/>
<div v-html="fullOrgName"/>
</el-row>
<ai-title title="总体概况" isShowBottomBorder/>
<ai-info-item label="建立时间">{{ selectedOrg.createTime|timeVal }}</ai-info-item>
<ai-info-item label="上级组织">{{ selectedOrg.parentName || "-" }}</ai-info-item>
<ai-title title="领导成员" isShowBottomBorder v-if="leaderList.length>0"/>
<div class="imgUl">
<li v-for="(item,index) in leaderList" :key="index">
<img v-if="item.avatarUrl" :src="item.avatarUrl.split(';')[0]" alt="图片" width="80px"
height="92px">
<el-row justify="center" align="middle" v-else>
<span class="iconfont iconProfile_Picture" style="font-size: 36px;color: #89b;"/>
<div style="font-size: 12px;color: #666;">暂无照片</div>
</el-row>
<p style="color: #333;">{{ item.name }}</p>
<p style="color: #999;">{{ dict.getLabel('partyPosition', item.partyPosition) }}</p>
</li>
</div>
<ai-title title="党员发展" isShowBottomBorder>
<template #rightBtn>
<el-button type="text" @click="memberDetailList(1)"
v-if="permissions('admin_syspartyorganization_detail')">党员详情
</el-button>
<!-- <el-button type="text" @click="memberDetailList(2)"-->
<!-- v-if="permissions('admin_syspartyorganization_detail')">发展党员详情-->
<!-- </el-button>-->
</template>
</ai-title>
<ai-info-item v-for="op in memberCounts" :key="op.prop">
<el-row slot="label" type="flex" align="middle" justify="end">
<div class="iconfont iconProlife"/>
<div v-html="op.label"/>
</el-row>
{{ op.v }}
</ai-info-item>
<ai-title title="基层党组织统计" isShowBottomBorder>
<template #rightBtn>
<el-button type="text" @click="exportExcel">导出</el-button>
</template>
</ai-title>
<el-table :data="organizationCounts" header-cell-class-name="table-header" border
show-summary size="small">
<el-table-column align="center" label="" prop="partyType">
<template slot-scope="{row}">
{{ dict.getLabel('orgPartyType', row.partyType) }}
</template>
</el-table-column>
<el-table-column align="center" label="基层组织数" prop="primary"></el-table-column>
<el-table-column align="center" label="机关单位" prop="governmentUnit"></el-table-column>
<el-table-column align="center" label="建制村/社区/队" prop="village"></el-table-column>
<el-table-column align="center" label="事业单位" prop="publicUnit"></el-table-column>
<el-table-column align="center" label="企业" prop="company"></el-table-column>
<el-table-column align="center" label="新经济社会组织" prop="social"></el-table-column>
</el-table>
</ai-wrapper>
<!--查看党员详情-->
<el-dialog title="党员列表" center :visible.sync="isCheckMember" width="60%" :close-on-click-modal="false">
<div style="overflow-y: auto;">
<el-table :data="tableData" header-cell-class-name="table-header" tooltip-effect="light"
row-class-name="table-row" cell-class-name="table-cell" max-height="500">
<el-table-column align="center" prop="name" label="姓名">
<template slot-scope="{row}">
{{ row.name || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="sex" label="性别">
<template slot-scope="{row}">
{{ dict.getLabel('sex', row.sex) || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="age" label="年龄">
<template slot-scope="{row}">
{{ row.age || '-' }}
</template>
</el-table-column>
<template v-if="detailType==1">
<el-table-column align="center" prop="partyStatus" label="党员状态">
<template slot-scope="{row}">
{{ dict.getLabel('partyStatus', row.partyStatus) || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="joinPartyTime" label="入党日期">
<template slot-scope="{row}">
{{ row.joinPartyTime|timeVal }}
</template>
</el-table-column>
<el-table-column align="center" prop="partyPosition" label="党内职务">
<template slot-scope="{row}">
{{ dict.getLabel('partyPosition', row.partyPosition) || '-' }}
</template>
</el-table-column>
<el-table-column align="center" prop="flowStatus" label="流动状态">
<template slot-scope="{row}">
{{ dict.getLabel('flowStatus', row.flowStatus) || '-' }}
</template>
</el-table-column>
</template>
<template v-if="detailType==2">
<el-table-column prop="applyJoinPartyTime" label="入党申请时间">
<div slot-scope="{row}">
{{ row.applyJoinPartyTime|timeVal }}
</div>
</el-table-column>
<el-table-column prop="developStatus" label="发展状态">
<div slot-scope="{row}">
{{ dict.getLabel('developStatus', row.developStatus) || "-" }}
</div>
</el-table-column>
</template>
</el-table>
<div class="pagination">
<el-pagination background :current-page.sync="searchObj.current" :total="total"
layout="total,prev, pager, next,sizes, jumper"
@size-change="handleSizeChange"
:page-size.sync="searchObj.size"
:page-sizes="[10, 20, 50, 100,200]"
@current-change="handleChange"></el-pagination>
</div>
</div>
</el-dialog>
</template>
<ai-empty v-else slot="content">请选择党组织</ai-empty>
</ai-list>
<!--暂无党组织-->
<div v-else class="no-permission"
style="display: flex;flex-direction:column;align-items: center;justify-content: center;height: calc(100% - 148px);font-size: 14px;">
<div style="height: 170px;"></div>
<p>暂未分配党组织</p>
<p>请前往 <span style="color: #2771FF;">系统设置 - 账号管理 - 功能分配</span> 中进行设置</p>
</div>
</section>
</template>
<script>
import {mapState} from "vuex";
import dayjs from 'dayjs'
export default {
name: "AppPartyOrganization",
label: "党组织管理",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
detailObj: {},
memberCount: {},
tableData: [],
total: 0,
searchObj: {
current: 1,
size: 10
},
isCheckMember: false,
detailType: 0,
selectedOrg: {},
orgForm: {},
showContextmenu: false,
dialog: false,
contextmenuPos: {},
currentEditOp: {},
info: {}
}
},
computed: {
...mapState(['user']),
hasPartyOrg() {
return Boolean(this.user.info.organizationId)
},
memberCounts() {
return [
{label: "正式党员", prop: "one"},
{label: "预备党员", prop: "five"},
{label: "发展对象", prop: "four"},
{label: "积极分子", prop: "three"},
{label: "申请入党", prop: "two"},
].map(e => ({...e, v: this.info.memberCount?.[e.prop] || 0}))
},
organizationCounts() {
return this.info.organizationCount || []
},
leaderList() {
return this.info?.leaderList?.filter(v => ['1', '2', '3', '4', '5'].includes(v.partyPosition)) || []
},
editOps() {
let initData = [
{
label: "编辑党组织", permit: "admin_syspartyorganization_edit", icon: "iconEdit",
foo: op => {
if (this.selectedOrg?.id) {
this.dialog = true
this.currentEditOp = op
this.orgForm = JSON.parse(JSON.stringify(this.selectedOrg))
} else {
this.$message.error('请选择党组织')
}
}
},
{
label: "新增下级党组织", permit: "admin_syspartyorganization_add", icon: "iconAdd_Subordinates",
foo: op => {
if (this.selectedOrg?.id) {
this.dialog = true
this.currentEditOp = op
this.orgForm.parentId = this.selectedOrg?.id
this.orgForm.parentName = this.selectedOrg?.name
} else {
this.$message.error('请选择党组织')
}
}
},
{
label: "新增同级党组织", permit: "admin_syspartyorganization_add", icon: "iconAdd_Peers",
foo: op => {
let parent = this.orgTreeRef.getNode(this.selectedOrg)?.parent?.data
if (parent) {
this.dialog = true
this.currentEditOp = op
this.orgForm.parentId = parent?.id
this.orgForm.parentName = parent?.name
} else {
this.$message.error("不能增加同级根组织!")
}
}
},
{
label: "删除党组织", permit: "admin_syspartyorganization_del", icon: "iconDelete",
foo: () => {
if (this.selectedOrg?.id) {
let {id} = this.selectedOrg
this.$confirm("确定需要删除该党组织吗?", {type: "error"}).then(() => {
this.instance.post('/app/partyOrganization/deletePartyOrganization', null, {
params: {id}
}).then(res => {
if (res?.code == 0) {
this.$message.success('删除成功');
this.orgTreeRef.remove(this.selectedOrg)
if (!!this.selectedOrg?.parentId) {
this.orgTreeRef.setCurrentKey(this.selectedOrg.parentId)
this.handleNodeClick(this.orgTreeRef.getCurrentNode())
} else {
this.selectedOrg = {}
}
}
})
})
} else {
this.$message.error('请选择党组织')
}
}
},
].map(e => ({
...e, foo: p => {
this.showContextmenu = false
e.foo(p)
}
}))
return initData.filter(e => this.permissions(e.permit))
},
rules() {
return {
name: [
{required: true, message: '请填写党组织名称', trigger: 'blur'}
],
partyType: [
{required: true, message: '请填写组织级别', trigger: 'change'}
],
orgType: [
{required: true, message: '请填写组织类别', trigger: 'change'}
],
createTime: [
{required: true, message: '请填写建立时间', trigger: 'blur'}
]
}
},
orgTreeRef() {
return this.$refs.orgTree?.$refs?.partyTree || {}
},
fullOrgName() {
let current = this.orgTreeRef.getNode(this.selectedOrg),
names = []
const getName = e => {
if (e.data?.name) {
names.push(e.data.name)
if (e.parent) {
getName(e.parent)
}
}
}
if (current) {
getName(current)
}
return names?.reverse()?.join(" / ")
}
},
filters: {
timeVal(val) {
if (val) {
return dayjs(val).format('YYYY-MM-DD');
} else {
return '-'
}
}
},
methods: {
// 查询党组织人员信息
getOrgInfo() {
let {id} = this.selectedOrg
return this.instance.post('/app/partyOrganization/detail', null, {
params: {id}
}).then(res => {
if (res?.data) {
this.info = res.data
}
})
},
// 党员详情
memberDetailList(index) {
this.detailType = index;
this.isCheckMember = true;
this.instance.post(index == 1 ? `/app/appparty/list` : `/app/apppartydevelop/list`, null, {
params: {
...this.searchObj,
partyOrgId: this.selectedOrg?.id
}
}).then((res) => {
this.tableData = res.data.records;
this.total = res.data.total;
})
},
handleSizeChange(val) {
this.searchObj.size = val;
this.memberDetailList(this.detailType);
},
handleChange(val) {
this.searchObj.current = val;
this.memberDetailList(this.detailType);
},
// 导出
exportExcel() {
this.instance.post('/app/partyOrganization/export', null, {
responseType: "blob",
params: {id: this.selectedOrg?.id}
}).then((res) => {
const link = document.createElement("a");
let blob = new Blob([res], {
type: "application/vnd.ms-excel"
});
link.style.display = "none";
link.href = URL.createObjectURL(blob);
let num = "";
for (let i = 0; i < 10; i++) {
num += Math.ceil(Math.random() * 10);
}
link.setAttribute("download", "党组织列表" + num + ".xls");
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
});
},
handleContextmenu(e, data) {
this.handleNodeClick(data).then(() => {
if (e.which == 3) {
this.contextmenuPos = {top: (e.y + 16) + 'px', left: e.x + 'px'}
this.$nextTick(() => this.showContextmenu = true)
}
})
},
submitOrg() {
this.$refs.orgForm.validate(v => {
if (v) {
this.instance.post('/app/partyOrganization/updatePartyOrganization', this.orgForm).then(res => {
if (res?.data) {
this.dialog = false;
this.handleNodeClick(res.data)
if (this.orgForm.id) {
this.$message.success('修改成功')
let node = this.orgTreeRef.getNode(this.selectedOrg)
node.data = res.data
} else {
this.$message.success('添加成功')
this.orgTreeRef.append(res.data, res.data.parentId)
}
}
})
}
});
},
handleNodeClick(org) {
this.showContextmenu = false
if (org) {
this.selectedOrg = org
if (!this.selectedOrg?.parentName) {
let parent = this.orgTreeRef.getNode(this.selectedOrg)?.parent?.data
this.selectedOrg.parentName = parent?.name
}
return this.getOrgInfo()
}
}
},
created() {
if (this.hasPartyOrg) {
this.dict.load('orgType', 'orgPartyType', 'flowStatus', 'partyPosition', 'partyStatus', 'sex');
}
}
}
</script>
<style scoped lang="scss">
.AppPartyOrganization {
height: 100%;
.iconParent {
color: #8899BB;
margin-right: 8px;
}
::v-deep .AiTreeMenu {
.bottomBar {
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
height: 32px;
border-top: 1px solid #E5E5E5;
background: #fff;
.iconfont {
cursor: pointer;
&:hover {
color: #26f;
}
&.iconDelete:hover {
color: #f46;
}
}
.treePanel {
padding-bottom: 32px;
}
}
.contextmenu {
background: #fff;
border-radius: 2px;
font-size: 12px;
padding: 8px;
position: fixed;
z-index: 999;
li {
height: 28px;
line-height: 28px;
cursor: pointer;
text-indent: 8px;
}
li:hover {
background-color: #EFF6FF;
color: #5088FF;
}
}
.tipInfo {
height: 32px;
background: #FFF3E8;
border-radius: 4px;
color: #FF8822;
font-size: 12px;
border: 1px solid #f82;
display: flex;
align-items: center;
padding: 0 8px;
gap: 8px;
margin-bottom: 10px;
}
}
.el-form-item {
.el-date-editor {
width: 100%;
}
}
::v-deep .ai-wrapper {
.AiTitle {
width: 100%;
margin-bottom: 10px;
}
.iconProlife {
font-size: 14px;
margin-right: 4px;
}
.imgUl {
display: flex;
flex-wrap: wrap;
font-size: 14px;
text-align: center;
li {
padding: 0 16px 16px 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.el-row {
width: 80px;
background: #ddd;
padding: 16px 0;
}
}
.el-table {
flex: none;
border-left: 1px solid #D0D4DC;
border-top: 1px solid #D0D4DC;
}
}
::v-deep .ai-list__content--right {
margin-left: 1px;
.ai-list__content--right-wrapper {
height: 100%;
.ai-empty {
height: 100%;
}
}
}
}
</style>

View File

@@ -0,0 +1,53 @@
<template>
<div class="AppPartyMember">
<component ref="component" :is="component" :selected.sync="selected" :instance="instance"
:dict="dict"/>
</div>
</template>
<script>
import List from './components/List'
import Add from './components/Add'
import Detail from './components/Detail'
import {mapState} from "vuex";
export default {
name: 'AppPartyMember',
label: '党员管理',
components: {
Add,
List,
Detail
},
props: {
instance: Function,
dict: Object
},
data() {
return {
selected: {}
}
},
computed: {
...mapState(['user']),
component() {
if (this.$route.hash == "#add") {
return Add
} else if (this.$route.query.id) {
return Detail
} else return List
}
},
created() {
let {organizationId: id, organizationName: name} = this.user.info
this.selected = {id, name}
},
}
</script>
<style lang="scss" scoped>
.AppPartyMember {
height: 100%;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,497 @@
<template>
<ai-detail class="party-detail">
<template slot="title">
<ai-title title="党员信息详情" isShowBack isShowBottomBorder @onBackClick="cancel(true)"></ai-title>
</template>
<template slot="content">
<div>
<ai-card title="基本信息">
<template #content>
<ai-wrapper
label-width="72px">
<ai-avatar class="party-avatar" v-model="info.avatarUrl" :editable="false"></ai-avatar>
<ai-info-item label="姓名">{{ info.name }}</ai-info-item>
<ai-info-item label="性别" :value="dict.getLabel('sex', info.sex)"></ai-info-item>
<ai-info-item label="身份证号">
<ai-id mode="show" :value="info.idNumber" rightBtn/>
</ai-info-item>
<ai-info-item label="出生日期" :value="info.birthday"></ai-info-item>
<ai-info-item label="年龄">{{ info.age }}</ai-info-item>
<ai-info-item label="民族" :value="dict.getLabel('nation', info.nation)"></ai-info-item>
<ai-info-item label="籍贯" isLine :value="info.birthplaceAreaName"></ai-info-item>
<ai-info-item label="户籍地" isLine :value="info.householdAreaName"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="审核状态">
<template #content>
<ai-wrapper
label-width="72px">
<ai-info-item label="审核状态">
<span :class="'audit-' + info.auditStatus">{{ dict.getLabel('auditStatus', info.auditStatus) }}</span>
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="联络信息">
<template #content>
<ai-wrapper
label-width="72px">
<ai-info-item label="联系方式">{{ info.phone || '-' }}</ai-info-item>
<ai-info-item isLine label="现住址">{{
((info.currentAreaName || '') + (info.currentAddress || '')) || '-'
}}
</ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="党籍信息">
<template #content>
<ai-wrapper
label-width="72px">
<ai-info-item label="党籍状态" :value="dict.getLabel('partyStatus',info.partyStatus)"/>
<ai-info-item label="转正日期"
:value="info.turnPositiveTime ? info.turnPositiveTime.split(' ')[0] : '-'"></ai-info-item>
<ai-info-item label="任职日期"
:value="info.partyStartDate ? info.partyStartDate.split(' ')[0] : '-'"></ai-info-item>
<ai-info-item label="党员类型" :value="dict.getLabel('partyType', info.partyType)"></ai-info-item>
<ai-info-item label="入党时间">{{
info.joinPartyTime ? info.joinPartyTime.split(' ')[0] : '-'
}}
</ai-info-item>
<ai-info-item label="党内兼职" :value="info.partyWork"></ai-info-item>
<ai-info-item label="党内职务" :value="dict.getLabel('partyPosition', info.partyPosition)"></ai-info-item>
<ai-info-item label="入党介绍人" :value="info.joinPartyIntroducer"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="流动信息">
<template #content>
<ai-wrapper
label-width="72px">
<ai-info-item label="流动情况" :value="dict.getLabel('flowStatus', info.flowStatus)"></ai-info-item>
<ai-info-item label="流入组织" v-if="info.flowStatus == 1" :value="info.flowOrgId"></ai-info-item>
<ai-info-item label="流入时间" v-if="info.flowStatus == 1"
:value="info.flowTime ? info.flowTime.split(' ')[0] : '-'"></ai-info-item>
<ai-info-item label="流出组织" v-if="info.flowStatus == 0" :value="info.outFlow"></ai-info-item>
<ai-info-item label="流出时间" v-if="info.flowStatus == 0"
:value="info.inTime ? info.inTime.split(' ')[0] : '-'"></ai-info-item>
<ai-info-item label="失联时间" v-if="info.flowStatus == 2"
:value="info.lossTime ? info.lossTime.split(' ')[0] : '-'"></ai-info-item>
</ai-wrapper>
</template>
</ai-card>
<ai-card title="文化程度">
<template #content>
<ai-wrapper
label-width="72px">
<ai-info-item label="学历" :value="dict.getLabel('education', info.education)"></ai-info-item>
</ai-wrapper>
<el-tabs v-model="activeName">
<el-tab-pane label="五星党员" name="五星党员" lazy></el-tab-pane>
<el-tab-pane label="工作信息" name="工作信息" lazy></el-tab-pane>
<el-tab-pane label="违纪信息" name="违纪信息" lazy></el-tab-pane>
</el-tabs>
<div class="add-btn">
<span></span>
<div @click="addForm(activeName)">
<i class="iconfont iconAdd"></i>
<span>添加{{ activeName }}</span>
</div>
</div>
<ai-table
v-if="activeName === '五星党员'"
:border="true"
:tableData="info.starList"
:isShowPagination="false"
:col-configs="colConfigs1"
:stripe="false"
@getList="() => {}">
<el-table-column label="评定等级" slot="level" align="center">
<template slot-scope="{row}">
<el-rate v-model="row.level" disabled show-text :texts="textlist"></el-rate>
</template>
</el-table-column>
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="editStar(row)">编辑</el-button>
<el-button type="text" @click="remove(row.id, '/app/apppartyfivestar/delete')">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-table
v-if="activeName === '工作信息'"
:border="true"
:tableData="info.workInfoList"
:isShowPagination="false"
:col-configs="colConfigs2"
:stripe="false"
@getList="() => {}">
<el-table-column label="工作时间" slot="date" align="center">
<template slot-scope="{row}">
<span v-if="row.starTime && row.endTime">{{
row.starTime.split(' ')[0]
}} {{ row.endTime.split(' ')[0] }}</span>
</template>
</el-table-column>
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="editJob(row)">编辑</el-button>
<el-button type="text" @click="remove(row.id, '/app/apppartyworkinfo/delete')">删除</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-table
v-if="activeName === '违纪信息'"
:border="true"
:tableData="info.disciplinaryInfoList"
:isShowPagination="false"
:col-configs="colConfigs3"
:stripe="false"
@getList="() => {}">
<el-table-column slot="options" width="120px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="editDisciplinary(row)">编辑</el-button>
<el-button type="text" @click="remove(row.id, '/app/apppartydisciplinaryinfo/delete')">删除
</el-button>
</div>
</template>
</el-table-column>
</ai-table>
</template>
</ai-card>
<ai-dialog
:visible.sync="isShowStarForm"
width="690px"
:title="starId ? '修改五星党员' : '添加五星党员'"
@close="onClose"
@onConfirm="onStarForm">
<el-form ref="starForm" :model="starForm" label-width="110px" label-position="right">
<el-form-item label="评定时间" prop="starTime"
:rules="[{ required: true, message: '请选择评定时间', trigger: 'change' }]">
<el-date-picker
size="small"
v-model="starForm.starTime"
type="month"
placeholder="请选择评定时间"
style="width: 230px;" format="yyyy-MM"
:value-format="'yyyy-MM-dd'+ ' 00:00:00'">
</el-date-picker>
</el-form-item>
<el-form-item label="评定等级" prop="level"
:rules="[{ required: true, message: '请选择评定等级', trigger: 'change' }]">
<el-rate v-model="starForm.level" show-text :texts="textlist" style="line-height: 2.5;"></el-rate>
</el-form-item>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowJobForm"
width="690px"
:title="jobId ? '修改工作信息' : '添加工作信息'"
@close="onClose"
@onConfirm="onJobForm">
<el-form ref="jobForm" :model="jobForm" label-width="110px" label-position="right">
<el-form-item label="工作时间" prop="date" :rules="[{ required: true, message: '请选择评定时间', trigger: 'change' }]">
<el-date-picker
size="small"
v-model="jobForm.date"
type="monthrange"
range-separator=""
start-placeholder="开始月份" end-placeholder="结束月份" format="yyyy-MM"
:value-format="'yyyy-MM-dd'+ ' 00:00:00'">
</el-date-picker>
</el-form-item>
<el-form-item label="单位" prop="company" :rules="[{ required: true, message: '请输入工作单位', trigger: 'blur' }]">
<el-input size="small" :maxLength="30" v-model="jobForm.company" placeholder="请输入工作单位"></el-input>
</el-form-item>
<el-form-item label="职务" prop="position" :rules="[{ required: true, message: '请输入职务', trigger: 'blur' }]">
<el-input size="small" :maxLength="30" v-model="jobForm.position" placeholder="请输入职务"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
<ai-dialog
:visible.sync="isShowDisciplinaryForm"
width="690px"
:title="disciplinaryId ? '修改违纪信息' : '添加违纪信息'"
@close="onClose"
@onConfirm="onDisciplinarForm">
<el-form ref="disciplinaryForm" :model="disciplinaryForm" label-width="110px" label-position="right">
<el-form-item label="时间" prop="starTime"
:rules="[{ required: true, message: '请选择违纪时间', trigger: 'change' }]">
<el-date-picker
size="small"
v-model="disciplinaryForm.starTime"
type="month"
placeholder="请选择违纪时间"
style="width: 230px;" format="yyyy-MM"
:value-format="'yyyy-MM-dd'+ ' 00:00:00'">
</el-date-picker>
</el-form-item>
<el-form-item label="违纪原因" prop="disciplinaryInfo"
:rules="[{ required: true, message: '请输入违纪原因', trigger: 'blur' }]">
<el-input size="small" v-model="disciplinaryForm.disciplinaryInfo" placeholder="请输入违纪原因"></el-input>
</el-form-item>
<el-form-item label="处理结果" prop="result" :rules="[{ required: true, message: '请输入处理结果', trigger: 'blur' }]">
<el-input size="small" v-model="disciplinaryForm.result" placeholder="请输入处理结果"></el-input>
</el-form-item>
</el-form>
</ai-dialog>
</div>
</template>
</ai-detail>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'detail',
props: {
instance: Function,
dict: Object,
params: Object
},
data() {
return {
info: {},
isShowStarForm: false,
isShowJobForm: false,
jobForm: {
date: [],
company: '',
position: ''
},
jobId: '',
starForm: {
starTime: '',
level: 1
},
disciplinaryId: '',
isShowDisciplinaryForm: false,
disciplinaryForm: {
starTime: '',
disciplinaryInfo: '',
result: ''
},
starId: '',
activeName: '五星党员',
textlist: ['一星党员', '二星党员', '三星党员', '四星党员', '五星党员'],
colConfigs1: [
{prop: 'starTime', label: '评定时间', align: 'center', formart: v => v ? v.split(' ')[0] : '-'},
{slot: 'level'}
],
colConfigs2: [
{slot: 'date'},
{prop: 'company', label: '单位', align: 'center'},
{prop: 'position', label: '职务', align: 'center'}
],
colConfigs3: [
{prop: 'starTime', label: '时间', align: 'center', formart: v => v ? v.split(' ')[0] : '-'},
{prop: 'disciplinaryInfo', label: '违纪原因', align: 'center'},
{prop: 'result', label: '处理结果', align: 'center'}
]
}
},
computed: {
...mapState(['user'])
},
created() {
this.getInfo()
},
methods: {
getInfo() {
let {id} = this.$route.query
id && this.instance.post(`/app/appparty/detail`, null, {
params: {id}
}).then(res => {
if (res?.data) {
this.info = res.data
}
})
},
remove(id, apiUrl) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`${apiUrl}?ids=${id}`).then(res => {
if (res.code == 0) {
this.getInfo()
this.$message.success('删除成功!')
}
})
})
},
editJob(query) {
this.jobForm = {
...query,
date: [query.starTime, query.endTime]
}
this.jobId = query.id
this.isShowJobForm = true
},
editStar(query) {
this.starForm = {
...query
}
this.starId = query.id
this.isShowStarForm = true
},
editDisciplinary(query) {
this.disciplinaryForm = {
...query
}
this.disciplinaryId = query.id
this.isShowDisciplinaryForm = true
},
onDisciplinarForm() {
this.$refs.disciplinaryForm.validate((valid) => {
if (valid) {
this.instance.post(`/app/apppartydisciplinaryinfo/addOrUpdate`, {
...this.disciplinaryForm,
partyId: this.params.id
}).then(res => {
if (res.code == 0) {
this.isShowDisciplinaryForm = false
this.getInfo()
this.$message.success(this.jobId ? '编辑成功' : '新增成功')
}
})
}
})
},
onJobForm() {
this.$refs.jobForm.validate((valid) => {
if (valid) {
this.instance.post(`/app/apppartyworkinfo/addOrUpdate`, {
...this.jobForm,
starTime: this.jobForm.date[0],
endTime: this.jobForm.date[1],
partyId: this.params.id
}).then(res => {
if (res.code == 0) {
this.isShowJobForm = false
this.getInfo()
this.$message.success(this.jobId ? '编辑成功' : '新增成功')
}
})
}
})
},
onStarForm() {
this.$refs.starForm.validate((valid) => {
if (valid) {
this.instance.post(`/app/apppartyfivestar/addOrUpdate`, {
...this.starForm,
idNumber: this.info.idNumber,
partyId: this.params.id
}).then(res => {
if (res.code == 0) {
this.isShowStarForm = false
this.getInfo()
this.$message.success(this.starId ? '编辑成功' : '新增成功')
}
})
}
})
},
onClose() {
this.starId = ''
this.jobId = ''
this.disciplinaryId = ''
this.starForm.level = 0
this.starForm.id = ''
this.starForm.starTime = ''
this.jobForm.date = []
this.jobForm.company = ''
this.jobForm.id = ''
this.jobForm.position = ''
this.disciplinaryForm.starTime = ''
this.disciplinaryForm.id = ''
this.disciplinaryForm.disciplinaryInfo = ''
this.disciplinaryForm.result = ''
},
addForm(type) {
if (type === '五星党员') {
this.isShowStarForm = true
} else if (type === '工作信息') {
this.isShowJobForm = true
} else {
this.isShowDisciplinaryForm = true
}
},
cancel() {
this.$router.push({})
}
}
}
</script>
<style scoped lang="scss">
.party-detail {
::v-deep .AiID {
line-height: 1.4;
color: #222;
.el-button {
height: auto;
padding: 0 8px 0 0;
}
}
.party-avatar {
position: absolute;
right: 100px;
}
}
.audit-0 {
color: #FF8822 !important;
}
.audit-1 {
color: #2EA222 !important;
}
.add-btn {
display: flex;
align-items: center;
justify-content: space-between;
margin: 10px 0 20px;
div {
display: flex;
align-items: center;
color: #2266FF;
font-size: 14px;
&:hover {
opacity: 0.6;
cursor: pointer;
user-select: none;
}
i {
line-height: 1;
margin-right: 4px;
}
}
}
</style>

View File

@@ -0,0 +1,288 @@
<template>
<ai-list class="partyList">
<template slot="title">
<ai-title title="党员管理" isShowBottomBorder/>
</template>
<template #left>
<ai-tree-menu title="组织目录" searchPlaceholder="请输入党组织名称" @search="v=>orgTree.filter(v)">
<ai-party-tree
:filter-node-method="filterNode"
ref="tree"
:instance="instance"
:root="user.info.organizationId"
:current-node-key="selected.id"
@select="onTreeChange"/>
</ai-tree-menu>
</template>
<template slot="content">
<ai-search-bar>
<template #left>
<ai-select v-model="search.sex" placeholder="请选择性别" :selectList="dict.getDict('sex')"
@change="search.current = 1, getList()"></ai-select>
<ai-select v-model="search.nation" placeholder="请选择民族" :selectList="dict.getDict('nation')"
@change="search.current = 1, getList()"></ai-select>
<ai-select v-model="search.partyStatus" placeholder="请选择党籍状态" :selectList="dict.getDict('partyStatus')"
@change="search.current = 1, getList()"></ai-select>
<ai-select v-model="search.flowStatus" placeholder="请选择流动状态" :selectList="dict.getDict('flowStatus')"
@change="search.current = 1, getList()"></ai-select>
<ai-select v-model="search.education" placeholder="请选择文化程度" :selectList="dict.getDict('education')"
@change="search.current = 1, getList()"></ai-select>
<ai-select v-model="search.partyPosition" placeholder="请选择党内职务" :selectList="dict.getDict('partyPosition')"
@change="search.current = 1, getList()"></ai-select>
<ai-select v-model="search.disciplinary" placeholder="请选择违纪情况" :selectList="dict.getDict('disciplinary')"
@change="search.current = 1, getList()"></ai-select>
<ai-search label="出生日期">
<el-date-picker
size="small"
v-model="search.birthStart"
type="date"
placeholder="开始日期"
format="yyyy-MM-dd"
style="width: 180px"
@change="search.current = 1, getList()"
clearable
:value-format="'yyyy-MM-dd'+' 00:00:00'"/>
<el-date-picker
size="small"
v-model="search.birthEnd"
type="date"
placeholder="结束日期"
format="yyyy-MM-dd"
style="width: 180px"
@change="search.current = 1, getList()"
clearable
:value-format="'yyyy-MM-dd'+' 23:59:59'"/>
</ai-search>
<ai-search label="入党时间">
<el-date-picker
size="small"
v-model="search.joinPartyStart"
type="date"
style="width: 180px"
placeholder="开始日期"
format="yyyy-MM-dd"
@change="search.current = 1, getList()"
clearable
:value-format="'yyyy-MM-dd'+' 00:00:00'">
</el-date-picker>
<el-date-picker
size="small"
v-model="search.joinPartyEnd"
type="date"
style="width: 180px"
placeholder="结束日期"
format="yyyy-MM-dd"
@change="search.current = 1, getList()"
clearable
:value-format="'yyyy-MM-dd'+' 23:59:59'">
</el-date-picker>
</ai-search>
<ai-search label="年龄">
<ai-range v-model="search.age" ref="resetagefoo" @change="search.current = 1, getList()"
@closeVal="search.age = []"/>
</ai-search>
</template>
<template slot="right">
<el-input
v-model="search.con"
size="small"
@keyup.enter.native="search.current = 1, getList()"
placeholder="请输入姓名或身份证"
clearable
@clear="search.current = 1, search.con = '', getList()"
suffix-icon="iconfont iconSearch">
</el-input>
</template>
</ai-search-bar>
<ai-search-bar>
<template #left>
<el-button size="small" :disabled="!isShowAddBtn" type="primary" icon="iconfont iconAdd" @click="toAdd()">
添加党员
</el-button>
</template>
<template #right>
<ai-import :instance="instance" :dict="dict" type="appparty" name="党员管理" @success="getList()"></ai-import>
<ai-download :instance="instance" :params="exportQuery" url="/app/appparty/export2" fileName="党员明细"/>
</template>
</ai-search-bar>
<ai-table
:dict="dict"
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
v-loading="loading"
style="margin-top: 6px;"
:current.sync="search.current"
:size.sync="search.size"
@handleSelectionChange="handleSelectionChange"
@getList="getList">
<el-table-column slot="options" width="160px" fixed="right" label="操作" align="center">
<template slot-scope="{ row }">
<div class="table-options">
<el-button type="text" @click="toDetail(row.id)">详情</el-button>
<el-button type="text" @click="toAdd(row.id)">编辑</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button>
</div>
</template>
</el-table-column>
<div slot="paginationBtns" class="party-table__btns">
<span style="margin-right: 8px;" @click="removeAll">批量删除</span>
</div>
</ai-table>
</template>
</ai-list>
</template>
<script>
import {mapState} from 'vuex'
export default {
name: 'List',
props: {
instance: Function,
dict: Object,
selected: Object
},
data() {
return {
search: {
current: 1,
size: 10,
con: '',
age: [],
sex: '',
nation: '',
partyStatus: '',
flowStatus: '',
education: '',
partyPosition: '',
birthStart: '',
birthEnd: '',
turnPositiveStart: '',
turnPositiveEnd: '',
joinPartyStart: '',
joinPartyEnd: ''
},
orgName: '',
loading: false,
total: 0,
colConfigs: [
{type: 'selection', label: ''},
{prop: 'name', label: '姓名', align: 'center'},
{prop: 'sex', label: '性别', align: 'center', dict: 'sex'},
{prop: 'age', label: '年龄', align: 'center'},
{
prop: 'auditStatus', label: '审核状态', align: 'center',
render: (h, {row}) => h('span', {class: `audit-${row.auditStatus}`}, this.dict.getLabel('auditStatus', row.auditStatus))
},
{prop: 'partyStatus', label: '党籍状态', align: 'center', dict: 'partyStatus'},
{prop: 'joinPartyTime', label: '入党日期', align: 'center', formart: v => v ? v.split(' ')[0] : '-'},
{prop: 'partyPosition', label: '党内职务', align: 'center', dict: 'partyPosition'},
{prop: 'flowStatus', label: '流动状态', align: 'center', dict: 'flowStatus'},
],
tableData: [],
ids: '',
}
},
computed: {
...mapState(['user']),
orgTree() {
return this.$refs.tree?.$refs?.partyTree
},
exportQuery() {
let {id: partyOrgId} = this.selected
return {
ids: this.ids ? this.ids.split(',') : [],
...this.search, partyOrgId
}
},
isShowAddBtn() {
return this.selected.isLeaf == 1
}
},
created() {
this.dict.load('disciplinary', 'partyType', 'sex', 'nation', 'education', 'partyStatus', 'partyPosition', 'flowStatus', 'auditStatus')
this.getList()
},
methods: {
onTreeChange(e) {
this.$emit("update:selected", e)
this.getList(e.id)
},
getList(partyOrgId) {
this.loading = true
partyOrgId = partyOrgId || this.selected.id
this.instance.post(`/app/appparty/list`, null, {
params: {partyOrgId, ...this.search, age: this.search.age?.join(',')}
}).then(res => {
this.loading = false
if (res?.data) {
this.tableData = res.data.records
this.total = res.data.total
}
}).catch(() => {
this.loading = false
})
},
removeAll() {
if (!this.ids) {
return this.$message.error('请选择党员')
}
this.remove(this.ids)
},
handleSelectionChange(e) {
this.ids = e.map(v => v.id).join(',')
},
filterNode(value, data) {
if (!value) return true
return data.name.indexOf(value) !== -1
},
remove(id) {
this.$confirm('确定删除该数据?').then(() => {
this.instance.post(`/app/appparty/delete?ids=${id}`).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
toDetail(id) {
this.$router.push({query: {id}})
},
toAdd(id) {
let {id: oid, name: oname} = this.selected
this.$router.push({query: {id, oid, oname}, hash: "#add"})
}
}
}
</script>
<style lang="scss" scoped>
.partyList {
.party-table__btns {
display: flex;
align-items: center;
}
::v-deep .audit-0 {
color: #FF8822 !important;
}
::v-deep .audit-1 {
color: #2EA222 !important;
}
::v-deep .ai-list__content--right {
flex: 1;
min-width: 0;
margin-left: 1px;
box-shadow: none;
.ai-list__content--right-wrapper {
width: 100%;
}
}
}
</style>