Browse Source

修改打印单净重毛重合计问题

lichao 3 years ago
parent
commit
dfd46946bd
1 changed files with 40 additions and 21 deletions
  1. 40 21
      src/views/Warehousing/inStock/AddOrUpdate.vue

+ 40 - 21
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -3012,8 +3012,8 @@
               <td>{{ form.fPlanqty }}</td>
               <td>{{ item.fWarehouseInformation }}</td>
               <td>{{ item.fQty }}</td>
-              <td>{{ item.fNetweight / 1000 }}</td>
-              <td>{{ item.fGrossweight / 1000 }}</td>
+              <td>{{ (item.fNetweight / 1000).toSuperFixed(4) }}</td>
+              <td>{{ (item.fGrossweight / 1000).toSuperFixed(4) }}</td>
               <td>{{ item.remark }}</td>
             </tr>
             <tr>
@@ -3023,8 +3023,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
-              <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ allfNetweight.toSuperFixed(4) }}</td>
+              <td>{{ allfGrossweight.toSuperFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -3309,8 +3309,8 @@
               <td>{{ item.fMblno }}</td>
               <td>{{ item.fCntrno }}</td>
               <td>{{ item.fQty }}</td>
-              <td>{{ (item.fGrossweight / 1000).toFixed(4) }}</td>
-              <td>{{ (item.fNetweight / 1000).toFixed(4) }}</td>
+              <td>{{ (item.fGrossweight / 1000).toSuperFixed(4) }}</td>
+              <td>{{ (item.fNetweight / 1000).toSuperFixed(4) }}</td>
               <td>{{ item.remark }}</td>
             </tr>
             <tr>
@@ -3320,8 +3320,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
-              <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ allfGrossweight.toSuperFixed(4) }}</td>
+              <td>{{ allfNetweight.toSuperFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -3994,8 +3994,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
               <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -4502,8 +4502,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
-              <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ (allfNetweight / 1000).toSuperFixed(4) }}</td>
+              <td>{{ (allfGrossweight / 1000).toSuperFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -4874,8 +4874,8 @@
               <td>{{ item.fQty }}</td>
               <td>{{ item.fWarehouseInformation }}</td>
               <td>{{ item.fQty }}</td>
-              <td>{{ (item.fNetweight / 1000).toFixed(4) }}</td>
-              <td>{{ (item.fGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ (item.fNetweight / 1000).toSuperFixed(4) }}</td>
+              <td>{{ (item.fGrossweight / 1000).toSuperFixed(4) }}</td>
               <td>{{ item.remark }}</td>
             </tr>
             <tr>
@@ -4885,8 +4885,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
-              <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ allfNetweight.toSuperFixed(4) }}</td>
+              <td>{{ allfGrossweight.toSuperFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -5176,8 +5176,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
               <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -5669,8 +5669,8 @@
               <td>{{ item.fMblno }}</td>
               <td>{{ item.fCntrno }}</td>
               <td>{{ item.fQty }}</td>
-              <td>{{ (item.fGrossweight / 1000).toFixed(4) }}</td>
-              <td>{{ (item.fNetweight / 1000).toFixed(4) }}</td>
+              <td>{{ (item.fGrossweight / 1000).toSuperFixed(4) }}</td>
+              <td>{{ (item.fNetweight / 1000).toSuperFixed(4) }}</td>
               <td>{{ item.remark }}</td>
             </tr>
             <tr>
@@ -5680,8 +5680,8 @@
               <td></td>
               <td></td>
               <td>{{ allfQty.toFixed(0) }}</td>
-              <td>{{ (allfNetweight / 1000).toFixed(4) }}</td>
-              <td>{{ (allfGrossweight / 1000).toFixed(4) }}</td>
+              <td>{{ allfGrossweight.toSuperFixed(4) }}</td>
+              <td>{{ allfNetweight.toSuperFixed(4) }}</td>
               <td></td>
             </tr>
           </table>
@@ -8461,7 +8461,6 @@ export default {
               let _hour = (10 > now.getHours()) ? '0' + now.getHours() : now.getHours();
               let _minute = (10 > now.getMinutes()) ? '0' + now.getMinutes() : now.getMinutes();
               this.timeOut = _hour + ':' + _minute
-              console.log(this.data)
               // 把入库时间的时间戳转换为时分秒
               let inTime = new Date(this.form.fBstime);
               let h = inTime.getHours()
@@ -8486,6 +8485,16 @@ export default {
             } else if (command == "f") {
               this.print_dpxx = true;
             } else if (command == "L") {
+              this.allfGrossweight = 0;
+              this.allfNetweight = 0;
+              this.Printinglist.map((e) => {
+                if (e.fGrossweight) {
+                  this.allfGrossweight += parseFloat((e.fGrossweight / 1000).toSuperFixed(4));
+                }
+                if (e.fNetweight) {
+                  this.allfNetweight += parseFloat((e.fNetweight / 1000).toSuperFixed(4));
+                }
+              })
               this.print_ccdzrkd = true
             } else if (command == "M") {
               this.print_fxdkrkd = true
@@ -8495,6 +8504,16 @@ export default {
               //   this.$message.error("请选择单条明细")
               // }
             } else if (command == "i") {
+              this.allfGrossweight = 0;
+              this.allfNetweight = 0;
+              this.Printinglist.map((e) => {
+                if (e.fGrossweight) {
+                  this.allfGrossweight += parseFloat((e.fGrossweight / 1000).toSuperFixed(4));
+                }
+                if (e.fNetweight) {
+                  this.allfNetweight += parseFloat((e.fNetweight / 1000).toSuperFixed(4));
+                }
+              })
               this.print_khrkd = true
             } else if (command == "j") {
               let date = new Date(this.Printinglist[0].fBsdate)