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 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-row :gutter="15" style="margin-bottom: 15px;">
<el-col :span="24">
<el-col :span="12">
<el-form-item label="装箱数量" class="customer-item"> <el-form-item label="装箱数量" class="customer-item">
<el-input v-model="formData.boxQty" type="number"> <el-input v-model="formData.boxQty" type="number">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </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> </el-row>
<!-- 按钮区域 --> <!-- 按钮区域 -->
@ -92,7 +104,7 @@
/*打印标签专用的js*/ /*打印标签专用的js*/
import { printShipmentPackingBoxLabel } from '@/views/modules/label/print_shipment_packing_box_label.js' import { printShipmentPackingBoxLabel } from '@/views/modules/label/print_shipment_packing_box_label.js'
import { import {
getPrintShipment,
getPrintShipment, getPrintShipmentBatchNos,
} from '@/api/shipment' } from '@/api/shipment'
import dayjs from "dayjs"; import dayjs from "dayjs";
@ -108,7 +120,9 @@ export default {
relatedOrderNo: '', relatedOrderNo: '',
saleQty: 0, saleQty: 0,
boxQty: 0, boxQty: 0,
batchNo: '',
}, },
batchNos: [],
printRow: {}, printRow: {},
dataListLoading: false, dataListLoading: false,
printLoading: false, printLoading: false,
@ -123,8 +137,12 @@ export default {
this.formData.orderNumber = row.orderNumber; this.formData.orderNumber = row.orderNumber;
this.formData.saleQty = row.saleQty; this.formData.saleQty = row.saleQty;
this.formData.boxQty = row.saleQty; this.formData.boxQty = row.saleQty;
this.formData.batchNo = '';
this.batchNos = [];
// //
this.visible = true; this.visible = true;
//
this.initShipmentBatchNos();
// //
this.printRow = JSON.parse(JSON.stringify(row)); this.printRow = JSON.parse(JSON.stringify(row));
// //
@ -145,7 +163,18 @@ export default {
boxQty: 0, 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() { handlePrintLabel() {
@ -171,8 +200,10 @@ export default {
this.printRow.boxQty = boxQty; this.printRow.boxQty = boxQty;
getPrintShipment(this.printRow).then(({data})=>{ getPrintShipment(this.printRow).then(({data})=>{
if (data && data.code === 0){ 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); printShipmentPackingBoxLabel(arr);
this.$message.success('标签打印成功'); this.$message.success('标签打印成功');
}else { }else {

Loading…
Cancel
Save