+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/modules/production/scanForm.vue b/src/views/modules/production/scanForm.vue
index 4ef4b85..4ae9586 100644
--- a/src/views/modules/production/scanForm.vue
+++ b/src/views/modules/production/scanForm.vue
@@ -17,6 +17,10 @@ export default {
allNum:{
type:Number,
default: 0,
+ },
+ notifyQty:{
+ type:Number,
+ default:0,
}
},
computed:{
@@ -28,10 +32,19 @@ export default {
this.$emit("update:scanFlag",val)
}
},
+ total:{
+ get(){
+ return this.scanLabelDetailList.reduce((pre, cur) => {
+ return pre + new Decimal(cur.scanQty).toNumber()
+ }, 0);
+ },
+ set(val) {
+ // this.scanLabelDetailList = v
+ }
+ }
},
data(){
return{
- total:0,
model:{
flag:"",
label:'',
@@ -82,10 +95,9 @@ export default {
scanLabel(paramsScan).then(({data})=>{
if (data && data.code === 0){
this.scanLabelDetailList = data.rows;
- let total = this.scanLabelDetailList.reduce((pre,cur)=>{
- return pre+new Decimal(cur.scanQty).toNumber()
- },0)
- this.total = total
+ this.$emit("changeAllNum",this.scanLabelDetailList.reduce((pre, cur) => {
+ return pre + new Decimal(cur.scanQty).toNumber()
+ }, 0))
}else {
this.$message.warning(data.msg)
}
@@ -94,6 +106,10 @@ export default {
})
},
scanLabelEnter(){
+ if (this.total > this.notifyQty){
+ this.$message.warning("扫描累计数量不允许超过要求发货数量")
+ return;
+ }
let arr = this.model.label.split(";");
if (arr.length !== 3){
this.$message.warning("标签格式错误")
@@ -111,6 +127,10 @@ export default {
this.$message.warning(`标签数量与标准袋装数量不匹配`)
return;
}
+ if (new Decimal(this.total).add(new Decimal(arr[2])).toNumber()> this.notifyQty){
+ this.$message.warning("扫描累计数量不允许超过要求发货数量")
+ return;
+ }
// 保存数据 通知单数量:this.detail.notifyQty
let params={
site:this.detail.site,
@@ -176,17 +196,17 @@ export default {