From 07ba572b92d572e0ce39b854fc2e9bfa914378cf Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Tue, 7 May 2024 13:26:57 +0800 Subject: [PATCH] =?UTF-8?q?PDF=EF=BC=8C=E5=9B=BE=E7=89=87=E9=A2=84?= =?UTF-8?q?=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Annex/src/Annex.vue | 25 +++++++- src/components/Detail/src/Detail.vue | 10 +++- src/components/PreviewPDF/index.vue | 60 +++++++++++++++++++ .../supplierdeliverRecordMain/index.vue | 38 +++++++++++- .../supplierdeliverRequestMain/index.vue | 1 + 5 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 src/components/PreviewPDF/index.vue diff --git a/src/components/Annex/src/Annex.vue b/src/components/Annex/src/Annex.vue index ef289c6a8..cb68ced7d 100644 --- a/src/components/Annex/src/Annex.vue +++ b/src/components/Annex/src/Annex.vue @@ -16,17 +16,20 @@
{{ item.size }}KB
来自 {{ item.nickname }}
- - + + +
{{ formatDate(item.createTime) }}
+ diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index d3308ecf0..3428a8a8f 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -223,6 +223,7 @@ const props = defineProps({ default: ()=>({ label: '附件', showDownload:false, + showPreview:false, hiddenDelete:false }) }, @@ -460,10 +461,14 @@ const getFileList = async () => { } } // 获取其他附件列表篇 -const getAnnexFileList = async (row:id) => { - console.log('getAnnexFileList') +const getAnnexFileList = async (row) => { props.annexTable?.forEach(async (item) => { let requstData = {...remarksData.data,tableName: item?.tableName} + if(item?.queryParams){ + item?.queryParams?.forEach(queryItem => { + requstData[queryItem.queryField] = row[queryItem.rowField] + }); + } const annexList = await FileApi.getFileList(requstData) const annexData = annexTableData.value.find(annex=>annex.label === item.label) if(annexData){ @@ -476,6 +481,7 @@ const getAnnexFileList = async (row:id) => { annexList, hasSubDetail:item.hasSubDetail||false, subDetailTableData:item.subDetailTableData, + showPreview:item.showPreview||false, // 是否展示预览按钮 showDownload:item.showDownload||false, // 是否展示下载按钮 hiddenDelete:item.hiddenDelete || false, // 是否展示删除按钮 }) diff --git a/src/components/PreviewPDF/index.vue b/src/components/PreviewPDF/index.vue new file mode 100644 index 000000000..696f1b105 --- /dev/null +++ b/src/components/PreviewPDF/index.vue @@ -0,0 +1,60 @@ + + + + + \ No newline at end of file diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue index 4c6a3afae..660f8b0e2 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue @@ -53,6 +53,31 @@ import download from '@/utils/download' +import * as SupplierdeliverInspectionDetailApi from '@/api/wms/supplierdeliverInspectionDetail' +import {   SupplierdeliverInspectionDetail,SupplierdeliverInspectionDetailRules} from '../supplierdeliverInspectionDetail/supplierdeliverInspectionDetail.data' import { SupplierdeliverRecordMain,SupplierdeliverRecordMainRules, SupplierdeliverRecordDetail,SupplierdeliverRecordDetailRules,SupplierdeliverRecordDetailPickingNumer } from './supplierdeliverRecordMain.data' import * as SupplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMain' import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' +import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' import { getAccessToken } from '@/utils/auth' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' @@ -197,9 +225,17 @@ const { getList:getDetailList } = detatableMethods const { wsCache } = useCache() /** 详情操作 */ const detailRef = ref() -const openDetail = (row: any, titleName: any, titleValue: any) => { +const openDetail = async (row: any, titleName: any, titleValue: any) => { const departmentCode = wsCache.get(CACHE_KEY.DEPT).find((account) => account.id == row.departmentCode)?.name if (departmentCode) row.departmentCode = JSON.parse(JSON.stringify(departmentCode)) + //获取申请中的masterId + const { tableObject: requestTableObject, tableMethods:requestTableMethods } = useTable({ + getListApi: SupplierdeliverRequestDetailApi.getSupplierdeliverRequestDetailPage // 分页接口 + }) + const { getList:requestGetList } = requestTableMethods + requestTableObject.params.number = 'REQ0120240506-0002' + await requestGetList() + row.annexMasterId = requestTableObject.tableList[0].masterId detailRef.value.openDetail(row, titleName, titleValue,'recordSupplierdeliverMain') } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index abe1f8cbc..4002104d1 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -82,6 +82,7 @@ prop: 'uploadFile', tableName:'SupplierdeliverInspectionDetail', hasSubDetail:true, // 附件中是否展示明细表 + showPreview:true, // 附件中是否展示预览按钮 align:'left', //明细表数据 subDetailTableData:{