|
@ -149,6 +149,7 @@ import { formatDate } from '@/utils/formatTime' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
import { usePageLoading } from '@/hooks/web/usePageLoading' |
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' |
|
|
import { SupplierdeliverRequestMainRules } from '../supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
import { SupplierdeliverRequestMainRules } from '../supplierdeliverRequestMain/supplierdeliverRequestMain.data' |
|
|
|
|
|
import { log } from 'console' |
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
const { loadStart, loadDone } = usePageLoading() |
|
|
// 供应商发货记录主 |
|
|
// 供应商发货记录主 |
|
|
defineOptions({ name: 'SupplierdeliverRecordMain' }) |
|
|
defineOptions({ name: 'SupplierdeliverRecordMain' }) |
|
@ -236,8 +237,10 @@ const buttonTableClick = async (val, row) => { |
|
|
if (val == 'generateApplication') { |
|
|
if (val == 'generateApplication') { |
|
|
handlerCreatePurchasereceiptRequest(row.number) |
|
|
handlerCreatePurchasereceiptRequest(row.number) |
|
|
} else if (val == 'documentPrint') { |
|
|
} 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 documentSrc2 = ref(BASE_URL + '/jmreport/view/1019406772438372352?token=' + getAccessToken()) |
|
|
|
|
|
|
|
|
const handleDocumentPrint = async (id) => { |
|
|
const handleDocumentPrint = async (id, supplierName, deliNo) => { |
|
|
console.log("wolaile "); |
|
|
console.log('wolaile ') |
|
|
|
|
|
console.log(supplierName) |
|
|
|
|
|
console.log(deliNo) |
|
|
await SupplierdeliverRecordMainApi.getPoLineType(id).then(async (res) => { |
|
|
await SupplierdeliverRecordMainApi.getPoLineType(id).then(async (res) => { |
|
|
if (res.isM && res.haveNOM == false) { |
|
|
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'); |
|
|
supplierdeliverJasperExportPS(id, 'M', supplierName, deliNo) |
|
|
} |
|
|
} |
|
|
if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') { |
|
|
if (res.isM && res.haveNOM && res.noMAndItemStatus == '生准订单') { |
|
|
//号试(生准订单)模板 |
|
|
//号试(生准订单)模板 |
|
|
// window.open(documentSrc2.value + '&id=' + id ) |
|
|
// window.open(documentSrc2.value + '&id=' + id ) |
|
|
supplierdeliverJasperExportPS(id,''); |
|
|
supplierdeliverJasperExportPS(id, '', supplierName, deliNo) |
|
|
} |
|
|
} |
|
|
if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') { |
|
|
if (res.isM && res.haveNOM && res.noMAndItemStatus != '生准订单') { |
|
|
//(生准订单)模板 M型物料 |
|
|
//(生准订单)模板 M型物料 |
|
|
//window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') |
|
|
//window.open(documentSrc.value + '&id=' + id+ '&type=' + 'M') |
|
|
supplierdeliverJasperExport(id,'M'); |
|
|
supplierdeliverJasperExport(id, 'M', supplierName, deliNo) |
|
|
//(补给品订单)模板 |
|
|
//(补给品订单)模板 |
|
|
//window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') |
|
|
//window.open(documentSrc.value + '&id=' + id+ '&type=' + 'noM') |
|
|
supplierdeliverJasperExport(id,'noM'); |
|
|
supplierdeliverJasperExport(id, 'noM', supplierName, deliNo) |
|
|
} |
|
|
} |
|
|
if (res.isM == false) { |
|
|
if (res.isM == false) { |
|
|
await SupplierdeliverRecordMainApi.getItemStatus(id).then(async (res) => { |
|
|
await SupplierdeliverRecordMainApi.getItemStatus(id).then(async (res) => { |
|
|
if (res) { |
|
|
if (res) { |
|
|
//号试(生准订单)模板 |
|
|
//号试(生准订单)模板 |
|
|
//window.open(documentSrc2.value + '&id=' + id) |
|
|
//window.open(documentSrc2.value + '&id=' + id) |
|
|
supplierdeliverJasperExportPS(id,''); |
|
|
supplierdeliverJasperExportPS(id, '', supplierName, deliNo) |
|
|
} else { |
|
|
} else { |
|
|
//window.open(documentSrc.value + '&id=' + id) |
|
|
//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 { |
|
|
try { |
|
|
// 发起导出导出明细 |
|
|
// 发起导出导出明细 |
|
|
let params = { |
|
|
let params = { |
|
|
id: id, |
|
|
id: id, |
|
|
type: type, |
|
|
type: type, |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
pageSize: 99999999, |
|
|
pageSize: 99999999 |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
const excelTitle = ref(route.meta.title) |
|
|
|
|
|
const data = await PackageApi.supplierdeliverJasperExport(params) |
|
|
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 { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const supplierdeliverJasperExportPS = async (id, type) => { |
|
|
const supplierdeliverJasperExportPS = async (id, type, supplierName, deliNo) => { |
|
|
try { |
|
|
try { |
|
|
// 发起导出导出明细 |
|
|
// 发起导出导出明细 |
|
|
let params = { |
|
|
let params = { |
|
|
id: id, |
|
|
id: id, |
|
|
type: type, |
|
|
type: type, |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
pageSize: 99999999, |
|
|
pageSize: 99999999 |
|
|
} |
|
|
} |
|
|
const excelTitle = ref(route.meta.title) |
|
|
|
|
|
const data = await PackageApi.supplierdeliverJasperExportPS(params) |
|
|
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 { |
|
|
} catch { |
|
|
} finally { |
|
|
} finally { |
|
|
} |
|
|
} |
|
|