ソースを参照

fix:修补被监审单位选项权限的bug

cb_luzhixia 1 ヶ月 前
コミット
1ea4faf854

+ 7 - 0
src/api/auditEntityManage.js

@@ -22,6 +22,13 @@ export function getAllUnitList(data) {
     params: data,
   })
 }
+export function getAllUnitListByRegionCode(data) {
+  return request({
+    url: url + '/api/audited-unit/getList',
+    method: 'get',
+    params: data,
+  })
+}
 // /api/audited-unit/detail
 export function getAuditedUnitDetail(data) {
   return request({

+ 2 - 2
src/components/costAudit/EstablishmentDialog.vue

@@ -359,7 +359,7 @@
   // import UnitSelectDialog from '@/components/costAudit/UnitSelectDialog.vue'
   import UploadComponent from '@/components/costAudit/UploadComponent.vue'
   import { Message } from 'element-ui'
-  import { getAllUnitList } from '@/api/auditEntityManage'
+  import { getAllUnitListByRegionCode } from '@/api/auditEntityManage'
   import {
     addProjectApproval,
     editProjectApproval,
@@ -653,7 +653,7 @@
     },
     methods: {
       getAllUnitList() {
-        getAllUnitList().then((res) => {
+        getAllUnitListByRegionCode().then((res) => {
           this.unitList = res.value || []
           // 过滤掉状态为停用的数据
           this.unitList = this.unitList.filter((item) => item.status == 1)

+ 3 - 25
src/views/costAudit/projectInfo/auditProjectManage/annualReviewPlan/index.vue

@@ -213,7 +213,7 @@
                   @change="handleUnitChange"
                 >
                   <el-option
-                    v-for="unit in areaUnitList"
+                    v-for="unit in unitList"
                     :key="unit.unitId"
                     :label="unit.unitName"
                     :value="unit.unitId"
@@ -418,7 +418,7 @@
     getDefaultDem,
     getOrgListByDemId,
   } from '@/api/annualReviewPlan'
-  import { getAllUnitList } from '@/api/auditEntityManage'
+  import { getAllUnitListByRegionCode } from '@/api/auditEntityManage'
   import { dictMixin, regionMixin } from '@/mixins/useDict'
 
   export default {
@@ -617,28 +617,6 @@
       }
     },
     computed: {
-      areaUnitList() {
-        // 过滤出区域单位
-        let user = this.$permission.getUserInfo()
-        let arr = []
-        if (this.$permission.isAdminOrProvince()) {
-          // 管理员或省级权限,显示所有数据
-          arr = this.unitList
-        } else if (user && user.dataScope !== undefined) {
-          // 非管理员且数据范围为区域时,筛选出当前用户区域下的市区数据
-          // 确保areaLevel和dataScope都有有效值再进行比较
-          arr = this.unitList.filter(
-            (item) =>
-              item &&
-              item.areaLevel !== undefined &&
-              item.areaLevel >= user.dataScope
-          )
-        } else {
-          // 如果用户信息或数据范围不存在,返回空数组
-          arr = []
-        }
-        return arr
-      },
       areaOrgList() {
         // 过滤出区域单位
         let user = this.$permission.getUserInfo()
@@ -670,7 +648,7 @@
         this.handleSearch()
       },
       getAllUnitList() {
-        getAllUnitList().then((res) => {
+        getAllUnitListByRegionCode().then((res) => {
           this.unitList = res.value || []
           // 过滤掉状态为停用的数据
           this.unitList = this.unitList.filter((item) => item.status == 1)