diff --git a/src/api/wms/package/index.ts b/src/api/wms/package/index.ts index c80cef69b..59069ce1f 100644 --- a/src/api/wms/package/index.ts +++ b/src/api/wms/package/index.ts @@ -184,4 +184,12 @@ export const jasperExportAll = async(params: any) => { //WMS采购标签和协定品标签 // export const jasperExportWMS = async(params: any) => { // return await request.download({url: `/wms/package/jasperExportWMS`, params}) -// } \ No newline at end of file +// } + +export const supplierdeliverJasperExport = async(params: any) => { + return await request.download({url: `/wms/package/supplierdeliverJasperExport`, params}) +} + +export const supplierdeliverJasperExportPS = async(params: any) => { + return await request.download({url: `/wms/package/supplierdeliverJasperExportPS`, params}) +} diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue index bdbb2b4e7..6809b42c6 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue @@ -141,6 +141,7 @@ import * as SupplierdeliverRecordMainApi from '@/api/wms/supplierdeliverRecordMa import * as SupplierdeliverRecordDetailApi from '@/api/wms/supplierdeliverRecordDetail' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as defaultButtons from '@/utils/disposition/defaultButtons' +import * as PackageApi from '@/api/wms/package' import { getAccessToken } from '@/utils/auth' import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { getJmreportBaseUrl } from '@/utils/systemParam' @@ -255,41 +256,83 @@ const handlerCreatePurchasereceiptRequest = async (number: string) => { } // 单据打印 -const BASE_URL = getJmreportBaseUrl() +// const BASE_URL = getJmreportBaseUrl() // 品番状态是“补给品”和其余状态 的发货单模版 -const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?token=' + getAccessToken()) +// const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?token=' + getAccessToken()) // 品番状态是号试显示生准订单的发货单模版 -const documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken()) +// const documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken()) const handleDocumentPrint = async (id) => { + console.log("wolaile "); await SupplierdeliverRecordMainApi.getPoLineType(id).then(async (res) => { if (res.isM && res.haveNOM == false) { //号试(生准订单)模板 - window.open(documentSrc2.value + '&id=' + id + '&type=' + 'M') + // window.open(documentSrc2.value + '&id=' + id + '&type=' + 'M') + supplierdeliverJasperExportPS(id,'M'); } if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') { //号试(生准订单)模板 - window.open(documentSrc2.value + '&id=' + id ) + // window.open(documentSrc2.value + '&id=' + id ) + supplierdeliverJasperExportPS(id,''); } if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') { //(生准订单)模板 M型物料 - window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') + //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') + supplierdeliverJasperExport(id,'M'); //(补给品订单)模板 - window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') + //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') + supplierdeliverJasperExport(id,'noM'); } if (res.isM == false) { await SupplierdeliverRecordMainApi.getItemStatus(id).then(async (res) => { if (res) { //号试(生准订单)模板 - window.open(documentSrc2.value + '&id=' + id) + //window.open(documentSrc2.value + '&id=' + id) + supplierdeliverJasperExportPS(id,''); } else { - window.open(documentSrc.value + '&id=' + id) + //window.open(documentSrc.value + '&id=' + id) + supplierdeliverJasperExport(id,''); } }) } }) } +const supplierdeliverJasperExport = async (id, type) => { + try { + // 发起导出导出明细 + let params = { + id: id, + type: type, + pageNo: 1, + pageSize: 99999999, + + } + const excelTitle = ref(route.meta.title) + const data = await PackageApi.supplierdeliverJasperExport(params) + download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + } catch { + } finally { + } +} + +const supplierdeliverJasperExportPS = async (id, type) => { + try { + // 发起导出导出明细 + let params = { + id: id, + type: type, + pageNo: 1, + pageSize: 99999999, + } + const excelTitle = ref(route.meta.title) + const data = await PackageApi.supplierdeliverJasperExportPS(params) + download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + } catch { + } finally { + } +} + // 子包装数据 const detailParenPackingRef = ref() const { tableObject: detatableData, tableMethods: detatableMethods } = useTable({ diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 1f22a9284..681cc9eba 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -1384,46 +1384,81 @@ const print = async () => { } // 单据打印 +// const BASE_URL = getJmreportBaseUrl() // 品番状态是“补给品”和其余状态 的发货单模版 -const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?token=' + getAccessToken()) +// const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?token=' + getAccessToken()) // 品番状态是号试显示生准订单的发货单模版 -const documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken()) -const handleDocumentPrint = async (id, stausId) => { - // await SupplierdeliverRequestMainApi.getItemStatus(stausId).then(async (res) => { - // if (res) { - // //号试(生准订单)模板 - // window.open(documentSrc2.value + '&id=' + id) - // } else { - // window.open(documentSrc.value + '&id=' + id) - // } - // }) +// const documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken()) + +const handleDocumentPrint = async (id) => { + console.log("wolaile "); await SupplierdeliverRecordMainApi.getPoLineType(id).then(async (res) => { if (res.isM && res.haveNOM == false) { //号试(生准订单)模板 - window.open(documentSrc2.value + '&id=' + id + '&type=' + 'M') + // window.open(documentSrc2.value + '&id=' + id + '&type=' + 'M') + supplierdeliverJasperExportPS(id,'M'); } if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') { //号试(生准订单)模板 - window.open(documentSrc2.value + '&id=' + id ) + // window.open(documentSrc2.value + '&id=' + id ) + supplierdeliverJasperExportPS(id,''); } if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') { //(生准订单)模板 M型物料 - window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') + //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') + supplierdeliverJasperExport(id,'M'); //(补给品订单)模板 - window.open(documentSrc.value + '&id=' + id) + //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') + supplierdeliverJasperExport(id,'noM'); } if (res.isM == false) { await SupplierdeliverRecordMainApi.getItemStatus(id).then(async (res) => { if (res) { //号试(生准订单)模板 - window.open(documentSrc2.value + '&id=' + id) + //window.open(documentSrc2.value + '&id=' + id) + supplierdeliverJasperExportPS(id,''); } else { - window.open(documentSrc.value + '&id=' + id) + //window.open(documentSrc.value + '&id=' + id) + supplierdeliverJasperExport(id,''); } }) } }) +} + +const supplierdeliverJasperExport = async (id, type) => { + try { + // 发起导出导出明细 + let params = { + id: id, + type: type, + pageNo: 1, + pageSize: 99999999, + + } + const excelTitle = ref(route.meta.title) + const data = await PackageApi.supplierdeliverJasperExport(params) + download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + } catch { + } finally { + } +} +const supplierdeliverJasperExportPS = async (id, type) => { + try { + // 发起导出导出明细 + let params = { + id: id, + type: type, + pageNo: 1, + pageSize: 99999999, + } + const excelTitle = ref(route.meta.title) + const data = await PackageApi.supplierdeliverJasperExportPS(params) + download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + } catch { + } finally { + } } /**