Pārlūkot izejas kodu

fix:修补年度监审计划管理,新增时-被监审单位应只显示本区域内的bug,任务制定发布-任务定制的bug,搜索条件的bug

cb_luzhixia 1 mēnesi atpakaļ
vecāks
revīzija
733f78535e

+ 7 - 1
src/api/uc.js

@@ -101,12 +101,18 @@ export function resetPassword(params) {
 }
 
 //获取系统中所有用户
-export function getAllUserList() {
+export function getAllUserList1() {
   return request({
     url: `${uc}/api/user/v2/users/getAllUser`,
     method: 'get',
   })
 }
+export function getAllUserList() {
+  return request({
+    url: `${uc}/api/user/v2/users/getUserList`,
+    method: 'get',
+  })
+}
 
 // 获取企业单位用户
 export function getOrgUserQuery(params) {

+ 27 - 5
src/components/costAudit/AuditEntityFormtDialog.vue

@@ -595,12 +595,18 @@
               ? res.value.relatedUnits.split(',')
               : [],
             relatedItems: result.relatedItems,
-            // 构建区域级联数据
-            areaCode: [
+          }
+          // 构建区域级联数据
+          if (res.value.areaLevel == 0) {
+            this.formData.areaCode = [res.value.province]
+          } else if (res.value.areaLevel == 1) {
+            this.formData.areaCode = [res.value.province, res.value.city]
+          } else if (res.value.areaLevel == 2) {
+            this.formData.areaCode = [
               res.value.province,
-              ...(res.value.areaLevel >= 1 ? [res.value.city] : []),
-              ...(res.value.areaLevel === 2 ? [res.value.county] : []),
-            ].filter(Boolean),
+              res.value.city,
+              res.value.county,
+            ]
           }
         })
       },
@@ -765,6 +771,22 @@
                 ? this.formData.areaCode[this.formData.areaCode.length - 1]
                 : '',
           }
+          let user = this.$permission.getUserInfo()
+          const areaCodeLength = this.formData.areaCode.length
+          if (user.dataScope === 0) {
+            submitData.areaLevel = areaCodeLength - 1
+            console.log('user.dataScope', user.dataScope)
+            console.log('areaCodeLength', areaCodeLength)
+            console.log('submitData.areaLevel', submitData.areaLevel)
+          } else if (user.dataScope === 1 || user.dataScope === 2) {
+            submitData.areaLevel = areaCodeLength
+            console.log('user.dataScope', user.dataScope)
+            console.log('areaCodeLength', areaCodeLength)
+            console.log('submitData.areaLevel', submitData.areaLevel)
+          } else {
+            // 处理其他可能的数据范围值,提供默认值
+            submitData.areaLevel = 0
+          }
 
           // 根据是否有unitId判断是添加还是修改操作
           let result

+ 38 - 3
src/components/costAudit/EstablishmentDialog.vue

@@ -55,7 +55,7 @@
             style="width: 76%"
           >
             <el-option
-              v-for="unit in unitList"
+              v-for="unit in areaUnitList"
               :key="unit.unitId"
               :label="unit.unitName"
               :value="unit.unitId"
@@ -289,7 +289,7 @@
             style="width: 100%"
           >
             <el-option
-              v-for="(item, index) in userList"
+              v-for="(item, index) in areaUserList"
               :key="index"
               :label="item.fullname"
               :value="item.userId"
@@ -306,7 +306,7 @@
             multiple
           >
             <el-option
-              v-for="(item, index) in userList"
+              v-for="(item, index) in areaUserList"
               :key="index"
               :label="item.fullname"
               :value="item.userId"
@@ -497,6 +497,40 @@
         },
       }
     },
