|
|
@ -178,7 +178,8 @@ |
|
|
|
</BasicForm> |
|
|
|
|
|
|
|
<!-- 标签打印 --> |
|
|
|
<SearchTable width="905px" ref="searchTableRef" sureText="打印所选" @searchTableSuccess="searchTableSuccess1"> |
|
|
|
<!-- <SearchTable width="905px" ref="searchTableRef" sureText="打印所选" @searchTableSuccess="searchTableSuccess1">--> |
|
|
|
<SearchTable width="905px" ref="searchTableRef" sureText="打印所选" @searchTableSuccess="handlePrintSelectExport"> |
|
|
|
<template #actionsOther> |
|
|
|
<!-- <el-button type="primary" @click="printAllClick">打印全部</el-button>--> |
|
|
|
<el-button type="primary" :loading="printAllLoading" @click="handlePrintAllExport">打印全部</el-button> |
|
|
@ -1341,6 +1342,37 @@ const searchTableSuccess1 = async (formField, searchField, val, formRef, type, r |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const handlePrintSelectExport = async (formField, searchField, val, formRef, type, row) => { |
|
|
|
// let rows:any = [] |
|
|
|
// val.forEach(item=>{ |
|
|
|
// rows = [...rows,...item.selectionRows.map(item1=>item1.number)] |
|
|
|
// }) |
|
|
|
if (val.length == 0) { |
|
|
|
message.warning(t('ts.请先选择要打印的数据')) |
|
|
|
return |
|
|
|
} |
|
|
|
let array1 = [] |
|
|
|
val.forEach((item,index) => { |
|
|
|
array1.push(item) |
|
|
|
}) |
|
|
|
await PackageApi.batchPrintingLablesForYT(array1) |
|
|
|
.then(res => { |
|
|
|
let asnNumber; |
|
|
|
if(res.xdpLabel){ |
|
|
|
//协定品标签 |
|
|
|
asnNumber = res.xdpLabel; |
|
|
|
} |
|
|
|
if (res.cgLabel) { |
|
|
|
//采购标签 |
|
|
|
asnNumber = res.cgLabel; |
|
|
|
} |
|
|
|
debugger; |
|
|
|
doHandlePrintAllExport(asnNumber); |
|
|
|
}).catch(err => { |
|
|
|
message.error(t('ts.创建标签失败')) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
const print = async () => { |
|
|
|
window.open(src.value + '&number=' + detatableData.tableList[0].number) |
|
|
|
} |
|
|
|