ソースを参照

fix:去掉查看监审文书弹窗的确认按钮

luzhixia 1 ヶ月 前
コミット
0a890e7d48

+ 5 - 1
src/components/costAudit/TemplatePreviewEdit.vue

@@ -15,7 +15,7 @@
         <p>请先上传模板文件</p>
       </div>
     </el-tab-pane>
-    <el-tab-pane label="编辑" name="edit">
+    <el-tab-pane v-if="isShowEdit" label="编辑" name="edit">
       <div class="template-edit">
         <div class="file-edit-section">
           <div v-if="url" class="reupload-section">文件编辑</div>
@@ -46,6 +46,10 @@
         type: Boolean,
         default: false,
       },
+      isShowEdit: {
+        type: Boolean,
+        default: true,
+      },
     },
     data() {
       return {

+ 55 - 18
src/components/task/components/costAudit.vue

@@ -103,6 +103,7 @@
         :width="item.width"
         :align="item.align"
         :fixed="item.fixed"
+        show-overflow-tooltip
       >
         <!-- <template slot-scope="scope"> 
         <el-input
@@ -667,29 +668,65 @@
               }
             })
 
-            if (this.selectedProject && this.selectedProject.auditPeriod) {
-              // 为审计期间的三个字段添加初始值
-              // 获取审计期间并按年份排序
-              let auditPeriod = this.selectedProject.auditPeriod
-                .split(',')
-                .map((year) => parseInt(year))
-                .sort((a, b) => a - b)
-                .map((year) => year.toString())
-
-              // 为每个年份添加三个字段的初始值
-              auditPeriod.forEach((year) => {
-                rowData[`${year}BookValue账面值`] = '' // 账面值
-                rowData[`${year}Audit审核调整值`] = '' // 审核调整值
-                rowData[`${year}ApprovedValue核定值`] = '' // 核定值
-              })
-            }
+            // if (this.selectedProject && this.selectedProject.auditPeriod) {
+            //   // 为审计期间的三个字段添加初始值
+            //   // 获取审计期间并按年份排序
+            //   let auditPeriod = this.selectedProject.auditPeriod
+            //     .split(',')
+            //     .map((year) => parseInt(year))
+            //     .sort((a, b) => a - b)
+            //     .map((year) => year.toString())
+
+            //   // 为每个年份添加三个字段的初始值,使用与表头定义一致的属性名
+            //   auditPeriod.forEach((year) => {
+            //     rowData[`year${year}BookValue`] = '' // 账面值
+            //     rowData[`year${year}Audit`] = '' // 审核调整值
+            //     rowData[`year${year}ApprovedValue`] = '' // 核定值
+            //   })
+            // }
 
             // 添加完整的行数据到表格数据中
             this.costAuditData.push(rowData)
           })
 
