From f7ec845a7bc5d83dee96dd83476ba127ec65eeb8 Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Thu, 21 Aug 2025 15:16:23 +0800 Subject: [PATCH] tijiao --- .env.development | 2 +- src/api/materials/purchaseDoc/index.ts | 2 +- src/views/materials/purchaseDoc/index.vue | 20 +++++++++++++------- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.env.development b/.env.development index 8849f99..d905b86 100644 --- a/.env.development +++ b/.env.development @@ -5,7 +5,7 @@ VITE_APP_TITLE = 煤科建管平台 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.110.213:8899' +VITE_APP_BASE_API = 'http://192.168.110.209:8899' # 无人机接口地址 diff --git a/src/api/materials/purchaseDoc/index.ts b/src/api/materials/purchaseDoc/index.ts index 64ec1ab..465a657 100644 --- a/src/api/materials/purchaseDoc/index.ts +++ b/src/api/materials/purchaseDoc/index.ts @@ -124,7 +124,7 @@ export const logisticsDetial = (id) => { export const getDetailBASE = (id) => { return request({ - url: '/cailiaoshebei/purchaseDoc/pic/' + id, + url: '/cailiaoshebei/purchaseDoc/pdf/' + id, method: 'get' }); }; diff --git a/src/views/materials/purchaseDoc/index.vue b/src/views/materials/purchaseDoc/index.vue index 0c70dce..bf61f0e 100644 --- a/src/views/materials/purchaseDoc/index.vue +++ b/src/views/materials/purchaseDoc/index.vue @@ -268,7 +268,6 @@ import { listContractor } from '@/api/project/contractor'; import { useUserStoreHook } from '@/store/modules/user'; import { getToken } from '@/utils/auth'; import logisticsDetail from './comm/logisticsDetail.vue'; -import type { DrawerProps } from 'element-plus'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const route = useRoute(); const router = useRouter(); @@ -385,12 +384,19 @@ const cancel = () => { }; const handleDetail = async (row?: PurchaseDocVO) => { - detailBASEVisble.value = true; - - const res = await getDetailBASE(row.id); - detailBASE.value = res.data; - - console.log('🚀 ~ handleDetail ~ res:', res); + proxy?.$modal.loading('加载中'); + try { + const res = await getDetailBASE(row.id); + if (res.data) { + window.open(res.data); + } else { + proxy?.$modal.msgError('查看失败'); + } + } catch (error) { + proxy?.$modal.msgError('查看失败'); + } finally { + proxy?.$modal.closeLoading(); + } }; /** 表单重置 */