|
|
|
@ -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 { |
|
|
|
<el-table-column label="操作" width="150px" header-align="center" fixed align="center"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-link style="cursor: pointer" @click="clickScan(row)">扫描记录</el-link> |
|
|
|
<el-link style="cursor: pointer" @click="boxLabelVisibleHandler(row)">外箱标签</el-link> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -520,6 +680,101 @@ export default { |
|
|
|
<el-button @click="updateDelNotifyDetailBtn('N')">不 合 格</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog :visible.sync="boxLabelVisible" v-drag :close-on-click-modal="false" title="打印外箱标签" width="800px"> |
|
|
|
<!-- {{selectDelNotifyDetail}}--> |
|
|
|
<el-form :model="selectDelNotifyDetail" label-position="top" label-width="120"> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="工厂编码"> |
|
|
|
<el-input v-model="selectDelNotifyDetail.site" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="通知单号"> |
|
|
|
<el-input v-model="selectDelNotifyDetail.delNotifyNo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="通知单序号"> |
|
|
|
<el-input v-model="selectDelNotifyDetail.delNotifyItemNo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="产品编码"> |
|
|
|
<el-input v-model="selectDelNotifyDetail.partNo" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="产品名称"> |
|
|
|
<el-input v-model="selectDelNotifyDetail.partDesc" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="20"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="发货数量" required> |
|
|
|
<el-input-number v-model="selectDelNotifyDetail.shipQty" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="每盒(袋)数量" required> |
|
|
|
<el-input-number v-model="selectDelNotifyDetail.qtyPerBag" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="每箱中的盒数" required> |
|
|
|
<el-input-number v-model="selectDelNotifyDetail.qtyPerBox" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="每箱总数量"> |
|
|
|
<el-input-number v-model="boxLabelTotalQty" disabled :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="箱数" required> |
|
|
|
<el-input-number v-model="boxNum" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="末箱子余数" required> |
|
|
|
<el-input-number v-model="endBoxQty" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<fieldset> |
|
|
|
<legend>箱号信息:</legend> |
|
|
|
<el-row :gutter="30"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="总箱数" required> |
|
|
|
<el-input-number v-model="selectDelNotifyDetail.printTotalBoxCount" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="起始箱号" required> |
|
|
|
<el-input-number v-model="selectDelNotifyDetail.printBoxSeqNo" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="箱数" required> |
|
|
|
<el-input-number v-model="boxNum" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="散箱箱号" required> |
|
|
|
<el-input-number v-model="scatteredBoxNo" :controls="false" :step="0" :precision="0"></el-input-number> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
</el-form> |
|
|
|
<span slot="footer" class="dialog-footer" style="text-align: center"> |
|
|
|
<el-button type="primary" @click="printBoxLabel">打印</el-button> |
|
|
|
<el-button @click="boxLabelVisible = false">取消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
<scan-form :is-report="true" :scan-flag.sync="scanFlag" @changeAllNum="changeAllNum" :all-num="allNum" :notify-qty="notifyQty" :detail="delNotifyDetail"></scan-form> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|