Преглед изворни кода

fix: 修改审核端报送资料,报送资料点击查看弹窗成本调查表详情

shiyanyu пре 1 месец
родитељ
комит
6872840d0f

+ 82 - 82
src/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue

@@ -767,88 +767,88 @@
       // 获取默认表单字段配置(兼容旧版本)
       getDefaultFormFields() {
         return [
-          {
-            prop: 'institutionName',
-            label: '机构名称',
-            type: 'input',
-            colSpan: 12,
-            defaultValue: '幼儿园基本情况',
-            required: true,
-          },
-          {
-            prop: 'institutionNature',
-            label: '机构性质',
-            type: 'select',
-            colSpan: 12,
-            dictType: 'institutionNature', // 字典类型
-            defaultValue: '公办',
-            required: true,
-          },
-          {
-            prop: 'institutionLevel',
-            label: '机构评定等级',
-            type: 'select',
-            colSpan: 12,
-            dictType: 'institutionLevel', // 字典类型
-            defaultValue: '省一级',
-            required: true,
-          },
-          {
-            prop: 'educationMode',
-            label: '机构办学方式',
-            type: 'select',
-            colSpan: 12,
-            dictType: 'educationMode', // 字典类型
-            defaultValue: '全日制',
-            required: true,
-          },
-          {
-            prop: 'institutionAddress',
-            label: '机构地址',
-            type: 'input',
-            colSpan: 12,
-            required: true,
-          },
-          {
-            prop: 'formFiller',
-            label: '机构填表人',
-            type: 'input',
-            colSpan: 12,
-            required: true,
-          },
-          {
-            prop: 'financialManager',
-            label: '机构财务负责人',
-            type: 'input',
-            colSpan: 12,
-            required: true,
-          },
-          {
-            prop: 'contactPhone',
-            label: '机构联系电话',
-            type: 'input',
-            colSpan: 12,
-            required: true,
-            rules: [
-              {
-                required: true,
-                message: '请输入机构联系电话',
-                trigger: 'blur',
-              },
-              {
-                pattern: /^1[3-9]\d{9}$/,
-                message: '请输入正确的手机号码',
-                trigger: 'blur',
-              },
-            ],
-          },
-          {
-            prop: 'formFillDate',
-            label: '机构填表日期',
-            type: 'date',
-            colSpan: 12,
-            required: true,
-          },
+          // {
+          //   prop: 'institutionName',
+          //   label: '机构名称',
+          //   type: 'input',
+          //   colSpan: 12,
+          //   defaultValue: '幼儿园基本情况',
+          //   required: true,
+          // },
+          // {
+          //   prop: 'institutionNature',
+          //   label: '机构性质',
+          //   type: 'select',
+          //   colSpan: 12,
+          //   dictType: 'institutionNature', // 字典类型
+          //   defaultValue: '公办',
+          //   required: true,
+          // },
+          // {
+          //   prop: 'institutionLevel',
+          //   label: '机构评定等级',
+          //   type: 'select',
+          //   colSpan: 12,
+          //   dictType: 'institutionLevel', // 字典类型
+          //   defaultValue: '省一级',
+          //   required: true,
+          // },
+          // {
+          //   prop: 'educationMode',
+          //   label: '机构办学方式',
+          //   type: 'select',
+          //   colSpan: 12,
+          //   dictType: 'educationMode', // 字典类型
+          //   defaultValue: '全日制',
+          //   required: true,
+          // },
+          // {
+          //   prop: 'institutionAddress',
+          //   label: '机构地址',
+          //   type: 'input',
+          //   colSpan: 12,
+          //   required: true,
+          // },
+          // {
+          //   prop: 'formFiller',
+          //   label: '机构填表人',
+          //   type: 'input',
+          //   colSpan: 12,
+          //   required: true,
+          // },
+          // {
+          //   prop: 'financialManager',
+          //   label: '机构财务负责人',
+          //   type: 'input',
+          //   colSpan: 12,
+          //   required: true,
+          // },
+          // {
+          //   prop: 'contactPhone',
+          //   label: '机构联系电话',
+          //   type: 'input',
+          //   colSpan: 12,
+          //   required: true,
+          //   rules: [
+          //     {
+          //       required: true,
+          //       message: '请输入机构联系电话',
+          //       trigger: 'blur',
+          //     },
+          //     {
+          //       pattern: /^1[3-9]\d{9}$/,
+          //       message: '请输入正确的手机号码',
+          //       trigger: 'blur',
+          //     },
+          //   ],
+          // },
+          // {
+          //   prop: 'formFillDate',
+          //   label: '机构填表日期',
+          //   type: 'date',
+          //   colSpan: 12,
+          //   required: true,
+          // },
         ]
       },
       handleClose() {

+ 35 - 1
src/views/costAudit/auditInfo/auditManage/details.vue

@@ -18,12 +18,18 @@
         </el-button>
       </div>
       <!-- 标签页面 -->
-      <el-tabs v-model="activeTab" type="card" class="audit-tabs">
+      <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">
@@ -196,6 +202,7 @@
     getDataPreliminaryReviewButton,
     doProcessBtn,
   } from '@/api/dataPreliminaryReview'
