Explorar el Código

Finish Hotfix-zh-206

Howie hace 3 años
padre
commit
6a8842565b

+ 15 - 15
src/views/supply/apply/components/design/panel.js

@@ -304,21 +304,21 @@ export default {
         "textAlign": "left"
       }, "printElementType": { "title": "", "type": "text" }
     },
-    // {
-    //   "options": {
-    //     "left": 650,
-    //     "top": 381,
-    //     "height": 13,
-    //     "width": 218,
-    //     "fontSize": 13,
-    //     "title": "",
-    //     "fontFamily": '黑体',
-    //     "field": "pageNumber",
-    //     "testData": "",
-    //     "color": "#000",
-    //     "textAlign": "left"
-    //   }, "printElementType": { "title": "", "type": "text" }
-    // }
+    {
+      "options": {
+        "left": 650,
+        "top": 381,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "",
+        "fontFamily": '黑体',
+        "field": "pageNumber",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    }
   ],
     "paperNumberDisabled": true
   }]

+ 6 - 5
src/views/supply/apply/components/design/preview.vue

@@ -119,11 +119,11 @@ export default {
   margin: 0 auto;
 }
 
-::v-deep tr td {
+/* ::v-deep tr td {
   border: 0 !important;
-  /* width: 911px !important;
-    height: 529px !important; */
-}
+  width: 911px !important;
+    height: 529px !important;
+} */
 
 ::v-deep .hiprint-paperNumber {
   display: none;
@@ -140,9 +140,10 @@ export default {
 
 @media print {
 
+/*    
   td {
     border: none !important;
-  }
+  } */
 
   .drag_item_box {
     height: 100%;

+ 46 - 47
src/views/supply/apply/components/design/print-data.js

@@ -5,62 +5,61 @@ import { getCompanyList } from '@/api/user'
 let detailArr = []
 let detailData = []
 let company = ''
+let invoicePickBeans = []
 // 获取详情
 getCompanyLists()
 function getDetail(id) {
       detailArr = []
       getDeliverDetail({id}).then(res => {
+        console.log(res.data,'jjj');
         const item = res.data
         detailData.push(item)
-        const table = []
-        item.invoicePickBeans.length = 5
-        item.invoicePickBeans.forEach(e => {
-          table.push({
-            salesId: e.salesOrderId,
-            invoiceId: e.invoiceId,
-            id: e.id,
-            createTime: e.id ? dateToDayFilter(item.createTime) : '',
-            enginOrderType: e.enginOrderType == 'HOME' || e.enginOrderType == 'TRADE' ? e.enginOrderNo : e.mainOrderId,
-            materialName: e.materialName || '',
-            specification: e.specification || '',
-            refundableQty: e.refundableQty || 0,
-            // headerRemark:e.headerRemark,
-            pjxh1Text: e.pjxh1Text || ''
-          })
-        });
-  
-        console.log(company);
-        detailArr.push({
-            type: item.type,
-            tiTui:item.type === 2 ? `退货人` : `提货人`,
-            takerPhone:item.takerPhone || '',
-            headerRemark:item.remark,
-            total_num: item.total_num,
-            company: item.type === 2 ? `${company}销售退货单` : `${company}销售发货单`,
-            pickOrderWater: item.pickOrderWater,
-            customerNumber: item.customerNumber,
-            takerDa:'',
-            nowDate: nowDate(),
-            takerName:item.type === 2 ? `退货人:${item.takerName || ''}` : `提货人:${item.takerName || ''}` ,
-            customerName: item.customerName || '',
-            correspondName: item.correspondName,
-            correspondNames:'',
-            pickCar:item.pickCar || '',
-            createBy: JSON.parse(
-              localStorage.getItem("supply_user")
-            ).nickName,
-            table
-        })
+        invoicePickBeans = item.invoicePickBeans
+        let len =Math.ceil(invoicePickBeans.length / 5) 
+          for (let index = 0; index < len; index++) {
+            const table = []
+            if (invoicePickBeans.length) {
+                invoicePickBeans.splice(0,5).forEach(e => {
+                    table.push({
+                      salesId: e.salesOrderId,
+                      invoiceId: e.invoiceId,
+                      id: e.id,
+                      createTime: e.id ? dateToDayFilter(item.createTime) : '',
+                      enginOrderType: e.enginOrderType == 'HOME' || e.enginOrderType == 'TRADE' ? e.enginOrderNo : e.mainOrderId,
+                      materialName: e.materialName || '',
+                      specification: e.specification || '',
+                      refundableQty: e.refundableQty || 0,
+                      // headerRemark:e.headerRemark,
+                      pjxh1Text: e.pjxh1Text || ''
+                    }) 
+                  
+              });
+            }
+            detailArr.push({
+              pageNumber:`${len}/${index+1}`,
+              type: item.type,
+              tiTui:item.type === 2 ? `退货人` : `提货人`,
+              takerPhone:item.takerPhone || '',
+              headerRemark:item.remark,
+              total_num: item.total_num,
+              company: item.type === 2 ? `${company}销售退货单` : `${company}销售发货单`,
+              pickOrderWater: item.pickOrderWater,
+              customerNumber: item.customerNumber,
+              takerDa:'',
+              nowDate: nowDate(),
+              takerName:item.type === 2 ? `退货人:${item.takerName || ''}` : `提货人:${item.takerName || ''}` ,
+              customerName: item.customerName || '',
+              correspondName: item.correspondName,
+              correspondNames:'',
+              pickCar:item.pickCar || '',
+              createBy: JSON.parse(
+                localStorage.getItem("supply_user")
+              ).nickName,
+              table
+            })
+          }
       })
 
-  // let  filterId =[]
-  //     filterId = newIds.map(k=>{
-  //             return k.id
-  //           })
-  //       filterId = [...new Set(filterId)]    
-  // for (let i = 0; i < filterId.length; i++) {
-
-  // }
 }
 
 function nowDate() {

+ 2 - 2
src/views/supply/apply/components/engin_detail.vue

@@ -415,9 +415,9 @@ export default {
 
     // 点击打印
     toPrint() {
-      this.initPrint()
+      // this.initPrint()
       this.printId = this.listItem.id;
-      getDetail(this.tableSelection)
+      getDetail(this.listItem.id)
         this.$refs.preView.show(this.hiprintTemplate, detailArr)
       // this.isShowPrint = true;
     },

+ 1 - 1
src/views/supply/deliver/components/design/panel.js

@@ -310,7 +310,7 @@ export default {
         "top": 381,
         "height": 13,
         "width": 218,
-        "fontSize": 13,
+        "fontSize": 16,
         "title": "",
         "fontFamily": '黑体',
         "field": "pageNumber",

+ 2 - 1
src/views/supply/deliver/components/design/preview.vue

@@ -139,9 +139,10 @@ export default {
 
 @media print {
    
+/*    
   td {
     border: none !important;
-  }
+  } */
 
   .drag_item_box {
     height: 100%;

+ 1 - 2
src/views/supply/deliver/components/design/print-data.js

@@ -1,7 +1,6 @@
 import { getDeliverDetail } from '@/api/supply/deliver'
 import { addPrints } from '@/api/supply/pickup'
 import { getCompanyList } from '@/api/user'
-
 let detailArr = []
     let detailData = []
 let cids = []
@@ -52,7 +51,7 @@ function getDetail(ids,nickName) {
             });
           }
           detailArr.push({
-            pageNumber:index+1,
+            pageNumber:`${len}/${index+1}`,
             type: item.type,
             tiTui:item.type === 2 ? `退货人` : `提货人`,
             takerPhone:item.takerPhone || '',

+ 1 - 1
src/views/supply/pickup/components/design/panel.js

@@ -311,7 +311,7 @@ export default {
         "top": 381,
         "height": 13,
         "width": 218,
-        "fontSize": 13,
+        "fontSize": 16,
         "title": "",
         "fontFamily": '黑体',
         "field": "pageNumber",

+ 2 - 1
src/views/supply/pickup/components/design/preview.vue

@@ -139,9 +139,10 @@ export default {
 
 @media print {
 
+/*    
   td {
     border: none !important;
-  }
+  } */
 
   .drag_item_box {
     height: 100%;

+ 1 - 1
src/views/supply/pickup/components/design/print-data.js

@@ -52,7 +52,7 @@ function getDetails(ids, nickName) {
           });
         }
         detailArr.push({
-          pageNumber:index+1,
+          pageNumber:`${len}/${index+1}`,
           type: item.type,
           tiTui: item.type === 2 ? `退货人` : `提货人`,
           takerPhone: item.takerPhone || '',