Bläddra i källkod

fix: 修改问题

shiyanyu 3 veckor sedan
förälder
incheckning
b38f289f08

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

@@ -281,7 +281,8 @@
                   scope.row.auditedStatus !== '1' &&
                   (currentNode === 'clcs' || currentNode === 'tjcl') &&
                   scope.row.formatRequired === '3' &&
-                  scope.row.templateType !== '1'
+                  scope.row.templateType !== '1' &&
+                  scope.row.informationName !== '动态表'
                 "
                 type="text"
                 size="small"

+ 1 - 0
src/views/EntDeclaration/auditTaskManagement/components/DynamicTableDialog.vue

@@ -225,6 +225,7 @@
           "
           :period-record-id="currentRow ? currentRow.id : ''"
           :task-id="taskId || (surveyData && surveyData.taskId) || ''"
+          :request-type="requestType"
         />
       </div>
       <div slot="footer" class="dialog-footer">

+ 6 - 1
src/views/EntDeclaration/auditTaskManagement/components/FixedAssetsTable.vue

@@ -252,6 +252,11 @@
         type: Array,
         default: () => [],
       },
+      // 统一控制接口 type(1=成本调查表,2=报送资料)
+      requestType: {
+        type: [String, Number],
+        default: 1,
+      },
     },
     data() {
       return {
@@ -1700,7 +1705,7 @@
               catalogId: this.catalogId || '',
               // 接口字段名为 taskkId,这里从 prop taskId 映射
               taskkId: this.taskId || '',
-              type: 1,
+              type: this.requestType,
             }
 
             // 如果有 uploadId(编辑模式),添加 uploadId 字段

+ 31 - 2
src/views/costAudit/auditInfo/auditManage/auditDocumentsMain.vue

@@ -1378,11 +1378,16 @@
   @import '@/styles/costAudit.scss';
   .documents-layout {
     display: flex;
+    flex-wrap: wrap; // 允许在窄屏时换行,左侧列表在上,右侧内容在下
     margin-bottom: 20px;
   }
 
   .documents-type-list {
-    width: 200px;
+    // 默认左侧固定宽度,不随容器缩小,避免内容被压缩
+    flex: 0 0 240px; // 不增长不收缩,固定240px
+    width: 240px;
+    min-width: 200px;
+    flex-shrink: 0;
     border: 1px solid #ebeef5;
     border-radius: 5px;
     padding: 10px;
@@ -1406,7 +1411,31 @@
   }
 
   .documents-content {
-    flex: 1;
+    // 右侧区域占据剩余空间,并允许在狭小空间下换行占满
+    flex: 1 1 0;
+    min-width: 0; // 修复某些浏览器下表格溢出导致的布局问题
+  }
+
+  // 响应式:小屏时左侧列表占满一行并堆叠到上方
+  @media (max-width: 992px) {
+    .documents-type-list {
+      flex: 0 0 220px;
+      width: 220px;
+    }
+  }
+
+  @media (max-width: 768px) {
+    .documents-type-list {
+      flex: 1 1 100%;
+      width: 100%;
+      min-width: auto;
+      margin-right: 0;
+      margin-bottom: 12px;
+    }
+    .documents-content {
+      flex: 1 1 100%;
+      width: 100%;
+    }
   }
 
   .generate-btn {

+ 1 - 1
src/views/costAudit/auditInfo/auditManage/auditOpinion.vue

@@ -326,7 +326,7 @@
                 this.preliminaryOpinionForm.id = res.value.id
               }
               // 通知父组件刷新列表并关闭弹窗,要求分页回到第一页
-              this.$emit('refresh', { resetToFirst: true })
+              // this.$emit('refresh', { resetToFirst: true })
               this.$emit('close')
             } else {
               this.$message({ type: 'error', message: res.message })

+ 0 - 1
src/views/costAudit/auditInfo/auditManage/conclusionMain.vue

@@ -283,7 +283,6 @@
             }
 
             // 触发父组件的事件,通知保存成功(父组件会关闭弹窗并刷新列表)
-            this.$emit('saved', this.formData)
           } else {
             this.$message.error(response?.message || '保存失败')
           }

+ 56 - 32
src/views/costAudit/auditInfo/auditManage/costAudit.vue

@@ -7,34 +7,6 @@
         :rules="rules"
         :disabled="auditForm.surveyTemplateId !== ''"
       >
-        <el-row>
-          <el-col :span="6">
-            <el-form-item label="" prop="catalogId">
-              <div
-                style="display: flex; justify-self: start; align-items: center"
-              >
-                <div style="width: 120px">监审类别:</div>
-                <el-cascader
-                  v-model="auditForm.catalogId"
-                  :options="catalogListOptions"
-                  v-bind="props"
-                  style="width: 200px"
-                  clearable
-                ></el-cascader>
-              </div>
-            </el-form-item>
-          </el-col>
-          <el-col :span="6">
-            <el-form-item label="核定模板名称:" prop="surveyTemplateName">
-              <el-input
-                v-model="auditForm.surveyTemplateName"
-                style="width: 200px"
-                clearable
-                placeholder="请输入核定模板名称"
-              ></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
         <el-row :gutter="20">
           <el-col :span="6">
             <el-form-item label="" prop="templateType">
