From d9a26857a53c520f194702edbc146bbdf71e6bc9 Mon Sep 17 00:00:00 2001
From: qiezi <15576055375@163.com>
Date: Thu, 1 Aug 2024 15:55:21 +0800
Subject: [PATCH] =?UTF-8?q?24-05-16=20=E6=A0=87=E7=AD=BE=E8=AE=B0=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/production/outboundLabelScan.vue | 255 ++++++++++++++++++
src/views/modules/production/shippingScan.vue | 4 +-
2 files changed, 257 insertions(+), 2 deletions(-)
diff --git a/src/views/modules/production/outboundLabelScan.vue b/src/views/modules/production/outboundLabelScan.vue
index 8417ba8..3fcff74 100644
--- a/src/views/modules/production/outboundLabelScan.vue
+++ b/src/views/modules/production/outboundLabelScan.vue
@@ -7,6 +7,8 @@ import {
import scanForm from "./scanForm.vue";
import dayjs from "dayjs";
import {Decimal} from "decimal.js";
+import {finallyPrintBoxLabel, getPrintBoxLabel, getPrintBoxLabelHandle} from "../../../api/pad";
+import {printOutBoxLabel} from "../print/print_outBox_label";
export default {
name: "shippingScan",
components:{
@@ -47,6 +49,11 @@ export default {
no:1,
size:50,
total:0,
+ boxLabelVisible:false,
+ selectDelNotifyDetail:{},
+ boxNum:0,
+ endBoxQty:0,
+ scatteredBoxNo:0,
}
},
mounted () {
@@ -130,8 +137,160 @@ export default {
changeAllNum(val){
this.allNum = val;
this.delNotifyDetail.allNum = val;
+ },
+ boxLabelVisibleHandler(row){
+ this.selectDelNotifyDetail = {
+ site:row.site,
+ delNotifyNo:row.delNotifyNo,
+ delNotifyItemNo:row.delNotifyItemNo,
+ partNo:row.partNo,
+ partDesc:row.partDescription,
+ shipQty:row.shipQty,
+ qtyPerBox:0,
+ qtyPerBag:0,
+ printTotalBoxCount:0,
+ printBoxSeqNo:0,
+ };
+ getPrintBoxLabel(this.selectDelNotifyDetail).then(({data})=>{
+ if (data && data.code === 0){
+ if (data.row){
+ this.selectDelNotifyDetail.qtyPerBox = data.row.QtyPerBox;
+ this.selectDelNotifyDetail.printTotalBoxCount = data.row.PrintTotalBoxCount;
+ this.selectDelNotifyDetail.printBoxSeqNo = data.row.PrintBoxSeqNo;
+ }
+ this.boxLabelVisible = true;
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ printBoxLabel(){
+ if (this.selectDelNotifyDetail.shipQty === undefined || this.selectDelNotifyDetail.shipQty === null || this.selectDelNotifyDetail.shipQty === ""){
+ this.$message.warning("发货数量不能为空")
+ return
+ }
+ if (this.selectDelNotifyDetail.qtyPerBag === undefined || this.selectDelNotifyDetail.qtyPerBag === null || this.selectDelNotifyDetail.qtyPerBag === ""){
+ this.$message.warning("每盒(袋)数量不能为空")
+ return
+ }
+ if (this.selectDelNotifyDetail.qtyPerBox === undefined || this.selectDelNotifyDetail.qtyPerBox === null || this.selectDelNotifyDetail.qtyPerBox === ""){
+ this.$message.warning("每箱中的盒数不能为空")
+ return
+ }
+ if (this.boxNum === undefined || this.boxNum === null || this.boxNum === ""){
+ this.$message.warning("箱数不能为空")
+ return
+ }
+ if (this.endBoxQty === undefined || this.endBoxQty === null || this.endBoxQty === ""){
+ this.$message.warning("末箱余数不能为空")
+ return
+ }
+ if (this.selectDelNotifyDetail.printTotalBoxCount === undefined || this.selectDelNotifyDetail.printTotalBoxCount === null || this.selectDelNotifyDetail.printTotalBoxCount === ""){
+ this.$message.warning("总箱数不能为空")
+ return
+ }
+ if (this.selectDelNotifyDetail.printBoxSeqNo === undefined || this.selectDelNotifyDetail.printBoxSeqNo === null || this.selectDelNotifyDetail.printBoxSeqNo === ""){
+ this.$message.warning("起始箱号不能为空")
+ return
+ }
+ if (this.scatteredBoxNo === undefined || this.scatteredBoxNo === null || this.scatteredBoxNo === ""){
+ this.$message.warning("散箱箱号不能为空")
+ return
+ }
+ //起始箱号 + 箱数 > 总箱数,提示 起始箱号 + 箱数 -1 超出了总箱数。
+ if (this.selectDelNotifyDetail.printBoxSeqNo + this.boxNum > this.selectDelNotifyDetail.printTotalBoxCount){
+ this.$message.warning("超出总箱数。")
+ return
+ }
+ // 散箱箱号 > 总箱数,提示 散箱箱号 超出了总箱数
+ if (this.scatteredBoxNo > this.selectDelNotifyDetail.printTotalBoxCount){
+ this.$message.warning("散箱箱号超出了总箱数。")
+ return
+ }
+ this.printBoxLabelHandler();
+ },
+ printBoxLabelHandler(){
+ let params = {
+ ...this.selectDelNotifyDetail,
+ boxNum:this.boxNum,
+ endBoxQty:this.endBoxQty,
+ partSpec:this.selectDelNotifyDetail.partDesc,
+ scatteredBoxNo:this.scatteredBoxNo,
+ boxLabelTotalQty:this.boxLabelTotalQty,
+ }
+ getPrintBoxLabelHandle(params).then(({data})=>{
+ if (data && data.code === 0){
+ // 调用打印插件
+ this.$message.success("打印成功")
+ printOutBoxLabel(data.rows)
+ // 打印执行方法
+ this.finallyPrintBoxLabel(params);
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ finallyPrintBoxLabel(params){
+ finallyPrintBoxLabel(params).then(({data})=>{
+ if (data && data.code === 0){
+ this.boxLabelVisible = false;
+ this.$message.success(data.msg)
+ }else {
+ this.$message.warning(data.msg)
+ }
+ }).catch((error)=>{
+ this.$message.error(error)
+ })
+ },
+ },
+ watch:{
+ "selectDelNotifyDetail.shipQty"(newVal,oldVal){
+ if (this.selectDelNotifyDetail.qtyPerBox === 0 || !this.selectDelNotifyDetail.qtyPerBox){
+ this.boxNum = 0;
+ this.endBoxQty = 0;
+ return
+ }
+ this.endBoxQty = this.selectDelNotifyDetail.shipQty % this.boxLabelTotalQty
+ this.boxNum = Math.floor(this.selectDelNotifyDetail.shipQty / this.boxLabelTotalQty)
+ },
+ "boxLabelTotalQty"(newVal,oldVal){
+ if (this.selectDelNotifyDetail.qtyPerBox === 0 || !this.selectDelNotifyDetail.qtyPerBox){
+ this.boxNum = 0;
+ this.endBoxQty = 0;
+ return
+ }
+ this.endBoxQty = this.selectDelNotifyDetail.shipQty % this.boxLabelTotalQty
+ this.boxNum = Math.floor(this.selectDelNotifyDetail.shipQty / this.boxLabelTotalQty)
+ },
+ "boxNum"(newVal,oldVal){
+ if (this.endBoxQty > 0){
+ this.scatteredBoxNo = this.boxNum + this.selectDelNotifyDetail.printBoxSeqNo
+ }else {
+ this.scatteredBoxNo = 0
+ }
+ },
+ "selectDelNotifyDetail.printBoxSeqNo"(newVal,oldVal){
+ if (this.endBoxQty > 0){
+ this.scatteredBoxNo = this.boxNum + this.selectDelNotifyDetail.printBoxSeqNo
+ }else {
+ this.scatteredBoxNo = 0
+ }
}
},
+ computed:{
+ boxLabelTotalQty:{
+ get(){
+ return this.selectDelNotifyDetail.qtyPerBag * this.selectDelNotifyDetail.qtyPerBox
+ },
+ set(val){
+
+ }
+ },
+ },
created() {
this.searchDelHeaderList();
}
@@ -318,6 +477,7 @@ export default {
扫描记录
+ 外箱标签
不 合 格
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/production/shippingScan.vue b/src/views/modules/production/shippingScan.vue
index bb97bc3..812b3d7 100644
--- a/src/views/modules/production/shippingScan.vue
+++ b/src/views/modules/production/shippingScan.vue
@@ -496,11 +496,11 @@ export default {
height="250"
border stripe
style="margin-top: 10px;">
-
+
检验
标签扫描
- 外箱标签
+ 外箱标签