Răsfoiți Sursa

查阅案卷按钮更改

duy 2 ani în urmă
părinte
comite
bdf80585f1
1 a modificat fișierele cu 32 adăugiri și 4 ștergeri
  1. 32 4
      src/views/using/query.vue

+ 32 - 4
src/views/using/query.vue

@@ -139,7 +139,7 @@
         <HcDrawer :show="isCarrySpotChecksDrawer" uis="hc-carry-spot-checks-target" to-id="carry-spot-checks-layout-target" @close="onCarrySpotChecksDrawerClose">
             <div class="hc-carry-spot-checks-pdf">
                 <!-- <HcPdf src="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20221212/ce9799c7d18efc03efefd6f242439f2e.pdf"/> -->
-                <HcPdf :src="pdfUrl"/>
+                <HcPdf :src="pdfUrl" v-loading="pdfLoading" />
                 <el-tooltip content="展开/收起 右侧目录" placement="top" :disabled="!isBubble">
                     <div class="hc-csc-pdf-btn" @click="onCarryDataShow">
                         <HcIcon name="arrow-right-s" v-show="isCarryDataShow"/>
@@ -299,6 +299,7 @@ import HcNodeTree from "./components/query/hc-tree.vue"
 import {getArrValue, arrIndex, isArrIndex} from "js-fast-way"
 import website from '~src/config/index'
 import archiveQueryApi from "~api/using/query.js";
+import tuningApi from "~api/archiveConfig/tuning.js";
 
 //变量
 const useAppState = useAppStore()
@@ -759,6 +760,7 @@ const tableData = ref([
 
 ])
 const pdfUrl=ref('')
+const pdfLoading=ref(false)
 const tableLoading = ref(false)
 const getTableData = async () => {
     tableLoading.value = true
@@ -860,8 +862,28 @@ const tableFileCloseClick = () => {
     tableAllShow.value = false;
     tableFileShow.value = false;
 }
+const viewPdf = async (id) => {
+    window.$message?.info('预览案卷需要合并pdf,需要一点时间')
+    pdfLoading.value=true
+    const {error, code, data, msg} = await tuningApi.printArchive({
+        id: id
+    })
+    pdfLoading.value=false
+    if (!error && code === 200) {
+        if (data) {
+          
+            return data
+            // window.open(data, '_blank')
+        } else {
+            window.$message?.warning('文件不存在')
+        }
 
-const consultFileClick = (row,type) => {
+    } 
+    // else {
+    //     window.$message?.warning(msg)
+    // }
+}
+const consultFileClick =async (row,type) => {
     isCarrySpotChecksDrawer.value = true
     console.log(row,'row');
    
@@ -878,8 +900,14 @@ const consultFileClick = (row,type) => {
     pdfUrl.value=row.pdfFileUrl
    }
     if(type===1&& cscTableData1.value.length>0&&cscTableData1.value[0]['pdfFileUrl']){
-        checkId.value=cscTableData1.value[0].id
-        pdfUrl.value=row.approvalFileList[0]['pdfFileUrl']
+        console.log('查阅案卷');
+       
+        const url=await viewPdf(row.id)
+        console.log(url,'url');
+       
+        pdfUrl.value=url
+        // checkId.value=cscTableData1.value[0].id
+        // pdfUrl.value=row.approvalFileList[0]['pdfFileUrl']
     }
 
 }