This commit is contained in:
=
2026-06-12 14:38:45 +08:00
parent 8291531e6e
commit f65bcf7b67
32 changed files with 4743 additions and 0 deletions
@@ -0,0 +1,363 @@
/**
*Desc:
*Create by: jug
*Create time:2023/11/20/16:49
*/
<template>
<div>
<el-form :model="formData" :rules="formRules" label-width="0" ref="form" class="flow-task-form">
<el-descriptions :column="3" border>
<el-descriptions-item label="工号">
<el-form-item prop="loginname">
<el-input v-model="formData.loginname" maxlength="120" size="small"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="姓名">
<el-form-item prop="username">
<el-input v-model="formData.username" maxlength="100" size="small"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="性别">
<el-form-item prop="sex">
<el-radio-group v-model="formData.sex" size="small">
<el-radio border label="男">男</el-radio>
<el-radio border label="女">女</el-radio>
</el-radio-group>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="民族">
<el-form-item prop="nation">
<dict-select style="width: 100%" placeholder="请选择民族" v-model="formData.nation"
code="USER_NATION"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出生日期">
<el-form-item prop="birthday">
<el-date-picker v-model="formData.birthday" type="date"
placeholder="请选择出生日期"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="籍贯">
<el-form-item prop="nativePlace">
<el-input v-model="formData.nativePlace" maxlength="100" placeholder="请输入籍贯"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="政治面貌">
<el-form-item prop="political">
<dict-select style="width: 100%" placeholder="请选择政治面貌" v-model="formData.political"
code="USER_POLITICAL"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="入党时间">
<el-form-item prop="joinPartyDate">
<el-date-picker v-model="formData.joinPartyDate" type="date"
placeholder="请选择入党时间"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="学历">
<el-form-item prop="education">
<dict-select style="width: 100%" placeholder="请选择学历" v-model="formData.education"
code="USER_EDUCATION"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="学位">
<el-form-item prop="academicDegree">
<dict-select style="width: 100%" placeholder="请选择学位" v-model="formData.academicDegree"
code="USER_ACADEMIC_DEGREE"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="婚姻状况">
<el-form-item prop="marriage">
<el-input v-model="formData.marriage" maxlength="50" placeholder="请输入婚姻状况"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="党政职务">
<el-form-item prop="position">
<el-input v-model="formData.position" maxlength="50" placeholder="请输入党政职务"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="职称">
<el-form-item prop="professionalTitle">
<el-input v-model="formData.professionalTitle" maxlength="50" placeholder="请输入职称"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="编制类别">
<el-form-item prop="preparedBy">
<el-input v-model="formData.preparedBy" maxlength="30" placeholder="请输入编制类别"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="来校时间">
<el-form-item prop="arrivalAtSchoolDate">
<el-input v-model="formData.arrivalAtSchoolDate" maxlength="20" placeholder="请输入来校时间"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="从教年月">
<el-form-item prop="teachingTime">
<el-date-picker v-model="formData.teachingTime" type="date"
placeholder="请选择从教年月"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="入会时间">
<el-form-item prop="memberTime">
<el-date-picker v-model="formData.memberTime" type="date"
placeholder="请选择入会时间"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属校区">
<el-form-item prop="campusName">
<el-input v-model="formData.campusName" readonly placeholder="系统自动显示"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="工作单位">
<el-form-item prop="unitId">
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
v-model="formData.unitId" @change="handleUnitChange">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in units"></el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="所属工会">
<el-form-item prop="unionName">
<el-input v-model="formData.unionName" readonly placeholder="系统自动显示"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="工会小组">
<el-form-item prop="unionGroupName">
<el-input v-model="formData.unionGroupName" readonly placeholder="系统自动显示"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="在职状态">
<el-form-item prop="userState">
<dict-select v-model="formData.userState" code="USER_STATE" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="教职工类别">
<el-form-item prop="personType">
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE" style="width: 100%"></dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="退休时间">
<el-form-item prop="retireDate">
<el-date-picker v-model="formData.retireDate" type="date"
placeholder="请选择退休时间"
value-format="yyyy-MM-dd"
style="width: 100%"></el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="身份证号码">
<el-form-item prop="idCard">
<el-input v-model="formData.idCard" maxlength="30" placeholder="请输入身份证号码"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="联系电话">
<el-form-item prop="mobile">
<el-input v-model="formData.mobile" maxlength="32" placeholder="请输入联系电话"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="电子邮箱">
<el-form-item prop="email">
<el-input v-model="formData.email" maxlength="255" placeholder="请输入电子邮箱"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-form-item prop="families">
<el-table :data="formData.families" border size="small">
<el-table-column label="关系" prop="relation">
<template slot-scope="{row}">
<el-input v-model="row.relation" maxlength="50" placeholder="请输入与本人关系"></el-input>
</template>
</el-table-column>
<el-table-column label="姓名" prop="name">
<template slot-scope="{row}">
<el-input v-model="row.name" maxlength="50" placeholder="请输入姓名"></el-input>
</template>
</el-table-column>
<el-table-column label="工作单位" prop="unit">
<template slot-scope="{row}">
<el-input v-model="row.unit" maxlength="100" placeholder="请输入工作单位"></el-input>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark">
<template slot-scope="{row}">
<el-input v-model="row.remark" maxlength="100" placeholder="请输入备注"></el-input>
</template>
</el-table-column>
<el-table-column width="100px">
<template slot="header" slot-scope="scope">
<el-button type="primary" size="mini" @click="addFamily">添加</el-button>
</template>
<template slot-scope="scope">
<el-button type="danger" icon="el-icon-delete" size="mini"
@click="removeFamily(scope.$index)"></el-button>
</template>
</el-table-column>
</el-table>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="个人简历" :span="3">
<el-form-item prop="personalData">
<el-input type="textarea" :rows="4" v-model="formData.personalData" maxlength="2000"
placeholder="请输入个人简历"></el-input>
</el-form-item>
</el-descriptions-item>
</el-descriptions>
</el-form>
<el-row :gutter="10" class="mt10" type="flex" justify="end">
<el-button @click="doSubmit" type="primary">确定</el-button>
</el-row>
</div>
</template>
<script>
module.exports = {
name: "userEdit",
data() {
return {
userId: null,
units: [],
formData: this.defaultFormData(),
formRules: {
loginname: [{required: true, message: "必填", trigger: ["change", "blur"]}],
username: [{required: true, message: "必填", trigger: ["change", "blur"]}],
sex: [{required: true, message: "必填", trigger: ["change", "blur"]}],
userState: [{required: true, message: "必填", trigger: ["change", "blur"]}],
personType: [{required: true, message: "必填", trigger: ["change", "blur"]}]
}
}
},
components: {
'dict-select': httpVueLoader('/components/plugins/sysDict/DictSelect.vue?v=1.0.0')
},
methods: {
// 新增和重置共用默认值,避免页面直接修改同一个对象引用。
defaultFormData() {
return {
userState: '退休',
personType: '离退休人员',
families: []
}
},
doSubmit() {
this.$refs.form.validate(async valid => {
if (valid) {
const {code, msg} = await $.post('/platform/retired/list/doSubmit', {
user: JSON.stringify(this.formData),
userId: this.userId
})
if (code === 0) {
this.$message.success(msg)
this.$emit('finish')
} else {
this.$message.warning(msg)
}
}
})
},
reset() {
this.$set(this, "userId", null)
this.$set(this, "formData", this.defaultFormData())
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate()
}
})
},
async getInfo(id) {
this.$set(this, "userId", id)
const resp = await $.post('/platform/retired/list/userInfo', {userId: this.userId})
const data = this.normalizeUserData(resp.data || {})
this.$set(this, "formData", data)
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate()
}
})
},
handleUnitChange(unitId) {
const unit = this.units.find(item => item.id === unitId)
this.$set(this.formData, "unitName", unit ? unit.name : null)
},
addFamily() {
const families = (this.formData.families || []).concat([{}])
this.$set(this.formData, "families", families)
},
removeFamily(index) {
const families = (this.formData.families || []).slice()
families.splice(index, 1)
this.$set(this.formData, "families", families)
},
async loadUnits() {
const units = await this.$businessTool.listUnit()
this.$set(this, "units", units || [])
},
normalizeUserData(user) {
const data = Object.assign(this.defaultFormData(), user)
// 详情数据可能来自视图或实体,统一把大小写差异字段整理成页面绑定的驼峰字段。
const fieldMap = {
idcard: "idCard",
idcardtype: "idCardType",
unitid: "unitId",
unitname: "unitName",
unionid: "unionId",
unionname: "unionName",
uniongroupid: "unionGroupId",
uniongroupname: "unionGroupName",
joinpartydate: "joinPartyDate",
nativeplace: "nativePlace",
academicdegree: "academicDegree",
professionaltitle: "professionalTitle",
arrivalatschooldate: "arrivalAtSchoolDate",
teachingtime: "teachingTime",
userstate: "userState",
persontype: "personType",
retiredate: "retireDate",
membertime: "memberTime",
personaldata: "personalData",
campusname: "campusName",
threeunitname: "threeUnitName",
retiredgroupname: "retiredGroupName",
retiredpartybranchname: "retiredPartyBranchName"
}
Object.keys(fieldMap).forEach(key => {
if ((data[fieldMap[key]] === undefined || data[fieldMap[key]] === null) && user[key] !== undefined) {
this.$set(data, fieldMap[key], user[key])
}
})
if (typeof data.families === "string") {
try {
this.$set(data, "families", JSON.parse(data.families))
} catch (e) {
this.$set(data, "families", [])
}
} else if (!data.families) {
this.$set(data, "families", [])
}
return data
}
},
created() {
this.loadUnits()
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,168 @@
/**
*Desc:
*Create by: jug
*Create time:2023/7/25/9:14
*/
<template>
<div>
<el-descriptions :column="3" border>
<el-descriptions-item label="工号">{{ emptyText(formData.loginname) }}</el-descriptions-item>
<el-descriptions-item label="姓名">{{ emptyText(formData.username) }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ emptyText(formData.sex) }}</el-descriptions-item>
<el-descriptions-item label="民族">{{ emptyText(formData.nation) }}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{ formatDate(formData.birthday) }}</el-descriptions-item>
<el-descriptions-item label="籍贯">{{ emptyText(formData.nativePlace) }}</el-descriptions-item>
<el-descriptions-item label="政治面貌">{{ emptyText(formData.political) }}</el-descriptions-item>
<el-descriptions-item label="入党时间">{{ formatDate(formData.joinPartyDate) }}</el-descriptions-item>
<el-descriptions-item label="婚姻状况">{{ emptyText(formData.marriage) }}</el-descriptions-item>
<el-descriptions-item label="学历">{{ emptyText(formData.education) }}</el-descriptions-item>
<el-descriptions-item label="学位">{{ emptyText(formData.academicDegree) }}</el-descriptions-item>
<el-descriptions-item label="党政职务">{{ emptyText(formData.position) }}</el-descriptions-item>
<el-descriptions-item label="职称">{{ emptyText(formData.professionalTitle) }}</el-descriptions-item>
<el-descriptions-item label="编制类别">{{ emptyText(formData.preparedBy) }}</el-descriptions-item>
<el-descriptions-item label="来校时间">{{ formatDate(formData.arrivalAtSchoolDate) }}</el-descriptions-item>
<el-descriptions-item label="从教年月">{{ formatDate(formData.teachingTime) }}</el-descriptions-item>
<el-descriptions-item label="入会时间">{{ formatDate(formData.memberTime) }}</el-descriptions-item>
<el-descriptions-item label="所属校区">{{ emptyText(formData.campusName) }}</el-descriptions-item>
<el-descriptions-item label="工作单位">{{ emptyText(formData.unitName) }}</el-descriptions-item>
<el-descriptions-item label="所属工会">{{ emptyText(formData.unionName) }}</el-descriptions-item>
<el-descriptions-item label="工会小组">{{ emptyText(formData.unionGroupName) }}</el-descriptions-item>
<el-descriptions-item label="所在科室">{{ emptyText(formData.threeUnitName) }}</el-descriptions-item>
<el-descriptions-item label="离退休小组">{{ emptyText(formData.retiredGroupName) }}</el-descriptions-item>
<el-descriptions-item label="离退休党支部">{{ emptyText(formData.retiredPartyBranchName) }}</el-descriptions-item>
<el-descriptions-item label="在职状态">{{ emptyText(formData.userState) }}</el-descriptions-item>
<el-descriptions-item label="教职工类别">{{ emptyText(formData.personType) }}</el-descriptions-item>
<el-descriptions-item label="退休时间">{{ formatDate(formData.retireDate) }}</el-descriptions-item>
<el-descriptions-item label="身份证号码">{{ emptyText(formData.idCard) }}</el-descriptions-item>
<el-descriptions-item label="联系电话">{{ emptyText(formData.mobile) }}</el-descriptions-item>
<el-descriptions-item label="电子邮箱">{{ emptyText(formData.email) }}</el-descriptions-item>
<el-descriptions-item label="家庭主要成员" :span="3">
<el-table v-if="formData.families && formData.families.length"
:data="formData.families" size="mini" border
:header-cell-style="{background:'#eff3f6'}"
style="width: 100%">
<el-table-column prop="relation" label="与本人关系" align="center"></el-table-column>
<el-table-column prop="name" label="姓名" align="center"></el-table-column>
<el-table-column prop="unit" label="单位" align="center"></el-table-column>
<el-table-column prop="remark" label="备注" align="center"></el-table-column>
</el-table>
<el-empty v-else :image-size="50" description="暂无家庭成员信息"></el-empty>
</el-descriptions-item>
<el-descriptions-item label="个人简历" :span="3">
<div v-if="formData.personalData" class="text-left" v-html="formData.personalData"></div>
<el-tag type="warning" v-else>暂无</el-tag>
</el-descriptions-item>
</el-descriptions>
<slot></slot>
</div>
</template>
<script>
module.exports = {
name: "userInfo",
props: {
id: {
type: String,
required: true
}
},
data() {
return {
formData: {}
}
},
methods: {
formatDate(val) {
if (val) {
return moment(val).format('YYYY-MM-DD')
}
return '暂无'
},
emptyText(val) {
if (val === undefined || val === null || val === '') {
return '暂无'
}
return val
},
getInfo() {
if (this.id) {
$.post('/platform/retired/list/userInfo', {userId: this.id}).then(res => {
this.$set(this, "formData", this.normalizeUserData(res.data || {}))
})
} else {
this.$set(this, "formData", {})
}
},
normalizeUserData(user) {
const data = Object.assign({}, user)
// 兼容视图查询和实体查询返回字段大小写不一致的情况,保证查看页字段能正常回显。
const fieldMap = {
idcard: "idCard",
idcardtype: "idCardType",
unitid: "unitId",
unitname: "unitName",
unionid: "unionId",
unionname: "unionName",
uniongroupid: "unionGroupId",
uniongroupname: "unionGroupName",
joinpartydate: "joinPartyDate",
nativeplace: "nativePlace",
academicdegree: "academicDegree",
professionaltitle: "professionalTitle",
arrivalatschooldate: "arrivalAtSchoolDate",
teachingtime: "teachingTime",
userstate: "userState",
persontype: "personType",
retiredate: "retireDate",
membertime: "memberTime",
personaldata: "personalData",
campusname: "campusName",
threeunitname: "threeUnitName",
retiredgroupname: "retiredGroupName",
retiredpartybranchname: "retiredPartyBranchName"
}
Object.keys(fieldMap).forEach(key => {
if ((data[fieldMap[key]] === undefined || data[fieldMap[key]] === null) && user[key] !== undefined) {
this.$set(data, fieldMap[key], user[key])
}
})
if (typeof data.families === "string") {
try {
this.$set(data, "families", JSON.parse(data.families))
} catch (e) {
this.$set(data, "families", [])
}
} else if (!data.families) {
this.$set(data, "families", [])
}
return data
}
},
watch: {
id: {
handler: function (val) {
this.getInfo()
},
immediate: true
}
},
created() {
}
}
</script>
<style scoped>
</style>
@@ -0,0 +1,101 @@
<template>
<div class="v-tree-layout">
<div class="shrink" :style="'left:' + (showTree ? 'calc(20% - 15px)' : '0')" @click="shrink">
<i v-if="!showTree" class="el-icon-arrow-right"></i>
<i v-else class="el-icon-arrow-left"></i>
</div>
<div class="v-tree-layout-left" :style="{width: showTree ? '20%' : '0'}">
<slot name="tree"></slot>
</div>
<div class="v-tree-layout-right" :style="{width: showTree ? '80%' : '100%'}">
<slot></slot>
</div>
</div>
</template>
<script>
module.exports = {
props: {},
data() {
return {
showTree: true
}
},
methods: {
shrink() {
this.showTree = !this.showTree
}
}
}
</script>
<style>
.shrink {
position: absolute;
height: 30px;
width: 30px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 15px;
background-color: white;
z-index: 99;
top: 0;
bottom: 0;
margin: auto;
box-shadow: 0 0 5px rgb(200, 200, 200);
cursor: pointer;
transition: all 500ms;
}
.shrink:hover {
box-shadow: 0 0 10px rgb(150, 150, 150);
}
.v-tree-layout-left::-webkit-scrollbar {
width: 4px;
height: 10px;
}
.v-tree-layout-left::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #dcdcdc;
}
.v-tree-layout-left::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px transparent;
border-radius: 10px;
background: transparent;
}
.v-tree-layout {
width: 100%;
height: 100%;
position: relative;
display: flex;
flex-direction: row;
}
.v-tree-layout-left {
width: 20%;
}
.v-tree-layout-left,
.v-tree-layout-left .el-tree {
background-color: #ffffff;
}
.v-tree-layout-right {
width: 80%;
border-left: 1px solid rgb(240, 240, 240);
}
.v-tree-layout-left,
.v-tree-layout-right {
height: 100%;
box-sizing: border-box;
overflow: auto;
transition: all 500ms;
position: relative;
}
</style>
@@ -0,0 +1,184 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年度"
style="width: 100%"
type="year"
v-model="pageForm.year"
:clearable="false"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input v-model="pageForm.searchKeyword" clearable maxlength="20"></el-input>
</div>
</div>
<div class="search-item"
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable
@change="flushUnits" @clear="flushUnits"
filterable>
<el-option v-for="item in unions" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">变更类型:</div>
<div class="search-item-option">
<el-select v-model="pageForm.changeType" style="width: 100%" clearable>
<el-option v-for="item in changeTypes" :label="item.desc" :value="item.code"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this"></table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template slot-scope="{row}">
<span v-if="column.prop==='unitname'">{{isDisPlayCode ? '(' + row.unitcode + ')' : ''}}{{row.unitname}}</span>
<span v-else-if="column.prop==='unionname'">{{isDisPlayCode ? '(' + row.unioncode + ')' : ''}}{{row.unionname}}</span>
<span v-else-if="column.prop==='changeType'">{{getChangeTypeName(row.changeType)}}</span>
<span v-else>{{row[column.prop]}}</span>
</template>
</el-table-column>
<!--<el-table-column align="center" header-align="center" label="操作" width="200px">
<template slot-scope="{row}">
<el-button size="mini" @click="openView(row.id)">查看</el-button>
</template>
</el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
isDisPlayCode: false,
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idCard', label: '身份证号', width: 170},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'professionalTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
{prop: 'political', label: '政治面貌', checked: 0},
{prop: 'changeType', label: '变更类型'}
],
changeTypes: [],
pageForm: {
year: (new Date().getFullYear()).toString()
}
}
},
methods: {
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (this.$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])) {
this.$set(this, "units", await this.$businessTool.listUnit(this.pageForm.unionId))
} else {
this.$set(this, "units", await this.$businessTool.listUnit(this.$store.state.user.union.id))
}
},
getChangeTypeName(changeType) {
const item = this.changeTypes.find(v => v.code === changeType)
return item ? item.desc : ''
},
openChange(row) {
this.$confirm('您确定要将' + row.username + '设为死亡吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/changeToDie', {userId: row.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async created() {
this.pageData()
this.$set(this, "changeTypes", [
{code: 1, desc: '在职转离退休'},
{code: 2, desc: '离退休转去世'}
])
this.$set(this, "unions", await this.$businessTool.listUnion())
this.flushUnits()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,514 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__body {
height: calc(100% - 40px);
}
.el-transfer-panel__list {
height: 100%;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
.el-transfer-panel__list.is-filterable {
height: 300px;
padding-top: 0;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-input
@input="(val)=>{$refs.tree.filter(val)}"
placeholder="输入关键字进行查找" clearable
v-model="filterText">
</el-input>
</div>
<el-tree ref="tree" :data="treeData" v-loading="treeLoading" node-key="id"
:props="{label:'groupName'}"
:expand-on-click-node="false"
:default-expanded-keys="['1']"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;
{{ data.label }}
</div>
<div v-if="node.level==2" style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-school"></i>
&nbsp; {{ data.label }}
</div>
</div>
</el-tree>
</template>
<template>
<div style="padding: 0 10px">
<el-tabs v-model="tabActive" @tab-click="doSearch" type="card" style="box-shadow: none">
<el-tab-pane v-if="currentNode.level===1" label="小组信息" name="groupInfo"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="组成单位"
name="componentUnit"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="小组人员" name="userInfo"></el-tab-pane>
</el-tabs>
<el-card shadow="never">
<div style="display: flex; align-items: center; width: 100%">
<div class="btn-group tool-button" style="width: 220px">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div style="margin-left: auto"
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
<el-button v-if="tabActive==='groupInfo'" type="primary" icon="el-icon-plus"
@click="openAddGroup">新增小组
</el-button>
<el-button v-if="tabActive==='componentUnit'" type="primary" icon="el-icon-plus"
@click="openAddComponentUnit">新增组成单位
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<div id="secondaryTableWrap" data-bottom="80">
<el-table :data="groupTableData" :height="tableHeight" v-if="tabActive==='groupInfo'">
<el-table-column type="index" label="序号" width="70px"></el-table-column>
<el-table-column prop="groupName" label="小组名称"></el-table-column>
<el-table-column prop="groupCode" label="小组代码"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="{row}">
<el-button size="mini" type="primary" @click="openEditGroup(row)">
编辑
</el-button>
<el-button size="mini" type="danger" @click="deleteGroup(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="componentUnitTableData" :height="tableHeight"
v-else-if="tabActive==='componentUnit'">
<el-table-column type="index" label="序号" width="70px"></el-table-column>
<el-table-column prop="name" label="单位名称"></el-table-column>
<el-table-column prop="unitcode" label="单位代码"></el-table-column>
</el-table>
<el-table :data="userTableData" :height="tableHeight" v-else-if="tabActive==='userInfo'">
<el-table-column type="index" label="序号" width="70px"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="birthday" label="出生年月"></el-table-column>
<el-table-column prop="mobile" label="联系电话"></el-table-column>
<el-table-column prop="unitname" label="所属单位"
show-overflow-tooltip></el-table-column>
<el-table-column prop="unionname" label="所属工会"
show-overflow-tooltip></el-table-column>
<el-table-column prop="roleName" label="身份"></el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action:setGroupLeader,value:row}"
v-if="row.roleCode==null">
设为组长
</el-dropdown-item>
<el-dropdown-item :command="{action:removeGroupLeader,value:row}"
v-if="row.roleCode!=null">
取消组长
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
</div>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="(val)=>{pageForm.pageSize=val;pageData()}"
@current-change="(val)=>{pageForm.pageNumber=val;pageData()}"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</guava>
<el-dialog :visible.sync="groupDialogVisible" title="新增离退休小组" width="40%">
<el-form :model="groupFormData" label-width="80px" ref="form">
<el-form-item label="小组名称" prop="groupName"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="groupFormData.groupName" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="小组代码" prop="groupCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number v-model="groupFormData.groupCode" style="width: 100%;"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="groupDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetGroup">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="componentUnitDialogVisible" title="组成单位">
<div style="width: 100%;">
<el-transfer v-model="groupComponentUnit" :data="groupComponentUnitLeft"
filterable
ref="componentUnitTransfer"
:props="{
key: 'id',
label: 'name'
}"
:titles="['可选单位', '当前成员单位']"
></el-transfer>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="componentUnitDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetComponentUnit">确定</el-button>
</span>
</el-dialog>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
data() {
return {
treeLoading: false,
treeData: [],
filterText: null,
currentData: null,
currentNode: {level: 1},
tabActive: 'groupInfo',
tableHeight: null,
//小组table
groupTableData: [],
groupDialogVisible: false,
groupFormData: {
groupName: null,
groupCode: null,
id: null
},
//组成单位table
componentUnitTableData: [],
componentUnitDialogVisible: false,
groupComponentUnit: [],
groupComponentUnitLeft: [],
userTableData: []
}
},
methods: {
// 根据表格容器位置动态计算高度,避免依赖旧项目全局方法。
resizeTableHeight() {
this.$nextTick(() => {
const wrap = document.getElementById('secondaryTableWrap')
if (!wrap) {
return
}
const bottom = Number(wrap.getAttribute('data-bottom') || 80)
const height = window.innerHeight - wrap.getBoundingClientRect().top - bottom
this.$set(this, "tableHeight", height > 240 ? height : 240)
})
},
doSearch() {
this.$set(this.pageForm, "pageNumber", 1)
this.pageData()
},
pageData() {
if (this.tabActive === 'groupInfo') {
this.groupPageData()
} else if (this.tabActive === 'componentUnit') {
this.componentUnitPageData()
} else if (this.tabActive === 'userInfo') {
this.getGroupUser()
}
},
handleNodeClick(data, node) {
this.$set(this, "currentData", data)
this.$set(this, "currentNode", node)
if (node.level === 1) {
this.$set(this, "tabActive", 'groupInfo')
this.groupPageData()
} else if (node.level === 2) {
this.$set(this, "tabActive", 'componentUnit')
this.componentUnitPageData()
}
},
filterNode(value, data, node) {
if (!value) return true
return data.label.includes(value)
},
//左侧树数据
async getTree() {
const resp = await $.post(loc() + '/getTree')
if (resp.code === 0) {
this.$set(this, "treeData", resp.data)
if (this.$refs.tree && this.$refs.tree.root.childNodes) {
this.$set(this, "currentNode", this.$refs.tree.root.childNodes[0])
}
} else {
this.notifyWarning(resp.msg)
}
},
//打开新增小组模态框
openAddGroup() {
this.$set(this, "groupDialogVisible", true)
this.$nextTick(() => {
this.$set(this, "groupFormData", {
groupName: null,
groupCode: null,
id: null
})
this.$refs.form.resetFields()
})
},
openEditGroup(row) {
this.$set(this, "groupDialogVisible", true)
this.$set(this, "groupFormData", Object.assign({}, row))
},
//新增、编辑小组
async doSetGroup() {
const resp = await $.post(loc() + '/doSetGroup', this.groupFormData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$set(this, "groupDialogVisible", false)
this.getTree()
this.groupPageData()
} else {
this.notifyWarning(resp.msg)
}
},
//小组分页数据
async groupPageData() {
const resp = await $.post(loc() + '/groupPageData', this.pageForm)
if (resp.code === 0) {
this.$set(this, "groupTableData", resp.data.list)
this.$set(this.pageForm, "totalCount", resp.data.totalCount)
}
},
//删除小组
deleteGroup(id) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/deleteGroup', {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getTree()
this.groupPageData()
} else {
this.notifyWarning(resp.msg)
}
})
},
//组成单位分页数据
async componentUnitPageData() {
const resp = await $.post(loc() + '/componentUnitPageData', Object.assign({}, this.pageForm, {
groupId: this.currentData.id
}))
if (resp.code === 0) {
this.$set(this, "componentUnitTableData", resp.data.list)
this.$set(this.pageForm, "totalCount", resp.data.totalCount)
}
},
openAddComponentUnit() {
this.$set(this, "componentUnitDialogVisible", true)
const groupId = this.currentData.id
this.getNotSetUnit(groupId)
this.getGroupComponentUnit(groupId)
if (this.$refs.componentUnitTransfer) {
this.$refs.componentUnitTransfer.clearQuery('left')
this.$refs.componentUnitTransfer.clearQuery('right')
}
},
//小组组成单位
async getGroupComponentUnit(groupId) {
const resp = await $.post(loc() + '/groupComponentUnit', {groupId})
if (resp.code === 0) {
this.$set(this, "groupComponentUnit", resp.data)
}
},
async getNotSetUnit(groupId) {
const resp = await $.post(loc() + '/notSetUnit', {groupId})
if (resp.code === 0) {
this.$set(this, "groupComponentUnitLeft", resp.data)
}
},
async doSetComponentUnit() {
const params = {
groupId: this.currentData.id,
units: JSON.stringify(this.groupComponentUnit)
}
const resp = await $.post(loc() + '/doSetComponentUnit', params)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$set(this, "componentUnitDialogVisible", false)
this.componentUnitPageData()
} else {
this.notifyWarning(resp.msg)
}
},
async getGroupUser() {
const resp = await $.post(loc() + '/groupUser', Object.assign({}, this.pageForm, {groupId: this.currentData.id}))
if (resp.code === 0) {
this.$set(this, "userTableData", resp.data.list)
this.$set(this.pageForm, "totalCount", resp.data.totalCount)
} else {
this.notifyWarning(resp.msg)
}
},
setGroupLeader(user) {
this.$confirm('您确定要将' + user.username + '设为小组组长吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/setGroupLeader', {
userId: user.id,
groupId: this.currentData.id
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getGroupUser()
} else {
this.notifyWarning(resp.msg)
}
})
},
removeGroupLeader(user) {
this.$confirm('您确定要将' + user.username + '设为小组组员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/removeGroupLeader', {
userId: user.id,
groupId: this.currentData.id
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getGroupUser()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async mounted() {
//动态改变table高度
await httpVueLoader('/components/plugins/Guava.vue', 'Guava')()
await httpVueLoader('/components/plugins/TreeLayout.vue', 'tree-layout')()
this.resizeTableHeight()
window.addEventListener('resize', this.resizeTableHeight)
},
beforeDestroy() {
window.removeEventListener('resize', this.resizeTableHeight)
},
created() {
this.getTree()
this.groupPageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,99 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">所属小组:</div>
<div class="search-item-option">
<el-select placeholder="所属小组" v-model="retiredGroupId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredGroupOption" :label="item.groupName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="getData" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="statisticsData"
header-align="center"
align="center"
show-summary
:summary-method="summaryMethod"
border
highlight-current-row>
<el-table-column label="序号" type="index" width="70px"></el-table-column>
<el-table-column label="小组名称" prop="groupName"></el-table-column>
<el-table-column label="小组代码" prop="groupCode" sortable></el-table-column>
<el-table-column label="组成单位" prop="componentUnit"></el-table-column>
<el-table-column label="人数" prop="retireCount" sortable></el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
data() {
return {
retiredGroupId: null,
statisticsData: [],
retiredGroupOption: []
}
},
methods: {
async getData() {
const resp = await $.post(loc() + '/data', {retiredGroupId: this.retiredGroupId})
if (resp.code === 0) {
this.$set(this, "statisticsData", resp.data)
} else {
this.notifyWarning(resp.msg)
}
},
summaryMethod(param) {
const {columns, data} = param
let sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (column.property === 'retireCount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
})
return sums
},
async getRetiredGroup() {
const resp = await $.post(loc() + '/retiredGroup')
this.$set(this, "retiredGroupOption", resp.data)
},
},
created() {
this.getData()
this.getRetiredGroup()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,196 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">年度:</div>
<div class="search-item-option">
<el-date-picker v-model="pageForm.year" value-format="yyyy" format="yyyy" type="year" style="width: 100%;" :clearable="false"></el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable
@change="flushUnits" @clear="flushUnits"
filterable>
<el-option v-for="item in unions" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属小组:</div>
<div class="search-item-option">
<el-select placeholder="所属小组" v-model="pageForm.retiredGroupId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredGroupOption" :label="item.groupName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属支部:</div>
<div class="search-item-option">
<el-select placeholder="所属支部" v-model="pageForm.retiredPartyBranchId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredPartyBranchOption" :label="item.partyBranchName"
:value="item.id" :key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this">
</table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template slot-scope="{row}">
<span v-if="column.prop==='unitname'">{{isDisPlayCode ? '(' + row.unitcode + ')' : ''}}{{row.unitname}}</span>
<span v-else-if="column.prop==='unionname'">{{isDisPlayCode ? '(' + row.unioncode + ')' : ''}}{{row.unionname}}</span>
<span v-else-if="column.prop==='memberJoinTime'">{{row.memberJoinTime ? moment(row.memberJoinTime).format('YYYY-MM-DD') : ''}}</span>
<span v-else>{{row[column.prop]}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100px">
<template slot-scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item>
查看
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
isDisPlayCode: false,
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idCard', label: '身份证号', width: 170, checked: 0},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'professionalTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
{prop: 'userState', label: '在职状态', sortable: true, checked: 0},
{prop: 'political', label: '政治面貌'},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0},
{prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0},
{prop: 'retiredGroupName', label: '退休小组', sortable: true},
{prop: 'retiredPartyBranchName', label: '退休党支部', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
],
retiredGroupOption: [],
retiredPartyBranchOption: [],
pageForm: {
year: new Date().getFullYear() + ''
}
}
},
methods: {
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (this.$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])) {
this.$set(this, "units", await this.$businessTool.listUnit(this.pageForm.unionId))
} else {
this.$set(this, "units", await this.$businessTool.listUnit(this.$store.state.user.union.id))
}
},
async getRetiredGroup() {
const resp = await $.post(loc() + '/retiredGroup')
this.$set(this, "retiredGroupOption", resp.data)
},
async getRetiredPartyBranch() {
const resp = await $.post(loc() + '/retiredPartyBranch')
this.$set(this, "retiredPartyBranchOption", resp.data)
}
},
async created() {
this.pageData()
this.$set(this, "unions", await this.$businessTool.listUnion())
this.flushUnits()
this.getRetiredGroup()
this.getRetiredPartyBranch()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,379 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input clearable maxlength="20"
placeholder="请输入姓名工号进行查询"
v-model.trim="pageForm.searchKeyword"></el-input>
</div>
</div>
<div class="search-item"
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="请选择所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable
@change="flushUnits" @clear="flushUnits"
filterable>
<el-option v-for="item in unions" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="请选择所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属小组:</div>
<div class="search-item-option">
<el-select placeholder="请选择所属小组" v-model="pageForm.retiredGroupId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredGroupOption" :label="item.groupName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属支部:</div>
<div class="search-item-option">
<el-select placeholder="请选择所属支部" v-model="pageForm.retiredPartyBranchId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredPartyBranchOption" :label="item.partyBranchName"
:value="item.id" :key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this">
<template #func>
<el-button size="small" type="primary" @click="openAdd">新增退休人员(系统中不存在)</el-button>
<el-button size="small" type="primary" @click="openSet">设置退休人员(系统中存在)</el-button>
<el-button size="small" type="primary" @click="backUp">备份为历史数据</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template slot-scope="{row}">
<span v-if="column.prop==='unitname'">{{isDisPlayCode ? '(' + row.unitcode + ')' : ''}}{{row.unitname}}</span>
<span v-else-if="column.prop==='unionname'">{{isDisPlayCode ? '(' + row.unioncode + ')' : ''}}{{row.unionname}}</span>
<span v-else-if="column.prop==='memberJoinTime'">{{row.memberJoinTime ? moment(row.memberJoinTime).format('YYYY-MM-DD') : ''}}</span>
<span v-else>{{row[column.prop]}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100px">
<template slot-scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action:openView,value:row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{action:openEdit,value:row}">
编辑
</el-dropdown-item>
<!-- <el-dropdown-item :command="{action:openChange,value:row}">-->
<!-- 变更-->
<!-- </el-dropdown-item>-->
<el-dropdown-item :command="{action:doDelete,value:row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<!-- <el-button size="mini" @click="openView(row.id)">查看</el-button>
<el-button size="mini" type="primary" @click="openChange(row)">编辑</el-button>-->
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<user-info :id="userId"></user-info>
</template>
<template #edit>
<user-edit ref="userEdit" @finish="$refs.guava.index();pageData()"></user-edit>
</template>
<el-drawer title="设置退休人员(系统中存在)" :visible.sync="retireUserAddDialogVisible" size="70%">
<el-timeline>
<el-timeline-item timestamp="" placement="top">
<el-input placeholder="请输入内容" clearable v-model="nonRetiredUserPageForm.searchKeyword"
@keyup.enter.native="nonRetiredUserPageForm.pageNumber=1;nonRetiredUserPageData()"
style="width: 300px">
<el-select v-model="nonRetiredUserPageForm.searchName" slot="prepend" style="width: 80px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
<el-button type="primary" icon="el-icon-search"
@click="nonRetiredUserPageForm.pageNumber=1;nonRetiredUserPageData()"></el-button>
</el-timeline-item>
<el-timeline-item timestamp="" placement="top">
<el-table :data="nonRetiredUserTableData" style="width: 100%" row-key="id"
ref="nonRetiredUserTable">
<el-table-column type="selection" reserve-selection></el-table-column>
<el-table-column label="工号" prop="loginname" align="center"></el-table-column>
<el-table-column label="姓名" prop="username" align="center"></el-table-column>
<el-table-column label="性别" prop="sex" align="center"></el-table-column>
<el-table-column label="电话" prop="mobile" align="center"></el-table-column>
<el-table-column label="在职状态" prop="userState" align="center"></el-table-column>
<el-table-column label="人员类型" prop="personType" align="center"></el-table-column>
<el-table-column label="单位" prop="unitname" align="center"
show-overflow-tooltip></el-table-column>
<el-table-column label="工会" prop="unionname" align="center"
show-overflow-tooltip></el-table-column>
</el-table>
<el-row class="el-pagination-container">
<el-pagination
@size-change="(val)=>{nonRetiredUserPageForm.pageSize=val;nonRetiredUserPageData()}"
@current-change="(val)=>{nonRetiredUserPageForm.pageNumber=val;nonRetiredUserPageData()}"
:current-page="nonRetiredUserPageForm.pageNumber"
:page-size="nonRetiredUserPageForm.pageSize"
layout="total, prev, pager, next"
:total="nonRetiredUserPageForm.totalCount">
</el-pagination>
</el-row>
</el-timeline-item>
</el-timeline>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="retireUserAddDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doBatchJoinRetire">确定</el-button>
</span>
</el-drawer>
</guava>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'user-info': httpVueLoader('/components/module/retired/userInfo.vue'),
'user-edit': httpVueLoader('/components/module/retired/userEdit.vue'),
},
data() {
return {
retireUserAddDialogVisible: false,
isDisPlayCode: false,
unions: [],
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idCard', label: '身份证号', width: 170, checked: 0},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'professionalTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
{prop: 'userState', label: '在职状态', sortable: true, checked: 0},
{prop: 'political', label: '政治面貌'},
// {prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0},
{prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0},
{prop: 'retiredGroupName', label: '退休小组', sortable: true},
{prop: 'retiredPartyBranchName', label: '退休党支部', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
],
nonRetiredUserPageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0
},
nonRetiredUserTableData: [],
deadDialogVisible: false,
deathFormData: {},
retiredGroupOption: [],
retiredPartyBranchOption: [],
userId: null
}
},
methods: {
backUp() {
this.$confirm('确定把当前数据备份吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/backUp')
if (resp.code === 0) {
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
openAdd() {
this.$set(this, "userId", null)
this.$refs.guava.edit()
this.$refs.userEdit.reset()
},
openSet() {
this.$set(this, "retireUserAddDialogVisible", true)
this.$set(this.nonRetiredUserPageForm, "pageNumber", 1)
this.nonRetiredUserPageData()
if (this.$refs.nonRetiredUserTable) {
this.$refs.nonRetiredUserTable.clearSelection()
}
},
openEdit(row) {
this.$refs.guava.edit()
this.$refs.userEdit.getInfo(row.id)
},
async nonRetiredUserPageData() {
const resp = await $.post(loc() + '/nonRetiredUserPageData', this.nonRetiredUserPageForm)
if (resp.code === 0) {
this.$set(this, "nonRetiredUserTableData", resp.data.list)
this.$set(this.nonRetiredUserPageForm, "totalCount", resp.data.totalCount)
} else {
this.notifyWarning(resp.msg)
}
},
async doBatchJoinRetire() {
const selection = this.$refs.nonRetiredUserTable.selection
if (!selection.length) {
this.notifyWarning("请先勾选需要设置为退休的人员")
return
}
const resp = await $.post(loc() + "/doBatchJoinRetire", {userIds: JSON.stringify(selection.map(v => v.id))})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$set(this, "retireUserAddDialogVisible", false)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (this.$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])) {
this.$set(this, "units", await this.$businessTool.listUnit(this.pageForm.unionId))
} else {
this.$set(this, "units", await this.$businessTool.listUnit(this.$store.state.user.union.id))
}
},
openChange(row) {
this.$set(this, "deadDialogVisible", true)
this.$nextTick(() => {
this.$set(this, "deathFormData", Object.assign({}, row))
})
},
setUserDeathInfo() {
this.$refs['deathForm'].validate(async valid => {
if (valid) {
const {id: userId, deathDate} = this.deathFormData
const resp = await $.post(loc() + '/changeToDie', {userId, deathDate})
if (resp.code === 0) {
this.$set(this, "deadDialogVisible", false)
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
}
})
},
async getRetiredGroup() {
const resp = await $.post(loc() + '/retiredGroup')
this.$set(this, "retiredGroupOption", resp.data)
},
async getRetiredPartyBranch() {
const resp = await $.post(loc() + '/retiredPartyBranch')
this.$set(this, "retiredPartyBranchOption", resp.data)
},
async openView(row) {
this.$set(this, "userId", row.id)
this.$refs.guava.view()
},
async doDelete(row) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + "/doDelete", {id: row.id})
if (resp.code == 0) {
this.$message.success(resp.msg)
this.doSearch()
} else {
this.$message.warning(resp.msg)
}
}
},
async created() {
this.pageData()
this.$set(this, "unions", await this.$businessTool.listUnion())
this.flushUnits()
this.getRetiredGroup()
this.getRetiredPartyBranch()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,595 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-transfer {
text-align: center;
}
.el-transfer-panel {
text-align: left;
width: 35%;
height: 400px;
}
.el-transfer-panel__body {
height: calc(100% - 40px);
}
.el-transfer-panel__list {
height: 100%;
}
.v-tree-layout-left {
overflow: unset !important;
}
.v-tree-layout-left .v-tree {
width: 100%;
height: calc(100vh - 170px);
overflow-y: auto;
}
.v-tree:hover::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
.v-tree-layout-left .custom-tree-node {
width: 90%;
position: relative;
display: flex;
align-items: center;
}
.v-tree-layout-left .v-tree .v-node {
width: 100%;
display: inline-block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
::-webkit-scrollbar {
/*width: 3px;*/
/*background-color: transparent;*/
display: none;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border-radius: 10px;
}
</style>
<div id="app" v-cloak>
<guava>
<el-card shadow="never" style="height: calc(100vh - 70px)">
<tree-layout>
<template #tree>
<div style="padding:0 20px 20px;">
<el-input
@input="(val)=>{$refs.tree.filter(val)}"
placeholder="输入关键字进行查找" clearable
v-model="filterText">
</el-input>
</div>
<el-tree ref="tree" :data="treeData" v-loading="treeLoading" node-key="id"
:props="{label:'partyBranchName'}"
:expand-on-click-node="false"
:default-expanded-keys="['1']"
@node-click="handleNodeClick" accordion
highlight-current :filter-node-method="filterNode">
<div class="custom-tree-node" slot-scope="{ node, data }">
<div v-if="node.level==1" style="font-size: 16px;" class="v-node">
<i class="el-icon-office-building"></i>&nbsp;
{{ data.label }}
</div>
<div v-if="node.level==2" style="font-size: 15px" :title="data.name" class="v-node">
<i class="el-icon-school"></i>
&nbsp; {{ data.label }}
</div>
</div>
</el-tree>
</template>
<template>
<div style="padding: 0 10px">
<el-tabs v-model="tabActive" @tab-click="doSearch" type="card" style="box-shadow: none">
<el-tab-pane v-if="currentNode.level===1" label="党支部信息" name="groupInfo"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="党支部人员" name="userInfo"></el-tab-pane>
<el-tab-pane v-if="currentNode.level===2" label="党支部委员会"
name="committee"></el-tab-pane>
</el-tabs>
<el-card shadow="never">
<div style="display: flex; align-items: center; width: 100%">
<div class="btn-group tool-button" style="width: 220px">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch">
</el-input>
</div>
<div class="btn-group tool-button">
<el-button type="primary" icon="el-icon-search"
@click="doSearch"></el-button>
</div>
<div style="margin-left: auto">
<el-button v-if="tabActive==='groupInfo'" type="primary" icon="el-icon-plus"
@click="openAddPartyBranch">新增党支部
</el-button>
<el-button v-if="tabActive==='userInfo'" type="primary" icon="el-icon-plus"
@click="openAddUser">新增党支部人员
</el-button>
<el-button v-if="tabActive==='committee'" type="primary" icon="el-icon-plus"
@click="openAddCommittee">新增支部委员会人员
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<div id="secondaryTableWrap" data-bottom="80">
<el-table :data="partyBranchTableData" :height="tableHeight" v-if="tabActive==='groupInfo'"
key="partyBranchTable">
<el-table-column type="index" label="序号" width="70px"></el-table-column>
<el-table-column prop="partyBranchName" label="党支部名称"></el-table-column>
<el-table-column prop="partyBranchCode" label="党支部代码"></el-table-column>
<el-table-column label="操作" width="200px">
<template slot-scope="{row}">
<el-button size="mini" type="primary" @click="openEditPartyBranch(row)">
编辑
</el-button>
<el-button size="mini" type="danger" @click="deletePartyBranch(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="userTableData" :height="tableHeight" v-else-if="tabActive==='userInfo'"
key="userTable">
<el-table-column type="index" label="序号" width="70px"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="birthday" label="出生年月"></el-table-column>
<el-table-column prop="mobile" label="联系电话"></el-table-column>
<el-table-column prop="unitname" label="所属单位"
show-overflow-tooltip></el-table-column>
<el-table-column prop="unionname" label="所属工会"
show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="{row}">
<el-button size="mini" type="danger" @click="deleteUser(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<el-table :data="committeeTableData" :height="tableHeight" v-else-if="tabActive==='committee'"
key="committeeTable">
<el-table-column type="index" label="序号" width="70px"></el-table-column>
<el-table-column prop="loginname" label="工号"></el-table-column>
<el-table-column prop="username" label="姓名"></el-table-column>
<el-table-column prop="sex" label="性别"></el-table-column>
<el-table-column prop="birthday" label="出生年月"></el-table-column>
<el-table-column prop="mobile" label="联系电话"></el-table-column>
<el-table-column prop="roleName" label="身份"></el-table-column>
<el-table-column label="操作" width="100px">
<template slot-scope="{row}">
<el-button size="mini" type="danger" @click="deleteCommittee(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="(val)=>{pageForm.pageSize=val;pageData()}"
@current-change="(val)=>{pageForm.pageNumber=val;pageData()}"
:current-page="pageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</div>
</template>
</tree-layout>
</el-card>
</guava>
<el-dialog :visible.sync="partyBranchDialogVisible" title="新增离退休党支部" width="40%">
<el-form :model="partyBranchFormData" label-width="100px" ref="form">
<el-form-item label="党支部名称" prop="partyBranchName"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="partyBranchFormData.partyBranchName" maxlength="20"></el-input>
</el-form-item>
<el-form-item label="党支部代码" prop="partyBranchCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input-number v-model="partyBranchFormData.partyBranchCode" style="width: 100%"></el-input-number>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="partyBranchDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doSetPartyBranch">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="userDialogVisible" title="新增党支部人员" width="40%">
<el-form :model="partyBranchUserFormData" label-width="80px" ref="partyBranchUserForm">
<el-form-item label="人员" prop="userIds"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchUserFormData.userIds"
style="width: 100%"
multiple
filterable
remote
reserve-keyword
placeholder="请输入姓名或者工号查询"
:remote-method="queryNonSetUser">
<el-option
v-for="item in nonSetUserOptions"
:key="item.id"
:label="item.username"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="userDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doAddBranchPartyUser">确定</el-button>
</span>
</el-dialog>
<el-dialog :visible.sync="committeeDialogVisible" title="新增党支部委员" width="40%">
<el-form :model="partyBranchCommitteeFormData" label-width="80px" ref="partyBranchCommitteeForm">
<el-form-item label="人员" prop="userId"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchCommitteeFormData.userId"
style="width: 100%"
filterable
remote
placeholder="请输入姓名或者工号查询"
:remote-method="queryUserByPartyBranchId">
<el-option
v-for="item in committeeUserOptions"
:key="item.id"
:label="item.username"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="身份" prop="roleCode"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-select v-model="partyBranchCommitteeFormData.roleCode" style="width: 100%;">
<el-option v-for="item in retiredPartyBranchCommitteeRoleOptions"
:label="item.name"
:value="item.code"
:key="item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="committeeDialogVisible = false">取消</el-button>
<el-button type="primary" @click="doAddCommitteeUser">确定</el-button>
</span>
</el-dialog>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'tree-layout': httpVueLoader('/components/plugins/TreeLayout.vue'),
},
data() {
return {
treeLoading: false,
treeData: [],
filterText: null,
currentData: null,
currentNode: {level: 1},
tabActive: 'groupInfo',
tableHeight: null,
//党支部table
partyBranchTableData: [],
partyBranchDialogVisible: false,
partyBranchFormData: {
partyBranchName: null,
partyBranchCode: null,
id: null
},
partyBranchUserFormData: {
userIds: []
},
userTableData: [],
userDialogVisible: false,
nonSetUserOptions: [],
//支部委员会信息
retiredPartyBranchCommitteeRoleOptions: [],
committeeDialogVisible: false,
committeeUserOptions: [],
partyBranchCommitteeFormData: {
userId: null,
roleCode: null
},
committeeTableData: []
}
},
methods: {
// 根据表格容器位置动态计算高度,避免依赖旧项目全局方法。
resizeTableHeight() {
this.$nextTick(() => {
const wrap = document.getElementById('secondaryTableWrap')
if (!wrap) {
return
}
const bottom = Number(wrap.getAttribute('data-bottom') || 80)
const height = window.innerHeight - wrap.getBoundingClientRect().top - bottom
this.$set(this, "tableHeight", height > 240 ? height : 240)
})
},
doSearch() {
this.$set(this.pageForm, "pageNumber", 1)
this.pageData()
},
pageData() {
if (this.tabActive === 'groupInfo') {
this.partyBranchPageData()
} else if (this.tabActive === 'userInfo') {
this.partyBranchUserPageData()
} else if (this.tabActive === 'committee') {
this.partyBranchCommitteePageData()
}
},
handleNodeClick(data, node) {
this.$set(this, "currentData", data)
this.$set(this, "currentNode", node)
if (node.level === 1) {
this.$set(this, "tabActive", 'groupInfo')
this.partyBranchPageData()
} else if (node.level === 2) {
this.$set(this, "tabActive", 'userInfo')
this.partyBranchUserPageData()
}
},
filterNode(value, data, node) {
if (!value) return true
return data.label.includes(value)
},
//左侧树数据
async getTree() {
const resp = await $.post(loc() + '/getTree')
if (resp.code === 0) {
this.$set(this, "treeData", resp.data)
if (this.$refs.tree && this.$refs.tree.root.childNodes) {
this.$set(this, "currentNode", this.$refs.tree.root.childNodes[0])
}
} else {
this.notifyWarning(resp.msg)
}
},
//打开新增党支部模态框
openAddPartyBranch() {
this.$set(this, "partyBranchDialogVisible", true)
this.$nextTick(() => {
this.$set(this, "partyBranchFormData", {
partyBranchName: null,
partyBranchCode: null,
id: null
})
this.$refs.form.resetFields()
})
},
openEditPartyBranch(row) {
this.$set(this, "partyBranchDialogVisible", true)
this.$set(this, "partyBranchFormData", Object.assign({}, row))
},
//新增、编辑党支部
async doSetPartyBranch() {
const resp = await $.post(loc() + '/doSetPartyBranch', this.partyBranchFormData)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.$set(this, "partyBranchDialogVisible", false)
this.getTree()
this.partyBranchPageData()
} else {
this.notifyWarning(resp.msg)
}
},
//党支部分页数据
async partyBranchPageData() {
const resp = await $.post(loc() + '/partyBranchPageData', this.pageForm)
if (resp.code === 0) {
this.$set(this, "partyBranchTableData", resp.data.list)
this.$set(this.pageForm, "totalCount", resp.data.totalCount)
}
},
//删除党支部
deletePartyBranch(id) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/deletePartyBranch', {id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.getTree()
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
},
async partyBranchUserPageData() {
const resp = await $.post(loc() + '/partyBranchUserPageData', Object.assign({}, this.pageForm, {
partyBranchId: this.currentData.id
}))
if (resp.code === 0) {
this.$set(this, "userTableData", resp.data.list)
this.$set(this.pageForm, "totalCount", resp.data.totalCount)
} else {
this.notifyWarning(resp.msg)
}
},
openAddUser() {
this.$set(this, "userDialogVisible", true)
this.$set(this.partyBranchUserFormData, "userIds", [])
this.queryNonSetUser(null)
},
async queryNonSetUser(val) {
if (val !== '') {
const resp = await $.post(loc() + '/queryNonSetUser', {val})
if (resp.code === 0) {
this.$set(this, "nonSetUserOptions", resp.data)
}
} else {
this.$set(this, "nonSetUserOptions", [])
}
},
async doAddBranchPartyUser() {
this.$refs['partyBranchUserForm'].validate(async valid => {
if (valid) {
const userIds = JSON.stringify(this.partyBranchUserFormData.userIds)
const partyBranchId = this.currentData.id
const resp = await $.post(loc() + '/doAddBranchPartyUser', {
partyBranchId,
userIds
})
if (resp.code === 0) {
this.$set(this, "userDialogVisible", false)
this.notifySuccess(resp.msg)
this.partyBranchUserPageData()
} else {
this.notifyWarning(resp.msg)
}
}
})
},
async deleteUser(userId) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async res => {
const resp = await $.post(loc() + '/deleteUser', {userId, partyBranchId: this.currentData.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
},
//打开新增支部委员会
openAddCommittee() {
this.$set(this, "committeeDialogVisible", true)
this.$set(this, "partyBranchCommitteeFormData", {
userId: null,
roleCode: null
})
this.queryUserByPartyBranchId(null)
},
//查询党支部下的人员
async queryUserByPartyBranchId(val) {
if (val) {
const resp = await $.post(loc() + '/queryUserByPartyBranchId', {
val,
partyBranchId: this.currentData.id
})
if (resp.code === 0) {
this.$set(this, "committeeUserOptions", resp.data)
}
} else {
this.$set(this, "committeeUserOptions", [])
}
},
//添加党支部委员会人员
doAddCommitteeUser() {
this.$refs['partyBranchCommitteeForm'].validate(async valid => {
if (valid) {
const resp = await $.post(loc() + '/doAddCommitteeUser', Object.assign({partyBranchId: this.currentData.id}, this.partyBranchCommitteeFormData))
if (resp.code === 0) {
this.$set(this, "committeeDialogVisible", false)
this.partyBranchCommitteePageData()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
}
})
},
async partyBranchCommitteePageData() {
const resp = await $.post(loc() + '/partyBranchCommitteePageData', Object.assign({}, this.pageForm, {
partyBranchId: this.currentData.id
}))
if (resp.code === 0) {
this.$set(this, "committeeTableData", resp.data.list)
this.$set(this.pageForm, "totalCount", resp.data.totalCount)
} else {
this.notifyWarning(resp.msg)
}
},
deleteCommittee(userId) {
this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + '/deleteCommittee', {userId, partyBranchId: this.currentData.id})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
})
}
},
async mounted() {
//动态改变table高度
await httpVueLoader('/components/plugins/Guava.vue', 'Guava')()
await httpVueLoader('/components/plugins/TreeLayout.vue', 'tree-layout')()
this.resizeTableHeight()
window.addEventListener('resize', this.resizeTableHeight)
},
beforeDestroy() {
window.removeEventListener('resize', this.resizeTableHeight)
},
created() {
this.getTree()
this.partyBranchPageData()
this.$businessTool.getDictOptions('RETIRED_PARTY_BRANCH_COMMITTEE_ROLE').then(res => {
this.$set(this, "retiredPartyBranchCommitteeRoleOptions", res)
})
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,99 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">所属支部:</div>
<div class="search-item-option">
<el-select placeholder="所属支部" v-model="retiredPartyBranchId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredPartyBranchOption" :label="item.partyBranchName"
:value="item.id" :key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="getData" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="statisticsData"
header-align="center"
align="center"
show-summary
:summary-method="summaryMethod"
border
highlight-current-row>
<el-table-column label="序号" type="index" width="70px"></el-table-column>
<el-table-column label="党支部名称" prop="partyBranchName"></el-table-column>
<el-table-column label="党支部代码" prop="partyBranchCode" sortable
:summary-method="()=>{}"></el-table-column>
<el-table-column label="党员人数" prop="userCount" sortable></el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
data() {
return {
retiredPartyBranchId: null,
retiredPartyBranchOption: [],
statisticsData: [],
}
},
methods: {
async getData() {
const resp = await $.post(loc() + '/data', {retiredPartyBranchId: this.retiredPartyBranchId})
if (resp.code === 0) {
this.$set(this, "statisticsData", resp.data)
} else {
this.notifyWarning(resp.msg)
}
},
summaryMethod(param) {
const {columns, data} = param
let sums = []
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
if (column.property === 'userCount') {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
})
return sums
},
async getRetiredPartyBranch() {
const resp = await $.post(loc() + '/retiredPartyBranch')
this.$set(this, "retiredPartyBranchOption", resp.data)
}
},
created() {
this.getData()
this.getRetiredPartyBranch()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,198 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">姓名工号:</div>
<div class="search-item-option">
<el-input clearable maxlength="20" v-model.trim="pageForm.searchKeyword"
placeholder="请输入工号或者姓名查询"></el-input>
</div>
</div>
<div class="search-item"
v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId" style="width: 100%;"
clearable
@change="flushUnits" @clear="flushUnits"
filterable>
<el-option v-for="item in unions" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属单位:</div>
<div class="search-item-option">
<el-select placeholder="所属单位" v-model="pageForm.unitId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属小组:</div>
<div class="search-item-option">
<el-select placeholder="所属小组" v-model="pageForm.retiredGroupId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredGroupOption" :label="item.groupName" :value="item.id"
:key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属支部:</div>
<div class="search-item-option">
<el-select placeholder="所属支部" v-model="pageForm.retiredPartyBranchId" style="width: 100%;"
clearable
filterable>
<el-option v-for="item in retiredPartyBranchOption" :label="item.partyBranchName"
:value="item.id" :key="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="退休人员" :app="this">
</table-tool>
<el-table :data="tableData" style="width: 100%" stripe border
:header-cell-style="{background:'#FAFAFA'}" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading">
<el-table-column align="center" header-align="center" type="index" :index="indexMethod" label="序号"
width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
:key="column.prop"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template slot-scope="{row}">
<span v-if="column.prop==='unitname'">{{isDisPlayCode ? '(' + row.unitcode + ')' : ''}}{{row.unitname}}</span>
<span v-else-if="column.prop==='unionname'">{{isDisPlayCode ? '(' + row.unioncode + ')' : ''}}{{row.unionname}}</span>
<span v-else-if="column.prop==='memberJoinTime'">{{row.memberJoinTime ? moment(row.memberJoinTime).format('YYYY-MM-DD') : ''}}</span>
<span v-else>{{row[column.prop]}}</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100px">
<template slot-scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action:openView,value:row}">
查看
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #view>
<user-info :id="userId"></user-info>
</template>
</guava>
</div>
<script nonce="${cspNonce!}">
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'user-info': httpVueLoader('/components/module/retired/userInfo.vue'),
},
data() {
return {
unions: [],
isDisPlayCode: false,
units: [],
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'mobile', label: '联系电话'},
{prop: 'idCard', label: '身份证号', width: 170, checked: 0},
{prop: 'position', label: '职务', sortable: true, checked: 0},
{prop: 'professionalTitle', label: '职称', sortable: true, checked: 0},
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
{prop: 'userState', label: '在职状态', sortable: true, checked: 0},
{prop: 'political', label: '政治面貌'},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true, checked: 0},
{prop: 'unionGroupName', label: '工会小组', sortable: true, checked: 0},
{prop: 'retiredGroupName', label: '退休小组', sortable: true},
{prop: 'retiredPartyBranchName', label: '退休党支部', sortable: true},
{prop: 'campusName', label: '所属校区', sortable: true, checked: 0},
{prop: 'nation', label: '民族', checked: 0},
],
retiredGroupOption: [],
retiredPartyBranchOption: [],
userId: null
}
},
methods: {
async flushUnits() {
this.$set(this.pageForm, "unitId", null)
if (this.$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])) {
this.$set(this, "units", await this.$businessTool.listUnit(this.pageForm.unionId))
} else {
this.$set(this, "units", await this.$businessTool.listUnit(this.$store.state.user.union.id))
}
},
async getRetiredGroup() {
const resp = await $.post(loc() + '/retiredGroup')
this.$set(this, "retiredGroupOption", resp.data)
},
async getRetiredPartyBranch() {
const resp = await $.post(loc() + '/retiredPartyBranch')
this.$set(this, "retiredPartyBranchOption", resp.data)
},
async openView(row) {
this.$set(this, "userId", row.id)
this.$refs.guava.view()
}
},
async created() {
this.pageData()
this.$set(this, "unions", await this.$businessTool.listUnion())
this.flushUnits()
this.getRetiredGroup()
this.getRetiredPartyBranch()
}
})
</script>
<!--#
}
#-->