Jelajahi Sumber

Merge branch 'master' of http://116.204.116.5:3000/zzw/cbjsxt-front-master

shiyanyu 1 bulan lalu
induk
melakukan
2dc67b1a90

+ 1 - 1
src/api/costSurveyFdTemplate.js

@@ -42,7 +42,7 @@ export function deleteSurveyFd(id) {
 
 export function batchDeleteSurveyFd(data) {
   return request({
-    url: `${url}/costSurveyFdTemplate/v1/`,
+    url: `${url}/costSurveyFdTemplateVersion/v1/`,
     method: 'delete',
     data,
   })

+ 2 - 0
src/components/costAudit/AuditEntityFormtDialog.vue

@@ -502,6 +502,8 @@
         // 加载所有单位列表
         getAllUnitList({ unitId: this.formData.unitId }).then((res) => {
           this.allUnits = res.value || []
+          // 过滤掉状态为停用的数据
+          this.allUnits = this.allUnits.filter((item) => item.status == 1)
         })
       },
       // 加载单位详情

+ 94 - 28
src/components/costAudit/EstablishmentDialog.vue

@@ -258,7 +258,7 @@
         <!-- 立项依据 -->
         <el-form-item label="立项依据:">
           <UploadComponent
-            :upload-mode="'single'"
+            :upload-mode="'multiple'"
             :max-size="50 * 1024 * 1024"
             :allowed-types="['xlsx', 'xls', 'doc', 'docx', 'pdf']"
             :files-list="accordingFileList"
@@ -271,7 +271,7 @@
         <!-- 其他材料 -->
         <el-form-item label="其他材料:">
           <UploadComponent
-            :upload-mode="'single'"
+            :upload-mode="'multiple'"
             :max-size="50 * 1024 * 1024"
             :allowed-types="['xlsx', 'xls', 'doc', 'docx', 'pdf']"
             :files-list="otherFileList"
@@ -511,15 +511,24 @@
               : []
             if (this.formData.auditPeriod) {
               this.formData.auditPeriodArray = this.formData.auditPeriod
-                .split('')
+                .split(',')
                 .map((year) => ({ value: year }))
             }
             this.formData.auditedUnitId = this.initialData.auditedUnitId
               ? this.initialData.auditedUnitId.split(',')
               : []
+            if (this.initialData.accordingFileUrl) {
+              this.accordingFileList =
+                this.initialData.accordingFileUrl.split(',')
+            }
+            if (this.initialData.otherFileUrl) {
+              this.otherFileList = this.initialData.otherFileUrl.split(',')
+            }
           }
           // 当弹窗关闭时重置表单
           if (!val) {
+            this.accordingFileList = []
+            this.otherFileList = []
             this.$nextTick(() => {
               if (this.$refs.initiationForm) {
                 this.$refs.initiationForm.resetFields()
@@ -527,23 +536,50 @@
             })
           }
         } else if (this.type === 3) {
-          this.formData.projectName = this.initialData.projectName
-          this.formData.auditType = this.initialData.auditType
-          this.formData.catalogId = this.initialData.catalogId
-          this.formData.areaCode = this.initialData.areaCode
-          this.formData.auditedUnitName = this.initialData.auditedUnitName
-          this.formData.auditedUnitId = this.initialData.auditedUnitId
-            ? this.initialData.auditedUnitId.split(',')
-            : []
-          this.formData.orgId = this.initialData.orgId
-          this.formData.planYear = this.initialData.planYear
-          if (this.formData.auditPeriod) {
-            this.formData.auditPeriodArray = this.initialData.auditPeriod
-              .split(',')
-              .map((year) => ({ value: year }))
+          // 当弹窗显示时设置数据
+          if (val && this.initialData) {
+            this.formData.projectName = this.initialData.projectName
+            this.formData.auditType = this.initialData.auditType
+            this.formData.catalogId = this.initialData.catalogId
+            this.formData.areaCode = this.initialData.areaCode
+            this.formData.auditedUnitName = this.initialData.auditedUnitName
+            this.formData.auditedUnitId = this.initialData.auditedUnitId
+              ? this.initialData.auditedUnitId.split(',')
+              : []
+            this.formData.orgId = this.initialData.orgId
+            this.formData.planYear = this.initialData.planYear
+            if (this.formData.auditPeriod) {
+              this.formData.auditPeriodArray = this.initialData.auditPeriod
+                .split(',')
+                .map((year) => ({ value: year }))
+            }
+          }
+          // 当弹窗关闭时重置表单
+          if (!val) {
+            this.accordingFileList = []
+            this.otherFileList = []
+            this.$nextTick(() => {
+              if (this.$refs.initiationForm) {
+                this.$refs.initiationForm.resetFields()
+              }
+            })
           }
         } else {
-          this.formData.areaCode = ''
+          // 当弹窗显示时初始化数据
+          if (val) {
+            this.formData.areaCode = ''
+            // 其他初始化逻辑
+          }
+          // 当弹窗关闭时重置表单
+          if (!val) {
+            this.accordingFileList = []
+            this.otherFileList = []
+            this.$nextTick(() => {
+              if (this.$refs.initiationForm) {
+                this.$refs.initiationForm.resetFields()
+              }
+            })
+          }
         }
       },
       'formData.districtId'(districtId) {
@@ -573,6 +609,8 @@
       getAllUnitList() {
         getAllUnitList().then((res) => {
           this.unitList = res.value || []
+          // 过滤掉状态为停用的数据
+          this.unitList = this.unitList.filter((item) => item.status == 1)
         })
       },
       // 获取默认维度
@@ -606,25 +644,53 @@
       // 立项依据文件处理
       saveAccordingFiles(data) {
         this.accordingFileList = data
-        this.formData.accordingFileUrl = data[0]?.savePath || ''
+        // 将所有文件的savePath以逗号分隔的形式保存
+        this.formData.accordingFileUrl = data
+          .map((file) => file.savePath)
+          .filter(Boolean)
+          .join(',')
       },
 
-      // 移除立项依据文件
-      removeAccordingFile() {
-        this.accordingFileList = []
-        this.formData.accordingFileUrl = ''
+      // 移除立项依据文件(支持单个文件删除)
+      removeAccordingFile(index) {
+        // 如果传入索引,则删除单个文件
+        if (typeof index === 'number') {
+          this.accordingFileList.splice(index, 1)
+        } else {
+          // 否则清空所有文件
+          this.accordingFileList = []
+        }
+        // 更新文件路径字符串
+        this.formData.accordingFileUrl = this.accordingFileList
+          .map((file) => file.savePath)
+          .filter(Boolean)
+          .join(',')
       },
 
       // 其他材料文件处理
       saveOtherFiles(data) {
         this.otherFileList = data
-        this.formData.otherFileUrl = data[0]?.savePath || ''
+        // 将所有文件的savePath以逗号分隔的形式保存
+        this.formData.otherFileUrl = data
+          .map((file) => file.savePath)
+          .filter(Boolean)
+          .join(',')
       },
 
-      // 移除其他材料文件
-      removeOtherFile() {
-        this.otherFileList = []
-        this.formData.otherFileUrl = ''
+      // 移除其他材料文件(支持单个文件删除)
+      removeOtherFile(index) {
+        // 如果传入索引,则删除单个文件
+        if (typeof index === 'number') {
+          this.otherFileList.splice(index, 1)
+        } else {
+          // 否则清空所有文件
+          this.otherFileList = []
+        }
+        // 更新文件路径字符串
+        this.formData.otherFileUrl = this.otherFileList
+          .map((file) => file.savePath)
+          .filter(Boolean)
+          .join(',')
       },
 
       // 处理地区选择变化

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

@@ -21,6 +21,7 @@
                 },
               }"
               style="width: 100%"
+              clearable
             ></el-cascader>
           </el-form-item>
           <el-form-item label="状态:">
@@ -471,6 +472,7 @@
             this.searchForm.catalogId && this.searchForm.catalogId.length > 0
               ? this.searchForm.catalogId[this.searchForm.catalogId.length - 1]
               : '',
+          status: this.searchForm.status,
           pageNum: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
         }

