|
|
@ -181,6 +181,8 @@ |
|
|
|
<SearchTable width="905px" ref="searchTableRef" sureText="打印所选" @searchTableSuccess="searchTableSuccess1"> |
|
|
|
<template #actionsOther> |
|
|
|
<el-button type="primary" @click="printAllClick">打印全部</el-button> |
|
|
|
<el-button type="primary" :loading="printAllLoading" @click="handlePrintAllExport">打印全部</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</SearchTable> |
|
|
|
<labelForm |
|
|
@ -1265,6 +1267,50 @@ const printAllClick = async () => { |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
/** 导出明细按钮操作 */ |
|
|
|
const printAllLoading = ref(false) // 导出的加载中 |
|
|
|
|
|
|
|
const doHandlePrintAllExport = async (asnNumber) => { |
|
|
|
try { |
|
|
|
// 发起导出导出明细 |
|
|
|
printAllLoading.value = true |
|
|
|
let params = { |
|
|
|
pageNo: 1, |
|
|
|
relateNumber: asnNumber, |
|
|
|
pageSize: 99999999, |
|
|
|
} |
|
|
|
const excelTitle = ref(route.meta.title) |
|
|
|
const data = await PackageApi.jasperExportAll(params) |
|
|
|
download.excel(data, `【${excelTitle.value}】【${formatDate(new Date())}】.pdf`) |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
printAllLoading.value = false |
|
|
|
} |
|
|
|
} |
|
|
|
const handlePrintAllExport = async () => { |
|
|
|
let res = await PackageApi.getLabelDetailPage({ |
|
|
|
moduleName: 'supplier', |
|
|
|
recordNumber: printRow.value.number, |
|
|
|
pageSize: 1000, |
|
|
|
pageNo: 1, |
|
|
|
}) |
|
|
|
|
|
|
|
await PackageApi.batchPrintingLablesForYT(res.list) |
|
|
|
.then(res => { |
|
|
|
let asnNumber |
|
|
|
if(res.xdpLabel){ |
|
|
|
//协定品标签 |
|
|
|
asnNumber = res.xdpLabel; |
|
|
|
} |
|
|
|
if (res.cgLabel) { |
|
|
|
//采购标签 |
|
|
|
asnNumber = res.cgLabel; |
|
|
|
} |
|
|
|
doHandlePrintAllExport(asnNumber); |
|
|
|
}).catch(err => { |
|
|
|
message.error(t('ts.创建标签失败')) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 批量打印--供应商发货申请 |
|
|
|
const searchTableSuccess1 = async (formField, searchField, val, formRef, type, row) => { |
|
|
|