Browse Source

预告和计划执法证件号调整

dev-V1.10.2-temp
wangmingyong@163.com 3 months ago
parent
commit
117225ba20
  1. 22
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_edit.vue
  2. 8
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/plan/cp_plan_edit.vue

22
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_edit.vue

@ -62,7 +62,7 @@
<span class="person-name">{{ person.name }}</span> <span class="person-name">{{ person.name }}</span>
<span class="person-phone">{{ person.phone }}</span> <span class="person-phone">{{ person.phone }}</span>
<van-icon <van-icon
v-if="personList.length > 1" v-if="personList.length > 1 && person.phone !== useCommon.phonenumber"
name="close" name="close"
class="person-remove" class="person-remove"
@click="removePerson(index)" @click="removePerson(index)"
@ -287,7 +287,7 @@ import { useRouter, useRoute } from 'vue-router';
import { showToast, showSuccessToast, showConfirmDialog } from 'vant'; import { showToast, showSuccessToast, showConfirmDialog } from 'vant';
import { addNotice, editNotice, getNoticeDetail } from '@/api/enforcement/notice'; import { addNotice, editNotice, getNoticeDetail } from '@/api/enforcement/notice';
import { getPlanList, searchUnionByEnterpriseName, searchBureauUnitUsers, getEnterpriseContactInfo } from '@/api/enforcement/plan'; import { getPlanList, searchUnionByEnterpriseName, searchBureauUnitUsers, getEnterpriseContactInfo } from '@/api/enforcement/plan';
import { maskPhone } from '@/util/util';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const { useCommon } = $globalStore; const { useCommon } = $globalStore;
@ -402,7 +402,7 @@ onMounted(() => {
const bindCurrentUserAsDefaultPerson = () => { const bindCurrentUserAsDefaultPerson = () => {
const name = useCommon.nickName || useCommon.userName || ''; const name = useCommon.nickName || useCommon.userName || '';
const phone = useCommon.phonenumber || ''; const phone = useCommon.lawCertificateNum || maskPhone(useCommon.phonenumber) || '';
const id = useCommon.userId || ''; const id = useCommon.userId || '';
if (!name && !id) return; if (!name && !id) return;
personList.value = [{ id, name, phone, code: '' }]; personList.value = [{ id, name, phone, code: '' }];
@ -534,7 +534,13 @@ const triggerPersonSearch = (keyword) => {
if (seq !== personSearchSeq) return; if (seq !== personSearchSeq) return;
personSearching.value = false; personSearching.value = false;
if (res && res.code === 200 && Array.isArray(res.rows)) { if (res && res.code === 200 && Array.isArray(res.rows)) {
personSearchResult.value = res.rows; let rows = res.rows;
// 过滤掉已选择的执法人员
if (personList.value.length > 0) {
const selectedIds = personList.value.map(p => String(p.id || '')).filter(Boolean);
rows = rows.filter(item => !selectedIds.includes(String(item.userId || '')));
}
personSearchResult.value = rows;
} else { } else {
personSearchResult.value = []; personSearchResult.value = [];
} }
@ -552,17 +558,23 @@ const onSelectPerson = (user) => {
const exists = personList.value.some(p => String(p.id || '') === uid); const exists = personList.value.some(p => String(p.id || '') === uid);
if (exists) { showToast('该人员已添加'); return; } if (exists) { showToast('该人员已添加'); return; }
if (personList.value.length >= maxPersonNum) { showToast(`最多只能添加 ${maxPersonNum} 名执法人员`); return; } if (personList.value.length >= maxPersonNum) { showToast(`最多只能添加 ${maxPersonNum} 名执法人员`); return; }
personList.value.push({ id: uid, name: user.fullname || user.userName || '', phone: user.mobileNumber || '', code: '' }); personList.value.push({ id: uid, name: user.fullname || user.userName || '', phone: user.lawCertificateNum || maskPhone(user.mobileNumber) || '', code: '' });
syncPersonData(); syncPersonData();
showPersonPicker.value = false; showPersonPicker.value = false;
}; };
const removePerson = (index) => { const removePerson = (index) => {
const person = personList.value[index];
if (person && person.id === useCommon.userId) {
showToast('本人不可移除');
return;
}
personList.value.splice(index, 1); personList.value.splice(index, 1);
syncPersonData(); syncPersonData();
}; };
const syncPersonData = () => { const syncPersonData = () => {
console.log(personList.value);
form.value.enforceUserNames = personList.value.map(p => p.name).join(','); form.value.enforceUserNames = personList.value.map(p => p.name).join(',');
form.value.enforceUserIds = personList.value.map(p => p.id || '').join(','); form.value.enforceUserIds = personList.value.map(p => p.id || '').join(',');
form.value.enforceUserTels = personList.value.map(p => p.phone || '').join(','); form.value.enforceUserTels = personList.value.map(p => p.phone || '').join(',');

8
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/plan/cp_plan_edit.vue

@ -101,7 +101,7 @@
<span class="person-name">{{ person.name }}</span> <span class="person-name">{{ person.name }}</span>
<span class="person-phone">{{ person.phone }}</span> <span class="person-phone">{{ person.phone }}</span>
<van-icon <van-icon
v-if="personList.length > 1 && person.id !== useCommon.userId" v-if="personList.length > 1 && person.phone !== useCommon.phonenumber"
name="close" name="close"
class="person-remove" class="person-remove"
@click="removePerson(index)" @click="removePerson(index)"
@ -252,7 +252,7 @@
import { useRouter, useRoute } from 'vue-router'; import { useRouter, useRoute } from 'vue-router';
import { showToast, showSuccessToast, showConfirmDialog } from 'vant'; import { showToast, showSuccessToast, showConfirmDialog } from 'vant';
import { addPlan, editPlan, getPlanDetail, getSubmitDeadline, getManualMatchDays, getMaxInnerUnitAcPersonNum, searchUnionByEnterpriseName, searchBureauUnitUsers } from '@/api/enforcement/plan'; import { addPlan, editPlan, getPlanDetail, getSubmitDeadline, getManualMatchDays, getMaxInnerUnitAcPersonNum, searchUnionByEnterpriseName, searchBureauUnitUsers } from '@/api/enforcement/plan';
import { maskPhone } from '@/util/util';
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
const {useCommon} = $globalStore; const {useCommon} = $globalStore;
@ -395,7 +395,7 @@ onMounted(() => {
// 默认绑定当前登录用户为执法人员 // 默认绑定当前登录用户为执法人员
const bindCurrentUserAsDefaultPerson = () => { const bindCurrentUserAsDefaultPerson = () => {
const name = useCommon.nickName || useCommon.userName || ''; const name = useCommon.nickName || useCommon.userName || '';
const phone = useCommon.phonenumber || ''; const phone = useCommon.lawCertificateNum || maskPhone(useCommon.phonenumber) || '';
const id = useCommon.userId || ''; const id = useCommon.userId || '';
if (!name && !id) return; if (!name && !id) return;
personList.value = [{ id, name, phone, code: '' }]; personList.value = [{ id, name, phone, code: '' }];
@ -642,7 +642,7 @@ const onSelectPerson = (user) => {
personList.value.push({ personList.value.push({
id: uid, id: uid,
name: user.fullname || user.userName || '', name: user.fullname || user.userName || '',
phone: user.mobileNumber || '', phone: user.lawCertificateNum || maskPhone(user.mobileNumber) || '',
code: '', code: '',
}); });
syncPersonData(); syncPersonData();

Loading…
Cancel
Save