+ 32 - 19
src/views/costAudit/baseInfo/costFormManage/infoMaintain.vue

@@ -2237,10 +2237,6 @@
             }
           }
         )
-        this.contentEditForm.fixedTable.fixedTableHeaders =
-          this.contentEditForm.fixedTable.fixedTablesTitle.filter(
-            (title) => title.rkey !== '序号'
-          )
 
         return row
       },
@@ -2299,6 +2295,7 @@
 
       // 内容维护
       handleEditContent(row) {
+        this.viewDetail = false
         this.versionId = row.id
 
         // 显示加载状态
@@ -2498,6 +2495,15 @@
             }
 
             this.contentEditForm.fixedTable.tableHeaders.splice(index, 1)
+            let fixedFields = this.contentEditForm.fixedTable.tableHeaders
+              .map((item) => item.fieldName)
+              .join(',')
+            this.contentEditForm.fixedTable.fixedTablesTitle =
+              this.stringToObjects(fixedFields || '')
+            this.contentEditForm.fixedTable.fixedTableHeaders =
+              this.contentEditForm.fixedTable.fixedTablesTitle.filter(
+                (title) => title.rkey !== '序号'
+              )
             handleDelete()
             break
 
@@ -2515,6 +2521,15 @@
               return
             }
             this.contentEditForm.dynamicTable.tableHeaders.splice(index, 1)
