协会报销预审

This commit is contained in:
=
2026-04-10 18:19:09 +08:00
parent 1c89f47958
commit a1dcad9e28
8 changed files with 1370 additions and 0 deletions
@@ -0,0 +1,138 @@
package io.v.nutz.clubPreAudit.controller;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.base.utils.Vi;
import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.clubPreAudit.models.ClubPreAudit;
import io.v.nutz.sys.models.Sys_club;
import io.v.nutz.sys.models.Sys_club_user;
import io.v.nutz.util.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.util.NutMap;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @ClassName clubPreAuditManageController
* @Description 我的预审管理
* @Version 1.0
* @Author zhf
* @Date 2025/4/9 下午2:04
*/
@At("/platform/clubPreAudit/manage")
@Ok("json:full")
@IocBean
public class clubPreAuditManageController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/clubPreAudit/manage.html")
@RequiresPermissions("clubPreAudit.manage")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("clubPreAudit.manage")
public Object pageData(PageForm pageForm, String year, String notes) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT * FROM `club_pre_audit` $condition
""");
cnd.andEX("YEAR(applyDate)", "=", year);
cnd.andEX("unionId", "=", Vi.getUnionId());
cnd.desc("applyDate").desc("opAt");
if (StrUtil.isNotEmpty(notes)) {
cnd.andEX("notes", "like", "%" + notes + "%");
}
if (StrUtil.isAllNotEmpty(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy());
}
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@RequiresPermissions("clubPreAudit.manage")
public Object doDelete(String id) {
baseService.dao().delete(ClubPreAudit.class, id);
return null;
}
@At
@ViReturn
@RequiresPermissions("clubPreAudit.manage")
public Object doSubmit(@Param("preAudit") ClubPreAudit preAudit, Boolean flag) {
preAudit.setUserId(ShiroUtil.getUserId());
preAudit.setUnitId(ShiroUtil.getUnitId());
preAudit.setUnionId(Vi.getUnionId());
// 获取用户所属协会
Sys_club_user clubUser = baseService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", ShiroUtil.getUserId()).and("isNormal", "=", true));
if (clubUser != null) {
Sys_club club = baseService.dao().fetch(Sys_club.class, clubUser.getClubid());
if (club != null) {
preAudit.setClubId(club.getId());
preAudit.setClubName(club.getName());
}
}
preAudit.setAuditState(flag ? 1 : 0);
baseService.insertOrUpdate(preAudit);
return null;
}
@At
@ViReturn
public Object findOne(String id) {
Sql sql = Sqls.create("""
SELECT * FROM `club_pre_audit` WHERE id=@id
""")
.setParam("id", id);
sql.setCallback(Sqls.callback.map());
baseService.dao().execute(sql);
NutMap info = (NutMap) sql.getResult();
info.put("auditInfo", baseService.dao().fetch(Audit.class, Cnd.where("id", "=", info.getString("auditId"))));
return info;
}
@At("/getUserClub")
@ViReturn
public Object getUserClub() {
NutMap result = new NutMap();
// 获取用户所属协会
Sys_club_user clubUser = baseService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", ShiroUtil.getUserId()).and("isNormal", "=", true));
if (clubUser != null) {
Sys_club club = baseService.dao().fetch(Sys_club.class, clubUser.getClubid());
if (club != null) {
result.put("clubId", club.getId());
result.put("clubName", club.getName());
}
}
return result;
}
@At("/getClubs")
@ViReturn
public Object getClubs() {
// 获取所有协会列表
return baseService.dao().query(Sys_club.class, Cnd.where("isjs", "=", false));
}
}
@@ -0,0 +1,67 @@
package io.v.nutz.clubPreAudit.controller;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.util.ShiroUtil;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
/**
* @ClassName clubPreAuditQueryController
* @Description TODO
* @Author zhf
* @Date 2025/4/10 上午9:13
*/
@At("/platform/clubPreAudit/query")
@Ok("json:full")
@IocBean
public class clubPreAuditQueryController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/clubPreAudit/query.html")
@RequiresPermissions("clubPreAudit.query")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("clubPreAudit.manage")
public Object pageData(PageForm pageForm, String startDate, String endDate, String notes, String unitId, String unionId, String clubId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT * FROM `club_pre_audit` $condition
""");
cnd.andEX("applyDate", ">=", startDate);
cnd.andEX("applyDate", "<=", endDate);
cnd.andEX("auditState", ">=", 3);
cnd.andEX("unitId", "=", unitId);
cnd.andEX("unionId", "=", unionId);
if (StrUtil.isNotEmpty(clubId)) {
cnd.andEX("clubId", "=", clubId);
}
if (StrUtil.isNotEmpty(notes)) {
cnd.andEX("notes", "like", "%" + notes + "%");
}
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isAllNotEmpty(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy());
}else{
cnd.desc("applyDate").desc("opAt");
}
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
}
@@ -0,0 +1,96 @@
package io.v.nutz.clubPreAudit.controller;
import cn.hutool.core.util.StrUtil;
import io.v.nutz.annontation.ViReturn;
import io.v.nutz.base.service.BaseService;
import io.v.nutz.modules.models.Audit;
import io.v.nutz.modules.models.PageForm;
import io.v.nutz.clubPreAudit.models.ClubPreAudit;
import io.v.nutz.util.ShiroUtil;
import io.v.nutz.web.commons.slog.annotation.SLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Sqls;
import org.nutz.dao.sql.Sql;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
/**
* @ClassName clubPreAuditSchoolController
* @Description TODO
* @Author zhf
* @Date 2025/4/9 下午4:46
*/
@At("/platform/clubPreAudit/audit")
@Ok("json:full")
@IocBean
public class clubPreAuditSchoolController {
@Inject
private BaseService baseService;
@At("")
@Ok("beetl:/platform/clubPreAudit/audit.html")
@RequiresPermissions("clubPreAudit.audit")
public void index() {
}
@At
@ViReturn
@RequiresPermissions("clubPreAudit.audit")
public Object pageData(PageForm pageForm, String year, String notes, Integer auditState, String unitId, String unionId, String clubId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT * FROM `club_pre_audit` $condition
""");
cnd.andEX("YEAR(applyDate)", "=", year);
cnd.andEX("unitId", "=", unitId);
cnd.andEX("unionId", "=", unionId);
if (StrUtil.isNotEmpty(clubId)) {
cnd.andEX("clubId", "=", clubId);
}
if (auditState != 0) {
cnd.andEX("auditState", auditState == 1 ? ">" : "=", 1);
} else {
cnd.andEX("auditState", ">=", 1);
}
if (StrUtil.isNotEmpty(notes)) {
cnd.andEX("notes", "like", "%" + notes + "%");
}
if (StrUtil.isAllNotEmpty(pageForm.getSearchName(), pageForm.getSearchKeyword())) {
cnd.and(Cnd.likeEX(pageForm.getSearchName(), pageForm.getSearchKeyword()));
}
if (StrUtil.isAllNotEmpty(pageForm.getPageOrderName(), pageForm.getPageOrderBy())) {
cnd.orderBy(pageForm.getPageOrderName(), pageForm.getPageOrderBy());
}else{
cnd.desc("applyDate").desc("opAt");
}
sql.setCondition(cnd);
return baseService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
}
@At
@ViReturn
@SLog(tag = "协会预审", msg = "审核一条记录", param = true, result = true)
@RequiresPermissions("clubPreAudit.audit")
public Object doSubmit(Audit audit, String id, @Param("flag") Integer flag) {
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
baseService.insert(audit);
Integer auditState;
if (flag == 1) {
auditState = 2;
} else if (flag == 2) {
auditState = 3;
} else {
auditState = 4;
}
Chain chain = Chain.make("auditId", audit.getId()).add("auditState", auditState);
baseService.dao().update(ClubPreAudit.class, chain, Cnd.where("id", "=", id));
return null;
}
}
@@ -0,0 +1,106 @@
package io.v.nutz.clubPreAudit.models;
import io.v.nutz.base.model.BaseModel;
import io.v.nutz.sys.models.Sys_file;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.List;
/**
* @ClassName ClubPreAudit
* @Description TODO
* @Author zhf
* @Date 2025/4/9 下午1:55
*/
@Data
@Table
@Comment("协会预审系统")
public class ClubPreAudit extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userId;
@Column
@Comment("姓名")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String userName;
@Column
@Comment("工号")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String loginName;
@Column
@Comment("单位")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unitName;
@Column
@Comment("单位Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unitId;
@Column
@Comment("工会")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String unionName;
@Column
@Comment("工会Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String unionId;
@Column
@Comment("协会")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String clubName;
@Column
@Comment("协会Id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String clubId;
@Column
@Comment("报销事由")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String notes;
@Column
@Comment("联系电话")
@ColDefine(type = ColType.VARCHAR, width = 50)
private String mobile;
@Column
@Comment("申报时间")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String applyDate;
@Column
@Comment("附件信息")
@ColDefine(type = ColType.MYSQL_JSON)
private List<Sys_file> files;
@Column
@Comment("审核记录id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String auditId;
@Column
@Comment("审核状态")
@ColDefine(type = ColType.INT)
private Integer auditState;
}
@@ -0,0 +1,311 @@
<!--#
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">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年"
style="width: 100%"
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-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>
<el-radio-group v-model="pageForm.auditState" @change="doSearch" size="small">
<el-radio-button :label="0">全部</el-radio-button>
<el-radio-button :label="1">已审核</el-radio-button>
<el-radio-button :label="2">未审核</el-radio-button>
</el-radio-group>
</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="300">
<template scope="{row}">
<el-button @click="openView(row)" type="primary" size="mini">查看
</el-button>
<el-button @click="openAudit(row)" type="primary" size="mini"
:disabled="![1].includes(row.auditState)">审核
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog
title="预审材料信息"
:visible.sync="dialogVisible"
width="40%"
:close-on-click-modal="false"
>
<info ref="auditInfo">
<template #handle>
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
style="padding: 20px 0"
label-width="120px">
<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="time" 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>
</el-form>
</template>
</info>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
<el-button type="danger" @click="doSubmit(1)">退回修改</el-button>
<el-button type="danger" @click="doSubmit(2)">退回修改并结束</el-button>
<el-button type="primary" @click="doSubmit(3)">通 过</el-button>
</span>
</el-dialog>
<el-dialog
title="预审材料信息"
:visible.sync="viewDialogVisible"
width="50%"
: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: {
auditState: 0,
searchName: "userName",
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: {},
dialogVisible: false,
viewDialogVisible: false
}
},
components: {
"info": info
},
methods: {
openView(row) {
this.viewDialogVisible = true
setTimeout(() => {
this.$refs.info.openView(row.id)
}, 300)
},
openAudit(row) {
this.formData = {
id: row.id,
auditOpinion: "",
auditTime: moment().format("YYYY-MM-DD"),
username: "${@shiro.getPrincipalProperty('username')}"
}
this.dialogVisible = true
setTimeout(() => {
this.$refs.auditInfo.openAudit(row.id, true)
}, 300)
},
doSubmit(flag) {
this.$refs.form.validate(async (valid) => {
if (valid) {
let msg = ""
if (flag === 1) {
msg = "退回修改"
} else if (flag === 2) {
msg = "退回修改并结束流程"
} else {
msg = "通过"
}
this.$confirm("确定要" + msg + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.formData.flag = flag
$.post("/platform/clubPreAudit/audit/doSubmit", this.formData).then(res => {
if (res.code === 0) {
this.$message({
type: "success",
message: "操作成功!"
})
this.dialogVisible = false
this.pageData()
}
})
})
}
})
},
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>
<!--#
}
#-->
@@ -0,0 +1,102 @@
let info = {
/*language=HTML*/
template: `
<el-tabs tab-position="top" v-model="activeName" v-loading="loading">
<el-tab-pane label="预审信息" name="1">
<el-form label-width="110px" class="formData">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="姓名">
{{viewData.userName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工号">
{{viewData.loginName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位">
{{viewData.unitName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工会">
{{viewData.unionName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="协会">
{{viewData.clubName}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="摘要">
{{viewData.notes}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系方式">
{{viewData.mobile}}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料" prop="files">
<file-upload card :files.sync="viewData.files"
view></file-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-tab-pane>
<el-tab-pane label="审核信息" name="2" v-if="viewData.auditId">
<el-form label-width="110px" class="formData">
<el-col :span="12">
<el-form-item label="姓名">
{{viewData.auditInfo.username}}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="审核时间">
{{viewData.auditInfo.auditTime}}
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="审核意见">
{{viewData.auditInfo.auditOpinion}}
</el-form-item>
</el-col>
</el-form>
</el-tab-pane>
<el-tab-pane v-if="handle" :label="label" name="999">
<slot name="handle"></slot>
</el-tab-pane>
</el-tabs>
</el-tabs>
`,
data() {
return {
handle: false,
label: "审核",
loading: false,
activeName: "1",
viewData: {}
}
},
methods: {
async openAudit(id, handle) {
this.handle = handle
await this.openView(id)
},
async openView(id) {
this.loading = true
const resp = await $.post("/platform/clubPreAudit/manage/findOne", {id})
resp.data.files = JSON.parse(resp.data.files)
this.viewData = resp.data
this.loading = false
if (this.handle){
this.activeName = "999"
}
}
}
}
@@ -0,0 +1,292 @@
<!--#
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">年&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
placeholder="选择年"
style="width: 100%"
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-input v-model="pageForm.notes" placeholder="请选择或输入摘要" clearable>
</el-input>
</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>
<el-button v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('xhbxy')}" type="primary" @click="openAdd" size="small">新增预审材料</el-button>
</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="300">
<template scope="{row}">
<el-button @click="openView(row)" type="primary" size="mini">查看
</el-button>
<el-button @click="openEdit(row)" type="primary" size="mini"
:disabled="![0,1,2].includes(row.auditState)">编辑
</el-button>
<el-button @click="doDelete(row.id)" type="danger" size="mini"
:disabled="![0,1].includes(row.auditState)">删除
</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</guava>
<el-dialog
title="预审材料信息"
:visible.sync="dialogVisible"
width="60%"
:close-on-click-modal="false"
>
<el-form :model="formData" :rules="rules" ref="form" label-width="100px" class="formData">
<el-row>
<el-col :span="12">
<el-form-item label="姓名" prop="userName">
<el-input v-model="formData.userName" disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工号" prop="loginName">
<el-input v-model="formData.loginName" disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="单位" prop="unitName">
<el-input v-model="formData.unitName" disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="工会" prop="unionName">
<el-input v-model="formData.unionName" disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="协会" prop="clubName">
<el-input v-model="formData.clubName" disabled>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="摘要" prop="notes">
<el-input v-model="formData.notes"
placeholder="请输入摘要" maxlength="50" show-word-limit>
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="联系电话" prop="mobile">
<el-input v-model="formData.mobile"
placeholder="请输入联系电话" maxlength="50" show-word-limit>
</el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="材料" prop="files">
<file-upload :files.sync="formData.files"
:type="['jpg', 'jpeg', 'png', 'JPG', 'JPEG', 'PNG']" :max="30">
<template #el-upload__tip>
<div class="el-upload__tip" slot="tip">
请上传类型为jpg/png/jpeg等格式的图片,最多上传30个文件
</div>
</template>
</file-upload>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
<el-button type="primary" @click="doSubmit(false)" :loading="formLoading">保 存</el-button>
<el-button type="primary" @click="doSubmit(true)" :loading="formLoading">提 交</el-button>
</span>
</el-dialog>
<el-dialog
title="预审材料信息"
:visible.sync="viewDialogVisible"
width="50%"
: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"){}#-->
const vue = new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
pageForm: {
year: new Date().getFullYear() + ""
},
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: "状态" }
],
dialogVisible: false,
viewDialogVisible: false,
rules: {
notes: [{ required: true, message: "必填", trigger: "blur" }],
mobile: [{ required: true, message: "必填", trigger: "blur" }],
files: [{ required: true, message: "必填", trigger: "blur" }]
}
}
},
components: {
"info": info
},
methods: {
async openAdd() {
this.formData = {
applyDate: moment().format("YYYY-MM-DD"),
userName: "${@shiro.getPrincipalProperty('username')}",
loginName: "${@shiro.getPrincipalProperty('loginname')}",
unitName: "${@shiro.getPrincipalProperty('unit').getName()}",
unionName: "${@shiro.getPrincipalProperty('union').getUnionname()}",
clubName: "",
clubId: ""
}
// 获取用户所属协会
const clubResp = await $.post("/platform/clubPreAudit/manage/getUserClub")
if (clubResp.code === 0 && clubResp.data) {
this.formData.clubName = clubResp.data.clubName || ""
this.formData.clubId = clubResp.data.clubId || ""
}
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.form.clearValidate()
})
},
openView(row) {
this.viewDialogVisible = true
setTimeout(() => {
this.$refs.info.openView(row.id)
}, 300)
},
openEdit(row) {
const data = clone(row)
data.files = JSON.parse(data.files)
this.formData = data
this.dialogVisible = true
},
doDelete(id) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
$.post("/platform/clubPreAudit/manage/doDelete", { id }).then(res => {
if (res.code === 0) {
this.$message({
type: "success",
message: "删除成功!"
})
this.pageData()
}
})
})
},
doSubmit(flag) {
this.$refs.form.validate(async (valid) => {
if (valid) {
this.$confirm("确定要" + (flag ? "提交" : "保存") + "吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.formLoading = true
$.post("/platform/clubPreAudit/manage/doSubmit", {
preAudit: JSON.stringify(this.formData),
flag: flag
}).then(res => {
if (res.code === 0) {
this.$message({
type: "success",
message: "操作成功!"
})
this.dialogVisible = false
this.pageData()
}
this.formLoading = false
})
})
}
})
}
},
async created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,258 @@
<!--#
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>
<!--#
}
#-->