From 316b265e12548e488834df7fc289f4b9fbd14202 Mon Sep 17 00:00:00 2001 From: wangmingyong Date: Wed, 27 May 2026 17:15:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/enforcement/index.js | 16 +- .../register/EnforcementInfoSection.vue | 4 +- .../enforcement/register/RegisterPopups.vue | 179 ++++++++++-------- .../src/util/fileUpload.js | 14 +- .../enforcement/enforce/enforcementList.vue | 34 +--- .../enforce/enforcementRegister.vue | 18 +- .../statistics/statisticsAnalysis.vue | 84 +++++++- .../vite.config.js | 6 +- 8 files changed, 230 insertions(+), 125 deletions(-) diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/api/enforcement/index.js b/zdxt-web-client/zdxt-efcode-enforcement-app/src/api/enforcement/index.js index 07dd4f6f..dd944645 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/api/enforcement/index.js +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/api/enforcement/index.js @@ -26,9 +26,9 @@ export const submitEvaluate = (params, success, error) => _post(baseUrl + "/ente // region 执法登记模块 -export const queryEnforcementRegistrationPageList = (params, success, error) => _get(baseUrl + "/enforcement_registration/queryEnforcementRegistrationPageList", params, success, error); +export const queryEnforcementRegistrationPageList = (params, success, error) => _get(baseUrl + "/enfRegistration/list", params, success, error); -export const getEnforcementRegistrationDetailById = (params, success, error) => _get(baseUrl + "/enforcement_registration/queryDetailById", params, success, error); +export const getEnforcementRegistrationDetailById = (params, success, error) => _get(baseUrl + "/enfRegistration/enfLawCasedetail", params, success, error); export const getEducationServicesList = (params, success, error) => _get(baseUrl + "/enforcementcode/educationServices/list", params, success, error); @@ -45,7 +45,7 @@ export const queryXzcfList = (enterpriseNumber, success, error) => _get(baseUrl export const queryXzqzList = (enterpriseNumber, success, error) => _get(baseUrl + "/caseInfo/queryXzqzList", { c301010: enterpriseNumber }, success, error); // 执法依据列表 -export const queryAccordingList = (params, success, error) => _get(baseUrl + "/according//list", params, success, error); +export const queryAccordingList = (params, success, error) => _get(baseUrl + "/according/list", params, success, error); export const queryEnfRegistrationList = (params, success, error) => _get(baseUrl + "/enfRegistration/queryList", params, success, error); @@ -65,6 +65,9 @@ export const queryEnforcementNoticeList = (params, success, error) => _post(base export const queryUsersByPage = (params, success, error) => _post(baseUrl + "/system/queryUsersByPage", params, success, error); +// 获取部门列表 +export const queryDeptList = (params, success, error) => _post("/app-enf/system/dept", params, success, error); + // endregion // region 首页模块 @@ -75,6 +78,13 @@ export const getCarouselBannerList = (params, success, error) => _get(baseUrl + // endregion +// region 统计分析模块 + +// 综合分析数据 +export const getComprehensiveAnalysis = (params, success, error) => _get(baseUrl + "/appComprehensiveAnalysis/whole", params, success, error); + +// endregion + // region 公共模块 // 查询字典数据(公共) diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnforcementInfoSection.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnforcementInfoSection.vue index 9a24610e..38ba63c3 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnforcementInfoSection.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnforcementInfoSection.vue @@ -19,11 +19,11 @@
- {{ person.name || '请选择' }} + {{ person.name || '请选择' }}{{ person.id || '' }}
-
+
请选择
diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/RegisterPopups.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/RegisterPopups.vue index f680fd73..e6824e75 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/RegisterPopups.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/RegisterPopups.vue @@ -30,7 +30,8 @@ 预告查询
- +
执法事项:{{ notice.checkItem }}
@@ -68,14 +69,14 @@ @clear="clearPersonSearch" /> 搜索
-
+
+ @click="handleSelectPerson(person)">
{{ person.userName }}
-
执法证件号:{{ person.isShowCardId }}
+
执法证件号:{{ person.phonenumber }}
- -
+ +
@@ -91,9 +92,10 @@ @clear="clearBasisSearch" /> 搜索 - +
+ @click="handleSelectBasis(item)">
{{ item.name || item.lawName }}
@@ -109,12 +111,13 @@
-
+
{{ item.name }}
@@ -128,7 +131,7 @@ @@ -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 { diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/util/fileUpload.js b/zdxt-web-client/zdxt-efcode-enforcement-app/src/util/fileUpload.js index cb2711a5..fdb5ce46 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/util/fileUpload.js +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/util/fileUpload.js @@ -10,18 +10,22 @@ const uploadFile = (files,callback) => { files.status = "uploading"; files.message = "上传中..."; files.status = "uploading"; - // files.message = "上传中..."; // 需要使用 FormData 进行文件上传 let form = new FormData(); form.append("file", files.file); + // 获取 token(从 localStorage 或 sessionStorage 中获取) + + const token = $globalStore.useCommon.token; + console.log(token); axios({ method: "post", - url: baseUrl+ "/common/upload", + url: baseUrl+ "/app-enf/common/file/upload", data: form, - // headers: { - // 'Content-Type': 'multipart/form-data' - // } + headers: { + 'clientid': 'f0535c2a32ab4d0496ab9a699b2a7d36', + 'Authorization': 'Bearer ' + token + } }) .then((res) => { files.status = "done"; diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementList.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementList.vue index f6609621..3969ca23 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementList.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementList.vue @@ -131,6 +131,7 @@ const getEnforcerDisplay = (item) => { // ========== 加载数据 ========== const fetchList = () => { + loading.value = true; const params = { pageNum: pageNum.value, pageSize: pageSize.value, @@ -149,44 +150,27 @@ const fetchList = () => { } queryEnforcementRegistrationPageList(params, (res) => { - // 兼容数组 / 包裹格式 - let rows = []; - let total = 0; - let ok = true; - if (Array.isArray(res)) { - rows = res; - total = res.length; - } else if (res && Array.isArray(res.rows)) { - rows = res.rows; - total = res.total || rows.length; - ok = res.code ? res.code === 200 : true; - } else if (res && Array.isArray(res.data)) { - rows = res.data; - total = res.total || rows.length; - ok = res.code ? res.code === 200 : true; - } else if (res && res.code && res.code !== 200) { - ok = false; - } - - if (ok) { + if (res.code === 200 || res.code === 0) { + const rows = res.data || res.rows || []; + const total = res.total || res.count || 0; + if (refreshing.value) { list.value = rows; refreshing.value = false; } else { list.value = [...list.value, ...rows]; } - - if (rows.length === 0 || list.value.length >= total) { + + if (total <= pageSize.value * pageNum.value) { finished.value = true; } else { pageNum.value++; } - loading.value = false; } else { - loading.value = false; - finished.value = true; showToast(res.msg || '加载失败'); + finished.value = true; } + loading.value = false; }, () => { loading.value = false; finished.value = true; diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementRegister.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementRegister.vue index 1a138308..25287544 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementRegister.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementRegister.vue @@ -146,7 +146,7 @@ const selectedPersonsList = computed(() => { // 添加额外执法人员 additionalPersons.value.forEach(p => { if (p.id || p.name) { - list.push({ id: p.id, name: p.name }); + list.push({ id: p.id, name: p.name, }); } }); return list; @@ -311,6 +311,14 @@ const buildSubmitPayload = () => { .map(p => p.id) .join(','); + // 任务来源:数字和中文名称 + const lawEnforceCategory = categoryOptions.value.find(item => item.text === formData.category)?.value || ''; + const lawEnforceCategoryText = formData.category || ''; + + // 执法类型:数字和中文名称 + const checkCategory = taskSourceOptions.find(item => item.text === formData.taskSource)?.value || ''; + const checkCategoryText = formData.taskSource || ''; + return { enterpriseName: enterpriseData.value.enterpriseName || '', enterpriseNumber: enterpriseData.value.enterpriseNumber || '', @@ -319,7 +327,10 @@ const buildSubmitPayload = () => { lawCertificateNumText: lawCertificateNumText, lawEnforcerTwo: lawEnforcerTwo, lawEnforcerIdTwo: lawEnforcerIdTwo, - lawEnforceCategory: formData.category || '', + lawEnforceCategory: lawEnforceCategory, + lawEnforceCategoryText: lawEnforceCategoryText, + checkCategory: checkCategory, + checkCategoryText: checkCategoryText, hasUnion: formData.jointEnforcement || 0, hasAuto: formData.entrustedEnforcement || 0, lawEnforcement: useCommon.deptName || '', @@ -347,6 +358,7 @@ const handleSave = () => { saveEnfRegistration(payload, (res) => { if (res.code === 200 || res.code === 0) { showSuccessToast('保存成功'); + router.push('/enforcement/enforcementList'); } else { showToast(res.msg || '保存失败'); } @@ -388,7 +400,7 @@ const onSubmit = () => { submitEnfRegistration(payload, (res) => { if (res.code === 200 || res.code === 0) { showSuccessToast('提交成功'); - router.back(); + router.push('/enforcement/enforcementList'); } else { showToast(res.msg || '提交失败'); } diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/statistics/statisticsAnalysis.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/statistics/statisticsAnalysis.vue index 658d6167..295d99a8 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/statistics/statisticsAnalysis.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/statistics/statisticsAnalysis.vue @@ -121,6 +121,7 @@ import { ref, computed, shallowRef, watch } from 'vue'; import { useRouter } from 'vue-router'; import { showToast } from 'vant'; import 'vant/es/toast/style'; +import { getComprehensiveAnalysis } from '@/api/enforcement/index'; const router = useRouter(); const maxDate = ref(new Date()); @@ -330,16 +331,72 @@ const yearColumns = computed(() => { // ========== 数据加载与动画 ========== const loadStatistics = () => { isLoading.value = true; - setTimeout(() => { - statistics.value = { - totalCount: 11, - monthOverMonth: 266.67, - yearOverYear: 266.66, - jointLaw: { noticeCount: 8, entrustedCount: 0, evaluateCount: 8, complaintCount: 5 }, + + // 构建请求参数 + const params = { + userType: userType.value, // 'personal' 或 'company' + period: period.value, // 'month', 'quarter', 'year', 'other' + }; + + // 根据周期类型添加具体参数 + if (period.value === 'month') { + params.year = selectedMonth.value[0]; + params.month = selectedMonth.value[1]; + } else if (period.value === 'quarter') { + params.year = selectedQuarter.value[0]; + params.quarter = selectedQuarter.value[1]; + } else if (period.value === 'year') { + params.year = currentYear.value; + } else if (period.value === 'other' && selectedDateRange.value) { + const formatDate = (date) => { + const d = new Date(date); + return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`; }; - startNumberAnimation(); + params.startDate = formatDate(selectedDateRange.value[0]); + params.endDate = formatDate(selectedDateRange.value[1]); + } + + getComprehensiveAnalysis(params, (res) => { + if (res.code === 200 || res.code === 0) { + const data = res.data || {}; + + statistics.value = { + totalCount: data.totalCount || 0, + monthOverMonth: data.monthOverMonth || 0, + yearOverYear: data.yearOverYear || 0, + jointLaw: { + noticeCount: data.jointLaw?.noticeCount || 0, + entrustedCount: data.jointLaw?.entrustedCount || 0, + evaluateCount: data.jointLaw?.evaluateCount || 0, + complaintCount: data.jointLaw?.complaintCount || 0, + }, + }; + + // 更新执法类别数据 + if (data.lawCategoryList && Array.isArray(data.lawCategoryList)) { + lawCategoryList.value = data.lawCategoryList; + } + + // 更新企业类别数据 + if (data.enterpriseCategoryList && Array.isArray(data.enterpriseCategoryList)) { + enterpriseCategoryList.value = data.enterpriseCategoryList; + } + + // 更新投诉类别数据 + if (data.complaintCategoryList && Array.isArray(data.complaintCategoryList)) { + complaintCategoryList.value = data.complaintCategoryList; + } + + startNumberAnimation(); + } else { + showToast(res.msg || '加载失败'); + } + isLoading.value = false; + }, (err) => { + console.error('获取综合分析数据失败', err); + showToast('网络请求失败'); isLoading.value = false; - }, 500); + }); }; const startNumberAnimation = () => { @@ -440,19 +497,19 @@ const onMonthConfirm = (value) => { selectedMonth.value = value; showToast(`已选择${periodDisplayText.value}`); showMonthSelector.value = false; + loadStatistics(); }; const onQuarterConfirm = ({ selectedValues }) => { - // van-picker 多列模式下,confirm 回调参数是对象,包含 selectedValues 数组 if (Array.isArray(selectedValues)) { selectedQuarter.value = selectedValues; } showToast(`已选择${periodDisplayText.value}`); showQuarterSelector.value = false; + loadStatistics(); }; const onYearConfirm = (value) => { - // van-picker 单列模式下confirm回调参数是对象,包含selectedValues数组 const selectedValues = value.selectedValues || value; if (typeof selectedValues === 'string') { @@ -464,6 +521,7 @@ const onYearConfirm = (value) => { } showToast(`已选择${periodDisplayText.value}`); showYearSelector.value = false; + loadStatistics(); }; const onConfirm = (dates) => { if (dates && dates.length === 2) { @@ -471,6 +529,7 @@ const onConfirm = (dates) => { isFilterMode.value = true; } showFilterSelector.value = false; + loadStatistics(); }; // 筛选切换(使用通用函数) const toggleFilterType = (type) => toggleFilter(selectedFilterType, type); @@ -486,6 +545,11 @@ import { onMounted } from 'vue'; onMounted(() => { loadStatistics(); }); + +// 监听用户类型和周期变化,重新加载数据 +watch([userType, period], () => { + loadStatistics(); +});