主支付流程关联支付信息判断修改

master
weizong song 1 week ago
parent 00b4687091
commit 98c7935c40

@ -35,7 +35,7 @@
v-loading="loadingPayments"
>
<div slot="header" class="clearfix">
<span style="font-weight: bold;">关联的支付信息</span>
<span style="font-weight: bold;">{{ relatedPaymentPanelTitle }}</span>
<span v-if="relatedPayments.length > 0" style="float: right; color: #909399; font-size: 12px;">
{{ relatedPayments.length }}
</span>
@ -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;

Loading…
Cancel
Save