From 2ac9ff6a02fff3cf956e413def25b94175ccf702 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 23 四月 2022 23:52:25 +0800
Subject: [PATCH] 2022-04-23

---
 src/views/billprint/index.jsx |   98 ++++++++++++++++++++++++++----------------------
 1 files changed, 53 insertions(+), 45 deletions(-)

diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx
index 90d3fe4..e5eb488 100644
--- a/src/views/billprint/index.jsx
+++ b/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>')
       }

--
Gitblit v1.8.0