first commit

This commit is contained in:
2026-09-09 09:14:28 +08:00
commit 5343198112
5199 changed files with 1052895 additions and 0 deletions
@@ -0,0 +1,316 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-table .auditing-row {
background: oldlace;
}
.el-table .audit-error-row {
background: #fa465926;
}
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch" style="width: 100%">
<el-select v-model="pageForm.searchName" slot="prepend" style="width: 80px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<div class="search-item">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select v-model="pageForm.unionId" style="width: 100%" filterable
clearable
placeholder="请选择" @change="changeWelfareUnit">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</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.unitId" style="width: 100%" filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in units"
:key="item.id"
: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.unionGroupId" style="width: 100%"
filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in unionGroups"
:key="item.id"
:label="item.groupName"
: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.threeUnitId" style="width: 100%" filterable
clearable
placeholder="请选择">
<el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">所属校区:</div>
<div class="search-item-option">
<el-select v-model="pageForm.campus" style="width: 100%" clearable
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;别:</div>
<div class="search-item-option">
<el-select v-model="pageForm.sex" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
placeholder="人员类型"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
placeholder="在职状态"
code="userState"></dict-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="人员列表" :app="this"></table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table">
<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"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop==='loginname'" scope="{row}">
<el-link type="primary" @click="openView(row)">{{row.loginname}}</el-link>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" fixed="right">
<template scope="{row}">
<el-button type="primary" @click="openEdit(row)" size="mini">编辑</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member ref="memberInfo" :id="userId" :source="source" view></member>
</template>
</guava>
<el-dialog title="编辑" :visible.sync="dialogVisible" width="40%">
<el-form :model="formData" ref="addForm" :rules="formRules" label-width="80px">
<vi-title title="修改人员信息"></vi-title>
<el-form-item prop="loginname" label="工&emsp;号">
<el-input disabled v-model="formData.loginname" type="text"></el-input>
</el-form-item>
<el-form-item prop="username" label="姓&emsp;名">
<el-input disabled v-model="formData.username" type="text"></el-input>
</el-form-item>
<el-form-item prop="mobile" label="手机号">
<el-input v-model="formData.mobile" type="text"></el-input>
</el-form-item>
<el-form-item prop="idcard" label="身份证">
<el-input v-model="formData.idcard" type="text"></el-input>
</el-form-item>
<el-form-item prop="marriage" label="婚&emsp;否">
<el-radio-group v-model="formData.marriage">
<el-radio label="已婚" border></el-radio>
<el-radio label="未婚" border></el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit" :loading="editLoading" :disabled="editLoading">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unitMode: {
UNIT: {
name: '福利单位'
},
UNION: {
name: '所属工会'
}
},
physicalsUnitMode: "${getSysConfig('PhysicalsUnitMode')}",
editLoading: false,
dialogVisible: false,
campusOptions: [],
batchEditLoading: false,
batchEditVisible: false,
batchFormData: {},
pageForm: {
searchName: 'username',
},
tableColumns: physicalsCommonColumns,
unionOptions: [],
unitOptions: [],
userId: '',
source: 'sys_user',
sexOptions,
formRules: {},
welfareUnits:[],
unionGroups:[],
threeUnits:[],
units:[],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.4'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
},
methods: {
openEdit(row) {
this.formData = row
this.dialogVisible = true
},
async doEdit() {
this.editLoading = true
const resp = await $.post(loc() + "/doEdit", {user: JSON.stringify(this.formData)})
requestLaterMsgFun(this, resp, () => {
this.dialogVisible = false
this.pageData()
}, null, () => {
this.editLoading = false
})
},
openView({id}) {
this.userId = id
this.$refs.guava.view()
},
async unionChange(val) {
this.$set(this.pageForm, 'unitId', '')
this.unitOptions = await getComponentUnitPhysicals(val)
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unitId', '')
this.units = await getComponentUnit(this.pageForm.unionId)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unitId, this.pageForm.unionGroupId)
}
},
async created() {
this.pageData();
this.unionOptions = await getWelfareUnitPhysicals()
this.campusOptions = await getCampus()
this.unitOptions = await getComponentUnitPhysicals(null)
this.changeWelfareUnit();
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,588 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch" style="width: 100%">
<el-select v-model="pageForm.searchName" slot="prepend" style="width: 80px;">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<!--<div class="search-item">
<div class="search-item-label">{{unitMode[physicalsUnitMode].name}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.unionId" style="width: 100%" filterable clearable
placeholder="请选择" @change="unionChange">
<el-option
v-for="item in unionOptions"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</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.unionId" style="width: 100%" filterable
clearable
placeholder="请选择" @change="changeWelfareUnit">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</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.unitId" style="width: 100%" filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in units"
:key="item.id"
: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.unionGroupId" style="width: 100%"
filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in unionGroups"
:key="item.id"
:label="item.groupName"
: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.threeUnitId" style="width: 100%" filterable
clearable
placeholder="请选择">
<el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">所属校区:</div>
<div class="search-item-option">
<el-select v-model="pageForm.campus" style="width: 100%" clearable
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;别:</div>
<div class="search-item-option">
<el-select v-model="pageForm.sex" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
placeholder="人员类型"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
placeholder="在职状态"
code="userState"></dict-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="体检人员" :app="this">
<template #func>
<!-- <el-dropdown style="margin: 0 10px" @command="pushDropdownCommand">
<el-button type="primary" size="small" icon="el-icon-plus">
添加
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'select'}">选择加入</el-dropdown-item>
<el-dropdown-item :command="{type:'add'}">新增用户</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>-->
<el-button v-show="checkUsers.length" type="primary" size="small" icon="el-icon-edit"
@click="openBatchEdit">
设置校区
</el-button>
<el-button v-show="checkUsers.length" type="danger" size="small" icon="el-icon-delete"
@click="kickPhysicals">
移除
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table"
@selection-change="tableHandleSelectionChange">
<el-table-column type="selection" :reserve-selection="true"></el-table-column>
<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"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop=='loginname'" scope="{row}">
<el-link type="primary" @click="openView(row.id)">{{row.loginname}}</el-link>
</template>
<template v-else-if="column.prop=='campusName'" scope="{row}">
<span v-if="!row.editCampus">{{row.campusName}}</span>
<div v-else>
<el-select v-model="row.modifiedCampusId" style="width: 160px" clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="180px" fixed="right">
<template scope="{row}">
<div v-if="row.editCampus">
<el-button size="mini" :loading="row.editCampusLoading" type="primary"
@click="doEditCampus(row)">确定
</el-button>
<el-button size="mini" :disabled="row.editCampusLoading"
@click="row.editCampus=!row.editCampus">取消
</el-button>
</div>
<el-dropdown @command="dropdownCommand" v-else>
<el-button plain size="mini">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<el-dropdown-item :command="{type:'editCampus',data:row}">
修改校区
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
移除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit_func>
<el-button type="primary" @click="$refs.member.save()">提交</el-button>
</template>
<template #edit>
<member ref="member" :id="userId" @save="afterEdit"></member>
</template>
<template #view>
<member ref="memberInfo" :id="userId" view></member>
</template>
</guava>
<el-drawer
title="设置校区"
:visible.sync="batchEditVisible"
:before-close="handleClose" size="1000px">
<el-timeline style="margin-right: 40px">
<el-timeline-item timestamp="" placement="top">
<el-form ref="batchForm" :model="batchFormData" label-width="100px">
<el-row :gutter="60">
<el-col :span="12">
<el-form-item label="所属校区">
<el-select v-model="batchFormData.campus" style="width: 300px" clearable
size="medium"
placeholder="请选择"
@change="checkUsers.map(v=>$set(v,'campusId',batchFormData.campus))">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-timeline-item>
<el-timeline-item timestamp="" placement="top">
<el-table :data="checkUsers" style="width: 100%" row-key="id" class="vi-table"
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="loginname"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="username"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="unitname"
label="所属单位"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="unionname"
label="所属工会"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center" prop="campusId"
label="所属校区" width="300px">
<template scope="{row}">
<el-select v-model="row.campusId" style="width: 200px" clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
</el-timeline-item>
</el-timeline>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="batchEditVisible = false" :disabled="batchEditLoading">取 消</el-button>
<el-button type="primary" @click="doBatchEdit" :loading="batchEditLoading">确定</el-button>
</span>
</el-drawer>
<el-drawer
title="添加体检人员"
:visible.sync="selectUserVisible"
:before-close="handleClose" size="1200px">
<user-select v-model="selectUsers" ref="userSelect" :page_size="10"
:sql_cnd="['(physicals is null or physicals = 0)']"></user-select>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="selectUserVisible = false" :disabled="selectUserLoading">取 消</el-button>
<el-button type="primary" @click="doBatchJoinPhysicals" :loading="selectUserLoading">确定</el-button>
</span>
</el-drawer>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unitMode: {
UNIT: {
name: '福利单位'
},
UNION: {
name: '所属工会'
}
},
physicalsUnitMode: "${getSysConfig('PhysicalsUnitMode')}",
selectUserLoading: false,
selectUserVisible: false,
selectUsers: [],
checkUsers: [],
batchEditVisible: false,
batchEditLoading: false,
batchFormData: {},
importLoading: false,
importVisible: false,
importData: {
fileList: [],
year: 0
},
campusOptions: [],
pageForm: {
searchName: 'username',
},
tableColumns: physicalsCommonColumns,
unionOptions: [],
unitOptions: [],
userId: '',
sexOptions,
welfareUnits:[],
unionGroups:[],
threeUnits:[],
units:[],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
},
methods: {
async doBatchJoinPhysicals() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要设置为体检人员的用户")
return
}
this.selectUserLoading = true
const resp = await $.post(physicalsCommonUrl + "/joinPhysicals", {userIds: JSON.stringify(this.selectUsers)});
requestLaterMsgFun(this, resp, async () => {
this.pageData()
this.$refs.userSelect.init()
this.selectUserVisible = false
}, null, () => {
this.selectUserLoading = false
})
},
pushDropdownCommand({type}) {
if (type === 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type === 'add') {
this.openEdit('')
}
},
kickPhysicals() {
this.$confirm('确定要移除体检人员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(physicalsCommonUrl + "/kickPhysicals", {
userIds: JSON.stringify(this.checkUsers.map(v => v.id))
});
requestLaterMsgFun(this, resp, async () => {
this.$refs.table.clearSelection();
this.doSearch()
})
}).catch(() => {
})
},
async doBatchEdit() {
const batch = this.checkUsers.map(v => {
return {id: v.id, campusId: v.campusId}
})
this.batchEditLoading = true
const resp = await $.post(loc() + "/batchEdit", {users: JSON.stringify(batch)});
requestLaterMsgFun(this, resp, async () => {
this.pageData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
}, null, () => {
this.batchEditLoading = false
})
},
openBatchEdit() {
this.batchFormData = {}
this.batchEditVisible = true
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
tableHandleSelectionChange(val) {
this.checkUsers = val;
},
async doEditCampus(row) {
const {id, modifiedCampusId} = row
this.$set(row, "editCampusLoading", true)
const resp = await $.post(loc() + "/batchEdit", {
users: JSON.stringify([{
id: id,
campusId: modifiedCampusId,
}])
});
requestLaterMsgFun(this, resp, async () => {
this.$set(row, "editCampusLoading", false)
this.$set(row, "editCampus", false)
this.pageData()
})
},
doDelete(userId) {
this.$confirm('确定要移除体检人员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(physicalsCommonUrl + "/kickPhysicals", {userIds: JSON.stringify([userId])});
requestLaterMsgFun(this, resp, () => {
this.doSearch()
})
}).catch(() => {
})
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'view') {
this.openView(data.id)
} else if (type === 'edit') {
this.openEdit(data.id)
} else if (type === 'delete') {
this.doDelete(data.id)
} else if (type === 'editCampus') {
this.$set(data, 'modifiedCampusId', data.campusId)
this.$set(data, 'editCampus', true)
}
},
async joinPhysicals(memData) {
await $.post(physicalsCommonUrl + "/joinPhysicals", {userIds: JSON.stringify([memData.id])})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinPhysicals(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
openEdit(userId) {
this.userId = userId
this.$refs.guava.edit()
},
openView(userId) {
this.active = 'info'
this.userId = userId
this.$refs.guava.view()
},
async unionChange(val) {
this.$set(this.pageForm, 'unitId', '')
this.unitOptions = await getComponentUnitPhysicals(val)
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unitId', '')
this.units = await getComponentUnit(this.pageForm.unionId)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unitId, this.pageForm.unionGroupId)
}
},
async created() {
this.pageData();
this.unionOptions = await getWelfareUnitPhysicals()
this.campusOptions = await getCampus()
this.unitOptions = await getComponentUnitPhysicals(null)
this.changeWelfareUnit();
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,336 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.flexible-gifts {
display: flex;
flex-direction: column
}
.flexible-gifts-item {
display: flex;
}
.flexible-gifts-item:not(:first-of-type) {
margin-top: 15px;
}
.flexible-gifts-item-input {
width: calc(100% - 144px);
}
.flexible-gifts-item-radio {
width: 100px;
text-align: center;
}
.flexible-gifts-item-delete {
width: 44px;
}
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 20%">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
v-model="pageForm.year"
type="year"
style="width: 100%"
value-format="yyyy"
placeholder="请选择">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">项目名称:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.name"
@keyup.enter.native="doSearch" style="width:100%"></el-input>
</div>
</div>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="体检项目" :app="this">
<template #func>
<el-button type="primary" size="small" icon="el-icon-plus" @click="openAdd">新建体检项目
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table">
<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"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop=='physicalsTimeStart'" scope="{row}">
<i class="el-icon-time"></i>&ensp;{{row.physicalsTimeStart}} 至 {{row.physicalsTimeEnd}}
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="150px">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<el-button plain size="mini" :loading="submitLoading">
<i class="ti-settings"></i>
<span class="ti-angle-down"></span>
</el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :disabled="!row.created"
:command="{type:'export',data:row}">
导出体检名单
</el-dropdown-item>
<el-dropdown-item
:disabled="moment().valueOf()>=moment(row.physicalsTimeStart).valueOf()"
:command="{type:'createList',data:row}">
{{row.created?'重新生成体检名单':'生成体检名单'}}
</el-dropdown-item>
<el-dropdown-item
:disabled="moment().valueOf()>=moment(row.physicalsTimeEnd).valueOf()"
:command="{type:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">
删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="form" :rules="formRules" label-width="120px" v-loading="formLoading">
<vi-title title="体检项目信息"></vi-title>
<el-form-item prop="name" label="项目名称">
<el-input v-model="formData.name" placeholder="项目名称" maxlength="100"></el-input>
</el-form-item>
<el-form-item prop="physicalsTime" label="体检时间">
<el-date-picker
style="width: 100%"
v-model="formData.physicalsTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间" @change="provideTimeChange">
</el-date-picker>
</el-form-item>
<el-form-item prop="physicalsAddress" label="体检地点">
<el-input v-model="formData.physicalsAddress" placeholder="体检地点"
suffix-icon="el-icon-location-information" maxlength="200"></el-input>
</el-form-item>
<el-form-item prop="conditionStructure" label="体检范围">
<el-button @click="$refs.cnd.open()" size="small" icon="el-icon-s-operation">打开</el-button>
</el-form-item>
</el-form>
<el-button @click="save" :loading="submitLoading" type="primary" style="float: right">提交</el-button>
</template>
<template #view>
</template>
</guava>
<condition ref="cnd" v-model="formData.conditionStructure" :fields="fields"></condition>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
fields: [
{
label: '性别',
value: 'sex',
type: "select",
options: [{label: '男', value: '男'}, {label: '女', value: '女'}]
},
{label: '出生日期', value: 'birthday', type: "date"},
],
pageForm: {
year: moment().format('YYYY')
},
tableColumns: [
{prop: 'year', label: '年度'},
{prop: 'name', label: '项目名称'},
{prop: 'physicalsAddress', label: '体检地址'},
{prop: 'physicalsTimeStart', label: '体检时间'},
],
formRules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
physicalsTime: [{required: true, message: '必选', trigger: ['blur', 'change']}],
physicalsAddress: [{required: true, message: '必选', trigger: ['blur', 'change']}],
},
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
},
methods: {
exportPhysicalsList,
save() {
this.$refs["form"].validate(async (valid) => {
if (valid) {
this.submitLoading = true
const formData = clone(this.formData)
if (formData.conditionStructure)
formData.conditionStructure = JSON.stringify(formData.conditionStructure)
const resp = await $.post(loc() + "/save", formData)
requestLaterMsgFun(this, resp, () => {
this.$refs.guava.index()
this.pageData()
}, () => {
}, () => {
this.submitLoading = false
})
}
})
},
provideTimeChange() {
if (this.formData.physicalsTime && this.formData.physicalsTime.length) {
this.formData.physicalsTimeStart = this.formData.physicalsTime[0]
this.formData.physicalsTimeEnd = this.formData.physicalsTime[1]
} else {
this.formData.physicalsTimeStart = ''
this.formData.physicalsTimeEnd = ''
}
},
openAdd() {
this.formData = {}
this.$refs.guava.edit()
if (this.$refs.form)
this.$refs.form.resetFields();
},
async createList(id) {
this.$confirm('是否生成体检名单?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.submitLoading = true
const resp = await $.post(loc() + "/createList", {id});
requestLaterMsgFun(this, resp, async () => {
this.pageData()
}, null, () => {
this.submitLoading = false
})
}).catch(() => {
});
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post(loc() + "/delete", {id});
requestLaterMsgFun(this, resp, async () => {
this.pageData()
})
}).catch(() => {
});
},
dropdownCommand(command) {
const {type, data} = command
if (type === 'edit') {
this.openEdit(data)
} else if (type === 'delete') {
this.doDelete(data.id)
} else if (type === 'createList') {
this.createList(data.id)
} else if (type === 'export') {
this.exportPhysicalsList(data.id)
}
},
async openEdit(row) {
this.submitLoading = true
const resp = await $.get(loc() + "/findOne", {id: row.id})
requestLaterFun(resp, (data) => {
data.physicalsTime = [data.physicalsTimeStart, data.physicalsTimeEnd]
this.formData = data
this.$refs.guava.edit()
}, null, () => {
this.submitLoading = false
})
}
},
async created() {
this.pageData();
const personType = await getDictOptions("UserType")
const userState = await getDictOptions("userState")
this.fields = this.fields.concat([{
label: '人员类型',
value: 'personType',
type: "select",
options: personType.map(v => {
return {label: v.name, value: v.code}
})
}, {
label: '在职状态',
value: 'userState',
type: "select",
options: userState.map(v => {
return {label: v.name, value: v.code}
})
}])
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,316 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-table .auditing-row {
background: oldlace;
}
.el-table .audit-error-row {
background: #fa465926;
}
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0 5%">
<template>
<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
:clearable="false"
@change="yearChange"
placeholder="选择年"
type="year"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">体检项目:</div>
<div class="search-item-option">
<el-select @change="doSearch" v-model="pageForm.projectId" style="width: 100%">
<el-option :key="item.id" :label="item.name" :value="item.id"
v-for="item in projectSelectOptions"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
@keyup.enter.native="doSearch" style="width: 100%">
<el-select v-model="pageForm.searchName" slot="prepend" style="width: 80px;">
<el-option label="姓名" value="u.username"></el-option>
<el-option label="工号" value="u.loginname"></el-option>
</el-select>
</el-input>
</div>
</div>
<!--<div class="search-item">
<div class="search-item-label">{{unitMode[physicalsUnitMode].name}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.unionId" style="width: 100%" filterable clearable
placeholder="请选择" @change="unionChange">
<el-option
v-for="item in unionOptions"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</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.unionId" style="width: 100%" filterable
clearable
placeholder="请选择" @change="changeWelfareUnit">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</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.unitId" style="width: 100%" filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in units"
:key="item.id"
: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.unionGroupId" style="width: 100%"
filterable
clearable
@change="getThreeUnits"
placeholder="请选择">
<el-option
v-for="item in unionGroups"
:key="item.id"
:label="item.groupName"
: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.threeUnitId" style="width: 100%" filterable
clearable
placeholder="请选择">
<el-option
v-for="item in threeUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</div>
</div>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">所属校区:</div>
<div class="search-item-option">
<el-select v-model="pageForm.campus" style="width: 100%" clearable
placeholder="请选择">
<el-option
v-for="item in campusOptions"
:key="item.campus_id"
:label="item.campus_name"
:value="item.campus_id">
</el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;别:</div>
<div class="search-item-option">
<el-select v-model="pageForm.sex" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="sex in sexOptions" :label="sex" :value="sex"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.personType" style="width: 100%" clearable
placeholder="人员类型"
code="UserType"></dict-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">在职状态:</div>
<div class="search-item-option">
<dict-select v-model="pageForm.userState" style="width: 100%" clearable
placeholder="在职状态"
code="userState"></dict-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="人员列表" :app="this">
<template #func>
<el-button :disabled="!pageForm.projectId" type="primary" size="small" icon="el-icon-download"
@click="exportPhysicalsList(pageForm.projectId)">
导出
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder" :size="tableSize"
v-loading="tableLoading" ref="table" class="vi-table">
<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"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
<template v-if="column.prop==='loginname'" scope="{row}">
<el-link type="primary" @click="openView(row)">{{row.loginname}}</el-link>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member ref="memberInfo" :id="userId" :source="source" view></member>
</template>
</guava>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unitMode: {
UNIT: {
name: '福利单位'
},
UNION: {
name: '所属工会'
}
},
physicalsUnitMode: "${getSysConfig('PhysicalsUnitMode')}",
projectOptions: [],
pageForm: {
year:moment().format('YYYY'),
searchName: 'u.username',
},
tableColumns: physicalsCommonColumns,
unionOptions: [],
unitOptions: [],
userId: '',
sexOptions,
source: 'sys_user',
projectSelectOptions:[],
welfareUnits:[],
unionGroups:[],
threeUnits:[],
units:[],
campusOptions: [],
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.4'),
},
methods: {
yearChange(){
this.getProjectByYear()
},
exportPhysicalsList,
openView({id}) {
this.userId = id
this.$refs.guava.view()
},
async unionChange(val) {
this.$set(this.pageForm, 'unitId', '')
this.unitOptions = await getComponentUnitPhysicals(val)
},
projectOptionChange(val) {
this.pageForm.projectId = val[1]
this.doSearch()
},
async getProjectByYear(){
const resp = await $.post('/platform/physicals/roster/getProjectByYear',{year:this.pageForm.year})
if (resp.code === 0){
this.projectSelectOptions = resp.data
this.pageForm.projectId = this.projectSelectOptions[0].id
}
this.pageData();
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unitId', '')
this.units = await getComponentUnit(this.pageForm.unionId)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.unionId)
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unitId, this.pageForm.unionGroupId)
}
},
async created() {
this.projectOptions = await getPhysicalsProjects()
this.unionOptions = await getWelfareUnitPhysicals()
this.unitOptions = await getComponentUnitPhysicals(null)
await this.getProjectByYear();
this.campusOptions = await getCampus()
this.changeWelfareUnit();
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
}
})
</script>
<!--#
}
#-->