suhp 2 hete
szülő
commit
30d7545432

+ 4 - 75
src/views/costAudit/auditInfo/archivesManage/ArchiveDetail.vue

@@ -15,27 +15,22 @@
     <div style="margin-bottom: 20px">
       <!-- 第0步:资料归纳 -->
       <ArchiveInduction
-        :show="currentStep === 0"
-        :loading="loading"
-        :archive-data="archiveData"
-        :total-page-count="totalPageCount"
+        v-if="currentStep === 0"
         :task-id="taskId"
         @next-step="nextStep"
-        @refresh-data="loadArchiveData"
       />
 
       <!-- 第1步:档案目录核对 -->
       <ArchiveProofread
-        :show="currentStep === 1"
-        :loading="loading"
-        :proofread-data="proofreadData"
+        v-if="currentStep === 1"
+        :task-id="taskId"
         @prev-step="prevStep"
         @next-step="nextStep"
       />
 
       <!-- 第2步:档案预览 -->
       <ArchivePreview
-        :show="currentStep === 2"
+        v-if="currentStep === 2"
         @prev-step="prevStep"
         @complete="completeArchive"
       />
@@ -47,7 +42,6 @@
   import ArchiveInduction from './ArchiveInduction.vue'
   import ArchiveProofread from './ArchiveProofread.vue'
   import ArchivePreview from './ArchivePreview.vue'