-          // 表格排序,子项排在父项的后面
-          this.sortItemsByHierarchy()
+          // 平铺顺序:父项在前、子项紧随其后
+          const sortFn = (a, b) =>
+            Number(a.orderNum || 0) - Number(b.orderNum || 0)
+          const byRowId = new Map()
+          const parents = []
+          const childGroups = new Map()
+          this.costAuditData.forEach((row) => {
+            if (row && row.children) delete row.children
+            const key = row.rowid != null ? String(row.rowid) : ''
+            if (key) byRowId.set(key, row)
+            const pid = row.parentid
+            const isParent =
+              pid === -1 || pid === '-1' || pid === null || pid === undefined
+            if (isParent) {
+              parents.push(row)
+            } else {
+              const pKey = pid != null ? String(pid) : ''
+              if (!childGroups.has(pKey)) childGroups.set(pKey, [])
+              childGroups.get(pKey).push(row)
+            }
+          })
+          parents.sort(sortFn)
+          const flat = []
+          const seen = new Set()
+          parents.forEach((p) => {
+            flat.push(p)
+            seen.add(p)
+            const group = childGroups.get(String(p.rowid)) || []
+            group.sort(sortFn).forEach((c) => {
+              flat.push(c)
+              seen.add(c)
+            })
+          })
+          // 处理找不到父项的子项:放在末尾
+          this.costAuditData.forEach((row) => {
+            if (!seen.has(row)) flat.push(row)
+          })
+          this.costAuditData = flat
         }
       },
       handleSaveTemplate() {

+ 36 - 2
src/components/task/taskComponents/auditNoticeTab.vue

@@ -152,6 +152,8 @@
       :width="dialogWidth"
       :close-on-click-modal="false"
       :z-index="9300"
+      :show-confirm-btn="false"
+      cancel-text="关闭"
       @cancel="handleCancel"
       @confirm="handleConfirm"
     >
@@ -276,7 +278,35 @@
                   min-width="150"
                   align="center"
                   show-overflow-tooltip
-                ></el-table-column>
+                >
+                  <template slot-scope="scope">
+                    <el-input
+                      v-if="scope.row.originalText !== '需要提供材料'"
+                      v-model="scope.row.dataValue"
+                      size="small"
+                      placeholder="请输入数据值"
+                      disabled
+                    ></el-input>
+                    <!-- 否则显示上传按钮 -->
+                    <div v-else>
+                      <!-- <el-button
+                      type="primary"
+                      size="small"
+                      @click="handleUploadClick(scope.row)"
+                    >
+                      上传附件
+                    </el-button> -->
+                      <el-button
+                        type="primary"
+                        size="small"
+                        :disabled="false"
+                        @click="handleViewScan(scope.row.dataValue)"
+                      >
+                        查看附件
+                      </el-button>
+                    </div>
+                  </template>
+                </el-table-column>
               </el-table>
               <div style="margin-top: 10px; font-size: 12px; color: #909399">
                 说明:数据内容不可修改,已在监审文书管理中配置完成,数据值为本次监审项目的相关数据。
@@ -288,7 +318,11 @@
         <!-- 右侧:模板预览和编辑区 -->
         <div class="document-preview">
           <!-- 预览/修改标签页 -->
-          <TemplatePreviewEdit :active-tab="activeTab" :file-url="fileUrl" />
+          <TemplatePreviewEdit
+            :active-tab="activeTab"
+            :file-url="fileUrl"
+            :is-show-edit="false"
+          />
         </div>
       </div>
     </CostAuditDialog>

+ 9 - 2
src/components/task/taskInfo.vue

@@ -840,7 +840,9 @@
       :visible="documentDialogVisible"
       width="82%"
       :close-on-click-modal="false"
-      :z-index="9200"
+      :z-index="9300"
+      :show-confirm-btn="false"
+      cancel-text="关闭"
       @cancel="handleDocCancel"
     >
       <div class="document-edit-container">
@@ -943,6 +945,7 @@
                       <el-button
                         type="primary"
                         size="small"
+                        :disabled="false"
                         @click="handleViewScan(scope.row.dataValue)"
                       >
                         查看附件
@@ -958,7 +961,11 @@
         <!-- 右侧:模板预览和编辑区 -->
         <div class="document-preview">
           <!-- 预览/修改标签页 -->
-          <TemplatePreviewEdit :active-tab="activeDocTab" :file-url="fileUrl" />
+          <TemplatePreviewEdit
+            :active-tab="activeDocTab"
+            :file-url="fileUrl"
+            :is-show-edit="false"
+          />
         </div>
       </div>
     </CostAuditDialog>

+ 7 - 1
src/views/EntDeclaration/auditTaskManagement/components/AuditDocumentTab.vue

@@ -98,6 +98,8 @@
       width="82%"
       :close-on-click-modal="false"
       :z-index="9100"
+      :show-confirm-btn="false"
+      cancel-text="关闭"
       @cancel="handleDocCancel"
     >
       <div class="document-edit-container">
@@ -216,7 +218,11 @@
         <!-- 右侧:模板预览和编辑区 -->
         <div class="document-preview">
           <!-- 预览/修改标签页 -->
-          <TemplatePreviewEdit :active-tab="activeDocTab" :file-url="fileUrl" />
+          <TemplatePreviewEdit
+            :active-tab="activeDocTab"
+            :file-url="fileUrl"
+            :is-show-edit="false"
+          />
         </div>
       </div>
     </CostAuditDialog>

+ 3 - 4
src/views/costAudit/auditInfo/auditManage/auditDocumentsMain.vue

@@ -312,7 +312,7 @@
       :visible="dialogVisible"
       :width="dialogWidth"
       :close-on-click-modal="false"
-      :z-index="9200"
+      :z-index="9300"
       @cancel="handleCancel"
       @confirm="handleConfirm"
     >
@@ -626,9 +626,9 @@
         this.documentData.documentTypes = res.value.records || []
         const pid = this.project.projectId
         if (!pid) return
-        this.getlist()
+        this.getlist(data)
       },
-      getlist() {
+      getlist(data) {
         getCostProjectDocumentPageList({
           pageNum: this.documentData.pagination.currentPage,
           pageSize: this.documentData.pagination.pageSize,
@@ -638,7 +638,6 @@
         }).then((res) => {
           this.documentData.list = res.value.value.records
           this.documentData.pagination.total = res.value.value.total
-          console.log(this.documentData.list)
         })
       },
       getEnterpriseName(row) {