+    computed: {
+      areaUnitList() {
+        // 过滤出区域单位
+        let user = this.$permission.getUserInfo()
+        let arr = []
+        if (this.$permission.isAdminOrProvince()) {
+          // 管理员或省级权限,显示所有数据
+          arr = this.unitList
+        } else {
+          // 非管理员且数据范围为区域时,筛选出当前用户区域下的市区数据
+          arr = this.unitList.filter((item) => item.areaLevel >= user.dataScope)
+        }
+        return arr
+      },
+      areaUserList() {
+        // 过滤出区域用户
+        // let user = this.$permission.getUserInfo()
+        // let arr = []
+        // if (this.$permission.isAdminOrProvince()) {
+        //   // 管理员或省级权限,显示所有数据
+        //   arr = this.userList
+        // } else {
+        //   // 非管理员且数据范围为区域时,筛选出当前用户区域下的用户数据
+        //   if(user.dataScope == '0'){
+        //     arr = this.userList.filter((item) => item.provinceCode == user.provinceCode)
+        //   }else if(user.dataScope == '1'){
+        //     arr = this.userList.filter((item) => item.cityCode == user.cityCode)
+        //   }else if(user.dataScope == '2'){
+        //     arr = this.userList.filter((item) => item.countyCode == user.countyCode)
+        //   }
+        // }
+        return this.userList
+      },
+    },
     watch: {
       visible(val) {
         // 当弹窗显示时初始化数据
@@ -836,6 +870,7 @@
         this.dialogAddUnitVisible = false
         this.getAllUnitList()
         this.formData.auditedUnitId.push(value)
+        this.formData.areaCode = data.areaCode[data.areaCode.length - 1]
       },
     },
   }

+ 1 - 1
src/views/costAudit/baseInfo/auditEntityManage/index.vue

@@ -221,7 +221,7 @@
             ? this.searchForm.areaCode[this.searchForm.areaCode.length - 1]
             : '',
           unitName: this.searchForm.unitName,
-          pageNum: this.pagination.currentPage,
+          page: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
         }
 

+ 4 - 3
src/views/costAudit/baseInfo/costVerifyManage/index.vue

@@ -18,6 +18,7 @@
           <el-input
             v-model="searchForm.keyword"
             placeholder="请输入模板名称"
+            clearable
           ></el-input>
         </el-form-item>
 
@@ -225,7 +226,7 @@
       </el-table>
       <el-pagination
         class="mt20"
-        :current-page.sync="searchForm.pageNum"
+        :current-page.sync="searchForm.page"
         :page-size="searchForm.pageSize"
         :page-sizes="[50, 100]"
         layout="total, sizes, prev, pager, next, jumper"
@@ -1082,7 +1083,7 @@
         selectedRows: [],
         pagination: {
           currentPage: 1,
-          pageSize: 10,
+          pageSize: 50,
           total: 0,
         },
         dialogVisible: false,
@@ -1390,7 +1391,7 @@
           catalogId: '',
           keyword: '',
           page: 1,
-          pageSize: 10,
+          pageSize: 50,
         }
         this.handleSearch()
       },

+ 2 - 0
src/views/costAudit/baseInfo/financeSheetManage/index.vue

@@ -10,6 +10,7 @@
               :options="catalogListOptions"
               v-bind="props"
               style="width: 100%"
+              clearable
             ></el-cascader>
           </el-form-item>
           <el-form-item label="状态:">
@@ -539,6 +540,7 @@
 
         const params = {
           catalogId: this.searchForm.catalogId,
+          status: this.searchForm.status,
           page: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
         }

+ 32 - 2
src/views/costAudit/projectInfo/auditProjectManage/annualReviewPlan/index.vue

@@ -213,7 +213,7 @@
                   @change="handleUnitChange"
                 >
                   <el-option
-                    v-for="unit in unitList"
+                    v-for="unit in areaUnitList"
                     :key="unit.unitId"
                     :label="unit.unitName"
                     :value="unit.unitId"
@@ -322,7 +322,7 @@
                   clearable
                 >
                   <el-option
-                    v-for="Org in OrgList"
+                    v-for="Org in areaOrgList"
                     :key="Org.id"
                     :label="Org.name"
                     :value="Org.id"
@@ -616,6 +616,35 @@
         },
       }
     },
+    computed: {
+      areaUnitList() {
+        // 过滤出区域单位
+        let user = this.$permission.getUserInfo()
+        let arr = []
+        if (this.$permission.isAdminOrProvince()) {
+          // 管理员或省级权限,显示所有数据
+          arr = this.unitList
+        } else {
+          // 非管理员且数据范围为区域时,筛选出当前用户区域下的市区数据
+          arr = this.unitList.filter((item) => item.areaLevel >= user.dataScope)
+        }
+        return arr
+      },
+      areaOrgList() {
+        // 过滤出区域单位
+        let user = this.$permission.getUserInfo()
+        let arr = []
+        if (this.$permission.isAdminOrProvince()) {
+          // 管理员或省级权限,显示所有数据
+          arr = this.OrgList
+        } else {
+          console.log('this.OrgList', this.OrgList)
+          // 非管理员且数据范围为区域时,筛选出当前用户区域下的市区数据
+          arr = this.OrgList
+        }
+        return arr
+      },
+    },
     mounted() {
       this.handleSearch() //加载数据
       this.getDefaultDem()
@@ -934,6 +963,7 @@
         this.getAllUnitList()
         this.currentProject.auditedUnitId.push(value)
         this.currentProject.areaCode = data.areaCode[data.areaCode.length - 1]
+        // this.currentProject.areaLevel = data.areaLevel
       },
     },
   }

