Quellcode durchsuchen

【修改】 bug

Howie vor 3 Jahren
Ursprung
Commit
7cd4a0101e

+ 3 - 3
src/views/basic_data/taker/taker_list.vue

@@ -113,7 +113,7 @@
               <el-input v-model="addForm.phone"></el-input>
             </el-form-item>
           </el-col>
-          <el-col :span="12">
+          <!-- <el-col :span="12">
             <el-row :gutter="0">
               <el-col :span="14">
                 <el-form-item label="验证码" prop="code">
@@ -128,7 +128,7 @@
                   }" type="info">{{ count }}s后重新获取</el-button>
               </el-col>
             </el-row>
-          </el-col>
+          </el-col> -->
         </el-row>
         <el-row>
           <el-col :span="12">
@@ -251,7 +251,7 @@ export default {
         expireTime: [
           { required: true, message: "有效期不能为空", trigger: "blur" },
         ],
-        code: [{ required: true, message: "验证码不能为空", trigger: "blur" }],
+        // code: [{ required: true, message: "验证码不能为空", trigger: "blur" }],
       },
 
       dialogForm: false,

+ 6 - 1
src/views/supply/apply/apply_list.vue

@@ -320,7 +320,7 @@
 
     <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
 
-    <ApplyDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <ApplyDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" ref="refDetail"/>
     <ApplyExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
     <ApplyForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
     <ApplyReturnForm :listItem="queryItem" v-if="isShowReturnForm" @backListFormDetail="backList" :isShow="isShow"/>
