Browse Source

报表打印

wengyuwen 4 years ago
parent
commit
9ab799d818

+ 27 - 139
src/views/Warehousing/inStock/AddOrUpdate.vue

@@ -2898,7 +2898,7 @@
               <td>货物名称</td>
               <td colspan="2">{{form.goodName}}</td>
               <td>库位</td>
-              <td colspan="2">{{ form.fWarehouseInformation}}</td>
+              <td colspan="2">{{ stockName}}</td>
             </tr>
             <tr>
               <td>提单号</td>
@@ -2908,9 +2908,9 @@
             </tr>
             <tr>
               <td>箱号</td>
-              <td colspan="2">{{form.fCntval}}</td>
+              <td colspan="2"></td>
               <td>总箱量</td>
-              <td colspan="2">{{ CntrTable.fCntrcount}}</td>
+              <td colspan="2">{{ container}}</td>
             </tr>
             <tr>
               <td>总件数</td>
@@ -3210,9 +3210,7 @@ export default {
   },
   data() {
     return {
-      plantyTotal:null,
-      GrossweightTotal:null,
-      NetweightTatol:null,
+      container:'',
       pageNum: 1,
       pageSize: 10,
       dialogWhgenlegList: [],
@@ -3859,7 +3857,6 @@ export default {
         if (res.code == 200) {
           this.showSetting = false;
           this.getRowList = this.setRowList.filter((e) => e.checked == 0);
-          console.log(this.tableDate);
         }
       });
     },
@@ -4934,7 +4931,6 @@ export default {
     // 库存明细多选
     Selectinventory(selection) {
       this.Printinglist = selection;
-      console.log(this.Printinglist)
       //允许确认入库list
       this.dataListSelection = [];
       if (this.stockoi == "0") {
@@ -5104,7 +5100,6 @@ export default {
               this.importList.fGrossweight / 1000
             ).toFixed(2);
           }
-          console.log(this.importList);
           this.weightList = true;
         }
       });