+ 1 - 1
src/views/costAudit/projectInfo/auditProjectManage/memoManage/memoManageMixin.js

@@ -433,7 +433,7 @@ export const memoManageMixin = {
     initCalendarData(num) {
       this.selectedDate = new Date()
       this.lunarInfo = this.getLunarInfo(this.selectedDate)
-      this.handleSearch(num)
+      // this.handleSearch(num)
     },
     onTabChange(tab) {
       this.searchParams.startTime = ''

+ 33 - 6
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/auditNoticeTab.vue

@@ -191,6 +191,7 @@
                   placeholder="请选择被监审单位"
                   style="width: 100%"
                   clearable
+                  :multiple="isMultipleMode"
                 >
                   <el-option
                     v-for="item in allUnits"
@@ -466,9 +467,7 @@
       },
     },
     watch: {},
-    mounted() {
-      this.loadOpts()
-    },
+    mounted() {},
     methods: {
       handleDocumentTypeClick(data) {
         this.activeDocumentTypeId = data.id
@@ -517,9 +516,29 @@
           this.allUnits = res.value || []
           // 过滤掉状态为停用的数据
           this.allUnits = this.allUnits.filter((item) => item.status == 1)
-          this.allUnits = this.allUnits.filter(
-            (item) => item.unitId == this.project.auditedUnitId
-          )
+          // 筛选this.project.auditedUnitId中的单位,支持多种格式
+          if (this.project.auditedUnitId) {
+            // 确保将project.auditedUnitId转换为数组格式
+            let auditedUnitIds = []
+            if (Array.isArray(this.project.auditedUnitId)) {
+              auditedUnitIds = this.project.auditedUnitId
+            } else if (
+              typeof this.project.auditedUnitId === 'string' &&
+              this.project.auditedUnitId.includes(',')
+            ) {
+              // 如果是逗号分隔的字符串,转换为数组
+              auditedUnitIds = this.project.auditedUnitId
+                .split(',')
+                .map((id) => id.trim())
+            } else {
+              // 单个ID也转换为数组
+              auditedUnitIds = [this.project.auditedUnitId]
+            }
+            // 使用数组进行筛选
+            this.allUnits = this.allUnits.filter((item) =>
+              auditedUnitIds.includes(item.unitId)
+            )
+          }
         })
       },
 
@@ -553,6 +572,13 @@
           updateBy: '',
           updateTime: '',
         }
+        // if(this.isMultipleMode){
+        //   this.document.enterpriseId = this.project.auditedUnitId ? this.project.auditedUnitId.split(',') : []
+        //   console.log('this.document.enterpriseId',this.document.enterpriseId)
+        // }else{
+        //   this.document.enterpriseId = this.project.auditedUnitId
+        // }
+        this.loadOpts()
         if (this.activeDocumentTypeId) {
           this.document.documentId = this.activeDocumentTypeId
           this.handleTemplateChange()
@@ -568,6 +594,7 @@
               ...this.document,
               ...res.value,
             }
+            this.loadOpts()
           }
         })
       },

+ 11 - 3
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/index.vue

@@ -309,11 +309,19 @@
         if (row.projectMembers) {
           auditTeamMembers = row.projectMembers.split(',')
         }
-        if (
-          this.$permission.isAdmin() ||
+        // if (
+        //   this.$permission.isAdmin() ||
+        //   row.leaderId === user.userId ||
+        //   auditTeamMembers.some((item) => item === user.userId)
+        // ) {
+        //   return true
+        // }
+        let isShow =
+          this.$permission.isAdminOrProvince() ||
+          user.dataScope == '1' ||
           row.leaderId === user.userId ||
           auditTeamMembers.some((item) => item === user.userId)
-        ) {
+        if (isShow) {
           return true
         }
       },