weizong song 3 months ago
parent 7f2e8e9c56
commit 58cb6e913e

@ -1444,9 +1444,20 @@ export default function formBuilder(
) { ) {
isJointly = !!log.is_jointly_sign; isJointly = !!log.is_jointly_sign;
if (log.status > 0 && log.user) { if (log.status > 0 && log.user) {
// 对于 budget-source 类型字段,如果值是 JSON 格式,不显示原始 JSON
let displayValue = value.value;
if (info.type === 'budget-source' && displayValue) {
const strValue = String(displayValue);
// 如果是 JSON 字符串,不显示
if (strValue.trim().startsWith('{') || strValue.trim().startsWith('[')) {
displayValue = ''; // 不显示原始 JSON
} else if (typeof displayValue === 'object' || Array.isArray(displayValue)) {
displayValue = ''; // 不显示对象或数组
}
}
jointlySignContent.push( jointlySignContent.push(
h("div", [ h("div", [
h("span", value.value), h("span", displayValue),
h("br"), h("br"),
info.is_sign info.is_sign
? log.user?.sign_file?.url ? log.user?.sign_file?.url
@ -2657,9 +2668,20 @@ export default function formBuilder(
) { ) {
isJointly = !!log.is_jointly_sign; isJointly = !!log.is_jointly_sign;
if (log.status > 0 && log.user) { if (log.status > 0 && log.user) {
// 对于 budget-source 类型字段,如果值是 JSON 格式,不显示原始 JSON
let displayValue = value.value;
if (info.type === 'budget-source' && displayValue) {
const strValue = String(displayValue);
// 如果是 JSON 字符串,不显示
if (strValue.trim().startsWith('{') || strValue.trim().startsWith('[')) {
displayValue = ''; // 不显示原始 JSON
} else if (typeof displayValue === 'object' || Array.isArray(displayValue)) {
displayValue = ''; // 不显示对象或数组
}
}
jointlySignContent.push( jointlySignContent.push(
h("div", [ h("div", [
h("span", value.value), h("span", displayValue),
h("br"), h("br"),
info.is_sign info.is_sign
? log.user?.sign_file?.url ? log.user?.sign_file?.url

@ -228,7 +228,7 @@
<el-descriptions :column="1" border class="indirect-payment-descriptions"> <el-descriptions :column="1" border class="indirect-payment-descriptions">
<template v-for="f in getIndirectTemplateFields((indirectExpenditureMap[expId] && indirectExpenditureMap[expId].category_id))"> <template v-for="f in getIndirectTemplateFields((indirectExpenditureMap[expId] && indirectExpenditureMap[expId].category_id))">
<el-descriptions-item <el-descriptions-item
v-if="true" v-if="shouldRenderPlannedField(expId, f)"
:key="f.key || (f.element_id || f.label)" :key="f.key || (f.element_id || f.label)"
:label="f.label || f.name || '字段'" :label="f.label || f.name || '字段'"
> >
@ -929,6 +929,15 @@ export default {
return (field && (field.key || field.field_key)) ? (field.key || field.field_key) : ''; return (field && (field.key || field.field_key)) ? (field.key || field.field_key) : '';
}, },
// oa_custom_model/out_custom_model
shouldRenderPlannedField(expenditureId, field) {
if (!field) return false;
if (field.element_type === 'oa_custom_model' || field.element_type === 'out_custom_model') {
return this.getOaCustomModelBindings(expenditureId, field).length > 0;
}
return true;
},
normalizeFlowId(val) { normalizeFlowId(val) {
if (val === null || val === undefined || val === '') return null; if (val === null || val === undefined || val === '') return null;
const s = String(val).trim(); const s = String(val).trim();

Loading…
Cancel
Save