From 07aab8bb335132d5dc56f2b000301457079e8539 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 29 九月 2026 10:49:01 +0800
Subject: [PATCH] feat(research): 完善经费拨付流程支持财务报销审批
---
src/views/research/application/modules/fund-form.vue | 49 ++++++++++++++++++++++++-------------------------
1 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/src/views/research/application/modules/fund-form.vue b/src/views/research/application/modules/fund-form.vue
index 33b2be5..107af50 100644
--- a/src/views/research/application/modules/fund-form.vue
+++ b/src/views/research/application/modules/fund-form.vue
@@ -3,9 +3,6 @@
import { computed, ref } from 'vue';
-import { DICT_TYPE } from '@vben/constants';
-import { getDictOptions } from '@vben/hooks';
-
import { useVbenModal } from '@vben/common-ui';
import { Alert, message } from 'ant-design-vue';
@@ -22,6 +19,8 @@
const isEdit = ref(false);
/** 鐢宠缁忚垂鍑忓幓宸茬櫥璁版嫧浠橀噾棰濆悗鐨勫彲鐢ㄤ綑棰� */
const remainder = ref<number>();
+/** 缂栬緫銆屽凡椹冲洖銆嶈褰曟椂灞曠ず鐨勮储鍔¢┏鍥炲師鍥� */
+const rejectReason = ref('');
const alertMessage = computed(() => {
if (remainder.value === undefined) {
@@ -98,17 +97,6 @@
},
},
{
- fieldName: 'status',
- label: '鎷ㄤ粯鐘舵��',
- component: 'Select',
- componentProps: {
- options: getDictOptions(DICT_TYPE.RESEARCH_FUND_STATUS, 'number'),
- placeholder: '璇烽�夋嫨鎷ㄤ粯鐘舵��',
- },
- rules: 'selectRequired',
- help: '閫夋嫨銆屽凡鎷ㄤ粯銆嶆椂蹇呴』涓婁紶鎷ㄤ粯鍑瘉闄勪欢',
- },
- {
fieldName: 'remark',
label: '澶囨敞',
component: 'Textarea',
@@ -128,6 +116,8 @@
multiple: true,
showDescription: true,
},
+ rules: 'required',
+ help: '蹇呭~锛氬嚟璇佸皢闅忚嚜鍔ㄧ敓鎴愮殑璐㈠姟鎶ラ攢鍗曚竴璧烽�佷氦璐㈠姟瀹℃壒',
formItemClass: 'col-span-2',
},
],
@@ -142,12 +132,9 @@
}
const values =
(await formApi.getValues()) as ResearchFundRecordApi.FundRecord;
- // 銆屽凡鎷ㄤ粯銆嶅繀椤绘湁鍑瘉锛屽厛鍦ㄥ墠绔嫤涓�閬擄紝閬垮厤鐢ㄦ埛鐧界瓑涓�娆¤姹�
- if (
- values.status === FundStatus.PAID &&
- (!values.blobIds || values.blobIds.length === 0)
- ) {
- message.warning('鎷ㄤ粯鐘舵�佷负銆屽凡鎷ㄤ粯銆嶆椂锛岃鍏堜笂浼犳嫧浠樺嚟璇侀檮浠�');
+ // 鍑瘉蹇呭~锛屽厛鍦ㄥ墠绔嫤涓�閬擄紝閬垮厤鐢ㄦ埛鐧界瓑涓�娆¤姹�
+ if (!values.blobIds || values.blobIds.length === 0) {
+ message.warning('璇峰厛涓婁紶鏈鎷ㄤ粯鍑瘉锛屽嚟璇佸皢闅忚储鍔℃姤閿�鍗曢�佷氦璐㈠姟瀹℃壒');
return;
}
modalApi.lock();
@@ -159,15 +146,16 @@
amount: values.amount,
payDate: values.payDate,
payee: values.payee,
- status: values.status,
remark: values.remark,
- blobIds: values.blobIds ?? [],
+ blobIds: values.blobIds,
} as ResearchFundRecordApi.FundRecord;
try {
await (data.id ? updateFundRecord(data) : createFundRecord(data));
await modalApi.close();
emit('success');
- message.success('淇濆瓨鎴愬姛');
+ message.success(
+ data.id ? '宸查噸鏂板彂璧疯储鍔℃姤閿�瀹℃壒' : '鐧昏鎴愬姛锛屽凡鑷姩鎻愪氦璐㈠姟鎶ラ攢瀹℃壒',
+ );
} finally {
modalApi.unlock();
}
@@ -176,6 +164,7 @@
if (!isOpen) {
isEdit.value = false;
remainder.value = undefined;
+ rejectReason.value = '';
return;
}
const data = modalApi.getData<{
@@ -185,6 +174,10 @@
}>();
isEdit.value = !!data.record;
remainder.value = data.remainder;
+ rejectReason.value =
+ data.record?.status === FundStatus.REJECTED
+ ? data.record.rejectReason || '璐㈠姟鏈~鍐欓┏鍥炲師鍥�'
+ : '';
await formApi.resetForm();
if (data.record) {
const blobIds = (data.record.attachmentList ?? []).map((item) => ({
@@ -206,7 +199,6 @@
await formApi.setValues(
{
applicationId: data.applicationId,
- status: FundStatus.PENDING,
},
false,
);
@@ -217,11 +209,18 @@
<template>
<Modal
- :title="isEdit ? '缂栬緫鎷ㄦ璁板綍' : '鐧昏鎷ㄦ璁板綍'"
+ :title="isEdit ? '淇敼骞堕噸鏂板彂璧锋姤閿�' : '鐧昏鎷ㄦ锛堢櫥璁板悗鑷姩鎻愪氦璐㈠姟鎶ラ攢瀹℃壒锛�'"
class="w-1/2"
:close-on-click-modal="false"
>
<Alert
+ v-if="rejectReason"
+ class="mx-3 mb-3"
+ type="error"
+ show-icon
+ :message="`璐㈠姟鎶ラ攢宸查┏鍥烇細${rejectReason}`"
+ />
+ <Alert
v-if="alertMessage"
class="mx-3 mb-3"
type="info"
--
Gitblit v1.9.3