|
|
|
@ -28,11 +28,9 @@ |
|
|
|
<div class="info-row"> |
|
|
|
<span class="info-label">执法人员</span> |
|
|
|
<div class="info-value enforcer-value"> |
|
|
|
<div> |
|
|
|
{{ detail.lawEnforcerDisplay }} |
|
|
|
</div> |
|
|
|
<div v-for="(item, index) in detail.lawEnforcer2List" :key="index"> |
|
|
|
{{ item }} |
|
|
|
<div v-for="(person, index) in getEnforcers(detail)" :key="index" class="enforcer-item"> |
|
|
|
<span class="enforcer-name">{{ person.name }}</span> |
|
|
|
<span class="enforcer-phone">{{ person.phone }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -282,19 +280,33 @@ const pickFirst = (obj, keys, fallback = '') => { |
|
|
|
return fallback; |
|
|
|
}; |
|
|
|
|
|
|
|
// 解析执法人员 |
|
|
|
const parseEnforcers = (data) => { |
|
|
|
// 解析执法人员(支持逗号分隔的多人) |
|
|
|
const getEnforcers = (data) => { |
|
|
|
const list = []; |
|
|
|
if (data.lawEnforcer) list.push({ name: data.lawEnforcer, phone: data.lawEnforcerId || '' }); |
|
|
|
if (data.lawEnforcerTwo) list.push({ name: data.lawEnforcerTwo, phone: data.lawEnforcerIdTwo || '' }); |
|
|
|
const raw = data.enforcers || data.enforcerList || []; |
|
|
|
// 第一名执法人员 |
|
|
|
if (data.lawEnforcer) { |
|
|
|
list.push({ name: data.lawEnforcer, phone: data.lawEnforcerId || '' }); |
|
|
|
} |
|
|
|
// 第二名及之后:lawEnforcerTwo 和 lawEnforcerIdTwo 均为逗号分隔字符串 |
|
|
|
if (data.lawEnforcerTwo) { |
|
|
|
const names = String(data.lawEnforcerTwo).split(','); |
|
|
|
const phones = data.lawEnforcerIdTwo ? String(data.lawEnforcerIdTwo).split(',') : []; |
|
|
|
names.forEach((name, i) => { |
|
|
|
const trimmed = name.trim(); |
|
|
|
if (trimmed) list.push({ name: trimmed, phone: phones[i] ? phones[i].trim() : '' }); |
|
|
|
}); |
|
|
|
} |
|
|
|
// 数组形式(兼容其他字段名) |
|
|
|
const raw = data.enforcers || data.enforcerList || data.lawEnforcer2List || []; |
|
|
|
if (Array.isArray(raw) && raw.length) { |
|
|
|
raw.forEach(p => { |
|
|
|
if (typeof p === 'string') list.push({ name: p, phone: '' }); |
|
|
|
else list.push({ |
|
|
|
name: p.name || p.userName || p.realName || '', |
|
|
|
phone: p.phone || p.mobile || p.tel || '' |
|
|
|
}); |
|
|
|
if (typeof p === 'string') { |
|
|
|
list.push({ name: p, phone: '' }); |
|
|
|
} else { |
|
|
|
const name = p.name || p.userName || p.realName || ''; |
|
|
|
const phone = p.phone || p.mobile || p.tel || ''; |
|
|
|
if (name) list.push({ name, phone }); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return list.filter(p => p.name); |
|
|
|
@ -526,6 +538,24 @@ const onSubmit = () => { |
|
|
|
.enforcer-value { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
gap: 4px; |
|
|
|
} |
|
|
|
|
|
|
|
.enforcer-item { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
gap: 8px; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 1.6; |
|
|
|
|
|
|
|
.enforcer-name { |
|
|
|
color: #666; |
|
|
|
font-weight: 500; |
|
|
|
} |
|
|
|
|
|
|
|
.enforcer-phone { |
|
|
|
color: #999; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.result-row { |
|
|
|
|