+            let dynamicFields = this.contentEditForm.dynamicTable.tableHeaders
+              .map((item) => item.fieldName)
+              .join(',')
+            this.contentEditForm.dynamicTable.dynamicTablesTitle =
+              this.stringToObjects(dynamicFields || '')
+            this.contentEditForm.dynamicTable.dynamicTableHeaders =
+              this.contentEditForm.dynamicTable.dynamicTablesTitle.filter(
+                (title) => title.rkey !== '序号'
+              )
             handleDelete() // 执行删除逻辑
             break
           case '动态表项目':
@@ -2743,6 +2758,10 @@
                           this.initFixedTableRow(row)
                         }
                       )
+                      this.contentEditForm.fixedTable.fixedTableHeaders =
+                        this.contentEditForm.fixedTable.fixedTablesTitle.filter(
+                          (title) => title.rkey !== '序号'
+                        )
                     })
                     .catch((error) => {
                       console.error('查询失败:', error)
@@ -2804,6 +2823,10 @@
                           this.initDynamicTableRow(row)
                         }
                       )
+                      this.contentEditForm.dynamicTable.dynamicTableHeaders =
+                        this.contentEditForm.dynamicTable.dynamicTablesTitle.filter(
+                          (title) => title.rkey !== '序号'
+                        )
                     })
                     .catch((error) => {
                       console.error('查询失败:', error)
@@ -3354,14 +3377,13 @@
             delSurveyTemplateVersionById(row.id)
               .then((res) => {
                 if (res.code === 200) {
-                  this.$message.success('删除成功')
-                  this.loading = false
+                  this.$message.success(res.message)
                   this.handleSearch()
+                  this.loading = false
                 }
               })
               .catch((error) => {
                 console.error('删除失败:', error)
-                this.$message.error('删除失败,请重试')
                 this.loading = false
               })
           })
@@ -3387,23 +3409,14 @@
             const ids = this.selectedRows.map((row) => row.id)
 
             batchDeleteCostForm(ids)
-              .then(() => {
-                this.selectedRows.forEach((row) => {
-                  const index = this.tableData.findIndex(
-                    (item) => item.id === row.id
-                  )
-                  if (index > -1) {
-                    this.tableData.splice(index, 1)
-                  }
-                })
-                this.pagination.total -= this.selectedRows.length
+              .then((res) => {
                 this.selectedRows = []
-                this.$message.success('批量删除成功')
+                this.$message.success(res.message)
+                this.handleSearch()
                 this.loading = false
               })
               .catch((error) => {
                 console.error('批量删除失败:', error)
-                this.$message.error('批量删除失败,请重试')
                 this.loading = false
               })
           })

