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,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>
<!--#
}
#-->