From fccf0fd26f9f60a18b6d6332867b47a7fa33816f Mon Sep 17 00:00:00 2001 From: wangmingyong Date: Wed, 27 May 2026 21:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=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 | 7 +- .../register/EnforcementInfoSection.vue | 23 +- .../register/EnterpriseInfoSection.vue | 12 ++ .../enforcement/register/RegisterPopups.vue | 83 ++++--- .../src/http/index.js | 1 + .../enforce/enforcementRegister.vue | 202 +++++++++++++----- 6 files changed, 233 insertions(+), 95 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 dd944645..81070224 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 @@ -61,12 +61,15 @@ export const queryNonRegistrationList = (params, success, error) => _get(baseUrl // 历史活动详情 export const queryNonRegistrationDetail = (params, success, error) => _get(baseUrl + "/nonRegistration/queryById", params, success, error); +// 非行政执法提交 +export const addNonRegistration = (params, success, error) => _post(baseUrl + "/app-enf/nonRegistration/add", params, success, error); + export const queryEnforcementNoticeList = (params, success, error) => _post(baseUrl + "/enforcement/queryList", params, success, error); -export const queryUsersByPage = (params, success, error) => _post(baseUrl + "/system/queryUsersByPage", params, success, error); +export const queryUsersByPage = (params, success, error) => _get(baseUrl + "/system/queryUsersByPage", params, success, error); // 获取部门列表 -export const queryDeptList = (params, success, error) => _post("/app-enf/system/dept", params, success, error); +export const queryDeptList = (params, success, error) => _get("/app-enf/system/dept", params, success, error); // endregion 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 38ba63c3..eccfe48a 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 @@ -23,7 +23,7 @@ -
+
请选择
@@ -44,9 +44,9 @@ required /> - +
@@ -102,7 +102,8 @@ -
本次执法是否为受委托事项
+
+
本次执法是否为受委托事项
- +
@@ -175,13 +176,13 @@ const entrustedEnforcementValue = computed(() => { const onAfterReadImage = (file) => { const files = Array.isArray(file) ? file : [file]; files.forEach(f => { + f.status = 'uploading'; + f.message = '上传中...'; uploadFile(f, (res) => { + f.status = 'done'; + f.message = '上传成功'; const data = res && res.data ? res.data : res; - const filePath = typeof data === 'string' ? data : (data && (data.url || data.fileUrl || data.path)) || ''; - if (filePath) { - f.url = filePath; - f.status = 'done'; - } + f.url = data; }); }); }; diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnterpriseInfoSection.vue b/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnterpriseInfoSection.vue index 832416fa..16ccc425 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnterpriseInfoSection.vue +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/components/enforcement/register/EnterpriseInfoSection.vue @@ -11,6 +11,10 @@ + +
@@ -46,6 +50,14 @@ const enterpriseNumber = computed({ } }); +// 计算属性:企业地址(支持双向绑定) +const enterpriseAddress = computed({ + get: () => props.enterpriseData?.enterpriseAddress || '', + set: (val) => { + emit('update:enterpriseData', { ...props.enterpriseData, enterpriseAddress: val }); + } +}); + const handleClick = () => { emit('open-picker'); }; 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 e6824e75..12da974f 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 @@ -69,7 +69,8 @@ @clear="clearPersonSearch" /> 搜索
- +
{{ person.userName }}
@@ -115,14 +116,15 @@ @clear="clearAgencySearch" /> 搜索
-
+
+ @click="handleSelectAgency(item)"> {{ item.name }}
- -
+ +
@@ -166,7 +168,6 @@ const taskSourceOptions = ref([]); // 加载执法类别字典 const loadCategoryDict = () => { loadDict('law_enforce_category', (columns) => { - console.log(columns); categoryOptions.value = columns; }); }; @@ -273,23 +274,21 @@ const initPersonList = () => { }; const loadPersonList = () => { - 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; const params = { pageNum: personPageNum.value, pageSize: personPageSize.value, - notUserId + notUserId, + userName: personSearchKeyword.value || undefined }; - + console.log(params); queryUsersByPage(params, (res) => { 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 { @@ -366,7 +365,7 @@ const loadBasisList = () => { pageSize: basisPageSize.value, lawName: basisSearchKeyword.value || undefined }; - + queryAccordingList(params, (res) => { if (res.code === 200 || res.code === 0) { const list = res.data || res.rows || []; @@ -401,14 +400,14 @@ const initBasisList = async () => { basisPageNum.value = 1; enforcementBasisList.value = []; basisLoading.value = false; - await nextTick(); loadBasisList(); }; const handleSelectBasis = (basis) => { - // 转换字段名称,确保 name 字段存在 + // 转换字段名称,确保 name 和 id 字段存在 emit('selectBasis', { - name: basis.name || basis.lawName || '' + name: basis.name || basis.lawName || '', + id: basis.id || basis.lawId || '' }); localBasisPopup.value = false; }; @@ -433,25 +432,59 @@ watch(() => props.visible.basis, (val) => { const agencySearchKeyword = ref(''); const agencyList = ref([]); const selectedAgency = ref(''); +const agencyLoading = ref(false); +const agencyFinished = ref(false); +const agencyPageNum = ref(1); +const agencyPageSize = ref(10); const initAgencyList = () => { + agencyFinished.value = false; + agencyPageNum.value = 1; + agencyList.value = []; + agencyLoading.value = false; + loadAgencyList(); +}; + +const loadAgencyList = () => { + agencyLoading.value = true; + const params = { + pageNum: agencyPageNum.value, + pageSize: agencyPageSize.value, 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 || '' - })); + const total = res.total || res.count || 0; + + if (agencyPageNum.value === 1) { + agencyList.value = data.map(item => ({ + id: item.deptId || item.id || '', + name: item.deptName || item.name || '' + })); + } else { + agencyList.value = [...agencyList.value, ...data.map(item => ({ + id: item.deptId || item.id || '', + name: item.deptName || item.name || '' + }))]; + } + + if (total <= agencyPageSize.value * agencyPageNum.value) { + agencyFinished.value = true; + } else { + agencyPageNum.value++; + } } else { console.error('获取部门列表失败:', res.msg); - agencyList.value = []; + agencyFinished.value = true; } + agencyLoading.value = false; }, (err) => { console.error('获取部门列表接口失败', err); - agencyList.value = []; + agencyLoading.value = false; + agencyFinished.value = true; }); }; @@ -464,9 +497,9 @@ const clearAgencySearch = () => { initAgencyList(); }; -const handleSelectAgency = (name) => { - selectedAgency.value = name; - emit('selectEntrustedAgency', name); +const handleSelectAgency = (item) => { + selectedAgency.value = item.name; + emit('selectEntrustedAgency', { name: item.name, id: item.id || '' }); localEntrustedAgencyPopup.value = false; }; @@ -513,7 +546,7 @@ const loadNotices = () => { } else { noticeList.value = [...noticeList.value, ...data]; } - + if (total <= noticePage.value * noticePageSize.value) { finished.value = true; } else { diff --git a/zdxt-web-client/zdxt-efcode-enforcement-app/src/http/index.js b/zdxt-web-client/zdxt-efcode-enforcement-app/src/http/index.js index 1113b3f2..cbb58d0e 100644 --- a/zdxt-web-client/zdxt-efcode-enforcement-app/src/http/index.js +++ b/zdxt-web-client/zdxt-efcode-enforcement-app/src/http/index.js @@ -40,6 +40,7 @@ function request(type, url, params, success, error) { data: params, }; if (type == "GET") { + console.log(params); config.params = params; } else { config.data = params; 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 25287544..7bd13562 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 @@ -77,7 +77,7 @@ import { ref, reactive, computed, onMounted } from 'vue'; import { useRouter, useRoute } from 'vue-router'; import { showConfirmDialog, showSuccessToast, showToast } from 'vant'; import { loadDict } from '@/util/dictUtil'; -import { saveEnfRegistration, submitEnfRegistration } from '@/api/enforcement/index'; +import { saveEnfRegistration, submitEnfRegistration, addNonRegistration } from '@/api/enforcement/index'; import EnterpriseInfoSection from '@/components/enforcement/register/EnterpriseInfoSection.vue'; import EnforcementInfoSection from '@/components/enforcement/register/EnforcementInfoSection.vue'; import NonEnforcementInfoSection from '@/components/enforcement/register/NonEnforcementInfoSection.vue'; @@ -107,14 +107,36 @@ const formData = reactive({ checkCss: '', category: '', taskSource: '', - enforcementMatter: '', + lawEnforcementItemText: '', enforcementBases: [''], + enforcementBasesIds: [''], reason: '系统未能有效生成监管码', enforcementTime: '', - jointEnforcement: 0, - entrustedEnforcement: 0, + jointEnforcement: '0', + entrustedEnforcement: '0', + entrustedAgency: '', + entrustedAgencyId: '', fileList: [], attachments: [], + id: '', + unionNo: '', + lawId: '', + lawText: '', + uniteCheck: '', + enforce: '', + enforceReason: '', + lawField: '', + lawFieldText: '', + deptTexts: '', + deptObjs: [], + userObjs: [], + isUnite: 0, + reslut: 0, + remark: '', + subsidiaryer: '', + subsidiaryerId: '', + subsidiaryerText: '', + fileListObj: [] }); // 执法人员 @@ -154,14 +176,7 @@ const selectedPersonsList = computed(() => { // 选项数据(从字典获取) const categoryOptions = ref([]); - -const taskSourceOptions = [ - { text: '年度计划', value: '年度计划' }, - { text: '临时任务', value: '临时任务' }, - { text: '上级交办', value: '上级交办' }, - { text: '群众举报', value: '群众举报' }, -]; - +const checkCategoryOptions = ref([]); // ========== 事件处理函数 ========== // 关闭弹窗(保持 reactive 对象的响应式) @@ -211,12 +226,14 @@ const handleOpenBasisPicker = (index) => { // 添加执法依据 const handleAddBasis = () => { formData.enforcementBases.push(''); + formData.enforcementBasesIds.push(''); }; // 删除执法依据 const handleRemoveBasis = (index) => { if (formData.enforcementBases.length > 1) { formData.enforcementBases.splice(index, 1); + formData.enforcementBasesIds.splice(index, 1); } }; @@ -242,6 +259,7 @@ const handleSelectBasis = (basis) => { const index = currentEditIndex.value; if (index >= 0 && index < formData.enforcementBases.length) { formData.enforcementBases[index] = basis.name; + formData.enforcementBasesIds[index] = basis.id || ''; } showPopups.basis = false; }; @@ -259,6 +277,7 @@ const handleSelectEnterprise = (enterprise) => { const handleLinkNotice = (notice) => { formData.relatedNotice = `${notice.checkItem}`; formData.checkCss = notice.id; + formData.lawEnforcementItemText = notice.checkItem || ''; showPopups.notice = false; // showSuccessToast('关联成功'); }; @@ -281,8 +300,9 @@ const handleShowEntrustedAgencyPicker = () => { }; // 选择委托行政机关 -const handleSelectEntrustedAgency = (agencyName) => { - formData.entrustedAgency = agencyName; +const handleSelectEntrustedAgency = ({ name, id }) => { + formData.entrustedAgency = name; + formData.entrustedAgencyId = id; showPopups.entrustedAgency = false; }; @@ -295,55 +315,127 @@ const goBack = () => { const buildSubmitPayload = () => { const useCommonStr = sessionStorage.getItem('useCommon'); const useCommon = JSON.parse(useCommonStr) || {}; - + + // 主执法人员 const mainPerson = enforcementPersons.value[0] || {}; - const lawCertificateNumText = mainPerson.name && mainPerson.phonenumber - ? `${mainPerson.name} ${mainPerson.phonenumber}` + const lawEnforcer = mainPerson.name || ''; + const lawEnforcerId = mainPerson.id || ''; + const lawEnforcerTel = mainPerson.phonenumber || ''; + const lawCertificateNumText = mainPerson.name && mainPerson.phonenumber + ? `${mainPerson.name} ${mainPerson.phonenumber}` : ''; - - const lawEnforcerTwo = additionalPersons.value - .filter(p => p.name) - .map(p => p.name) + + // 额外执法人员(多个,逗号拼接) + const validAdditionalPersons = additionalPersons.value.filter(p => p.name); + const lawEnforcerTwo = validAdditionalPersons.map(p => p.name).join(','); + const lawEnforcerIdTwo = validAdditionalPersons.map(p => p.id).join(','); + const lawCertificateNumTwoText = validAdditionalPersons + .filter(p => p.name && p.phonenumber) + .map(p => `${p.name} ${p.phonenumber}`) .join(','); - - const lawEnforcerIdTwo = additionalPersons.value - .filter(p => p.id) - .map(p => p.id) + + // 构建 lawEnforcerOther:姓名,证件号,姓名,证件号,... + const lawEnforcerOther = validAdditionalPersons + .filter(p => p.name && p.phonenumber) + .map(p => `${p.name},${p.phonenumber}`) .join(','); - + const lawEnforcerIdOther = validAdditionalPersons.map(p => p.id).join(','); + const lawEnforcerTelOther = validAdditionalPersons.map(p => p.phonenumber || '').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 checkCategory = checkCategoryOptions.value.find(item => item.text === formData.taskSource)?.value || ''; const checkCategoryText = formData.taskSource || ''; - + + // 执法依据ID列表 + const lawEnforcementBasis = formData.enforcementBasesIds ? formData.enforcementBasesIds.join(',') : ''; + + // 非行政执法payload + if (isNonEnforcement.value) { + return { + enterpriseName: enterpriseData.value.enterpriseName || '', + enterpriseNumber: enterpriseData.value.enterpriseNumber || '', + enterpriseAddress: enterpriseData.value.enterpriseAddress || '', + enforcementTime: formData.enforcementTime || '', + lawEnforcer: lawEnforcer, + lawEnforcerId: lawEnforcerId, + lawEnforcerTel: lawEnforcerTel, + lawEnforcerOther: lawEnforcerOther, + lawEnforcerIdOther: lawEnforcerIdOther, + lawEnforcerTelOther: lawEnforcerTelOther, + bureauDeptId: useCommon.bureauUnitId || '', + bureauDeptName: useCommon.bureauUnitName || '', + creditcode: '', + lawEnforcementType: checkCategory, + lawEnforcementTypeText: checkCategoryText, + lawEnforcementItem: '', + lawEnforcementItemText: formData.lawEnforcementItemText || '', + lawEnforcementBasis: lawEnforcementBasis, + lawEnforcementBasisText: formData.enforcementBases ? formData.enforcementBases.join(',') : '', + fileList: buildFileList(), + userId: useCommon.userId || '', + reason: formData.reason || '', + checkCss: formData.checkCss || '0' + }; + } + + // 行政执法payload return { - enterpriseName: enterpriseData.value.enterpriseName || '', - enterpriseNumber: enterpriseData.value.enterpriseNumber || '', - oureauDeptName: formData.enforcementUnit || '', - checkCss: formData.checkCss || '', + id: formData.id || '', + lawEnforcement: useCommon.deptName || '', + lawEnforcementId: useCommon.deptId || '', + bureauDeptId: useCommon.bureauUnitId || '', + bureauDeptName: useCommon.bureauUnitName || '', + lawEnforcer: lawEnforcer, + lawEnforcerId: lawEnforcerId, lawCertificateNumText: lawCertificateNumText, lawEnforcerTwo: lawEnforcerTwo, lawEnforcerIdTwo: lawEnforcerIdTwo, - lawEnforceCategory: lawEnforceCategory, - lawEnforceCategoryText: lawEnforceCategoryText, + lawCertificateNumTwoText: lawCertificateNumTwoText, + subsidiaryer: formData.subsidiaryer || '', + subsidiaryerId: formData.subsidiaryerId || '', + subsidiaryerText: formData.subsidiaryerText || '', + lawEnforcementItem: '', + lawEnforcementItemText: formData.lawEnforcementItemText || '', + lawEnforcementBasis: lawEnforcementBasis, + reslut: formData.reslut || 0, + remark: formData.remark || '', + enterpriseName: enterpriseData.value.enterpriseName || '', + enterpriseNumber: enterpriseData.value.enterpriseNumber || '', + enterpriseAddress: enterpriseData.value.enterpriseAddress || '', + enforcementTime: formData.enforcementTime || '', + updateTimeFlag: 0, + fileList: buildFileList(), + fileListObj: formData.fileListObj || [], + isSubmit: 0, + unionNo: formData.unionNo || '', + hasUnion: formData.jointEnforcement === '1' ? 1 : 0, + hasAuto: formData.entrustedEnforcement === '1' ? 1 : 0, + lawId: formData.lawId || '', + lawText: formData.lawText || '', + uniteCheck: formData.uniteCheck || '', + enforce: formData.enforce || '', + checkCss: formData.checkCss || '', + enforceReason: formData.enforceReason || '', + lawField: formData.lawField || '', + lawFieldText: formData.lawFieldText || '', checkCategory: checkCategory, checkCategoryText: checkCategoryText, - hasUnion: formData.jointEnforcement || 0, - hasAuto: formData.entrustedEnforcement || 0, - lawEnforcement: useCommon.deptName || '', - lawEnforcementId: useCommon.deptId || '', - oureauDeptId: useCommon.bureauUnitId || '', - isRealUnion: formData.jointEnforcement === 1 ? 1 : 0, - lawEnforcementBasisText: formData.enforcementBases ? formData.enforcementBases.join(',') : '', - fileList: buildFileList(), - enforcementTime: formData.enforcementTime || '', - enforcementMatter: formData.enforcementMatter || '', + lawEnforceCategory: lawEnforceCategory, + lawEnforceCategoryText: lawEnforceCategoryText, + userId: useCommon.userId || '', + deptTexts: formData.deptTexts || '', + deptObjs: formData.deptObjs || [], + userObjs: formData.userObjs || [], + isUnite: formData.isUnite || 0, + entrustDeptName: formData.entrustedAgency || '', + entrustDeptId: formData.entrustedAgencyId || '', reason: formData.reason || '', - result: formData.result || '', - remark: formData.remark || '' + lawEnforcementBasisText: formData.enforcementBases ? formData.enforcementBases.join(',') : '', + oureauDeptName: formData.enforcementUnit || '' }; }; @@ -376,28 +468,21 @@ const buildFileList = () => { return (formData.fileList || []) .filter(img => img && (img.url || img.content)) .map(img => { - return img.url || ''; + return img.url || (img.content || ''); }) .filter(Boolean); }; // 提交表单 const onSubmit = () => { - // 有未上传完的附件则拦截 - const uploadingFile = (formData.fileList || []).find(img => img && img.status === 'uploading'); - if (uploadingFile) { - showToast('附件上传中,请稍后'); - return; - } - showConfirmDialog({ title: '确认提交', message: '确认提交吗?提交后将无法修改。', width: '80%', }).then(() => { const payload = buildSubmitPayload(); - console.log('提交数据:', payload); - submitEnfRegistration(payload, (res) => { + const submitApi = isNonEnforcement.value ? addNonRegistration : submitEnfRegistration; + submitApi(payload, (res) => { if (res.code === 200 || res.code === 0) { showSuccessToast('提交成功'); router.push('/enforcement/enforcementList'); @@ -468,6 +553,9 @@ onMounted(() => { categoryOptions.value = columns; }); + loadDict('check_category', (columns) => { + checkCategoryOptions.value = columns; + }); // 设置当前时间 const now = new Date(); formData.enforcementTime = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, '0')}-${String(now.getDate()).padStart(2, '0')} ${String(now.getHours()).padStart(2, '0')}:${String(now.getMinutes()).padStart(2, '0')}:${String(now.getSeconds()).padStart(2, '0')}`;