commit
This commit is contained in:
+29
-9
@@ -72,15 +72,19 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.nation,
|
||||
null as campusName,
|
||||
campusDict.name as campusName,
|
||||
u.unionGroupName,
|
||||
u.political,
|
||||
u.personType,
|
||||
u.userState,
|
||||
u.unitName as unitname,
|
||||
u.unionName as unionname,
|
||||
null as threeUnitName
|
||||
CASE WHEN userUnit.unitLevel = 3 THEN userUnit.name ELSE NULL END as threeUnitName
|
||||
FROM vw_user u
|
||||
LEFT JOIN sys_unit userUnit ON userUnit.id = u.unitId
|
||||
LEFT JOIN sys_dict campusParent ON campusParent.code = 'USER_CAMPUS'
|
||||
LEFT JOIN sys_dict campusDict ON campusDict.parentId = campusParent.id
|
||||
AND (campusDict.id = userUnit.xqid OR campusDict.code = userUnit.xqid OR campusDict.name = userUnit.xqid)
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@@ -157,11 +161,15 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.memberTime,
|
||||
u.families,
|
||||
u.personalData,
|
||||
null as campusName,
|
||||
null as threeUnitName,
|
||||
campusDict.name as campusName,
|
||||
CASE WHEN userUnit.unitLevel = 3 THEN userUnit.name ELSE NULL END as threeUnitName,
|
||||
rg.groupName as retiredGroupName,
|
||||
rpb.partyBranchName as retiredPartyBranchName
|
||||
FROM vw_user u
|
||||
LEFT JOIN sys_unit userUnit ON userUnit.id = u.unitId
|
||||
LEFT JOIN sys_dict campusParent ON campusParent.code = 'USER_CAMPUS'
|
||||
LEFT JOIN sys_dict campusDict ON campusDict.parentId = campusParent.id
|
||||
AND (campusDict.id = userUnit.xqid OR campusDict.code = userUnit.xqid OR campusDict.name = userUnit.xqid)
|
||||
LEFT JOIN retired_group_unit rgu ON rgu.unitId = u.unitId
|
||||
LEFT JOIN retired_group rg ON rg.id = rgu.retiredGroupId
|
||||
LEFT JOIN retired_party_branch_user rpbu ON rpbu.userId = u.id
|
||||
@@ -226,7 +234,7 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.nation,
|
||||
null as campusName,
|
||||
campusDict.name as campusName,
|
||||
u.unionGroupName,
|
||||
u.personType,
|
||||
u.userState,
|
||||
@@ -234,6 +242,10 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.unionName as unionname
|
||||
FROM retired_user_change ruc
|
||||
LEFT JOIN vw_user u ON u.id = ruc.userId
|
||||
LEFT JOIN sys_unit userUnit ON userUnit.id = u.unitId
|
||||
LEFT JOIN sys_dict campusParent ON campusParent.code = 'USER_CAMPUS'
|
||||
LEFT JOIN sys_dict campusDict ON campusDict.parentId = campusParent.id
|
||||
AND (campusDict.id = userUnit.xqid OR campusDict.code = userUnit.xqid OR campusDict.name = userUnit.xqid)
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@@ -264,18 +276,21 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.nation,
|
||||
null as campusName,
|
||||
campusDict.name as campusName,
|
||||
unionGroup.name as unionGroupName,
|
||||
u.personType,
|
||||
u.userState,
|
||||
n.name AS unitname,
|
||||
gh.name AS unionname,
|
||||
u.political,
|
||||
null as threeUnitName,
|
||||
CASE WHEN n.unitLevel = 3 THEN n.name ELSE NULL END as threeUnitName,
|
||||
rg.groupName AS retiredGroupName,
|
||||
rpb.partyBranchName AS retiredPartyBranchName
|
||||
FROM retired_user_history u
|
||||
LEFT JOIN sys_unit n ON n.id = u.unitId
|
||||
LEFT JOIN sys_dict campusParent ON campusParent.code = 'USER_CAMPUS'
|
||||
LEFT JOIN sys_dict campusDict ON campusDict.parentId = campusParent.id
|
||||
AND (campusDict.id = n.xqid OR campusDict.code = n.xqid OR campusDict.name = n.xqid)
|
||||
LEFT JOIN sys_union gh ON gh.id = n.unionId
|
||||
LEFT JOIN sys_union_group unionGroup ON unionGroup.id = n.unionGroupId
|
||||
LEFT JOIN retired_group_unit rgu ON rgu.unitId = u.unitId
|
||||
@@ -306,6 +321,7 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
}
|
||||
|
||||
private Sql retiredUserSql() {
|
||||
// 当前库的 vw_user 不直接提供科室和校区名称,科室按三级单位显示,校区按单位 xqid 关联 USER_CAMPUS 字典显示。
|
||||
return Sqls.create("""
|
||||
SELECT
|
||||
u.id,
|
||||
@@ -321,17 +337,21 @@ public class RetiredUserServiceImpl extends BaseServiceImpl<Sys_user> implements
|
||||
u.education,
|
||||
u.academicDegree,
|
||||
u.nation,
|
||||
null as campusName,
|
||||
campusDict.name as campusName,
|
||||
u.unionGroupName,
|
||||
u.personType,
|
||||
u.userState,
|
||||
u.unitName as unitname,
|
||||
u.unionName as unionname,
|
||||
u.political,
|
||||
null as threeUnitName,
|
||||
CASE WHEN userUnit.unitLevel = 3 THEN userUnit.name ELSE NULL END as threeUnitName,
|
||||
rg.groupName as retiredGroupName,
|
||||
rpb.partyBranchName as retiredPartyBranchName
|
||||
FROM vw_user u
|
||||
LEFT JOIN sys_unit userUnit ON userUnit.id = u.unitId
|
||||
LEFT JOIN sys_dict campusParent ON campusParent.code = 'USER_CAMPUS'
|
||||
LEFT JOIN sys_dict campusDict ON campusDict.parentId = campusParent.id
|
||||
AND (campusDict.id = userUnit.xqid OR campusDict.code = userUnit.xqid OR campusDict.name = userUnit.xqid)
|
||||
LEFT JOIN retired_group_unit rgu ON rgu.unitId = u.unitId
|
||||
LEFT JOIN retired_group rg ON rg.id = rgu.retiredGroupId
|
||||
LEFT JOIN retired_party_branch_user rpbu ON rpbu.userId = u.id
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
<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="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="sex">
|
||||
<el-radio-group v-model="formData.sex" size="small">
|
||||
@@ -26,12 +32,6 @@
|
||||
</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"
|
||||
@@ -40,9 +40,9 @@
|
||||
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-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="政治面貌">
|
||||
@@ -52,102 +52,34 @@
|
||||
</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-descriptions-item label="参加工作时间">
|
||||
<el-form-item prop="arrivalAtSchoolDate">
|
||||
<el-input v-model="formData.arrivalAtSchoolDate" maxlength="20" placeholder="请输入来校时间"></el-input>
|
||||
<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-descriptions-item label="单位">
|
||||
<el-form-item prop="unitId">
|
||||
<el-select clearable filterable placeholder="请选择工作单位" style="width: 100%"
|
||||
<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-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-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="personType">
|
||||
<dict-select v-model="formData.personType" code="USER_PERSON_TYPE" style="width: 100%"></dict-select>
|
||||
<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="退休时间">
|
||||
@@ -159,62 +91,25 @@
|
||||
</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-descriptions-item label="电话">
|
||||
<el-form-item prop="mobile">
|
||||
<el-input v-model="formData.mobile" maxlength="32" placeholder="请输入联系电话"></el-input>
|
||||
<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-descriptions-item label="工龄">
|
||||
<el-form-item>
|
||||
<el-input :value="workAgeText(formData.arrivalAtSchoolDate)" readonly 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-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="个人简历" :span="3">
|
||||
<el-form-item prop="personalData">
|
||||
<el-input type="textarea" :rows="4" v-model="formData.personalData" maxlength="2000"
|
||||
placeholder="请输入个人简历"></el-input>
|
||||
<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>
|
||||
@@ -293,6 +188,10 @@ module.exports = {
|
||||
handleUnitChange(unitId) {
|
||||
const unit = this.units.find(item => item.id === unitId)
|
||||
this.$set(this.formData, "unitName", unit ? unit.name : null)
|
||||
const unionId = unit ? (unit.unionId || unit.unionid || null) : null
|
||||
const unionName = unit ? (unit.unionName || unit.unionname || null) : null
|
||||
this.$set(this.formData, "unionId", unionId)
|
||||
this.$set(this.formData, "unionName", unionName)
|
||||
},
|
||||
addFamily() {
|
||||
const families = (this.formData.families || []).concat([{}])
|
||||
@@ -307,6 +206,40 @@ module.exports = {
|
||||
const units = await this.$businessTool.listUnit()
|
||||
this.$set(this, "units", units || [])
|
||||
},
|
||||
// 工龄不落库,根据参加工作时间实时计算,兼容 yyyy、yyyy-MM、yyyy-MM-dd 三种输入。
|
||||
workAgeText(val) {
|
||||
const start = this.parseWorkDate(val)
|
||||
if (!start) {
|
||||
return ""
|
||||
}
|
||||
const today = new Date()
|
||||
let years = today.getFullYear() - start.getFullYear()
|
||||
if (today.getMonth() < start.getMonth() ||
|
||||
(today.getMonth() === start.getMonth() && today.getDate() < start.getDate())) {
|
||||
years = years - 1
|
||||
}
|
||||
if (years < 0) {
|
||||
years = 0
|
||||
}
|
||||
return years + "年"
|
||||
},
|
||||
parseWorkDate(val) {
|
||||
if (!val) {
|
||||
return null
|
||||
}
|
||||
const parts = String(val).split("-")
|
||||
const year = Number(parts[0])
|
||||
const month = parts.length > 1 ? Number(parts[1]) : 1
|
||||
const day = parts.length > 2 ? Number(parts[2]) : 1
|
||||
if (!year || !month || !day) {
|
||||
return null
|
||||
}
|
||||
const date = new Date(year, month - 1, day)
|
||||
if (isNaN(date.getTime())) {
|
||||
return null
|
||||
}
|
||||
return date
|
||||
},
|
||||
normalizeUserData(user) {
|
||||
const data = Object.assign(this.defaultFormData(), user)
|
||||
// 详情数据可能来自视图或实体,统一把大小写差异字段整理成页面绑定的驼峰字段。
|
||||
|
||||
@@ -8,61 +8,26 @@
|
||||
<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.sex) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="出生日期">{{ formatDate(formData.birthday) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="身份证号码">{{ emptyText(formData.idCard) }}</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="参加工作时间">{{ displayDate(formData.arrivalAtSchoolDate) }}</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.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="退休时间">{{ formatDate(formData.retireDate) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="电话">{{ emptyText(formData.mobile) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="工龄">{{ workAgeText(formData.arrivalAtSchoolDate) || '暂无' }}</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-item label="人员类型">{{ emptyText(formData.personType) }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<slot></slot>
|
||||
</div>
|
||||
@@ -89,12 +54,52 @@ module.exports = {
|
||||
}
|
||||
return '暂无'
|
||||
},
|
||||
displayDate(val) {
|
||||
if (!val) {
|
||||
return '暂无'
|
||||
}
|
||||
return String(val)
|
||||
},
|
||||
emptyText(val) {
|
||||
if (val === undefined || val === null || val === '') {
|
||||
return '暂无'
|
||||
}
|
||||
return val
|
||||
},
|
||||
// 工龄不落库,根据参加工作时间实时计算,兼容 yyyy、yyyy-MM、yyyy-MM-dd 三种输入。
|
||||
workAgeText(val) {
|
||||
const start = this.parseWorkDate(val)
|
||||
if (!start) {
|
||||
return ""
|
||||
}
|
||||
const today = new Date()
|
||||
let years = today.getFullYear() - start.getFullYear()
|
||||
if (today.getMonth() < start.getMonth() ||
|
||||
(today.getMonth() === start.getMonth() && today.getDate() < start.getDate())) {
|
||||
years = years - 1
|
||||
}
|
||||
if (years < 0) {
|
||||
years = 0
|
||||
}
|
||||
return years + "年"
|
||||
},
|
||||
parseWorkDate(val) {
|
||||
if (!val) {
|
||||
return null
|
||||
}
|
||||
const parts = String(val).split("-")
|
||||
const year = Number(parts[0])
|
||||
const month = parts.length > 1 ? Number(parts[1]) : 1
|
||||
const day = parts.length > 2 ? Number(parts[2]) : 1
|
||||
if (!year || !month || !day) {
|
||||
return null
|
||||
}
|
||||
const date = new Date(year, month - 1, day)
|
||||
if (isNaN(date.getTime())) {
|
||||
return null
|
||||
}
|
||||
return date
|
||||
},
|
||||
getInfo() {
|
||||
if (this.id) {
|
||||
$.post('/platform/retired/list/userInfo', {userId: this.id}).then(res => {
|
||||
|
||||
@@ -71,7 +71,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
<table-tool label="退休人员" :app="this">
|
||||
<template #func>
|
||||
<template v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN', 'SCHOOL_UNION_MEMBER_ADMIN'])">
|
||||
<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>
|
||||
@@ -211,19 +211,14 @@ layout("/layouts/platform.html"){
|
||||
{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: {
|
||||
@@ -262,7 +257,7 @@ layout("/layouts/platform.html"){
|
||||
openAdd() {
|
||||
this.$set(this, "userId", null)
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.userEdit.reset()
|
||||
this.callUserEdit(userEdit => userEdit.reset())
|
||||
},
|
||||
openSet() {
|
||||
this.$set(this, "retireUserAddDialogVisible", true)
|
||||
@@ -275,7 +270,21 @@ layout("/layouts/platform.html"){
|
||||
|
||||
openEdit(row) {
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.userEdit.getInfo(row.id)
|
||||
this.callUserEdit(userEdit => userEdit.getInfo(row.id))
|
||||
},
|
||||
callUserEdit(callback, retry) {
|
||||
const waitCount = retry || 0
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.userEdit) {
|
||||
callback(this.$refs.userEdit)
|
||||
} else if (waitCount < 10) {
|
||||
setTimeout(() => {
|
||||
this.callUserEdit(callback, waitCount + 1)
|
||||
}, 100)
|
||||
} else {
|
||||
this.notifyWarning("编辑组件加载失败,请刷新页面后重试")
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
async nonRetiredUserPageData() {
|
||||
|
||||
Reference in New Issue
Block a user