Files
2026-09-20 15:46:34 +08:00

517 lines
23 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.query-row {
height: 70px;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
.query-row .el-col {
overflow: hidden;
}
.query-row:not(:last-child) {
border-bottom: 1px dashed rgb(230, 230, 230);
}
.query-row-title {
width: 120px;
}
.el-table-container {
padding-top: 0;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<template>
<el-card shadow="never">
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>年&emsp;&emsp;度:</span>
<el-date-picker
v-model="pageForm.year"
type="year"
value-format="yyyy"
placeholder="选择年"
style="width: 80%" @change="doSearch">
</el-date-picker>
</el-col>
<el-col :span="12">
<span>查询类型:</span>
<el-input placeholder="请输入内容" clearable v-model="pageForm.searchKeyword"
style="width: 80%" @keyup.enter.native="doSearch">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询类型"
style="width: 110px;">
<el-option label="姓名" value="userName"></el-option>
<el-option label="工号" value="loginName"></el-option>
</el-select>
<el-button slot="append" @click="doSearch">搜索</el-button>
</el-input>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>所属工会:</span>
<el-select v-model="pageForm.unionId" placeholder="请选择所属工会" @change="unionChange"
filterable clearable style="width: 80%">
<el-option
v-for="item in unionOptions"
:key="item.id"
:label="item.unionname"
:value="item.id">
</el-option>
</el-select>
</el-col>
<el-col :span="12">
<span>所属单位:</span>
<el-select v-model="pageForm.unitId" placeholder="请选择所属单位" @change="doSearch"
filterable clearable style="width: 80%">
<el-option
v-for="item in unitOptions"
:key="item.id"
:label="item.name"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<el-row>
<el-col :span="12">
<span>选择路线:</span>
<el-select v-model="pageForm.takePartInLineId" filterable clearable placeholder="请选择线路"
style="width: 80%" @change="doSearch()">
<el-option v-for="item in takePartInLines"
:key="item.id"
:label="item.lineName"
:value="item.id">
</el-option>
</el-select>
</el-col>
</el-row>
</el-col>
</el-row>
<el-row align="middle" class="query-row" type="flex">
<el-col class="query-row-title"></el-col>
<el-col class="query-row-content">
<span>查询条件:</span>
<el-tag :effect="pageForm.state===item.value?'dark':'plain'"
:key="item.value"
:type="item.label"
@click="checkState(item.value)"
style="margin-right: 10px;cursor: pointer;margin-bottom: 5px;font-size: 15px"
v-for="item in options">
{{ item.label }}
</el-tag>
<el-link :underline="false" @click="pageForm.state='';doSearch()"
type="danger" v-if="options.length&&pageForm.state">清空
</el-link>
</el-col>
</el-row>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="审核列表" :app="this">
<template #func>
<el-button type="primary" size="small" class="mr10" @click="openOnekeyAudit">一键审核</el-button>
<el-radio-group @change="doSearch()" size="small" v-model="pageForm.isAudit">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</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"
@selection-change="handleSelectionChange">
<el-table-column
:selectable="ifEdit"
type="selection"
width="55">
</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 scope="{row}" v-if="column.prop=='isTransferIn'">
<sapn v-if="row.takePartInUnionId!=unionId">转出</sapn>
<sapn v-else-if="row.selfUnionId!=unionId">转入</sapn>
<sapn v-else>否</sapn>
</template>
<template scope="{row}" v-else-if="column.prop=='lineName'">
<el-link type="primary" @click="openLine(row)">{{row.lineName}}</el-link>
</template>
<template scope="{row}" v-else-if="column.prop=='isFamily'">
{{row.isFamily?'携带':'未携带'}}
</template>
<template scope="{row}" v-else-if="column.prop=='num'">
{{1+row.num}}
</template>
<template scope="{row}" v-else-if="column.prop=='stateId'">
<span>
<vi-table-state :state="row"></vi-table-state>
</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="300px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button @click="doRecall(row)" size="mini" type="danger"
v-if="ifRecall(row)">撤回
</el-button>
<el-button v-if="ifEdit(row)" @click="openEdit(row)" size="mini" type="primary">
审核
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #view>
<enroll-info ref="viewEnrollInfo" :union_id="unionId"></enroll-info>
</template>
<template #public>
<line-info ref="viewLineInfo"></line-info>
</template>
<template #edit>
<enroll-info ref="editEnrollInfo">
<template #handle>
<el-tab-pane label="所属分工会审核" name="audit">
<el-form :model="formData" label-width="130px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input disabled v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-row>
<el-row style="margin: 40px 0;text-align: right">
<el-button @click="doAudit(false)" type="danger">退回
</el-button>
<el-button @click="doAudit(true)" type="primary">通过
</el-button>
</el-row>
</el-form>
</el-tab-pane>
</template>
</enroll-info>
</template>
</guava>
<el-dialog
title="提示"
:visible.sync="dialogVisible"
width="50%">
<el-form :model="formData" label-width="130px">
<el-row gutter="20">
<el-col :span="12">
<el-form-item label="审核人" prop="username">
<el-input disabled v-model="formData.username"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间" prop="auditTime">
<el-input disabled v-model="formData.auditTime"></el-input>
</el-form-item>
</el-col>
<el-form-item label="审核意见" prop="auditOpinion">
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
v-model="formData.auditOpinion"></el-input>
</el-form-item>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="doOnekeyAudit(false)">取 消</el-button>
<el-button type="primary" @click="doOnekeyAudit(true)">确 定</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unionId: "${@shiro.getPrincipalProperty('unit').getUnionid()}",
dialogVisible: false,
tableSelection: [],
formData: {
id: "",
username: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
auditTime: moment().format('YYYY-MM-DD HH:mm:ss'),
auditOpinion: "",
isTransferIn: false,
},
options: [
{label: "本工会人员(自己线路)", value: "1"},
{label: "本工会人员(其他路线)", value: "2"},
{label: "其他工会人员(选我线路)", value: "3"}
],
unionOptions: [],
unitOptions: [],
takePartInLines: [],
pageForm: {
isAudit: "false",
state: "",
year: moment().format('YYYY'),
searchName: "userName",
},
tableColumns: [
{prop: 'loginName', label: '工号'},
{prop: 'userName', label: '姓名'},
{prop: 'unitName', label: '单位', sortable: true},
{prop: 'unionName', label: '工会', sortable: true},
{prop: 'lineName', label: '线路', sortable: true},
{prop: 'userNature', label: '人员性质'},
{prop: 'isFamily', label: '是否携带家属'},
{prop: 'num', label: '人数'},
{prop: 'isTransferIn', label: '是否转入转出', sortable: true},
{prop: 'stateId', label: '审核状态'},
]
}
},
components: {
'enroll-info': httpVueLoader('/components/theRapyRecuperation/Enrollinfo.vue'),
'line-info': httpVueLoader('/components/theRapyRecuperation/LineInfo.vue')
},
methods: {
async doOnekeyAudit(flag) {
const confirm = await this.$confirm('您确定要一键审核您所勾选的信息吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + "/doOnekeyAudit", {
ids: JSON.stringify(this.tableSelection),
flag: flag,
auditOpinion: this.formData.auditOpinion
})
requestLaterFun(resp, (data) => {
this.$notify.success({title: '成功', message: resp.msg});
this.doSearch()
}, () => {
this.$notify.warning({title: '失败', message: resp.msg});
}, () => {
this.dialogVisible = false
})
}
},
async openOnekeyAudit() {
if (this.tableSelection.length === 0) {
this.$notify.warning({title: '警告', message: "请您先在左侧勾选在审核"});
return
}
this.dialogVisible = true
},
handleSelectionChange(val) {
this.tableSelection = val.map(v => v.id);
},
ifEdit(row) {
const {
stateId,
selfUnionId,
takePartInUnionId
} = row
if (stateId === 2710 && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else if (stateId === 2720 && takePartInUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else {
return false
}
},
ifRecall(row) {
const {
stateId,
selfUnionId,
takePartInUnionId
} = row
if ((stateId === 2715 || stateId === 2720 || stateId === 2750) && selfUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else if ((stateId === 2725 || stateId === 2750) && takePartInUnionId === "${@shiro.getPrincipalProperty('unit').getUnionid()}") {
return true
} else {
return false
}
},
async doRecall(row) {
const confirm = await this.$confirm('您确定要撤回吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm === "confirm") {
const resp = await $.post(loc() + "/doRecall", {id: row.id})
requestLaterFun(resp, (data) => {
this.$notify.success({title: '成功', message: resp.msg});
this.doSearch()
}, () => {
this.$notify.warning({title: '失败', message: resp.msg});
}, () => {
})
}
},
async doAudit(flag) {
const resp = await $.post(loc() + "/doAudit", {
flag: flag,
id: this.formData.id,
isTransferIn: this.formData.isTransferIn,
auditOpinion: this.formData.auditOpinion
})
requestLaterFun(resp, (data) => {
this.$notify.success({title: '成功', message: resp.msg});
this.doSearch()
this.$refs.guava.index()
}, () => {
this.$notify.warning({title: '失败', message: resp.msg});
}, () => {
})
},
openLine(row) {
this.$refs.guava.public()
this.$refs.viewLineInfo.findOne(row.takePartInLineId)
},
openEdit(row) {
this.$set(this.formData, "isTransferIn", row.isTransferIn)
this.$set(this.formData, "id", row.id)
this.$refs.guava.edit()
this.$refs.editEnrollInfo.openAudit(row.id, 'audit')
},
openView(row) {
this.$refs.guava.view()
this.$refs.viewEnrollInfo.openView(row.id)
},
checkState(type) {
this.pageForm.state = type
this.doSearch()
},
async unionChange(val) {
this.pageForm.unitId = null
this.unitOptions = await getUnits(val)
this.takePartInLines = await this.getXlByUnion()
this.doSearch()
},
/**
* 查询所有报名人员的工会
* @returns {Promise<void>}
*/
async getBmUserUnion() {
const {data} = await $.post(loc() + "/getBmUserUnion")
this.unionOptions = data
},
async getXlByUnion() {
const {data} = await $.post(loc() + "/getXlByUnion", {
unionId: this.pageForm.unionId,
year: this.pageForm.year,
regionalNature: "省外"
})
return data
},
pageData() {
sublime.showLoadingbar();
this.tableLoading = true
const pageForm = clone(this.pageForm)
pageForm.states = JSON.stringify(pageForm.states)
$.post(loc() + "/pageData", pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code === 0) {
this.tableData = data.data.list;
this.pageForm.totalCount = data.data.totalCount;
} else {
this.$message.error(data.msg);
}
}, "json");
},
async getApplyNumAudit() {
const {data} = await $.post(loc() + "/getApplyNumAudit", this.pageForm)
this.options = [
{label: "本工会人员(自己线路)" + data.count1 + "人", value: "1"},
{label: "本工会人员(其他路线)" + data.count2 + "人", value: "2"},
{label: "其他工会人员(选我线路)" + data.count3 + "人", value: "3"}
]
},
async doSearch() {
this.pageForm.pageNumber = 1;
this.pageData();
await this.getApplyNumAudit()
}
},
async created() {
await this.getBmUserUnion()
this.takePartInLines = await this.getXlByUnion()
await this.doSearch()
}
})
</script>
<!--#
}
#-->