Procházet zdrojové kódy

Merge branch 'master' of http://1.71.9.215:3000/feiyi/cbjsxt-front-master

suhp před 1 měsícem
rodič
revize
23530c425f

+ 12 - 0
src/components/task/components/costSurvey.vue

@@ -87,6 +87,8 @@
     <fixed-table-dialog
       :visible.sync="fixedDialogVisible"
       :survey-data="surveyDetailData"
+      :fixed-fields="fixedFields || ''"
+      :fixed-fieldids="fixedFieldids || ''"
       :is-view-mode="true"
       :request-type="1"
       :audited-unit-id="
@@ -156,6 +158,8 @@
         singleDialogVisible: false,
         fixedDialogVisible: false,
         dynamicDialogVisible: false,
+        fixedFields: '',
+        fixedFieldids: '',
       }
     },
     watch: {
@@ -340,6 +344,14 @@
                 ...item,
               }))
             }
+            // 透传固定表头(与 DataRequirementsTab 对齐)
+            if (res.value && res.value.fixedFields && res.value.fixedFieldids) {
+              this.fixedFields = res.value.fixedFields
+              this.fixedFieldids = res.value.fixedFieldids
+            } else {
+              this.fixedFields = ''
+              this.fixedFieldids = ''
+            }
             // 尝试从当前行或配置中解析监审期间
             const periodStr =
               row.auditPeriod || (res.value && res.value.auditPeriod) || ''

+ 35 - 31
src/components/task/taskInfo.vue

@@ -16,7 +16,7 @@
         :form-fields="formFields"
         :is-view-mode="true"
         :audited-unit-id="auditedUnitId"
-        :request-type="2"
+        :request-type="viewContext === 'costSurvey' ? 1 : 2"
         :upload-id="
           (currentTemplateRow &&
             (currentTemplateRow.uploadId || currentTemplateRow.id)) ||
@@ -29,10 +29,12 @@
       <fixed-table-dialog
         :visible.sync="fixedTableDialogVisible"
         :survey-data="{ ...(currentTemplateRow || {}), fixedHeaders }"
+        :fixed-fields="fixedFields || ''"
+        :fixed-fieldids="fixedFieldids || ''"
         :table-items="tableItems"
         :audit-periods="auditPeriods"
         :is-view-mode="true"
-        :request-type="2"
+        :request-type="viewContext === 'costSurvey' ? 1 : 2"
         :audited-unit-id="auditedUnitId"
         :upload-id="
           (currentTemplateRow &&
@@ -50,7 +52,7 @@
         :table-data="dynamicTableData"
         :table-items="tableItems"
         :is-view-mode="true"
-        :request-type="2"
+        :request-type="viewContext === 'costSurvey' ? 1 : 2"
         :audited-unit-id="auditedUnitId"
         :upload-id="
           (currentTemplateRow &&
@@ -1139,6 +1141,8 @@
         surveyFormDialogVisible: false,
         fixedTableDialogVisible: false,
         dynamicTableDialogVisible: false,
+        // 视图上下文:'costSurvey' 或 'dataRequirements'
+        viewContext: 'dataRequirements',
         formFields: [],
         surveyDetailData: {},
         tableItems: [],
@@ -1146,6 +1150,8 @@
         dynamicTableData: [],
         dynamicDialogKey: 0,
         fixedHeaders: null,
+        fixedFields: '',
+        fixedFieldids: '',
       }
     },
     computed: {
@@ -1569,29 +1575,7 @@
           this.loading = false
         }
       },
