Browse Source

入企人员

dev-V1.0.6
wangmingyong@163.com 3 months ago
parent
commit
b61e9fd3fc
  1. 2
      zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/NonEnforcementInfoSection.vue
  2. 5
      zdxt-web-client/zdxt-efcode-enforcement-app/src/util/util.js
  3. 45
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/components/HistoryActivityList.vue
  4. 1
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/law/lawServiceList.vue

2
zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/NonEnforcementInfoSection.vue

@ -19,7 +19,7 @@
<span class="enforcer-name" :class="{ placeholder: !person.name }"> <span class="enforcer-name" :class="{ placeholder: !person.name }">
{{ person.name || '请选择' }} {{ person.name || '请选择' }}
</span> </span>
<span v-if="person.id" class="enforcer-id">{{ person.id }}</span> <span v-if="person.phonenumber" class="enforcer-id">{{ person.phonenumber }}</span>
</div> </div>
<van-icon name="close" class="remove-icon" @click="$emit('removePerson', index)" /> <van-icon name="close" class="remove-icon" @click="$emit('removePerson', index)" />
</div> </div>

5
zdxt-web-client/zdxt-efcode-enforcement-app/src/util/util.js

@ -166,17 +166,18 @@ const getDeviceType = () =>{
* @returns {Array} - 格式化后的执法人员数组,每个元素为 "名字 - ID" 的格式 * @returns {Array} - 格式化后的执法人员数组,每个元素为 "名字 - ID" 的格式
*/ */
const formatEnforcer = (item) => { const formatEnforcer = (item) => {
console.log(item,'item')
const enforcers = []; const enforcers = [];
if (item.lawEnforcer) { if (item.lawEnforcer) {
const names = item.lawEnforcer.split(',').map(n => n.trim()).filter(n => n); const names = item.lawEnforcer.split(',').map(n => n.trim()).filter(n => n);
const ids = item.lawEnforcerId ? item.lawEnforcerId.split(',').map(id => id.trim()).filter(id => id) : []; const ids = item.lawEnforcerTel ? item.lawEnforcerTel.split(',').map(id => id.trim()).filter(id => id) : [];
names.forEach((name, index) => { names.forEach((name, index) => {
const id = ids[index] || ''; const id = ids[index] || '';
enforcers.push({ name, id }); enforcers.push({ name, id });
}); });
} }
const secondName = item.lawEnforcerTwo || item.lawEnforcerOther; const secondName = item.lawEnforcerTwo || item.lawEnforcerOther;
const secondId = item.lawEnforcerIdTwo || item.lawEnforcerIdOther; const secondId = item.lawEnforcerTelTwo || item.lawEnforcerIdOther;
if (secondName) { if (secondName) {
const names = secondName.split(',').map(n => n.trim()).filter(n => n); const names = secondName.split(',').map(n => n.trim()).filter(n => n);
const ids = secondId ? secondId.split(',').map(id => id.trim()).filter(id => id) : []; const ids = secondId ? secondId.split(',').map(id => id.trim()).filter(id => id) : [];

45
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/components/HistoryActivityList.vue

@ -32,9 +32,14 @@
</div> </div>
<div class="activity-row"> <div class="activity-row">
<div class="activity-label">入企人员:</div> <div class="activity-label">入企人员:</div>
<div> <div class="enforcer-list">
<div v-for="(enforcer, index) in formatEnforcer(item)" :key="index"> <div class="enforcer-line">
{{ enforcer }} <span class="enforcer-name">{{ parseEnforcer(item.lawEnforcer).name }}</span>
<span v-if="parseEnforcer(item.lawEnforcer).phone" class="enforcer-phone">{{ parseEnforcer(item.lawEnforcer).phone }}</span>
</div>
<div v-for="(enforcer, index) in item.lawEnforcerOtherList" :key="index" class="enforcer-line">
<span class="enforcer-name">{{ parseEnforcer(enforcer).name }}</span>
<span v-if="parseEnforcer(enforcer).phone" class="enforcer-phone">{{ parseEnforcer(enforcer).phone }}</span>
</div> </div>
</div> </div>
</div> </div>
@ -57,6 +62,18 @@ import { formattedDate, formatEnforcer } from '@/util/util.js';
const router = useRouter(); const router = useRouter();
// 解析执法人员字符串,提取名字和电话
// 输入: "白宁 19020811001" -> { name: "白宁", phone: "19020811001" }
// 输入: "白宁" -> { name: "白宁", phone: "" }
const parseEnforcer = (str) => {
if (!str) return { name: '', phone: '' };
const match = String(str).match(/^(.+?)\s+(\d{7,15})$/);
if (match) {
return { name: match[1].trim(), phone: match[2] };
}
return { name: String(str).trim(), phone: '' };
};
const props = defineProps({ const props = defineProps({
enterpriseName: { enterpriseName: {
type: String, type: String,
@ -264,6 +281,28 @@ fetchActivityList();
color: #323233; color: #323233;
white-space: nowrap; white-space: nowrap;
} }
.enforcer-list {
display: flex;
flex-direction: column;
}
.enforcer-line {
display: flex;
align-items: baseline;
white-space: nowrap;
}
.enforcer-name {
display: inline-block;
min-width: 3em;
text-align: justify;
text-align-last: justify;
}
.enforcer-phone {
margin-left: 0.4em;
}
} }
} }

1
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/law/lawServiceList.vue

@ -117,6 +117,7 @@ const fetchList = () => {
const params = { const params = {
pageNum: pageNum.value, pageNum: pageNum.value,
pageSize: pageSize.value, pageSize: pageSize.value,
status: 2
}; };
if (searchText.value) { if (searchText.value) {
params.searchValue = searchText.value; params.searchValue = searchText.value;

Loading…
Cancel
Save