Merge remote-tracking branch 'origin/main'

This commit is contained in:
@jyuhsin
2025-09-16 19:35:14 +08:00
13 changed files with 211 additions and 41 deletions
@@ -52,14 +52,18 @@ public class OutlayManageUnionController {
@At
@ApiOperation("分页查询")
@SaCheckPermission("outlay.outlayManage.union.manage")
public Result pageData(PageForm pageForm, Integer year) {
public Result pageData(PageForm pageForm,
Integer year,
String unionId) {
Cnd cnd = Cnd.NEW();
Sql sql = Sqls.create("""
SELECT * FROM `outlay_manage_union` $condition
""");
cnd.andEX("year", "=", year);
if (!AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.andEX("unionId", "=", SecurityUtil.getUnionId());
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
cnd.andEX("unionId", "=", unionId);
} else {
cnd.and("unionId", "=", SecurityUtil.getUnionId());
}
cnd.asc("unionCode");
sql.setCondition(cnd);
@@ -105,8 +105,11 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor {
}
}
else {
// 处理未知的经费来源类型
throw new BaseException("不支持的经费来源类型: " + reimburseFundSource);
if (reimburseFundSource == null) {
throw new BaseException("经费来源类型不能为空");
} else {
throw new BaseException("不支持的经费来源类型: " + reimburseFundSource);
}
}
}
@@ -20,6 +20,18 @@ layout("/layouts/platform.html"){
value-format="yyyy">
</el-date-picker>
</search-item>
<search-item label="所属工会" v-if="$auth.hasRoleOr(['SYSADMIN', 'SCHOOL_UNION_ADMIN'])">
<el-select placeholder="请选择所属工会" v-model="pageForm.unionId"
style="width: 100%;"
clearable
@change="doSearch"
filterable>
<el-option v-for="item in unions"
:label="item.name"
:key="item.id"
:value="item.id"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never" class="mt10">
@@ -102,7 +114,8 @@ layout("/layouts/platform.html"){
pageForm: {
year: this.$moment().format("YYYY")
},
isAllocation: false
isAllocation: false,
unions: []
}
},
components: {},
@@ -170,6 +183,7 @@ layout("/layouts/platform.html"){
}
},
async created() {
this.unions = await this.$businessTool.listUnion()
this.getIsAllocation()
this.pageData()
}
@@ -555,7 +555,7 @@ layout("/layouts/platform.html"){
this.queryCondolenceType()
this.init()
//社团查询
this.$businessTool.listClub().then((res) => (this.clubOptions = res))
this.$businessTool.listCLubByRole().then((res) => (this.clubOptions = res))
}
})
</script>
@@ -60,7 +60,7 @@ layout("/layouts/platform.html"){
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #edit>
<info ref="infoRef">
<div v-if="showApprovalForm">
@@ -83,7 +83,7 @@ layout("/layouts/platform.html"){
</div>
</info>
</template>
</guava>
</div>
<script>
@@ -107,10 +107,10 @@ layout("/layouts/platform.html"){
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true },
{ prop: "sign", label: "签字" },
{ prop: "taskName", label: "当前节点" },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
// 审核相关
showApprovalForm: false,
formData: {
@@ -23,7 +23,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="工号">{{row.loginName}}</table-column>
<table-column label="申请模式">{{row.mode ? '加入' : '退出'}}</table-column>
<table-column label="申请时间">{{row.applyDate}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -26,6 +26,7 @@ layout("/layouts/platform_h5.html"){
:value="row.registrationType"></dict-tag>
</table-column>
<table-column label="填报时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -34,6 +34,7 @@ layout("/layouts/platform_h5.html"){
:value="row.registrationType"></dict-tag>
</table-column>
<table-column label="填报时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -79,7 +80,7 @@ layout("/layouts/platform_h5.html"){
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
@@ -36,6 +36,7 @@ layout("/layouts/platform_h5.html"){
:value="row.registrationType"></dict-tag>
</table-column>
<table-column label="填报时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -81,7 +82,7 @@ layout("/layouts/platform_h5.html"){
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
@@ -24,7 +24,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请选择报销类别"
@click="showReimburseTypePicker = true"
clickable
:rules="[{ required: true }]"
required
></van-field>
<van-popup position="bottom" round v-model:show="showReimburseTypePicker">
@@ -41,7 +40,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请选择支付方式"
@click="showPaymentWayPicker = true"
clickable
:rules="[{ required: true }]"
required
></van-field>
<van-popup position="bottom" round v-model:show="showPaymentWayPicker">
@@ -58,7 +56,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请选择报销项目"
@click="showReimburseProjectPicker = true"
clickable
:rules="[{ required: true }]"
required
></van-field>
<van-popup position="bottom" round v-model:show="showReimburseProjectPicker">
@@ -75,7 +72,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请选择报销经费来源"
@click="showReimburseFundSourcePicker = true"
clickable
:rules="[{ required: true }]"
required
></van-field>
<van-popup position="bottom" round v-model:show="showReimburseFundSourcePicker">
@@ -95,6 +91,7 @@ layout("/layouts/platform_h5.html"){
readonly
@click="showClubPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showClubPicker">
<van-picker :columns="clubColumns" @cancel="showClubPicker = false" @confirm="onClubConfirm"
@@ -108,23 +105,21 @@ layout("/layouts/platform_h5.html"){
<van-field label="户名"
v-model="formData.bankUserName"
placeholder="请输入户名"
:rules="[{ required: true }]"
required>
required
>
</van-field>
<van-field label="银行账号"
v-model="formData.bankCardNumber"
placeholder="请输入银行账号"
:rules="[{ required: true }]"
required>
required
>
</van-field>
<van-field label="开户行"
v-model="formData.bankOfDeposit"
placeholder="请输入开户行"
:rules="[{ required: true }]"
required>
required
>
</van-field>
<!-- 将原有的慰问对象字段替换为以下代码 -->
@@ -136,6 +131,7 @@ layout("/layouts/platform_h5.html"){
readonly
@click="showCondolenceSearch = true"
clickable
required
></van-field>
<!-- 添加搜索弹窗 -->
@@ -178,6 +174,7 @@ layout("/layouts/platform_h5.html"){
placeholder="请选择慰问类型"
@click="showCondolenceTypePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showCondolenceTypePicker">
<van-picker :columns="condolenceTypeColumns" @cancel="showCondolenceTypePicker = false"
@@ -194,7 +191,6 @@ layout("/layouts/platform_h5.html"){
readonly
@click="showCondolenceTimePicker = true"
clickable
:rules="[{ required: true }]"
required
></van-field>
<van-popup position="bottom" round v-model:show="showCondolenceTimePicker">
@@ -210,8 +206,11 @@ layout("/layouts/platform_h5.html"){
</template>
<!-- 活动相关字段 (当报销项目不为慰问时显示) -->
<template v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">
<van-field label="活动名称" v-model="formData.activityName"
placeholder="请输入活动名称"></van-field>
<van-field label="活动名称"
v-model="formData.activityName"
placeholder="请输入活动名称"
required
></van-field>
<!-- 活动类型 (当报销项目为活动时显示) -->
<van-field
@@ -222,6 +221,7 @@ layout("/layouts/platform_h5.html"){
readonly
@click="showActivityTypePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showActivityTypePicker">
<van-picker :columns="activityTypeColumns" @cancel="showActivityTypePicker = false"
@@ -235,12 +235,13 @@ layout("/layouts/platform_h5.html"){
v-model="formData.activityNumber"
placeholder="请输入活动人数"
type="number"
required
></van-field>
<van-field label="活动地点" v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'"
v-model="formData.activityPlace" placeholder="请输入活动地点"></van-field>
v-model="formData.activityPlace" placeholder="请输入活动地点" required></van-field>
<van-field label="报销金额" v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'"
v-model="formData.money" placeholder="请输入报销金额" type="number"></van-field>
v-model="formData.money" placeholder="请输入报销金额" type="number" required></van-field>
<van-field
label="活动时间"
v-if="formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'"
@@ -249,6 +250,7 @@ layout("/layouts/platform_h5.html"){
readonly
@click="showActivityTimePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showActivityTimePicker">
<van-datetime-picker
@@ -268,16 +270,14 @@ layout("/layouts/platform_h5.html"){
v-model="formData.invoiceNumber"
placeholder="请输入发票张数"
type="number"
:rules="[{ required: true }]"
required
>
</van-field>
<van-field label="发票号码"
v-model="formData.invoice"
placeholder="请填写发票号码,如有多个请用逗号分隔"
:rules="[{ required: true }]"
required>
required
>
</van-field>
</template>
@@ -288,7 +288,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请填写支付内容"
type="textarea"
autosize
:rules="[{ required: true }]"
required
></van-field>
@@ -477,6 +476,10 @@ layout("/layouts/platform_h5.html"){
},
// 提交
async onSubmit() {
// 自定义验证
if (!this.validateForm()) {
return;
}
// 余额校验
if (this.formData.money && this.formData.fundBalance) {
const balance = parseFloat(this.formData.fundBalance);
@@ -503,6 +506,10 @@ layout("/layouts/platform_h5.html"){
},
// 再次提交
async onSubmitAgain() {
// 自定义验证
if (!this.validateForm()) {
return;
}
// 余额校验
if (this.formData.money && this.formData.fundBalance) {
const balance = parseFloat(this.formData.fundBalance);
@@ -530,6 +537,145 @@ layout("/layouts/platform_h5.html"){
this.$toast.fail('网络错误,请稍后重试');
});
},
// 自定义表单验证方法
validateForm() {
// 按照表单字段出现顺序进行验证
// 经办人信息(只读,不验证)
// 报销类别
if (!this.formData.reimburseType) {
this.$toast.fail("请选择报销类别");
return false;
}
// 支付方式
if (!this.formData.paymentWay) {
this.$toast.fail("请选择支付方式");
return false;
}
// 报销项目
if (!this.formData.reimburseProject) {
this.$toast.fail("请选择报销项目");
return false;
}
// 报销经费来源
if (!this.formData.reimburseFundSource) {
this.$toast.fail("请选择报销经费来源");
return false;
}
// 联系方式
// (非必填,不验证)
// 所属社团(条件显示)
if (this.formData.reimburseFundSource === 'UNION_REIMBURSE_FUND_SOURCE_3') {
if (!this.formData.clubId) {
this.$toast.fail("请选择所属社团");
return false;
}
}
// 银行信息
if (!this.formData.bankUserName) {
this.$toast.fail("请填写户名");
return false;
}
if (!this.formData.bankCardNumber) {
this.$toast.fail("请填写银行账号");
return false;
}
if (!this.formData.bankOfDeposit) {
this.$toast.fail("请填写开户行");
return false;
}
// 慰问相关字段
if (this.formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1') {
if (!this.formData.condolenceName) {
this.$toast.fail("请选择慰问对象");
return false;
}
if (!this.formData.condolenceMobile) {
this.$toast.fail("请填写慰问对象联系方式");
return false;
}
if (!this.formData.condolenceType) {
this.$toast.fail("请选择慰问类型");
return false;
}
if (!this.formData.condolenceTime) {
this.$toast.fail("请选择慰问时间");
return false;
}
if (!this.formData.money) {
this.$toast.fail("慰问金额不能为空");
return false;
}
}
// 活动相关字段
if (this.formData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1') {
if (!this.formData.activityName) {
this.$toast.fail("请填写活动名称");
return false;
}
// 活动类型(条件显示)
if (this.formData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2') {
if (!this.formData.activityType) {
this.$toast.fail("请选择活动类型");
return false;
}
if (!this.formData.activityNumber) {
this.$toast.fail("请填写活动人数");
return false;
}
}
if (!this.formData.activityPlace) {
this.$toast.fail("请填写活动地点");
return false;
}
if (!this.formData.activityTime) {
this.$toast.fail("请选择活动时间");
return false;
}
if (!this.formData.money) {
this.$toast.fail("请填写报销金额");
return false;
}
}
// 发票相关字段
if (this.formData.reimburseType === 'UNION_REIMBURSE_TYPE_1') {
if (!this.formData.invoiceNumber) {
this.$toast.fail("请填写发票张数");
return false;
}
if (!this.formData.invoice) {
this.$toast.fail("请填写发票号码");
return false;
}
}
// 支付内容
if (!this.formData.paymentNotes) {
this.$toast.fail("请填写支付内容");
return false;
}
// 附件(非必填,不验证)
return true;
}
,
onReimburseTypeConfirm(o) {
this.$set(this.formData, "reimburseTypeName", o.text); // 显示名称
this.$set(this.formData, "reimburseType", o.value); // 字典值
@@ -674,7 +820,7 @@ layout("/layouts/platform_h5.html"){
// 查询社团
queryClubs() {
this.$businessTool.listClub().then((res) => {
this.$businessTool.listCLubByRole().then((res) => {
this.clubOptions = res;
this.clubColumns = res.map(item => {
return {text: item.clubName, value: item.id}
@@ -28,7 +28,7 @@ layout("/layouts/platform_h5.html"){
</dict-tag>
</table-column>
<table-column label="金额">{{row.money}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -38,7 +38,7 @@ layout("/layouts/platform_h5.html"){
</dict-tag>
</table-column>
<table-column label="金额">{{row.money}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
@@ -80,7 +80,7 @@ layout("/layouts/platform_h5.html"){
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
@@ -237,7 +237,7 @@ layout("/layouts/platform_h5.html"){
<div style="display: flex; justify-content: space-between; column-gap: 10px; padding: 10px">
<van-button block type="primary" @click.submit="onSave">保存</van-button>
<van-button v-if="!taskId" block type="primary" @click.submit="onSubmit">提交</van-button>
<van-button v-else block type="primary" @click.submit="onFinishTask">提交</van-button>
<van-button v-else block type="primary" @click.submit="onFinishTask">提交1</van-button>
</div>
</van-form>
</div>