|
|
@ -130,7 +130,7 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getPoList, receivePo,printLabel } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
import { getPoList, receivePo, printLabel, getNextItemNo } from "@/api/po/po.js"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
@ -189,7 +189,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
recvLine(row) { |
|
|
|
|
|
|
|
|
async recvLine(row) { |
|
|
/* if (row.receiveCaseDB!='INVDIR' && row.receiveCaseDB!='QAINV') { |
|
|
/* if (row.receiveCaseDB!='INVDIR' && row.receiveCaseDB!='QAINV') { |
|
|
return this.$message.warning("该采购订单行的收货方式为"+row.receiveCase+",无法接收"); |
|
|
return this.$message.warning("该采购订单行的收货方式为"+row.receiveCase+",无法接收"); |
|
|
}*/ |
|
|
}*/ |
|
|
@ -199,12 +199,30 @@ export default { |
|
|
if (row.status === 'Stopped' || row.status === 'Closed' || row.status === 'Cancelled') { |
|
|
if (row.status === 'Stopped' || row.status === 'Closed' || row.status === 'Cancelled') { |
|
|
return this.$message.warning("该采购订单行状态为"+row.status+",无法接收"); |
|
|
return this.$message.warning("该采购订单行状态为"+row.status+",无法接收"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 获取下一个itemNo |
|
|
|
|
|
let nextItemNo = 1; |
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await getNextItemNo({ |
|
|
|
|
|
orderNo: row.orderNo, |
|
|
|
|
|
lineNo: row.lineNo, |
|
|
|
|
|
releaseNo: row.releaseNo || '' |
|
|
|
|
|
}); |
|
|
|
|
|
if (data.code === 0) { |
|
|
|
|
|
nextItemNo = data.data; |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error('获取itemNo失败:', error); |
|
|
|
|
|
// 失败时使用默认值1 |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.recvItem = { |
|
|
this.recvItem = { |
|
|
...row, |
|
|
...row, |
|
|
poNo: row.poNumber || this.scanCode, |
|
|
poNo: row.poNumber || this.scanCode, |
|
|
dueinQty: row.qtyToReceive || row.invQtyToReceive, |
|
|
dueinQty: row.qtyToReceive || row.invQtyToReceive, |
|
|
transQty: '', |
|
|
transQty: '', |
|
|
batchNo: row.partNo+'-'+row.lineNo+'-'+row.releaseNo+'-'+1, |
|
|
|
|
|
|
|
|
itemNo: nextItemNo, |
|
|
|
|
|
batchNo: row.partNo+'-'+row.lineNo+'-'+row.releaseNo+'-'+nextItemNo, |
|
|
deliveryDate: row.plannedDeliveryDate || '', |
|
|
deliveryDate: row.plannedDeliveryDate || '', |
|
|
arrivalDate: this.getCurrentDate(), |
|
|
arrivalDate: this.getCurrentDate(), |
|
|
supplierBatchNo: '', |
|
|
supplierBatchNo: '', |
|
|
@ -270,7 +288,7 @@ export default { |
|
|
transQty: item.transQty, |
|
|
transQty: item.transQty, |
|
|
batchNo: item.batchNo, |
|
|
batchNo: item.batchNo, |
|
|
locationNo: item.locationNo, |
|
|
locationNo: item.locationNo, |
|
|
itemNo: 1, |
|
|
|
|
|
|
|
|
itemNo: item.itemNo, |
|
|
wdr: item.wdr || '*', |
|
|
wdr: item.wdr || '*', |
|
|
deliveryDate: item.deliveryDate, |
|
|
deliveryDate: item.deliveryDate, |
|
|
arrivalDate: item.arrivalDate, |
|
|
arrivalDate: item.arrivalDate, |
|
|
@ -303,7 +321,7 @@ export default { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
this.$message.success("操作成功"); |
|
|
this.$message.success("操作成功"); |
|
|
this.clearAllHandlingUnitCache(); |
|
|
this.clearAllHandlingUnitCache(); |
|
|
this.printViaServer(data.data); // 调用打印 |
|
|
|
|
|
|
|
|
this.printViaServer(data.data,item.needCheck); // 调用打印 |
|
|
this.processFlag = 1; |
|
|
this.processFlag = 1; |
|
|
this.scanCode = ''; |
|
|
this.scanCode = ''; |
|
|
this.poList = []; |
|
|
this.poList = []; |
|
|
@ -322,7 +340,7 @@ export default { |
|
|
/** |
|
|
/** |
|
|
* 通过服务器打印 |
|
|
* 通过服务器打印 |
|
|
*/ |
|
|
*/ |
|
|
async printViaServer(receiptNo) { |
|
|
|
|
|
|
|
|
async printViaServer(receiptNo,needCheck) { |
|
|
this.$emit('print-start') |
|
|
this.$emit('print-start') |
|
|
try { |
|
|
try { |
|
|
const printRequest = { |
|
|
const printRequest = { |
|
|
@ -334,7 +352,8 @@ export default { |
|
|
userId: localStorage.getItem('userName'), |
|
|
userId: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
username: localStorage.getItem('userName'), |
|
|
site: localStorage.getItem('site'), |
|
|
site: localStorage.getItem('site'), |
|
|
receiptNo: receiptNo |
|
|
|
|
|
|
|
|
receiptNo: receiptNo, |
|
|
|
|
|
needCheck:needCheck |
|
|
} |
|
|
} |
|
|
const { data } = await printLabel(printRequest) |
|
|
const { data } = await printLabel(printRequest) |
|
|
if (data.code === 200) { |
|
|
if (data.code === 200) { |
|
|
|