File diff ditekan karena terlalu besar
+ 347 - 490
src/views/costAudit/baseInfo/costVerifyManage/infoMaintain.vue


+ 31 - 15
src/views/costAudit/baseInfo/financeSheetManage/infoMaintain.vue

@@ -179,7 +179,7 @@
           ></el-input>
         </el-form-item>
       </el-form>
-      <div slot="footer">
+      <div slot="footer" class="dialog-footer">
         <el-button @click="dialogVisible = false">取消</el-button>
         <el-button type="primary" @click="submitForm">确定</el-button>
       </div>
@@ -189,7 +189,7 @@
     <el-dialog
       title="内容维护"
       :visible.sync="contentEditDialogVisible"
-      width="70%"
+      width="75%"
       class="content-edit-dialog"
     >
       <div class="content-edit-container">
@@ -2497,6 +2497,15 @@
             }
 
             this.contentEditForm.fixedTable.tableHeaders.splice(index, 1)
+            let fixedFields = this.contentEditForm.fixedTable.tableHeaders
+              .map((item) => item.fieldName)
+              .join(',')
+            this.contentEditForm.fixedTable.fixedTablesTitle =
+              this.stringToObjects(fixedFields || '')
+            this.contentEditForm.fixedTable.fixedTableHeaders =
+              this.contentEditForm.fixedTable.fixedTablesTitle.filter(
+                (title) => title.rkey !== '序号'
+              )
             handleDelete()
             break
 
@@ -2514,6 +2523,15 @@
               return
             }
             this.contentEditForm.dynamicTable.tableHeaders.splice(index, 1)
+            let dynamicFields = this.contentEditForm.dynamicTable.tableHeaders
+              .map((item) => item.fieldName)
+              .join(',')
+            this.contentEditForm.dynamicTable.dynamicTablesTitle =
+              this.stringToObjects(dynamicFields || '')
+            this.contentEditForm.dynamicTable.dynamicTableHeaders =
+              this.contentEditForm.dynamicTable.dynamicTablesTitle.filter(
+                (title) => title.rkey !== '序号'
+              )
             handleDelete() // 执行删除逻辑
             break
           case '动态表项目':
@@ -2747,6 +2765,10 @@
                           this.initFixedTableRow(row)
                         }
                       )
+                      this.contentEditForm.fixedTable.fixedTableHeaders =
+                        this.contentEditForm.fixedTable.fixedTablesTitle.filter(
+                          (title) => title.rkey !== '序号'
+                        )
                     })
                     .catch((error) => {
                       console.error('查询失败:', error)
@@ -2808,6 +2830,10 @@
                           this.initDynamicTableRow(row)
                         }
                       )
