✨ 多业务接入MK审核流,提交改传bizId并由后端生成表单实例
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -134,6 +134,7 @@ export default {
|
||||
loading: { type: Boolean, default: false },
|
||||
page: { type: Object, required: true },
|
||||
hasPermission: { type: Function, required: true },
|
||||
mkEnabled: { type: Boolean, default: false },
|
||||
},
|
||||
emits: [
|
||||
'create',
|
||||
@@ -193,7 +194,10 @@ export default {
|
||||
actions.push({ type: 'delete', label: '删除', danger: true });
|
||||
if (this.hasPermission('formal_settlement_submit') && this.isEditable(row))
|
||||
actions.push({ type: 'submit', label: '提交' });
|
||||
if (this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
if (this.mkEnabled && this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
actions.push({ type: 'mkAudit', label: '流程' });
|
||||
}
|
||||
if (!this.mkEnabled && this.hasPermission('formal_settlement_approve') && row.approvalStatus === 'reviewing') {
|
||||
actions.push({ type: 'approve', label: '通过' });
|
||||
actions.push({ type: 'return', label: '驳回', danger: true });
|
||||
}
|
||||
|
||||
@@ -1604,7 +1604,7 @@ export default {
|
||||
await submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'pre-settlement',
|
||||
formInstanceId: this.form.id,
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.preSettlementNo || this.form.contractName || '',
|
||||
approvalStatus: this.form.approvalStatus || '',
|
||||
});
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
:loading="loading"
|
||||
:page="page"
|
||||
:has-permission="hasPermissionFn"
|
||||
:mk-enabled="mkEnabled"
|
||||
@create="openCreate"
|
||||
@payment="openPaymentDialog"
|
||||
@sync="handleSync"
|
||||
@@ -82,6 +83,7 @@
|
||||
:loading="loading"
|
||||
:page="page"
|
||||
:has-permission="hasPermissionFn"
|
||||
:mk-enabled="mkEnabled"
|
||||
@create="openCreate"
|
||||
@payment="openPaymentDialog"
|
||||
@sync="handleSync"
|
||||
@@ -182,7 +184,8 @@ import organizationSearch from '@/mixins/organization-search';
|
||||
import { formalSettlementTableColumns } from '@/option/settlement/formalSettlementTable';
|
||||
import FormalSettlementEditor from './components/formal-settlement-editor.vue';
|
||||
import FormalSettlementTablePanel from './components/formal-settlement-table-panel.vue';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import { submitMkApprovalFlow, loadMkEnabled } from '@/utils/mk-approval';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
formalSettlementNo: '',
|
||||
@@ -224,6 +227,7 @@ export default {
|
||||
rows: [],
|
||||
form: { appliedAmount: 0, remark: '' },
|
||||
},
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -247,6 +251,13 @@ export default {
|
||||
this.loadOrganizationOptions();
|
||||
this.loadTable();
|
||||
this.openRouteDetail();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -290,6 +301,7 @@ export default {
|
||||
edit: () => this.openEdit(row),
|
||||
delete: () => this.handleDelete(row),
|
||||
submit: () => this.handleSubmit(row),
|
||||
mkAudit: () => this.handleMkAudit(row),
|
||||
approve: () => this.handleApprove(row),
|
||||
return: () => this.handleReturn(row),
|
||||
void: () => this.handleVoid(row),
|
||||
@@ -340,13 +352,31 @@ export default {
|
||||
await api.submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'formal-settlement',
|
||||
formInstanceId: row.id,
|
||||
bizId: row.id,
|
||||
subjectName: row.formalSettlementNo || '',
|
||||
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(
|
||||
'审核通过后正式结算生效,金额只能通过结算调整单处理,确认通过?',
|
||||
|
||||
@@ -172,21 +172,43 @@
|
||||
删除
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="hasPermission('pre_settlement_view') && row.approvalStatus !== 'draft'"
|
||||
v-if="
|
||||
hasPermission('pre_settlement_submit') &&
|
||||
['draft', 'returned'].includes(row.approvalStatus)
|
||||
"
|
||||
type="primary"
|
||||
@click="openFlow(row)"
|
||||
@click="handleSubmit(row)"
|
||||
>
|
||||
提交
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="
|
||||
mkEnabled &&
|
||||
hasPermission('pre_settlement_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleMkAudit(row)"
|
||||
>
|
||||
流程
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="hasPermission('pre_settlement_approve') && row.approvalStatus === 'reviewing'"
|
||||
v-if="
|
||||
!mkEnabled &&
|
||||
hasPermission('pre_settlement_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleApprove(row)"
|
||||
>
|
||||
通过
|
||||
</el-link>
|
||||
<el-link
|
||||
v-if="hasPermission('pre_settlement_approve') && row.approvalStatus === 'reviewing'"
|
||||
v-if="
|
||||
!mkEnabled &&
|
||||
hasPermission('pre_settlement_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="danger"
|
||||
@click="handleReturn(row)"
|
||||
>
|
||||
@@ -259,23 +281,6 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程" width="620px" append-to-body>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="预结算单号">
|
||||
{{ flowDialog.row.preSettlementNo || '-' }}
|
||||
</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-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -290,6 +295,7 @@ import {
|
||||
getPrintTemplates,
|
||||
remove,
|
||||
returnBill,
|
||||
submit,
|
||||
voidBill,
|
||||
} from '@/api/settlement/preSettlement';
|
||||
import { preSettlementSearchFields } from '@/option/settlement/preSettlementSearch';
|
||||
@@ -297,6 +303,8 @@ import organizationSearch from '@/mixins/organization-search';
|
||||
import { preSettlementTableColumns } from '@/option/settlement/preSettlementTable';
|
||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||
import { downloadFile } from '@/utils/util';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import PreSettlementEditor from './components/pre-settlement-editor.vue';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
@@ -345,10 +353,7 @@ export default {
|
||||
templates: [],
|
||||
template: '',
|
||||
},
|
||||
flowDialog: {
|
||||
visible: false,
|
||||
row: {},
|
||||
},
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -372,6 +377,13 @@ export default {
|
||||
this.loadOrganizationOptions();
|
||||
this.loadTable();
|
||||
this.openRouteDetail();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -628,9 +640,34 @@ export default {
|
||||
const { data } = await exportList(params);
|
||||
downloadFile(data, `预结算单${this.$dayjs().format('YYYY-MM-DD HH-mm-ss')}.xlsx`);
|
||||
},
|
||||
openFlow(row) {
|
||||
this.flowDialog.row = row;
|
||||
this.flowDialog.visible = true;
|
||||
async handleSubmit(row) {
|
||||
await submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'pre-settlement',
|
||||
bizId: row.id,
|
||||
subjectName: row.preSettlementNo || '',
|
||||
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' });
|
||||
|
||||
Reference in New Issue
Block a user