+  import { getTaskRequirementList } from '@/api/auditTaskProcessing'
   export default {
     name: 'Details',
     components: {
@@ -229,6 +236,8 @@
       return {
         buttonData: [], //资料初审按钮数据
         activeTab: 'submitData', // 默认选中报送资料标签页
+        // 报送资料数据(从接口获取后下发给子组件)
+        submitMaterials: [],
         // 弹窗显示状态
         showSupplementDialog: false,
         showAbortDialog: false,
@@ -268,6 +277,10 @@
             this.setActiveTab()
             // 弹窗打开时,无论什么情况都要获取资料初审按钮数据
             this.getPreliminaryReviewButton()
+            // 若默认在报送资料页,加载报送资料
+            if (this.activeTab === 'submitData') {
+              this.loadSubmitMaterials()
+            }
           })
         }
       },
@@ -301,6 +314,10 @@
             this.setActiveTab()
             // 获取按钮数据
             this.getPreliminaryReviewButton()
+            // 任务变化时,若在报送资料页,刷新报送资料
+            if (this.activeTab === 'submitData') {
+              this.loadSubmitMaterials()
+            }
           })
         }
       },
@@ -313,6 +330,9 @@
         this.$nextTick(() => {
           // 弹窗打开时,无论什么情况都要获取资料初审按钮数据
           this.getPreliminaryReviewButton()
+          if (this.activeTab === 'submitData') {
+            this.loadSubmitMaterials()
+          }
         })
       }
     },
@@ -371,6 +391,20 @@
         // 打开弹窗方法,供父组件通过ref调用
         this.$emit('update:visible', true)
       },
+      handleTabClick(tab) {
+        if (tab && tab.name === 'submitData' && this.id) {
+          this.loadSubmitMaterials()
+        }
+      },
+      async loadSubmitMaterials() {
+        try {
+          const resp = await getTaskRequirementList(this.id)
+          const list = resp?.value || resp?.data || resp || []
+          this.submitMaterials = Array.isArray(list) ? list : []
+        } catch (e) {
+          this.submitMaterials = []
+        }
+      },
       // 处理审核操作按钮点击
       handleAuditPass(item) {
         this.additionalParams = {

+ 121 - 13
src/views/costAudit/auditInfo/auditManage/submitData.vue

@@ -25,13 +25,20 @@
           min-width="200"
         />
 
-        <el-table-column label="资料类型" width="120" align="center">
+        <el-table-column label="资料类型" width="150" align="center">
           <template slot-scope="scope">
             <span
-              :class="{
-                'template-tag': scope.row.templateId,
-              }"
+              v-if="
+                Number(scope.row.formatRequired) === 2 && scope.row.templateId
+              "
+              class="template-tag"
+              style="cursor: pointer"
+              title="点击查看模板"
+              @click="handleViewTemplate(scope.row)"
             >
+              预置模板
+            </span>
+            <span v-else>
               {{ getFormatType(scope.row.formatRequired) }}
             </span>
           </template>
@@ -82,12 +89,12 @@
           </template>
         </el-table-column>
         <el-table-column label="操作" width="200" align="center">
-          <template v-if="scope.row.isUpload === '1'" slot-scope="scope">
+          <template slot-scope="scope">
             <el-button
               v-if="
-                scope.row.auditedStatus == '0' &&
-                currentStatus === '审核中' &&
-                currentNode === 'clcs'
+                scope.row.auditedStatus === '0' &&
+                (currentStatus === 200 || currentStatus === '200') &&
+                (currentNode === 'clcs' || currentNode === 'sdsh')
               "
               type="text"
               size="small"
@@ -137,6 +144,57 @@
         <el-button type="primary" @click="handleAuditSubmit">提交</el-button>
       </div>
     </el-dialog>
+    <!-- 单记录弹窗 -->
+    <survey-form-dialog
+      :visible.sync="singleDialogVisible"
+      :survey-data="{}"
+      :is-view-mode="true"
+      :audited-unit-id="
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
+      "
+      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
+      :survey-template-id="
+        (currentTemplateRow &&
+          (currentTemplateRow.templateId ||
+            currentTemplateRow.surveyTemplateId)) ||
+        ''
+      "
+      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
+    />
+
+    <!-- 固定表弹窗(查看模式) -->
+    <fixed-table-dialog
+      :visible.sync="fixedDialogVisible"
+      :is-view-mode="true"
+      :audited-unit-id="
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
+      "
+      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
+      :survey-template-id="
+        (currentTemplateRow &&
+          (currentTemplateRow.templateId ||
+            currentTemplateRow.surveyTemplateId)) ||
+        ''
+      "
+      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
+    />
+
+    <!-- 动态表弹窗(查看模式) -->
+    <dynamic-table-dialog
+      :visible.sync="dynamicDialogVisible"
+      :is-view-mode="true"
+      :audited-unit-id="
+        (currentTemplateRow && currentTemplateRow.auditedUnitId) || ''
+      "
+      :upload-id="(currentTemplateRow && currentTemplateRow.uploadId) || ''"
+      :survey-template-id="
+        (currentTemplateRow &&
+          (currentTemplateRow.templateId ||
+            currentTemplateRow.surveyTemplateId)) ||
+        ''
+      "
+      :catalog-id="(currentTemplateRow && currentTemplateRow.catalogId) || ''"
+    />
   </div>
 </template>
 
@@ -163,9 +221,17 @@
     getDataPreliminaryReviewButton,
     doProcessBtn,
   } from '@/api/dataPreliminaryReview'
