✨ 多业务接入MK审核流,提交改传bizId并由后端生成表单实例
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -151,14 +151,20 @@
|
||||
>提交</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="hasPermission('invoice_application_view') && row.approvalStatus !== 'draft'"
|
||||
v-if="
|
||||
mkEnabled &&
|
||||
hasPermission('invoice_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="openFlow(row)"
|
||||
@click="handleMkAudit(row)"
|
||||
>流程</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('invoice_application_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('invoice_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleApprove(row)"
|
||||
@@ -166,7 +172,9 @@
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('invoice_application_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('invoice_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="danger"
|
||||
@click="handleReturn(row)"
|
||||
@@ -197,42 +205,6 @@
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程" width="900px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="开票申请单号">
|
||||
{{ flowDialog.row.applicationNo || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
{{ flowDialog.row.approvalStatusName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前节点">
|
||||
{{ flowDialog.row.currentNode || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前处理人">
|
||||
{{ flowDialog.row.currentProcessor || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table
|
||||
v-loading="flowDialog.loading"
|
||||
:data="flowDialog.records"
|
||||
border
|
||||
class="invoice-page__flow-table"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column prop="actionName" label="操作" min-width="110" align="center" />
|
||||
<el-table-column label="原状态" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ statusName(row.fromStatus) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="新状态" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ statusName(row.toStatus) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operatorName" label="操作人" min-width="110" align="center" />
|
||||
<el-table-column prop="createTime" label="操作时间" min-width="170" align="center" />
|
||||
<el-table-column prop="reason" label="原因" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="kingdeeBillNo" label="金蝶单据号" min-width="150" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -244,6 +216,8 @@ import * as api from '@/api/payment/invoiceApplication';
|
||||
import * as formalSettlementApi from '@/api/settlement/formalSettlement';
|
||||
import { invoiceApplicationTableColumns } from '@/option/payment/invoiceApplication';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
applicationNo: '',
|
||||
@@ -271,7 +245,7 @@ export default {
|
||||
selection: [],
|
||||
loading: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
flowDialog: { visible: false, loading: false, row: {}, records: [] },
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -280,6 +254,13 @@ export default {
|
||||
mounted() {
|
||||
this.loadOrganizationOptions();
|
||||
this.loadTable();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -356,19 +337,6 @@ export default {
|
||||
this.$message.error('正式结算单详情加载失败');
|
||||
}
|
||||
},
|
||||
async openFlow(row) {
|
||||
this.flowDialog.row = { ...row };
|
||||
this.flowDialog.records = [];
|
||||
this.flowDialog.visible = true;
|
||||
this.flowDialog.loading = true;
|
||||
try {
|
||||
const detail = this.unwrapData(await api.getDetail(row.id));
|
||||
this.flowDialog.row = { ...row, ...detail };
|
||||
this.flowDialog.records = detail.records || [];
|
||||
} finally {
|
||||
this.flowDialog.loading = false;
|
||||
}
|
||||
},
|
||||
async handleDelete(row) {
|
||||
await this.$confirm('确认删除该开票申请?', '提示', { type: 'warning' });
|
||||
await api.remove(row.id);
|
||||
@@ -377,9 +345,33 @@ export default {
|
||||
},
|
||||
async handleSubmit(row) {
|
||||
await api.submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'invoice-application',
|
||||
bizId: row.id,
|
||||
subjectName: row.applicationNo || '',
|
||||
approvalStatus: row.approvalStatus || '',
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.loadTable();
|
||||
},
|
||||
handleMkAudit(row) {
|
||||
if (!row?.id) {
|
||||
this.$message.warning('开票申请ID为空,无法打开审核页');
|
||||
return;
|
||||
}
|
||||
getMKApprovalUrl({ bizId: String(row.id) })
|
||||
.then(res => {
|
||||
const url = res?.data?.data;
|
||||
if (!url) {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
return;
|
||||
}
|
||||
window.open(url, '_blank');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
});
|
||||
},
|
||||
async handleApprove(row) {
|
||||
await this.$confirm('确认审批通过该开票申请?', '提示', { type: 'warning' });
|
||||
await api.approve({ id: row.id });
|
||||
@@ -436,19 +428,6 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
statusName(status) {
|
||||
return (
|
||||
{
|
||||
draft: '草稿',
|
||||
reviewing: '审批中',
|
||||
approved: '审批通过',
|
||||
returned: '已驳回',
|
||||
voided: '已作废',
|
||||
}[status] ||
|
||||
status ||
|
||||
'-'
|
||||
);
|
||||
},
|
||||
displayValue(value) {
|
||||
return value === null || value === undefined || value === '' ? '-' : value;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user