@@ -5207,12 +5202,9 @@ export default {
             } else if(command == "g"){
               this.print_ccdzrkd = true
             } else if(command == "h"){
-              console.log(this.Printinglist.length)
               if(this.Printinglist.length == 1){
-                console.log("111")
                 this.print_fxdkrkd = true
               }else {
-                console.log("222")
                 this.$message.error("请选择单条明细")
               }
             } else if(command == "i"){
@@ -5225,8 +5217,22 @@ export default {
               this.form.fBsdate = Y + '-' + M + '-' + D
             this.print_xhcdrkd = true
             } else if(command == "k") {
+              let container = []
+              this.container = ''
+              this.CntrTable.map((e)=>{
+                this.cntrList.map((i)=>{
+                  if(i.fId == e.fCntrid){
+                    e.fCntrid = i.fName
+                    container.push(e.fCntrid + '*' + e.fCntrcount + ',')
+                  }
+                })
+              })
+              container.forEach(item =>{
+                this.container += item
+              })
+              this.container = this.container.slice(0,this.container.length-1)
+              console.log(this.container)
               this.print_zpdkrkd = true
-              console.log(this.CntrTable)
             } else if (command == "g") {
               this.print_bzrkd = true;
             } else if (command == "h") {
@@ -5439,45 +5445,8 @@ export default {
       const style =
         "@page {  } " +
         "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
-      switch (status){
+      switch (status) {
         case 'zyd':
-          if (this.CntrTable.length > 0) {
-            let arr = [];
-            this.CntrTable.map((e) => {
-              this.cntrList.map((item) => {
-                if (item.fId == e.fCntrid) {
-                  arr.push(item.fName + "X" + e.fCntrcount);
-                }
-              });
-            });
-            arr = [...new Set(arr)];
-            this.form.fCntval = arr.join(",");
-          } else {
-            this.form.fCntval = null;
-          }
-          if (this.detailList.length > 0) {
-            let arr = [];
-            this.detailList.map((e) => {
-              this.goodsOptions.map((item) => {
-                if (e.fGoodsid == item.fId) {
-                  arr.push(item.fName);
-                }
-      let checkData = {
-        fId: this.form.fId,
-        fType: "warehouse",
-        codeVal: this.form.fDateChanged,
-      };
-      checkCode(checkData).then((response) => {
-        if (!response) {
-          this.$confirm("数据发生变化,请更新一下数据?", "提示", {
-            confirmButtonText: "确认",
-            cancelButtonText: "取消",
-            type: "warning",
-          }).then(() => {
-            this.getForm();
-          });
-        } else {
-          if (status == "zyd") {
             if (this.CntrTable.length > 0) {
               let arr = [];
               this.CntrTable.map((e) => {
@@ -5540,18 +5509,10 @@ export default {
               "warehousebillsfeesCr",
               JSON.stringify(this.warehouseCrList)
             );
-            formData.append(
-              "tEnclosure",
-              JSON.stringify(this.relevantAttachments)
-            );
+            formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
             formData.append("tCntr", JSON.stringify(this.CntrTable));
             addJoblist(formData).then((response) => {
               if (response.code == 200) {
-                this.$set(
-                  this.form,
-                  "fDateChanged",
-                  response.data.fDateChanged
-                );
                 this.detailList.map((e, index) => {
                   response.data.warehousebillsitems.map((item) => {
                     if (e.fId == item.fId) {
@@ -5563,66 +5524,6 @@ export default {
                 this.$set(this.form, "fItemsStatus", 2);
               }
             });
-            arr = [...new Set(arr)];
-            this.form.fProductName = arr.join(",");
-          } else {
-            this.form.fProductName = "";
-          }
-          if (this.detailList.length > 0) {
-            let arr = [];
-            this.detailList.map((e) => {
-              arr.push(e.fMarks);
-            });
-            arr = [...new Set(arr)];
-            this.form.fMarks = arr.join(",");
-          } else {
-            this.form.fMarks = "";
-          }
-          this.form.fBillingway = this.form.fFeetUnit;
-          if (this.detailList.length == 0) {
-            this.form.fNetweight = 0;
-            this.form.fPlanvolumn = 0;
-            this.form.fGrossweight = 0;
-          } else {
-            this.form.fNetweight = this.fNetweight;
-            this.form.fPlanvolumn = this.fPlanvolumn;
-            this.form.fGrossweight = this.fGrossweight;
-          }
-          let formData = new window.FormData();
-          formData.append("warehouseBills", JSON.stringify(this.form));
-          formData.append(
-            "warehousebillsitems",
-            JSON.stringify(this.Printinglist)
-          );
-          formData.append(
-            "warehousebillsfeesDr",
-            JSON.stringify(this.warehouseDrList)
-          );
-          formData.append(
-            "warehousebillsfeesCr",
-            JSON.stringify(this.warehouseCrList)
-          );
-          formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
-          formData.append("tCntr", JSON.stringify(this.CntrTable));
-          addJoblist(formData).then((response) => {
-            if (response.code == 200) {
-              this.detailList.map((e, index) => {
-                response.data.warehousebillsitems.map((item) => {
-                  if (e.fId == item.fId) {
-                    e = item;
-                    this.$set(this.detailList, index, e);
-                  }
-                });
-              });
-              this.$set(this.form, "fItemsStatus", 2);
-            }
-          });
-          print({
-            printable: "print_area1",
-            type: "html",
-            style: style, // 亦可使用引入的外部css;
-            scanStyles: false,
-          });
           break
         case 'ccdzrkd':
           print({
@@ -5665,26 +5566,13 @@ export default {
           });
           break
         default:
-        print({
-          printable: "print_area1",
-          type: "html",
-          style: style, // 亦可使用引入的外部css;
-          scanStyles: false,
-        });
+          print({
+            printable: "print_area1",
+            type: "html",
+            style: style, // 亦可使用引入的外部css;
+            scanStyles: false,
+          });
       }
-          }
-        }
-      });
-
-      const style =
-        "@page {  } " +
-        "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
-      print({
-        printable: "print_area1",
-        type: "html",
-        style: style, // 亦可使用引入的外部css;
-        scanStyles: false,
-      });
     },
     cancel() {
       if (this.$route.query.id) {

+ 169 - 156
src/views/Warehousing/outStock/AddOrUpdate.vue

@@ -3821,7 +3821,6 @@ export default {
         if (res.code == 200) {
           this.showSetting = false;
           this.getRowList = this.setRowList.filter((e) => e.checked == 0);
-          console.log(this.tableDate);
         }
       });
     },
@@ -5086,10 +5085,6 @@ export default {
       //允许撤销入库list
       this.dataWithdrawList = [];
       this.dataWithdrawList = selection.filter((e) => e.fBillstatus == 40);
-      console.log("ruku");
-      console.log(this.dataListSelection);
-      console.log("chexiao");
-      console.log(this.dataWithdrawList);
     },
     // 合计
     getSummaries(param) {
@@ -5315,13 +5310,11 @@ export default {
               }
             });
             this.fDriverTel = this.Printinglist[0].fDriverTel;
-            // console.log(this.Printinglist)
             let date = new Date(this.Printinglist[0].fBsdate)
             let Y = date.getFullYear()
             let M = (date.getMonth() +1 <10 ?'0' + (date.getMonth() +1) : date.getMonth() +1)
             let D = date.getDate()
             this.fBsdate = Y + '-' + M + '-' + D
-            // console.log(this.fBsdate)
             // this.fBsdate = this.Printinglist[0].fBsdate;
             this.fTruckno = this.Printinglist[0].fTruckno;
             this.allfCntqty = 0;
@@ -5488,7 +5481,6 @@ export default {
           }
           let fAmount = 0;
           fAmount = e.fPrice * qty;
-          console.log(this.key_id);
           if (this.key_id == 3) {
             this.warehouseDrList.push({
               fQty: qty,
@@ -5622,155 +5614,175 @@ export default {
     },
     //打印
     addprint(status) {
-      console.log(status)
-      if (status == "zyd") {
-        if (this.CntrTable.length > 0) {
-          let arr = [];
-          this.CntrTable.map((e) => {
-            this.cntrList.map((item) => {
-              if (item.fId == e.fCntrid) {
-                arr.push(item.fName + "X" + e.fCntrcount);
-              }
+      // if (status == "zyd") {
+        // if (this.CntrTable.length > 0) {
+        //   let arr = [];
+        //   this.CntrTable.map((e) => {
+        //     this.cntrList.map((item) => {
+        //       if (item.fId == e.fCntrid) {
+        //         arr.push(item.fName + "X" + e.fCntrcount);
+        //       }
+        //     });
+        //   });
+        //   arr = [...new Set(arr)];
+        //   this.form.fCntval = arr.join(",");
+        // } else {
+        //   this.form.fCntval = null;
+        // }
+        // if (this.detailList.length > 0) {
+        //   let arr = [];
+        //   this.detailList.map((e) => {
+        //     this.goodsOptions.map((item) => {
+        //       if (e.fGoodsid == item.fId) {
+        //         arr.push(item.fName);
+        //       }
+        //     });
+        //   });
+        //   arr = [...new Set(arr)];
+        //   this.form.fProductName = arr.join(",");
+        // } else {
+        //   this.form.fProductName = "";
+        // }
+        // if (this.detailList.length > 0) {
+        //   let arr = [];
+        //   this.detailList.map((e) => {
+        //     arr.push(e.fMarks);
+        //   });
+        //   arr = [...new Set(arr)];
+        //   this.form.fMarks = arr.join(",");
+        // } else {
+        //   this.form.fMarks = "";
+        // }
+        // this.form.fBillingway = this.form.fFeetUnit;
+        // if (this.detailList.length == 0) {
+        //   this.form.fNetweight = 0;
+        //   this.form.fPlanvolumn = 0;
+        //   this.form.fGrossweight = 0;
+        // } else {
+        //   this.form.fNetweight = this.fNetweight;
+        //   this.form.fPlanvolumn = this.fPlanvolumn;
+        //   this.form.fGrossweight = this.fGrossweight;
+        // }
+        // let formData = new window.FormData();
+        // formData.append("warehouseBills", JSON.stringify(this.form));
+        // formData.append(
+        //   "warehousebillsitems",
+        //   JSON.stringify(this.Printinglist)
+        // );
+        // formData.append(
+        //   "warehousebillsfeesDr",
+        //   JSON.stringify(this.warehouseDrList)
+        // );
+        // formData.append(
+        //   "warehousebillsfeesCr",
+        //   JSON.stringify(this.warehouseCrList)
+        // );
+        // formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
+        // formData.append("tCntr", JSON.stringify(this.CntrTable));
+        // addJoblist(formData).then((response) => {
+        //   if (response.code == 200) {
+        //     this.detailList.map((e, index) => {
+        //       response.data.warehousebillsitems.map((item) => {
+        //         item.fBsdate = Date.parse(new Date(item.fBsdate));
+        //         if (item.fBusinessType) {
+        //           item.fBusinessType = item.fBusinessType.toString();
+        //         }
+        //         if (e.fId == item.fId) {
+        //           this.$set(this.detailList, index, item);
+        //         }
+        //       });
+        //     });
+        //     this.$set(this.form, "fItemsStatus", 2);
+        //   }
+        // });
+      // }
+      const style =
+        "@page {  } " +
+        "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
+
+      switch (status){
+        case 'zyd':
+          if (this.CntrTable.length > 0) {
+            let arr = [];
+            this.CntrTable.map((e) => {
+              this.cntrList.map((item) => {
+                if (item.fId == e.fCntrid) {
+                  arr.push(item.fName + "X" + e.fCntrcount);
+                }
+              });
             });
-          });
-          arr = [...new Set(arr)];
-          this.form.fCntval = arr.join(",");
-        } else {
-          this.form.fCntval = null;
-        }
-        if (this.detailList.length > 0) {
-          let arr = [];
-          this.detailList.map((e) => {
-            this.goodsOptions.map((item) => {
-              if (e.fGoodsid == item.fId) {
-                arr.push(item.fName);
-              }
+            arr = [...new Set(arr)];
+            this.form.fCntval = arr.join(",");
+          } else {
+            this.form.fCntval = null;
+          }
+          if (this.detailList.length > 0) {
+            let arr = [];
+            this.detailList.map((e) => {
+              this.goodsOptions.map((item) => {
+                if (e.fGoodsid == item.fId) {
+                  arr.push(item.fName);
+                }
+              });
             });
-          });
-          arr = [...new Set(arr)];
-          this.form.fProductName = arr.join(",");
-        } else {
-          this.form.fProductName = "";
-        }
-        if (this.detailList.length > 0) {
-          let arr = [];
-          this.detailList.map((e) => {
-            arr.push(e.fMarks);
-      let checkData = {
-        fId: this.form.fId,
-        fType: "warehouse",
-        codeVal: this.form.fDateChanged,
-      };
-      checkCode(checkData).then((response) => {
-        if (!response) {
-          this.$confirm("数据发生变化,请更新一下数据?", "提示", {
-            confirmButtonText: "确认",
-            cancelButtonText: "取消",
-            type: "warning",
-          }).then(() => {
-            this.getForm();
-          });
-        } else {
-          if (status == "zyd") {
-            if (this.CntrTable.length > 0) {
-              let arr = [];
-              this.CntrTable.map((e) => {
-                this.cntrList.map((item) => {
-                  if (item.fId == e.fCntrid) {
-                    arr.push(item.fName + "X" + e.fCntrcount);
+            arr = [...new Set(arr)];
+            this.form.fProductName = arr.join(",");
+          } else {
+            this.form.fProductName = "";
+          }
+          if (this.detailList.length > 0) {
+            let arr = [];
+            this.detailList.map((e) => {
+              arr.push(e.fMarks);
+            });
+            arr = [...new Set(arr)];
+            this.form.fMarks = arr.join(",");
+          } else {
+            this.form.fMarks = "";
+          }
+          this.form.fBillingway = this.form.fFeetUnit;
+          if (this.detailList.length == 0) {
+            this.form.fNetweight = 0;
+            this.form.fPlanvolumn = 0;
+            this.form.fGrossweight = 0;
+          } else {
+            this.form.fNetweight = this.fNetweight;
+            this.form.fPlanvolumn = this.fPlanvolumn;
+            this.form.fGrossweight = this.fGrossweight;
+          }
+          let formData = new window.FormData();
+          formData.append("warehouseBills", JSON.stringify(this.form));
+          formData.append(
+            "warehousebillsitems",
+            JSON.stringify(this.Printinglist)
+          );
+          formData.append(
+            "warehousebillsfeesDr",
+            JSON.stringify(this.warehouseDrList)
+          );
+          formData.append(
+            "warehousebillsfeesCr",
+            JSON.stringify(this.warehouseCrList)
+          );
+          formData.append("tEnclosure", JSON.stringify(this.relevantAttachments));
+          formData.append("tCntr", JSON.stringify(this.CntrTable));
+          addJoblist(formData).then((response) => {
+            if (response.code == 200) {
+              this.detailList.map((e, index) => {
+                response.data.warehousebillsitems.map((item) => {
+                  item.fBsdate = Date.parse(new Date(item.fBsdate));
+                  if (item.fBusinessType) {
+                    item.fBusinessType = item.fBusinessType.toString();
                   }
-                });
-              });
-              arr = [...new Set(arr)];
-              this.form.fCntval = arr.join(",");
-            } else {
-              this.form.fCntval = null;
-            }
-            if (this.detailList.length > 0) {
-              let arr = [];
-              this.detailList.map((e) => {
-                this.goodsOptions.map((item) => {
-                  if (e.fGoodsid == item.fId) {
-                    arr.push(item.fName);
+                  if (e.fId == item.fId) {
+                    this.$set(this.detailList, index, item);
                   }
                 });
               });
-              arr = [...new Set(arr)];
-              this.form.fProductName = arr.join(",");
-            } else {
-              this.form.fProductName = "";
+              this.$set(this.form, "fItemsStatus", 2);
             }
-            if (this.detailList.length > 0) {
-              let arr = [];
-              this.detailList.map((e) => {
-                arr.push(e.fMarks);
-              });
-              arr = [...new Set(arr)];
-              this.form.fMarks = arr.join(",");
-            } else {
-              this.form.fMarks = "";
-            }
-            this.form.fBillingway = this.form.fFeetUnit;
-            if (this.detailList.length == 0) {
-              this.form.fNetweight = 0;
-              this.form.fPlanvolumn = 0;
-              this.form.fGrossweight = 0;
-            } else {
-              this.form.fNetweight = this.fNetweight;
-              this.form.fPlanvolumn = this.fPlanvolumn;
-              this.form.fGrossweight = this.fGrossweight;
-            }
-            let formData = new window.FormData();
-            formData.append("warehouseBills", JSON.stringify(this.form));
-            formData.append(
-              "warehousebillsitems",
-              JSON.stringify(this.Printinglist)
-            );
-            formData.append(
-              "warehousebillsfeesDr",
-              JSON.stringify(this.warehouseDrList)
-            );
-            formData.append(
-              "warehousebillsfeesCr",
-              JSON.stringify(this.warehouseCrList)
-            );
-            formData.append(
-              "tEnclosure",
-              JSON.stringify(this.relevantAttachments)
-            );
-            formData.append("tCntr", JSON.stringify(this.CntrTable));
-            addJoblist(formData).then((response) => {
-              if (response.code == 200) {
-                this.$set(
-                  this.form,
-                  "fDateChanged",
-                  response.data.fDateChanged
-                );
-                this.detailList.map((e, index) => {
-                  response.data.warehousebillsitems.map((item) => {
-                    item.fBsdate = Date.parse(new Date(item.fBsdate));
-                    if (item.fBusinessType) {
-                      item.fBusinessType = item.fBusinessType.toString();
-                    }
-                    item.fLntype = item.fLntype
-                      ? item.fLntype.toString()
-                      : null;
-                    if (e.fId == item.fId) {
-                      this.$set(this.detailList, index, item);
-                    }
-                  });
-                });
-                this.$set(this.form, "fItemsStatus", 2);
-              }
-            });
-          }
-        }
-      });
-      const style =
-        "@page {  } " +
-        "@media print { .print-div{ padding:8px;background-color:#cccccc;} .print-title{display:flex;justify-content: center;font-size:24px} .print_form{font-size:12px} .print_table table {border-right: 1px solid #000;border-bottom: 1px solid #000;font-size:12px} .print_table table td {border-left: 1px solid #000;border-top: 1px solid #000;padding:2px;vertical-align:middle;text-align: center;}";
-
-      switch (status){
+          });
+          break
         case 'ccckd':
           print({
             printable: "print_area6",
@@ -5795,13 +5807,14 @@ export default {
             scanStyles: false,
           });
           break
+        default:
+        print({
+          printable: "print_area1",
+          type: "html",
+          style: style, // 亦可使用引入的外部css;
+          scanStyles: false,
+        });
       }
-      // print({
-      //   printable: "print_area1",
-      //   type: "html",
-      //   style: style, // 亦可使用引入的外部css;
-      //   scanStyles: false,
-      // });
     },
     cancel() {
       if (this.$route.query.id) {

+ 0 - 3
src/views/Warehousing/stockTransfer/AddOrUpdate.vue

@@ -3576,7 +3576,6 @@ export default {
       this.fSbuOptions = response.rows;
     });
     listUser().then((response) => {
-      console.log(response)
       this.userOptions = response.rows;
     });
     listGoods({ fStatus: 0, delFlag: 0 }).then((response) => {
@@ -4094,7 +4093,6 @@ export default {
       }
     },
     creditClick() {
-      console.log(this.Printinglist);
       for (let item in this.Printinglist) {
         if (!this.Printinglist[item].fId) {
           return this.$message.error("请存在未保存的数据");
@@ -5240,7 +5238,6 @@ export default {
           }
           let fAmount = 0;
           fAmount = e.fPrice * qty;
-          console.log(this.key_id);
           if (this.key_id == 3) {
             this.warehouseDrList.push({
               fQty: qty,