From 595111c613a339d6c8dc28774dd94f3ee3087ffe Mon Sep 17 00:00:00 2001 From: zhouxy Date: Wed, 28 Jan 2026 16:54:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=AC=E5=8A=9E=E5=8A=9F=E8=83=BD=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E9=80=89=E6=8B=A9=E5=85=A8=E9=83=A8=E6=9C=BA=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user.js | 11 ++++ src/views/credit/company/RemoveAccept.vue | 61 ++++++++++++++++------ src/views/credit/repair/Accept.vue | 62 +++++++++++++++++------ 3 files changed, 102 insertions(+), 32 deletions(-) diff --git a/src/api/user.js b/src/api/user.js index bbfb0da..fa4b2c3 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -87,4 +87,15 @@ getStationByOrg }) } +export function getOrgunits(orgNumber, orgLevel) { + return request({ + url: '/tOrgunits/getAllOrgunits', + method: 'post', + params: { + orgNumber, + orgLevel + } + }) +} + diff --git a/src/views/credit/company/RemoveAccept.vue b/src/views/credit/company/RemoveAccept.vue index 83c3fdc..2c6b7cc 100644 --- a/src/views/credit/company/RemoveAccept.vue +++ b/src/views/credit/company/RemoveAccept.vue @@ -548,14 +548,19 @@ *转办机关 - - - + @@ -869,13 +874,12 @@ import HandleDialog from '@/components/HandleDialog' import { removeAttachementById, listAttachmentByBizseq } from '@/api/attachment' import { abnRemTransfer, bizRemoveNext, getBizRemInfo, removeBizRemListBySplistid, getBizRemoveRecordList, returnToApplyer, addrRemovCheck, checknb, getaicepsYbList, geteGtAlterRecoderList } from '@/api/abnormal' -import { getUsersWithPermission, getStationByOrg } from '@/api/user' +import {getUsersWithPermission, getStationByOrg, getOrgunits} from '@/api/user' import { getConstant, getCD72 } from '@/api/system' import { validBeforeUpload } from '@/api/fileUpload' import editor from '@/components/editor.vue' import { taskOpinion } from '@/api/task' import { getContentsWithBizseq, saveOrUpdateContent, getNewestOpinion } from '@/api/credit' -import { nextRemTask } from '@/api/illegal' import { isMenHu } from '@/utils/utils' import { checkPyBlacklist } from '@/api/pyBlacklist' @@ -1138,14 +1142,11 @@ export default { this.getRepairDecContent() // 加载常用语 this.opinionOptions = this.$util.getCommonWords(this.user.primaryKey) - console.log(this.user.orgCode) // 加载转办机关下拉框选项 - getStationByOrg({ 'regorg': this.user.orgCode }).then(res => { + getOrgunits('15', 0).then(res => { if (res.code === 0) { - res.data.forEach(each => { - console.log(each) - this.orgList.push(each) - }) + // 将扁平数据转换为树形结构以适应 cascader + this.orgList = this.convertToTreeStructure(res.data) } }) // 加载企业移出原因 @@ -2203,6 +2204,34 @@ export default { } }) } + }, + convertToTreeStructure(data) { + // 如果后端返回的就是树形结构,直接使用 + // 如果是扁平结构,需要转换 + if (data && data.length > 0 && data[0].hasOwnProperty('children')) { + return data // 已经是树形结构 + } else { + // 如果是扁平结构,需要转换为树形结构 + // 假设数据有 parentCode 和 code 字段表示层级关系 + const map = {} + const roots = [] + + // 创建映射 + data.forEach(item => { + map[item.value] = { ...item, children: [] } + }) + + // 构建树形结构 + data.forEach(item => { + if (item.parentValue && map[item.parentValue]) { + map[item.parentValue].children.push(map[item.value]) + } else { + roots.push(map[item.value]) + } + }) + + return roots + } } } } diff --git a/src/views/credit/repair/Accept.vue b/src/views/credit/repair/Accept.vue index 03b8fe0..023c265 100644 --- a/src/views/credit/repair/Accept.vue +++ b/src/views/credit/repair/Accept.vue @@ -350,14 +350,19 @@ *转办机关 - - - + @@ -613,7 +618,7 @@