✨ 多业务接入MK审核流,提交改传bizId并由后端生成表单实例
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -405,7 +405,7 @@
|
||||
</el-form-item>
|
||||
</section-card>
|
||||
|
||||
<div class="invoice-form-page__actions">
|
||||
<div v-if="!isPublicViewPage" class="invoice-form-page__actions">
|
||||
<el-button @click="goBack">取消</el-button>
|
||||
<el-button v-if="!readonly" type="primary" plain @click="syncReferenceData">同步</el-button>
|
||||
<el-button v-if="!readonly && canSave" type="primary" plain @click="saveDraft"
|
||||
@@ -491,6 +491,8 @@ import { getList as getReceivablePayableDetailList } from '@/api/settlement/rece
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
let localId = 0;
|
||||
const emptyLine = () => ({
|
||||
@@ -583,7 +585,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/invoice-application/public-view';
|
||||
},
|
||||
canSave() {
|
||||
const code = this.recordId ? 'invoice_application_edit' : 'invoice_application_add';
|
||||
@@ -655,6 +660,10 @@ export default {
|
||||
.filter(Boolean);
|
||||
},
|
||||
async initialize() {
|
||||
if (this.isPublicViewPage) {
|
||||
await this.loadPublicDetail();
|
||||
return;
|
||||
}
|
||||
await Promise.all([this.loadInvoiceItems(), this.loadTransportTypeOptions()]);
|
||||
const userInfo = this.$store.getters.userInfo || {};
|
||||
if (!this.recordId) {
|
||||
@@ -662,6 +671,21 @@ export default {
|
||||
return;
|
||||
}
|
||||
const data = this.unwrapData(await api.getDetail(this.recordId));
|
||||
this.applyDetail(data);
|
||||
if (this.settlementIds.length) {
|
||||
await Promise.all([this.loadReceiverInformation(), this.loadSettlementDetails(false)]);
|
||||
}
|
||||
if (this.readonly)
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
this.$nextTick(this.restoreDetailSelection);
|
||||
},
|
||||
async loadPublicDetail() {
|
||||
if (!this.recordId) return;
|
||||
const data = this.unwrapData(await getMkPublicDetail('invoice-application', this.recordId));
|
||||
this.applyDetail(data);
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
},
|
||||
applyDetail(data) {
|
||||
this.form = {
|
||||
...emptyForm(),
|
||||
...data,
|
||||
@@ -682,12 +706,6 @@ export default {
|
||||
sheet.lines.forEach(line => this.syncInvoiceItemLine(line, false))
|
||||
);
|
||||
this.selectedDetailIds = (data.details || []).map(item => item.formalSettlementDetailId);
|
||||
if (this.settlementIds.length) {
|
||||
await Promise.all([this.loadReceiverInformation(), this.loadSettlementDetails(false)]);
|
||||
}
|
||||
if (this.readonly)
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
this.$nextTick(this.restoreDetailSelection);
|
||||
},
|
||||
async loadInvoiceItems() {
|
||||
const data = this.unwrapData(await getInvoiceItems());
|
||||
@@ -1177,6 +1195,12 @@ export default {
|
||||
const saved = await this.saveDraft();
|
||||
if (!saved) return;
|
||||
await api.submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'invoice-application',
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.applicationNo || '',
|
||||
approvalStatus: this.form.approvalStatus || '',
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.goBack();
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user