Browse Source

标签打印部分逻辑修改 选择打印的批次 打印数据

master
DouDou 8 months ago
parent
commit
287b5f068f
  1. 4
      src/api/shipment/index.js
  2. 41
      src/views/modules/finshProduct/outWarehouse/com_print_pick_list.vue

4
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)

41
src/views/modules/finshProduct/outWarehouse/com_print_pick_list.vue

@ -60,12 +60,24 @@
<!-- 第三行 -->
<el-row :gutter="15" style="margin-bottom: 15px;">
<el-col :span="24">
<el-col :span="12">
<el-form-item label="装箱数量" class="customer-item">
<el-input v-model="formData.boxQty" type="number">
</el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="装箱批次" class="customer-item">
<el-select v-model="formData.batchNo" placeholder="请选择装箱批次">
<el-option
v-for="item in batchNos"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<!-- 按钮区域 -->
@ -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,7 +163,18 @@ 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() {
@ -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 {

Loading…
Cancel
Save