瀏覽代碼

修改新窗口打印和默认文件名

mxx 3 年之前
父節點
當前提交
0c0afd0486

+ 1 - 0
public/static/inspection.html

@@ -323,6 +323,7 @@
         console.log(_data)
         this.tableData = JSON.parse(_data)
         console.log(this.tableData)
+        document.title="粮食质检单"
         window.print()
         window.onafterprint = function(event) {
           window.history.back(-1)

+ 1 - 0
public/static/payprint.html

@@ -513,6 +513,7 @@
         // console.log(_data)
         this.printData = JSON.parse(_data)
         // console.log(this.tableData)
+        document.title="中天昊元粮食贸易有限公司结算凭证"
         window.print()
         window.onafterprint = function(event) {
           window.history.back(-1)

+ 1 - 0
public/static/print.html

@@ -101,6 +101,7 @@
          this.name = decodeURIComponent(this.getQueryVariable("name"))
         console.log(_data)
         this.tableData = JSON.parse(_data)
+        document.title = this.name+'价格对照表(按水分)'
         window.print()
         window.onafterprint = function(event) {
           window.history.back(-1)

+ 1 - 0
public/static/weightCheck.html

@@ -325,6 +325,7 @@
         console.log(_data,"sddsd")
         this.tableData = JSON.parse(_data)
         console.log(this.tableData)
+        document.title = "粮食检斤单"
         window.print()
         window.onafterprint = function(event) {
           window.history.back(-1)

+ 3 - 3
src/views/houseSelfCollect/acquisitionManagementAdd.vue

@@ -619,7 +619,7 @@
       //打印
       print() {
         localStorage.setItem('pricePrintList', JSON.stringify(this.baseInfoForm.detailPrints));
-        window.location.href = "../../../static/print.html?name=" + this.baseInfoForm.goodsName
+        window.open("../../../static/print.html?name=" + this.baseInfoForm.goodsName)
       },
       validate() {
         let that = this
@@ -871,7 +871,7 @@
         this.tableData = _list
       },
       // 获取分界价格数据,构造分界价格区间数据
-      getSplitPrice() {
+      getSplitPrice() {debugger
         let _priceList = this.priceList
         for (let i = 0; i < _priceList.length; i++) {
           for (let k = 0; k < _priceList[i].checkList.length; k++) {
@@ -948,7 +948,7 @@
         return _leftTotalPrice + _rightTotalPrice
       },
       // 计算价格
-      calculatePrice(_waterMin) {
+      calculatePrice(_waterMin) {debugger
         let prcieList = []
         let totalPrice = []
         let _price = 0

+ 2 - 6
src/views/houseSelfCollect/component/paymentPrint.vue

@@ -167,14 +167,10 @@
         return datas
       },
       printSmall() {
-        window.location.href =
-          '../../../../../static/payprint.html?type=1&dataList=' +
-          JSON.stringify(this.printData)
+        window.open('../../../../../static/payprint.html?type=1&dataList=' +JSON.stringify(this.printData))
       },
       printBig() {
-        window.location.href =
-          '../../../../../static/payprint.html?type=2&dataList=' +
-          JSON.stringify(this.printData)
+         window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData))
       },
     },
   }

+ 2 - 6
src/views/houseSelfCollect/inspectInfo.vue

@@ -211,14 +211,10 @@
     },
     methods: {
       printSmall() {
-        window.location.href =
-          '../../../static/inspection.html?type=1&dataList=' +
-          JSON.stringify(this.inspect)
+        window.open('../../../static/inspection.html?type=1&dataList=' +JSON.stringify(this.inspect))
       },
       printBig() {
-        window.location.href =
-          '../../../static/inspection.html?type=2&dataList=' +
-          JSON.stringify(this.inspect)
+        window.open('../../../static/inspection.html?type=2&dataList=' +JSON.stringify(this.inspect)) 
       },
       getdate() {
         var date = new Date()

+ 2 - 6
src/views/houseSelfCollect/inspectionManagement.vue

@@ -154,14 +154,10 @@ export default {
   },
   methods: {
     printSmall() {
-        window.location.href =
-          '../../../static/inspection.html?type=1&dataList=' +
-          JSON.stringify(this.printData)
+      window.open('../../../static/inspection.html?type=1&dataList=' +JSON.stringify(this.printData))
       },
       printBig() {
-        window.location.href =
-          '../../../static/inspection.html?type=2&dataList=' +
-          JSON.stringify(this.printData)
+         window.open('../../../static/inspection.html?type=2&dataList=' +JSON.stringify(this.printData))
       },
      closePrint(){
         this.isShowPrint = false

+ 3 - 5
src/views/houseSelfCollect/paymentManagement.vue

@@ -298,13 +298,11 @@ export default {
       this.imageUrl = e.url
     },
     printSmall() {
-      window.location.href =
-        '../../../../../static/payprint.html?type=1&dataList=' +
-        JSON.stringify(this.printData)
+      window.open('../../../../../static/payprint.html?type=1&dataList=' +JSON.stringify(this.printData))
+        
     },
     printBig() {
-      window.open('../../../../../static/payprint.html?type=2&dataList=' +
-        JSON.stringify(this.printData),"结算凭证")
+      window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData),"结算凭证")
         
     },
     getList() {

+ 2 - 6
src/views/houseSelfCollect/settlement.vue

@@ -459,14 +459,10 @@ export default {
 
     },
     printSmall() {
-        window.location.href =
-          '../../../../../static/payprint.html?type=1&dataList=' +
-          JSON.stringify(this.printData)
+      window.open('../../../../../static/payprint.html?type=1&dataList=' +JSON.stringify(this.printData))
       },
       printBig() {
-        window.location.href =
-          '../../../../../static/payprint.html?type=2&dataList=' +
-          JSON.stringify(this.printData)
+        window.open('../../../../../static/payprint.html?type=2&dataList=' +JSON.stringify(this.printData))
       },
     getList(){
       getpaymentexamine({id:this.$route.query.id}).toPromise().then((response) => {

+ 2 - 6
src/views/houseSelfCollect/weighingManagement.vue

@@ -172,14 +172,10 @@ export default {
   },
   methods: {
      printSmall() {
-      window.location.href =
-        '../../../../static/weightCheck.html?type=1&tableData=' +
-        JSON.stringify(this.dialogData)
+       window.open('../../../../static/weightCheck.html?type=1&tableData=' +JSON.stringify(this.dialogData))
     },
     printBig() {
-      window.location.href =
-        '../../../../static/weightCheck.html?type=2&tableData=' +
-        JSON.stringify(this.dialogData)
+      window.open( '../../../../static/weightCheck.html?type=2&tableData=' +JSON.stringify(this.dialogData))
     },
     print(row) {
        getPrint({

+ 2 - 6
src/views/houseSelfCollect/weightCheck.vue

@@ -247,14 +247,10 @@ export default {
       }
     },
     printSmall() {
-      window.location.href =
-        '../../../../static/weightCheck.html?type=1&tableData=' +
-        JSON.stringify(this.inspect)
+      window.open('../../../../static/weightCheck.html?type=1&tableData=' +JSON.stringify(this.inspect))
     },
     printBig() {
-      window.location.href =
-        '../../../../static/weightCheck.html?type=2&tableData=' +
-        JSON.stringify(this.inspect)
+      window.open( '../../../../static/weightCheck.html?type=2&tableData=' +JSON.stringify(this.inspect))
     },
     closeDialog() {
       html2canvas(this.$refs.saveImg.$el).then((canvas) => {