|
|
@ -111,7 +111,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getPoReceiveRecords, getHandlingUnitsByReceiptNo, printLabel } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
import { getPoReceiveRecords, getHandlingUnitsByReceiptNo, printLabelCommon } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
@ -222,7 +222,13 @@ export default { |
|
|
|
|
|
|
|
|
this.fullscreenLoading = true; |
|
|
this.fullscreenLoading = true; |
|
|
try { |
|
|
try { |
|
|
await this.printViaServer(unit.unitId); |
|
|
|
|
|
|
|
|
let printLabelType; |
|
|
|
|
|
if (unit.partNo && unit.partNo.startsWith("80")) { |
|
|
|
|
|
printLabelType = '库存成品标签'; |
|
|
|
|
|
} else { |
|
|
|
|
|
printLabelType = 'BIL标签'; |
|
|
|
|
|
} |
|
|
|
|
|
await this.printViaServer(unit.unitId,printLabelType); |
|
|
this.$message.success('补打标签任务已发送!'); |
|
|
this.$message.success('补打标签任务已发送!'); |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('补打标签失败:', error); |
|
|
console.error('补打标签失败:', error); |
|
|
@ -234,21 +240,16 @@ export default { |
|
|
/** |
|
|
/** |
|
|
* 通过服务器打印 |
|
|
* 通过服务器打印 |
|
|
*/ |
|
|
*/ |
|
|
async printViaServer(unitId) { |
|
|
|
|
|
|
|
|
async printViaServer(unitId,printLabelType) { |
|
|
try { |
|
|
try { |
|
|
const printRequest = { |
|
|
const printRequest = { |
|
|
reportId: this.reportId, |
|
|
|
|
|
zplCode: this.zplCode, |
|
|
|
|
|
paperSize: this.paperSize, |
|
|
|
|
|
orientation: this.orientation, |
|
|
|
|
|
dpi: this.dpi, |
|
|
|
|
|
userId: localStorage.getItem('userName'), |
|
|
userId: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
unitId: unitId, |
|
|
|
|
|
printLabel:"BIL标签" |
|
|
|
|
|
|
|
|
unitIds: [unitId], |
|
|
|
|
|
labelType: printLabelType |
|
|
} |
|
|
} |
|
|
const { data } = await printLabel(printRequest) |
|
|
|
|
|
|
|
|
const { data } = await printLabelCommon(printRequest) |
|
|
if (data.code === 200) { |
|
|
if (data.code === 200) { |
|
|
return Promise.resolve(); |
|
|
return Promise.resolve(); |
|
|
} else { |
|
|
} else { |
|
|
|