-  import { getDataInductionList } from '@/api/audit/dataInduction'
 
   export default {
     name: 'ArchiveDetail',
@@ -64,75 +58,10 @@
     },
     data() {
       return {
-        loading: false,
         currentStep: 0,
-        totalPageCount: 0,
-        archiveData: [],
-        proofreadData: [
-          { id: 1, name: '档案封面', pageCount: 1, startEndPageCount: '--' },
-          { id: 2, name: '卷内目录', pageCount: 1, startEndPageCount: '--' },
-          {
-            id: 3,
-            name: '成本监审报告(含成本监审报告修改稿、送达回证)',
-            pageCount: 30,
-            startEndPageCount: '1-30',
-          },
-          {
-            id: 4,
-            name: '被监审单位申请(报告)价格表(复印件)',
-            pageCount: 5,
-            startEndPageCount: '31-35',
-          },
-          {
-            id: 5,
-            name: '成本监审评审书(含送达回证)',
-            pageCount: 13,
-            startEndPageCount: '36-48',
-          },
-        ],
-        catalogueData: [
-          { id: 1, name: '卷宗封面' },
-          { id: 2, name: '卷内目录' },
-          { id: 3, name: '卷宗内容' },
-          { id: 4, name: '卷宗封底' },
-        ],
-      }
-    },
-    created() {
-      if (this.taskId) {
-        this.loadArchiveData()
       }
     },
     methods: {
-      async loadArchiveData() {
-        if (!this.taskId) return
-        this.loading = true
-        try {
-          const response = await getDataInductionList({ taskId: this.taskId })
-          if (response && response.value) {
-            this.archiveData = response.value
-            this.totalPageCount = (
-              Array.isArray(response.value)
-                ? response.value
-                : response.value.list || []
-            ).reduce(
-              (total, item) =>
-                total + parseInt(item.pageCount || item.pageNum || 0),
-              0
-            )
-            this.archiveData.sort(
-              (a, b) => (a.sortOrder || 0) - (b.sortOrder || 0)
-            )
-          } else {
-            this.archiveData = []
-          }
-        } catch (error) {
-          console.error('加载资料归纳列表失败:', error)
-          this.archiveData = []
-        } finally {
-          this.loading = false
-        }
-      },
       nextStep() {
         if (this.currentStep < 2) {
           this.currentStep++

+ 72 - 25
src/views/costAudit/auditInfo/archivesManage/ArchiveInduction.vue

@@ -1,8 +1,5 @@
 <template>
-  <div
-    v-if="show"
-    style="padding: 20px; background-color: #f9f9f9; border-radius: 4px"
-  >
+  <div style="padding: 20px; background-color: #f9f9f9; border-radius: 4px">
     <div
       style="
         display: flex;
@@ -22,7 +19,7 @@
         >
           添加资料
         </el-button>
-        <el-button type="primary" @click="$emit('next-step')">下一步</el-button>
+        <el-button type="primary" @click="handleNextStep">下一步</el-button>
       </div>
     </div>
     <div
@@ -72,7 +69,7 @@
           <el-button type="text" size="small" @click="handleEditMaterial(row)">
             修改
           </el-button>
-          <el-button type="text" size="small" @click="$emit('delete', row)">
+          <el-button type="text" size="small" @click="handleDelete(row)">
             删除
           </el-button>
           <el-button type="text" size="small" @click="handleViewFiles(row)">
@@ -86,7 +83,7 @@
             v-if="$index !== 0"
             type="text"
             size="small"
-            @click="$emit('move-up', row, $index)"
+            @click="handleMoveUp(row, $index)"
           >
             上移
           </el-button>
@@ -94,7 +91,7 @@
             v-if="$index !== archiveData.length - 1"
             type="text"
             size="small"
-            @click="$emit('move-down', row, $index)"
+            @click="handleMoveDown(row, $index)"
           >
             下移
           </el-button>
@@ -770,6 +767,7 @@
     saveDetailInfo,
     deleteDetailInfo,
     getDetailListByMasterList,
+    getDataInductionList,
   } from '@/api/audit/dataInduction'
   import { getAllUnitList } from '@/api/auditEntityManage'
 
@@ -793,22 +791,6 @@
       },
     },
     props: {
-      show: {
-        type: Boolean,
-        default: false,
-      },
-      loading: {
-        type: Boolean,
-        default: false,
-      },
-      archiveData: {
-        type: Array,
-        default: () => [],
-      },
-      totalPageCount: {
-        type: Number,
-        default: 0,
-      },
       taskId: {
         type: String,
         default: '',
@@ -816,6 +798,9 @@
     },
     data() {
       return {
+        loading: false,
+        archiveData: [],
+        totalPageCount: 0,
         allUnits: [],
         dataDialogTitle: '添加资料',
         dataDialogVisible: false,
@@ -902,8 +887,18 @@
         editingFileId: null,
       }
     },
+    watch: {
+      taskId: {
+        handler(newVal) {
+          if (newVal) {
+            this.loadArchiveData()
+          }
+        },
+      },
+    },
     created() {
       this.loadAllUnits()
+      this.loadArchiveData()
     },
     methods: {
       openAddDataDialog() {
@@ -1383,7 +1378,7 @@
           if (response && response.success !== false) {
             this.$message.success(response.message || '保存成功')
             this.handleCancel()
-            this.$emit('refresh-data')
+            this.handleRefreshData()
           } else {
             this.$message.error(response.message || '保存失败')
           }
@@ -1429,6 +1424,58 @@
           this.allUnits = []
         }
       },
+      handleDelete(row) {
+        // 处理删除操作
+        this.$emit('delete', row)
+      },
+      handleMoveUp(row, index) {
+        // 处理上移操作
+        this.$emit('move-up', row, index)
+      },
+      handleMoveDown(row, index) {
+        // 处理下移操作
+        this.$emit('move-down', row, index)
+      },
+      handleRefreshData() {
+        // 刷新数据
+        this.loadArchiveData()
+      },
+      async loadArchiveData() {
+        if (!this.taskId) return
+        this.loading = true
+        try {
+          const response = await getDataInductionList({ taskId: this.taskId })
+          if (response && response.value) {
+            this.archiveData = response.value
+            this.totalPageCount = (
+              Array.isArray(response.value)
+                ? response.value
+                : response.value.list || []
+            ).reduce(
+              (total, item) =>
+                total +
+                parseInt(
+                  item.totalPageCount || item.pageCount || item.pageNum || 0
+                ),
+              0
+            )
+            this.archiveData.sort(
+              (a, b) => (a.sortOrder || 0) - (b.sortOrder || 0)
+            )
+          } else {
+            this.archiveData = []
+          }
+        } catch (error) {
+          console.error('加载资料归纳列表失败:', error)
+          this.archiveData = []
+        } finally {
+          this.loading = false
+        }
+      },
+      handleNextStep() {
+        // 处理下一步操作
+        this.$emit('next-step')
+      },
     },
   }
 </script>

+ 11 - 10
src/views/costAudit/auditInfo/archivesManage/ArchivePreview.vue

@@ -1,8 +1,5 @@
 <template>
-  <div
-    v-if="show"
-    style="padding: 20px; background-color: #f9f9f9; border-radius: 4px"
-  >
+  <div style="padding: 20px; background-color: #f9f9f9; border-radius: 4px">
     <div
       style="
         display: flex;
@@ -13,10 +10,10 @@
     >
       <div style="font-size: 16px; font-weight: 500">档案预览</div>
       <div>
-        <el-button style="margin-right: 10px" @click="$emit('prev-step')">
+        <el-button style="margin-right: 10px" @click="handlePrevStep">
           上一步
         </el-button>
-        <el-button type="success" @click="$emit('complete')">完成</el-button>
+        <el-button type="success" @click="handleComplete">完成</el-button>
       </div>
     </div>
     <div class="preview-actions" style="margin-bottom: 20px">
