Files
UNION_NSI/target/classes/views/platform/member/check/personal.html
T
2026-09-08 19:49:21 +08:00

254 lines
11 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%"
@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">导出核对信息
</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>
var 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/member/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>
<!--#
}
#-->