hiprint.io打印插件,一旦数据过多打印出空白,为啥呢 求大佬?

新手上路,请多包涵

cf1abe076cbb033185b3f92c06e5ecb.png02f0319d591499cafc052a8db1d387f.png

export const printingTemplate = (data) => {
  hiprint.init();
  const hiprintTemplate = new hiprint.PrintTemplate({
    template: {
      panels: [
        {
          // index: 0,
          // paperType: 'A4',
          height: 210,
          width: 297,
          paperHeader: 76.5,
          paperFooter: 546,
          printElements: [
            {
              options: {
                left: 64.5,
                top: 4.5,
                height: 72,
                width: 115.5,
                src: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.58cdn.com.cn%2Fenterprise%2Fappearance%2Fbig%2Fn_v218105d1538b94b59b70b9d6ab23d6d40.jpg&refer=http%3A%2F%2Fpic1.58cdn.com.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1657260979&t=35c2237273dbfb393cc989a102f4adee',
              },
              printElementType: { type: 'image' },
            },
            {
              options: {
                left: 243,
                top: 15,
                height: 51,
                width: 397.5,
                title: '入库日报表',
                fontSize: 21.75,
                fontWeight: 'bolder',
                textAlign: 'center',
                textContentVerticalAlign: 'middle',
              },
              printElementType: { type: 'text' },
            },
            {
              options: {
                left: 64.5,
                top: 96,
                height: 36,
                width: 706.5,
                textAlign: 'center',
                field: 'tableData',
                columns: [
                  [
                    {
                      title: '仓库编号',
                      field: 'warehouseid',
                      width: 100.92,
                      colspan: 1,
                      rowspan: 1,
                      checked: true,
                      columnId: 'warehouseid',
                    },
                    {
                      title: '客户',
                      field: 'customerid',
                      width: 100.92,
                      colspan: 1,
                      rowspan: 1,
                      checked: true,
                      columnId: 'customerid',
                    },
                    {
                      title: '箱码',
                      field: 'alternativesku',
                      width: 303,
                      colspan: 1,
                      rowspan: 1,
                      checked: true,
                      columnId: 'alternativesku',
                    },
                    {
                      title: '入库日期',
                      field: 'receivedtime',
                      width: 100.92,
                      colspan: 1,
                      rowspan: 1,
                      checked: true,
                      columnId: 'receivedtime',
                    },
                    {
                      title: '质量状态',
                      field: 'qcstatus',
                      width: 100.92,
                      colspan: 1,
                      rowspan: 1,
                      checked: true,
                      columnId: 'qcstatus',
                    },
                  ],
                ],
              },
              printElementType: { title: '表格', type: 'tableCustom' },
            },
            {
              options: {
                left: 64.5,
                top: 555,
                height: 18,
                width: 120,
                title: '制单人(签名/日期):',
              },
              printElementType: { type: 'text' },
            },
            {
              options: {
                left: 682,
                top: 555,
                height: 16.5,
                width: 120,
                field: 'printTime',
              },
              printElementType: { type: 'text' },
            },
            {
              options: { left: 63, top: 546, height: 9, width: 708 },
              printElementType: { type: 'hline' },
            },
          ],
          paperNumberLeft: 403.5,
          paperNumberTop: 553.5,
          rotate: true,
          // paperNumberFormat: 'paperNo/paperCount',
        },
      ],
    },
  });
  hiprintTemplate.print({
    printTime: new Date().toLocaleString(),
    tableData: data,
  });
};
阅读 1.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题