@@ -43,10 +40,14 @@
 <script>
   export default {
     name: 'ArchivePreview',
-    props: {
-      show: {
-        type: Boolean,
-        default: false,
+    methods: {
+      handlePrevStep() {
+        // 处理上一步操作
+        this.$emit('prev-step')
+      },
+      handleComplete() {
+        // 处理完成操作
+        this.$emit('complete')
       },
     },
   }

+ 247 - 22
src/views/costAudit/auditInfo/archivesManage/ArchiveProofread.vue

@@ -1,8 +1,5 @@
 <template>
-  <div
-    v-if="show"
-    style="padding: 20px; background-color: #f9f9f9; border-radius: 4px"
-  >
+  <div style="padding: 20px; background-color: #f9f9f9; border-radius: 4px">
     <div
       style="
         display: flex;
@@ -13,10 +10,10 @@
     >
       <div style="font-size: 16px; font-weight: 500">档案目录核对</div>
       <div>
-        <el-button style="margin-right: 10px" @click="$emit('prev-step')">
+        <el-button style="margin-right: 10px" @click="handlePrevStep">
           上一步
         </el-button>
-        <el-button type="primary" @click="$emit('next-step')">下一步</el-button>
+        <el-button type="primary" @click="handleNextStep">下一步</el-button>
       </div>
     </div>
     <el-table
@@ -25,9 +22,13 @@
       border
       style="width: 100%"
     >
-      <el-table-column type="index" label="序号" width="60" align="center" />
+      <el-table-column type="index" label="序号" width="60" align="center">
+        <template slot-scope="{ row }">
+          {{ row.orderNum }}
+        </template>
+      </el-table-column>
       <el-table-column
-        prop="name"
+        prop="materialName"
         label="资料名称"
         min-width="300"
         align="left"
@@ -39,43 +40,267 @@
         align="center"
       />
       <el-table-column
-        prop="startEndPageCount"
+        prop="pageRange"
         label="起止页码"
         width="120"
         align="center"
       />
       <el-table-column label="操作" width="150" align="center" fixed="right">
         <template slot-scope="{ row }">
-          <el-button type="text" size="small" @click="$emit('view', row)">
-            查看
+          <el-button
+            v-if="row.canGenerate === '1'"
+            type="text"
+            size="small"
+            @click="handleGenerate(row)"
+          >
+            生成
           </el-button>
-          <el-button type="text" size="small" @click="$emit('edit', row)">
+          <el-button
+            v-if="row.canEdit === '1'"
+            type="text"
+            size="small"
+            @click="handleEdit(row)"
+          >
             编辑
           </el-button>
+          <el-button
+            v-if="row.documentType === 0"
+            type="text"
+            size="small"
+            @click="handleViewFiles(row)"
+          >
+            查看
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
+
+    <!-- 文件列表弹窗(只读模式) -->
+    <el-dialog
+      :visible.sync="fileListDialogVisible"
+      title="文件列表"
+      width="80%"
+      :close-on-click-modal="false"
+      @close="fileListDialogVisible = false"
+    >
+      <!-- 资料信息展示 -->
+      <div
+        v-if="currentViewingMaterial"
+        style="
+          margin-bottom: 20px;
+          padding: 15px;
+          background-color: #f5f7fa;
+          border-radius: 4px;
+        "
+      >
+        <el-row :gutter="20">
+          <el-col :span="12">
+            <span style="color: #606266; font-size: 14px; margin-right: 10px">
+              资料名称:
+            </span>
+            <span style="font-weight: 500; font-size: 16px">
+              {{ currentViewingMaterial.materialName }}
+            </span>
+          </el-col>
+          <el-col :span="12">
+            <span style="color: #606266; font-size: 14px; margin-right: 10px">
+              资料序号:
+            </span>
+            <span style="font-weight: 500; font-size: 16px">
+              {{
+                currentViewingMaterial.materialOrderNum ||
+                currentViewingMaterial.orderNum
+              }}
+            </span>
+          </el-col>
+        </el-row>
+      </div>
+
+      <!-- 文件列表(只读模式,无操作按钮和拖拽功能) -->
+      <div
+        v-for="(row, index) in fileListData"
+        :key="row.id"
+        class="file-list-item"
+        style="
+          padding: 15px;
+          border: 1px solid #dcdfe6;
+          margin-bottom: 10px;
+          border-radius: 4px;
+          background-color: #fff;
+        "
+      >
+        <el-row :gutter="20">
+          <el-col :span="2">
+            <div style="text-align: center">
+              <div style="font-size: 12px; margin-top: 5px">
+                {{ index + 1 }}
+              </div>
+            </div>
+          </el-col>
+          <el-col :span="6">
+            <div style="font-size: 14px; font-weight: 500">
+              {{ row.documentName }}
+            </div>
+            <div style="font-size: 12px; color: #909399; margin-top: 5px">
+              文书名称
+            </div>
+          </el-col>
+          <el-col :span="4">
+            <div style="font-size: 14px">{{ row.documentNumber }}</div>
+            <div style="font-size: 12px; color: #909399; margin-top: 5px">
+              文号
+            </div>
+          </el-col>
+          <el-col :span="5">
+            <div style="font-size: 14px">{{ row.auditedUnitName }}</div>
+            <div style="font-size: 12px; color: #909399; margin-top: 5px">
+              被监审单位
+            </div>
+          </el-col>
+          <el-col :span="3">
+            <div style="font-size: 14px">{{ row.fileSource }}</div>
+            <div style="font-size: 12px; color: #909399; margin-top: 5px">
+              文件来源
+            </div>
+          </el-col>
+          <el-col :span="2">
+            <div style="font-size: 14px">{{ row.pageCount || 0 }}</div>
+            <div style="font-size: 12px; color: #909399; margin-top: 5px">
+              页数
+            </div>
+          </el-col>
+          <el-col :span="2" style="text-align: right">
+            <!-- 只读模式,无操作按钮 -->
+          </el-col>
+        </el-row>
+      </div>
+      <div
+        v-if="fileListData.length === 0"
+        style="text-align: center; padding: 40px 0; color: #909399"
+      >
+        暂无数据
+      </div>
+
+      <div slot="footer" style="text-align: right">
+        <el-button @click="fileListDialogVisible = false">关闭</el-button>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+  import { getArchiveProofreadList } from '@/api/audit/dataProofread'
+  import { getDetailListByMasterList } from '@/api/audit/dataInduction'
+
   export default {
     name: 'ArchiveProofread',
     props: {
-      show: {
-        type: Boolean,
-        default: false,
+      taskId: {
+        type: String,
+        default: '',
+      },
+    },
+    data() {
+      return {
+        loading: false,
+        proofreadData: [],
+        // 文件列表弹窗相关
+        fileListDialogVisible: false,
+        fileListData: [],
+        fileListLoading: false,
+        currentViewingMaterial: null,
+      }
+    },
+    watch: {
+      taskId: {
+        handler(newVal) {
+          if (newVal) {
+            this.loadProofreadData()
+          }
+        },
+        immediate: true,
+      },
+    },
+    methods: {
+      async loadProofreadData() {
+        if (!this.taskId) return
+
+        try {
+          this.loading = true
+          const response = await getArchiveProofreadList({
+            taskId: this.taskId,
+          })
+          if (response && response.value) {
+            this.proofreadData = Array.isArray(response.value)
+              ? response.value
+              : response.value.list || []
+          } else {
+            this.proofreadData = []
+          }
+        } catch (error) {
+          console.error('加载卷宗校对列表失败:', error)
+          this.proofreadData = []
+          this.$message.error('数据加载失败')
+        } finally {
+          this.loading = false
+        }
       },
-      loading: {
-        type: Boolean,
-        default: false,
+      handleGenerate(row) {
+        // 处理生成操作
+        this.$emit('generate', row)
       },
-      proofreadData: {
-        type: Array,
-        default: () => [],
+      handleEdit(row) {
+        // 处理编辑操作
+        this.$emit('edit', row)
+      },
+      handleViewFiles(row) {
+        // 处理查看文件列表操作
+        this.currentViewingMaterial = row
+        this.fileListDialogVisible = true
+        this.loadFileList(row.id)
+      },
+      async loadFileList(masterId) {
+        try {
+          this.fileListLoading = true
+          const response = await getDetailListByMasterList(masterId)
+          if (response && response.value) {
+            this.fileListData = Array.isArray(response.value)
+              ? response.value
+              : response.value.list || []
+          } else {
+            this.fileListData = []
+          }
+        } catch (error) {
+          console.error('加载文件列表失败:', error)
+          this.fileListData = []
+          this.$message.error('文件列表加载失败')
+        } finally {
+          this.fileListLoading = false
+        }
+      },
+      handlePrevStep() {
+        // 处理上一步操作
+        this.$emit('prev-step')
+      },
+      handleNextStep() {
+        // 处理下一步操作
+        this.$emit('next-step')
       },
     },
   }
 </script>
 
-<style scoped lang="scss"></style>
+<style scoped lang="scss">
+  .file-list-item {
+    pointer-events: none; // 只读模式,禁用所有交互
+  }
+
+  .file-list-item ::v-deep .el-input__inner,
+  .file-list-item ::v-deep .el-textarea__inner,
+  .file-list-item ::v-deep .el-select .el-input__inner {
+    background-color: #f5f7fa;
+    border-color: #e4e7ed;
+    color: #909399;
+    cursor: not-allowed;
+  }
+</style>