fei
2025-12-08 835caa28c4a48af5e9382a8045bb59e3f7e2470b
src/views/archiveManager/archiveMaterial/index.vue
@@ -796,7 +796,7 @@
  </template>
  <script>
  import { getFileCount,islegal, listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials"
  import {insertFile, getFileCount,islegal, listMaterials, enload, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/system/materials"
import { getToken } from '@/utils/auth'
import store from '@/store'
import { updateStatusById } from "@/api/system/records"
@@ -806,6 +806,7 @@
    name: "Materials",
    data() {
      return {
        totalPageCount: 0,
        // 记录元素初始位置和状态
  originalOffsetLeft: 0,
        originalWidth: 0,
@@ -1000,6 +1001,9 @@
    created() {
      //const roleId = this.$route.params && this.$route.params.roleId
      const recordId = this.$route.params && this.$route.params.recordId
      this.totalPageCount = this.$route.params && this.$route.params.pageCount
      //alert(this.totalPageCount)
      //alert(recordId)
      this.recordId = recordId;
      this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId
@@ -1044,6 +1048,11 @@
    },
       // 打开导入对话框
    handleImport() {
      //生成新的记录
      insertFile(this.recordId, this.totalPageCount).then(response => {
        console.log(response)
      //  alert(3245)
        })
      this.importDialogVisible = true
    },
    // 文件移除
@@ -1070,26 +1079,27 @@
      //判断页号与上传上传的文件的页号是不是一一对应的
     islegal(this.recordId).then(response => {
       console.log(response.data)
       var res = response.data.res
     // islegal(this.recordId).then(response => {
     //   console.log(response.data)
     //   var res = response.data.res
     //  console.log(res)
       //alert(response.data.total)
       if(fileCount!==response.data.total)
       if(fileCount!=this.totalPageCount)
       {
         this.$modal.msgWarning('请选择与记录数一致的文件')
         return
       }
       if(res)
       else
       {
         // 执行上传
           this.$refs.upload.submit()
           this.getList()
       }
       else
       {
         this.$modal.msgError("页号不连续,请修改为连续正确的页号!")
       }
     })
       // else
       // {
       //   this.$modal.msgError("页号不连续,请修改为连续正确的页号!")
       // }
     //})
    },
    clearFileList() {