|
|
|
@ -30,7 +30,8 @@ |
|
|
|
<span class="popup-title">预告查询</span> |
|
|
|
<van-icon name="cross" class="close-icon" @click="localNoticePopup = false" /> |
|
|
|
</div> |
|
|
|
<van-list v-model:loading="loading" :finished="finished" :immediate-check="false" finished-text="没有更多了" @load="loadNotices" class="popup-content"> |
|
|
|
<van-list v-model:loading="loading" :finished="finished" :immediate-check="false" finished-text="没有更多了" |
|
|
|
@load="loadNotices" class="popup-content"> |
|
|
|
<div v-for="(notice, index) in noticeList" :key="index" class="notice-item"> |
|
|
|
<div class="notice-info"> |
|
|
|
<div class="notice-matter">执法事项:{{ notice.checkItem }}</div> |
|
|
|
@ -68,14 +69,14 @@ |
|
|
|
@clear="clearPersonSearch" /> |
|
|
|
<van-button class="search-btn" type="primary" @click="handlePersonSearch">搜索</van-button> |
|
|
|
</div> |
|
|
|
<div class="person-list"> |
|
|
|
<van-list v-model:loading="personLoading" :finished="personFinished" :immediate-check="false" finished-text="没有更多了" @load="loadPersonList" class="person-list"> |
|
|
|
<div v-for="(person, index) in personList" :key="index" class="person-list-item" |
|
|
|
@click="$emit('selectPerson', person)"> |
|
|
|
@click="handleSelectPerson(person)"> |
|
|
|
<div class="person-name">{{ person.userName }}</div> |
|
|
|
<div class="person-id">执法证件号:{{ person.isShowCardId }}</div> |
|
|
|
<div class="person-id">执法证件号:{{ person.phonenumber }}</div> |
|
|
|
</div> |
|
|
|
<van-empty v-if="personList.length === 0" description="暂无数据" /> |
|
|
|
</div> |
|
|
|
<van-empty v-if="personList.length === 0 && !personLoading" description="暂无数据" /> |
|
|
|
</van-list> |
|
|
|
</div> |
|
|
|
</van-popup> |
|
|
|
|
|
|
|
@ -91,9 +92,10 @@ |
|
|
|
@clear="clearBasisSearch" /> |
|
|
|
<van-button class="search-btn" type="primary" @click="handleBasisSearch">搜索</van-button> |
|
|
|
</div> |
|
|
|
<van-list v-model:loading="basisLoading" :finished="basisFinished" :immediate-check="false" finished-text="没有更多了" @load="loadBasisList" class="enforcement-basis-list"> |
|
|
|
<van-list v-model:loading="basisLoading" :finished="basisFinished" :immediate-check="false" |
|
|
|
finished-text="没有更多了" @load="loadBasisList" class="enforcement-basis-list"> |
|
|
|
<div v-for="(item, index) in enforcementBasisList" :key="index" class="basis-list-item" |
|
|
|
@click="$emit('selectBasis', item)"> |
|
|
|
@click="handleSelectBasis(item)"> |
|
|
|
<div class="basis-name">{{ item.name || item.lawName }}</div> |
|
|
|
</div> |
|
|
|
<van-empty v-if="enforcementBasisList.length === 0 && !basisLoading" description="暂无数据" /> |
|
|
|
@ -109,12 +111,13 @@ |
|
|
|
<van-icon name="cross" class="close-icon" @click="localEntrustedAgencyPopup = false" /> |
|
|
|
</div> |
|
|
|
<div class="search-bar"> |
|
|
|
<van-search v-model="agencySearchKeyword" placeholder="请输入单位名称" |
|
|
|
@search="handleAgencySearch" @clear="clearAgencySearch" /> |
|
|
|
<van-search v-model="agencySearchKeyword" placeholder="请输入单位名称" @search="handleAgencySearch" |
|
|
|
@clear="clearAgencySearch" /> |
|
|
|
<van-button class="search-btn" type="primary" @click="handleAgencySearch">搜索</van-button> |
|
|
|
</div> |
|
|
|
<div class="agency-list"> |
|
|
|
<div v-for="(item, index) in agencyList" :key="index" class="agency-list-item" @click="handleSelectAgency(item.name)"> |
|
|
|
<div v-for="(item, index) in agencyList" :key="index" class="agency-list-item" |
|
|
|
@click="handleSelectAgency(item.name)"> |
|
|
|
<van-radio v-model="selectedAgency" :name="item.name" /> |
|
|
|
<span class="agency-name">{{ item.name }}</span> |
|
|
|
</div> |
|
|
|
@ -128,7 +131,7 @@ |
|
|
|
<script setup name="RegisterPopups"> |
|
|
|
import { ref, reactive, watch, computed, onMounted } from 'vue'; |
|
|
|
import { showToast } from 'vant'; |
|
|
|
import { queryEnforcementNoticeList, queryUsersByPage, queryAccordingList } from '@/api/enforcement/index'; |
|
|
|
import { queryEnforcementNoticeList, queryUsersByPage, queryAccordingList, queryDeptList } from '@/api/enforcement/index'; |
|
|
|
import { loadDict } from '@/util/dictUtil'; |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
|
@ -258,21 +261,21 @@ const personSearchKeyword = ref(''); |
|
|
|
const personList = ref([]); |
|
|
|
const personPageNum = ref(1); |
|
|
|
const personPageSize = ref(10); |
|
|
|
const personHasMore = ref(true); |
|
|
|
const personLoading = ref(false); |
|
|
|
const personFinished = ref(false); |
|
|
|
|
|
|
|
const initPersonList = () => { |
|
|
|
personFinished.value = false; |
|
|
|
personPageNum.value = 1; |
|
|
|
personHasMore.value = true; |
|
|
|
personList.value = []; |
|
|
|
personLoading.value = false; |
|
|
|
loadPersonList(); |
|
|
|
}; |
|
|
|
|
|
|
|
const loadPersonList = () => { |
|
|
|
if (personLoading.value || !personHasMore.value) return; |
|
|
|
|
|
|
|
if (personLoading.value || personFinished.value) return; |
|
|
|
personLoading.value = true; |
|
|
|
|
|
|
|
|
|
|
|
// 获取已选人员的 userId,用逗号拼接 |
|
|
|
const selectedIds = props.selectedPersons.map(p => p.id).filter(Boolean); |
|
|
|
const notUserId = selectedIds.length > 0 ? selectedIds.join(',') : undefined; |
|
|
|
@ -281,47 +284,56 @@ const loadPersonList = () => { |
|
|
|
pageSize: personPageSize.value, |
|
|
|
notUserId |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
queryUsersByPage(params, (res) => { |
|
|
|
if (res.code === 200 && res.rows) { |
|
|
|
const data = res.rows; |
|
|
|
if (Array.isArray(data)) { |
|
|
|
// 转换数据格式,确保 id 和 name 字段存在 |
|
|
|
if (personPageNum.value === 1) { |
|
|
|
personList.value = data; |
|
|
|
} else { |
|
|
|
personList.value = [...personList.value, ...data]; |
|
|
|
} |
|
|
|
|
|
|
|
// 判断是否还有更多数据 |
|
|
|
personHasMore.value = data.length >= personPageSize.value; |
|
|
|
if (res.code === 200 || res.code === 0) { |
|
|
|
const data = res.data || res.rows || []; |
|
|
|
const total = res.total || res.count || 0; |
|
|
|
|
|
|
|
if (personPageNum.value === 1) { |
|
|
|
personList.value = data; |
|
|
|
} else { |
|
|
|
personHasMore.value = false; |
|
|
|
personList.value = [...personList.value, ...data]; |
|
|
|
} |
|
|
|
if (total <= personPageSize.value * personPageNum.value) { |
|
|
|
personFinished.value = true; |
|
|
|
} else { |
|
|
|
personPageNum.value++; |
|
|
|
} |
|
|
|
} else { |
|
|
|
personHasMore.value = false; |
|
|
|
personFinished.value = true; |
|
|
|
} |
|
|
|
personLoading.value = false; |
|
|
|
}, () => { |
|
|
|
personLoading.value = false; |
|
|
|
personFinished.value = true; |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const handlePersonSearch = () => { |
|
|
|
personFinished.value = false; |
|
|
|
personPageNum.value = 1; |
|
|
|
personHasMore.value = true; |
|
|
|
personList.value = []; |
|
|
|
loadPersonList(); |
|
|
|
}; |
|
|
|
|
|
|
|
const clearPersonSearch = () => { |
|
|
|
personSearchKeyword.value = ''; |
|
|
|
personFinished.value = false; |
|
|
|
personPageNum.value = 1; |
|
|
|
personHasMore.value = true; |
|
|
|
personList.value = []; |
|
|
|
loadPersonList(); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleSelectPerson = (person) => { |
|
|
|
// 转换字段名称,将接口返回的 userName 转换为 name,phonenumber 转换为 id |
|
|
|
emit('selectPerson', { |
|
|
|
name: person.userName || person.name || '', |
|
|
|
id: person.phonenumber || person.id || '' |
|
|
|
}); |
|
|
|
localPersonPopup.value = false; |
|
|
|
}; |
|
|
|
|
|
|
|
watch(localPersonPopup, (val) => { |
|
|
|
if (val) { |
|
|
|
personSearchKeyword.value = ''; |
|
|
|
@ -332,8 +344,8 @@ watch(localPersonPopup, (val) => { |
|
|
|
// 监听已选人员变化,重新加载列表 |
|
|
|
watch(() => props.selectedPersons, () => { |
|
|
|
if (localPersonPopup.value) { |
|
|
|
personFinished.value = false; |
|
|
|
personPageNum.value = 1; |
|
|
|
personHasMore.value = true; |
|
|
|
personList.value = []; |
|
|
|
loadPersonList(); |
|
|
|
} |
|
|
|
@ -348,7 +360,7 @@ const basisPageNum = ref(1); |
|
|
|
const basisPageSize = ref(10); |
|
|
|
|
|
|
|
const loadBasisList = () => { |
|
|
|
if (basisFinished.value) return; |
|
|
|
basisLoading.value = true; |
|
|
|
const params = { |
|
|
|
pageNum: basisPageNum.value, |
|
|
|
pageSize: basisPageSize.value, |
|
|
|
@ -358,13 +370,15 @@ const loadBasisList = () => { |
|
|
|
queryAccordingList(params, (res) => { |
|
|
|
if (res.code === 200 || res.code === 0) { |
|
|
|
const list = res.data || res.rows || []; |
|
|
|
const total = res.total || res.count || 0; |
|
|
|
if (basisPageNum.value === 1) { |
|
|
|
enforcementBasisList.value = list; |
|
|
|
} else { |
|
|
|
enforcementBasisList.value = [...enforcementBasisList.value, ...list]; |
|
|
|
} |
|
|
|
basisFinished.value = list.length < basisPageSize.value; |
|
|
|
if (!basisFinished.value) { |
|
|
|
if (total <= basisPageSize.value * basisPageNum.value) { |
|
|
|
basisFinished.value = true; |
|
|
|
} else { |
|
|
|
basisPageNum.value++; |
|
|
|
} |
|
|
|
} else { |
|
|
|
@ -372,6 +386,7 @@ const loadBasisList = () => { |
|
|
|
showToast(res.msg || '获取执法依据失败'); |
|
|
|
basisFinished.value = true; |
|
|
|
} |
|
|
|
|
|
|
|
basisLoading.value = false; |
|
|
|
}, (err) => { |
|
|
|
basisLoading.value = false; |
|
|
|
@ -382,14 +397,22 @@ const loadBasisList = () => { |
|
|
|
}; |
|
|
|
|
|
|
|
const initBasisList = async () => { |
|
|
|
basisLoading.value = false; |
|
|
|
basisFinished.value = false; |
|
|
|
basisPageNum.value = 1; |
|
|
|
enforcementBasisList.value = []; |
|
|
|
basisLoading.value = false; |
|
|
|
await nextTick(); |
|
|
|
loadBasisList(); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleSelectBasis = (basis) => { |
|
|
|
// 转换字段名称,确保 name 字段存在 |
|
|
|
emit('selectBasis', { |
|
|
|
name: basis.name || basis.lawName || '' |
|
|
|
}); |
|
|
|
localBasisPopup.value = false; |
|
|
|
}; |
|
|
|
|
|
|
|
const handleBasisSearch = () => { |
|
|
|
initBasisList(); |
|
|
|
}; |
|
|
|
@ -412,31 +435,28 @@ const agencyList = ref([]); |
|
|
|
const selectedAgency = ref(''); |
|
|
|
|
|
|
|
const initAgencyList = () => { |
|
|
|
agencyList.value = [ |
|
|
|
{ name: '深圳市人民检察院' }, |
|
|
|
{ name: '深圳市发展和改革委员会' }, |
|
|
|
{ name: '深圳市人力资源和社会保障局' }, |
|
|
|
{ name: '深圳市文化广电旅游体育局' }, |
|
|
|
{ name: '深圳市宝安区发展和改革局' }, |
|
|
|
{ name: '深圳市宝安区教育局' }, |
|
|
|
{ name: '深圳市宝安区民政局' }, |
|
|
|
{ name: '深圳市宝安区西乡街道办事处' }, |
|
|
|
{ name: '深圳市宝安区福永街道办事处' }, |
|
|
|
{ name: '中共深圳市南山区委统一战线工作部' }, |
|
|
|
{ name: '深圳市龙岗区教育局' }, |
|
|
|
{ name: '深圳市南山区司法局' }, |
|
|
|
{ name: '深圳市南山区人力资源局' }, |
|
|
|
]; |
|
|
|
const params = { |
|
|
|
deptName: agencySearchKeyword.value || undefined |
|
|
|
}; |
|
|
|
|
|
|
|
queryDeptList(params, (res) => { |
|
|
|
if (res.code === 200 || res.code === 0) { |
|
|
|
const data = res.data || res.rows || []; |
|
|
|
agencyList.value = data.map(item => ({ |
|
|
|
name: item.deptName || item.name || '' |
|
|
|
})); |
|
|
|
} else { |
|
|
|
console.error('获取部门列表失败:', res.msg); |
|
|
|
agencyList.value = []; |
|
|
|
} |
|
|
|
}, (err) => { |
|
|
|
console.error('获取部门列表接口失败', err); |
|
|
|
agencyList.value = []; |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const handleAgencySearch = () => { |
|
|
|
initAgencyList(); |
|
|
|
if (agencySearchKeyword.value.trim()) { |
|
|
|
const keyword = agencySearchKeyword.value.toLowerCase(); |
|
|
|
agencyList.value = agencyList.value.filter(item => |
|
|
|
item.name.toLowerCase().includes(keyword) |
|
|
|
); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
const clearAgencySearch = () => { |
|
|
|
@ -466,9 +486,7 @@ const loading = ref(false); |
|
|
|
const finished = ref(false); |
|
|
|
|
|
|
|
const loadNotices = () => { |
|
|
|
if (finished.value) return; |
|
|
|
|
|
|
|
// 从缓存中获取企业统一信用代码 |
|
|
|
loading.value = true; |
|
|
|
let enterpriseNumber = ''; |
|
|
|
try { |
|
|
|
const cached = sessionStorage.getItem('enterpriseScanData'); |
|
|
|
@ -489,20 +507,23 @@ const loadNotices = () => { |
|
|
|
queryEnforcementNoticeList(params, (res) => { |
|
|
|
if (res.code === 200) { |
|
|
|
const data = res.rows || []; |
|
|
|
const total = res.total || 0; |
|
|
|
if (noticePage.value === 1) { |
|
|
|
noticeList.value = data; |
|
|
|
} else { |
|
|
|
noticeList.value = [...noticeList.value, ...data]; |
|
|
|
} |
|
|
|
console.log('获取预告列表成功:', data); |
|
|
|
finished.value = data.length < noticePageSize.value; |
|
|
|
if (!finished.value) { |
|
|
|
|
|
|
|
if (total <= noticePage.value * noticePageSize.value) { |
|
|
|
finished.value = true; |
|
|
|
} else { |
|
|
|
noticePage.value++; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.error('获取预告列表失败:', res.msg); |
|
|
|
finished.value = true; |
|
|
|
} |
|
|
|
loading.value = false; |
|
|
|
}, (err) => { |
|
|
|
loading.value = false; |
|
|
|
finished.value = true; |
|
|
|
@ -510,14 +531,17 @@ const loadNotices = () => { |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
const initNoticesList = async () => { |
|
|
|
finished.value = false; |
|
|
|
noticePage.value = 1; |
|
|
|
noticeList.value = []; |
|
|
|
loading.value = false; |
|
|
|
loadNotices(); |
|
|
|
}; |
|
|
|
|
|
|
|
watch(localNoticePopup, async (newVal) => { |
|
|
|
if (newVal) { |
|
|
|
noticePage.value = 1; |
|
|
|
noticeList.value = []; |
|
|
|
loading.value = false; |
|
|
|
finished.value = false; |
|
|
|
await nextTick(); |
|
|
|
loadNotices(); |
|
|
|
initNoticesList(); |
|
|
|
} |
|
|
|
}); |
|
|
|
</script> |
|
|
|
@ -568,7 +592,7 @@ watch(localNoticePopup, async (newVal) => { |
|
|
|
.person-search-popup, |
|
|
|
.enforcement-basis-popup, |
|
|
|
.entrusted-agency-popup { |
|
|
|
height: 100%; |
|
|
|
height: 99%; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
} |
|
|
|
@ -580,6 +604,13 @@ watch(localNoticePopup, async (newVal) => { |
|
|
|
flex: 1; |
|
|
|
overflow-y: auto; |
|
|
|
padding: 0 0.3rem; |
|
|
|
min-height: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.enforcement-basis-list { |
|
|
|
:deep(.van-list) { |
|
|
|
height: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -587,7 +618,7 @@ watch(localNoticePopup, async (newVal) => { |
|
|
|
.enterprise-list-item, |
|
|
|
.person-list-item, |
|
|
|
.basis-list-item { |
|
|
|
padding:20px 20px 14px 14px; |
|
|
|
padding: 20px 20px 14px 14px; |
|
|
|
border-bottom: 1px solid #f5f5f5; |
|
|
|
|
|
|
|
&:active { |
|
|
|
|