Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

zzw 1 mesiac pred
rodič
commit
2d008f70e8

+ 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]
       },
     },
   }

+ 4 - 4
src/views/EntDeclaration/auditTaskManagement/taskFillIn.vue

@@ -4,7 +4,7 @@
     :size="drawerSize"
     :with-header="true"
     :modal="true"
-    style="z-index: 9000"
+    :z-index="9000"
     :close-on-click-modal="false"
     :show-close="true"
     @close="handleDrawerClose"
@@ -147,9 +147,9 @@
         title="补充材料"
         :visible.sync="materialDialogVisible"
         width="600px"
-        style="z-index: 10000"
+        :z-index="10000"
         :close-on-click-modal="false"
-        :modal="false"
+        :modal="true"
         append-to-body
       >
         <el-form
@@ -280,7 +280,7 @@
         :title="'选择模板'"
         :visible="costAuditDialogVisible"
         width="50%"
-        style="z-index: 11000"
+        :z-index="20000"
         :close-on-click-modal="false"
         :confirm-loading="costAuditSubmitting"
         @confirm="submitCostAuditTemplate"

+ 13 - 27
src/views/costAudit/baseInfo/auditDocNoManage/index.vue

@@ -62,11 +62,11 @@
 
         <!-- 操作按钮区域 -->
         <div class="operation-bar">
-          <el-button
-            v-region-permission="{
+          <!-- v-region-permission="{
               category: 'auditDocNoManage',
               action: 'add',
-            }"
+            }" -->
+          <el-button
             plain
             type="success"
             icon="el-icon-circle-plus"
@@ -115,33 +115,25 @@
             </div>
           </template>
           <template #action="{ row }">
-            <el-button
-              v-region-permission="{
+            <!-- v-region-permission="{
                 category: 'auditReviewDocManage',
                 action: 'view',
-              }"
-              type="text"
-              size="mini"
-              @click="handleDetail(row)"
-            >
+              }" -->
+            <el-button type="text" size="mini" @click="handleDetail(row)">
               详情
             </el-button>
-            <el-button
-              v-region-permission="{
+            <!-- v-region-permission="{
                 category: 'auditReviewDocManage',
                 action: 'edit',
-              }"
-              type="text"
-              size="mini"
-              @click="handleEdit(row)"
-            >
+              }" -->
+            <el-button type="text" size="mini" @click="handleEdit(row)">
               修改
             </el-button>
-            <el-button
-              v-region-permission="{
+            <!-- v-region-permission="{
                 category: 'auditReviewDocManage',
                 action: 'delete',
-              }"
+              }" -->
+            <el-button
               type="text"
               size="mini"
               class="delete-btn"
@@ -330,13 +322,7 @@
           </div>
 
           <div slot="footer" class="dialog-footer">
-            <el-button
-              v-if="dialogTitle === '添加'"
-              type="primary"
-              @click="handleSave"
-            >
-              确认
-            </el-button>
+            <el-button type="primary" @click="handleSave">确认</el-button>
             <el-button @click="dialogVisible = false">取消</el-button>
           </div>
         </el-dialog>

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

@@ -221,15 +221,15 @@
             ? this.searchForm.areaCode[this.searchForm.areaCode.length - 1]
             : '',
           unitName: this.searchForm.unitName,
-          pageNum: this.pagination.currentPage,
+          page: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
         }
 
         getAuditedUnitList(params)
           .then(async (res) => {
             this.loading = false
-            this.tableData = res.value.records || []
-            this.pagination.total = res.value.total || 0
+            this.tableData = res.rows || []
+            this.pagination.total = res.total || 0
             // 安全地预处理区域名称
             if (this.tableData && this.tableData.length > 0) {
               try {

+ 24 - 1
src/views/costAudit/baseInfo/costFormManage/index.vue

@@ -88,6 +88,9 @@
           @selection-change="handleSelectionChange"
           @pagination-change="handlePaginationChange"
         >
+          <!-- :table-props="{
+            defaultSort: { prop: 'createTime', order: 'descending' },
+          }" -->
           <template #catalogId="{ row }">
             <span class="table-name-link">
               {{ getCatalogNames(row) }}
@@ -117,6 +120,15 @@
             >
               详情
             </el-button>
+            <!-- 查看内容详情 -->
+            <el-button
+              v-if="!$permission.isAdminOrProvince()"
+              type="text"
+              size="mini"
+              @click="handleDropdownCommand('infoMaintain', row)"
+            >
+              内容详情
+            </el-button>
             <el-button
               v-region-permission="{
                 category: 'costFormManage',
@@ -499,6 +511,18 @@
         ]
       },
     },
