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 @@