@@ -96,6 +68,7 @@
         v-if="!auditForm.surveyTemplateId"
         type="primary"
         size="small"
+        :loading="loading"
         @click="handleGenerateTemplate"
       >
         生成核定表
@@ -343,6 +316,10 @@
           return {}
         },
       },
+      catalogId: {
+        type: [String, Number],
+        default: '',
+      },
       currentNode: {
         type: String,
         default: '',
@@ -385,9 +362,6 @@
           catalogId: [
             { required: true, message: '请输选择监审类别', trigger: 'change' },
           ],
-          surveyTemplateName: [
-            { required: true, message: '请输入模版名称', trigger: 'blur' },
-          ],
         },
         tableHeadersRes: [],
         tableDataRes: [],
@@ -400,6 +374,8 @@
         yearPropMap: {},
         // 字典缓存(当未使用 dictMixin 批量加载时备用)
         dictCache: {},
+        // 生成核定表时的加载状态
+        loading: false,
       }
     },
     computed: {
@@ -497,8 +473,9 @@
       },
       async generateFromSurveyTemplate() {
         try {
+          this.loading = true
           const resp = await generateCostVerifyForm({
-            catalogId: this.auditForm.catalogId,
+            catalogId: this.catalogId,
             templatename: this.auditForm.surveyTemplateName,
             templateId: this.auditForm.dataTable,
             taskId: (this.selectedProject && this.selectedProject.taskId) || '',
@@ -511,10 +488,13 @@
           }
         } catch (error) {
           console.error('生成模板失败:', error)
+        } finally {
+          this.loading = false
         }
       },
       async generateFromHistoryTemplate() {
         try {
+          this.loading = true
           const resp = await generateCostVerifyFormData({
             catalogId: this.auditForm.catalogId,
             templatename: this.auditForm.surveyTemplateName,
@@ -529,6 +509,50 @@
           }
         } catch (error) {
           console.error('生成模板失败:', error)
+        } finally {
+          this.loading = false
+        }
+      },
+      // 生成后,按模板ID加载表头与详情,保持与 base 管理页一致
+      async loadTemplateDataForEdit(surveyTemplateId) {
+        try {
+          const id = surveyTemplateId || this.auditForm?.surveyTemplateId || ''
+          if (!id) return
+          // 并行获取:表头配置 + 版本数据(明细) + 模板详情(兜底)
+          const [tableHeadersRes, versionsRes, detailRes] = await Promise.all([
+            getlistBySurveyTemplateId({ surveyTemplateId: id }),
+            getCostFormVersionsByTemplateId({ surveyTemplateId: id }),
+            getVerifyTemplateDetail({ id }),
+          ])
+
+          if (tableHeadersRes && tableHeadersRes.code === 200) {
+            await this.parseAndDisplayTableHeaders(tableHeadersRes)
+          } else {
+            this.tableHeadersRes = []
+            this.costAuditcolumn = []
+          }
+
+          // 优先使用版本接口返回的数据;若无则回退到模板详情
+          let parsedDataRes = null
+          if (versionsRes && versionsRes.code === 200) {
+            const list = Array.isArray(versionsRes.value)
+              ? versionsRes.value
+              : (versionsRes.value && versionsRes.value.itemlist) || []
+            parsedDataRes = { value: { itemlist: list } }
+          } else if (detailRes && detailRes.code === 200) {
+            parsedDataRes = detailRes
+          }
+
+          if (parsedDataRes) {
+            this.parseAndDisplayTableData(parsedDataRes)
+          } else {
+            this.costAuditData = []
+          }
+
+          // 依据当前数据触发一次联动计算
+          this.computeApprovedForAllRows()
+        } catch (e) {
+          console.error('加载核定模板数据失败:', e)
         }
       },
       // 单元格输入联动:当账面值或审核调整值变化时,自动计算核定值

+ 2 - 2
src/views/costAudit/auditInfo/auditManage/costSurvey.vue

@@ -174,8 +174,8 @@
           <el-button
             v-if="
               scope.row.auditedStatus === '0' &&
-              (currentStatusLocal === 200 || currentStatusLocal === '200') &&
-              (currentNodeLocal === 'clcs' || currentNodeLocal === 'sdsh')
+              (currentStatus === 200 || currentStatus === '200') &&
+              (currentNode === 'clcs' || currentNode === 'sdsh')
             "
             type="text"
             size="small"

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

@@ -59,6 +59,7 @@
             :selected-project="selectedProject"
             :current-node="currentNode"
             :current-status="currentStatus"
+            :catalog-id="catalogId"
             :audited-unit-id="auditedUnitId"
           />
         </el-tab-pane>

+ 2 - 2
src/views/costAudit/baseInfo/catalogManage/surveyDialog.vue

@@ -72,7 +72,7 @@
                   {{ scope.row._displaySeq || '-' }}
                 </template>
               </el-table-column>
-              <el-table-column label="项目" min-width="200" align="left">
+              <!-- <el-table-column label="项目" min-width="200" align="left">
                 <template slot-scope="scope">
                   <span
                     :class="[
@@ -91,7 +91,7 @@
                     {{ scope.row._displayUnit || '-' }}
                   </span>
                 </template>
-              </el-table-column>
+              </el-table-column> -->
               <el-table-column
                 v-for="column in fixedTableValueColumns"
                 :key="column.key"