+    watch: {
+      // 监听目录数据变化,数据加载完成后处理回显
+      catalogListOptions: {
+        handler(newVal) {
+          if (newVal && newVal.length > 0) {
+            // 数据加载完成后,重新处理value
+            this.batchGetCatalogNames()
+          }
+        },
+        immediate: true,
+      },
+    },
     mounted() {
       // 初始化表单选项
       // this.initFormOptions()
@@ -546,7 +570,6 @@
             if (res.rows.length > 0) {
               this.tableData = res.rows || []
               this.pagination.total = res.total || 0
-              this.batchGetCatalogNames()
             }
           })
           .catch((error) => {

+ 36 - 1
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -40,6 +40,7 @@
     <!-- 操作栏 -->
     <div class="operation-bar">
       <el-button
+        v-region-permission="{ category: 'costFormManage', action: 'add' }"
         plain
         type="success"
         icon="el-icon-circle-plus"
@@ -48,6 +49,11 @@
         添加
       </el-button>
       <el-button
+        v-region-permission="{
+          category: 'costFormManage',
+          action: 'delete',
+          targetData: row,
+        }"
         plain
         type="danger"
         icon="el-icon-delete"
@@ -80,11 +86,23 @@
 
         <!-- 操作列 -->
         <template #action="{ row }">
-          <el-button type="text" size="small" @click="handleViewDetail(row)">
+          <el-button
+            v-region-permission="{
+              category: 'costFormManage',
+              action: 'view',
+            }"
+            type="text"
+            size="small"
+            @click="handleViewDetail(row)"
+          >
             详情
           </el-button>
           <el-button
             v-if="row.status === '-1'"
+            v-region-permission="{
+              category: 'costFormManage',
+              action: 'edit',
+            }"
             type="text"
             size="small"
             @click="handleEdit(row)"
@@ -93,6 +111,11 @@
           </el-button>
           <el-button
             v-if="row.status != '0'"
+            v-region-permission="{
+              category: 'costFormManage',
+              action: 'delete',
+              targetData: row,
+            }"
             class="delete-btn"
             type="text"
             size="small"
@@ -102,6 +125,10 @@
           </el-button>
           <el-button
             v-if="row.status === '-1'"
+            v-region-permission="{
+              category: 'costFormManage',
+              action: 'edit',
+            }"
             type="text"
             size="small"
             @click="handleEditContent(row)"
@@ -110,6 +137,10 @@
           </el-button>
           <el-button
             v-if="row.status === '-1'"
+            v-region-permission="{
+              category: 'costFormManage',
+              action: 'edit',
+            }"
             type="text"
             size="small"
             @click="handleStatus(row)"
@@ -118,6 +149,10 @@
           </el-button>
           <el-button
             v-if="row.status === '0'"
+            v-region-permission="{
+              category: 'costFormManage',
+              action: 'edit',
+            }"
             type="text"
             size="small"
             @click="handleStatus(row)"

+ 19 - 8
src/views/costAudit/baseInfo/costVerifyManage/index.vue

@@ -18,6 +18,7 @@
           <el-input
             v-model="searchForm.keyword"
             placeholder="请输入模板名称"
+            clearable
           ></el-input>
         </el-form-item>
 
@@ -80,6 +81,7 @@
         :default-sort="{ prop: 'createTime', order: 'descending' }"
         @selection-change="handleSelectionChange"
       >
