diff --git a/src/api/pad.js b/src/api/pad.js index de4dc2f..914ed78 100644 --- a/src/api/pad.js +++ b/src/api/pad.js @@ -15,3 +15,7 @@ export const getRoutingDetailData = data => createAPI(`pad/getRoutingDetailData` export const searchDelHeaderList = data => createAPI(`/pad/searchDelHeaderList`,'get',data) export const searchDelNotifyDetail = data => createAPI(`/pad/searchDelNotifyDetail`,'get',data) export const updateDelNotifyDetail = data => createAPI(`/pad/updateDelNotifyDetail`,'post',data) + +export const getPrintBoxLabel = (data) => createAPI(`/delivery/box/label`,'post',data) +export const getPrintBoxLabelHandle = (data) => createAPI(`/delivery/box/label/handle`,'post',data) +export const finallyPrintBoxLabel = (data) => createAPI(`/delivery/box/label/finally`,'post',data) diff --git a/src/assets/scss/global.scss b/src/assets/scss/global.scss index 84e3839..ccd1d42 100644 --- a/src/assets/scss/global.scss +++ b/src/assets/scss/global.scss @@ -423,3 +423,14 @@ a:hover{ padding-right: 0px; padding-left: 0px; } + +.el-input-number--medium{ + line-height: 1.5px; + width: 100%; +} + +.el-input-number .el-input__inner{ + text-align: right; + padding-right: 5px !important; + padding-left: 0 !important; +} diff --git a/src/views/modules/print/print_outBox_label.js b/src/views/modules/print/print_outBox_label.js index dfa9232..e3bcbd3 100644 --- a/src/views/modules/print/print_outBox_label.js +++ b/src/views/modules/print/print_outBox_label.js @@ -7,12 +7,10 @@ export function printOutBoxLabel(printList) { //LODOP.SET_LICENSES("", "AF8A5800B84BCC5218BCF67B92627BEA", "", ""); LODOP.SET_LICENSES("", "AF8A5800B823CC8E18BCF67B925E7BF0", "", ""); // LODOP.SET_PRINTER_INDEXA(printList[0].printerName); - //循环调用打印机 for(let i = 0; i < printList.length; i++){ let printData = printList[i]; LODOP.NewPage(); - // LODOP.SET_PRINT_PAGESIZE(0,1000,1500,""); LODOP.SET_PRINT_PAGESIZE(0,1000,1500,""); LODOP.ADD_PRINT_RECT(60,5,551,270,0,1); LODOP.ADD_PRINT_TEXT(3,35,496,50,printData.siteName ); diff --git a/src/views/modules/production/shippingScan.vue b/src/views/modules/production/shippingScan.vue index 4633fa0..bb97bc3 100644 --- a/src/views/modules/production/shippingScan.vue +++ b/src/views/modules/production/shippingScan.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 () { @@ -147,10 +154,162 @@ export default { }).catch((error)=>{ this.$message.error(error) }) + }, + 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) + }) } }, created() { this.searchDelHeaderList(); + }, + 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){ + + } + }, } } @@ -337,10 +496,11 @@ export default { height="250" border stripe style="margin-top: 10px;"> - + 不 合 格 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ 箱号信息: + + + + + + + + + + + + + + + + + + + + + + +
+
+ + 打印 + 取消 + +