348 lines
15 KiB
HTML
348 lines
15 KiB
HTML
<!--#
|
|
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="username"></el-option>
|
|
<el-option label="工号" value="loginname"></el-option>
|
|
</el-select>
|
|
</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>
|
|
<span class="text-danger">人员信息是否异动:</span>
|
|
<el-radio-group v-model="pageForm.changed" @change="doSearch" class="mr5" size="small">
|
|
<el-radio-button label="">全部({{numData.userSumNum}})</el-radio-button>
|
|
<el-radio-button :label="1">是({{numData.changeNum}})</el-radio-button>
|
|
<el-radio-button :label="0">否({{numData.notChangeNum}})</el-radio-button>
|
|
</el-radio-group>
|
|
|
|
<span class="text-danger">是否会员:</span>
|
|
<el-radio-group v-model="pageForm.isMember" @change="doSearch" class="mr5" size="small">
|
|
<el-radio-button label="">全部({{numData.userSumNum}})</el-radio-button>
|
|
<el-radio-button label="1">是({{numData.memberNum}})</el-radio-button>
|
|
<el-radio-button label="0">否({{numData.notMemberNum}})</el-radio-button>
|
|
</el-radio-group>
|
|
|
|
<span v-if="!allowOperationTask" class="text-danger mr10">
|
|
该任务核对时间已过,无法操作
|
|
</span>
|
|
|
|
<el-button icon="el-icon-success" size="small" type="primary" @click="submitCheck"
|
|
:disabled="unionTaskStatus || !allowOperationTask">
|
|
全部核对完成,提交核对
|
|
</el-button>
|
|
|
|
<el-button v-if="unionTaskStatus" type="primary" size="small" @click="checkAgain">
|
|
重新核对
|
|
</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 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" 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="变更状态" header-align="center" align="center" prop="welfareMember"
|
|
show-overflow-tooltip sortable>
|
|
<template scope="{row}">
|
|
<vi-table-state v-if="row.stateId" :state="row"></vi-table-state>
|
|
<vi-table-state v-else :state="{stateColor:'#1890ff',stateName:'暂无'}"></vi-table-state>
|
|
</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) || unionTaskStatus || !allowOperationTask">
|
|
核对
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-card>
|
|
|
|
<template #edit>
|
|
<mem-change-apply ref="apply" :userid="userId" @submit="doSubmitChangeUser" :welfare_member="true"
|
|
change_mode="check"></mem-change-apply>
|
|
</template>
|
|
|
|
</guava>
|
|
|
|
|
|
</div>
|
|
<script>
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
components: {
|
|
'mem-change-apply': httpVueLoader('/components/member/MemChangeApply.vue?v=1.0.2'),
|
|
},
|
|
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 {
|
|
unions: [],
|
|
units: [],
|
|
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: 'unitname', label: '所在单位', sortable: true},
|
|
{prop: 'unionname', label: '所属工会', sortable: true},
|
|
|
|
],
|
|
pageForm: {
|
|
year: new Date().getFullYear() + '',
|
|
searchName:'username',
|
|
changed: '',
|
|
isMember: ''
|
|
},
|
|
memberCheckTaskOptions: [],
|
|
changeType: {},
|
|
userId: null,
|
|
unionTaskStatus: false,
|
|
numData:{
|
|
changeNum:0,
|
|
notChangeNum:0,
|
|
userSumNum:0,
|
|
memberNum:0,
|
|
notMemberNum:0,
|
|
}
|
|
}
|
|
},
|
|
methods: {
|
|
openCheck(row) {
|
|
this.userId = row.id
|
|
this.$refs.guava.edit()
|
|
},
|
|
/**
|
|
* 提交异动人员
|
|
* @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()
|
|
this.getNumData()
|
|
} else {
|
|
this.notifyWarning(resp.msg)
|
|
}
|
|
},
|
|
|
|
/**
|
|
* 提交核对
|
|
*/
|
|
async submitCheck() {
|
|
const confirm = await this.$confirm('此操作会提交至校工会确认,请确认核对完成了吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
if ('confirm' !== confirm) return
|
|
const {taskId} = this.pageForm
|
|
const resp = await $.post(loc() + '/submitCheck', {taskId})
|
|
if (resp.code === 0) {
|
|
this.doSearch()
|
|
this.notifySuccess(resp.msg)
|
|
this.getUnionTaskStatus()
|
|
} else {
|
|
this.notifyWarning(resp.msg)
|
|
}
|
|
},
|
|
|
|
async getMemberCheckTaskOptions() {
|
|
const resp = await $.get('/platform/member/check/task/getAllTask')
|
|
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 getUnionTaskStatus() {
|
|
const {taskId} = this.pageForm
|
|
const resp = await $.get(loc() + '/getUnionTaskStatus', {taskId})
|
|
if (resp.code === 0) {
|
|
this.unionTaskStatus = resp.data
|
|
}
|
|
},
|
|
async checkAgain() {
|
|
const confirm = await this.$confirm('您确定要重新核对吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
})
|
|
if ('confirm' !== confirm) return
|
|
|
|
const {taskId} = this.pageForm
|
|
const resp = await $.get(loc() + '/checkAgain', {taskId})
|
|
if (resp.code === 0) {
|
|
this.getUnionTaskStatus()
|
|
}
|
|
},
|
|
async getNumData() {
|
|
const resp = await $.post(loc() + '/getButtonNum', this.pageForm)
|
|
if (resp.code === 0) {
|
|
this.numData = resp.data
|
|
}else{
|
|
this.notifyWarning(resp.msg)
|
|
}
|
|
}
|
|
|
|
},
|
|
async created() {
|
|
await this.getMemberCheckTaskOptions()
|
|
if (this.pageForm.taskId != null) {
|
|
this.pageData()
|
|
this.getNumData()
|
|
}
|
|
this.unions = await getUnions(null)
|
|
this.flushUnits()
|
|
this.changeType = await this.getChangeType()
|
|
this.getUnionTaskStatus()
|
|
}
|
|
})
|
|
</script>
|
|
|
|
<!--#
|
|
}
|
|
#--> |