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,126 @@
let welfareUnitMode = {
sexOptions: ['男', '女'],
UNIT: {
modeName: '福利单位'
},
UNION: {
modeName: '所属工会'
},
getWelfareUnit: async () => {
const {code, data} = await $.get(welfareCommonUrl + "/welfareUnit")
if (!code) {
return data
}
return []
},
getComponentUnit: async (unitId) => {
const {code, data} = await $.get(welfareCommonUrl + "/componentUnit", {unitId})
if (!code) {
return data
}
return []
}
}
let welfare = {
welfareUnitMode: "${getSysConfig('WelfareUnitMode')}",
welfareUnitModeName: welfareUnitMode["${getSysConfig('WelfareUnitMode')}"].modeName
}
let welfarePersonTypeList = []
let welfareCommonUrl = "/platform/welfare/common";
let getWelfareUnit = async (isPermission = false) => {
const {code, data} = await $.get(welfareCommonUrl + "/welfareUnit", {isPermission})
if (!code) {
return data
}
return []
}
let getComponentUnit = async (unitId) => {
const {code, data} = await $.get(welfareCommonUrl + "/componentUnit", {unitId})
if (!code) {
return data
}
return []
}
let getWelfareProjects = async () => {
const {code, data} = await $.get(welfareCommonUrl + "/welfareProjects")
if (!code) {
return data
}
return []
}
let exportWelfareList = (projectId, personType, unionGroupId) => {
let url = welfareCommonUrl + "/exportWelfareList?projectId=" + projectId + "&unionGroupId=" + unionGroupId
if (personType.length > 0) {
url += "&personType=" + JSON.stringify(personType)
}
// location.href = url
window.open(url)
// location.href = welfareCommonUrl + "/exportWelfareList?projectId=" + projectId + "&personType=" + JSON.stringify(personType)
}
let doExportWelfare = (projectId) => {
window.open(welfareCommonUrl + "/doExportWelfare?projectId=" + projectId)
}
let doExportWelfareReceive = (projectId) => {
window.open(welfareCommonUrl + "/exportReceive?projectId=" + projectId)
}
let exportWelfareListSummary = (projectId) => {
window.open(welfareCommonUrl + "/exportWelfareListSummary?projectId=" + projectId)
}
let getPersonTypeListGroupByWelfare = async () => {
const {code, data} = await $.get(welfareCommonUrl + "/getPersonTypeListGroupByWelfare")
if (!code) {
return data
}
return []
}
const minixs = {
methods: {
async yearChange(val) {
if (val) {
const option = this.projectOptions.find(v => v.label === parseInt(val))
if (option) {
this.projectSelectOptions = this.projectOptions.find(v => v.label === parseInt(val)).children
} else {
this.pageForm.projectId = null
this.projectSelectOptions = []
}
} else {
this.projectSelectOptions = []
this.projectOptions.forEach(v => {
this.projectSelectOptions = this.projectSelectOptions.concat(v.children)
})
}
if (this.projectSelectOptions && this.projectSelectOptions.length > 0) {
this.pageForm.projectId = this.projectSelectOptions[0].value
}
this.doSearch()
}
}
}
const judgmentAuthority = "${@shiro.hasRole('sysadmin')||@shiro.hasRole('flwyh01')||@shiro.hasRole('A06')}" === 'true'
// const sexOptions = ['男', '女']
let commonColumns = [{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
{prop: 'personType', label: '人员类型', sortable: true, checked: 0},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true},
// {prop: 'isReceive', label: '是否领取', sortable: true}
]
// {prop: 'campusName', label: '所属校区', sortable: true},]
@@ -0,0 +1,952 @@
<!--#
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;
}
.search-item-option .el-date-editor, .search-item-option .el-select {
width: 100%;
}
</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="true"
@change="yearChange"
placeholder="选择年"
type="year"
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();getWelfareOptions();"
v-model="pageForm.projectId">
<el-option :key="item.value" :label="item.label" :value="item.value"
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-date-picker
style="width: 100%"
v-model="pageForm.month"
type="month"
value-format="yyyy-MM"
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.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">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" 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.unit" 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">性&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="doExportWelfareReceive(pageForm.projectId)">导出领取名单-->
<!-- </el-button>-->
<!-- <el-button v-if="pageFormProjectType===3" type="primary" size="small"
icon="el-icon-download"
@click="sendMsgToNotWriteAddressUsers">
发送消息至未填写地址人员
</el-button>-->
<template
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('flwyh01')||@shiro.hasRole('H05')||@shiro.hasRole('ghxzzz')}">
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-download"
@click="doExportList">导出列表
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-download"
@click="openExportWelFareList(pageForm.projectId)">导出签字表
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-download"
@click="doExportWelfareListAll(pageForm.projectId)">导出名单Excel
</el-button>
<!--<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-download"
@click="doExportWelfare(pageForm.projectId)">导出名单
</el-button>-->
</template>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-download"
@click="doWholeReceive(pageForm.projectId)"
v-if="pageFormSignMode===1&&${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}">
批量领取
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-download"
@click="doOneKeyReceive(pageForm.projectId)"
v-if="pageFormSignMode===1&&${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}">
一键全部领取
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-plus"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}"
@click="openAdd">添加
</el-button>
<el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-document-add"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}"
@click="openImport">导入人员
</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="handleSelectionChange">
<el-table-column
:reserve-selection="true"
:selectable="(row)=>{return !row.isReceive}"
type="selection"
width="55px">
</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=='provideTimeStart'" scope="{row}">
<i class="el-icon-time"></i>&ensp;{{row.provideTimeStart}} -
{{row.provideTimeEnd}}
</template>
<template v-else-if="column.prop=='unionname'" scope="{row}">
( {{row.unioncode}}){{row.unionname}}
</template>
<template v-else-if="column.prop=='unitname'" scope="{row}">
( {{row.unitcode}}){{row.unitname}}
</template>
<template v-else-if="column.prop=='isReceive'" scope="{row}">
<el-tag type="success" v-if="row.isReceive">已领取</el-tag>
<el-tag type="warning" v-else>未领取</el-tag>
</template>
<template v-else-if="column.prop=='gist_list'" scope="{row}">
{{row.gist_list?row.gist_list:'暂无'}}
</template>
<template v-else-if="column.prop=='threeUnitName'" scope="{row}">
<span v-if="row.threeUnitName"> ( {{row.threeUnitCode}}){{row.threeUnitName}}</span>
<span v-else>暂无</span>
</template>
<template v-else-if="column.prop=='userSign'" scope="{row}">
<el-image v-if="row.userSign"
:src="row.userSign"
fit="cover" style="height: 60px"></el-image>
<el-tag type="warning" v-else>暂无</el-tag>
</template>
<template v-else-if="column.prop=='realWelfareUnitId'" scope="{row}">
<span v-if="!row.editWelfareUnit">{{row.realWelfareUnitName}}</span>
<div v-else>
<el-select v-model="row.modifiedWelfareUnitId" filterable
style="width: 160px" clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column label="配送地址" prop="receiveAddress" width="200px"
v-if="pageFormProjectType===3">
<template scope="{row}">
<span v-if="row.receiveAddress">{{row.receiveAddress.includes('undefined')?'':row.receiveAddress}}</span>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作" width="300px"
fixed="right">
<template scope="{row}">
<div v-if="row.editWelfareUnit">
<el-button size="mini" :loading="row.editWelfareUnitLoading"
type="primary"
@click="doEditWelfareUnit(row)">确定
</el-button>
<el-button size="mini" :disabled="row.editWelfareUnitLoading"
@click="row.editWelfareUnit=!row.editWelfareUnit">取消
</el-button>
</div>
<el-button plain @click="doReceive(row)" size="mini" type="primary"
v-if="pageFormSignMode===1&&!row.isReceive&&${@shiro.hasRole('sysadmin')||@shiro.hasRole('H05')}">
领取
</el-button>
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button @click="openEditWelfare(row)" size="mini" type="primary">
编辑
</el-button>
<el-button @click="doDelete(row)" size="mini" type="danger"
v-if="${@shiro.hasRole('sysadmin')}">
删除
</el-button>
</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-dialog title="" :visible.sync="exportWelfareListDialog" width="40%">
<el-row class="pt5 pb5 text-danger">勾选需要导出的人员类型</el-row>
<el-row class="pt10 pb10">
<el-checkbox-group v-model="selPersonType">
<el-checkbox v-for="i in welfarePersonTypeList" :label="i.personType"></el-checkbox>
</el-checkbox-group>
</el-row>
<el-row type="flex" justify="end">
<el-button @click="doExportWelFareList" type="primary">确定</el-button>
</el-row>
</el-dialog>
<el-dialog title="修改福利" :visible.sync="exportWelfareListDialog" width="50%">
<el-form :model="editWelfareData" label-width="120px" ref="editWelfareForm">
<el-form-item label="姓名">
<el-input :value="editWelfareData.username"></el-input>
</el-form-item>
<el-form-item label="工号">
<el-input :value="editWelfareData.loginname"></el-input>
</el-form-item>
<el-form-item label="福利"
prop="optionIds"
:rules="[{required:true,message:'请选择',trigger:['change','blur']}]">
<el-select v-model="editWelfareData.optionIds" style="width: 100%"
@change="optionIdsChange">
<el-option v-for="item in welfareOptions" :key="item.id" :value="item.id"
:label="item.optionName"></el-option>
</el-select>
</el-form-item>
<el-form-item label="示例地址" v-if="ifReceiveAddress" style="color: red">
<span>收货地址:XXXX,收件人:{{editWelfareData.username}},联系方式:{{editWelfareData.mobile}}</span>
</el-form-item>
<el-form-item label="配送地址"
v-if="ifReceiveAddress"
prop="receiveAddress"
:rules="[{required:true,message:'请填写配送地址',trigger:['change','blur']}]">
<el-input v-model="editWelfareData.receiveAddress" type="textarea" :rows="2"
placeholder="请按照上方示例地址填写"></el-input>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="exportWelfareListDialog=false" type="primary">取消</el-button>
<el-button @click="doEditWelfareData" type="primary">确定</el-button>
</el-row>
</el-dialog>
<el-dialog
title="福利名单人员导入"
:visible.sync="importVisible"
:close-on-click-modal="false"
width="50%"
>
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-button size="medium" type=""
@click="location.href='/platform/welfare/list/mange/downloadImportTemplate'"
icon="el-icon-download">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-form>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload"
style="width: 200px">选择文件
</el-button>
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
只能上传 xls/xlsx 文件,按工号导入当前福利项目名单
</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span>
</el-dialog>
<el-drawer
title="添加福利名单人员"
:visible.sync="selectUserVisible"
:before-close="handleClose" size="1200px">
<user-select v-model="selectUsers" ref="userSelect" :page_size="10"
:sql_cnd="selectUserSqlCnd"></user-select>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="selectUserVisible = false"
:disabled="selectUserLoading">取 消</el-button>
<el-button type="primary" @click="doBatchJoinList"
:loading="selectUserLoading">确定</el-button>
</span>
</el-drawer>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins, minixs],
computed: {
selectUserSqlCnd() {
if (!this.pageForm.projectId) {
return []
}
return ["u.id not in (select userId from welfare_list where projectId = '" + this.pageForm.projectId + "')"]
},
pageFormProjectType() {
if (this.pageForm.projectId) {
const projectInfo = this.projectSelectOptions.find(v => v.value === this.pageForm.projectId)
if (projectInfo.v) {
return projectInfo.v.provideMode
}
return null
}
return null
},
pageFormSignMode() {
if (this.pageForm.projectId) {
const projectInfo = this.projectSelectOptions.find(v => v.value === this.pageForm.projectId)
if (projectInfo.v) {
return projectInfo.v.signMode
}
return null
}
return null
},
},
data() {
return {
selectUserLoading: false,
selectUserVisible: false,
selectUsers: [],
importVisible: false,
importLoading: false,
importData: {
fileList: [],
},
userId: '',
projectOptions: [],
units: [],
welfareUnits: [],
threeUnits: [],
unionGroups: [],
welfareProvideMode: [],
welfareSignMode: [],
welfareNoticePushMode: [],
pageForm: {
year: moment().format('YYYY'),
searchName: 'username',
welfareUnit: '',
unionGroupId: '',
},
tableColumns: commonColumns.concat([
// {prop: 'realWelfareUnitId', label: '福利发放单位', sortable: true, width: "200px"},
{prop: 'isReceive', label: '是否领取', width: "100px"},
{prop: 'gist_list', label: '所选福利', width: "100px"},
{prop: 'userSign', label: '签字', width: "100px"},
// {prop: 'receiveAddress', label: '邮寄地址', width: "200px"},
]),
formRules: {},
welfare,
welfareUnitMode,
exportWelfareListDialog: false,
selPersonType: [],
welfare_id: null,
welfarePersonTypeList: [],
projectSelectOptions: [],
choiceList: [],
editWelfareData: {},
welfareOptions: [],
ifReceiveAddress: false,
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
async doBatchJoinList() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要添加的人员")
return
}
this.selectUserLoading = true
const resp = await $.post(loc() + "/joinWelfareList", {
projectId: this.pageForm.projectId,
userIds: JSON.stringify(this.selectUsers)
})
this.selectUserLoading = false
if (resp.code === 0) {
this.pageData()
this.$refs.userSelect.init()
this.selectUserVisible = false
} else {
this.notifyWarning(resp.msg)
}
},
doExportList() {
window.open(loc() + "/exportList?" + $.param(this.pageForm))
},
doImport() {
if (!this.pageForm.projectId) {
this.notifyWarning("请先选择福利项目")
return
}
if (this.importData.fileList.length === 0) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
data.append("projectId", this.pageForm.projectId)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = true
$.ajax({
url: loc() + "/importUsers",
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
this.importLoading = false
if (data.code === 0) {
this.notifySuccess(data.msg)
this.pageData();
this.importVisible = false
} else {
this.notifyWarning(data.msg)
}
},
error: () => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
openImport() {
if (!this.pageForm.projectId) {
this.notifyWarning("请先选择福利项目")
return
}
this.importData = {
fileList: [],
}
this.importVisible = true;
},
doExportWelfareListAll(projectId) {
const {
welfareUnit,
unit,
unionGroupId,
threeUnitId,
} = this.pageForm
window.location.href = '/platform/welfare/common/doExportWelfareListAll?projectId='
+ projectId + "&unionId=" + welfareUnit + "&unitId=" + unit
+ "&unionGroupId=" + unionGroupId + "&threeUnitId=" + threeUnitId
},
async openEditWelfare(row) {
this.exportWelfareListDialog = true
const data = await searchUser(row.loginname, null, null, null, null)
this.editWelfareData = {
mobile: (data.length !== 0) ? data[0].mobile : '',
username: row.username,
loginname: row.loginname,
optionIds: row.gift_list_id ? row.gift_list_id[0] : '',
receiveAddress: row.receiveAddress,
projectId: this.pageForm.projectId,
userId: row.id
}
this.optionIdsChange(this.editWelfareData.optionIds)
},
optionIdsChange(val) {
const tcArr = this.welfareOptions.filter(v => v.optionType === "套餐")
const tc = tcArr.find(v => v.id === val)
if (tc && this.pageFormProjectType === 3) {
this.ifReceiveAddress = true
} else {
this.editWelfareData.receiveAddress = null
this.ifReceiveAddress = false
}
},
doEditWelfareData() {
this.$refs['editWelfareForm'].validate(async valid => {
if (valid) {
const formData = clone(this.editWelfareData)
formData.optionIds = [formData.optionIds]
const resp = await $.post(loc() + "/doEditWelfareData", formData)
this.exportWelfareListDialog = false
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
})
},
doReceive(row) {
this.$confirm('请确认【' + row.username + '】是否领取?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
this.choiceList.push(row.id)
const resp = await $.post(loc() + "/doWholeReceive", {
id: this.pageForm.projectId,
choices: JSON.stringify(this.choiceList)
})
if (resp.code === 0) {
this.$refs.table.clearSelection();
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
handleSelectionChange(val) {
this.choiceList = val.map(v => v.id);
},
doWholeReceive(id) {
if (this.choiceList.length === 0) {
this.notifyWarning('请先在左侧勾选')
return
}
this.$confirm('确定要领取吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(loc() + "/doWholeReceive", {
id: id,
choices: JSON.stringify(this.choiceList)
});
if (resp.code === 0) {
this.$refs.table.clearSelection();
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
async doOneKeyReceive() {
const confirm = await this.$confirm('确定要一键全部领取吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) {
return
}
const resp = await $.post(loc() + "/doOneKeyReceive", {
id: this.pageForm.projectId
})
if (resp.code === 0) {
this.notifySuccess(resp.msg)
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
},
openExportWelFareList(id) {
// this.exportWelfareListDialog = true
this.welfare_id = id
this.exportWelfareList(this.welfare_id, this.selPersonType, this.pageForm.unionGroupId)
},
doExportWelFareList() {
this.exportWelfareList(this.welfare_id, this.selPersonType)
this.exportWelfareListDialog = false
},
exportWelfareList,
doExportWelfare,
doExportWelfareReceive,
async doEditWelfareUnit(row) {
const {listId, modifiedWelfareUnitId} = row
this.$set(row, "editWelfareUnitLoading", true)
const resp = await $.post(loc() + "/editWelfareUnit", {
listId,
welfareUnitId: modifiedWelfareUnitId,
})
if (resp.code === 0) {
this.$set(row, "editWelfareUnitLoading", false)
this.$set(row, "editWelfareUnit", false)
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
},
projectOptionChange(val) {
this.pageForm.projectId = val[1]
this.doSearch()
},
async joinWelfareList(user) {
await $.post(loc() + "/joinWelfareList", {
projectId: this.pageForm.projectId,
userIds: JSON.stringify([user.id])
})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinWelfareList(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
openAdd() {
if (!this.pageForm.projectId) {
this.notifyWarning("请先选择福利项目")
return
}
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.pageForm.sqlCnd = JSON.stringify(this.selectUserSqlCnd)
this.$refs.userSelect.init()
})
},
doDelete(row) {
this.$confirm('确定要移除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(loc() + "/delete", {id: JSON.stringify([row.listId])});
if (resp.code === 0) {
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
}
}
});
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'delete') {
this.doDelete(data.listId)
} else if (type == 'editWelfareUnit') {
this.$set(data, 'modifiedWelfareUnitId', data.realWelfareUnitId)
this.$set(data, 'editWelfareUnit', true)
}
},
openEdit({id}) {
this.userId = id
this.$refs.guava.edit()
},
openView({id}) {
this.userId = id
this.$refs.guava.view()
},
async sendMsgToNotWriteAddressUsers() {
const project = this.projectSelectOptions.find(v => v.value === this.pageForm.projectId)
const projectName = project.label
const confirm = await this.$confirm('您确定要向' + projectName + '未填写地址的人员发送信息吗?', '提示', {
confirmButtonText: '确定',
cancelButtonTest: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/sendMsgToNotWriteAddressUsers/' + project.value)
if (resp.code === 0) {
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
},
async getWelfareOptions() {
const resp = await $.post(loc() + '/welfareOptions', {projectId: this.pageForm.projectId})
this.welfareOptions = resp.data
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unit', '')
this.units = await getComponentUnit(this.pageForm.welfareUnit)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.welfareUnit)
if ("${@shiro.hasRole('ghxzzz')}" === 'true' && "${@shiro.hasRole('H04')}" === 'false') {
this.$set(this.pageForm, 'unionGroupId', this.unionGroups[0].id)
await this.getThreeUnits()
}
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unit, this.pageForm.unionGroupId)
}
},
async created() {
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
await this.changeWelfareUnit()
this.projectOptions = await getWelfareProjects()
this.welfarePersonTypeList = await getPersonTypeListGroupByWelfare()
this.welfarePersonTypeList.map(v => {
this.selPersonType.push(v.personType)
})
if (this.projectOptions.length && this.projectOptions[0].children.length) {
const yearOption = this.projectOptions.find(v => v.label === new Date().getFullYear()) || this.projectOptions[0]
this.projectSelectOptions = yearOption.children
this.$set(this.pageForm, "projectOption", [yearOption.value, yearOption.children[0].value])
this.$set(this.pageForm, "projectId", yearOption.children[0].value)
this.doSearch()
await this.getWelfareOptions()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,349 @@
<!--#
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;
}
.welfare-list .el-card {
border: none;
}
</style>
<div id="app" class="platform" v-cloak>
<guava ref="guava" padding="0">
<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="projectOptionChange" v-model="pageForm.projectId" style="width: 100%">
<el-option :key="item.value" :label="item.label" :value="item.value"
v-for="item in projectSelectOptions"></el-option>
</el-select>
<!-- <el-cascader style="width: 100%"-->
<!-- v-model="pageForm.projectOption"-->
<!-- :options="projectOptions" @change="projectOptionChange"></el-cascader>-->
</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">-->
<table-tool label="工会小组汇总" :app="this">
<template #func>
<el-button :disabled="!pageForm.projectId" type="primary" size="small" icon="el-icon-download"
@click="exportWelfareListSummary(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">
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="170px"
fixed="right">
<template scope="{row}">
<el-button size="small" @click="openView(row)">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view class="welfare-list">
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">福利项目:</div>
<div class="search-item-option">
<el-cascader style="width: 100%" disabled
v-model="pageForm.projectOption"
:options="projectOptions" @change="projectOptionChange"></el-cascader>
</div>
</div>
<div class="search-item">
<div class="search-item-label">职工信息:</div>
<div class="search-item-option">
<el-input placeholder="请输入内容" clearable v-model="listPageForm.searchKeyword"
@keyup.enter.native="doSearch" style="width: 100%">
<el-select v-model="listPageForm.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="listPageForm.unit" style="width: 100%" filterable clearable
placeholder="请选择">
<el-option
v-for="item in units"
: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">&emsp;&emsp;别:</div>
<div class="search-item-option">
<el-select v-model="listPageForm.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="listPageForm.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="listPageForm.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="listDoSearch">搜索</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<el-table :data="listTableData" style="width: 100%" row-key="id" @sort-change="listPageOrder"
v-loading="listTableLoading" ref="listTable" class="vi-table">
<el-table-column align="center" header-align="center" type="index" label="序号"
width="80px">
<template scope="{$index}">
{{$index + (listPageForm.pageNumber - 1) * listPageForm.pageSize + 1}}
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in listTableColumns"
show-overflow-tooltip
:sortable="column.sortable"
:label="column.label"
:prop="column.prop" :width="column.width" min-width="100px">
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="listPageSizeChange"
@current-change="listPageNumberChange"
:current-page="listPageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="listPageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="listPageForm.totalCount">
</el-pagination>
</el-row>
</el-card>
</template>
</guava>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
exportWelfareListSummary,
listPageForm: {
searchName: 'username',
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: "",
},
listTableData: [],
listTableLoading: false,
listTableColumns: commonColumns,
units: [],
projectOptions: [],
projectSelectOptions: [],
pageForm: {
year: moment().format('YYYY'),
searchName: 'username'
},
tableColumns: [
// {prop: 'welfareUnitName', label: welfare.welfareUnitModeName},
{prop: 'groupName', label: "工会小组"},
{prop: 'unionName', label: "所属工会"},
{prop: 'groupAddress', label: "发放地址"},
{prop: 'groupContact', label: "联系人电话"},
{prop: 'number', label: "合计"},
],
formRules: {},
welfare,
welfareUnitMode,
sexOptions
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
},
methods: {
yearChange() {
this.projectSelectOptions = [];
this.projectSelectOptions = this.projectOptions.find(v => v.label === new Date(this.pageForm.year).getFullYear()).children
this.$set(this.pageForm, "projectId", this.projectSelectOptions[0].value)
this.pageData()
},
listDoSearch() {
this.listPageForm.pageNumber = 1
this.listPageData()
},
listPageOrder(column) {
this.listPageForm.pageOrderName = column.prop;
this.listPageForm.pageOrderBy = column.order;
this.listPageData();
},
listPageNumberChange(val) {
this.listPageForm.pageNumber = val;
this.listPageData();
},
listPageSizeChange(val) {
this.listPageForm.pageSize = val;
this.listPageData();
},
listPageData() {
sublime.showLoadingbar();
this.listTableLoading = true
$.post("/platform/welfare/list/mange/pageData", this.listPageForm, (data) => {
sublime.closeLoadingbar();
this.listTableLoading = false
if (data.code == 0) {
this.listTableData = data.data.list;
this.listPageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
},
projectOptionChange(val) {
this.pageForm.projectId = val
this.listPageForm.projectId = val
this.doSearch()
},
async openView(row) {
this.units = await welfareUnitMode.getComponentUnit(row.unionId)
this.listPageForm.welfareUnit = row.unionId
this.listPageForm.unionGroupId = row.groupId
this.listDoSearch()
this.$refs.guava.view()
},
},
async created() {
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
this.projectOptions = await getWelfareProjects()
if (this.projectOptions.length && this.projectOptions[0].children.length) {
this.projectSelectOptions = this.projectOptions.find(v => v.label === new Date().getFullYear()).children
this.$set(this.pageForm, "projectOption", [this.projectOptions[0].value, this.projectOptions[0].children[0].value])
this.$set(this.pageForm, "projectId", this.projectOptions[0].children[0].value)
this.$set(this.listPageForm, "projectId", this.projectOptions[0].children[0].value)
this.pageData()
}
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,981 @@
<!--#
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();getChangeData()"
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" v-if="judgmentAuthority">
<div class="search-item-label">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" 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.unit" 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>
<!-- <div class="search-item" style="width: 22%;">
<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>-->
<template v-if="searchMore">
<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>
<template v-if="searchMore">
<div class="search-item">
<div class="search-item-label">人员组成:</div>
<div class="search-item-option">
<el-select v-model="pageForm.member" style="width: 100%" clearable
placeholder="请选择">
<el-option v-for="member in memberOptions" :label="member.name"
:value="member.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item">
<div class="search-item-label">更新日期:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
v-model="pageForm.changeDateRange"
@change="changeDateRangeChange"
type="datetimerange"
:picker-options="pickerOptions"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
align="right">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">异动类型:</div>
<div class="search-item-option">
<enum-select v-model="pageForm.changeType" value="code"
label="description"
style="width:100%"
clearable placeholder="异动类型"
enum="UserChangeType"></enum-select>
</div>
</div>
</template>
<div class="search-query">
<el-button type="primary" icon="el-icon-search"
@click="doSearch();getChangeData()">搜索
</el-button>
<more v-model="searchMore"></more>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="人员列表" :app="this">
<template #label_end>
<span class="text-danger ml10"
style="font-size: 13px">提醒:小组长可以查看本小组之外的人员</span>
</template>
<template #func>
<span class="text-danger" style="font-size: 13px">人员信息有无变化:</span>
<el-select v-model="pageForm.welfareMember"
@change="doSearch();getChangeData()"
:clearable="false" size="small"
style="width: 150px;margin-right: 15px">
<el-option label="全部教职工范围内" :value="0"></el-option>
<el-option label="可发放福利老师" :value="1"></el-option>
<el-option label="不发放福利老师" :value="2"></el-option>
</el-select>
<el-radio-group v-model="pageForm.changed"
@change="doSearch();getChangeData()" class="mr5"
size="small">
<el-radio-button :label="0">全部({{numberData.all}}</el-radio-button>
<el-radio-button :label="1">有变化({{numberData.have}}</el-radio-button>
<el-radio-button :label="2">无变化({{numberData.no}}</el-radio-button>
</el-radio-group>
<!--
<enum-select v-if="pageForm.changed==1" v-model="pageForm.changeType"
size="small" value="code"
label="description"
style="width:150px"
clearable placeholder="异动类型" enum="UserChangeType"
@change="doSearch();getChangeData()"></enum-select>
-->
<!-- <el-button size="small" @click="openEdit('')" type="primary" class="mt5"
icon="el-icon-plus">
添加
</el-button>-->
<template
v-if="welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority">
<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 :disabled="!checkUsers.length" type="primary" size="small"
icon="el-icon-edit"
@click="openBatchEdit">
设置校区
</el-button>
<el-button :disabled="!checkUsers.length" type="primary" size="small"
icon="el-icon-edit"
@click="openUnitMove" class="ml5 ">
单位调整
</el-button>
</template>
</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"
:row-class-name="tableRowClassName"
lazy
:load="load"
:tree-props="{hasChildren: 'hasHis'}"
@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)">{{row.loginname}}
</el-link>
</template>
<template v-else-if="column.prop=='unionname'" scope="{row}">
( {{row.unioncode}}){{row.unionname}}
</template>
<template v-else-if="column.prop=='unitname'" scope="{row}">
( {{row.unitcode}}){{row.unitname}}
</template>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="100px"
header-align="center" sortable
align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="异动类型" prop="changeType" header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="福利会员" header-align="center" align="center"
prop="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<div v-if="row.flag">
<span v-if="row.welfareMember==1" class="text-success ">
<i
class="fa fa-circle ml5"></i>
</span>
<span v-else class="text-danger">
<i class="fa fa-circle ml5"></i>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="变更状态" header-align="center" align="center"
prop="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.stateId">
<vi-table-state :state="row"></vi-table-state>
</span>
<span v-else-if="row.mcrStateId"
:style="'color:'+row.mcrStateColor">{{ row.mcrStateName }}</span>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center"
label="操作" fixed="right">
<template scope="{row}">
<el-dropdown @command="dropdownCommand" v-if="row.flag">
<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
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
:disabled="row.welfareMember==1"
:command="{type:'apply',data:row}">
设为福利会员
</el-dropdown-item>
<el-dropdown-item :command="{type:'view',data:row}">
查看
</el-dropdown-item>
<el-dropdown-item
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
:disabled="row.welfareMember!=1||row.changeUnitAuditing"
:command="{type:'change',data:row}">
变更
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:row}"
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="row.welfareMember"
v-if="row.apply&&welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
: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" :source="source" 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="changeVisible"
:before-close="handleClose" size="1000px">
<div style="padding: 0 20px">
<mem-change-apply ref="apply" :userid="userId" @submit="doSubmit"></mem-change-apply>
</div>
</el-drawer>
<el-drawer
title="单位调整"
:visible.sync="unitMoveVisibile"
:before-close="handleClose" size="70%">
<el-row class="text-primary p20">
选择新单位
</el-row>
<el-row type="flex" :gutter="20" class="pl20 pr20">
<el-col :span="12">
<el-select placeholder="请选择新工会" v-model="unitMoveFormData.unionId"
style="width: 100%;"
clearable="true"
@change="moveUnionsChange"
filterable="true">
<el-option v-for="item in unitMoveUnions" :label="item.welfareUnitName"
:value="item.welfareUnitId"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.unitId" style="width: 100%" filterable
clearable
@change="moveUnitChange"
placeholder="请选择新单位">
<el-option
v-for="item in unitMoveUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.threeUnitId" clearable filterable
placeholder="请选择新科室"
style="width: 100%" @change="threeUnitChange">
<el-option
v-for="item in threeUnits2"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-input :value="unitMoveFormData.unionGroupName" disabled
placeholder="新工会小组"></el-input>
</el-col>
</el-row>
<el-row class="mt10">
<el-table :data="checkUsers" style="width: 100%;padding: 20px" class="vi-table"
border
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="loginname"
width="120"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="username"
width="120"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="threeUnitName"
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"
label="新科室">
<template slot-scope="{row}">
<span>{{unitMoveFormData.threeUnitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新单位">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新分工会">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unionName}}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="unitMoveVisibile = false">取 消</el-button>
<el-button type="primary" @click="doUnitMove">确定</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="['(u.welfareMember is null or u.welfareMember = 0) and c.taskId is null']"></user-select>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="selectUserVisible = false"
:disabled="selectUserLoading">取 消</el-button>
<el-button type="primary" @click="doBatchJoinMember"
: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 {
unitId:'',
pickerOptions: {
shortcuts: [{
text: '最近一周',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [start, end]);
}
}, {
text: '最近三个月',
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [start, end]);
}
}]
},
changeVisible: false,
welfareImportUnitList: [],
judgmentAuthority,
campusOptions: [],
batchEditLoading: false,
batchEditVisible: false,
checkUsers: [],
batchFormData: {},
changeType: {},
pageForm: {
searchName: 'u.username',
welfareMember: 1,
member: 1,
changed: 0,
},
tableColumns: [{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true}
],
welfareUnits: [],
units: [],
threeUnits: [],
unionGroups: [],
userId: '',
source: 'sys_user',
welfare,
welfareUnitMode,
sexOptions,
memberOptions: [{id: 1, name: '全部教职工'}, {id: 2, name: '工会会员'}, {
id: 3,
name: '非工会会员'
}],
numberData: {},
unitMoveVisibile: false,
threeUnits2: [],
unitMoveUnions: [],
unitMoveUnits: [],
unitMoveFormData: {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
},
selectUserVisible: false,
selectUsers: [],
selectUserLoading: false,
}
},
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'),
'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=1.0.1'),
},
methods: {
pushDropdownCommand({type}) {
if (type == 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type == 'add') {
this.openEdit('')
}
},
async doBatchJoinMember() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要设置为福利会员的用户")
return
}
this.selectUserLoading = true
const resp = await $.post(loc() + "/joinWelfareMember", {userIds: JSON.stringify(this.selectUsers)});
this.selectUserLoading = false
if(resp.code===0){
this.pageData()
this.$refs.userSelect.init()
this.selectUserVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
async doUnitMove() {
if (this.unitMoveFormData.unitId === '') {
this.notifyWarning('请选择新单位!')
return
}
if (this.unitMoveFormData.threeUnitId === '') {
this.notifyWarning('请选择新科室!')
return
}
const params = {
unitId: this.unitMoveFormData.unitId,
threeUnitId: this.unitMoveFormData.threeUnitId,
userId: this.checkUsers.map(v => v.id)
}
const resp = await $.post('/platform/member/change/mange/userUnitMove', params)
if(resp.code===0){
this.pageData()
this.$refs.table.clearSelection();
this.unitMoveVisibile = false
}else{
this.notifyWarning(resp.msg)
}
},
async threeUnitChange(val) {
if (val) {
const threeUnit = this.threeUnits2.find(v => v.id === val)
const groupName = threeUnit.groupname
this.$set(this.unitMoveFormData, 'threeUnitName', threeUnit.name)
this.$set(this.unitMoveFormData, 'unionGroupName', groupName)
} else {
this.$set(this.unitMoveFormData, 'unionGroupName', null)
}
},
async moveUnitChange(val) {
if (val) {
this.$set(this.unitMoveFormData, 'unitName', this.unitMoveUnits.find(v => v.id === val).name)
} else {
this.$set(this.unitMoveFormData, 'unitName', '')
}
if (val) {
this.threeUnits2 = await threeUnitsByUnionGroupOrUnitId(val, null)
}
},
async moveUnionsChange(val) {
if (val) {
this.unitMoveUnits = await getUnits(val)
this.$set(this.unitMoveFormData, 'unionName', this.unitMoveUnions.find(v => v.welfareUnitId === val).welfareUnitName)
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
} else {
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
this.$set(this.unitMoveFormData, 'unionName', '')
this.unitMoveUnits = []
}
},
openUnitMove() {
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
async getChangeData() {
const {data} = await $.post(loc() + "/getChangeNumber", this.pageForm)
this.numberData = data
},
changeDateRangeChange(val) {
this.pageForm.changeDateBefore = val[0]
this.pageForm.changeDateEnd = val[1]
},
tableRowClassName({row: {changeUnitAuditing, changeUnitError}, rowIndex}) {
if (changeUnitAuditing) {
return 'auditing-row';
} else if (changeUnitError) {
return 'audit-error-row';
}
return '';
},
async doSubmit(formData) {
const resp = await $.post(loc() + "/change", formData)
this.$refs.apply.closeLoading()
if(resp.code===0){
this.userId = ""
this.$refs.guava.index()
this.changeVisible = false
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
},
openChange({id}) {
this.userId = id
this.changeVisible = true
},
openBatchEdit() {
this.batchFormData = {}
this.batchEditVisible = true
},
async doBatchEdit() {
const batch = this.checkUsers.map(v => {
return {id: v.id, campusId: v.campusId}
})
this.batchEditLoading = true
const resp = await $.post("/platform/welfare/member/mange/batchEdit", {users: JSON.stringify(batch)});
this.batchEditLoading = false
if(resp.code===0){
this.pageData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
tableHandleSelectionChange(val) {
this.checkUsers = val;
},
apply({id, username}) {
this.$confirm('确定将' + username + '设为福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(loc() + "/joinWelfareMember", {userIds: JSON.stringify([id])});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
async joinWelfareMember(memData) {
await $.post(loc() + "/joinWelfareMember", {userIds: JSON.stringify([memData.id])})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinWelfareMember(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
async load(tree, treeNode, resolve) {
const {loginname} = tree
const resp = await $.get(loc() + "/historyUsers", {loginname})
if(resp.code===0){
resolve(data)
}else{
resolve([])
}
},
doDelete(userId) {
this.$confirm('确定要移除福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(welfareCommonUrl + "/kickWelfareMember", {userIds: JSON.stringify([userId])});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'edit') {
this.openEdit(data.id)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type == 'apply') {
this.apply(data)
} else if (type == 'change') {
this.openChange(data)
}
},
openEdit(userId) {
this.userId = userId
this.$refs.guava.edit()
if (!userId) {
this.$refs.member.getUserInfo()
}
},
openView({id, flag}) {
this.userId = id
this.source = flag ? 'sys_user' : 'user_history'
this.$refs.guava.view()
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unit', '')
this.units = await getComponentUnit(this.pageForm.welfareUnit)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.welfareUnit)
},
async getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unit, this.pageForm.unionGroupId)
}
},
async created() {
this.welfareImportUnitList = await getDictOptions("welfareImportUnit")
this.unitId = "${@shiro.getPrincipalProperty('unit').getId()}"
await this.getChangeData()
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
this.changeWelfareUnit()
this.unitMoveUnions = clone(this.welfareUnits)
this.campusOptions = await getCampus()
this.changeType = await this.getChangeType()
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,284 @@
<!--#
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="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">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" 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.unit" style="width: 100%" filterable clearable
placeholder="请选择">
<el-option
v-for="item in units"
: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">人员类型:</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 v-show="selectedApplies.length" type="primary" size="small" icon="el-icon-document-checked"
@click="openAudit">
审核
</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)">{{row.loginname}}</el-link>
</template>
<template v-if="column.prop=='stateId'" scope="{row}">
<vi-table-state :state="row"></vi-table-state>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作">
<template scope="{row}">
<el-dropdown @command="dropdownCommand">
<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:'audit',data:row}">
审核
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member ref="memberInfo" :id="userId" view></member>
</template>
</guava>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="30%">
<div style="font-size: 16px">
<i class="el-icon-question text-primary"></i>&ensp;
是否同意将{{selectedApply?' '+selectedApply.username+' ':'已勾选的人员'}}设置为福利会员?
</div>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible=false" :disabled="submitLoading">取 消</el-button>
<el-button size="small" type="danger" @click="doAudit(false)" :loading="submitLoading">驳 回</el-button>
<el-button size="small" type="primary" @click="doAudit(true)" :loading="submitLoading">通 过</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
selectedApply: undefined,
selectedApplies: [],
dialogVisible: false,
pageForm: {
searchName: 'u.username',
welfareMember: 0,
},
tableColumns: commonColumns.concat([
{prop: "stateId", label: "状态", sortable: true}
]),
welfareUnits: [],
units: [],
userId: '',
welfare,
welfareUnitMode
}
},
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'),
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
},
methods: {
openAudit() {
this.selectedApply = undefined
this.dialogVisible = true
},
tableHandleSelectionChange(val) {
this.selectedApplies = val;
},
async doAudit(flag) {
this.submitLoading = true
let applyIds
if (this.selectedApply) {
applyIds = [this.selectedApply.applyId]
} else {
applyIds = this.selectedApplies.map(v => v.applyId)
}
const resp = await $.post(loc() + "/audit", {applyIds: JSON.stringify(applyIds), flag: flag});
this.submitLoading = false
if(resp.code===0){
this.pageData()
this.dialogVisible = false
this.$refs.table.clearSelection();
}else{
this.notifyWarning(resp.msg)
}
},
dropdownCommand(command) {
const {type, data} = command
if (type == 'view') {
this.openView(data)
} else if (type == 'audit') {
this.selectedApply = data
this.dialogVisible = true
}
},
openView({id}) {
this.userId = id
this.$refs.guava.view()
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unit', '')
this.units = await getComponentUnit(this.pageForm.welfareUnit)
},
async getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
},
async created() {
this.pageData();
this.welfareUnits = await getWelfareUnit()
this.campusOptions = await getCampus()
this.units = await getComponentUnit()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,755 @@
<!--#
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">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" 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.unit" 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="kickWelfareMembers">
移除
</el-button>
<el-button type="primary" size="small" icon="el-icon-document-add"
v-if="welfareImportUnitList.map(v=>v.code).includes(unitId)||judgmentAuthority"
@click="openImport">导入名单
</el-button>
<el-button type="primary" size="small" icon="el-icon-download"
@click="doExportList">导出列表
</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=='unionname'" scope="{row}">
( {{row.unioncode}}){{row.unionname}}
</template>
<template v-else-if="column.prop=='unitname'" scope="{row}">
( {{row.unitcode}}){{row.unitname}}
</template>
<template v-else-if="column.prop=='welfareUnitName'" scope="{row}">
<span v-if="!row.editWelfareUnit">{{row.welfareUnitName}}</span>
<div v-else>
<el-select v-model="row.modifiedWelfareUnitId" style="width: 160px"
clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</el-option>
</el-select>
</div>
</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-dialog
title="福利名单导入"
:visible.sync="importVisible"
:close-on-click-modal="false"
width="50%"
>
<el-timeline>
<el-timeline-item timestamp="下载模板" placement="top">
<el-card>
<el-button size="medium" type=""
@click="location.href='/platform/basics/downloadTemplate?filePath=welfare/WelfareMemberImportTemplate.xls&fileName=模板.xls'"
icon="el-icon-download">下载模板
</el-button>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="上传文件" placement="top">
<el-card>
<el-form>
<!-- <el-form-item label="年&emsp;&emsp;度">
<el-date-picker
:clearable="false"
v-model="importData.year"
type="year"
size="medium"
style="width: 200px"
value-format="yyyy"
placeholder="年度">
</el-date-picker>
</el-form-item>-->
<el-form-item label="是否覆盖现有的福利会员">
<el-radio-group v-model="importData.isfg">
<el-radio-button label="true"></el-radio-button>
<el-radio-button label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-upload
name="file"
ref="upload"
:on-remove="(file, fileList) => {
importData.fileList = fileHandleRemove(file, fileList)
}"
:on-change="(file, fileList) => {
importData.fileList = fileHandleChange(file, fileList,{type:['xls','xlsx']})
}"
:auto-upload="false"
:limit="1"
:file-list="importData.fileList">
<el-button size="medium" type="" icon="el-icon-upload"
style="width: 200px">选择文件
</el-button>
<div class="el-upload__tip" slot="tip" style="color: #F56C6C">
只能上传 xls/xlsx 文件
</div>
</el-upload>
</el-form>
</el-card>
</el-timeline-item>
</el-timeline>
<span slot="footer" class="dialog-footer">
<el-button @click="importVisible = false" :disabled="importLoading">取 消</el-button>
<el-button type="primary" @click="doImport" :loading="importLoading">确定</el-button>
</span>
</el-dialog>
<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="['(u.welfareMember is null or u.welfareMember = 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="doBatchJoinMember"
: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 {
selectUserLoading: false,
selectUserVisible: false,
selectUsers: [],
checkUsers: [],
batchEditVisible: false,
batchEditLoading: false,
batchFormData: {},
importVisible: false,
importData: {
fileList: [],
year: 0,
isfg: true
},
importLoading: false,
campusOptions: [],
pageForm: {
searchName: 'username',
},
tableColumns: [{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true}
],
welfareUnits: [],
welfareImportUnitList: [],
units: [],
threeUnits: [],
unionGroups: [],
userId: '',
unitId: '',
judgmentAuthority,
welfare,
welfareUnitMode,
sexOptions
}
},
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 doBatchJoinMember() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要设置为福利会员的用户")
return
}
this.selectUserLoading = true
const resp = await $.post(welfareCommonUrl + "/joinWelfareMember", {userIds: JSON.stringify(this.selectUsers)});
this.selectUserLoading = false
if(resp.code===0){
this.pageData()
this.$refs.userSelect.init()
this.selectUserVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
doExportList() {
window.open(loc() + "/exportList?" + $.param(this.pageForm))
},
pushDropdownCommand({type}) {
if (type == 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type == 'add') {
this.openEdit('')
}
},
kickWelfareMembers() {
this.$confirm('确定要移除福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {
const resp = await $.post(welfareCommonUrl + "/kickWelfareMember", {
userIds: JSON.stringify(this.checkUsers.map(v => v.id))
});
if(resp.code===0){
this.$refs.table.clearSelection();
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
})
},
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)});
this.batchEditLoading = false
if(resp.code===0){
this.pageData()
this.$refs.table.clearSelection();
this.batchEditVisible = false
}else{
this.notifyWarning(resp.msg)
}
},
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,
}])
});
this.$set(row, "editCampusLoading", false)
if(resp.code===0){
this.$set(row, "editCampus", false)
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
},
doImport() {
if (this.importData.fileList.length === 0) {
this.notifyWarning("请选择文件!")
return
}
const data = new FormData();
data.append("isfg", this.importData.isfg)
this.importData.fileList.forEach((val) => {
data.append("file", val.raw, val.raw.name);
});
this.importLoading = true
$.ajax({
url: loc() + "/importMember",
type: "post",
data: data,
processData: false,
contentType: false,
success: (data) => {
this.importLoading = false
if(data.code===0){
this.pageData();
this.importVisible = false
}else{
this.notifyWarning(data.msg)
}
},
error: (data) => {
this.notifyWarning("导入失败")
this.importLoading = false
}
});
},
openImport() {
this.importData = {
fileList: [],
year: moment().format('YYYY'),
isfg: true
}
this.importVisible = true;
},
doDelete(userId) {
this.$confirm('确定要移除福利会员吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(welfareCommonUrl + "/kickWelfareMember", {userIds: JSON.stringify([userId])});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
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 joinWelfareMember(memData) {
await $.post(welfareCommonUrl + "/joinWelfareMember", {userIds: JSON.stringify([memData.id])})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinWelfareMember(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
openEdit(userId) {
this.userId = userId
this.$refs.guava.edit()
if (!userId) {
this.$refs.member.getUserInfo()
}
},
openView(userId) {
this.active = 'info'
this.userId = userId
this.$refs.guava.view()
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unit', '')
this.units = await getComponentUnit(this.pageForm.welfareUnit)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.welfareUnit)
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", null)
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unit, this.pageForm.unionGroupId)
}
},
async created() {
this.welfareImportUnitList = await getDictOptions("welfareImportUnit")
this.unitId = "${@shiro.getPrincipalProperty('unit').getId()}"
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
this.campusOptions = await getCampus()
this.changeWelfareUnit()
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,331 @@
<style>
.el-tabs__content {
padding-top: 20px;
}
</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" placeholder="查询类型"
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">申请时间:</div>
<div class="search-item-option">
<el-date-picker
style="width: 100%"
v-model="pageForm.dateRange"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd" @change="pageForm.date=JSON.stringify(pageForm.dateRange)">
</el-date-picker>
</div>
</div>
<div class="search-item" v-if="source==2">
<div class="search-item-label">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" style="width: 100%" filterable clearable
placeholder="请选择">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</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">
<dict-select v-model="pageForm.type" style="width: 100%" clearable placeholder="变更类型"
code="MemberChangeType"></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-radio-group v-model="pageForm.audit" @change="doSearch" size="small"
style="margin-bottom: -7.5px">
<el-radio-button :label="false">全部</el-radio-button>
<el-radio-button :label="true">待我审核</el-radio-button>
</el-radio-group>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" :size="tableSize" 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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop=='type'" scope="{row:{type}}">
{{changeType[type]}}
</template>
<template v-else-if="column.prop=='applyOrigin'" scope="{row:{applyOrigin}}">
{{changeOrigin[applyOrigin]}}
</template>
<template v-else-if="column.prop=='stateId'" scope="{row}">
<vi-table-state :state="row"></vi-table-state>
</template>
<template v-else-if="column.prop=='unionname'" scope="{row}">
( {{row.unioncode}}){{row.unionname}}
</template>
<template v-else-if="column.prop=='unitname'" scope="{row}">
( {{row.unitcode}}){{row.unitname}}
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作"
width="100px">
<template scope="{row}">
<el-button size="small" :loading="row.loading" v-if="row.audit" type="primary"
@click="openAudit(row,true)">审核
</el-button>
<el-button size="small" :loading="row.loading" v-else @click="openAudit(row,false)">查看
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-tabs v-model="active">
<el-tab-pane label="个人信息" name="info">
<member ref="memberInfo" :id="info.userId" view></member>
</el-tab-pane>
<el-tab-pane label="变更记录" name="changInfo">
<mem-change-records :userid="info.userId" :audit_info_union="false"></mem-change-records>
</el-tab-pane>
<el-tab-pane label="校工会审核" name="school"
v-if="info.unionAudit">
<el-form class="demo-table-expand" :model="formData" ref="form" :rules="formRules"
label-width="120px" label-suffix="">
<vi-title title="审核信息"></vi-title>
<template v-if="!info.schoolAudit&&source==2">
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="opinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4" maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<div style="float: right;margin: 20px 0">
<el-button @click="doAudit(false)" :loading="submitLoading">
</el-button>
<el-button type="primary" @click="doAudit(true)"
:loading="submitLoading">
</el-button>
</div>
</template>
<template v-else>
<el-row :gutter="20" v-if="info&&info.schoolAudit">
<el-col :span="12">
<el-form-item label="审核人员">
<span>{{ info.schoolAudit.username }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
<span>{{ info.schoolAudit.auditTime }}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见">
<span>{{ info.schoolAudit.auditOpinion }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row v-else type="flex" justify="center">
<el-form-item label="暂无审核信息">
</el-form-item>
</el-row>
</template>
</el-form>
</el-tab-pane>
</el-tabs>
</template>
<template #view>
</template>
</guava>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
active: 'info',
submitLoading: false,
formRules: {},
info: {},
formData: {},
pageForm: {
source,
searchName: "u.username",
audit: false
},
welfareUnits: [],
changeOrigin: {},
changeType: {},
tableColumns: [
{prop: 'loginname', label: '工号'},
{prop: 'username', label: '姓名'},
{prop: 'mobile', label: '联系电话'},
{prop: 'unitname', label: '所在单位', sortable: true},
{prop: 'realWelfareUnitName', label: welfare.welfareUnitModeName, sortable: true},
{prop: 'type', label: '变更类型', sortable: true},
{prop: 'applyDate', label: '申请时间', sortable: true},
// {prop: 'applyOrigin', label: '申请方式', sortable: true},
{prop: 'stateId', label: '状态', sortable: true},
],
welfare,
welfareUnitMode,
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
},
methods: {
async doAudit(pass) {
this.formData.auditPass = pass
this.submitLoading = true
const resp = await $.post(loc() + "/doAudit", this.formData)
this.submitLoading = false
if(resp.code===0){
//更新用户信息
this.info.userId = ""
this.pageData()
this.$refs.guava.index()
}else{
this.notifyWarning(resp.msg)
}
},
async openAudit(row, audit) {
this.$set(row, "loading", true)
const resp = await $.get("/platform/member/common/findChangeApplyInfo", {id: row.id})
this.$set(row, "loading", false)
if(resp.code===0){
const data = resp.data
data.audit = audit
this.info = data
if (audit) {
if (this.pageForm.source == 1) {
this.active = 'union'
} else if (this.pageForm.source == 2) {
this.active = 'school'
}
} else {
this.active = 'info'
}
this.$refs.guava.edit()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
this.formData = {
recordId: row.id,
username: "${@shiro.getPrincipalProperty('username')}",
auditTime: moment().format('YYYY-MM-DD'),
}
}else{
this.notifyWarning(resp.msg)
}
},
},
async created() {
this.pageData();
if (source == 2) {
this.welfareUnits = await getWelfareUnit()
}
this.changeType = await member.getChangeType()
this.changeOrigin = await member.getChangeOrigin()
}
})
</script>
@@ -0,0 +1,12 @@
<!--#
layout("/layouts/platform.html"){
#-->
<script>
window.source = 2
</script>
<!--#include("/platform/welfare/member/change/audit/Layout.html"){}#-->
<!--#
}
#-->
@@ -0,0 +1,253 @@
<!--#
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-date-picker
style="width: 100%"
@change="doSearch"
v-model="pageForm.year"
type="year"
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-select v-model="pageForm.taskId" style="width: 100%" @change="doSearch">
<el-option v-for="item in memberCheckTaskOptions"
:label="item.taskName"
: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-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
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-input @keyup.enter.native="doSearch" clearable clearable
placeholder="请输入联系电话"
style="width: 100%"
v-model="pageForm.mobile">
</el-input>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId"
style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
: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="true"
filterable="true">
<el-option v-for="item in units" :label="item.name"
:value="item.id"></el-option>
</el-select>
</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-radio-group @change="doSearch" size="medium" v-model="pageForm.showFinish">
<el-radio-button :label="0">全部{{finishNum.allFinish}}</el-radio-button>
<el-radio-button :label="1">已核对{{finishNum.doFinish}}</el-radio-button>
<el-radio-button :label="-1">未核对{{finishNum.noFinish}}</el-radio-button>
</el-radio-group>
<el-button size="small" type="primary" style="margin-left: 10px"
@click.prevent="doExport" :disabled="!pageForm.taskId">导出核对信息
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" :size="tableSize" 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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop=='isFinish'">
<el-tag v-if="row.isFinish">已核对</el-tag>
<el-tag type="danger" v-else>未核对</el-tag>
</template>
</el-table-column>
<!-- <el-table-column header-align="center" label="操作" width="200px">-->
<!-- <template scope="{row}">-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
exportVisible: false,
exportValue: 0,
unions: [],
units: [],
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'mobile', label: '联系电话', sortable: true},
{prop: 'sex', label: '性别', sortable: true},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'personType', label: '人员类型', sortable: true},
// {prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所在单位', sortable: true},
{prop: 'isFinish', label: '是否核对', sortable: true},
],
pageForm: {
year: new Date().getFullYear() + '',
searchName: 'username',
showFinish: 0,
},
memberCheckTaskOptions: [],
finishNum: {
allFinish: 0,
doFinish: 0,
noFinish: 0,
}
}
},
methods: {
doSearch() {
this.pageForm.pageNumber = 1
this.pageData();
this.getFinishNum();
},
async getMemberCheckTaskOptions() {
const resp = await $.get('/platform/welfareMember/check/task/getTaskModePersonal')
this.memberCheckTaskOptions = resp.data
if (this.memberCheckTaskOptions.length) {
this.$set(this.pageForm, 'taskId', this.memberCheckTaskOptions[0].id)
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async getFinishNum() {
const resp = await $.post(loc() + '/getFinishNum', this.pageForm)
if (resp.code === 0) {
this.finishNum = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async doExport() {
// let _this = this.pageForm
let task = this.memberCheckTaskOptions.filter(v => v.taskId = this.pageForm.taskId)
if (this.pageForm.unionId === undefined) {
this.pageForm.unionId = '';
}
if (this.pageForm.mobile === undefined) {
this.pageForm.mobile = '';
}
window.location.href =
loc() + '/exportExcel?unionId=' + this.pageForm.unionId +
'&unitId=' + this.pageForm.unitId +
'&showFinish=' + this.pageForm.showFinish +
'&year=' + this.pageForm.year +
'&taskName=' + task[0].taskName +
'&taskId=' + this.pageForm.taskId +
'&mobile=' + this.pageForm.mobile +
'&searchKeyword=' + this.pageForm.searchKeyword;
},
},
async created() {
await this.getMemberCheckTaskOptions()
if (this.pageForm.taskId != null) {
await this.pageData();
await this.getFinishNum();
}
this.unions = await getUnions(null);
this.flushUnits()
},
computed: {
allowOperationTask() {
const {taskId} = this.pageForm
if (taskId) {
const task = this.memberCheckTaskOptions.find(v => v.id === taskId)
const startTime = moment(task.startTime).valueOf()
const endTime = moment(task.endTime).valueOf()
const nowDate = Date.now()
return nowDate > startTime && nowDate < endTime
} else {
return false
}
}
},
});
</script>
<!--#
}
#-->
@@ -0,0 +1,655 @@
<!--#
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-date-picker
style="width: 100%"
v-model="pageForm.year"
type="year"
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-select v-model="pageForm.taskId" style="width: 100%">
<el-option v-for="item in memberCheckTaskOptions"
:label="item.taskName"
:value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select placeholder="所属工会" v-model="pageForm.unionId"
style="width: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
filterable="true">
<el-option v-for="item in unions" :label="item.unionname"
: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="true"
filterable="true">
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</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 @click="exportChangeUser" size="small" type="primary">导出</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
show-summary
:summary-method="getSummaries"
@expand-change="tableColumnExpandChange"
v-loading="tableLoading" :size="tableSize" class="vi-table">
<el-table-column type="expand">
<template slot-scope="{row}">
<el-table :data="row.checkUsers" style="width: 100%">
<el-table-column label="姓名" prop="userName"
header-align="center"></el-table-column>
<el-table-column label="工号" prop="loginName"
header-align="center"></el-table-column>
<el-table-column label="所属单位" prop="unitname"
header-align="center">
<template scope="{row}">
{{row.unitname}}<span v-if="row.newUnitName">→{{row.newUnitName}}</span>
</template>
</el-table-column>
<el-table-column label="所在科室" prop="threeUnitName"
header-align="center">
<template scope="{row}">
{{row.threeUnitName}}<span
v-if="row.newThreeUnitName">→{{row.newThreeUnitName}}</span>
</template>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="145px"
header-align="center"
sortable
align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="异动类型" prop="changeType"
header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="变更类型" header-align="center" prop="changeType">
<template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
</template>
</el-table-column>
<el-table-column label="会员" header-align="center" align="center"
prop="member"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.member==1" class="text-success ">
<i class="fa fa-circle ml5"></i>
</span>
<span v-else class="text-danger">
<i class="fa fa-circle ml5"></i>
</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" header-align="center">
<template scope="{row:expandRow}">
<el-button size="mini" type="primary"
@click="openAudit(expandRow,true,row)">
审核
</el-button>
</template>
</el-table-column>
</el-table>
</template>
</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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop=='isFinish'" scope="{row}">
<span :class="row.isFinish?'text-success':'text-danger'">
{{row.isFinishText}}
</span>
</template>
<template v-else-if="column.prop=='unionGroup'" scope="{row}">
<el-link type="primary" @click="openGroupUnionDrawer(row)">
{{row.unionGroupNum}}
{{row.shiUnionGroupNum}}
</el-link>
</template>
</el-table-column>
<!--<el-table-column header-align="center" label="操作" width="200px">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openCheck(row)"
:disabled="!(row.apply||row.reApply)">
核对
</el-button>
</template>
</el-table-column>-->
</el-table>
</el-card>
<template #edit>
<el-tabs v-model="active">
<el-tab-pane label="个人信息" name="info">
<member ref="memberInfo" :id="info.userId" view></member>
</el-tab-pane>
<el-tab-pane label="变更记录" name="changInfo">
<mem-change-records :userid="info.userId"></mem-change-records>
</el-tab-pane>
<el-tab-pane label="工会小组审核" name="union">
<el-form :model="formData" ref="form" :rules="formRules"
label-width="120px" label-suffix="">
<vi-title title="审核信息"></vi-title>
<template v-if="!info.unionAudit&&source==1">
<template v-if="info.type==1">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="原单位">
<el-input :value="info.originUnit.name"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原工会">
<el-input :value="info.originUnion.unionname"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="新单位">
<el-input :value="info.currentUnit.name"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="新工会">
<el-input :value="info.currentUnion.unionname"
disabled></el-input>
</el-form-item>
</el-col>
</el-row>
</template>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="opinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<div style="float: right;margin: 20px 0">
<el-button @click="doAudit(false)" :loading="submitLoading">
</el-button>
<el-button type="primary" @click="doAudit(true)"
:loading="submitLoading">
</el-button>
</div>
</template>
<template v-else>
<el-row :gutter="20" v-if="info&&info.unionAudit">
<el-col :span="12">
<el-form-item label="审核人员">
<span>{{ info.unionAudit.username }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
<span>{{ info.unionAudit.auditTime }}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见">
<span>{{ info.unionAudit.auditOpinion }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row v-else type="flex" justify="center">
<el-form-item label="暂无审核信息">
</el-form-item>
</el-row>
</template>
</el-form>
</el-tab-pane>
<el-tab-pane label="校工会审核" name="school"
v-if="info.unionAudit">
<el-form class="demo-table-expand" :model="formData" ref="form"
:rules="formRules"
label-width="120px" label-suffix="">
<vi-title title="审核信息"></vi-title>
<template v-if="!info.schoolAudit&&source==2">
<template v-if="info.type==1||info.currentUnitId">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="原单位">
<el-input :value="info.originUnit.name"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="原工会">
<el-input :value="info.originUnion.unionname"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="新单位">
<!-- <el-input :value="info.currentUnit.name"></el-input>-->
<el-select v-model="info.currentUnitId"
style="width: 100%" filterable
clearable
@change="unitChange"
placeholder="请选择单位">
<el-option
v-for="item in unitOptions"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="新工会">
<el-input v-model="info.currentUnionName"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="新科室">
<el-select v-model="info.currentThreeUnitId"
style="width: 100%" filterable
clearable
placeholder="请选择单位">
<el-option
v-for="item in threeUnits"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</template>
<el-row gutter="20">
<el-col :span="12">
<el-form-item prop="username" label="审核人员">
<el-input v-model="formData.username"
disabled></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="auditTime" label="审核时间">
<el-input v-model="formData.auditTime" disabled></el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="opinion" label="审核意见">
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
maxlength="500"
placeholder="请填写您的审核意见"></el-input>
</el-form-item>
<div style="float: right;margin: 20px 0">
<el-button @click="doAudit(false)" :loading="submitLoading">
</el-button>
<el-button type="primary" @click="doAudit(true)"
:loading="submitLoading">
</el-button>
</div>
</template>
<template v-else>
<el-row :gutter="20" v-if="info&&info.schoolAudit">
<el-col :span="12">
<el-form-item label="审核人员">
<span>{{ info.schoolAudit.username }}</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
<span>{{ info.schoolAudit.auditTime }}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见">
<span>{{ info.schoolAudit.auditOpinion }}</span>
</el-form-item>
</el-col>
</el-row>
<el-row v-else type="flex" justify="center">
<el-form-item label="暂无审核信息">
</el-form-item>
</el-row>
</template>
</el-form>
</el-tab-pane>
</el-tabs>
</template>
</guava>
<el-drawer
title="小组核对情况"
:visible.sync="groupUnionDrawer"
direction="rtl" :size="'50%'">
<el-table :data="unionGroupData">
<el-table-column prop="groupCode" label="小组编号"></el-table-column>
<el-table-column prop="groupName" label="小组名称"></el-table-column>
<el-table-column prop="username" label="联系人">
<template scope="{row}">
<sapn v-if="row.username">
{{row.username}}({{row.loginname}})
</sapn>
</template>
</el-table-column>
<el-table-column prop="mobile" label="联系方式"></el-table-column>
<el-table-column prop="isFinish" label="是否核对">
<template scope="{row}">
<el-tag type="danger" v-if="!row.isFinish">未核对</el-tag>
<el-tag v-else type="success">已核对</el-tag>
</template>
</el-table-column>
</el-table>
</el-drawer>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
'mem-change-records': httpVueLoader('/components/member/MemChangeRecords.vue?v=1.0.2'),
},
data() {
return {
unionGroupData: [],
groupUnionDrawer: false,
unions: [],
units: [],
tableColumns: [
{prop: 'unionname', label: '分工会名称', sortable: true},
{prop: 'unioncode', label: '分工会编码', sortable: true},
{prop: 'memberNum', label: '会员人数', sortable: true},
{prop: 'unionGroup', label: '小组核对情况', sortable: true},
// {prop: 'isFinish', label: '是否核对完成', sortable: true},
{prop: 'notCheckNum', label: '待核对人数', sortable: true},
],
pageForm: {
year: new Date().getFullYear() + ''
},
memberCheckTaskOptions: [],
changeType: {},
userId: null,
active: 'school',
info: {},
source: 2,
formData: {},
unitOptions: [],
}
},
methods: {
exportChangeUser() {
const {taskId} = this.pageForm
if (!taskId) {
this.notifyWarning('请先选择核对任务')
return
}
window.open(loc() + '/exportChangeUser?taskId=' + taskId)
},
async openGroupUnionDrawer(row) {
const {data} = await $.post(loc() + "/unionGroupData", {
unionId: row.id,
taskId: this.pageForm.taskId
})
this.unionGroupData = data
this.groupUnionDrawer = true
},
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '总计';
return;
} else if (index === 5) {
sums[index] = '';
return;
} else if (index === 3) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' ';
} else {
sums[index] = '';
}
});
return sums;
},
openCheck(row) {
this.userId = row.id
this.$refs.guava.edit()
},
async getMemberCheckTaskOptions() {
const resp = await $.get('/platform/welfareMember/check/task/getAllTask', {year: this.pageForm.year})
this.memberCheckTaskOptions = resp.data
if (this.memberCheckTaskOptions.length) {
this.$set(this.pageForm, 'taskId', this.memberCheckTaskOptions[0].id)
}
},
async flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
async getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
async pageData() {
sublime.showLoadingbar()
const resp = await $.post(loc() + '/pageData', this.pageForm)
sublime.closeLoadingbar()
if (resp.code === 0) {
this.tableData = resp.data
} else {
this.notifyWarning(resp.msg)
}
},
async tableColumnExpandChange(row, expandedRows) {
if (expandedRows.length) {
const {taskId} = this.pageForm
const {id: unionId} = row
const resp = await $.post(loc() + '/getNotCheckUsers', {taskId, unionId})
if (resp.code === 0) {
this.$set(row, 'checkUsers', resp.data)
}
}
},
async openAudit(expandRow, audit, row) {
const resp = await $.get("/platform/member/common/findChangeApplyInfo", {id: expandRow.id})
if (resp.code === 0) {
const data = resp.data
data.audit = audit
data.currentUnionName = data.currentUnion ? data.currentUnion.unionname : null
this.info = data
if (audit) {
this.active = 'school'
} else {
this.active = 'info'
}
await this.unitChange(data.currentUnitId)
this.$refs.guava.edit()
if (this.$refs['form']) {
this.$refs['form'].resetFields()
}
this.formData = {
recordId: expandRow.id,
username: "${@shiro.getPrincipalProperty('username')}",
auditTime: moment().format('YYYY-MM-DD'),
}
} else {
this.notifyWarning(resp.msg)
}
},
async doAudit(pass) {
this.formData.currentUnitId = this.info.currentUnitId
this.formData.currentUnionId = this.info.currentUnionId
this.formData.currentThreeUnitId = this.info.currentThreeUnitId
this.formData.auditPass = pass
this.submitLoading = true
const resp = await $.post("/platform/member/change/audit/doAudit", this.formData)
this.submitLoading = false
if (resp.code === 0) {
//更新用户信息
this.info.userId = null
this.pageData()
this.$refs.guava.index()
} else {
this.notifyWarning(resp.msg)
}
},
async unitChange(v) {
const unit = this.unitOptions.find(x => x.id === v)
if (unit) {
this.info.currentUnionId = unit.unionid
this.info.currentUnionName = unit.unionname
} else {
this.info.currentUnionId = ''
this.info.currentUnionName = ''
}
if (!v) {
this.info.currentThreeUnitId = ''
}
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.info.currentUnitId, null)
},
},
async created() {
await this.getMemberCheckTaskOptions()
if (this.pageForm.taskId != null) {
this.pageData()
}
this.unions = await getUnions(null)
this.unitOptions = await getUnits(null)
this.flushUnits()
this.changeType = await this.getChangeType()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,194 @@
<!--#
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
style="width: 100%"
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</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 icon="el-icon-plus" size="small" @click="openAdd" type="primary">
新增任务
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
v-loading="tableLoading" :size="tableSize" 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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
<el-table-column header-align="center" label="操作" width="200px">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
<el-button size="mini" type="danger" @click="doDelete(row.id)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" :close-on-click-modal="false"
width="40%">
<el-form :model="formData" ref="form" label-width="80px" :rules="rules">
<el-form-item prop="taskName" label="任务名称">
<el-input v-model="formData.taskName" maxlength="20"></el-input>
</el-form-item>
<el-form-item prop="startTime" label="开始时间">
<el-date-picker
v-model="formData.startTime"
type="datetime"
value-format="yyyy-MM-dd"
placeholder="选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item prop="endTime" label="结束时间">
<el-date-picker
v-model="formData.endTime"
type="datetime"
value-format="yyyy-MM-dd"
placeholder="选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item prop="createTaskMode" label="核对模式">
<el-radio-group v-model="formData.createTaskMode">
<el-radio-button :label="1">工会小组核对</el-radio-button>
<el-radio-button :label="2">个人核对</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item prop="description" label="任务说明">
<el-input v-model="formData.description"
type="textarea"
maxlength="50"></el-input>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="dialogVisible=false">取消</el-button>
<el-button type="primary" @click="doSubmit">确定</el-button>
</el-row>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
computed: {
dialogTitle() {
return this.formData.id ? '编辑任务' : '新增任务'
}
},
data() {
return {
tableColumns: [
{prop: 'taskName', label: '任务名称', sortable: true},
{prop: 'year', label: '年度', sortable: true},
{prop: 'startTime', label: '开始时间', sortable: true},
{prop: 'endTime', label: '结束时间', sortable: true},
],
dialogVisible: false,
rules: {
taskName: [{required: true, message: '请输入', trigger: ['change', 'blur']}],
startTime: [{required: true, message: '请选择', trigger: ['change', 'blur']}],
endTime: [{required: true, message: '请选择', trigger: ['change', 'blur']}],
description: [{required: true, message: '请输入', trigger: ['change', 'blur']}],
createTaskMode: [{required: true, message: '请选择', trigger: ['change', 'blur']}]
},
formData: {
startTime: null,
endTime: null,
description: null
},
pageForm: {
year: new Date().getFullYear() + ''
}
}
},
methods: {
openAdd() {
this.dialogVisible = true
this.$refs['form'].resetFields()
},
openEdit(row) {
this.dialogVisible = true
this.$nextTick(() => {
this.formData = {...row}
})
},
async doSubmit() {
const valid = await this.$refs['form'].validate()
if (!valid) return
const methodName = this.formData.id ? '/doEdit' : '/doAdd'
const resp = await $.post(loc() + methodName, this.formData)
if (resp.code === 0) {
this.pageData()
this.notifySuccess(resp.msg)
this.dialogVisible = false
} else {
this.notifyWarning(resp.msg)
}
},
async doDelete(id) {
const confirm = await this.$confirm('您确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const resp = await $.post(loc() + '/doDelete', {id})
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,779 @@
<!--#
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-date-picker
style="width: 100%"
v-model="pageForm.year"
type="year"
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-select v-model="pageForm.taskId" style="width: 100%">
<el-option v-for="item in memberCheckTaskOptions"
:label="item.taskName"
: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-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 100%"
@keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend"
placeholder="查询类型"
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" v-if="judgmentAuthority">
<div class="search-item-label">{{welfare.welfareUnitModeName}}</div>
<div class="search-item-option">
<el-select v-model="pageForm.welfareUnit" 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" v-if="judgmentAuthority">
<div class="search-item-label">组成单位:</div>
<div class="search-item-option">
<el-select v-model="pageForm.unit" style="width: 100%" filterable clearable
placeholder="请选择" @change="getThreeUnits">
<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>
<div class="search-query">
<el-button type="primary" icon="el-icon-search"
@click="doSearch();getChangeData();getUnionTaskStatus()">搜索
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="人员列表" :app="this">
<template #func>
<!-- <span class="text-danger">更新时间段内人员信息有无变化:</span>-->
<el-select v-model="pageForm.welfareMember" @change="doSearch();getChangeData()"
:clearable="false" size="small"
style="width: 200px;margin-right: 5px">
<el-option label="全部教职工范围内" :value="0"></el-option>
<el-option label="可发放福利老师" :value="1"></el-option>
<el-option label="不发放福利老师" :value="2"></el-option>
</el-select>
<el-radio-group v-model="pageForm.changed" @change="doSearch();getChangeData()"
class="mr5"
size="small">
<el-radio-button :label="0">全部({{numberData.all}}</el-radio-button>
<el-radio-button :label="1">有变化({{numberData.have}}</el-radio-button>
<el-radio-button :label="2">无变化({{numberData.no}}</el-radio-button>
</el-radio-group>
<enum-select v-if="pageForm.changed=='1'" v-model="pageForm.changeType"
size="small" value="code"
label="description"
style="width:200px"
clearable placeholder="异动类型" enum="UserChangeType"
@change="doSearch();getChangeData()"></enum-select>
<!-- <span v-if="!allowOperationTask" class="text-danger mr10">
该任务不在核对时间内,无法操作
</span>-->
<el-button icon="el-icon-success" size="small" type="primary" class="ml5"
@click="submitCheck"
v-loading="tableLoading"
:disabled="unionTaskStatus || !allowOperationTask">
全部核对完成,提交核对
</el-button>
<el-button v-if="unionTaskStatus" type="primary" size="small"
:disabled="!pageForm.unionGroupId"
@click="checkAgain">
重新核对
</el-button>
<el-dropdown style="margin: 0 5px" @command="pushDropdownCommand"
>
<el-button type="primary" size="small" icon="el-icon-plus"
:disabled="unionTaskStatus || !allowOperationTask">
添加
</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 type="primary" size="small" icon="el-icon-s-promotion"
@click="doWelfareMemberExport">
导出福利会员
</el-button>
<el-button :disabled="!checkUsers.length||!pageForm.taskId" type="primary" size="small"
icon="el-icon-edit"
@click="openUnitMove" class="ml5">
单位调整
</el-button>
</template>
</table-tool>
<el-table :data="tableData" style="width: 100%" row-key="id" @sort-change="pageOrder"
ref="table"
@selection-change="(val)=>checkUsers=val"
v-loading="tableLoading" :size="tableSize" class="vi-table">
<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
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
<el-table-column label="异动信息" header-align="center">
<el-table-column label="更新时间" prop="changeTime" min-width="100px"
header-align="center" sortable
align="center" show-overflow-tooltip>
</el-table-column>
<el-table-column label="异动类型" prop="changeType" header-align="center"
align="center" show-overflow-tooltip sortable>
<template scope="{row}">
<span style="color: #0e78c5">{{changeType[row.changeType]}}</span>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="福利会员" header-align="center" align="center"
prop="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<div v-if="row.flag">
<span v-if="row.welfareMember==1" class="text-success ">
<i
class="fa fa-circle ml5"></i>
</span>
<span v-else class="text-danger">
<i class="fa fa-circle ml5"></i>
</span>
</div>
</template>
</el-table-column>
<el-table-column label="变更状态" header-align="center" align="center"
prop="welfareMember"
show-overflow-tooltip sortable>
<template scope="{row}">
<span v-if="row.stateId">
<vi-table-state :state="row"></vi-table-state>
</span>
<span v-else-if="row.mcrStateId"
:style="'color:'+row.mcrStateColor">{{ row.mcrStateName }}</span>
</template>
</el-table-column>
<el-table-column header-align="center" label="操作" width="100px">
<template scope="{row}">
<el-button size="mini" type="primary" @click="openCheck(row)"
:disabled="row.changeUnitAuditing || unionTaskStatus||!allowOperationTask">
核对
</el-button>
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
: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>
<template #view>
<mem-change-apply ref="apply" :userid="userId" @submit="doSubmitChangeUser"
:welfare_member="true"
change_mode="check"></mem-change-apply>
</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>
</guava>
<el-drawer
title="添加福利会员"
:visible.sync="selectUserVisible"
:before-close="handleClose" size="1200px">
<user-select v-model="selectUsers" ref="userSelect" :page_size="10" :is_ghxzzz="is_ghxzzz"
:sql_cnd="['(u.welfareMember is null or u.welfareMember = 0) and c.taskId is null']"></user-select>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="selectUserVisible = false"
:disabled="selectUserLoading">取 消</el-button>
<el-button type="primary" @click="doBatchJoinMember"
:loading="selectUserLoading">确定</el-button>
</span>
</el-drawer>
<el-drawer
title="单位调整"
:visible.sync="unitMoveVisibile"
:before-close="handleClose" size="70%">
<el-row class="text-primary p20">
选择新单位
</el-row>
<el-row type="flex" :gutter="20" class="pl20 pr20">
<el-col :span="12">
<el-select placeholder="请选择新工会" v-model="unitMoveFormData.unionId"
style="width: 100%;"
clearable="true"
@change="moveUnionsChange"
filterable="true">
<el-option v-for="item in unitMoveUnions" :label="item.welfareUnitName"
:value="item.welfareUnitId"></el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.unitId" style="width: 100%" filterable
clearable
@change="moveUnitChange"
placeholder="请选择新单位">
<el-option
v-for="item in unitMoveUnits"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-select v-model="unitMoveFormData.threeUnitId" clearable filterable
placeholder="请选择新科室"
style="width: 100%" @change="threeUnitChange">
<el-option
v-for="item in threeUnits2"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<el-input :value="unitMoveFormData.unionGroupName" disabled
placeholder="新工会小组"></el-input>
</el-col>
</el-row>
<el-row class="mt10">
<el-table :data="checkUsers" style="width: 100%;padding: 20px" class="vi-table"
border
height="70vh">
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="loginname"
width="120"
label="工号"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="username"
width="120"
label="姓名"></el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
prop="threeUnitName"
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"
label="新科室">
<template slot-scope="{row}">
<span>{{unitMoveFormData.threeUnitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新单位">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unitName}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" header-align="center"
label="新分工会">
<template slot-scope="{row}">
<span>{{unitMoveFormData.unionName}}</span>
</template>
</el-table-column>
</el-table>
</el-row>
<span style="position: absolute;bottom: 20px;right: 20px">
<el-button @click="unitMoveVisibile = false">取 消</el-button>
<el-button type="primary" @click="doUnitMove">确定</el-button>
</span>
</el-drawer>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
components: {
'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=1.0.2'),
'enum-select': httpVueLoader('/components/plugins/EnumSelect.vue?v=1.0.0'),
'user-select': httpVueLoader('/components/plugins/UserTableSelect.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.4'),
},
computed: {
allowOperationTask() {
const {taskId} = this.pageForm
if (taskId) {
const task = this.memberCheckTaskOptions.find(v => v.id === taskId)
const startTime = moment(task.startTime).valueOf()
const endTime = moment(task.endTime).valueOf()
const nowDate = Date.now()
return nowDate > startTime && nowDate < endTime
} else {
return false
}
}
},
data() {
return {
is_ghxzzz: false,
selectUserLoading: false,
selectUserVisible: false,
selectUsers: [],
judgmentAuthority,
welfare,
welfareUnitMode,
unions: [],
welfareUnits: [],
units: [],
threeUnits: [],
unionGroups: [],
tableColumns: [
{prop: 'loginname', label: '工号', sortable: true},
{prop: 'username', label: '姓名', sortable: true},
{prop: 'sex', label: '性别', sortable: true, width: '100px'},
{prop: 'birthday', label: '出生年月', sortable: true},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unionname', label: '所属工会', sortable: true},
{prop: 'unitname', label: '所属单位', sortable: true},
{prop: 'threeUnitName', label: '所在科室', sortable: true},
{prop: 'unionGroupName', label: '工会小组', sortable: true},
],
pageForm: {
year: new Date().getFullYear() + '',
searchName: 'u.username',
welfareMember: 1,
changed: 0,
taskId: null,
welfareUnit: '',
unit: '',
unionGroupId: '',
threeUnitId: '',
},
memberCheckTaskOptions: [],
changeType: {},
userId: null,
unionTaskStatus: false,
numberData: {},
checkUsers: [],
unitMoveVisibile: false,
unitMoveFormData: {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
},
unitMoveUnions: [],
unitMoveUnits: [],
threeUnits2: []
}
},
methods: {
openUnitMove() {
this.unitMoveVisibile = true
this.unitMoveFormData = {
unitId: '',
unionId: '',
unitName: '',
unionName: ''
}
},
async threeUnitChange(val) {
if (val) {
const threeUnit = this.threeUnits2.find(v => v.id === val)
const groupName = threeUnit.groupname
this.$set(this.unitMoveFormData, 'threeUnitName', threeUnit.name)
this.$set(this.unitMoveFormData, 'unionGroupName', groupName)
} else {
this.$set(this.unitMoveFormData, 'unionGroupName', null)
}
},
async moveUnitChange(val) {
if (val) {
this.$set(this.unitMoveFormData, 'unitName', this.unitMoveUnits.find(v => v.id === val).name)
} else {
this.$set(this.unitMoveFormData, 'unitName', '')
}
if (val) {
this.threeUnits2 = await threeUnitsByUnionGroupOrUnitId(val, null)
}
},
async moveUnionsChange(val) {
if (val) {
this.unitMoveUnits = await getUnits(val)
this.$set(this.unitMoveFormData, 'unionName', this.unitMoveUnions.find(v => v.welfareUnitId === val).welfareUnitName)
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
} else {
this.$set(this.unitMoveFormData, 'unitId', '')
this.$set(this.unitMoveFormData, 'unitName', '')
this.$set(this.unitMoveFormData, 'unionName', '')
this.unitMoveUnits = []
}
},
async doUnitMove() {
if (this.unitMoveFormData.unitId === '') {
this.notifyWarning('请选择新单位!')
return
}
if (this.unitMoveFormData.threeUnitId === '') {
this.notifyWarning('请选择新科室!')
return
}
const params = {
unitId: this.unitMoveFormData.unitId,
threeUnitId: this.unitMoveFormData.threeUnitId,
userId: this.checkUsers.map(v => v.id)
}
const resp = await $.post('/platform/member/change/mange/userUnitMove', params)
if (resp.code === 0) {
this.pageData()
this.$refs.table.clearSelection();
this.unitMoveVisibile = false
} else {
this.notifyWarning(resp.msg)
}
},
doWelfareMemberExport() {
const {welfareUnit, unit, unionGroupId, threeUnitId} = this.pageForm
if (!unionGroupId) {
this.notifyWarning("请先选择工会小组后在导出")
return
}
window.open(loc() + "/doWelfareMemberExport?welfareUnit=" + welfareUnit
+ "&unit=" + unit
+ "&unionGroupId=" + unionGroupId
+ "&threeUnitId=" + threeUnitId)
},
openEdit(userId) {
this.userId = userId
this.$refs.guava.edit()
if (!userId) {
this.$refs.member.getUserInfo()
}
},
async joinWelfareMember(memData) {
await $.post(loc() + "/doWelfareMember", {
userIds: JSON.stringify([memData.id]),
taskId: this.pageForm.taskId
})
},
async afterEdit(memData) {
if (!this.userId) {
await this.joinWelfareMember(memData)
}
this.userId = ''
this.pageData()
this.$refs.guava.index()
},
async doBatchJoinMember() {
if (!this.selectUsers.length) {
this.notifyWarning("请先勾选需要设置为福利会员的用户")
return
}
let aa = false
const unitId = this.$refs.userSelect.pageForm.unitId
const threeUnitId = this.$refs.userSelect.pageForm.threeUnitId
if (threeUnitId) {
aa = true
}
this.$confirm('您确定将选择的用户加入会员' + (aa ? "并修改单位和科室?" : "?"))
.then(async _ => {
this.selectUserLoading = true
const resp = await $.post(loc() + "/doWelfareMember", {
userIds: JSON.stringify(this.selectUsers),
taskId: this.pageForm.taskId,
unitId: unitId,
threeUnitId: threeUnitId,
});
if (resp.code === 0) {
this.pageData()
this.$refs.userSelect.init()
this.selectUserVisible = false
} else {
this.notifyWarning(resp.msg)
}
})
.catch(_ => {
});
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {
});
},
pushDropdownCommand({type}) {
if (!this.pageForm.unionGroupId) {
this.notifyWarning("请选择需要核对的工会小组!")
return
}
if (type == 'select') {
this.selectUsers = []
this.selectUserVisible = true
this.$nextTick(() => {
this.$refs.userSelect.init()
})
} else if (type == 'add') {
this.openEdit('')
}
},
openCheck(row) {
this.userId = row.id
this.$refs.guava.view()
},
/**
* 提交异动人员
* @returns {Promise<void>}
*/
async doSubmitChangeUser(formData) {
console.log(formData)
formData.taskId = this.pageForm.taskId
const resp = await $.post(loc() + '/doSubmitChangeUser', formData)
this.$refs.apply.closeLoading()
if (resp.code === 0) {
this.userId = null
this.$refs.guava.index()
this.pageData()
} else {
this.notifyWarning(resp.msg)
}
},
/**
* 提交核对
*/
async submitCheck() {
if (!this.pageForm.unionGroupId) {
this.notifyWarning("请选择需要核对的工会小组!")
return
}
const confirm = await this.$confirm('此操作会提交至校工会确认,请确认核对完成了吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const {taskId} = this.pageForm
const resp = await $.post(loc() + '/submitCheck', this.pageForm)
if (resp.code === 0) {
this.doSearch()
this.notifySuccess(resp.msg)
this.getUnionTaskStatus()
} else {
this.notifyWarning(resp.msg)
}
},
async getMemberCheckTaskOptions() {
const resp = await $.get('/platform/welfareMember/check/task/getAllTask', {year: this.pageForm.year})
this.memberCheckTaskOptions = resp.data
if (this.memberCheckTaskOptions.length) {
this.$set(this.pageForm, 'taskId', this.memberCheckTaskOptions[0].id)
}
},
async getChangeData() {
const {data} = await $.post("/platform/welfare/member/adjustment/getChangeNumber", this.pageForm)
this.numberData = data
},
async getChangeType() {
const changeType = {}
const changeTypeOptions = await getEnumOptions("UserChangeType")
changeTypeOptions.forEach(v => {
changeType[v.code] = v.description
})
return changeType
},
async getUnionTaskStatus() {
const {taskId} = this.pageForm
const resp = await $.get(loc() + '/getUnionTaskStatus', this.pageForm)
if (resp.code === 0) {
this.unionTaskStatus = resp.data
}
},
async checkAgain() {
if (!this.pageForm.unionGroupId) {
this.notifyWarning("请选择需要重新核对的工会小组!")
return
}
const confirm = await this.$confirm('您确定要重新核对吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if ('confirm' !== confirm) return
const {taskId} = this.pageForm
const resp = await $.get(loc() + '/checkAgain', this.pageForm)
if (resp.code === 0) {
this.getUnionTaskStatus()
}
},
async changeWelfareUnit() {
this.$set(this.pageForm, 'unit', '')
this.units = await getComponentUnit(this.pageForm.welfareUnit)
this.unionGroups = await unionGroupsByUnionId(this.pageForm.welfareUnit)
if ("${@shiro.hasRole('ghxzzz')}" === 'true') {
this.is_ghxzzz = true
}
},
async getThreeUnits() {
this.$set(this.pageForm, "threeUnitId", '')
this.threeUnits = await threeUnitsByUnionGroupOrUnitId(this.pageForm.unit, this.pageForm.unionGroupId)
await this.getChangeData();
await this.getUnionTaskStatus()
}
},
async created() {
this.welfareUnits = await getWelfareUnit(!judgmentAuthority)
if (!judgmentAuthority) {
this.$set(this.pageForm, "welfareUnit", this.welfareUnits[0].welfareUnitId)
}
await this.getMemberCheckTaskOptions()
this.changeWelfareUnit()
this.unitMoveUnions = clone(this.welfareUnits)
setTimeout(() => {
this.getUnionTaskStatus()
this.getChangeData()
if (this.pageForm.taskId != null) {
this.pageData()
}
}, 300)
this.changeType = await this.getChangeType()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,224 @@
<!--#
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;
}
.search-item-option .el-date-editor, .search-item-option .el-select {
width: 100%;
}
</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="true"
@change="yearChange"
placeholder="选择年"
type="year"
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" clearable>
<el-option :key="item.value" :label="item.label" :value="item.value"
v-for="item in projectSelectOptions"></el-option>
</el-select>
<!-- <el-cascader style="width: 100%"-->
<!-- v-model="pageForm.projectOption"-->
<!-- :options="projectOptions" @change="projectOptionChange"></el-cascader>-->
</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>
</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=='provideTimeStart'" scope="{row}">
<i class="el-icon-time"></i>&ensp;{{row.provideTimeStart}} - {{row.provideTimeEnd}}
</template>
<template v-else-if="column.prop=='unionname'" scope="{row}">
( {{row.unioncode}}){{row.unionname}}
</template>
<template v-else-if="column.prop=='unitname'" scope="{row}">
( {{row.unitcode}}){{row.unitname}}
</template>
<template v-else-if="column.prop=='realWelfareUnitId'" scope="{row}">
<span v-if="!row.editWelfareUnit">{{row.realWelfareUnitName}}</span>
<div v-else>
<el-select v-model="row.modifiedWelfareUnitId" filterable style="width: 160px" clearable
size="small"
placeholder="请选择">
<el-option
v-for="item in welfareUnits"
:key="item.welfareUnitId"
:label="item.welfareUnitName"
:value="item.welfareUnitId">
</el-option>
</el-select>
</div>
</template>
</el-table-column>
<el-table-column prop="userOnline" align="center" header-align="center" label="操作" width="170px"
fixed="right">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<member ref="memberInfo" :id="userId" view></member>
</template>
</guava>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins, minixs],
data() {
return {
userId: '',
projectOptions: [],
units: [],
welfareUnits: [],
welfareProvideMode: [],
welfareSignMode: [],
welfareNoticePushMode: [],
pageForm: {
year: moment().format('YYYY'),
searchName: 'username'
},
tableColumns: [
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'personType', label: '人员类型', sortable: true},
{prop: 'userState', label: '在职状态', sortable: true},
{prop: 'unitName', label: '所属单位', sortable: true},
{prop: 'unionName', label: '所属工会', sortable: true},
{prop: 'projectName', label: '福利项目', sortable: true},
{prop: 'gist_list', label: '所选礼品', sortable: true},
{prop: 'receiveAddress', label: '邮寄地址', sortable: true},
{prop: 'courierNumber', label: '快递单号', sortable: true},
],
formRules: {},
welfare,
welfareUnitMode,
sexOptions,
selPersonType: [],
welfare_id: null,
welfarePersonTypeList: [],
projectSelectOptions: []
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'member': httpVueLoader('/components/member/MemberInfo.vue?v=1.0.3'),
'dict-select': httpVueLoader('/components/plugins/DictSelect.vue?v=1.0.0'),
},
methods: {
projectOptionChange(val) {
this.pageForm.projectId = val[1]
this.doSearch()
},
openView({userId}) {
this.userId = userId
this.$refs.guava.view()
},
},
async created() {
this.projectOptions = await getWelfareProjects()
this.pageData()
if (this.projectOptions.length && this.projectOptions[0].children.length) {
this.projectSelectOptions = this.projectOptions.find(v => v.label === new Date().getFullYear()).children
this.$set(this.pageForm, "projectOption", [this.projectOptions[0].value, this.projectOptions[0].children[0].value])
this.pageData()
}
this.units = await getComponentUnit()
this.welfareUnits = await getWelfareUnit()
this.welfarePersonTypeList = await getPersonTypeListGroupByWelfare()
this.welfarePersonTypeList.map(v => {
this.selPersonType.push(v.personType)
})
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,774 @@
<!--#
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;
}
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409EFF;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</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 v-if="judgmentAuthority" 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 type="expand">
<template scope="{row}">
<vi-title title="详细信息"></vi-title>
<el-form label-width="120px" label-suffix="">
<el-row gutter="20">
<el-col span="8">
<el-form-item label="项目名称">
{{ row.name }}
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="发放节日">
{{ row.festival }}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="发放地点">
{{ row.provideAddress }}
</el-form-item>
<!-- <el-form-item label="弹性福利" v-if="row.flexible">
<el-row v-for="item,i in row.flexibleGifts">
{{i+1}}. {{item.name}} <span v-if="item.isDefault"
class="text-primary">(默认)</span>
</el-row>
</el-form-item>-->
<el-row gutter="20">
<el-col span="8">
<el-form-item label="发放形式">
{{welfareProvideMode.find(v=>v.code==row.provideMode).description}}
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="签收形式">
{{welfareSignMode.find(v=>v.code==row.signMode).description}}
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="通知推送">
{{welfareNoticePushMode.find(v=>v.code==row.noticePushMode).description}}
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
</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=='provideTimeStart'" scope="{row}">
<i class="el-icon-time"></i>&ensp;{{row.provideTimeStart}} <span
v-if="row.provideTimeEnd">- {{row.provideTimeEnd}}</span>
</template>
<template v-if="column.prop=='gift'" scope="{row}">
<span v-if="row.flexible">福利套餐</span>
<span v-else>{{row.gift}}</span>
</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">
<template v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('flwyh01')}">
<el-dropdown-item :disabled="!row.created"
:command="{type:'export',data:row}">
导出签字表
</el-dropdown-item>
</template>
<!--:disabled="moment().valueOf()>=moment(row.provideTimeStart).valueOf()"-->
<el-dropdown-item
v-if="row.created"
:command="{type:'createList2',data:row}">
更新福利名单
</el-dropdown-item>
<el-dropdown-item
v-if="judgmentAuthority"
:command="{type:'createList',data:row}">
{{row.created?'重置福利名单':'生成福利名单'}}
</el-dropdown-item>
<el-dropdown-item v-if="judgmentAuthority"
:command="{type:'edit',data:row}">
编辑
</el-dropdown-item>
<el-dropdown-item v-if="judgmentAuthority"
: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-row>
<el-col span="12">
<el-form-item prop="festival" label="发放节日">
<el-select placeholder="发放节日"
style="width: 100%"
filterable
v-model="formData.festival">
<el-option v-for="f in festival" :key="f" :value="f"
:label="f"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col span="12">
<el-form-item prop="provideTime" label="发放时间">
<el-date-picker
style="width: 100%"
v-model="formData.provideTime"
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-col>
</el-row>
<el-form-item prop="provideAddress" label="发放地点">
<el-input v-model="formData.provideAddress" placeholder="发放地点"
suffix-icon="el-icon-location-information" maxlength="200"></el-input>
</el-form-item>
<el-row>
<el-col span="6">
<el-form-item label="是否福利套餐" prop="flexible">
<el-switch v-model="formData.flexible" @change="isCheckBoxChange">
</el-switch>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="是否常规" prop="isRoutine" v-if="formData.flexible">
<el-switch v-model="formData.isRoutine">
</el-switch>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="是否多选" prop="isCheckBox" v-if="formData.isRoutine">
<el-switch
v-model="formData.isCheckBox"
active-value="checkBox"
inactive-value="radio" @change="isCheckBoxChange">
</el-switch>
</el-form-item>
</el-col>
<el-col span="6">
<el-form-item label="最多选几个" prop="multiSelectNum"
v-if="formData.isCheckBox=='checkBox'">
<el-input-number v-model="formData.multiSelectNum" placeholder="最多选几个"
:min="2" :max="10"></el-input-number>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="福利礼品" prop="gift" v-if="!formData.flexible">
<el-input maxlength="100" placeholder="福利礼品" suffix-icon="el-icon-present"
v-model="formData.gift"></el-input>
</el-form-item>
<template v-if="formData.flexible">
<el-form-item label="福利选项" v-if="[2,3,4].includes(formData.provideMode)">
<question-naire :subject="formData.welfareProjectSubjects"
ref="questionNaire"
></question-naire>
</el-form-item>
</template>
<el-row>
<el-col span="12">
<el-form-item prop="provideMode" label="发放形式">
<el-radio-group v-model="formData.provideMode" size="small">
<el-radio v-for="item in welfareProvideMode" :key="item.code"
:label="item.code" border>
{{item.description}}
</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col span="12" v-if="formData.provideMode===2||formData.provideMode===3">
<el-form-item prop="choiceTime" label="选择时间">
<el-date-picker
style="width: 100%"
v-model="formData.choiceTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间" @change="choiceTimeChange">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-form-item prop="signMode" label="签收形式">
<el-radio-group v-model="formData.signMode" size="small">
<el-radio v-for="item in welfareSignMode" :key="item.code"
:label="item.code" border>
{{item.description}}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item prop="noticePushMode" label="通知推送">
<el-radio-group v-model="formData.noticePushMode" size="small">
<el-radio v-for="item in welfareNoticePushMode" :key="item.code"
:label="item.code" border>
{{item.description}}
</el-radio>
</el-radio-group>
</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-item label="封面图片" prop="cover">
<!-- <file-upload :files.sync=""></file-upload>-->
<el-upload
:action="FILE_UPLOAD_ADDRESS"
:before-upload="beforeAvatarUpload"
:on-success="handleAvatarSuccess"
:show-file-list="false"
class="avatar-uploader">
<img :src="'${AppFileDomain!}'+'/fileStreamPreview?id='+formData.cover"
class="avatar"
v-if="formData.cover">
<i class="el-icon-plus avatar-uploader-icon" v-else></i>
</el-upload>
</el-form-item>
</el-form>
<el-button @click="save" v-loading="submitLoading" type="primary" style="float: right">
提交
</el-button>
</template>
<template #view>
</template>
</guava>
<condition ref="cnd" v-model="formData.conditionStructure" :fields="fields"></condition>
<el-dialog title="导出" :visible.sync="exportWelfareListDialog" width="40%">
<el-row class="pt5 pb5 text-danger">勾选需要导出的人员类型</el-row>
<el-row class="pt10 pb10">
<el-checkbox-group v-model="selPersonType">
<el-checkbox v-for="i in welfarePersonTypeList" :label="i.personType"></el-checkbox>
</el-checkbox-group>
</el-row>
<el-row type="flex" justify="end">
<el-button @click="doExportWelFareList" type="primary">确定</el-button>
</el-row>
</el-dialog>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
judgmentAuthority,
fields: [
{
label: '性别',
value: 'sex',
type: "select",
options: [{label: '男', value: '男'}, {label: '女', value: '女'}]
},
{label: '出生日期', value: 'birthday', type: "date"},
],
welfareProvideMode: [],
welfareSignMode: [],
welfareNoticePushMode: [],
pageForm: {
year: moment().format('YYYY')
},
tableColumns: [
{prop: 'year', label: '年度'},
{prop: 'name', label: '项目名称'},
{prop: 'gift', label: '福利礼品'},
{prop: 'provideTimeStart', label: '发放时间'},
],
formRules: {
name: [{required: true, message: '必填', trigger: ['blur', 'change']}],
festival: [{required: true, message: '必选', trigger: ['blur', 'change']}],
provideTime: [{required: true, message: '必选', trigger: ['blur', 'change']}],
choiceTime: [{required: true, message: '必选', trigger: ['blur', 'change']}],
provideAddress: [{required: true, message: '必选', trigger: ['blur', 'change']}],
provideMode: [{required: true, message: '必选', trigger: ['blur', 'change']}],
signMode: [{required: true, message: '必选', trigger: ['blur', 'change']}],
noticePushMode: [{required: true, message: '必选', trigger: ['blur', 'change']}],
gift: [{required: true, message: '必填', trigger: ['blur', 'change']}],
multiSelectNum: [{required: true, message: '必填', trigger: ['blur', 'change']}],
// flexible: [{required: true, message: '必填', trigger: ['blur', 'change']}],
},
welfare,
welfareUnitMode,
exportWelfareListDialog: false,
selPersonType: [],
welfare_id: null,
welfarePersonTypeList: []
}
},
components: {
'guava': httpVueLoader('/components/plugins/Guava.vue?v=1.0.0'),
'condition': httpVueLoader('/components/plugins/ConditionStructure.vue?v=1.0.0'),
'question-naire': httpVueLoader('/components/plugins/QuestionNaire.vue'),
},
methods: {
isCheckBoxChange() {
this.formData.welfareProjectSubjects = [{
subjectName: '请输入福利信息',
subjectType: this.formData.isCheckBox ? this.formData.isCheckBox : 'radio',
defaultOption: null,
options: [
{
optionType: "套餐",
optionName: '福利1',
optionNameId: '',
optionSort: '1',
imgUrl: ''
}
]
}]
},
async handleAvatarSuccess(res, file) {
this.$set(this.formData, 'cover', res.data.filepath)
await this.$refs['form'].validate()
},
beforeAvatarUpload(file) {
const isJPG = file.type === 'image/jpeg';
const isLt2M = file.size / 1024 / 1024 / 1024 / 1024 < 2;
if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 格式!');
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 4MB!');
}
return isJPG && isLt2M;
},
doExportWelFareList() {
this.exportWelfareList(this.welfare_id, this.selPersonType)
this.exportWelfareListDialog = false
},
exportWelfareList,
async save() {
const formValid = await this.$refs["form"].validate()
if (formValid) {
if (this.formData.flexible) {
const questionValid = this.$refs.questionNaire.validate()
if (!questionValid) {
this.$message.warning('题目信息填写不完整!')
return
}
}
this.submitLoading = true
const loading = this.$loading({
lock: true,
text: '数据保存中请稍后',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const formData = clone(this.formData)
if (formData.isCheckBox === "radio") {
formData.multiSelectNum = 0
}
if (formData.flexible) {
formData.flexibleGifts.map(v => v.isDefault = false)
formData.flexibleGifts[formData.defaultFlexibleGifts].isDefault = true
formData.flexibleGifts = JSON.stringify(formData.flexibleGifts)
} else {
formData.flexibleGifts = null
}
if (formData.conditionStructure)
formData.conditionStructure = JSON.stringify(formData.conditionStructure)
if (this.formData.flexible && [2, 3, 4].includes(formData.provideMode)) {
formData.welfareProjectSubjects = JSON.stringify(this.$refs.questionNaire.subject)
}
if (!this.formData.id) {
const alert = await this.$alert('在发放福利前,请及时生成福利名单,便于教职工选择福利', '提醒', {
confirmButtonText: '确定',
})
}
const resp = await $.post(loc() + "/save", formData)
loading.close()
this.submitLoading = false
if(resp.code===0){
this.$refs.guava.index()
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
},
provideTimeChange() {
if (this.formData.provideTime && this.formData.provideTime.length) {
this.formData.provideTimeStart = this.formData.provideTime[0]
this.formData.provideTimeEnd = this.formData.provideTime[1]
} else {
this.formData.provideTimeStart = ''
this.formData.provideTimeEnd = ''
}
},
choiceTimeChange() {
if (this.formData.choiceTime && this.formData.choiceTime.length) {
this.formData.choiceTimeStart = this.formData.choiceTime[0]
this.formData.choiceTimeEnd = this.formData.choiceTime[1]
} else {
this.formData.choiceTimeStart = ''
this.formData.choiceTimeEnd = ''
}
},
openAdd() {
this.formData = {
isRoutine: true,
isCheckBox: "radio",
defaultFlexibleGifts: 0,
flexible: false,
welfareProjectSubjects: [],
flexibleGifts: [{}]
}
this.$refs.guava.edit()
if (this.$refs.form)
this.$refs.form.resetFields();
},
async createList(row) {
let msg = row.created ? "务必确认是否重新生成福利名单,如果确认,系统将清空已经选取的福利信息。请再次确认 !!" : "确定要生成福利名单吗?"
this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
this.submitLoading = true
const resp = await $.post(loc() + "/createList", {
id: row.id,
created: false
})
this.submitLoading = false
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
})
},
async createList2(row) {
this.$confirm('系统根据现有的福利会员,更新当前福利名单,对已经选择的福利没有影响,请确认是否更新?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
this.submitLoading = true
const resp = await $.post(loc() + "/createList", {
id: row.id,
created: true
})
this.submitLoading = false
if(resp.code===0){
this.pageData()
this.notifySuccess(resp.msg)
}else{
this.notifyWarning(resp.msg)
}
}
}
})
},
doDelete(id) {
this.$confirm('确定要删除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await $.post(loc() + "/delete", {id});
if(resp.code===0){
this.pageData()
}else{
this.notifyWarning(resp.msg)
}
}
}
});
},
dropdownCommand(command) {
const {type, data} = command
this.welfare_id = data.id
if (type == 'view') {
this.openView(data.id)
} else if (type == 'edit') {
this.openEdit(data)
} else if (type == 'delete') {
this.doDelete(data.id)
} else if (type == 'createList') {
this.createList(data)
} else if (type == 'createList2') {
this.createList2(data)
} else if (type == 'export') {
this.exportWelfareListDialog = true
// this.exportWelfareList(data.id)
}
},
async openEdit(row) {
this.submitLoading = true
const resp = await $.get(loc() + "/findOne", {id: row.id})
this.submitLoading = false
if(resp.code===0){
const data = resp.data
data.flexibleGifts = data.flexibleGifts || [{}]
const idx = data.flexibleGifts.findIndex(v => v.isDefault)
data.defaultFlexibleGifts = idx < 0 ? 0 : idx
data.provideTime = [data.provideTimeStart, data.provideTimeEnd]
data.choiceTime = [data.choiceTimeStart, data.choiceTimeEnd]
if (data.welfareProjectSubjects.length === 0) {
data.welfareProjectSubjects = [{
subjectName: '请输入福利信息',
subjectType: data.isCheckBox,
defaultOption: null,
options: [
{
optionType: "套餐",
optionName: '福利1',
optionNameId: '',
optionSort: '1',
imgUrl: ''
}
]
}]
} else {
data.welfareProjectSubjects.forEach(v => {
v.options.map(o => {
if (!o.optionNameId) {
o.optionNameId = ""
}
})
})
}
this.formData = data
this.$refs.guava.edit()
}else{
this.notifyWarning(resp.msg)
}
},
openView() {
this.$refs.guava.view()
},
pageData() {
sublime.showLoadingbar();
this.tableLoading = true
$.post(loc() + "/pageData", this.pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code == 0) {
data.data.list.forEach(v => {
v.flexibleGifts = JSON.parse(v.flexibleGifts || "[]")
})
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
},
},
async created() {
this.pageData();
this.welfareProvideMode = await getEnumOptions("WelfareProvideMode")
this.welfareSignMode = await getEnumOptions("WelfareSignMode")
this.welfareNoticePushMode = await getEnumOptions("WelfareNoticePushMode")
this.welfarePersonTypeList = await getPersonTypeListGroupByWelfare()
this.welfarePersonTypeList.map(v => {
this.selPersonType.push(v.personType)
})
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,697 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<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
style="width: 100%"
@change="yearChange"
:clearable="false"
value-format="yyyy"
v-model="pageForm.year"
type="year"
placeholder="选择年">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">福利项目:</div>
<div class="search-item-option">
<el-select placeholder="福利项目" v-model="pageForm.projectId"
@change="doSearch();getWelfareOptions();"
style="width: 100%;"
filterable="true">
<el-option v-for="item in welfareProjectList" :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-date-picker
style="width: 100%"
v-model="pageForm.month"
type="month"
value-format="yyyy-MM"
placeholder="请选择发放生日蛋糕的月份">
</el-date-picker>
</div>
</div>-->
<div class="search-item">
<div class="search-item-label">所属工会:</div>
<div class="search-item-option">
<el-select @change="getUnionGroup()" clearable filterable
placeholder="所属工会" style="width: 100%;"
:clearable="clearable"
v-model="pageForm.welfareUnitCode">
<el-option :label="item.unionname" :value="item.unioncode"
v-for="item in unions"></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="clearable"
@change="pageData"
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-query">
<el-button type="primary" icon="el-icon-search"
@click="doSearch();unionGroupChange()">搜索
</el-button>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10" v-loading="tableLoading">
<table-tool label="工会列表" :app="this">
<template #func>
<!-- <el-button type="primary" size="small" icon="el-icon-printer"
:disabled="provideMode!==3"
@click="openImportExpressExcel">
导入快递单号
</el-button>-->
<!--<el-button @click="sendMsg" icon="el-icon-s-promotion" size="small"
type="primary">
短信通知
</el-button>-->
<el-button
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}"
@click="allExportReceiveDetailByUnionIdWord"
icon="el-icon-printer"
size="small"
type="primary">导出全部福利签领表(压缩包)
</el-button>
<el-button
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H04')}"
@click="welfareProjectGroupExport" icon="el-icon-printer"
size="small"
type="primary">按品牌导出(xlsx
</el-button>
<!-- <el-button
@click="allShopExport" icon="el-icon-printer"
size="small"
type="primary">按品牌导出全部(蛋糕券)
</el-button>-->
<template
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H04')}">
<!-- <el-button :disabled="!pageForm.projectId" type="primary"
size="small"
icon="el-icon-printer"
@click="exportReceiveDetail(true)">按分工会导出已选名单
</el-button>
<el-button
:disabled="!pageForm.projectId" type="primary"
size="small"
icon="el-icon-printer"
@click="exportReceiveDetail(false)">按分工会导出未选名单
</el-button>
<el-button
:disabled="!pageForm.projectId"
type="primary" size="small"
icon="el-icon-printer"
@click="exportByUnit">按单位导出汇总表
</el-button>-->
<el-button
:disabled="!pageForm.projectId"
type="primary" size="small"
icon="el-icon-printer"
@click="exportByUnionGroup">导出汇总表
</el-button>
</template>
<template
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
<!-- <el-button :disabled="!pageForm.projectId" type="primary" size="small"
icon="el-icon-printer"
@click="exportByUnion">导出汇总表
</el-button>-->
<el-button @click="selectOptionByAdmin"
icon="el-icon-printer"
size="small"
type="primary">管理员代选择
</el-button>
</template>
</template>
</table-tool>
<el-table :data="tableData"
@sort-change="pageOrder"
row-key="welfareUnitId" show-summary style="width: 100%"
ref="table" class="vi-table" :size="tableSize" lazy
@expand-change="unionGroupChange">
<!-- <el-table-column type="expand">
<template scope="{row}">
<el-table :data="row.unionGroupTableData" style="width: 100%"
row-key="id"
v-loading="tableLoading" class="vi-table" :size="tableSize">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
align="center"
v-for="column in row.unionGroupTableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
</el-table>
</template>
</el-table-column>-->
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
:width="column.width"
align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template scope="{row}" v-if="column.prop=='welfareUnitName'">
({{row.welfareUnitCode}}){{row.welfareUnitName}}
</template>
<template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'">
<el-link @click="openUnclaimed(row.welfareUnitCode)" type="primary">
{{row.unselectedTeacherSum}}
</el-link>
</template>
</el-table-column>
<el-table-column header-align="center" label="操作" v-if="tableColumns.length>0"
width="300px">
<template scope="{ row }">
<!-- <el-button plain
@click="shopExport(row.welfareUnitId)"
size="mini"
type="primary">导出蛋糕券签领表
</el-button>-->
<el-button plain
@click="exportReceiveDetailByUnionIdWord(row.welfareUnitId)"
size="mini"
type="primary">导出福利签领表
</el-button>
<el-button @click="openView(row.welfareUnitCode)" size="mini"
type="primary">查看已选人员
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<el-table :data="receiveTableData" style="width: 100%" row-key="id"
height="100%"
v-loading="tableLoading" class="vi-table" :size="tableSize">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
align="center"
v-for="column in receive_tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="receivePageSizeChange"
@current-change="receivePageNumberChange"
:current-page="receivePageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="receivePageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="receivePageForm.totalCount">
</el-pagination>
</el-row>
</template>
</guava>
<el-dialog :visible.sync="unclaimedDialog" title="未领取人员" width="65%">
<el-button type="primary"
class="pull-right"
icon="el-icon-printer"
@click="exportReceiveDetailByUnionId(false)">导出未选名单
</el-button>
<el-table :data="unclaimedTableData" style="width: 100%" row-key="id" max-height="650"
v-loading="tableLoading" class="vi-table" :size="tableSize">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
align="center"
v-for="column in unclaimed_tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@size-change="unclaimedPageSizeChange"
@current-change="unclaimedPageNumberChange"
:current-page="unclaimedPageForm.pageNumber"
:page-sizes="[5,10, 20, 30, 50]"
:page-size="receivePageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="unclaimedPageForm.totalCount">
</el-pagination>
</el-row>
</el-dialog>
<el-dialog :visible.sync="importExpressExcelDialog" title="导入快递单号" width="65%">
<el-row type="flex" style="justify-content: space-between;align-items: center">
<span>只能导入已选人员名单,导入未选人员名单无效。</span>
<el-button size="small" type="primary" @click="downLoadExpressTemplate">下载模板</el-button>
</el-row>
<el-row type="flex" justify="center">
<el-upload
ref="expressExcelUpload"
:auto-upload="false"
:file-list="importExpressExcelFile"
:limit="1"
:data="{projectId:pageForm.projectId}"
drag
:action="loc()+'/importCourierNumber'"
:on-success="expressExcelHandleSuccess"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传xls,xlsx文件</div>
</el-upload>
</el-row>
<el-row type="flex" justify="end">
<el-button @click="importExpressExcelDialog=false">取消</el-button>
<el-button type="primary" @click="doImportExpressExcel">提交</el-button>
</el-row>
</el-dialog>
<el-dialog :visible.sync="selectByAdminDialogVisible" title="" width="35%"
v-loading="doSelectByAdminLoading">
<el-form label-width="120px" label-position="right">
<el-form-item label="福利选项">
<el-select v-model="noSelectOptionId" style="width: 100%">
<el-option v-for="item in welfareOptions" :key="item.id" :value="item.id"
:label="item.optionName"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="selectByAdminDialogVisible=false">取消</el-button>
<el-button type="primary" @click="doSelectByAdmin">提交</el-button>
</el-row>
</el-dialog>
</div>
<script>
<!--#include("/platform/welfare/include/common.js"){}#-->
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
clearable: false,
dgkMonth: "",
isDgk: false,
welfareProjectList: [],
pageForm: {
month: '',
unionGroupId: '',
year: '',
welfareUnitCode: ''
},
unions: [],
tableColumns: [],
receive_tableColumns: [
{label: '工号', prop: 'loginName'},
{label: '姓名', prop: 'userName'},
{label: '身份证', prop: 'idCard'},
{label: '单位', prop: 'unitName'},
{label: '部门', prop: 'threeUnitName'},
{label: '所选福利', prop: 'optionName'},
],
receiveTableData: [],
receivePageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
unclaimedDialog: false,
unclaimedTableData: [],
unclaimedPageForm: {
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
unclaimed_tableColumns: [
{label: '姓名', prop: 'userName'},
{label: '工号', prop: 'loginName'},
{label: '单位', prop: 'unitName'},
{label: '工会', prop: 'unionName'},
{label: '联系方式', prop: 'mobile'},
],
unionGroupTableData: [],
unionGroupTableColumns: [],
welfare,
welfareUnitCode: null,
importExpressExcelDialog: false,
importExpressExcelFile: [],
selectByAdminDialogVisible: false,
noSelectUsers: [],
welfareOptions: [],
noSelectOptionId: null,
doSelectByAdminLoading: false,
unionGroups: [],
viewTableWrapHeight: 500
}
},
computed: {
provideMode() {
const project = this.welfareProjectList.find(v => v.id === this.pageForm.projectId)
if (project) {
return project.provideMode
}
return null
}
},
methods: {
async unionGroupChange(row, expandedRows) {
if (expandedRows.length) {
this.tableLoading = true
const resp = await $.get(loc() + '/unionGroupPageData', {
projectId: this.pageForm.projectId,
month: this.pageForm.month,
unionGroupId: this.pageForm.unionGroupId,
unionId: row.welfareUnitId,
})
if (resp.code === 0) {
this.$set(row, "unionGroupTableData", resp.data.tableList)
this.$set(row, "unionGroupTableColumns", resp.data.tableColumn)
}
this.tableLoading = false
}
},
async getUnionGroup() {
const un = this.unions.find(v => v.unioncode === this.pageForm.welfareUnitCode)
this.unionGroups = await unionGroupsByUnionId(un.id)
},
async selectOptionByAdmin() {
this.selectByAdminDialogVisible = true
// const resp = await $.get(loc() + '/getNoSelectUsers', {projectId: this.pageForm.projectId})
// this.noSelectUsers = resp.data
},
doSelectByAdmin() {
if (this.noSelectOptionId == null || this.noSelectOptionId === '') {
this.notifyWarning('请选择福利')
return
}
const {optionName} = this.welfareOptions.find(v => v.id === this.noSelectOptionId)
this.$confirm('请确定是否把【' + optionName + '】福利赋给未选择的教职工?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
this.doSelectByAdminLoading = true
const resp = await $.get(loc() + '/doSelectByAdmin', {
optionId: this.noSelectOptionId,
projectId: this.pageForm.projectId
})
this.doSelectByAdminLoading = false
if (resp.code === 0) {
this.pageData()
this.selectByAdminDialogVisible = false
this.notifySuccess(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
allExportReceiveDetailByUnionIdWord() {
window.open(loc() + '/allExportReceiveDetailByUnionIdWord?projectId=' + this.pageForm.projectId + "&month=" + this.pageForm.month)
},
exportReceiveDetailByUnionIdWord(welfareUnitId) {
window.open(loc() + '/exportReceiveDetailByUnionIdWord?welfareUnitId=' + welfareUnitId +
'&projectId=' + this.pageForm.projectId +
"&month=" + this.pageForm.month +
"&unionGroupId=" + this.pageForm.unionGroupId)
},
downLoadExpressTemplate() {
window.open(loc() + '/downLoadExpressTemplate')
},
openImportExpressExcel() {
this.importExpressExcelDialog = true
if (this.$refs.expressExcelUpload) {
this.$refs.expressExcelUpload.clearFiles()
}
},
expressExcelHandleSuccess(response, file, fileList) {
if (response.code !== 0) {
this.notifyWarning(response.msg)
this.$refs.expressExcelUpload.clearFiles()
} else {
this.notifySuccess(response.msg)
this.$refs.expressExcelUpload.clearFiles()
this.importExpressExcelDialog = false
this.doSearch()
}
},
doImportExpressExcel() {
this.$refs.expressExcelUpload.submit()
},
async init() {
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('club01')}" === 'false' && ("${@shiro.hasRole('H04')}" === 'true' || "${@shiro.hasRole('ghxzzz')}" === 'true')) {
this.unions = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
this.$set(this.pageForm, "welfareUnitCode", this.unions[0].unioncode)
await this.getUnionGroup()
if ("${@shiro.hasRole('ghxzzz')}" === 'true') {
this.$set(this.pageForm, "unionGroupId", this.unionGroups[0].id)
} else {
this.clearable = true
}
} else {
this.unions = await getUnions(null)
this.clearable = true
}
this.pageForm.year = new Date().getFullYear().toString()
await this.getWelfareProjectList()
},
async getWelfareProjectList() {
const resp = await $.get(loc() + '/welfareProjectList', {year: this.pageForm.year})
this.welfareProjectList = resp.data
if (this.welfareProjectList && this.welfareProjectList.length > 0) {
this.$set(this.pageForm, "projectId", this.welfareProjectList[0].id)
await this.pageData()
await this.getWelfareOptions()
} else {
this.tableData = []
this.tableColumns = []
}
},
async yearChange() {
this.$set(this.pageForm, "projectId", null)
this.$set(this.pageForm, "welfareUnitCode", '')
await this.getWelfareProjectList()
},
async pageData() {
const loading = this.$loading({
lock: true,
text: '努力加载中。。。',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
sublime.showLoadingbar()
const resp = await $.post(loc() + '/pageData', this.pageForm)
sublime.closeLoadingbar()
if (resp.code === 0) {
this.tableColumns = [{
width:"200",
prop: 'welfareUnitName',
label: "工会小组"
}].concat(resp.data.tableColumn)
this.tableData = resp.data.tableList
}
loading.close()
},
receivePageSizeChange(val) {
this.receivePageForm.pageSize = val;
this.receivePageData();
},
receivePageNumberChange(val) {
this.receivePageForm.pageNumber = val;
this.receivePageData();
},
async openView(welfareUnitCode) {
this.receivePageForm.pageNumber = 1;
this.receivePageForm.pageSize = 10;
this.welfareUnitCode = welfareUnitCode
await this.receivePageData()
this.$refs.guava.view()
},
async receivePageData() {
this.tableLoading = true
const resp = await $.post(loc() + '/receivePageData', {
welfareUnitCode: this.welfareUnitCode,
projectId: this.pageForm.projectId,
month: this.pageForm.month,
unionGroupId: this.pageForm.unionGroupId,
pageNumber: this.receivePageForm.pageNumber,
pageSize: this.receivePageForm.pageSize,
})
this.receiveTableData = resp.data.list;
this.receivePageForm.totalCount = resp.data.totalCount;
this.tableLoading = false
},
async openUnclaimed(welfareUnitCode) {
this.unclaimedPageForm.pageNumber = 1;
this.unclaimedPageForm.pageSize = 10;
this.welfareUnitCode = welfareUnitCode
await this.unclaimedPageData()
this.unclaimedDialog = true
},
async unclaimedPageData() {
this.tableLoading = true
const resp = await $.post(loc() + '/unclaimedData', {
welfareUnitCode: this.welfareUnitCode,
projectId: this.pageForm.projectId,
month: this.pageForm.month,
unionGroupId: this.pageForm.unionGroupId,
pageNumber: this.unclaimedPageForm.pageNumber,
pageSize: this.unclaimedPageForm.pageSize,
})
this.unclaimedTableData = resp.data.list;
this.unclaimedPageForm.totalCount = resp.data.totalCount;
this.tableLoading = false
},
unclaimedPageSizeChange(val) {
this.unclaimedPageForm.pageSize = val;
this.unclaimedPageData();
},
unclaimedPageNumberChange(val) {
this.unclaimedPageForm.pageNumber = val;
this.unclaimedPageData();
},
exportByUnion() {
const {projectId, welfareUnitCode} = this.pageForm
window.open(loc() + '/exportByUnion?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : '') + "&month=" + this.pageForm.month)
},
exportByUnit() {
const {projectId, welfareUnitCode} = this.pageForm
window.open(loc() + '/exportByUnit?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : ''))
},
exportByUnionGroup() {
const {projectId, welfareUnitCode} = this.pageForm
window.open(loc() + '/exportByUnionGroup?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : ''))
},
exportReceiveDetail(flag) {
const {projectId, welfareUnitCode} = this.pageForm
window.open(loc() + '/exportReceiveDetail?projectId=' + projectId + '&welfareUnitCode=' + (welfareUnitCode ? welfareUnitCode : '') + '&flag=' + flag + "&month=" + this.pageForm.month)
},
exportReceiveDetailByUnionId(flag) {
const {projectId} = this.pageForm
const welfareUnitCode = this.welfareUnitCode ? this.welfareUnitCode : ''
window.open(loc() + '/exportReceiveDetail?projectId=' + projectId + '&welfareUnitCode=' + welfareUnitCode + '&flag=' + flag + "&month=" + this.pageForm.month)
},
shopExport(welfareUnitId) {
window.open(loc() + "/shopExport?projectId=" + this.pageForm.projectId + "&month=" + this.pageForm.month + "&welfareUnitId=" + welfareUnitId)
},
allShopExport() {
window.open(loc() + "/allShopExport?projectId=" + this.pageForm.projectId + "&month=" + this.pageForm.month)
},
welfareProjectGroupExport() {
window.open(loc() + "/welfareProjectGroupExport?projectId=" + this.pageForm.projectId + "&welfareUnitCode=" + this.pageForm.welfareUnitCode)
},
sendMsg() {
this.$confirm('您确定要向未领取人员发送短信提醒吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async () => {
const resp = await $.post('/sendMsg', {projectId: this.pageForm.projectId})
if (resp.code === 0) {
this.$message.success(resp.msg)
} else {
this.$message.error(resp.msg)
}
}).catch(() => {
});
},
async getWelfareOptions() {
const resp = await $.post('/platform/welfare/list/mange/welfareOptions', {projectId: this.pageForm.projectId})
this.welfareOptions = resp.data
}
},
created() {
this.init()
}
})
</script>
<!--#
}
#-->