king
2022-04-23 2ac9ff6a02fff3cf956e413def25b94175ccf702
src/views/billprint/index.jsx
@@ -526,33 +526,37 @@
          } else if (_pageover) {
            return
          } else if (item.subtype === 'datacard' || item.type === 'table') {
            if (!_item.dataArray || _item.dataArray.length === 0) return
            if (item.subtype === 'datacard' && item.wrap.layout === 'flex') {
              if (!item.added && item.wrap.printHeight) {
                count += item.wrap.printHeight
                if (count >= limit) {
                  _pageover = true
                }
                if (count <= limit) {
            if (_item.dataArray && _item.dataArray.length > 0) {
              if (item.subtype === 'datacard' && item.wrap.layout === 'flex') {
                if (!item.added && item.wrap.printHeight) {
                  count += item.wrap.printHeight
                  if (count >= limit) {
                    _pageover = true
                  }
                  if (count <= limit) {
                    _item.added = true
                    page.push(item)
                  }
                } else if (!item.added) {
                  _item.added = true
                  page.push(item)
                }
              } else if (!item.added) {
                _item.added = true
              } else {
                item.data = []
                while (count + 1 <= limit && _item.dataArray.length > 0) {
                  item.data.push(_item.dataArray.shift())
                  count++
                }
                if (count >= limit) {
                  _pageover = true
                }
                page.push(item)
              }
            } else {
              item.data = []
              while (count + 1 <= limit && _item.dataArray.length > 0) {
                item.data.push(_item.dataArray.shift())
                count++
              }
              if (count >= limit) {
                _pageover = true
              }
              _item.added = true
            } else if (!item.added) {
              _item.added = true
              page.push(item)
            }
          } else if (!item.added && item.wrap && item.wrap.printHeight) {
@@ -602,33 +606,37 @@
            } else if (_pageover) {
              return
            } else if (item.subtype === 'datacard' || item.type === 'table') {
              if (!_item.dataArray || _item.dataArray.length === 0) return
              if (item.subtype === 'datacard' && item.wrap.layout === 'flex') {
                if (!item.added && item.wrap.printHeight) {
                  count += item.wrap.printHeight
                  if (count >= limit) {
                    _pageover = true
                  }
                  if (count <= limit) {
              if (_item.dataArray && _item.dataArray.length > 0) {
                if (item.subtype === 'datacard' && item.wrap.layout === 'flex') {
                  if (!item.added && item.wrap.printHeight) {
                    count += item.wrap.printHeight
                    if (count >= limit) {
                      _pageover = true
                    }
                    if (count <= limit) {
                      _item.added = true
                      page.push(item)
                    }
                  } else if (!item.added) {
                    _item.added = true
                    page.push(item)
                  }
                } else if (!item.added) {
                  _item.added = true
                } else {
                  item.data = []
                  while (count + 1 <= limit && _item.dataArray.length > 0) {
                    item.data.push(_item.dataArray.shift())
                    count++
                  }
                  if (count >= limit) {
                    _pageover = true
                  }
                  page.push(item)
                }
              } else {
                item.data = []
                while (count + 1 <= limit && _item.dataArray.length > 0) {
                  item.data.push(_item.dataArray.shift())
                  count++
                }
                if (count >= limit) {
                  _pageover = true
                }
                _item.added = true
              } else if (!item.added) {
                _item.added = true
                page.push(item)
              }
            } else if (!item.added && item.wrap && item.wrap.printHeight) {
@@ -692,7 +700,7 @@
          doc.write(`<LINK rel="stylesheet" type="text/css" href="${linkList[i].href}">`)
        }
      }
      doc.write(`<style>body{width: ${config.width}px!important;}*{border-style: solid;border-width: 0;}</style>`)
      doc.write(`<style>body{width: ${config.width}px!important;}*{border-style: solid;border-width: 0;}.ant-table-placeholder{display: none;}.ant-empty{display: none;}</style>`)
      for (let i = 0;i < styleList.length;i++) {
        doc.write('<style>' + styleList[i].innerHTML + '</style>')
      }