Forráskód Böngészése

卷内文件数据改为接口获取

duy 2 éve
szülő
commit
18c7b3545b
2 módosított fájl, 42 hozzáadás és 40 törlés
  1. 8 0
      src/api/modules/using/query.js
  2. 34 40
      src/views/using/query.vue

+ 8 - 0
src/api/modules/using/query.js

@@ -53,4 +53,12 @@ async getarchiveQueryPage(form, msg = true) {
             data: form,
         }, msg);
     },
+    //查询案卷里的文件
+    async getArchiveFileList(form, msg = true) {
+      return httpApi({
+          url: '/api/blade-archive/archivesauto/getArchiveFileList',
+          method: 'get',
+          params: form,
+      }, msg);
+  },
 }

+ 34 - 40
src/views/using/query.vue

@@ -947,7 +947,9 @@ const getTableData = async () => {
             if(tableData.value.length>0&&tableData.value[0]?.approvalFileList.length>0){
                 // tableFileData.value =getArrValue( tableData.value[0]['approvalFileList'])
                 let searchinput=searchForm.value.queryValue
-                let allarr=getArrValue( tableData.value[0]['approvalFileList'])
+                // let allarr=getArrValue( tableData.value[0]['approvalFileList'])
+                fileInfo.value.id= tableData.value[0]['id']
+                getArchiveFileListData()
                 let filterarr=allarr.filter((item)=>{
                     if(item.fileName.indexOf(searchinput)!=-1){
                         return item
@@ -986,14 +988,23 @@ const tableFileColumn = ref([
 const tableFileData = ref([
 
 ])
-//查看卷内文件pdf
-// const viewfilePdf=(row)=>{
-//     if(row?.pdfFileUrl){
-//         window.open(row?.pdfFileUrl, '_blank')
-//     }else{
-//         window.$message?.warning('文件不存在')
-//  }
-// }
+//获取卷内文件数据
+const getArchiveFileListData=async()=>{
+    const { error, code, msg,data } = await archiveQueryApi.getArchiveFileList({
+        id: fileInfo.value.id, //案卷id
+     
+    })
+    //处理返回数据
+    if (!error && code === 200) {
+        fileInfo.value.pageNumber=data.pageNumber 
+        tableFileData.value=getArrValue(data['approvalFileList']) 
+        cscTableData1.value=getArrValue(data['approvalFileList']) 
+
+    } else {
+        tableFileData.value=[]
+        cscTableData1.value=[]
+    }
+}
 const tableFileLoading = ref(false)
 const tableFileSelection = (rows) => {
     console.log(rows)
@@ -1004,12 +1015,11 @@ const tableFileShow = ref(false)
 const tableRowClick = ({row}) => {
     tableAllShow.value = true;
     tableFileShow.value = true;
-    tableFileData.value =getArrValue( row['approvalFileList'])
-    cscTableData1.value=getArrValue( row['approvalFileList'])
-    InsearchForm.value.total=row['approvalFileList'].length
+    // tableFileData.value =getArrValue( row['approvalFileList'])
+    // cscTableData1.value=getArrValue( row['approvalFileList'])
+    // InsearchForm.value.total=row['approvalFileList'].length
     fileInfo.value=row
-    // fileInfo.value.pageN=row['approvalFileList'].length||0
-    //  fileInfo.value.pageNumber=row['approvalFileList'].length||0
+    getArchiveFileListData()
 
 
 }
@@ -1026,45 +1036,26 @@ const viewPdf = async (id) => {
     pdfLoading.value=false
     if (!error && code === 200) {
         if (data) {
-
             return data
-            // window.open(data, '_blank')
         } else {
             window.$message?.warning('文件不存在')
         }
 
     }
-    // else {
-    //     window.$message?.warning(msg)
-    // }
 }
 const consultFileClick =async (row,type) => {
     isCarrySpotChecksDrawer.value = true
-    console.log(row,'row');
-
-
-    // pdfUrl.value=row.approvalFileList
-
-   if(type===1){
-    cscTableData1.value=row.approvalFileList
-    fileInfo.value=row
-    // fileInfo.value.pageN=row['approvalFileList'].length||0
-    // fileInfo.value.pageNumber=row['approvalFileList'].length||0
-   }else if(type==2){
-    checkId.value=row.id
-    pdfUrl.value=row.pdfFileUrl
-   }
     if(type===1){
-        console.log('查阅案卷');
-
+        //查阅案卷
+        fileInfo.value=row
+        getArchiveFileListData()
         const url=await viewPdf(row.id)
-        console.log(url,'url');
-
         pdfUrl.value=url
         checkId.value=''
-        // checkId.value=cscTableData1.value[0].id
-        // pdfUrl.value=row.approvalFileList[0]['pdfFileUrl']
-    }
+    }else if(type==2){//查阅卷内文件
+        checkId.value=row.id
+        pdfUrl.value=row.pdfFileUrl
+   }
 
 }
 const isCarrySpotChecksDrawer = ref(false)
@@ -1080,6 +1071,9 @@ const fileInfo=ref({
 const checkId=ref('')
 const changePdf=(row)=>{
     console.log(row,'row');
+    if(pdfLoading.value===true){
+        pdfLoading.value=false
+    }
     pdfUrl.value=row['pdfFileUrl']||''
     checkId.value=row.id