diff --git a/src/api/shipment/index.js b/src/api/shipment/index.js index 2f21835..83cb713 100644 --- a/src/api/shipment/index.js +++ b/src/api/shipment/index.js @@ -11,3 +11,7 @@ export const cancelShipment = (data) => createAPI( `/shipment/cancel`,'post',dat /* 获取装箱单打印的数据 */ export const getPrintShipment = (data)=>createAPI('/shipment/getPrintShipment','post',data) + +/* 获取装箱单打印批次的数据 */ +export const getPrintShipmentBatchNos = (data)=>createAPI('/shipment/getPrintShipmentBatchNos','post',data) + diff --git a/src/views/modules/finshProduct/outWarehouse/com_print_pick_list.vue b/src/views/modules/finshProduct/outWarehouse/com_print_pick_list.vue index b05098d..290454f 100644 --- a/src/views/modules/finshProduct/outWarehouse/com_print_pick_list.vue +++ b/src/views/modules/finshProduct/outWarehouse/com_print_pick_list.vue @@ -60,12 +60,24 @@ - + + + + + + + + + @@ -92,7 +104,7 @@ /*打印标签专用的js*/ import { printShipmentPackingBoxLabel } from '@/views/modules/label/print_shipment_packing_box_label.js' import { - getPrintShipment, + getPrintShipment, getPrintShipmentBatchNos, } from '@/api/shipment' import dayjs from "dayjs"; @@ -108,7 +120,9 @@ export default { relatedOrderNo: '', saleQty: 0, boxQty: 0, + batchNo: '', }, + batchNos: [], printRow: {}, dataListLoading: false, printLoading: false, @@ -123,8 +137,12 @@ export default { this.formData.orderNumber = row.orderNumber; this.formData.saleQty = row.saleQty; this.formData.boxQty = row.saleQty; + this.formData.batchNo = ''; + this.batchNos = []; //打开显示 this.visible = true; + //刷新列表信息 + this.initShipmentBatchNos(); //赋值 this.printRow = JSON.parse(JSON.stringify(row)); //自动获取焦点 @@ -145,9 +163,20 @@ export default { boxQty: 0, }; }, + /*初始化数据*/ + initShipmentBatchNos(){ + getPrintShipmentBatchNos(this.printRow).then(({data})=>{ + if (data && data.code === 0){ + this.batchNos = data.rows; + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, - - // 处理打印标签 + // 处理打印标签 handlePrintLabel() { if (!this.formData || Object.keys(this.formData).length === 0) { this.$message.warning('请先扫描标签条码'); @@ -171,8 +200,10 @@ export default { this.printRow.boxQty = boxQty; getPrintShipment(this.printRow).then(({data})=>{ if (data && data.code === 0){ - let arr = data.row; - arr.productionDate = `${dayjs(arr.productionDate).format("YYYYMMDD")}`; + let printRow = data.row; + printRow.productionDate = `${dayjs(printRow.productionDate).format("YYYYMMDD")}`; + let arr = []; + arr.push(printRow) ; printShipmentPackingBoxLabel(arr); this.$message.success('标签打印成功'); }else {