shiyanyu 2 settimane fa
parent
commit
367e871565

+ 69 - 38
src/components/task/components/costAudit.vue

@@ -356,10 +356,12 @@
       },
       // TemplateTypeChange
       handleTemplateTypeChange(val) {
-        if (this.auditForm.templateType == '1') {
-          this.historyTemplate = ''
-        } else if (this.auditForm.templateType == '2') {
-          this.dataTable = ''
+        if (this.auditForm.templateType === '1') {
+          this.auditForm.historyTemplate = ''
+          this.auditForm.surveyTemplateId = this.auditForm.dataTable
+        } else if (this.auditForm.templateType === '2') {
+          this.auditForm.dataTable = ''
+          this.auditForm.surveyTemplateId = this.auditForm.historyTemplate
         }
       },
 
@@ -410,27 +412,34 @@
             taskId: this.selectedProject.taskId,
           })
           this.auditForm.surveyTemplateId = data.value
-            ? data.value.surveyTemplateId
-            : ''
-          this.loadTemplateDataForEdit(this.auditForm.surveyTemplateId)
+            ? data.value.surveyTemplateId || this.auditForm.dataTable
+            : this.auditForm.dataTable
+          await this.loadTemplateDataForEdit(this.auditForm.surveyTemplateId)
         } catch (error) {
           console.error('生成模板失败:', error)
-        } finally {
+          this.$message.error('生成模板失败:' + (error.message || '未知错误'))
         }
       },
       // 根据历史核定模板生成
       async generateFromHistoryTemplate() {
-        // 保存模板基本信息
-        let data = await generateCostVerifyFormData({
-          catalogId: this.auditForm.catalogId,
-          templatename: this.auditForm.surveyTemplateName,
-          templateId: this.auditForm.historyTemplate,
-          taskId: this.selectedProject.taskId,
-        })
-        this.auditForm.surveyTemplateId = data.value
-          ? data.value.surveyTemplateId
-          : ''
-        this.loadTemplateDataForEdit(this.auditForm.surveyTemplateId)
+        try {
+          // 保存模板基本信息
+          let data = await generateCostVerifyFormData({
+            catalogId: this.auditForm.catalogId,
+            templatename: this.auditForm.surveyTemplateName,
+            templateId: this.auditForm.historyTemplate,
+            taskId: this.selectedProject.taskId,
+          })
+          this.auditForm.surveyTemplateId = data.value
+            ? data.value.surveyTemplateId || this.auditForm.historyTemplate
+            : this.auditForm.historyTemplate
+          await this.loadTemplateDataForEdit(this.auditForm.surveyTemplateId)
+        } catch (error) {
+          console.error('生成历史模板失败:', error)
+          this.$message.error(
+            '生成历史模板失败:' + (error.message || '未知错误')
+          )
+        }
       },
       // 回显数据用
       async loadTemplateData(surveyTemplateId) {
@@ -463,7 +472,7 @@
 
             if (templateDetailRes.value.createmode == '1') {
               this.auditForm.dataTable =
-                templateDetailRes.value.createtemplateid
+                templateDetailRes.value.surveyTemplateName
 
               // // 如果是调查表类型,调用 getSurveyDetail 获取调查表详情
               // if (this.auditForm.dataTable) {
@@ -498,25 +507,47 @@
         }
       },
       async loadTemplateDataForEdit(surveyTemplateId) {
-        // 并行获取表头和表格数据
-        const [tableHeadersRes, tableDataRes] = await Promise.all([
-          getlistBySurveyTemplateId({
-            surveyTemplateId: this.auditForm.surveyTemplateId,
-            taskId: this.selectedProject.taskId,
-          }),
-          getCostFormVersionsByTemplateId({
-            surveyTemplateId: this.auditForm.surveyTemplateId,
-            taskId: this.selectedProject.taskId,
-          }),
-        ])
-        // 处理表头数据
-        if (tableHeadersRes.code == 200) {
-          this.parseAndDisplayTableHeaders(tableHeadersRes)
+        if (!surveyTemplateId) {
+          console.error('surveyTemplateId 不能为空')
+          return
         }
-        // 处理表格数据
-        if (tableDataRes.code == 200) {
-          this.parseAndDisplayTableData(tableDataRes)
-          await this.tryEchoUploadData()
+        this.loading = true
+        try {
+          // 并行获取表头和表格数据
+          const [tableHeadersRes, tableDataRes] = await Promise.all([
+            getlistBySurveyTemplateId({
+              surveyTemplateId: surveyTemplateId,
+              taskId: this.selectedProject.taskId,
+            }),
+            getCostFormVersionsByTemplateId({
+              surveyTemplateId: surveyTemplateId,
+              taskId: this.selectedProject.taskId,
+            }),
+          ])
+          // 处理表头数据
+          if (tableHeadersRes.code == 200) {
+            this.parseAndDisplayTableHeaders(tableHeadersRes)
+          } else {
+            console.error(
+              '获取表头数据失败:',
+              tableHeadersRes.msg || '未知错误'
+            )
+          }
+
+          // 处理表格数据
+          if (tableDataRes.code == 200) {
+            this.parseAndDisplayTableData(tableDataRes)
+            await this.tryEchoUploadData()
+          } else {
+            console.error('获取表格数据失败:', tableDataRes.msg || '未知错误')
+          }
+        } catch (error) {
+          console.error('加载模板数据出错:', error)
+          this.$message.error(
+            '加载模板数据失败:' + (error.message || '未知错误')
+          )
+        } finally {
+          this.loading = false
         }
       },
       // 根据已存在的上传数据进行回显(若有)

+ 2 - 0
src/components/task/components/submitData.vue

@@ -292,6 +292,8 @@
         showRejectDialog: false, // 初审退回弹窗显示状态
         showAbortDialog: false, // 中止监审弹窗显示状态
         loading: false, // 加载状态
+        projectAuditPeriods: [], // 监审期间列表
+        projectAuditPeriod: '', // 当前选中的监审期间
         // 初审退回表单数据
         rejectForm: {
           opinion: '在初审阶段,需补充完善相关材料。',

+ 74 - 22
src/components/task/mounTaskComponents/materialTab.vue

@@ -72,8 +72,8 @@
     addCostProjectMaterial,
     updateCostProjectMaterial,
     deleteCostProjectMaterial,
-    getCostProjectMaterialPageList,
   } from '@/api/taskCustomizedRelease.js'
+  import { getDocumentCatalog } from '@/api/catalogManage.js'
   import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
   import LegalDialog from '@/views/costAudit/baseInfo/catalogManage/legalDialog.vue'
   import { dictMixin } from '@/mixins/useDict'
@@ -165,7 +165,10 @@
             width: 120,
             align: 'center',
             formatter: (row) => {
-              return this.getDictName('materialType', row.informationType)
+              return (
+                row.informationTypeName ||
+                this.getDictName('materialType', row.informationType)
+              )
             },
           },
           {
@@ -186,16 +189,13 @@
             width: 120,
             align: 'center',
             formatter: (row) => {
-              return this.getDictName('formatAsk', row.formatRequired)
+              return (
+                row.formatRequiredName ||
+                this.getDictName('formatAsk', row.formatRequired)
+              )
             },
           },
-          {
-            prop: 'orderNum',
-            label: '排序',
-            width: 120,
-            align: 'center',
-            slotName: 'orderNum',
-          },
+
           {
             prop: 'action',
             label: '操作',
@@ -235,20 +235,72 @@
         const { currentPage, pageSize } = this.pagination
         const params = {
           projectId: this.project.projectId,
-          page: currentPage,
-          size: pageSize,
+          catalogId:
+            this.project.catalogId ||
+            this.project.catalogid ||
+            this.project.catalogID ||
+            '',
+          pageNum: currentPage,
+          pageSize: pageSize,
         }
-        getCostProjectMaterialPageList(params)
+        getDocumentCatalog(params)
           .then((res) => {
-            if (res && res.value && res.value.value) {
-              this.materialList = Array.isArray(res.value.value.records)
-                ? res.value.value.records
-                : []
-              this.pagination.total = Number(res.value.value.total) || 0
-            } else {
-              this.materialList = []
-              this.pagination.total = 0
-            }
+            const value = res?.value || {}
+            const recordsRaw = Array.isArray(value.records)
+              ? value.records
+              : Array.isArray(value?.value?.records)
+              ? value.value.records
+              : []
+            const records = recordsRaw.map((item) => ({
+              // 兼容不同字段命名,便于表格直接使用
+              id: item.id || item.documentId || item.catalogId || '',
+              informationType:
+                item.informationType ??
+                item.materialType ??
+                item.catalogType ??
+                '',
+              informationName:
+                item.informationName ??
+                item.name ??
+                item.materialName ??
+                item.informationTitle ??
+                '',
+              informationRequire:
+                item.informationRequire ??
+                item.requireDesc ??
+                item.description ??
+                item.informationDesc ??
+                '',
+              formatRequired:
+                item.formatRequired ??
+                item.formatAsk ??
+                item.formatRequirement ??
+                '',
+              orderNum:
+                item.orderNum ??
+                item.orderNumber ??
+                item.sort ??
+                item.sortNo ??
+                1,
+              templateId:
+                item.templateId ||
+                item.surveyTemplateId ||
+                item.templateid ||
+                '',
+              surveyTemplateName:
+                item.surveyTemplateName ||
+                item.templateName ||
+                item.template_title ||
+                '',
+              isRequired:
+                item.isRequired != null ? String(item.isRequired) : '0',
+            }))
+            const total =
+              value.total ??
+              value?.value?.total ??
+              (Array.isArray(recordsRaw) ? recordsRaw.length : 0)
+            this.materialList = records
+            this.pagination.total = Number(total) || 0
           })
           .catch((error) => {
             console.error('加载材料数据失败:', error)

+ 41 - 8
src/components/task/mounTaskComponents/surveyTab.vue

@@ -6,7 +6,10 @@
       :table-data="surveyData.list"
       :columns="getSurveyColumns()"
       :show-action-column="true"
+      :show-pagination="true"
+      :pagination="costSurveyPagination"
       style="width: 100%"
+      @pagination-change="handlePaginationChange"
     ></CostAuditTable>
     <!-- 成本调查表查看弹窗 -->
     <SurveyDialog
@@ -22,7 +25,7 @@
 <script>
   import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
   import SurveyDialog from '@/views/costAudit/baseInfo/catalogManage/surveyDialog.vue'
-  import { getCostSurveyTemplates } from '@/api/catalogManage.js'
+  import { getCostSurveyForms } from '@/api/catalogManage.js'
   export default {
     components: {
       CostAuditTable,
@@ -60,6 +63,11 @@
         surveyData: {
           list: [],
         },
+        costSurveyPagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
       }
     },
     computed: {
@@ -103,14 +111,34 @@
         }
         this.loading = true
         const params = {
-          catalogId: this.project.catalogId,
+          catalogId:
+            this.project.catalogId ||
+            this.project.catalogid ||
+            this.project.catalogID ||
+            '',
+          pageNum: this.costSurveyPagination.currentPage,
+          pageSize: this.costSurveyPagination.pageSize,
         }
-        getCostSurveyTemplates(params)
+        getCostSurveyForms(params)
           .then((res) => {
-            if (res && res.value) {
-              const arr = Array.isArray(res.value) ? res.value : []
-              this.surveyData.list = arr
-            }
+            const value = res?.value || {}
+            const records = Array.isArray(value.records)
+              ? value.records
+              : Array.isArray(value?.value?.records)
+              ? value.value.records
+              : []
+            // 直接用 records;若无 records 则尝试把 value 视作数组
+            this.surveyData.list =
+              Array.isArray(records) && records.length > 0
+                ? records
+                : Array.isArray(value)
+                ? value
+                : []
+            const total =
+              value.total ??
+              value?.value?.total ??
+              (Array.isArray(records) ? records.length : 0)
+            this.costSurveyPagination.total = Number(total) || 0
           })
           .catch((error) => {
             console.error('加载调查模板数据失败:', error)
@@ -170,7 +198,7 @@
           templateType: data.templateType || '1',
           data: {
             ...data,
-            surveyId: data.surveyTemplateId,
+            surveyId: data.surveyId,
           },
           tableHeaders: [],
           fixedTable: {
@@ -191,6 +219,11 @@
         this.contentEditDialogTitle = '查看'
         this.contentEditDialogVisible = true
       },
+      handlePaginationChange({ currentPage, pageSize }) {
+        this.costSurveyPagination.currentPage = currentPage
+        this.costSurveyPagination.pageSize = pageSize
+        this.loadSurveyData()
+      },
       // 关闭内容编辑弹窗
       handleContentEditCancel() {
         this.contentEditDialogVisible = false

+ 164 - 230
src/components/task/taskComponents/materialTab.vue

@@ -9,91 +9,45 @@
         style="width: 100%"
         border
       >
-        <el-table-column prop="orderNum" label="序号" width="80" align="center">
+        <el-table-column label="序号" width="80" align="center">
           <template slot-scope="scope">
             {{ scope.$index + 1 }}
           </template>
         </el-table-column>
         <el-table-column
+          prop="informationTypeName"
+          label="材料分类"
+          min-width="140"
+          align="center"
+        />
+        <el-table-column
           prop="informationName"
-          label="报送资料"
+          label="材料名称"
           header-align="center"
           align="left"
-          min-width="200"
+          min-width="240"
+          show-overflow-tooltip
         />
         <el-table-column
-          prop="informationTypeName"
-          label="资料类型"
-          min-width="150"
-          align="center"
+          prop="informationRequire"
+          label="材料要求说明"
+          min-width="260"
+          align="left"
+          show-overflow-tooltip
         />
         <el-table-column
-          prop="isRequired"
-          label="是否必项"
-          min-width="120"
-          align="center"
-        >
-          <template slot-scope="scope">
-            {{
-              scope.row.isRequired === '1' || scope.row.isRequired === 1
-                ? '是'
-                : '否'
-            }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="isUpload"
-          label="是否上传"
+          prop="formatRequiredName"
+          label="格式要求"
           min-width="120"
           align="center"
-        >
-          <template slot-scope="scope">
-            <span
-              :class="
-                scope.row.isUpload === '1' || scope.row.isUpload === 1
-                  ? 'status-uploaded'
-                  : 'status-not-uploaded'
-              "
-            >
-              {{
-                scope.row.isUpload === '1' || scope.row.isUpload === 1
-                  ? '已上传'
-                  : '未上传'
-              }}
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="uploadTime"
-          label="上传时间"
-          width="150"
-          align="center"
-        >
-          <template slot-scope="scope">
-            {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="auditedStatus"
-          label="初审结果"
-          min-width="120"
+          :formatter="formatFormatRequired"
+        />
+        <!-- <el-table-column
+          prop="orderNum"
+          label="排序"
+          width="120"
           align="center"
-        >
-          <template slot-scope="scope">
-            {{ formatAuditStatus(scope.row.auditedStatus) }}
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="100" align="center" fixed="right">
-          <template slot-scope="scope">
-            <el-button
-              type="text"
-              size="small"
-              @click="handleViewDetail(scope.row)"
-            >
-              查看
-            </el-button>
-          </template>
-        </el-table-column>
+        /> -->
       </el-table>
     </div>
 
@@ -106,91 +60,45 @@
         style="width: 100%"
         border
       >
-        <el-table-column prop="orderNum" label="序号" width="80" align="center">
+        <el-table-column label="序号" width="80" align="center">
           <template slot-scope="scope">
             {{ scope.$index + 1 }}
           </template>
         </el-table-column>
         <el-table-column
+          prop="informationTypeName"
+          label="材料分类"
+          min-width="140"
+          align="center"
+        />
+        <el-table-column
           prop="informationName"
-          label="报送资料"
+          label="材料名称"
           header-align="center"
           align="left"
-          min-width="200"
+          min-width="240"
+          show-overflow-tooltip
         />
         <el-table-column
-          prop="informationTypeName"
-          label="资料类型"
-          min-width="150"
-          align="center"
+          prop="informationRequire"
+          label="材料要求说明"
+          min-width="260"
+          align="left"
+          show-overflow-tooltip
         />
         <el-table-column
-          prop="isRequired"
-          label="是否必项"
-          min-width="120"
-          align="center"
-        >
-          <template slot-scope="scope">
-            {{
-              scope.row.isRequired === '1' || scope.row.isRequired === 1
-                ? '是'
-                : '否'
-            }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="isUpload"
-          label="是否上传"
+          prop="formatRequiredName"
+          label="格式要求"
           min-width="120"
           align="center"
-        >
-          <template slot-scope="scope">
-            <span
-              :class="
-                scope.row.isUpload === '1' || scope.row.isUpload === 1
-                  ? 'status-uploaded'
-                  : 'status-not-uploaded'
-              "
-            >
-              {{
-                scope.row.isUpload === '1' || scope.row.isUpload === 1
-                  ? '已上传'
-                  : '未上传'
-              }}
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="uploadTime"
-          label="上传时间"
-          width="150"
-          align="center"
-        >
-          <template slot-scope="scope">
-            {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="auditedStatus"
-          label="初审结果"
-          min-width="120"
+          :formatter="formatFormatRequired"
+        />
+        <!-- <el-table-column
+          prop="orderNum"
+          label="排序"
+          width="120"
           align="center"
-        >
-          <template slot-scope="scope">
-            {{ formatAuditStatus(scope.row.auditedStatus) }}
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="100" align="center" fixed="right">
-          <template slot-scope="scope">
-            <el-button
-              type="text"
-              size="small"
-              @click="handleViewDetail(scope.row)"
-            >
-              查看
-            </el-button>
-          </template>
-        </el-table-column>
+        /> -->
       </el-table>
     </div>
 
@@ -203,91 +111,39 @@
         style="width: 100%"
         border
       >
-        <el-table-column prop="orderNum" label="序号" width="80" align="center">
+        <el-table-column label="序号" width="80" align="center">
           <template slot-scope="scope">
             {{ scope.$index + 1 }}
           </template>
         </el-table-column>
         <el-table-column
+          prop="informationTypeName"
+          label="材料分类"
+          min-width="140"
+          align="center"
+        />
+        <el-table-column
           prop="informationName"
-          label="报送资料"
+          label="材料名称"
           header-align="center"
           align="left"
-          min-width="200"
+          min-width="240"
+          show-overflow-tooltip
         />
         <el-table-column
-          prop="informationTypeName"
-          label="资料类型"
-          min-width="150"
-          align="center"
+          prop="informationRequire"
+          label="材料要求说明"
+          min-width="260"
+          align="left"
+          show-overflow-tooltip
         />
         <el-table-column
-          prop="isRequired"
-          label="是否必项"
+          prop="formatRequiredName"
+          label="格式要求"
           min-width="120"
           align="center"
-        >
-          <template slot-scope="scope">
-            {{
-              scope.row.isRequired === '1' || scope.row.isRequired === 1
-                ? '是'
-                : '否'
-            }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="isUpload"
-          label="是否上传"
-          min-width="120"
-          align="center"
-        >
-          <template slot-scope="scope">
-            <span
-              :class="
-                scope.row.isUpload === '1' || scope.row.isUpload === 1
-                  ? 'status-uploaded'
-                  : 'status-not-uploaded'
-              "
-            >
-              {{
-                scope.row.isUpload === '1' || scope.row.isUpload === 1
-                  ? '已上传'
-                  : '未上传'
-              }}
-            </span>
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="uploadTime"
-          label="上传时间"
-          width="150"
-          align="center"
-        >
-          <template slot-scope="scope">
-            {{ scope.row.uploadTime ? scope.row.uploadTime : '--' }}
-          </template>
-        </el-table-column>
-        <el-table-column
-          prop="auditedStatus"
-          label="初审结果"
-          min-width="120"
-          align="center"
-        >
-          <template slot-scope="scope">
-            {{ formatAuditStatus(scope.row.auditedStatus) }}
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="100" align="center" fixed="right">
-          <template slot-scope="scope">
-            <el-button
-              type="text"
-              size="small"
-              @click="handleViewDetail(scope.row)"
-            >
-              查看
-            </el-button>
-          </template>
-        </el-table-column>
+          :formatter="formatFormatRequired"
+        />
       </el-table>
     </div>
 
@@ -307,10 +163,12 @@
 </template>
 
 <script>
-  import { getMaterialByTaskId } from '@/api/home'
+  import { getDocumentCatalog } from '@/api/catalogManage.js'
+  import { dictMixin } from '@/mixins/useDict'
 
   export default {
     name: 'MaterialTab',
+    mixins: [dictMixin],
     props: {
       project: {
         type: Object,
@@ -320,6 +178,11 @@
         type: Boolean,
         default: false,
       },
+      // 是否自动加载报送资料(默认 true)。如需在父组件切换到页签时再加载,可置为 false。
+      autoLoad: {
+        type: Boolean,
+        default: true,
+      },
     },
     data() {
       return {
@@ -335,7 +198,11 @@
     watch: {
       project: {
         handler(newVal) {
-          if (newVal && newVal.taskId) {
+          if (!this.autoLoad) return
+          if (
+            newVal &&
+            (newVal.taskId || newVal.projectId || newVal.catalogId)
+          ) {
             this.loadMaterialData()
           }
         },
@@ -343,32 +210,81 @@
         immediate: true,
       },
     },
+    mounted() {
+      // if (
+      //   this.autoLoad &&
+      //   this.project &&
+      //   (this.project.taskId || this.project.projectId || this.project.catalogId)
+      // ) {
+      //   this.loadMaterialData()
+      // }
+    },
     methods: {
       // 加载报送资料数据
       async loadMaterialData() {
-        if (!this.project || !this.project.taskId) {
+        if (
+          !this.project ||
+          (!this.project.projectId && !this.project.catalogId)
+        ) {
           return
         }
         try {
           this.loading = true
-          const res = await getMaterialByTaskId({
-            taskId: this.project.taskId,
-          })
+          const params = {
+            projectId: this.project.projectId || this.project.projectID || '',
+            catalogId:
+              this.project.catalogId ||
+              this.project.catalogid ||
+              this.project.catalogID ||
+              '',
+            pageNum: 1,
+            pageSize: 500,
+          }
+          const res = await getDocumentCatalog(params)
 
-          if (res && res.state && res.value) {
-            // 根据接口返回的数据结构进行处理
-            // 如果返回是数组,直接使用;否则获取 records 或 data
-            const materialList = Array.isArray(res.value)
-              ? res.value
-              : res.value.records || res.value.data || []
+          const value = res?.value || {}
+          const records = Array.isArray(value.records)
+            ? value.records
+            : Array.isArray(value?.value?.records)
+            ? value.value.records
+            : Array.isArray(res?.value)
+            ? res.value
+            : []
 
-            this.materialData = materialList
-            // 按资料类型分组
-            this.groupMaterialData(materialList)
-          } else {
-            this.materialData = []
-            this.resetMaterialGroups()
-          }
+          // 归一化字段,便于表格/分组使用
+          const materialList = records.map((item) => ({
+            id: item.id || item.pkVal || '',
+            informationName:
+              item.informationName ||
+              item.informationTitle ||
+              item.materialName ||
+              '',
+            informationType: item.informationType || '',
+            informationTypeName:
+              item.informationTypeName ||
+              this.formatTypeName(item.informationType),
+            informationRequire:
+              item.informationRequire ||
+              item.requireDesc ||
+              item.description ||
+              item.informationDesc ||
+              '',
+            formatRequired: item.formatRequired || '',
+            formatRequiredName: item.formatRequiredName || '',
+            orderNum:
+              item.orderNum ||
+              item.orderNumber ||
+              item.sort ||
+              item.sortNo ||
+              1,
+            isRequired: item.isRequired != null ? String(item.isRequired) : '0',
+            isUpload: item.isUpload != null ? item.isUpload : item.uploaded,
+            uploadTime: item.uploadTime || item.createTime || '',
+            auditedStatus: item.auditedStatus,
+          }))
+
+          this.materialData = materialList
+          this.groupMaterialData(materialList)
         } catch (error) {
           console.error('加载报送资料失败:', error)
           this.materialData = []
@@ -429,6 +345,24 @@
         }
         return statusMap[status] || '未知'
       },
+      // 简单的类型名称兜底
+      formatTypeName(type) {
+        const map = {
+          1: '综合性资料',
+          2: '财务会计资料',
+          3: '其他资料',
+        }
+        return map[type] || ''
+      },
+      // 格式要求显示与目录管理一致
+      formatFormatRequired(row) {
+        return (
+          row.formatRequiredName ||
+          this.getDictName('formatAsk', row.formatRequired) ||
+          row.formatRequired ||
+          ''
+        )
+      },
     },
   }
 </script>

+ 32 - 7
src/components/task/taskComponents/surveyTab.vue

@@ -6,7 +6,10 @@
       :table-data="surveyData.list"
       :columns="getSurveyColumns()"
       :show-action-column="true"
+      :show-pagination="true"
+      :pagination="costSurveyPagination"
       style="width: 100%"
+      @pagination-change="handlePaginationChange"
     ></CostAuditTable>
     <!-- 成本调查表查看弹窗 -->
     <SurveyDialog
@@ -23,7 +26,7 @@
 <script>
   import CostAuditTable from '@/components/costAudit/CostAuditTable.vue'
   import SurveyDialog from '@/views/costAudit/baseInfo/catalogManage/surveyDialog.vue'
-  import { getCostSurveyTemplates } from '@/api/catalogManage.js'
+  import { getCostSurveyForms } from '@/api/catalogManage.js'
   export default {
     components: {
       CostAuditTable,
@@ -61,6 +64,11 @@
         surveyData: {
           list: [],
         },
+        costSurveyPagination: {
+          currentPage: 1,
+          pageSize: 10,
+          total: 0,
+        },
       }
     },
     computed: {
@@ -127,13 +135,23 @@
         this.loading = true
         const params = {
           catalogId: catalogId,
+          pageNum: this.costSurveyPagination.currentPage,
+          pageSize: this.costSurveyPagination.pageSize,
         }
-        getCostSurveyTemplates(params)
+        getCostSurveyForms(params)
           .then((res) => {
-            if (res && res.value) {
-              const arr = Array.isArray(res.value) ? res.value : []
-              this.surveyData.list = arr
-            }
+            const value = res?.value || {}
+            const records = Array.isArray(value.records)
+              ? value.records
+              : Array.isArray(value?.value?.records)
+              ? value.value.records
+              : []
+            this.surveyData.list = Array.isArray(records) ? records : []
+            const total =
+              value.total ??
+              value?.value?.total ??
+              (Array.isArray(records) ? records.length : 0)
+            this.costSurveyPagination.total = Number(total) || 0
           })
           .catch((error) => {
             console.error('加载调查模板数据失败:', error)
@@ -188,12 +206,13 @@
       },
       // 查看成本调查表内容弹窗
       handleViewTemplate(data) {
+        console.log(data, 'data')
         this.contentEditForm = {
           surveyTemplateName: data.surveyTemplateName || '',
           templateType: data.templateType || '1',
           data: {
             ...data,
-            surveyId: data.surveyTemplateId,
+            surveyId: data.surveyId,
           },
           tableHeaders: [],
           fixedTable: {
@@ -211,9 +230,15 @@
           isDynamicTables: false,
           isFixedTables: false,
         }
+        console.log(this.contentEditForm, 'qq数据')
         this.contentEditDialogTitle = '查看'
         this.contentEditDialogVisible = true
       },
+      handlePaginationChange({ currentPage, pageSize }) {
+        this.costSurveyPagination.currentPage = currentPage
+        this.costSurveyPagination.pageSize = pageSize
+        this.loadSurveyData()
+      },
       // 关闭内容编辑弹窗
       handleContentEditCancel() {
         this.contentEditDialogVisible = false

+ 1 - 0
src/components/task/taskDetail.vue

@@ -48,6 +48,7 @@
             ref="materialTab"
             :project="actualProject"
             :is-view="isView"
+            :auto-load="false"
             :material-data="materialData"
             @refresh="getMaterialData"
             @paginationChange="handlePaginationChange"

+ 100 - 85
src/views/costAudit/auditInfo/auditManage/details.vue

@@ -20,92 +20,103 @@
         </el-button>
       </div>
       <!-- 标签页面 -->
-      <el-tabs
-        v-model="activeTab"
-        type="card"
-        class="audit-tabs"
-        @tab-click="handleTabClick"
-      >
-        <el-tab-pane label="报送资料" name="submitData">
-          <submit-data
-            :id="id"
-            :current-node="currentNode"
-            :current-status="currentStatus"
-            :materials="submitMaterials"
-          />
-        </el-tab-pane>
-        <el-tab-pane label="成本调查表" name="costSurvey">
-          <cost-survey
-            :current-node="currentNode"
-            :current-status="currentStatus"
-            :paginated-data="costSurveyPaginated"
-            :pagination="costSurveyPagination"
-            :audited-unit-id="auditedUnitId"
-            :upload-id="''"
-            :survey-template-id="''"
-            :catalog-id="catalogId"
-            :project-id="selectedProject && selectedProject.projectId"
-            @handle-page-change="handleCostSurveyPageChange"
-            @handle-size-change="handleCostSurveySizeChange"
-            @refresh="handleCostSurveyRefresh"
-          />
-        </el-tab-pane>
-        <el-tab-pane
-          v-if="currentNode !== 'clcs'"
-          label="成本审核"
-          name="costAudit"
-        >
-          <cost-audit
-            :id="id"
-            :key="costAuditKey"
-            ref="costAudit"
-            :selected-project="selectedProject"
-            :current-node="currentNode"
-            :current-status="currentStatus"
-            :catalog-id="catalogId"
-            :audited-unit-id="auditedUnitId"
-          />
-        </el-tab-pane>
-        <el-tab-pane
-          v-if="currentNode !== 'clcs'"
-          label="工作底稿"
-          name="workDraft"
-        >
-          <work-draft
-            :id="id"
-            :current-node="currentNode"
-            :current-status="currentStatus"
-          />
-        </el-tab-pane>
-        <el-tab-pane
-          v-if="currentNode !== 'clcs'"
-          label="提取材料登记"
-          name="extractMaterial"
+      <template v-if="!isShenhe">
+        <el-tabs
+          v-model="activeTab"
+          type="card"
+          class="audit-tabs"
+          @tab-click="handleTabClick"
         >
-          <extract-material
-            :id="id"
-            :current-node="currentNode"
-            :current-status="currentStatus"
-          />
-        </el-tab-pane>
-        <el-tab-pane
-          v-if="currentNode !== 'clcs' && currentNode !== 'sdsh'"
-          label="成本审核意见"
-          name="auditOpinion"
-        >
-          <audit-opinion
-            :id="id"
-            :key="opinionKey"
-            :current-node="currentNode"
-            :current-status="currentStatus"
-            @refresh="handleAuditOpinionRefresh"
-            @close="handleClose"
-          />
-        </el-tab-pane>
-        <el-tab-pane label="消息通知" name="messageNotify">
-          <message-notify :id="id" />
-        </el-tab-pane>
-      </el-tabs>
+          <el-tab-pane label="报送资料" name="submitData">
+            <submit-data
+              :id="id"
+              :current-node="currentNode"
+              :current-status="currentStatus"
+              :materials="submitMaterials"
+            />
+          </el-tab-pane>
+          <el-tab-pane label="成本调查表" name="costSurvey">
+            <cost-survey
+              :current-node="currentNode"
+              :current-status="currentStatus"
+              :paginated-data="costSurveyPaginated"
+              :pagination="costSurveyPagination"
+              :audited-unit-id="auditedUnitId"
+              :upload-id="''"
+              :survey-template-id="''"
+              :catalog-id="catalogId"
+              :project-id="selectedProject && selectedProject.projectId"
+              @handle-page-change="handleCostSurveyPageChange"
+              @handle-size-change="handleCostSurveySizeChange"
+              @refresh="handleCostSurveyRefresh"
+            />
+          </el-tab-pane>
+          <el-tab-pane
+            v-if="currentNode !== 'clcs'"
+            label="成本审核"
+            name="costAudit"
+          >
+            <cost-audit
+              :id="id"
+              :key="costAuditKey"
+              ref="costAudit"
+              :selected-project="selectedProject"
+              :current-node="currentNode"
+              :current-status="currentStatus"
+              :catalog-id="catalogId"
+              :audited-unit-id="auditedUnitId"
+            />
+          </el-tab-pane>
+          <el-tab-pane
+            v-if="currentNode !== 'clcs'"
+            label="工作底稿"
+            name="workDraft"
+          >
+            <work-draft
+              :id="id"
+              :current-node="currentNode"
+              :current-status="currentStatus"
+            />
+          </el-tab-pane>
+          <el-tab-pane
+            v-if="currentNode !== 'clcs'"
+            label="提取材料登记"
+            name="extractMaterial"
+          >
+            <extract-material
+              :id="id"
+              :current-node="currentNode"
+              :current-status="currentStatus"
+            />
+          </el-tab-pane>
+          <el-tab-pane
+            v-if="currentNode !== 'clcs' && currentNode !== 'sdsh'"
+            label="成本审核意见"
+            name="auditOpinion"
+          >
+            <audit-opinion
+              :id="id"
+              :key="opinionKey"
+              :current-node="currentNode"
+              :current-status="currentStatus"
+              @refresh="handleAuditOpinionRefresh"
+              @close="handleClose"
+            />
+          </el-tab-pane>
+          <el-tab-pane label="消息通知" name="messageNotify">
+            <message-notify :id="id" />
+          </el-tab-pane>
+        </el-tabs>
+      </template>
+      <!-- 只显示报送资料 -->
+      <div v-else class="submit-data-container">
+        <submit-data
+          :id="id"
+          :current-node="currentNode"
+          :current-status="currentStatus"
+          :materials="submitMaterials"
+        />
+      </div>
     </el-dialog>
     <!-- 补充资料弹窗 -->
     <el-dialog
@@ -258,6 +269,10 @@
         type: Object,
         default: () => ({}),
       },
+      isShenhe: {
+        type: Boolean,
+        default: false,
+      },
     },
     data() {
       return {

+ 10 - 4
src/views/costAudit/auditInfo/auditManage/index.vue

@@ -157,7 +157,7 @@
                     scope.row.status === '200')
                 "
                 type="text"
-                @click="handleOpenDetails(scope.row)"
+                @click="handleOpenDetails(scope.row, 'shenhe')"
               >
                 审核
               </el-button>
@@ -198,7 +198,7 @@
       :visible.sync="detailsVisible"
       :current-node="selectedProject && selectedProject.currentNode"
       :current-status="selectedProject && selectedProject.status"
-      :task-info="selectedProject"
+      :is-shenhe="isShenhe"
       @close="handleDetailsClose"
       @refresh="handleRefresh"
     />
@@ -258,6 +258,7 @@
     mixins: [dictMixin],
     data() {
       return {
+        isShenhe: false,
         dictData: {
           projectProposal: [],
         },
@@ -439,10 +440,15 @@
       },
 
       // 打开详情弹窗
-      handleOpenDetails(project) {
-        // console.log('project', project)
+      handleOpenDetails(project, type) {
         this.selectedProject = project
+        this.isShenhe = type === 'shenhe'
         this.detailsVisible = true
+        this.$nextTick(() => {
+          if (this.$refs.detailsRef) {
+            this.$refs.detailsRef.open()
+          }
+        })
       },
       handleOpenMainDetails(project) {
         // console.log('project', project)

+ 40 - 1
src/views/costAudit/projectInfo/auditTaskManage/taskProgressManage/index.vue

@@ -74,7 +74,11 @@
         <!-- 操作列自定义内容 -->
         <template #action="{ row }">
           <template v-if="row.isSubTask">
-            <el-button size="mini" type="text" @click="handleView(row)">
+            <el-button
+              size="mini"
+              type="text"
+              @click="handleMessage(row, 'chengben')"
+            >
               查看
             </el-button>
             <el-button
@@ -324,6 +328,9 @@
       :is-view="isView"
     />
 
+    <!-- 任务信息弹窗 -->
+    <task-info ref="taskInfo" />
+
     <!-- 成本监审任务制定弹窗(封装自 tabs.vue,列表“详情/查看”入口使用) -->
     <task-customized-release-dialog
       :visible.sync="taskReleaseDialogVisible"
@@ -332,6 +339,15 @@
       @backToList="taskReleaseDialogVisible = false"
       @close="taskReleaseDialogVisible = false"
     />
+
+    <!-- 成本监审信息弹窗 -->
+    <cbjs-info
+      :id="cbjsInfoData && cbjsInfoData.id"
+      :selected-project="cbjsInfoData"
+      :visible.sync="cbjsInfoVisible"
+      :current-node="cbjsInfoData && cbjsInfoData.currentNode"
+      :current-status="cbjsInfoData && cbjsInfoData.status"
+    />
   </div>
 </template>
 
@@ -346,15 +362,23 @@
   import TaskDetail from '@/components/task/taskDetail.vue'
   import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
   import { createSuperviseTask } from '@/api/audit/supervise'
+  import cbjsInfo from '@/components/task/cbjsInfo.vue'
+  import taskInfo from '@/components/task/taskInfo.vue'
   export default {
     components: {
       CostAuditTable,
       TaskDetail,
       TaskCustomizedReleaseDialog,
+      cbjsInfo,
+      taskInfo,
     },
     mixins: [dictMixin],
     data() {
       return {
+        // 弹窗相关
+        cbjsInfoData: null, // 存储当前选中的成本监审信息
+        cbjsInfoVisible: false, // 控制成本监审信息弹窗的显示/隐藏
+
         dictData: {
           auditType: [], //监审形式
           projectProposal: [], //立项来源
@@ -985,6 +1009,21 @@
             this.$message.error('操作失败')
           })
       },
+      // 查看 - 修改为打开cbjsInfo弹窗
+      handleMessage(row, type) {
+        if (type === 'chengben') {
+          this.cbjsInfoData = { ...row, taskId: row.id }
+
+          console.log(this.cbjsInfoData, '数据')
+          this.cbjsInfoVisible = true
+        } else if (this.$refs.taskInfo) {
+          this.$refs.taskInfo.open(row, type)
+        } else {
+          console.warn('taskInfo 组件未找到,请确保已正确导入和注册')
+          // 如果 taskInfo 组件不存在,尝试使用其他方式处理
+          this.$message.warning('功能暂不可用,请联系管理员')
+        }
+      },
     },
   }
 </script>

+ 46 - 1
src/views/costAudit/projectInfo/auditTaskManage/taskQueryStatistics/index.vue

@@ -100,7 +100,11 @@
         <!-- 操作列自定义模板 -->
         <template #operation="{ row }">
           <template v-if="row.isSubTask">
-            <el-button size="mini" type="text" @click="handleView(row)">
+            <el-button
+              size="mini"
+              type="text"
+              @click="handleMessage(row, 'chengben')"
+            >
               查看
             </el-button>
           </template>
@@ -156,6 +160,17 @@
       @backToList="taskReleaseDialogVisible = false"
       @close="taskReleaseDialogVisible = false"
     />
+
+    <!-- 成本监审信息弹窗 -->
+    <cbjs-info
+      v-if="cbjsInfoData"
+      :id="cbjsInfoData.id || ''"
+      :selected-project="cbjsInfoData"
+      :visible.sync="cbjsInfoVisible"
+      :current-node="cbjsInfoData.currentNode || ''"
+      :current-status="cbjsInfoData.status || ''"
+      :survey-template-id="cbjsInfoData.surveyTemplateId || ''"
+    />
   </div>
 </template>
 
@@ -167,12 +182,14 @@
   import TaskDetail from '@/components/task/taskDetail.vue'
   import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
   import { getCostProjectDetail } from '@/api/taskCustomizedRelease.js'
+  import cbjsInfo from '@/components/task/cbjsInfo.vue'
   export default {
     components: {
       detailTabs,
       CostAuditTable,
       TaskDetail,
       TaskCustomizedReleaseDialog,
+      cbjsInfo,
     },
     mixins: [dictMixin, regionMixin],
     data() {
@@ -195,6 +212,9 @@
         pageNum: 1,
         pageSize: 10,
         total: 0,
+        // 成本监审信息弹窗相关
+        cbjsInfoData: null, // 存储当前选中的成本监审信息
+        cbjsInfoVisible: false, // 控制成本监审信息弹窗的显示/隐藏
         // 统计数据
         statistics: {
           pendingCount: 0,
@@ -479,6 +499,31 @@
           this.searchForm.areaCode = null
         }
       },
+      // 查看 - 修改为打开cbjsInfo弹窗
+      handleMessage(row, type) {
+        if (type === 'chengben') {
+          // 确保 row 存在并且包含必要的属性
+          if (row) {
+            this.cbjsInfoData = {
+              ...row,
+              taskId: row.id,
+              surveyTemplateId: row.surveyTemplateId || '', // 确保 surveyTemplateId 有默认值
+              currentNode: row.currentNode || '',
+              status: row.status || '',
+            }
+            console.log(this.cbjsInfoData, '数据')
+            this.cbjsInfoVisible = true
+          } else {
+            console.warn('行数据为空,无法打开弹窗')
+            this.$message.warning('无法查看:数据异常')
+          }
+        } else if (this.$refs.taskInfo) {
+          this.$refs.taskInfo.open(row, type)
+        } else {
+          console.warn('taskInfo 组件未找到,请确保已正确导入和注册')
+          this.$message.warning('功能暂不可用,请联系管理员')
+        }
+      },
     },
   }
 </script>

+ 52 - 3
src/views/costAudit/projectInfo/taskSuperviseManage/superviseMattersManage/index.vue

@@ -164,7 +164,11 @@
       >
         <template slot-scope="scope">
           <template v-if="scope.row.isSubTask || scope.row.pid != 0">
-            <el-button size="mini" type="text" @click="handleView(scope.row)">
+            <el-button
+              size="mini"
+              type="text"
+              @click="handleMessage(scope.row, 'chengben')"
+            >
               查看
             </el-button>
           </template>
@@ -227,7 +231,18 @@
     <task-detail
       ref="taskDetail"
       :visible.sync="taskDetailVisible"
-      :is-view="isView"
+      :is-view="true"
+    />
+
+    <!-- 成本监审信息弹窗 -->
+    <cbjs-info
+      v-if="cbjsInfoData"
+      :id="cbjsInfoData.id || ''"
+      :selected-project="cbjsInfoData"
+      :visible.sync="cbjsInfoVisible"
+      :current-node="cbjsInfoData.currentNode || ''"
+      :current-status="cbjsInfoData.status || ''"
+      :survey-template-id="cbjsInfoData.surveyTemplateId || ''"
     />
 
     <!-- 成本监审任务制定弹窗(母项“详情”) -->
@@ -243,6 +258,7 @@
 
 <script>
   import { getSupervisorList } from '@/api/superviseMattersManage'
+  import cbjsInfo from '@/components/task/cbjsInfo.vue'
   import { dictMixin } from '@/mixins/useDict'
   import UploadComponent from '@/components/costAudit/UploadComponent.vue'
   import { updateSuperviseTask } from '@/api/audit/supervise'
@@ -253,8 +269,8 @@
   export default {
     name: 'TaskSupervision',
     components: {
-      UploadComponent,
       TaskDetail,
+      cbjsInfo,
       TaskCustomizedReleaseDialog,
     },
     mixins: [dictMixin],
@@ -282,6 +298,9 @@
         isView: true,
         // 任务详情弹窗(子项)
         taskDetailVisible: false,
+        // 成本监审信息弹窗相关
+        cbjsInfoData: null, // 存储当前选中的成本监审信息
+        cbjsInfoVisible: false, // 控制成本监审信息弹窗的显示/隐藏
         // 成本监审任务制定弹窗(母项)
         taskReleaseDialogVisible: false,
         project: {},
@@ -495,6 +514,36 @@
       handleViewDialogClose() {
         this.taskDetailVisible = false
       },
+      // 查看 - 修改为打开cbjsInfo弹窗
+      handleMessage(row, type) {
+        console.log(row)
+        if (type === 'chengben') {
+          // 确保 row 存在并且包含必要的属性
+          if (row) {
+            // 确保从 scope.row 获取数据
+            const currentRow = row.row || row
+            this.cbjsInfoData = {
+              ...currentRow,
+              taskId: currentRow.id,
+              surveyTemplateId: currentRow.surveyTemplateId || '',
+              currentNode: currentRow.currentNode || '',
+              status: currentRow.status || '',
+            }
+            console.log('成本监审数据:', this.cbjsInfoData)
+            this.$nextTick(() => {
+              this.cbjsInfoVisible = true
+            })
+          } else {
+            console.warn('行数据为空,无法打开弹窗')
+            this.$message.warning('无法查看:数据异常')
+          }
+        } else if (this.$refs.taskInfo) {
+          this.$refs.taskInfo.open(row, type)
+        } else {
+          console.warn('taskInfo 组件未找到,请确保已正确导入和注册')
+          this.$message.warning('功能暂不可用,请联系管理员')
+        }
+      },
     },
   }
 </script>

+ 50 - 1
src/views/costAudit/projectInfo/taskSuperviseManage/superviseResultManage/index.vue

@@ -168,7 +168,11 @@
       >
         <template slot-scope="scope">
           <template v-if="scope.row.isSubTask">
-            <el-button size="mini" type="text" @click="handleView(scope.row)">
+            <el-button
+              size="mini"
+              type="text"
+              @click="handleMessage(scope.row, 'chengben')"
+            >
               查看
             </el-button>
           </template>
@@ -277,6 +281,16 @@
       @backToList="taskReleaseDialogVisible = false"
       @close="taskReleaseDialogVisible = false"
     />
+
+    <!-- 成本监审详情弹窗 -->
+    <cbjs-info
+      v-if="cbjsInfoVisible"
+      :id="cbjsInfoData.id"
+      :visible.sync="cbjsInfoVisible"
+      :selected-project="cbjsInfoData"
+      :current-node="cbjsInfoData.currentNode"
+      :current-status="cbjsInfoData.status"
+    />
   </div>
 </template>
 
@@ -288,11 +302,13 @@
   } from '@/api/audit/supervise'
   import TaskDetail from '@/components/task/taskDetail.vue'
   import TaskCustomizedReleaseDialog from '@/components/task/TaskCustomizedReleaseDialog.vue'
+  import CbjsInfo from '@/components/task/cbjsInfo.vue'
   import { getCostProjectDetail } from '@/api/taskCustomizedRelease.js'
   export default {
     components: {
       TaskDetail,
       TaskCustomizedReleaseDialog,
+      CbjsInfo,
     },
     data() {
       return {
@@ -403,6 +419,9 @@
         taskDetailVisible: false,
         taskReleaseDialogVisible: false,
         project: {},
+        // 成本监审详情弹窗
+        cbjsInfoVisible: false,
+        cbjsInfoData: {},
       }
     },
     mounted() {
@@ -664,6 +683,36 @@
         this.isSupervisionDetail = false
         this.currentTask = null
       },
+      // 查看 - 打开成本监审详情弹窗
+      handleMessage(row, type) {
+        if (type === 'chengben') {
+          // 确保 row 存在并且包含必要的属性
+          if (row) {
+            this.cbjsInfoData = {
+              ...row,
+              id: row.id, // 确保有 id 属性
+              projectId: row.id, // 项目ID
+              projectName: row.projectName, // 项目名称
+              auditedUnitId: row.auditedUnitId || '', // 被监审单位ID
+              catalogId: row.catalogId || '', // 目录ID
+              taskId: row.id, // 任务ID
+              surveyTemplateId: row.surveyTemplateId || '', // 调查表模板ID
+              currentNode: row.currentNode || 'sdshenhe', // 默认设置为审核节点
+              status: row.status || '审核中', // 默认状态
+            }
+            console.log('成本监审详情数据:', this.cbjsInfoData)
+            this.cbjsInfoVisible = true
+          } else {
+            console.warn('行数据为空,无法打开弹窗')
+            this.$message.warning('无法查看:数据异常')
+          }
+        } else if (this.$refs.taskInfo) {
+          this.$refs.taskInfo.open(row, type)
+        } else {
+          console.warn('taskInfo 组件未找到,请确保已正确导入和注册')
+          this.$message.warning('功能暂不可用,请联系管理员')
+        }
+      },
     },
   }
 </script>