From 98c7935c40ec5f697b678f684f8d6ab6d5d52098 Mon Sep 17 00:00:00 2001 From: weizong song Date: Wed, 27 May 2026 15:09:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E6=94=AF=E4=BB=98=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=94=AF=E4=BB=98=E4=BF=A1=E6=81=AF=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/flow/create.vue | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/views/flow/create.vue b/src/views/flow/create.vue index 960540a..aac1874 100644 --- a/src/views/flow/create.vue +++ b/src/views/flow/create.vue @@ -35,7 +35,7 @@ v-loading="loadingPayments" >
- 关联的支付信息 + {{ relatedPaymentPanelTitle }} 共 {{ relatedPayments.length }} 条 @@ -1222,11 +1222,22 @@ export default { const p = payment || {}; return p?.fields?.[el.id]; }, + isCurrentPaymentMainApprovalFlow(el, payment) { + if (!el || el.type !== 'approval_flow' || !el.is_main_approval_process) { + return false; + } + const currentFlowId = this.normalizeFlowId(this.$route.query.flow_id); + const paymentFlowId = this.normalizeFlowId(this.getPaymentTemplateElementValue(el, payment)); + return !!currentFlowId && !!paymentFlowId && currentFlowId === paymentFlowId; + }, getVisiblePaymentTemplateElements(payment) { const p = payment || {}; const list = Array.isArray(this.paymentTemplateElements) ? this.paymentTemplateElements : []; return list.filter(el => { const val = this.getPaymentTemplateElementValue(el, p); + if (this.isCurrentPaymentMainApprovalFlow(el, p)) { + return false; + } if (el.type === 'checklist') { const options = this.getPaymentChecklistOptions(el); const anyChecked = (options || []).some(opt => this.isChecklistChecked(val, opt.value)); @@ -2288,7 +2299,10 @@ export default { try { // request.js 成功时会直接返回 res.data;兼容旧接口单对象和新接口数组。 const result = await getPaymentsByFlowId(this.$route.query.flow_id, { all: true }) - const payments = Array.isArray(result) ? result : (result ? [result] : []) + const rawPayments = Array.isArray(result) + ? result + : (Array.isArray(result?.data) ? result.data : (result ? [result] : [])) + const payments = rawPayments.filter(payment => payment && payment.id) if (payments.length > 0) { // 兼容 breadcrumb 为字符串或数组 payments.forEach((payment) => { @@ -2857,6 +2871,13 @@ export default { node() { return this.config?.currentNode || {}; }, + relatedPaymentPanelTitle() { + const currentFlowId = this.normalizeFlowId(this.$route.query.flow_id); + const isCurrentFlowPayment = currentFlowId && this.relatedPayments.some(payment => { + return this.normalizeFlowId(payment?.oa_flow_id) === currentFlowId; + }); + return isCurrentFlowPayment ? '当前流程对应的支付单信息' : '关联的支付信息'; + }, scriptContent() { if (this.config?.customModel?.view_js && this.$route.query.flow_id && /\/detail/.test(this.$route.path)) { return this.config?.customModel?.view_js;