Quellcode durchsuchen

出库打印磅单sdy

zhongtianhaoyuan vor 3 Jahren
Ursprung
Commit
cdb5f1c0a9

+ 8 - 8
public/static/weightCheckInOut.html

@@ -171,9 +171,7 @@
     new Vue({
       el: '#app',
       data: {
-        tableData: {
-          // qualityInspectionManagement:{}
-        },
+        tableData: {},
         name: "",
         bigContent: false,
         smallContent: false
@@ -205,10 +203,12 @@
         printSmall() {},
         printBig() {},
       },
-      mounted() {
-        console.log(this.getQueryVariable("tableData"))
-        let _data = decodeURIComponent(this.getQueryVariable("tableData"))
-        let _type = decodeURIComponent(this.getQueryVariable("type"))
+      mounted() {debugger
+        // console.log("sssss",this.getQueryVariable("tableData"))
+        // let _data = decodeURIComponent(this.getQueryVariable("tableData"))
+        // console.log("dfddd",_data)
+        let _data= JSON.parse(localStorage.getItem('ck_bd_printData'))            
+        let _type = this.getQueryVariable("type")
         if (_type == 2) {
           this.bigContent = true
           this.smallContent = false
@@ -217,7 +217,7 @@
           this.bigContent = false
         }
         console.log(_data,"sddsd")
-        this.tableData = JSON.parse(_data)
+        this.tableData = _data
         console.log(this.tableData)
         document.title = "粮食检斤单"
         window.print()

+ 7 - 5
public/static/weightCheckOut.html

@@ -219,9 +219,11 @@
         printBig() {},
       },
       mounted() {
-        console.log(decodeURIComponent(this.getQueryVariable("tableData")))
-        let _data = decodeURIComponent(this.getQueryVariable("tableData"))
-        let _type = decodeURIComponent(this.getQueryVariable("type"))
+        debugger
+        // console.log(decodeURIComponent(this.getQueryVariable("tableData")))
+        // let _data = decodeURIComponent(this.getQueryVariable("tableData"))
+        let _data= JSON.parse(localStorage.getItem('ck_bd_printData1'))            
+        let _type = this.getQueryVariable("type")
         if (_type == 2) {
           this.bigContent = true
           this.smallContent = false
@@ -230,10 +232,10 @@
           this.bigContent = false
         }
         console.log(_data, "sddsd")
-        this.tableData = JSON.parse(_data)
+        this.tableData = _data
         console.log(this.tableData)
         document.title = "粮食检斤单"
-        //window.print()
+        window.print()
         window.onafterprint = function(event) {
           window.history.back(-1)
         };

+ 2 - 4
src/views/warehouse/warehouseManagementNoWeightIn.vue

@@ -1422,10 +1422,8 @@
                         })
                         .toPromise()
                         .then((response) => {
-                          window.open(
-                            '../../../../static/weightCheckInOut.html?type=2&tableData=' +
-                            JSON.stringify(response)
-                          )
+                          localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
                         })
                     })
                     this.$router

+ 3 - 4
src/views/warehouse/warehouseManagementNoWeightOut.vue

@@ -1202,10 +1202,9 @@
                           })
                           .toPromise()
                           .then((response) => {
-                            window.open(
-                              '../../../../static/weightCheckInOut.html?type=2&tableData=' +
-                              JSON.stringify(response)
-                            )
+                                    localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
+                         
                           })
                         this.$router.push({
                           path: 'warehouseManagementList',

+ 3 - 1
src/views/warehouse/warehouseManagementRecord.vue

@@ -532,7 +532,9 @@
                       })
                         .toPromise()
                         .then((response) => {
-                            window.open( '../../../../static/weightCheckInOut.html?type=2&tableData=' +encodeURIComponent(JSON.stringify(response)))
+                                      localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
+                         
                         })
 			},
 			//返回按钮

+ 3 - 4
src/views/warehouse/warehouseManagementTare.vue

@@ -1486,10 +1486,9 @@
 
                     var date = new Date()
                     this.weightbills.updateDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' +
-                      date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date
-                      .getSeconds()
-                    window.open('../../../../static/weightCheckOut.html?type=2&tableData=' +
-                      encodeURIComponent(JSON.stringify(this.weightbills)))
+                      date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds()
+                      localStorage.setItem('ck_bd_printData1',JSON.stringify(this.weightbills))
+                      window.open('../../../../static/weightCheckOut.html?type=2')
                   }
                   this.$router.push({
                     path: 'warehouseManagementList',

+ 3 - 4
src/views/warehousenew/warehouseManagementNoWeightIn.vue

@@ -1402,10 +1402,9 @@
                         })
                         .toPromise()
                         .then((response) => {
-                          window.open(
-                            '../../../../static/weightCheckInOut.html?type=2&tableData=' +
-                            JSON.stringify(response)
-                          )
+                               localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
+                         
                         })
                     })
                     this.$router

+ 3 - 4
src/views/warehousenew/warehouseManagementNoWeightOut.vue

@@ -1200,10 +1200,9 @@
                           })
                           .toPromise()
                           .then((response) => {
-                            window.open(
-                              '../../../../static/weightCheckInOut.html?type=2&tableData=' +
-                              JSON.stringify(response)
-                            )
+                                 localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
+                         
                           })
                         this.$router.push({
                           path: 'warehouseManagementList',

+ 3 - 1
src/views/warehousenew/warehouseManagementRecord.vue

@@ -533,7 +533,9 @@
                       })
                         .toPromise()
                         .then((response) => {
-                            window.open( '../../../../static/weightCheckInOut.html?type=2&tableData=' +encodeURIComponent(JSON.stringify(response)))
+                                     localStorage.setItem('ck_bd_printData',JSON.stringify(response))
+                         window.open('../../../../static/weightCheckInOut.html?type=2')
+                         
                         })
 			},
 			//返回按钮

+ 4 - 2
src/views/warehousenew/warehouseManagementTare.vue

@@ -1488,8 +1488,10 @@
                     this.weightbills.updateDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' +
                       date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date
                       .getSeconds()
-                    window.open('../../../../static/weightCheckOut.html?type=2&tableData=' +
-                      encodeURIComponent(JSON.stringify(this.weightbills)))
+                       localStorage.setItem('ck_bd_printData1',JSON.stringify(this.weightbills))
+                      window.open('../../../../static/weightCheckOut.html?type=2')
+                    // window.open('../../../../static/weightCheckOut.html?type=2&tableData=' +
+                    //   encodeURIComponent(JSON.stringify(this.weightbills)))
                   }
                   this.$router.push({
                     path: 'warehouseManagementList',