@@ -554,6 +554,11 @@ export default {
     toDetail(item) {
       this.queryItem = item;
       this.isShowDetail = true;
+      this.$nextTick(()=>{
+        this.$refs.refDetail.initPrint()
+      })
+      
+      // this.$refs.refDetail.initPrint()
     },
 
     backList() {

+ 6 - 6
src/views/supply/apply/components/apply_detail.vue

@@ -175,8 +175,8 @@
       </div>
 
     </div>
-    <!-- <print-preview ref="preView" /> -->
-    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+    <print-preview ref="preView" />
+    <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
 
   </div>
 </template>
@@ -365,10 +365,10 @@ export default {
 
     // 点击打印
     toPrint() {
-      this.printId = this.listItem.id;
-      this.isShowPrint = true;
-        //   getDetail(this.listItem.id)
-        // this.$refs.preView.show(this.hiprintTemplate, detailArr)
+        this.printId = this.listItem.id;
+      // this.isShowPrint = true;
+            getDetail(this.listItem.id)
+          this.$refs.preView.show(this.hiprintTemplate, detailArr)
       
     },
 

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

@@ -4,10 +4,11 @@ export default {
     "index": 0,
     "height": 140,
     "width": 241,
+    "paperCount":222,
     "printElements": [{
       "options": {
         "left": 0,
-        "top": 20,
+        "top": 25,
         "height": 27,
         "width": 656,
         "field": "company",
@@ -91,10 +92,10 @@ export default {
     },
     {
       "options": {
-        "left": 15,
+        "left": 23,
         "top": 115,
         "height": 381,
-        "width": 656,
+        "width": 650,
         "fontSize": 13,
         "field": "table",
         "fontFamily": '黑体',
@@ -113,7 +114,7 @@ export default {
           }, {
             "title": "发货单号",
             "field": "invoiceId",
-            "width": 45,
+            "width": 47,
             "align": "left",
             "colspan": 1,
             "rowspan": 1,
@@ -124,7 +125,7 @@ export default {
           , {
             "title": "发货日期",
             "field": "createTime",
-            "width": 50,
+            "width": 25,
             "align": "left",
             "colspan": 1,
             "rowspan": 1,
@@ -155,7 +156,7 @@ export default {
           }, {
             "title": "规格型号",
             "field": "specification",
-            "width": 100,
+            "width": 120,
             "align": "left",
             "colspan": 1,
             "rowspan": 1,
@@ -188,7 +189,7 @@ export default {
           {
             "title": "备注说明",
             "field": "pjxh1Text",
-            "width": 60,
+            "width": 40,
             "align": "left",
             "colspan": 2,
             "rowspan": 1,
@@ -221,7 +222,7 @@ export default {
         "fontSize": 13,
         "title": "",
         "fontFamily": '黑体',
-        "field": "tiTui",
+        "field": "takerName",
         "testData": "",
         "color": "#000",
         "textAlign": "left"
@@ -252,7 +253,7 @@ export default {
         "fontSize": 13,
         "title": "提单",
         "fontFamily": '黑体',
-        "field": "",
+        "field": "takerDa",
         "testData": "",
         "color": "#000",
         "textAlign": "left"
@@ -267,7 +268,7 @@ export default {
         "fontSize": 13,
         "title": "联系方式",
         "fontFamily": '黑体',
-        "field": "",
+        "field": "takerPhone",
         "testData": "",
         "color": "#000",
         "textAlign": "left"
@@ -282,7 +283,7 @@ export default {
         "fontSize": 13,
         "title": "车辆",
         "fontFamily": '黑体',
-        "field": "",
+        "field": "pickCar",
         "testData": "",
         "color": "#000",
         "textAlign": "left"
@@ -297,14 +298,28 @@ export default {
         "fontSize": 13,
         "title": "仓库",
         "fontFamily": '黑体',
-        "field": "",
+        "field": "correspondNames",
         "testData": "",
         "color": "#000",
         "textAlign": "left"
       }, "printElementType": { "title": "", "type": "text" }
-    }],
-
-    "paperNumberLeft": 0,
-    "paperNumberTop": 380
+    },
+    // {
+    //   "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
   }]
 }

+ 21 - 15
src/views/supply/apply/components/design/print-data.js

@@ -1,4 +1,4 @@
-import { getDeliverDetail } from '@/api/supply/deliver'
+import { getDeliverDetail } from "@/api/supply/deliver";
 import { addPrints } from '@/api/supply/pickup'
 import { getCompanyList } from '@/api/user'
 
@@ -8,8 +8,7 @@ let company = ''
 // 获取详情
 getCompanyLists()
 function getDetail(id) {
-
-           detailArr = []
+      detailArr = []
       getDeliverDetail({id}).then(res => {
         const item = res.data
         detailData.push(item)
@@ -32,18 +31,25 @@ function getDetail(id) {
   
         console.log(company);
         detailArr.push({
-          type: item.type,
-          tiTui:item.type === 2 ? `退货人` : `提货人`,
-          headerRemark:item.remark,
-          total_num: item.total_num,
-          company: item.type === 2 ? `${company}销售退货单` : `${company}销售发货单`,
-          pickOrderWater: item.pickOrderWater,
-          customerNumber: item.customerNumber,
-          nowDate: nowDate(),
-          customerName: item.customerName || '',
-          correspondName: item.correspondName || '',
-          createBy: item.createBy,
-          table
+            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
         })
       })
 

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

@@ -211,14 +211,15 @@
 
     </div>
       
-    <!-- <print-preview ref="preView" /> -->
+    <print-preview ref="preView" />
 
-    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+    <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
 
   </div>
 </template>
 
 <script>
+
 import { getEnginDetail } from "@/api/supply/apply";
 import { getFileUrl } from '@/api/common';
 
@@ -416,9 +417,9 @@ export default {
     toPrint() {
       this.initPrint()
       this.printId = this.listItem.id;
-      // getDetail(this.tableSelection)
-      //   this.$refs.preView.show(this.hiprintTemplate, detailArr)
-      this.isShowPrint = true;
+      getDetail(this.tableSelection)
+        this.$refs.preView.show(this.hiprintTemplate, detailArr)
+      // this.isShowPrint = true;
     },
 
     backDetail() {

+ 5 - 2
src/views/supply/apply/engin_list.vue

@@ -335,7 +335,7 @@
 
     <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
 
-    <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <EnginDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList"  ref="refDetail"/>
     <EnginExamine :listItem="queryItem" v-if="isShowExamine" @backListFormDetail="backList" />
     <EnginForm :listItem="queryItem" v-if="isShowForm" @backListFormDetail="backList" />
     <EnginReturnForm :listItem="queryItem" v-if="isShowReturnForm" @backListFormDetail="backList" />
@@ -573,7 +573,10 @@ export default {
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
-      this.isShowDetail = true;
+      // this.isShowDetail = true;
+      this.$nextTick(()=>{
+        this.$refs.refDetail.initPrint()
+      })
     },
 
     backList() {

+ 4 - 1
src/views/supply/deliver/commerce_list.vue

@@ -277,7 +277,7 @@
       </div>
     </el-dialog>
 
-    <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <CommerceDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" ref="refDetail"/>
 
   </div>
 </template>
@@ -442,6 +442,9 @@ export default {
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
+      this.$nextTick(()=>{
+        this.$refs.refDetail.initPrint()
+      })
     },
 
     backList() {

+ 118 - 4
src/views/supply/deliver/components/commerce_detail.vue

@@ -177,13 +177,20 @@
       </div>
 
     </div>
+    <print-preview ref="preView" />
 
-    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+    <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
 
   </div>
 </template>
 
 <script>
+      import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
+disAutoConnect();
+
+import panel from '../../apply/components/design/panel'
+import { getDetail, detailArr } from '../../apply/components/design/print-data'
+import printPreview from '../../apply/components/design/preview.vue'
 import { getEnginDetail } from "@/api/supply/deliver";
 import CommonPrint from "@/views/supply/deliver/components/common_print";
 
@@ -193,6 +200,7 @@ export default {
   props: ['listItem'],
   components: {
     CommonPrint,
+    printPreview
   },
   filters: {
     statusFilter(val) {
@@ -226,9 +234,60 @@ export default {
       printType: 2,
       printId: '',
       isShowPrint: false,
+      curPaper: {
+        type: 'A5',
+        width: 500,
+        height: 147.6
+      },
+      paperTypes: {
+        'A3': {
+          width: 420,
+          height: 296.6
+        },
+        'A4': {
+          width: 210,
+          height: 296.6
+        },
+        'A5': {
+          width: 210,
+          height: 147.6
+        },
+        'B3': {
+          width: 500,
+          height: 352.6
+        },
+        'B4': {
+          width: 250,
+          height: 352.6
+        },
+        'B5': {
+          width: 250,
+          height: 175.6
+        }
+      },
+      scaleValue: 1,
+      scaleMax: 5,
+      scaleMin: 0.5,
+      hiprintTemplate:'',
     }
   },
-
+  computed:{
+    curPaperType() {
+      let type = 'other'
+      let types = this.paperTypes
+      for (const key in types) {
+        let item = types[key]
+        let { width, height } = this.curPaper
+        if (item.width === width && item.height === height) {
+          type = key
+        }
+      }
+      return type
+    }
+  },
+  activated(){
+    this.initPrint()
+  },
   created() {
     this.getDetail();
   },
@@ -238,7 +297,40 @@ export default {
     goBack() {
       this.$emit('backListFormDetail');
     },
-
+    initPrint(){
+      hiprint.init({
+      providers: [new defaultElementTypeProvider()]
+    });
+    // 还原配置
+    hiprint.setConfig()
+    // 替换配置
+    hiprint.setConfig({
+      movingDistance: 2.5,
+      text: {
+        supportOptions: [
+          {
+            name: 'styler',
+            hidden: true
+          },
+          {
+            name: 'formatter',
+            hidden: true
+          },
+        ]
+      }
+    })
+    // eslint-disable-next-line no-undef
+    hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
+    this.hiprintTemplate = new hiprint.PrintTemplate({
+      template: panel,
+      settingContainer: '#PrintElementOptionSetting',
+      paginationContainer: '.hiprint-printPagination'
+    });
+    this.hiprintTemplate.design('#hiprint-printTemplate');
+    // 获取当前放大比例, 当zoom时传true 才会有
+    // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+    }
+,
     // 获取详情
     getDetail() {
       getEnginDetail({id: this.listItem.id}).then(res => {
@@ -256,13 +348,35 @@ export default {
     // 点击打印
     toPrint() {
       this.printId = this.listItem.id;
-      this.isShowPrint = true;
+      // this.isShowPrint = true;
+      getDetail(this.listItem.id)
+        this.$refs.preView.show(this.hiprintTemplate, detailArr)
     },
 
     backDetail() {
       this.printId = '';
       this.isShowPrint = false;
     },
+       /**
+  * 设置纸张大小
+  * @param type [A3, A4, A5, B3, B4, B5, other]
+  * @param value {width,height} mm
+  */
+  setPaper(type, value) {
+  try {
+    if (Object.keys(this.paperTypes).includes(type)) {
+      this.curPaper = { type: type, width: value.width, height: value.height }
+      this.hiprintTemplate.setPaper(value.width, value.height)
+    } else {
+      this.curPaper = { type: 'other', width: value.width, height: value.height }
+      this.hiprintTemplate.setPaper(value.width, value.height)
+
+    }
+  } catch (error) {
+    this.$message.error(`操作失败: ${error}`)
+  }
+},
+
 
   }
 }

+ 117 - 5
src/views/supply/deliver/components/deliver_detail.vue

@@ -180,13 +180,20 @@
       </div>
 
     </div>
+    <print-preview ref="preView" />
 
-    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+    <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
 
   </div>
 </template>
 
 <script>
+  import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
+disAutoConnect();
+
+import panel from '../../apply/components/design/panel'
+import { getDetail, detailArr } from '../../apply/components/design/print-data'
+import printPreview from '../../apply/components/design/preview.vue'
 import { getDeliverDetail } from "@/api/supply/deliver";
 import CommonPrint from "@/views/supply/deliver/components/common_print";
 
@@ -195,7 +202,7 @@ export default {
   componentName: 'DeliverDetail',
   props: ['listItem'],
   components: {
-    CommonPrint,
+    CommonPrint,printPreview
   },
   filters: {
     statusFilter(val) {
@@ -229,9 +236,60 @@ export default {
       printType: 1,
       printId: '',
       isShowPrint: false,
+      curPaper: {
+        type: 'A5',
+        width: 500,
+        height: 147.6
+      },
+      paperTypes: {
+        'A3': {
+          width: 420,
+          height: 296.6
+        },
+        'A4': {
+          width: 210,
+          height: 296.6
+        },
+        'A5': {
+          width: 210,
+          height: 147.6
+        },
+        'B3': {
+          width: 500,
+          height: 352.6
+        },
+        'B4': {
+          width: 250,
+          height: 352.6
+        },
+        'B5': {
+          width: 250,
+          height: 175.6
+        }
+      },
+      scaleValue: 1,
+      scaleMax: 5,
+      scaleMin: 0.5,
+      hiprintTemplate:'',
     }
   },
-
+  computed:{
+    curPaperType() {
+      let type = 'other'
+      let types = this.paperTypes
+      for (const key in types) {
+        let item = types[key]
+        let { width, height } = this.curPaper
+        if (item.width === width && item.height === height) {
+          type = key
+        }
+      }
+      return type
+    }
+  },
+  activated(){
+    this.initPrint()
+  },
   created() {
     this.getDetail();
   },
@@ -241,7 +299,40 @@ export default {
     goBack() {
       this.$emit('backListFormDetail');
     },
-
+    initPrint(){
+      hiprint.init({
+      providers: [new defaultElementTypeProvider()]
+    });
+    // 还原配置
+    hiprint.setConfig()
+    // 替换配置
+    hiprint.setConfig({
+      movingDistance: 2.5,
+      text: {
+        supportOptions: [
+          {
+            name: 'styler',
+            hidden: true
+          },
+          {
+            name: 'formatter',
+            hidden: true
+          },
+        ]
+      }
+    })
+    // eslint-disable-next-line no-undef
+    hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
+    this.hiprintTemplate = new hiprint.PrintTemplate({
+      template: panel,
+      settingContainer: '#PrintElementOptionSetting',
+      paginationContainer: '.hiprint-printPagination'
+    });
+    this.hiprintTemplate.design('#hiprint-printTemplate');
+    // 获取当前放大比例, 当zoom时传true 才会有
+    // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+    }
+,
     // 获取详情
     getDetail() {
       getDeliverDetail({id: this.listItem.id}).then(res => {
@@ -259,14 +350,35 @@ export default {
     // 点击打印
     toPrint() {
       this.printId = this.listItem.id;
-      this.isShowPrint = true;
+      // this.isShowPrint = true;]
+      getDetail(this.listItem.id)
+        this.$refs.preView.show(this.hiprintTemplate, detailArr)
+      
     },
 
     backDetail() {
       this.printId = '';
       this.isShowPrint = false;
     },
+/**
+  * 设置纸张大小
+  * @param type [A3, A4, A5, B3, B4, B5, other]
+  * @param value {width,height} mm
+  */
+  setPaper(type, value) {
+  try {
+    if (Object.keys(this.paperTypes).includes(type)) {
+      this.curPaper = { type: type, width: value.width, height: value.height }
+      this.hiprintTemplate.setPaper(value.width, value.height)
+    } else {
+      this.curPaper = { type: 'other', width: value.width, height: value.height }
+      this.hiprintTemplate.setPaper(value.width, value.height)
 
+    }
+  } catch (error) {
+    this.$message.error(`操作失败: ${error}`)
+  }
+},
   }
 }
 </script>

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

@@ -3,7 +3,7 @@ import { addPrints } from '@/api/supply/pickup'
 import { getCompanyList } from '@/api/user'
 
 let detailArr = []
-let detailData = []
+    let detailData = []
 let cids = []
 let company = ''
 // 获取详情

+ 117 - 5
src/views/supply/deliver/components/home_detail.vue

@@ -178,13 +178,20 @@
       </div>
 
     </div>
+    <print-preview ref="preView" />
 
-    <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" />
+    <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
 
   </div>
 </template>
 
 <script>
+    import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
+disAutoConnect();
+
+import panel from '../../apply/components/design/panel'
+import { getDetail, detailArr } from '../../apply/components/design/print-data'
+import printPreview from '../../apply/components/design/preview.vue'
 import { getEnginDetail } from "@/api/supply/deliver";
 import CommonPrint from "@/views/supply/deliver/components/common_print";
 
@@ -193,7 +200,7 @@ export default {
   componentName: 'HomeDetail',
   props: ['listItem'],
   components: {
-    CommonPrint,
+    CommonPrint,printPreview
   },
   filters: {
     statusFilter(val) {
@@ -227,19 +234,103 @@ export default {
       printType: 2,
       printId: '',
       isShowPrint: false,
+      curPaper: {
+        type: 'A5',
+        width: 500,
+        height: 147.6
+      },
+      paperTypes: {
+        'A3': {
+          width: 420,
+          height: 296.6
+        },
+        'A4': {
+          width: 210,
+          height: 296.6
+        },
+        'A5': {
+          width: 210,
+          height: 147.6
+        },
+        'B3': {
+          width: 500,
+          height: 352.6
+        },
+        'B4': {
+          width: 250,
+          height: 352.6
+        },
+        'B5': {
+          width: 250,
+          height: 175.6
+        }
+      },
+      scaleValue: 1,
+      scaleMax: 5,
+      scaleMin: 0.5,
+      hiprintTemplate:'',
     }
   },
 
+  computed:{
+    curPaperType() {
+      let type = 'other'
+      let types = this.paperTypes
+      for (const key in types) {
+        let item = types[key]
+        let { width, height } = this.curPaper
+        if (item.width === width && item.height === height) {
+          type = key
+        }
+      }
+      return type
+    }
+  },
+  activated(){
+    this.initPrint()
+  },
   created() {
     this.getDetail();
   },
-
   methods: {
     // 返回列表
     goBack() {
       this.$emit('backListFormDetail');
     },
-
+    initPrint(){
+      hiprint.init({
+      providers: [new defaultElementTypeProvider()]
+    });
+    // 还原配置
+    hiprint.setConfig()
+    // 替换配置
+    hiprint.setConfig({
+      movingDistance: 2.5,
+      text: {
+        supportOptions: [
+          {
+            name: 'styler',
+            hidden: true
+          },
+          {
+            name: 'formatter',
+            hidden: true
+          },
+        ]
+      }
+    })
+    // eslint-disable-next-line no-undef
+    hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
+    this.hiprintTemplate = new hiprint.PrintTemplate({
+      template: panel,
+      settingContainer: '#PrintElementOptionSetting',
+      paginationContainer: '.hiprint-printPagination'
+    });
+    this.hiprintTemplate.design('#hiprint-printTemplate');
+    // 获取当前放大比例, 当zoom时传true 才会有
+    // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+    }
+,
     // 获取详情
     getDetail() {
       getEnginDetail({id: this.listItem.id}).then(res => {
@@ -257,13 +348,34 @@ export default {
     // 点击打印
     toPrint() {
       this.printId = this.listItem.id;
-      this.isShowPrint = true;
+      // this.isShowPrint = true;
+      getDetail(this.listItem.id)
+        this.$refs.preView.show(this.hiprintTemplate, detailArr)
     },
 
     backDetail() {
       this.printId = '';
       this.isShowPrint = false;
     },
+    /**
+  * 设置纸张大小
+  * @param type [A3, A4, A5, B3, B4, B5, other]
+  * @param value {width,height} mm
+  */
+  setPaper(type, value) {
+  try {
+    if (Object.keys(this.paperTypes).includes(type)) {
+      this.curPaper = { type: type, width: value.width, height: value.height }
+      this.hiprintTemplate.setPaper(value.width, value.height)
+    } else {
+      this.curPaper = { type: 'other', width: value.width, height: value.height }
+      this.hiprintTemplate.setPaper(value.width, value.height)
+
+    }
+  } catch (error) {
+    this.$message.error(`操作失败: ${error}`)
+  }
+},
 
   }
 }

+ 5 - 1
src/views/supply/deliver/deliver_list.vue

@@ -233,7 +233,7 @@
       </div>
     </el-dialog>
 
-    <DeliverDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <DeliverDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList"  ref="refDetail"/>
 
   </div>
 </template>
@@ -387,6 +387,10 @@ export default {
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
+      this.$nextTick(()=>{
+        this.$refs.refDetail.initPrint()
+      })
+      
     },
 
     backList() {

+ 5 - 1
src/views/supply/deliver/home_list.vue

@@ -247,7 +247,7 @@
       </div>
     </el-dialog>
 
-    <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList" />
+    <HomeDetail :listItem="queryItem" v-if="isShowDetail" @backListFormDetail="backList"  ref="refDetail" />
 
   </div>
 </template>
@@ -411,6 +411,10 @@ export default {
     // 进入详情
     toDetail(item) {
       this.queryItem = item;
+      this.$nextTick(()=>{
+        this.$refs.refDetail.initPrint()
+      })
+      
     },
 
     backList() {

+ 17 - 8
src/views/supply/deliver/sum_list.vue

@@ -90,18 +90,27 @@
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="审核开始时间" prop="approvalStartTime">
-                <el-date-picker v-model="screenForm.approvalStartTime" type="datetimerange" range-separator="至"
-                  style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
-                  end-placeholder="结束日期">
-                </el-date-picker>
+         
+
+                        <el-date-picker
+                        v-model="screenForm.approvalStartTime" 
+              value-format="yyyy-MM-dd HH:mm:ss"
+              type="date"
+              placeholder="选择日期">
+            </el-date-picker>
+
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
               <el-form-item label="审核结束时间" prop="approvalEndTime">
-                <el-date-picker v-model="screenForm.approvalEndTime" type="datetimerange" range-separator="至"
-                  style="width: 100%;" value-format="yyyy-MM-dd HH:mm:ss" start-placeholder="开始日期"
-                  end-placeholder="结束日期">
-                </el-date-picker>
+
+                <el-date-picker
+                        v-model="screenForm.approvalEndTime" 
+              value-format="yyyy-MM-dd HH:mm:ss"
+              type="date"
+              placeholder="选择日期">
+            </el-date-picker>
+
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="24" :lg="6" class="tr">