初始化
This commit is contained in:
1188
packages/party/partyMember/components/Add.vue
Normal file
1188
packages/party/partyMember/components/Add.vue
Normal file
File diff suppressed because it is too large
Load Diff
497
packages/party/partyMember/components/Detail.vue
Normal file
497
packages/party/partyMember/components/Detail.vue
Normal 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>
|
||||
288
packages/party/partyMember/components/List.vue
Normal file
288
packages/party/partyMember/components/List.vue
Normal 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>
|
||||
Reference in New Issue
Block a user