-      // 成本调查表-查看:复用报送资料预置模版查看的三种弹窗(只读)
-      handleCostSurveyView(row) {
-        if (!row) return
-        // 将成本调查表行映射为 currentTemplateRow 结构
-        const templateRow = {
-          uploadId: row.uploadId || row.id,
-          id: row.id,
-          surveyTemplateId: row.surveyTemplateId,
-          templateType:
-            row.templateType ||
-            (row.tableType === '单记录'
-              ? '1'
-              : row.tableType === '固定表'
-              ? '2'
-              : row.tableType === '动态表'
-              ? '3'
-              : ''),
-          catalogId: row.catalogId || this.catalogId || '',
-          auditedUnitId: row.auditedUnitId || this.auditedUnitId || '',
-          informationName: row.name,
-        }
-        this.handleViewTemplate(templateRow)
-      },
+
       // 报送资料预置模版-查看:单记录/固定表/动态表只读查看并回显
       async handleOnlineSubmission(row) {
         if (!row) return
@@ -1605,7 +1589,7 @@
               const params = {
                 uploadId: row.uploadId || row.id,
                 auditedUnitId: this.auditedUnitId,
-                type: 2,
+                type: this.viewContext === 'costSurvey' ? 1 : 2,
               }
               const res = await getSurveyDetail(params)
               if (res && res.code === 200 && res.value) {
@@ -1638,6 +1622,8 @@
           (row && (row.templateType || row.templatetype)) || ''
         ).trim()
         if (t === '1' || t === '2' || t === '3') {
+          // 报送资料查看
+          this.viewContext = 'dataRequirements'
           this.handleOnlineSubmission(row)
         } else {
           this.$message &&
@@ -1645,6 +1631,19 @@
             this.$message.warning('未知的模板类型,无法打开预置模板')
         }
       },
+      handleCostSurveyView(row) {
+        // 成本调查表查看
+        this.viewContext = 'costSurvey'
+        const templateRow = {
+          ...row,
+          uploadId: row.id,
+          surveyTemplateId: row.surveyTemplateId || row.templateId || '',
+          catalogId: row.catalogId || this.catalogId || '',
+          auditedUnitId: row.auditedUnitId || this.auditedUnitId || '',
+          informationName: row.name,
+        }
+        this.handleOnlineSubmission(templateRow)
+      },
       async initDynamicTableData() {
         try {
           const uploadId =
@@ -1664,7 +1663,7 @@
             auditedUnitId,
             catalogId,
             surveyTemplateId,
-            type: 2,
+            type: this.viewContext === 'costSurvey' ? 1 : 2,
           }
           const res = await getDynamicTableData(params)
           if (res && res.code === 200) {
@@ -1704,7 +1703,7 @@
               surveyTemplateId: this.getSurveyTemplateId(
                 this.currentTemplateRow
               ),
-              type: 2,
+              type: this.viewContext === 'costSurvey' ? 1 : 2,
             }
             const res = await getListBySurveyFdTemplateIdAndVersion(params)
             if (res && res.code === 200) {
@@ -1761,7 +1760,7 @@
               surveyTemplateId: this.getSurveyTemplateId(
                 this.currentTemplateRow
               ),
-              type: 2,
+              type: this.viewContext === 'costSurvey' ? 1 : 2,
             }
             const res = await getSingleRecordSurveyList(params)
             if (res && res.code === 200 && res.value) {
@@ -1787,6 +1786,11 @@
                   children: item.children || [],
                   ...item,
                 }))
+                // 如果接口返回 fixedFields/fixedFieldids,一并保存,供弹窗表头渲染
+                if (res.value.fixedFields && res.value.fixedFieldids) {
+                  this.fixedFields = res.value.fixedFields
+                  this.fixedFieldids = res.value.fixedFieldids
+                }
               } else {
                 this.tableItems = this.getMockTableItems()
               }
@@ -1816,7 +1820,7 @@
         try {
           const headerRes = await getListBySurveyFdTemplateIdAndVersion({
             surveyTemplateId: this.getSurveyTemplateId(this.currentTemplateRow),
-            type: 2,
+            type: this.viewContext === 'costSurvey' ? 1 : 2,
           })
           if (headerRes && headerRes.code === 200) {
             this.fixedHeaders = headerRes.value || null

+ 2 - 2
src/views/EntDeclaration/auditTaskManagement/components/DataRequirementsTab.vue

@@ -65,7 +65,7 @@
       :table-data="dynamicTableData"
       :table-items="tableItems"
       :is-view-mode="viewModeForDialog"
-      :request-type="1"
+      :request-type="2"
       :audited-unit-id="auditedUnitId"
       :upload-id="
         currentSurveyRow && (currentSurveyRow.uploadId || currentSurveyRow.id)
@@ -1070,7 +1070,7 @@
         try {
           const headerRes = await getListBySurveyTemplateIdAndVersion({
             surveyTemplateId: this.getSurveyTemplateId(this.currentTemplateRow),
-            type: 1,
+            type: 2,
           })
           if (headerRes && headerRes.code === 200) {
             const hdrVal = headerRes.value