瀏覽代碼

仓库打印sdy

zhongtianhaoyuan 3 年之前
父節點
當前提交
25a8820436
共有 2 個文件被更改,包括 67 次插入40 次删除
  1. 44 17
      public/static/warehousePrint.html
  2. 23 23
      src/views/warehouse/warehouseManagementList.vue

+ 44 - 17
public/static/warehousePrint.html

@@ -181,36 +181,56 @@
       <div class="center">
         <div class="title">黑龙江中天昊元贸易有限公司-{{warehouseName}}仓库<span v-if="type == '2'">出</span><span v-if="type == '3'">入</span>库单</div>
         <table class="table">
+          <tr>
+            <td colspan="8">仓库名:{{warehouseName}} 质检员:暂无 复检员:暂无 检斤员:暂无</td>
+          </tr>
+          <tr>
+            <td>值班日期:</td>
+            <td colspan="3"></td>
+            <td>到货日期</td>
+            <td></td>
+            <td colspan="3"></td>
+          </tr>
+          <tr>
+            <td>仓位号:</td>
+            <td colspan="2"></td>
+            <td>货名:玉米</td>
+            <td></td>
+            <td></td>
+            <td colspan="2">质量单位:吨</td>
+          </tr>
             <tr class="row">
                  <th v-if="type == '2'">出库日期</th>
                  <th v-if="type == '3'">入库日期</th>
-                 <th>合同/业务编号</th>
-                 <th>客户</th>
-                 <th>货名</th>
                  <th>车牌号</th>
-                 <th>箱号</th>
-                 <th>车厢号</th>
+                 <th>仓位号</th>
+                 <th>箱一号</th>
+                 <th>箱二号</th>
                  <th>毛重</th>
                  <th>皮重</th>
                  <th>净重</th>
             </tr>
-            <!-- <div v-for="(item,index) in printData"> -->
          <tr class="row" v-for="(item,index) in printData">
             <td class="col">{{item.inOutDate}}</td>
-            <td class="col">{{item.contractNo}}</td>
-            <td class="col">{{item.companyName}}</td>
-            <td class="col">{{item.goodsName}}</td>
             <td class="col">{{item.carNo}}</td>
-            <td class="col">{{item.boxNo}}<span v-if="item.boxNoOther">,</span>{{item.boxNoOther}}</td>
-            <td class="col">{{item.boxNo}}<span v-if="item.boxNoOther">,</span>{{item.boxNoOther}}</td>
+            <td class="col">{{item.binNumber}}</td>
+            <td class="col">{{item.boxNo}}</td>
+            <td class="col">{{item.boxNo}}</td>
             <td class="col">{{item.grossWeight}}</td>
             <td class="col">{{item.tare}}</td>
             <td class="col">{{item.netWeight}}</td>
           </tr>
-        <!-- </div> -->
+          <tr class="row">
+            <td class="col">合计</td>
+            <td class="col"></td>
+            <td class="col"></td>
+            <td class="col"></td>
+            <td class="col"></td>
+            <td class="col">{{maoZhong.toFixed(3)}}</td>
+            <td class="col">{{piZhong.toFixed(3)}}</td>
+            <td class="col">{{jingZhong.toFixed(3)}}</td>
+          </tr>
         </table>
-        <!-- <div class="bottom">
-        </div> -->
       </div>
     
     </div>
@@ -237,6 +257,11 @@
         date: '',
         warehouseName:"",
         type:"",
+        maoZhong:0,
+        piZhong:0,
+        jingZhong:0,
+        binNos:[],
+        binNoShow:""
      
       },
       computed: {},
@@ -274,9 +299,11 @@
         this.type = decodeURIComponent(this.getQueryVariable('type'))
         this.warehouseName = decodeURIComponent(this.getQueryVariable('warehouseName'))
         this.printData = JSON.parse(sessionStorage.getItem('inOutWarehouse_Print'))
-        console.log("磅单",this.printData)
-        
-        console.log(this.printData % 17)
+        for(var count = 0 ; count < this.printData.length; count ++){
+          this.maoZhong += this.printData[count].grossWeight
+          this.piZhong += this.printData[count].tare
+          this.jingZhong += this.printData[count].netWeight
+        }
         // document.title = this.printData.compName + '结算凭证'
         window.print()
         window.onafterprint = function(event) {

+ 23 - 23
src/views/warehouse/warehouseManagementList.vue

@@ -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)
              }
           }
         })