|
@@ -524,18 +524,11 @@ export default {
|
|
|
if(increment > 0){
|
|
|
|
|
|
let index = Math.abs(Math.round(Math.random()*response1.length - 1))
|
|
|
- console.log(Math.abs(Math.round(Math.random()* warehousePrint.length - 1)),response1[index])
|
|
|
let pro = response1[index] //取出假数据并设定值
|
|
|
- pro.inOutDate = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].inOutDate
|
|
|
- pro.contractNo = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].contractNo
|
|
|
- pro.companyName = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].companyName
|
|
|
-
|
|
|
- pro.goodsName = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].goodsName
|
|
|
- pro.boxNo = warehousePrint[Math.abs(Math.round(Math.random()* warehousePrint.length - 1))].boxNo
|
|
|
pro.netWeight = Number((Math.random()*(70-10+1)+10).toFixed(2))
|
|
|
- pro.tare = Number((Math.random()*(20-10+1)+10).toFixed(2))
|
|
|
- pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
|
|
|
- if(pro.netWeight < increment){
|
|
|
+ pro.tare = Number((Math.random()*(20-10+1)+10).toFixed(2))
|
|
|
+ // pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
|
|
|
+ if(pro.netWeight < increment){ //随机净重 小于 所要增量
|
|
|
increment = (increment - pro.netWeight).toFixed(2) //所要增的量
|
|
|
if(increment < 10 && pro.netWeight <= 60){
|
|
|
pro.netWeight += Number(increment)
|
|
@@ -544,30 +537,37 @@ export default {
|
|
|
warehousePrint.push(pro)
|
|
|
}else{
|
|
|
increment -= pro.netWeight
|
|
|
- warehousePrint.push(pro)
|
|
|
+ pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
|
|
|
+ warehousePrint.push(pro)
|
|
|
}
|
|
|
- }else{
|
|
|
+ }else{ //随机净重 大于 所要增量
|
|
|
pro.netWeight = Number(increment.toFixed(2))
|
|
|
pro.grossWeight = Number((pro.tare + pro.netWeight).toFixed(2))
|
|
|
increment = 0
|
|
|
warehousePrint.push(pro)
|
|
|
}
|
|
|
response1.splice(index,1)//删除已添加过得假数据车牌号
|
|
|
+ if( response1.length == 0){
|
|
|
+ sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(warehousePrint))
|
|
|
+ let _canshu = ""
|
|
|
+ _canshu = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
|
|
|
+ window.open('../../../../../static/warehousePrint.html?type=' + _canshu)
|
|
|
+ }
|
|
|
+ }else{ //增量为0时
|
|
|
+ break
|
|
|
}
|
|
|
- sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(warehousePrint))
|
|
|
- let i = ""
|
|
|
- i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
|
|
|
- window.open('../../../../../static/warehousePrint.html?type=' + i)
|
|
|
- // return
|
|
|
}
|
|
|
- // },2000)
|
|
|
-
|
|
|
+ //跳转
|
|
|
+ sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(warehousePrint))
|
|
|
+ let _canshu = ""
|
|
|
+ _canshu = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
|
|
|
+ window.open('../../../../../static/warehousePrint.html?type=' + _canshu)
|
|
|
})
|
|
|
- }else{
|
|
|
+ }else{//没有增量比例的直接打印
|
|
|
sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(response.records))
|
|
|
- let i = ""
|
|
|
- i = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
|
|
|
- window.open('../../../../../static/warehousePrint.html?type=' + i)
|
|
|
+ let _canshu1 = ""
|
|
|
+ _canshu1 = this.parameter.radio+"&warehouseName=" + this.parameter.warehouseName
|
|
|
+ window.open('../../../../../static/warehousePrint.html?type=' + _canshu1)
|
|
|
}
|
|
|
}
|
|
|
})
|