+  import SurveyFormDialog from '@/views/EntDeclaration/auditTaskManagement/components/SurveyFormDialog.vue'
+  import FixedTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/FixedTableDialog.vue'
+  import DynamicTableDialog from '@/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue'
 
   export default {
     name: 'AuditReview',
+    components: {
+      SurveyFormDialog,
+      FixedTableDialog,
+      DynamicTableDialog,
+    },
     props: {
       id: {
         type: [String, Number],
@@ -179,6 +245,10 @@
         type: String,
         default: '',
       },
+      materials: {
+        type: Array,
+        default: () => [],
+      },
     },
     data() {
       return {
@@ -203,6 +273,11 @@
         showAuditDialog: false,
         // 当前审核的资料
         currentAuditMaterial: null,
+        // 模板查看相关
+        currentTemplateRow: null,
+        singleDialogVisible: false,
+        fixedDialogVisible: false,
+        dynamicDialogVisible: false,
         // 资料审核表单数据
         auditForm: {
           auditedStatus: '通过', // 默认审核通过
@@ -214,18 +289,34 @@
       }
     },
     watch: {
-      // 监听标签页切换事件
       activeTab(newTab) {
-        // 当切换到成本调查表标签页时,模拟加载过程
         if (newTab === 'costSurvey') {
           this.loadCostSurveyData()
         }
       },
+      materials: {
+        handler(newList) {
+          if (Array.isArray(newList) && newList.length > 0) {
+            this.materialData = newList
+            this.processMaterialData()
+          }
+        },
+        deep: true,
+        immediate: true,
+      },
     },
     created() {
-      this.loadMaterialData()
+      if (Array.isArray(this.materials) && this.materials.length > 0) {
+        this.materialData = this.materials
+        this.processMaterialData()
+      } else {
+        this.loadMaterialData()
+      }
+    },
+    mounted() {
+      console.log(this.currentNode, '123')
+      console.log(this.currentStatus, '222')
     },
-    mounted() {},
     methods: {
       // 加载报送资料数据
       async loadMaterialData() {
@@ -323,8 +414,25 @@
       },
       // 查看下载文件
       handleViewDownload(row) {
-        this.$message.info(`查看下载文件:${row.name}`)
+        // this.$message.info(`查看下载文件:${row.name}`)
         // 这里可以添加查看下载文件的逻辑
+        this.handleViewTemplate(row)
+      },
+      // 查看预置模板,按模板类型打开不同弹窗
+      handleViewTemplate(row) {
+        this.currentTemplateRow = row || null
+        const t = String(
+          (row && (row.templateType || row.templatetype)) || ''
+        ).trim()
+        if (t === '1') {
+          this.singleDialogVisible = true
+        } else if (t === '2') {
+          this.fixedDialogVisible = true
+        } else if (t === '3') {
+          this.dynamicDialogVisible = true
+        } else {
+          this.$message.warning('未知的模板类型,无法打开预置模板')
+        }
       },
       // 查看报表
       handleViewReport(row) {