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;