diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue index 6809b42c6..a18c664b1 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue @@ -149,6 +149,7 @@ import { formatDate } from '@/utils/formatTime' import { usePageLoading } from '@/hooks/web/usePageLoading' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import { SupplierdeliverRequestMainRules } from '../supplierdeliverRequestMain/supplierdeliverRequestMain.data' +import { log } from 'console' const { loadStart, loadDone } = usePageLoading() // 供应商发货记录主 defineOptions({ name: 'SupplierdeliverRecordMain' }) @@ -236,8 +237,10 @@ const buttonTableClick = async (val, row) => { if (val == 'generateApplication') { handlerCreatePurchasereceiptRequest(row.number) } else if (val == 'documentPrint') { + console.log('ye',); + // 单据打印 - handleDocumentPrint(row.masterId) + handleDocumentPrint(row.masterId, row.supplierName, row.deliNo) } } @@ -262,72 +265,80 @@ const handlerCreatePurchasereceiptRequest = async (number: string) => { // 品番状态是号试显示生准订单的发货单模版 // const documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken()) -const handleDocumentPrint = async (id) => { - console.log("wolaile "); +const handleDocumentPrint = async (id, supplierName, deliNo) => { + console.log('wolaile ') + console.log(supplierName) + console.log(deliNo) await SupplierdeliverRecordMainApi.getPoLineType(id).then(async (res) => { if (res.isM && res.haveNOM == false) { //号试(生准订单)模板 // window.open(documentSrc2.value + '&id=' + id + '&type=' + 'M') - supplierdeliverJasperExportPS(id,'M'); + supplierdeliverJasperExportPS(id, 'M', supplierName, deliNo) } if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') { //号试(生准订单)模板 // window.open(documentSrc2.value + '&id=' + id ) - supplierdeliverJasperExportPS(id,''); + supplierdeliverJasperExportPS(id, '', supplierName, deliNo) } if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') { //(生准订单)模板 M型物料 //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') - supplierdeliverJasperExport(id,'M'); - //(补给品订单)模板 - //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') - supplierdeliverJasperExport(id,'noM'); + supplierdeliverJasperExport(id, 'M', supplierName, deliNo) + //(补给品订单)模板 + //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') + supplierdeliverJasperExport(id, 'noM', supplierName, deliNo) } if (res.isM == false) { await SupplierdeliverRecordMainApi.getItemStatus(id).then(async (res) => { if (res) { //号试(生准订单)模板 //window.open(documentSrc2.value + '&id=' + id) - supplierdeliverJasperExportPS(id,''); + supplierdeliverJasperExportPS(id, '', supplierName, deliNo) } else { //window.open(documentSrc.value + '&id=' + id) - supplierdeliverJasperExport(id,''); + supplierdeliverJasperExport(id, '', supplierName, deliNo) } }) } }) } -const supplierdeliverJasperExport = async (id, type) => { +const supplierdeliverJasperExport = async (id, type, supplierName, deliNo) => { + console.log('tututut ') + console.log(supplierName) + console.log(deliNo) try { // 发起导出导出明细 let params = { id: id, type: type, pageNo: 1, - pageSize: 99999999, - + pageSize: 99999999 } - const excelTitle = ref(route.meta.title) const data = await PackageApi.supplierdeliverJasperExport(params) - download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + download.excel( + data, + `【${supplierName}】【${formatDate(new Date(), 'YYYY-MM-DD HH:MM:ss')}】【${deliNo}】.pdf` + ) } catch { } finally { } } -const supplierdeliverJasperExportPS = async (id, type) => { +const supplierdeliverJasperExportPS = async (id, type, supplierName, deliNo) => { try { // 发起导出导出明细 let params = { id: id, type: type, pageNo: 1, - pageSize: 99999999, + pageSize: 99999999 } - const excelTitle = ref(route.meta.title) const data = await PackageApi.supplierdeliverJasperExportPS(params) - download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + download.excel( + data, + `【${supplierName}】【${formatDate(new Date(), 'YYYY-MM-DD HH:MM:ss')}】【${deliNo}】.pdf` + ) } catch { } finally { } diff --git a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue index 681cc9eba..c0267052d 100644 --- a/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue +++ b/src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue @@ -1383,43 +1383,35 @@ const print = async () => { window.open(src.value + '&number=' + detatableData.tableList[0].number) } -// 单据打印 -// const BASE_URL = getJmreportBaseUrl() -// 品番状态是“补给品”和其余状态 的发货单模版 -// const documentSrc = ref(BASE_URL + '/jmreport/view/1019060741381099520?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') - supplierdeliverJasperExportPS(id,'M'); + supplierdeliverJasperExportPS(id, 'M') } if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') { //号试(生准订单)模板 // window.open(documentSrc2.value + '&id=' + id ) - supplierdeliverJasperExportPS(id,''); + supplierdeliverJasperExportPS(id, '') } if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') { //(生准订单)模板 M型物料 //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') - supplierdeliverJasperExport(id,'M'); - //(补给品订单)模板 - //window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') - supplierdeliverJasperExport(id,'noM'); + supplierdeliverJasperExport(id, 'M') + //(补给品订单)模板 + //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) - supplierdeliverJasperExportPS(id,''); + supplierdeliverJasperExportPS(id, '') } else { //window.open(documentSrc.value + '&id=' + id) - supplierdeliverJasperExport(id,''); + supplierdeliverJasperExport(id, '') } }) } @@ -1433,12 +1425,13 @@ const supplierdeliverJasperExport = async (id, type) => { id: id, type: type, pageNo: 1, - pageSize: 99999999, - + pageSize: 99999999 } - const excelTitle = ref(route.meta.title) const data = await PackageApi.supplierdeliverJasperExport(params) - download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + download.excel( + data, + `【供应商发货记录】【${formatDate(new Date(), 'YYYY-MM-DD HH:MM:ss')}】.pdf` + ) } catch { } finally { } @@ -1451,11 +1444,13 @@ const supplierdeliverJasperExportPS = async (id, type) => { id: id, type: type, pageNo: 1, - pageSize: 99999999, + pageSize: 99999999 } - const excelTitle = ref(route.meta.title) const data = await PackageApi.supplierdeliverJasperExportPS(params) - download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) + download.excel( + data, + `【${supplierName.value}】【${formatDate(new Date())}】【${deliNo.value}】.pdf` + ) } catch { } finally { }