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 3de13f6b..41da0832 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 @@ -68,6 +68,9 @@ export const submitEnfRegistration = (params, success, error) => _post(baseUrl + // 历史活动列表 export const queryNonRegistrationList = (params, success, error) => _get(baseUrl + "/nonRegistration/queryList", params, success, error); +// 非行政执法登记列表 +export const queryNonRegistrationPageList = (params, success, error) => _get(baseUrl + "/nonRegistration/list", params, success, error); + // 历史活动详情 export const queryNonRegistrationDetail = (params, success, error) => _get(baseUrl + "/nonRegistration/queryById", params, success, error); 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 14e9c3e0..05bbc35e 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 @@ -3,6 +3,12 @@ + + + + + +
@@ -13,24 +19,24 @@
- 执法时间:{{ formatTime(item.enforcementTime) }} + {{ activeTab === 'enforcement' ? '执法时间:' : '入企时间:' }}{{ formatTime(item.enforcementTime) }} 联
{{ item.lawEnforcementItemText || '-' }}
- 执法单位: + {{ activeTab === 'enforcement' ? '执法单位:' : '入企单位:' }} {{ item.bureauDeptName || '-' }}
-
执法人员:
+
{{ activeTab === 'enforcement' ? '执法人员:' : '入企人员:' }}
{{ parseEnforcer(item.lawEnforcer).name }} {{ parseEnforcer(item.lawEnforcer).phone }}
-
+
{{ parseEnforcer(value).name }} {{ parseEnforcer(value).phone }}
@@ -41,9 +47,8 @@ {{ item.enterpriseName || '-' }}
- -
- + +
编辑
@@ -60,12 +65,16 @@ import { ref, onMounted } from 'vue'; import { useRouter } from 'vue-router'; import { showToast } from 'vant'; import 'vant/es/toast/style'; -import { queryEnforcementRegistrationPageList } from '@/api/enforcement'; +import { queryEnforcementRegistrationPageList, queryNonRegistrationPageList } from '@/api/enforcement'; import { formatEnforcer, parseEnforcer, formatTime } from '@/util/util'; import SearchFilterBar from '@/components/common/SearchFilterBar.vue'; const router = useRouter(); +// ========== Tab 状态 ========== +// 'enforcement':行政执法;'non-enforcement':非行政执法 +const activeTab = ref('enforcement'); + // ========== 列表状态 ========== const list = ref([]); const loading = ref(false); @@ -81,15 +90,11 @@ const pageSize = ref(10); const dateType = ref(null); const dateSearch = ref(null); -// ========== 格式化日期 ========== -const formatDate = (dateStr) => { - if (!dateStr) return '-'; - const d = new Date(dateStr.replace ? dateStr.replace(/-/g, '/') : dateStr); - if (isNaN(d.getTime())) return dateStr; - const y = d.getFullYear(); - const m = String(d.getMonth() + 1).padStart(2, '0'); - const day = String(d.getDate()).padStart(2, '0'); - return `${y}-${m}-${day}`; +// ========== 根据当前 Tab 选择接口 ========== +const getFetchApi = () => { + return activeTab.value === 'enforcement' + ? queryEnforcementRegistrationPageList + : queryNonRegistrationPageList; }; // ========== 加载数据 ========== @@ -111,8 +116,10 @@ const fetchList = () => { if (dateSearch.value) { params.dateSearch = dateSearch.value; } - queryEnforcementRegistrationPageList(params, (res) => { + const api = getFetchApi(); + api(params, (res) => { if (res.code === 200 || res.code === 0) { + // 行政执法接口返回 res.data,非行政执法接口返回 res.rows const rows = res.data || res.rows || []; const total = res.total || res.count || 0; @@ -181,16 +188,35 @@ const onDateChange = ({ dateType: type, dateSearch: search, dateShow }) => { onSearch(); }; -// ========== 跳转详情(只读查看,始终不显示提交按钮)========== +// ========== Tab 切换 ========== +const onTabChange = (name) => { + activeTab.value = name; + // 重置列表并加载新 Tab 数据 + pageNum.value = 1; + list.value = []; + finished.value = false; + loading.value = true; + fetchList(); +}; + +// ========== 跳转详情(只读查看)========== const toDetailView = (item) => { - router.push({ - path: '/enforcement/enforcementEvaluateDetail', - query: { id: item.id, hasEvaluate: 1 } - }); + if (activeTab.value === 'enforcement') { + router.push({ + path: '/enforcement/enforcementEvaluateDetail', + query: { id: item.id, hasEvaluate: 1 } + }); + } else { + // 非行政执法跳转到历史活动详情 + router.push({ + path: '/enforcement/historyActivityDetail', + query: { id: item.id } + }); + } }; -// ========== 跳转反馈(可编辑,与反馈页面的待反馈逻辑打通)========== -const toEvaluate = (id, checkItem) => { +// ========== 跳转反馈 ========== +const toEvaluate = (id) => { router.push({ path: '/enforcement/enforcementEvaluateDetail', query: { @@ -202,9 +228,14 @@ const toEvaluate = (id, checkItem) => { // ========== 跳转编辑页面 ========== const toEdit = (id) => { + const query = { id }; + // 非行政执法模式需要带上 type 参数 + if (activeTab.value === 'non-enforcement') { + query.type = 'non-enforcement'; + } router.push({ path: '/enforcement/enforcementRegister', - query: { id } + query }); }; @@ -220,6 +251,11 @@ onMounted(() => { height: 100%; background-color: #fbfdff; + .list-tabs { + background: #fff; + flex-shrink: 0; + } + .list-container { flex: 1; overflow-y: auto; diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy b/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy index 1e2d7f5c..7cca0901 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/vite-env/.env.enforcement-dev-wmy @@ -4,9 +4,9 @@ VITE_BASE_URL = '/efcode20-enf-app/api' VITE_CONTEXT_PATH = '/efcode20-enf-app/' # VITE_PROXY_TARGET = 'http://139.186.148.21:8080' # VITE_API_URL = 'http://192.168.1.17:8080' -# VITE_PROXY_TARGET = 'http://172.16.21.213:8080' +VITE_PROXY_TARGET = 'http://172.16.21.213:8080' # VITE_PROXY_TARGET = 'http://172.16.21.93:8080' -VITE_PROXY_TARGET = 'http://172.16.20.72:8080' +# VITE_PROXY_TARGET = 'http://172.16.20.72:8080' VITE_DEFAULT_LOGIN = '/enforcement/loginByPassword' VITE_APP_ENV = 'dev' VITE_FILE_URL = ''