Browse Source

SCP供应商发货单PDF导出

intex
叶佳兴 2 days ago
parent
commit
04a89076af
  1. 10
      src/api/wms/package/index.ts
  2. 61
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRecordMain/index.vue
  3. 69
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

10
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})
// }
// }
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})
}

61
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({

69
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 {
}
}
/**

Loading…
Cancel
Save