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

259 lines
11 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<style>
.formData .viewFile {
height: 200px;
}
</style>
<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
v-model="pageForm.date"
type="daterange"
@change="dateChange"
align="right"
unlink-panels
value-format="yyyy-MM-dd"
style="width: 100%"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions">
</el-date-picker>
</div>
</div>
<div class="search-item">
<div class="search-item-label">姓名/工号:</div>
<div class="search-item-option">
<el-input @keyup.enter.native="doSearch" clearable
placeholder="请输入内容"
v-model="pageForm.searchKeyword">
<el-select clearable placeholder="查询类型"
slot="prepend"
style="width: 100px;"
v-model="pageForm.searchName">
<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 v-model="pageForm.notes" placeholder="请输入摘要" clearable>
</el-input>
</div>
</div>
<div class="search-item">
<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>
<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-item">
<div class="search-item-label">所属协会:</div>
<div class="search-item-option">
<el-select placeholder="所属协会" v-model="pageForm.clubId"
style="width: 100%;"
clearable="true"
filterable="true">
<el-option v-for="item in clubs" :label="item.name"
:value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="预审列表">
<template #func>
</template>
</table-tool>
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
style="width: 100%"
v-loading="tableLoading">
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号"
type="index"
width="80px"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
header-align="center"
v-for="column in tableColumns">
<template scope="{row}" v-if="column.prop==='auditState'">
<el-tag v-if="row.auditState===0" type="info">保存中</el-tag>
<el-tag v-if="row.auditState===1" type="info">待审核</el-tag>
<el-tag v-else-if="row.auditState===2" type="danger">退回修改</el-tag>
<el-tag v-else-if="row.auditState===3" type="danger">退回修改并结束</el-tag>
<el-tag v-else-if="row.auditState===4" type="success">已通过</el-tag>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
width="100">
<template scope="{row}">
<el-button @click="openView(row)" type="primary" size="mini">查看
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog
title="预审材料信息"
:visible.sync="viewDialogVisible"
width="40%"
:close-on-click-modal="false">
<info ref="info"></info>
<span slot="footer" class="dialog-footer">
<el-button @click="viewDialogVisible = false" type="primary">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
<!--#include("info.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
units: [],
unions: [],
clubs: [],
pageForm: {
date: [moment().subtract(1, "months")._d, new Date()],
year: new Date().getFullYear() + "",
clubId: ""
},
tableColumns: [
{prop: "loginName", label: "工号"},
{prop: "userName", label: "姓名"},
{prop: "unitName", label: "单位"},
{prop: "unionName", label: "工会"},
{prop: "clubName", label: "协会"},
{prop: "notes", label: "事由"},
{prop: "applyDate", label: "填写时间"},
{prop: "auditState", label: "状态"}
],
formRules: {},
viewDialogVisible: false,
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])
}
}]
}
}
},
components: {
"info": info
},
methods: {
dateChange(val) {
if (val && val.length > 0) {
this.$set(this.pageForm, "startDate", val[0])
this.$set(this.pageForm, "endDate", val[1])
} else {
this.$set(this.pageForm, "startDate", "")
this.$set(this.pageForm, "endDate", "")
}
},
openView(row) {
this.viewDialogVisible = true
setTimeout(() => {
this.$refs.info.openView(row.id)
}, 300)
},
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 getClubs() {
const resp = await $.post("/platform/clubPreAudit/manage/getClubs")
if (resp.code === 0) {
this.clubs = resp.data
}
}
},
async created() {
this.unions = await getUnions(null)
this.flushUnits()
await this.getClubs()
this.pageData()
}
})
</script>
<!--#
}
#-->