+        <!-- :default-sort="{ prop: 'createTime', order: 'descending' }" -->
         <el-table-column
           type="selection"
           width="55"
@@ -151,10 +153,11 @@
           prop="createTime"
           label="创建时间"
           width="160"
-          sortable
           show-overflow-tooltip
           align="center"
+          sortable
         >
+          <!-- sortable -->
           <template slot-scope="scope">
             <div>{{ scope.row.createTime.split(' ')[0] }}</div>
             <div>{{ scope.row.createTime.split(' ')[1] }}</div>
@@ -162,7 +165,6 @@
         </el-table-column>
 
         <el-table-column
-          v-if="$permission.isAdminOrProvince()"
           label="操作"
           width="240"
           fixed="right"
@@ -225,7 +227,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"
@@ -239,7 +241,7 @@
     <el-dialog
       :title="dialogTitle"
       :visible.sync="dialogVisible"
-      width="70%"
+      width="75%"
       :close-on-click-modal="false"
     >
       <el-form
@@ -1082,7 +1084,7 @@
         selectedRows: [],
         pagination: {
           currentPage: 1,
-          pageSize: 10,
+          pageSize: 50,
           total: 0,
         },
         dialogVisible: false,
@@ -1158,6 +1160,16 @@
       }
     },
     watch: {
+      // 监听目录数据变化,数据加载完成后处理回显
+      catalogListOptions: {
+        handler(newVal) {
+          if (newVal && newVal.length > 0) {
+            // 数据加载完成后,重新处理value
+            this.batchGetCatalogNames()
+          }
+        },
+        immediate: true,
+      },
       indicatorTableData: {
         handler(newVal) {
           if (this.radioType === 'other' && this.selectedTemplateId) {
@@ -1379,7 +1391,6 @@
           if (res.rows.length > 0) {
             this.tableData = res.rows || []
             this.pagination.total = res.total || 0
-            this.batchGetCatalogNames()
           }
         })
       },
@@ -1390,7 +1401,7 @@
           catalogId: '',
           keyword: '',
           page: 1,
-          pageSize: 10,
+          pageSize: 50,
         }
         this.handleSearch()
       },
@@ -1519,7 +1530,7 @@
                 this.generateFromSurveyTemplate()
               } else if (this.contentEditForm.createmode == '2') {
                 if (!this.contentEditForm.createtemplateid1) {
-                  this.$message.error('请选择成本调查表模板')
+                  this.$message.error('请选择历史核定模板')
                   return
                 }
                 this.generateFromHistoryTemplate()

+ 17 - 1
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="状态:">
@@ -96,6 +97,9 @@
           @selection-change="handleSelectionChange"
           @pagination-change="handlePaginationChange"
         >
+          <!-- :table-props="{
+            defaultSort: { prop: 'createTime', order: 'descending' },
+          }" -->
           <template #catalogId="{ row }">
             <span class="table-name-link">
               {{ getCatalogNames(row) }}
@@ -500,6 +504,18 @@
         ]
       },
     },
+    watch: {
+      // 监听目录数据变化,数据加载完成后处理回显
+      catalogListOptions: {
+        handler(newVal) {
+          if (newVal && newVal.length > 0) {
+            // 数据加载完成后,重新处理value
+            this.batchGetCatalogNames()
+          }
+        },
+        immediate: true,
+      },
+    },
     mounted() {
       if (!this.$permission.isAdminOrProvince()) {
         this.tableColumns.splice(this.tableColumns.length - 1, 1)
@@ -539,6 +555,7 @@
 
         const params = {
           catalogId: this.searchForm.catalogId,
+          status: this.searchForm.status,
           page: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
         }
@@ -547,7 +564,6 @@
             if (res.rows.length > 0) {
               this.tableData = res.rows || []
               this.pagination.total = res.total || 0
-              this.batchGetCatalogNames()
             }
           })
           .catch((error) => {

+ 41 - 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,44 @@
         },
       }
     },
+    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()
+        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 +972,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
         }
       },