Browse Source

资料查询查看pdf修改

duy 1 year ago
parent
commit
26398ea8ff
1 changed files with 33 additions and 8 deletions
  1. 33 8
      src/views/data-fill/query.vue

+ 33 - 8
src/views/data-fill/query.vue

@@ -169,7 +169,7 @@
                     @selection-change="tableSelectionChange"
                     @selection-change="tableSelectionChange"
                 >
                 >
                     <template #name="{ row }">
                     <template #name="{ row }">
-                        <span class="text-link" @click="tableRowName(row)">{{ row?.name }}</span>
+                        <span v-loading="bussPreviewLoading" class="text-link" @click="tableRowName(row)">{{ row?.name }}</span>
                     </template>
                     </template>
                     <template #waitingUserList="{ row }">
                     <template #waitingUserList="{ row }">
                         <template v-for="item in row.waitingUserList">
                         <template v-for="item in row.waitingUserList">
@@ -267,6 +267,7 @@ import { arrToId, arrToKey, downloadBlob, getArrValue, getObjValue, isString } f
 import queryApi from '~api/data-fill/query'
 import queryApi from '~api/data-fill/query'
 import { eVisaTaskCheckApi } from '~api/other'
 import { eVisaTaskCheckApi } from '~api/other'
 import { toPdfPage } from '~uti/btn-auth'
 import { toPdfPage } from '~uti/btn-auth'
+import wbsApi from '~api/data-fill/wbs'
 
 
 //变量
 //变量
 const useAppState = useAppStore()
 const useAppState = useAppStore()
@@ -596,14 +597,38 @@ const tableSelectionChange = (rows) => {
 //名称被点击
 //名称被点击
 const tableRowName = (row) => {
 const tableRowName = (row) => {
     //如果 evisaPdfUrl 不为空,使用evisaPdfUrl,反之使用pdfUrl
     //如果 evisaPdfUrl 不为空,使用evisaPdfUrl,反之使用pdfUrl
-    if (row['evisaPdfUrl']) {
-        toPdfPage(row['evisaPdfUrl'])
-        //window.open(row['evisaPdfUrl'], '_blank')
-    } else if (row['pdfUrl']) {
-        toPdfPage(row['pdfUrl'])
-        //window.open(row['pdfUrl'], '_blank')
+    // if (row['evisaPdfUrl']) {
+    //     toPdfPage(row['evisaPdfUrl'])
+    //     //window.open(row['evisaPdfUrl'], '_blank')
+    // } else if (row['pdfUrl']) {
+    //     toPdfPage(row['pdfUrl'])
+    //     //window.open(row['pdfUrl'], '_blank')
+    // } else {
+    //     window.$message?.warning('文件不存在')
+    // }
+    bussPreview()
+}
+
+
+//多表预览
+const bussPreviewLoading = ref(false)
+const bussPreview = async () => {
+    const info = nodeDataInfo.value
+    bussPreviewLoading.value = true
+    const { error, code, data } = await wbsApi.getBussPdfs({
+        nodeId: info?.primaryKeyId || '',
+        classify: contractTypeTabKey.value,
+        projectId: projectId.value,
+        // contractId: contractId.value
+        contractId: contractInfo.value?.contractType == 2 ? info?.contractIdRelation : contractId.value,
+    })
+
+    bussPreviewLoading.value = false
+    if (!error && code === 200) {
+        toPdfPage(data)
+        //window.open(data, '_blank')
     } else {
     } else {
-        window.$message?.warning('文件不存在')
+        window.$message?.warning('获取PDF失败')
     }
     }
 }
 }