浏览代码

【修改】bug

howie 3 年之前
父节点
当前提交
1b8ad661a0

+ 267 - 0
src/mixin/print.js

@@ -0,0 +1,267 @@
+import { disAutoConnect, hiprint, defaultElementTypeProvider } from 'vue-plugin-hiprint'
+disAutoConnect();
+import panel from '@/utils/panel'
+import { getDeliverDetail } from "@/api/supply/deliver";
+import { addPrints } from "@/api/supply/pickup";
+import { getCompanyList } from "@/api/user";
+
+export default {
+  data() {
+    return {
+      company: '', // 公司名称
+      clonelData: [], // 克隆数据
+      outputData: [], // 打印数据
+      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,
+      loading: false,
+      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
+    }
+  },
+  created() {
+    this.getCompanyLists()
+  },
+  methods: {
+    // 初始化打印模板
+    initPrint() {
+      hiprint.init({
+        providers: [new defaultElementTypeProvider()]
+      });
+      // 替换配置
+      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;
+    },
+    /**
+     * 获取需要打印数据详情
+     * @param {Array} ids
+     */
+    getDateil(ids) {
+      console.log(ids);
+      // 清空之前打印的数据
+      this.outputData = [];
+      // 筛选id
+      let formatting = [];
+      // 获取数据id
+      for (let i = ids.length; i > 0; i--) {
+        formatting.push(ids[i - 1].id);
+      }
+      // id 去重
+      formatting = [...new Set(formatting)];
+
+      for (let i = formatting.length; i > 0; i--) {
+        // 延迟请求
+        setTimeout(async () => {
+          try {
+            const { data } = await getDeliverDetail({
+              id: formatting[i - 1],
+            });
+            //避免数据发生改变
+            this.clonelData.push(JSON.parse(JSON.stringify(data)))
+            // 需要计算长度和数据裁切
+            let invoicePickBeans = data.invoicePickBeans;
+            // 获取length向上取整
+            let len = Math.ceil(invoicePickBeans.length / 5);
+            for (let index = 0; index < len; index++) {
+              const table = [];
+              //  length <= 0 则不执行打印
+              if (invoicePickBeans.length) {
+                const newInvoicePickBeans = invoicePickBeans.splice(0, 5);
+                for (let e = newInvoicePickBeans.length; e > 0; e--) {
+                  const tempData = newInvoicePickBeans[e - 1];
+                  //添加表格数据
+                  table.push({
+                    salesId: tempData.salesOrderId,
+                    invoiceId: tempData.invoiceId,
+                    id: tempData.id,
+                    createTime: tempData.id
+                      ? this.dateToDayFilter(tempData.createTime)
+                      : '',
+                    enginOrderType:
+                      tempData.orderType == "HOME" || tempData.orderType == "TRADE"
+                        ? tempData.enginOrderNo
+                        : tempData.mainOrderId,
+                    materialName: tempData.materialName,
+                    specification: tempData.specification,
+                    refundableQty: tempData.refundableQty,
+                    pjxh1Text: tempData.pjxh1Text,
+                  });
+                }
+              }
+              // 添加print输出数据
+              this.outputData.push({
+                pageNumber: `${len}-${index + 1}`,
+                type: data.type,
+                tiTui: data.type === 2 ? `退货人` : `提货人`,
+                takerPhone: data.takerPhone || '',
+                headerRemark: data.remark,
+                total_num: data.total_num,
+                company:
+                  data.type === 2 ? `${this.company}销售退货单` : `${this.company}销售发货单`,
+                pickOrderWater: data.pickOrderWater,
+                customerNumber: data.customerNumber,
+                takerDa: '',
+                nowDate: this.nowDate(),
+                takerName:
+                  data.type === 2
+                    ? `退货人:${data.takerName || ''}`
+                    : `提货人:${data.takerName || ''}`,
+                customerName: data.customerName || '',
+                correspondName: data.correspondName,
+                correspondNames: '',
+                pickCar: data.pickCar || '',
+                createBy: JSON.parse(localStorage.getItem("supply_user")).nickName,
+                table,
+              });
+            }
+          } catch (error) {
+            console.error('获取打印数据失败')
+          }
+        }, 0);
+
+      }
+    },
+
+    // 获取公司名称
+    async getCompanyLists() {
+      try {
+        const { data } = await getCompanyList();
+        this.company = data ? data[0].companyName : '';
+      } catch (error) {
+        console.error('获取公司名称失败')
+
+      }
+    },
+    // 获取当前时间
+    nowDate() {
+      var date = new Date();
+      var seperator1 = "-";
+      var year = date.getFullYear();
+      var month = date.getMonth() + 1;
+      var strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+        month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+        strDate = "0" + strDate;
+      }
+      var currentdate = year + seperator1 + month + seperator1 + strDate;
+      console.log(currentdate);
+      return currentdate;
+    },
+    // 格式化时间
+    dateToDayFilter(date) {
+      if (!date) {
+        return '';
+      }
+      return date.slice(0, 10);
+    },
+    // 添加次数
+    async addPrint() {
+
+      let ids = []
+      for (let i = this.clonelData.length; i > 0; i--) {
+        const tempData = this.clonelData[i - 1].invoicePickBeans;
+        if (tempData.length) {
+          for (let e = tempData.length; e > 0; e--) {
+            const newTempData = tempData[e - 1];
+            ids.push(newTempData.id)
+          }
+        } else {
+          return this.clonelData[i - 1].invoiceOrderId || this.clonelData[i - 1].id
+        }
+      }
+      try {
+        await addPrints({ ids: ids.join(',') })
+      } catch (error) {
+        console.error('添加打印次数失败');
+      }
+    },
+    /**
+      * 设置纸张大小
+      * @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}`)
+      }
+    },
+  },
+};

+ 325 - 0
src/utils/panel.js

@@ -0,0 +1,325 @@
+
+export default {
+  "panels": [{
+    "index": 0,
+    "height": 150,
+    "width": 241,
+    "paperCount":222,
+    "printElements": [{
+      "options": {
+        "left": 0,
+        "top": 25,
+        "height": 27,
+        "width": 656,
+        "field": "company",
+        "fontSize": 19,
+        "fontWeight": "600",
+        "fontFamily": '黑体',
+        "textAlign": "center",
+        "lineHeight": 26
+      }, "printElementType": { "title": "", "type": "text" }
+    }, {
+      "options": {
+        "left": 40,
+        "top": 50,
+        "height": 13,
+        "width": 328,
+        "fontSize": 13,
+        "title": "经销商编码",
+        "fontFamily": '黑体',
+        "field": "customerNumber",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    }, {
+      "options": {
+        "left": 348,
+        "top": 50,
+        "height": 13,
+        "width": 328,
+        "fontSize": 13,
+        "title": "打印日期",
+        "fontFamily": '黑体',
+        "field": "nowDate",
+        "testData": "",
+        "color": "#000",
+
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+      , {
+      "options": {
+        "left": 40,
+        "top": 70,
+        "height": 13,
+        "width": 328,
+        "fontSize": 13,
+        "title": "经销商",
+        "fontFamily": '黑体',
+        "field": "customerName",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    }, {
+      "options": {
+        "left": 348,
+        "top": 70,
+        "height": 13,
+        "width": 328,
+        "fontSize": 13,
+        "title": "仓库",
+        "fontFamily": '黑体',
+        "field": "correspondName",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    , {
+      "options": {
+        "left": 40,
+        "top": 90,
+        "height": 13,
+        "width": 328,
+        "fontSize": 13,
+        "title": "备注",
+        "fontFamily": '黑体',
+        "field": "headerRemark",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+        "left": 23,
+        "top": 115,
+        "height": 400,
+        "width": 633,
+        "fontSize": 13,
+        "field": "table",
+        "fontFamily": '黑体',
+        "lineHeight": 16,
+        "tableFooterRepeat": "",
+        "columns": [[
+          {
+            "title": "出库单号",
+            "field": "salesId",
+            "width": 40,
+            "align": "left",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+
+          }, {
+            "title": "发货单号",
+            "field": "invoiceId",
+            "width": 47,
+            "align": "left",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+
+
+          }
+          , {
+            "title": "发货日期",
+            "field": "createTime",
+            "width": 25,
+            "align": "left",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+
+
+          }
+          , {
+            "title": "订单号",
+            "field": "enginOrderType",
+            "width": 40,
+            "align": "left",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+
+          }
+          , {
+            "title": "存货名称",
+            "field": "materialName",
+            "width": 40,
+            "align": "left",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+
+
+          }, {
+            "title": "规格型号",
+            "field": "specification",
+            "width": 120,
+            "align": "left",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+
+
+          }
+          , {
+             "title": "数量",
+            "field": "refundableQty",
+            "width": 23,
+            "align": "center",
+            "colspan": 1,
+            "rowspan": 1,
+            "fontSize": 13,
+            "tableSummary": "sum"
+
+          }
+          // , {
+          //   "title": "订单备注",
+          //   "field": "headerRemark",
+          //   "width": 40,
+          //   "align": "center",
+          //   "colspan": 1,
+          //   "rowspan": 1,
+          //   "fontSize": 13,
+          // }
+
+          ,
+
+          {
+            "title": "备注说明",
+            "field": "pjxh1Text",
+            "width": 40,
+            "align": "left",
+            "colspan": 2,
+            "rowspan": 1,
+            "fontSize": 13,
+          }]]
+      }, "printElementType": {
+        "title": "表格", "type": "table",
+        editable: true,
+        columnDisplayEditable: true,//列显示是否能编辑
+        columnDisplayIndexEditable: true,//列顺序显示是否能编辑
+        columnTitleEditable: true,//列标题是否能编辑
+        columnResizable: true, //列宽是否能调整
+        columnAlignEditable: true,//列对齐是否调整
+        isEnableEditField: true, //编辑字段
+        isEnableContextMenu: true, //开启右键菜单 默认true
+        isEnableInsertRow: true, //插入行
+        isEnableDeleteRow: true, //删除行
+        isEnableInsertColumn: true, //插入列
+        isEnableDeleteColumn: true, //删除列
+        isEnableMergeCell: true, //合并单元格
+      }
+
+    },
+      , {
+      "options": {
+        "left": 40,
+        "top": 380,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "",
+        "fontFamily": '黑体',
+        "field": "takerName",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+
+        "left": 40,
+        "top": 400,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "打单",
+        "fontFamily": '黑体',
+        "field": "createBy",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+        "left": 238,
+        "top": 400,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "车辆",
+        "fontFamily": '黑体',
+        "field": "pickCar",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+        "left": 238,
+        "top": 380,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "联系方式",
+        "fontFamily": '黑体',
+        "field": "takerPhone",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+        "left": 463,
+        "top": 380,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "提单",
+        "fontFamily": '黑体',
+        "field": "takerDa",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+        "left": 463,
+        "top": 400,
+        "height": 13,
+        "width": 218,
+        "fontSize": 13,
+        "title": "仓库",
+        "fontFamily": '黑体',
+        "field": "correspondNames",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    },
+    {
+      "options": {
+        "left": 650,
+        "top": 400,
+        "height": 13,
+        "width": 218,
+        "fontSize": 16,
+        "title": "",
+        "fontFamily": '黑体',
+        "field": "pageNumber",
+        "testData": "",
+        "color": "#000",
+        "textAlign": "left"
+      }, "printElementType": { "title": "", "type": "text" }
+    }],
+    "paperNumberDisabled": true
+  }]
+}

+ 60 - 67
src/views/supply/deliver/components/design/preview.vue

@@ -1,30 +1,38 @@
 <template>
-  <el-dialog :visible.sync="visible" :show-close="false" :maskClosable="false" :close-on-click-modal="false"
-    @cancel="hideModal" :width="350 + 'mm'">
+  <el-dialog
+    :visible.sync="visible"
+    :show-close="false"
+    :maskClosable="false"
+    :close-on-click-modal="false"
+    @cancel="hideModal"
+    :width="350 + 'mm'"
+  >
     <div :spinning="spinning" style="min-height: 100px">
-      <div id="preview_content" ref="printDom">
-
-      </div>
+      <div id="preview_content" ref="printDom"></div>
     </div>
     <template slot="title">
       <div>
         <!-- <div style="margin-right: 20px">打印预览</div> -->
-        <el-button :loading="waitShowPrinter" type="primary" icon="printer" @click.stop="print">打印</el-button>
+        <el-button
+          :loading="waitShowPrinter"
+          type="primary"
+          icon="printer"
+          @click.stop="print"
+          >打印</el-button
+        >
         <!-- <el-button type="primary" icon="printer" @click.stop="toPdf">pdf</el-button> -->
       </div>
     </template>
     <template slot="footer">
-      <el-button key="close" type="info" @click="hideModal">
-        关闭
-      </el-button>
+      <el-button key="close" type="info" @click="hideModal"> 关闭 </el-button>
     </template>
   </el-dialog>
 </template>
 
 <script>
 // import { downloadPDF } from '@/utils/pdf'
-import { addPrint } from './print-data'
-import { detailArr } from './print-data'
+import { addPrint } from "./print-data";
+import { detailArr } from "./print-data";
 export default {
   name: "printPreview",
   props: {},
@@ -38,71 +46,62 @@ export default {
       // 模板
       hiprintTemplate: {},
       // 数据
-      printData: {}
-    }
+      printData: {},
+    };
   },
   computed: {},
   watch: {},
-  created() {
-  },
-  mounted() {
-  },
+  created() {},
+  mounted() {},
   methods: {
     // handleExport() {
     //   downloadPDF(this.$refs.printDom);
     // },
     hideModal() {
-      this.visible = false
-      this.waitShowPrinter = false
-      this.$parent.initPrint()
+      this.visible = false;
+      this.waitShowPrinter = false;
+      this.$parent.initPrint();
       // console.log(this.$parent);
     },
-    show(hiprintTemplate, printData, width = '210') {
-      this.visible = true
-      this.spinning = true
-      this.width = width
-      this.hiprintTemplate = hiprintTemplate
-      this.printData = printData
+    show(hiprintTemplate, printData, width = "210") {
+      this.visible = true;
+      this.spinning = true;
+      this.width = width;
+      this.hiprintTemplate = hiprintTemplate;
+      this.printData = printData;
       setTimeout(() => {
         // eslint-disable-next-line no-undef
-        $('#preview_content').html(hiprintTemplate.getHtml(printData))
-        this.spinning = false
-      }, 500)
+        $("#preview_content").html(hiprintTemplate.getHtml(printData));
+        this.spinning = false;
+      }, 500);
     },
     print() {
-       
-      this.hiprintTemplate.print(this.printData, {}, {
-        callback: () => {
-          addPrint()
-          this.hiprintTemplate = {}
-          this.$parent.getList()
-          this.$parent.tableSelection =[]
+      this.hiprintTemplate.print(
+        this.printData,
+        {},
+        {
+          callback: () => {
+            console.log(5545);
+            this.$parent.addPrint();
+            this.hiprintTemplate = {};
+            this.$parent.tableSelection = [];
+            setTimeout(() => {
+              this.$parent.getList();
+              console.error("更新发货汇总列表");
+            }, 1000);
+          },
         }
-      })
-      this.hiprintTemplate.on('printSuccess', function (data) {
-        console.log('打印完成')
-          //  addPrint()
-          this.hiprintTemplate = {}
-          this.$parent.getList()
-          this.$parent.tableSelection =[]
-      })
-      // this.hiprintTemplate.on('printError', function (data) {
-      //   console.log('打印失败')
-      //   this.hiprintTemplate = {}
-      //     this.$parent.getList()
-      //     this.$parent.tableSelection =[]
-      // })
-      setTimeout(()=>{
-        this.hideModal()
-      },2000)
+      );
+      setTimeout(() => {
+        this.hideModal();
+      }, 2000);
     },
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);
     //   this.hiprintTemplate.toPdf({}, '打印预览');
     // },
-  }
-}
-
+  },
+};
 </script>
 
 <style scoped>
@@ -110,7 +109,6 @@ export default {
   padding: 0;
 }
 
-
 ::v-deep tr {
   height: 40px !important;
 }
@@ -134,12 +132,10 @@ export default {
 
 .ant-modal-content {
   margin-bottom: 24px;
-
 }
 
 @media print {
-   
-/*    
+  /*
   td {
     border: none !important;
   } */
@@ -149,7 +145,7 @@ export default {
     padding: 6px;
   }
 
-  .drag_item_box>div {
+  .drag_item_box > div {
     height: 100%;
     width: 100%;
     background-color: #fff;
@@ -158,16 +154,16 @@ export default {
     align-items: center;
   }
 
-  .drag_item_box>div>a {
+  .drag_item_box > div > a {
     text-align: center;
     text-decoration-line: none;
   }
 
-  .drag_item_box>div>a>span {
+  .drag_item_box > div > a > span {
     font-size: 28px;
   }
 
-  .drag_item_box>div>a>p {
+  .drag_item_box > div > a > p {
     margin: 0;
   }
 
@@ -177,7 +173,6 @@ export default {
     font-weight: bold;
   }
 
-
   .card-design {
     overflow: hidden;
     overflow-x: auto;
@@ -206,14 +201,12 @@ export default {
     height: 529px !important; */
   }
 
-
   .ant-modal-body {
     padding: 0px;
   }
 
   .ant-modal-content {
     margin-bottom: 24px;
-
   }
 }
 </style>

文件差异内容过多而无法显示
+ 627 - 205
src/views/supply/deliver/sum_list.vue


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

@@ -2,7 +2,7 @@
 export default {
   "panels": [{
     "index": 0,
-    "height": 140,
+    "height": 150,
     "width": 241,
      "paperNumber":0,
     "printElements": [{
@@ -94,13 +94,13 @@ export default {
       "options": {
         "left": 23,
         "top": 115,
-        "height": 381,
+        "height": 400,
         "width": 633,
         "fontSize": 13,
         "field": "table",
         "fontFamily": '黑体',
         "lineHeight": 16,
-       
+
         "tableFooterRepeat": "",
         "columns": [[
           {
@@ -120,7 +120,7 @@ export default {
             "colspan": 1,
             "rowspan": 1,
             "fontSize": 13,
-            
+
 
           }
           , {
@@ -131,7 +131,7 @@ export default {
             "colspan": 1,
             "rowspan": 1,
             "fontSize": 13,
-           
+
 
           }
           , {
@@ -142,7 +142,7 @@ export default {
             "colspan": 1,
             "rowspan": 1,
             "fontSize": 13,
-            
+
           }
           , {
             "title": "存货名称",
@@ -184,9 +184,9 @@ export default {
           //   "rowspan": 1,
           //   "fontSize": 13,
           // }
-          
-          , 
-          
+
+          ,
+
           {
             "title": "备注说明",
             "field": "pjxh1Text",
@@ -217,7 +217,7 @@ export default {
       , {
       "options": {
         "left": 40,
-        "top": 360,
+        "top": 380,
         "height": 13,
         "width": 218,
         "fontSize": 13,
@@ -231,9 +231,9 @@ export default {
     },
     {
       "options": {
-        
+
         "left": 40,
-        "top": 381,
+        "top": 400,
         "height": 13,
         "width": 218,
         "fontSize": 13,
@@ -248,7 +248,7 @@ export default {
     {
       "options": {
         "left": 238,
-        "top": 381,
+        "top": 400,
         "height": 13,
         "width": 218,
         "fontSize": 13,
@@ -263,7 +263,7 @@ export default {
     {
       "options": {
         "left": 238,
-        "top": 360,
+        "top": 380,
         "height": 13,
         "width": 218,
         "fontSize": 13,
@@ -278,7 +278,7 @@ export default {
     {
       "options": {
         "left": 463,
-        "top": 360,
+        "top": 380,
         "height": 13,
         "width": 218,
         "fontSize": 13,
@@ -293,7 +293,7 @@ export default {
     {
       "options": {
         "left": 463,
-        "top": 381,
+        "top": 400,
         "height": 13,
         "width": 218,
         "fontSize": 13,
@@ -308,7 +308,7 @@ export default {
     {
       "options": {
         "left": 650,
-        "top": 381,
+        "top": 400,
         "height": 13,
         "width": 218,
         "fontSize": 16,

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

@@ -10,10 +10,7 @@ let cNewIds = []
 
  async function getDetails(ids, nickName) {
   let invoicePickBeans = []
-  let start = 0
-  let end = 5
   detailArr = []
-  // detailData = ids
   let newIds = []
   newIds = ids
   let filterId = []
@@ -81,61 +78,6 @@ let cNewIds = []
         }
       })
   })
-
-
-  return
-  for (let i = 0; i < filterId.length; i++) {
-    getDetail({ id: filterId[i] }).then(res => {
-      const item = res.data
-      detailData.push(JSON.parse(JSON.stringify(item)))
-
-      invoicePickBeans = item.invoicePickBeans
-      let len = Math.ceil(invoicePickBeans.length / 5)
-      console.log(len, '长度');
-      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.orderType == 'HOME' || e.orderType == '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
-        })
-      }
-    })
-  }
 }
 
 function nowDate() {

部分文件因为文件数量过多而无法显示