|
@@ -432,7 +432,8 @@ export default {
|
|
|
var year = date.getFullYear();
|
|
|
var month = date.getMonth() + 1;
|
|
|
var strDate = date.getDate()
|
|
|
- this.parameter.startDate = ""+year+"-"+month+"-"+(strDate-1)
|
|
|
+ var pastdate=new Date(date.getTime()-24*60*60*1000)
|
|
|
+ this.parameter.startDate = pastdate.getFullYear()+'-'+(pastdate.getMonth() + 1)+'-'+pastdate.getDate()
|
|
|
this.parameter.endDate = ""+year+"-"+month+"-"+strDate
|
|
|
this.$forceUpdate();
|
|
|
this.isShowPrintType = true
|
|
@@ -518,16 +519,20 @@ export default {
|
|
|
var increment = (countWeight * (Number(this.parameter.proportion)/100)).toFixed(2)//所要增加的量
|
|
|
printAdd().toPromise()
|
|
|
.then((response1) => {
|
|
|
+ // setTimeout(function(){
|
|
|
for(let i = 0 ; i < response1.length ; i++){
|
|
|
increment = Number(increment)
|
|
|
if(increment > 0){
|
|
|
- let index = Math.round(Math.random()*response1.length - 1)
|
|
|
+
|
|
|
+ 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.round(Math.random()* warehousePrint.length - 1)].inOutDate
|
|
|
- pro.contractNo = warehousePrint[Math.round(Math.random()* warehousePrint.length - 1)].contractNo
|
|
|
- pro.companyName = warehousePrint[Math.round(Math.random()* warehousePrint.length - 1)].companyName
|
|
|
- pro.goodsName = warehousePrint[Math.round(Math.random()* warehousePrint.length - 1)].goodsName
|
|
|
- pro.boxNo = warehousePrint[Math.round(Math.random()* warehousePrint.length - 1)].boxNo
|
|
|
+ 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))
|
|
@@ -548,14 +553,15 @@ export default {
|
|
|
warehousePrint.push(pro)
|
|
|
}
|
|
|
response1.splice(index,1)//删除已添加过得假数据车牌号
|
|
|
- }else{
|
|
|
+ }
|
|
|
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)
|
|
|
+
|
|
|
})
|
|
|
}else{
|
|
|
sessionStorage.setItem("inOutWarehouse_Print",JSON.stringify(response.records))
|