+                      this.contentEditForm.dynamicTable.dynamicTableHeaders =
+                        this.contentEditForm.dynamicTable.dynamicTablesTitle.filter(
+                          (title) => title.rkey !== '序号'
+                        )
                     })
                     .catch((error) => {
                       console.error('查询失败:', error)
@@ -3253,24 +3279,14 @@
             this.loading = true
             const ids = this.selectedRows.map((row) => row.id)
 
-            batchDeleteSurveyFd({ ids })
-              .then(() => {
-                this.selectedRows.forEach((row) => {
-                  const index = this.tableData.findIndex(
-                    (item) => item.id === row.id
-                  )
-                  if (index > -1) {
-                    this.tableData.splice(index, 1)
-                  }
-                })
-                this.pagination.total -= this.selectedRows.length
+            batchDeleteSurveyFd({ ids: ids })
+              .then((res) => {
                 this.selectedRows = []
-                this.$message.success('批量删除成功')
+                this.$message.success(res.message)
                 this.loading = false
               })
               .catch((error) => {
                 console.error('批量删除失败:', error)
-                this.$message.error('批量删除失败,请重试')
                 this.loading = false
               })
           })

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

@@ -97,11 +97,15 @@
         </template>
       </el-table-column>
       <el-table-column
-        prop="auditedUnitName"
+        prop="auditedUnitId"
         label="被监审单位"
         align="center"
         show-overflow-tooltip
-      />
+      >
+        <template slot-scope="scope">
+          {{ getUnitName(scope.row.auditedUnitId) }}
+        </template>
+      </el-table-column>
       <el-table-column
         prop="auditTime"
         label="监审时间"
@@ -626,8 +630,28 @@
       getAllUnitList() {
         getAllUnitList().then((res) => {
           this.unitList = res.value || []
+          // 过滤掉状态为停用的数据
+          this.unitList = this.unitList.filter((item) => item.status == 1)
         })
       },
+      getUnitName(unitId) {
+        // 直接处理unitId值,而不是row对象
+        if (unitId && typeof unitId === 'string' && unitId.includes(',')) {
+          // 如果包含逗号,分割成数组并查找对应的unitName
+          const unitIds = unitId.split(',')
+          return unitIds
+            .map((id) => {
+              const unit = this.unitList.find((item) => item.unitId == id)
+              return unit ? unit.unitName : ''
+            })
+            .filter((name) => name) // 过滤空值
+            .join(',')
+        } else {
+          // 单个unitId的情况
+          const unit = this.unitList.find((item) => item.unitId == unitId)
+          return unit ? unit.unitName : ''
+        }
+      },
       // 获取默认维度
       getDefaultDem() {
         getDefaultDem().then((res) => {

+ 39 - 50
src/views/costAudit/projectInfo/auditProjectManage/initiation/index.vue

@@ -14,18 +14,13 @@
         class="search-form"
       >
         <el-form-item label="年度:">
-          <el-select
-            v-model="searchForm.year"
+          <el-date-picker
+            v-model="searchForm.projectYear"
+            type="year"
             placeholder="请选择年度"
-            clearable
-          >
-            <el-option
-              v-for="(item, index) in years"
-              :key="index"
-              :label="item.dictLabel"
-              :value="item.dictValue"
-            ></el-option>
-          </el-select>
+            format="yyyy"
+            value-format="yyyy"
+          ></el-date-picker>
         </el-form-item>
 
         <el-form-item label="地区:">
@@ -113,7 +108,7 @@
           align="center"
         >
           <template slot-scope="scope">
-            {{ areaCodeNameMap[scope.row.areaCode] }}
+            {{ regionNameMap[scope.row.areaCode] }}
           </template>
         </el-table-column>
         <el-table-column
@@ -141,7 +136,7 @@
           show-overflow-tooltip
         >
           <template slot-scope="scope">
-            {{ UnitNameMap[scope.row.auditedUnitId] }}
+            {{ getUnitName(scope.row.auditedUnitId) }}
           </template>
         </el-table-column>
         <el-table-column
@@ -153,7 +148,7 @@
         <el-table-column
           prop="sourceType"
           label="立项来源"
-          width="120"
+          width="100"
           align="center"
         >
           <template slot-scope="scope">
@@ -163,7 +158,7 @@
         <el-table-column
           prop="auditType"
           label="监审形式"
-          width="120"
+          width="100"
           align="center"
         >
           <template slot-scope="scope">
@@ -232,7 +227,7 @@
 
 <script>
   import { getDataList, delProjectApprovalById } from '@/api/auditInitiation'
-  import { getAuditedUnitDetail } from '@/api/auditEntityManage'
+  import { getAllUnitList } from '@/api/auditEntityManage'
   import { selectDictDataByType, getByCode } from '@/api/dictionaryManage'
   import { dictMixin, regionMixin } from '@/mixins/useDict'
   import { getOrgById } from '@/api/annualReviewPlan'
@@ -251,7 +246,7 @@
         },
         // 搜索表单
         searchForm: {
-          year: '',
+          projectYear: '',
           areaCode: [],
           projectName: '',
         },
@@ -263,8 +258,8 @@
         areaCodeNameMap: {},
         //监审主体名称映射
         orgNameMap: {},
-        //被监审单位主体名称映射
-        UnitNameMap: {},
+        //被监审单位列表
+        unitList: [],
         // 分页信息
         pagination: {
           currentPage: 1,
@@ -294,7 +289,7 @@
         const params = {
           areaCode:
             this.searchForm.areaCode[this.searchForm.areaCode.length - 1] || '',
-          planYear: this.searchForm.year,
+          projectYear: this.searchForm.projectYear,
           projectName: this.searchForm.projectName,
           pageNum: this.pagination.currentPage,
           pageSize: this.pagination.pageSize,
@@ -387,39 +382,33 @@
       },
       //获取被监审单位名称
       batchGetUnitNames() {
-        this.projectList.forEach((row) => {
-          const unitId = row.auditedUnitId
-          getAuditedUnitDetail({ unitId: unitId })
-            .then((res) => {
-              if (res && res.value && res.value.unitName) {
-                // 缓存名称
-                this.$set(this.UnitNameMap, unitId, res.value.unitName)
-              }
-            })
-            .catch((err) => {
-              console.error('获取被监审单位主体名称失败', err)
-              this.$set(this.UnitNameMap, unitId, '获取失败')
-            })
-            .finally(() => {})
+        getAllUnitList().then((res) => {
+          this.unitList = res.value || []
+          // 过滤掉状态为停用的数据
+          this.unitList = this.unitList.filter((item) => item.status == 1)
         })
       },
+      getUnitName(unitId) {
+        // 直接处理unitId值,而不是row对象
+        if (unitId && typeof unitId === 'string' && unitId.includes(',')) {
+          // 如果包含逗号,分割成数组并查找对应的unitName
+          const unitIds = unitId.split(',')
+          return unitIds
+            .map((id) => {
+              const unit = this.unitList.find((item) => item.unitId == id)
+              return unit ? unit.unitName : ''
+            })
+            .filter((name) => name) // 过滤空值
+            .join(',')
+        } else {
+          // 单个unitId的情况
+          const unit = this.unitList.find((item) => item.unitId == unitId)
+          return unit ? unit.unitName : ''
+        }
+      },
       //获取立项地区名称
       batchGetAreaNames() {
-        this.projectList.forEach((row) => {
-          const areaCode = row.areaCode
-          getByCode({ code: areaCode })
-            .then((res) => {
-              if (res && res.value && res.value.name) {
-                // 缓存名称
-                this.$set(this.areaCodeNameMap, areaCode, res.value.name)
-              }
-            })
-            .catch((err) => {
-              console.error('获取立项地区名称失败', err)
-              this.$set(this.areaCodeNameMap, areaCode, '获取失败')
-            })
-            .finally(() => {})
-        })
+        this.fetchRegionNames(this.projectList, 'areaCode')
       },
 
       // 查看项目详情
@@ -433,7 +422,7 @@
       handleEdit(row) {
         this.establishType = 1
         this.projectInfo = row
-        this.projectInfo.auditedUnitName = this.UnitNameMap[row.auditedUnitId]
+        // this.projectInfo.auditedUnitName = this.UnitNameMap[row.auditedUnitId]
         this.projectInfo.orgName = this.orgNameMap[row.orgId]
         // this.projectName
         // this.orgNameMap[scope.row.orgId]

+ 2 - 0
src/views/costAudit/projectInfo/auditTaskManage/taskCustomizedRelease/auditNoticeTab.vue

@@ -427,6 +427,8 @@
         // 加载所有单位列表
         getAllUnitList().then((res) => {
           this.allUnits = res.value || []
+          // 过滤掉状态为停用的数据
+          this.allUnits = this.allUnits.filter((item) => item.status == 1)
         })
       },
 

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini