✨ 多业务接入MK审核流,提交改传bizId并由后端生成表单实例

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-29 02:23:24 +08:00
parent 8b9c908237
commit 4641d0a5dd
28 changed files with 644 additions and 391 deletions
+26 -2
View File
@@ -78,7 +78,7 @@
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" :max-size="10" />
</section-card>
<div class="bill-payment-form-page__actions">
<div v-if="!isPublicViewPage" class="bill-payment-form-page__actions">
<template v-if="!readonly">
<el-button type="primary" :loading="saving" :disabled="submitting" @click="saveDraft">
保存
@@ -139,6 +139,8 @@ import { mapGetters } from 'vuex';
import * as api from '@/api/payment/billPayment';
import * as billLedgerApi from '@/api/payment/billLedger';
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
import { getMkPublicDetail } from '@/api/mk-process';
import { submitMkApprovalFlow } from '@/utils/mk-approval';
const emptyForm = () => ({
id: null,
@@ -194,7 +196,10 @@ export default {
return this.$route.query.id || '';
},
readonly() {
return this.$route.query.mode === 'view';
return this.$route.query.mode === 'view' || this.isPublicViewPage;
},
isPublicViewPage() {
return this.$route.path === '/payment/bill-payment/public-view';
},
},
created() {
@@ -215,6 +220,10 @@ export default {
}
},
async initialize() {
if (this.isPublicViewPage) {
await this.loadPublicDetail();
return;
}
if (this.recordId) {
const data = this.unwrapData(await api.getDetail(this.recordId));
this.form = {
@@ -228,6 +237,15 @@ export default {
this.form.deptName = this.userInfo?.deptName || this.userInfo?.dept_name || '';
this.form.paymentDate = this.$dayjs().format('YYYY-MM-DD');
},
async loadPublicDetail() {
if (!this.recordId) return;
const data = this.unwrapData(await getMkPublicDetail('bill-payment', this.recordId));
this.form = {
...emptyForm(),
...data,
attachments: this.parse(data.attachmentsJson),
};
},
validateUsedAmount(rule, value, callback) {
const amount = Number(value);
const balance = Number(this.form.availableBalance || 0);
@@ -324,6 +342,12 @@ export default {
const id = this.unwrapData(await api.save(this.payload()));
this.form.id = id;
await api.submit({ id: this.form.id });
await submitMkApprovalFlow({
bizType: 'bill-payment',
bizId: this.form.id,
subjectName: this.form.paymentNo || this.form.billNo || '',
approvalStatus: this.form.approvalStatus || '',
});
this.$message.success('提交成功');
this.goBack();
} finally {