@cecee/document-flip-book 1.0.19 → 1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/AccountingBook/assets/active-line.png +0 -0
- package/dist/cjs/AccountingBook/assets/default-line.png +0 -0
- package/dist/cjs/AccountingBook/assets/filp-bg.png +0 -0
- package/dist/cjs/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
- package/dist/cjs/AccountingBook/components/AccountingVoucher/index.js +398 -0
- package/dist/cjs/AccountingBook/components/AccountingVoucher/index.less +231 -0
- package/dist/cjs/AccountingBook/components/ExportModal.d.ts +10 -0
- package/dist/cjs/AccountingBook/components/ExportModal.js +96 -0
- package/dist/cjs/AccountingBook/components/FilpPage.d.ts +7 -0
- package/dist/cjs/AccountingBook/components/FilpPage.js +39 -0
- package/dist/cjs/AccountingBook/components/HeaderBar.d.ts +28 -0
- package/dist/cjs/AccountingBook/components/HeaderBar.js +245 -0
- package/dist/cjs/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
- package/dist/cjs/AccountingBook/components/ImagePageRenderer.js +91 -0
- package/dist/cjs/AccountingBook/components/LoadingComponent.d.ts +7 -0
- package/dist/cjs/AccountingBook/components/LoadingComponent.js +54 -0
- package/dist/cjs/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
- package/dist/cjs/AccountingBook/components/PDFPageRenderer.js +259 -0
- package/dist/cjs/AccountingBook/components/index.less +6 -0
- package/dist/cjs/AccountingBook/constants.d.ts +11 -0
- package/dist/cjs/AccountingBook/constants.js +25 -0
- package/dist/cjs/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
- package/dist/cjs/AccountingBook/hooks/useAmountSearch.js +165 -0
- package/dist/cjs/AccountingBook/hooks/usePageFlip.d.ts +15 -0
- package/dist/cjs/AccountingBook/hooks/usePageFlip.js +67 -0
- package/dist/cjs/AccountingBook/index.d.ts +29 -1
- package/dist/cjs/AccountingBook/index.js +1163 -7
- package/dist/cjs/AccountingBook/index.less +188 -0
- package/dist/cjs/AccountingBook/types.d.ts +84 -0
- package/dist/cjs/AccountingBook/types.js +5 -0
- package/dist/cjs/AccountingBook/utils/canvasUtils.d.ts +51 -0
- package/dist/cjs/AccountingBook/utils/canvasUtils.js +499 -0
- package/dist/cjs/AccountingBook/utils/html.d.ts +9 -0
- package/dist/cjs/AccountingBook/utils/html.js +97 -0
- package/dist/cjs/AccountingBook/utils/utils.d.ts +38 -0
- package/dist/cjs/AccountingBook/utils/utils.js +204 -0
- package/dist/cjs/DocumentFlipBook/ExportModal.d.ts +1 -1
- package/dist/cjs/DocumentFlipBook/ExportModal.js +1 -1
- package/dist/cjs/DocumentFlipBook/HeaderBar.d.ts +2 -1
- package/dist/cjs/DocumentFlipBook/HeaderBar.js +13 -11
- package/dist/cjs/DocumentFlipBook/SideTabs.js +111 -6
- package/dist/cjs/DocumentFlipBook/index.d.ts +1 -0
- package/dist/cjs/DocumentFlipBook/index.js +6 -3
- package/dist/cjs/DocumentFlipBook/index.less +235 -9
- package/dist/cjs/declarations.d.ts +21 -0
- package/dist/esm/AccountingBook/assets/active-line.png +0 -0
- package/dist/esm/AccountingBook/assets/default-line.png +0 -0
- package/dist/esm/AccountingBook/assets/filp-bg.png +0 -0
- package/dist/esm/AccountingBook/components/AccountingVoucher/index.d.ts +26 -0
- package/dist/esm/AccountingBook/components/AccountingVoucher/index.js +391 -0
- package/dist/esm/AccountingBook/components/AccountingVoucher/index.less +231 -0
- package/dist/esm/AccountingBook/components/ExportModal.d.ts +10 -0
- package/dist/esm/AccountingBook/components/ExportModal.js +88 -0
- package/dist/esm/AccountingBook/components/FilpPage.d.ts +7 -0
- package/dist/esm/AccountingBook/components/FilpPage.js +33 -0
- package/dist/esm/AccountingBook/components/HeaderBar.d.ts +28 -0
- package/dist/esm/AccountingBook/components/HeaderBar.js +236 -0
- package/dist/esm/AccountingBook/components/ImagePageRenderer.d.ts +11 -0
- package/dist/esm/AccountingBook/components/ImagePageRenderer.js +85 -0
- package/dist/esm/AccountingBook/components/LoadingComponent.d.ts +7 -0
- package/dist/esm/AccountingBook/components/LoadingComponent.js +48 -0
- package/dist/esm/AccountingBook/components/PDFPageRenderer.d.ts +13 -0
- package/dist/esm/AccountingBook/components/PDFPageRenderer.js +252 -0
- package/dist/esm/AccountingBook/components/index.less +6 -0
- package/dist/esm/AccountingBook/constants.d.ts +11 -0
- package/dist/esm/AccountingBook/constants.js +17 -0
- package/dist/esm/AccountingBook/hooks/useAmountSearch.d.ts +24 -0
- package/dist/esm/AccountingBook/hooks/useAmountSearch.js +158 -0
- package/dist/esm/AccountingBook/hooks/usePageFlip.d.ts +15 -0
- package/dist/esm/AccountingBook/hooks/usePageFlip.js +61 -0
- package/dist/esm/AccountingBook/index.d.ts +29 -1
- package/dist/esm/AccountingBook/index.js +1162 -6
- package/dist/esm/AccountingBook/index.less +188 -0
- package/dist/esm/AccountingBook/types.d.ts +84 -0
- package/dist/esm/AccountingBook/types.js +1 -0
- package/dist/esm/AccountingBook/utils/canvasUtils.d.ts +51 -0
- package/dist/esm/AccountingBook/utils/canvasUtils.js +493 -0
- package/dist/esm/AccountingBook/utils/html.d.ts +9 -0
- package/dist/esm/AccountingBook/utils/html.js +89 -0
- package/dist/esm/AccountingBook/utils/utils.d.ts +38 -0
- package/dist/esm/AccountingBook/utils/utils.js +195 -0
- package/dist/esm/DocumentFlipBook/ExportModal.d.ts +1 -1
- package/dist/esm/DocumentFlipBook/ExportModal.js +1 -1
- package/dist/esm/DocumentFlipBook/HeaderBar.d.ts +2 -1
- package/dist/esm/DocumentFlipBook/HeaderBar.js +13 -11
- package/dist/esm/DocumentFlipBook/SideTabs.js +110 -5
- package/dist/esm/DocumentFlipBook/index.d.ts +1 -0
- package/dist/esm/DocumentFlipBook/index.js +6 -3
- package/dist/esm/DocumentFlipBook/index.less +235 -9
- package/dist/esm/declarations.d.ts +21 -0
- package/package.json +8 -2
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface VoucherEntry {
|
|
4
|
+
summary: string;
|
|
5
|
+
account: string;
|
|
6
|
+
debit: string;
|
|
7
|
+
credit: string;
|
|
8
|
+
trade_direction?: '借' | '贷';
|
|
9
|
+
amount?: string;
|
|
10
|
+
isTotal?: boolean;
|
|
11
|
+
checked?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface VoucherProps {
|
|
14
|
+
date?: string;
|
|
15
|
+
company?: string;
|
|
16
|
+
voucherNo?: string;
|
|
17
|
+
entries?: VoucherEntry[];
|
|
18
|
+
accountant?: string;
|
|
19
|
+
recorder?: string;
|
|
20
|
+
maker?: string;
|
|
21
|
+
showTotal?: boolean;
|
|
22
|
+
totalDebit?: string;
|
|
23
|
+
totalCredit?: string;
|
|
24
|
+
}
|
|
25
|
+
declare const AccountingVoucher: React.FC<VoucherProps>;
|
|
26
|
+
export default AccountingVoucher;
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
require("./index.less");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
14
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
16
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
17
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
18
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
19
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
20
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
22
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /*
|
|
23
|
+
* @Author: Geralt Rivia
|
|
24
|
+
* @Date: 2025-05-15 15:43:44
|
|
25
|
+
* @LastEditors: Geralt Rivia
|
|
26
|
+
* @LastEditTime: 2025-09-11 14:40:54
|
|
27
|
+
* @Description: 记账凭证-单据样式组件
|
|
28
|
+
*/
|
|
29
|
+
// 格式化金额显示的新函数
|
|
30
|
+
function formatAmount(amount, tradeDirection, originalAmount) {
|
|
31
|
+
var result = new Array(11).fill(' ');
|
|
32
|
+
|
|
33
|
+
// 仅在遇到 null/undefined/空字符串时返回空值
|
|
34
|
+
if (!amount) return result;
|
|
35
|
+
var numAmount = parseFloat(amount);
|
|
36
|
+
if (isNaN(numAmount)) return result;
|
|
37
|
+
|
|
38
|
+
// 处理零值的特殊情况
|
|
39
|
+
if (numAmount === 0) {
|
|
40
|
+
// 如果有原始金额信息,检查原始金额是否为0
|
|
41
|
+
if (originalAmount) {
|
|
42
|
+
var originalNum = parseFloat(originalAmount);
|
|
43
|
+
if (originalNum === 0 && tradeDirection) {
|
|
44
|
+
// 只有当trade_direction与当前列匹配时,才显示0
|
|
45
|
+
var zeroResult = new Array(11).fill(' ');
|
|
46
|
+
zeroResult[8] = '0'; // 元位显示0
|
|
47
|
+
zeroResult[9] = '0'; // 角位显示0
|
|
48
|
+
zeroResult[10] = '0'; // 分位显示0
|
|
49
|
+
return zeroResult;
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
// 原有逻辑保持不变
|
|
53
|
+
var _zeroResult = new Array(11).fill(' ');
|
|
54
|
+
_zeroResult[8] = '0'; // 元位显示0
|
|
55
|
+
_zeroResult[9] = '0'; // 角位显示0
|
|
56
|
+
_zeroResult[10] = '0'; // 分位显示0
|
|
57
|
+
return _zeroResult;
|
|
58
|
+
}
|
|
59
|
+
return result; // 不匹配方向时返回空
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 对于非零值,按常规格式显示
|
|
63
|
+
var formattedAmount = numAmount.toFixed(2);
|
|
64
|
+
var _formattedAmount$spli = formattedAmount.split('.'),
|
|
65
|
+
_formattedAmount$spli2 = _slicedToArray(_formattedAmount$spli, 2),
|
|
66
|
+
intPart = _formattedAmount$spli2[0],
|
|
67
|
+
_formattedAmount$spli3 = _formattedAmount$spli2[1],
|
|
68
|
+
decPart = _formattedAmount$spli3 === void 0 ? '00' : _formattedAmount$spli3;
|
|
69
|
+
var paddedInt = intPart.padStart(9, ' ');
|
|
70
|
+
return (paddedInt + decPart).split('').slice(0, 11);
|
|
71
|
+
}
|
|
72
|
+
;
|
|
73
|
+
|
|
74
|
+
// 判断是否应该显示金额的辅助函数
|
|
75
|
+
function shouldShowAmount(entry, isDebit) {
|
|
76
|
+
var numDebit = parseFloat(entry.debit || '0');
|
|
77
|
+
var numCredit = parseFloat(entry.credit || '0');
|
|
78
|
+
var originalAmount = parseFloat(entry.amount || '0');
|
|
79
|
+
// 允许负数
|
|
80
|
+
if (numDebit !== 0 || numCredit !== 0) {
|
|
81
|
+
return isDebit ? numDebit !== 0 : numCredit !== 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// 如果都为0,但原始金额为0,根据trade_direction判断
|
|
85
|
+
if (originalAmount === 0 && entry.trade_direction) {
|
|
86
|
+
return isDebit ? entry.trade_direction === '借' : entry.trade_direction === '贷';
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
var AccountingVoucher = function AccountingVoucher(_ref) {
|
|
91
|
+
var _ref$date = _ref.date,
|
|
92
|
+
date = _ref$date === void 0 ? '' : _ref$date,
|
|
93
|
+
_ref$company = _ref.company,
|
|
94
|
+
company = _ref$company === void 0 ? '迈金西(成都)企业管理咨询有限公司' : _ref$company,
|
|
95
|
+
_ref$voucherNo = _ref.voucherNo,
|
|
96
|
+
voucherNo = _ref$voucherNo === void 0 ? '13' : _ref$voucherNo,
|
|
97
|
+
_ref$entries = _ref.entries,
|
|
98
|
+
entries = _ref$entries === void 0 ? [] : _ref$entries,
|
|
99
|
+
_ref$accountant = _ref.accountant,
|
|
100
|
+
accountant = _ref$accountant === void 0 ? '' : _ref$accountant,
|
|
101
|
+
_ref$recorder = _ref.recorder,
|
|
102
|
+
recorder = _ref$recorder === void 0 ? '' : _ref$recorder,
|
|
103
|
+
_ref$maker = _ref.maker,
|
|
104
|
+
maker = _ref$maker === void 0 ? '邹瑜' : _ref$maker,
|
|
105
|
+
_ref$showTotal = _ref.showTotal,
|
|
106
|
+
showTotal = _ref$showTotal === void 0 ? false : _ref$showTotal,
|
|
107
|
+
_ref$totalDebit = _ref.totalDebit,
|
|
108
|
+
totalDebit = _ref$totalDebit === void 0 ? '0' : _ref$totalDebit,
|
|
109
|
+
_ref$totalCredit = _ref.totalCredit,
|
|
110
|
+
totalCredit = _ref$totalCredit === void 0 ? '0' : _ref$totalCredit;
|
|
111
|
+
var MIN_ROWS = 5; // 每页展示5行数据
|
|
112
|
+
var _useState = (0, _react.useState)(1),
|
|
113
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
114
|
+
currentPage = _useState2[0],
|
|
115
|
+
setCurrentPage = _useState2[1]; // 当前页
|
|
116
|
+
|
|
117
|
+
// 计算总页数
|
|
118
|
+
var totalPages = Math.max(Math.ceil(entries.length / MIN_ROWS), 1);
|
|
119
|
+
|
|
120
|
+
// 获取当前页的数据
|
|
121
|
+
var getPageData = function getPageData() {
|
|
122
|
+
var startIndex = (currentPage - 1) * MIN_ROWS;
|
|
123
|
+
var endIndex = Math.min(currentPage * MIN_ROWS, entries.length);
|
|
124
|
+
return entries.slice(startIndex, endIndex);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
// 生成空数据行(每个字段为空字符串)
|
|
128
|
+
var generateEmptyRows = function generateEmptyRows(num) {
|
|
129
|
+
return Array(num).fill({
|
|
130
|
+
summary: '',
|
|
131
|
+
account: '',
|
|
132
|
+
debit: '',
|
|
133
|
+
credit: ''
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// 获取当前页数据
|
|
138
|
+
var pageData = getPageData();
|
|
139
|
+
var emptyRowsNeeded = MIN_ROWS - pageData.length;
|
|
140
|
+
if (emptyRowsNeeded > 0) {
|
|
141
|
+
pageData = [].concat(_toConsumableArray(pageData), _toConsumableArray(generateEmptyRows(emptyRowsNeeded)));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// 是否是最后一页
|
|
145
|
+
var isLastPage = currentPage === totalPages;
|
|
146
|
+
|
|
147
|
+
// 格式化凭证号
|
|
148
|
+
var formattedVoucherNo = "".concat(voucherNo);
|
|
149
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
150
|
+
className: "voucher-wrapper",
|
|
151
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
152
|
+
className: "voucher-container",
|
|
153
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
154
|
+
className: "voucher-header",
|
|
155
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
|
|
156
|
+
children: "\u8BB0 \u8D26 \u51ED \u8BC1"
|
|
157
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
158
|
+
className: "header-line"
|
|
159
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
160
|
+
className: "date",
|
|
161
|
+
dangerouslySetInnerHTML: {
|
|
162
|
+
__html: date
|
|
163
|
+
}
|
|
164
|
+
})]
|
|
165
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
166
|
+
className: "company-info",
|
|
167
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
168
|
+
className: "company-name",
|
|
169
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
170
|
+
children: "\u516C\u53F8\uFF1A"
|
|
171
|
+
}), company]
|
|
172
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
173
|
+
className: "voucher-no",
|
|
174
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
175
|
+
children: "\u5B57\u7B2C"
|
|
176
|
+
}), " ", formattedVoucherNo, " ", /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
177
|
+
children: "\u53F7"
|
|
178
|
+
})]
|
|
179
|
+
})]
|
|
180
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
181
|
+
className: "voucher-table-wrapper",
|
|
182
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("table", {
|
|
183
|
+
className: "voucher-table",
|
|
184
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("thead", {
|
|
185
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
186
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
187
|
+
className: "summary",
|
|
188
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
189
|
+
children: "\u6458\u8981"
|
|
190
|
+
})
|
|
191
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
192
|
+
className: "subject",
|
|
193
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
194
|
+
children: "\u79D1\u76EE"
|
|
195
|
+
})
|
|
196
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
197
|
+
className: "checkmark"
|
|
198
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsxs)("th", {
|
|
199
|
+
className: "amount",
|
|
200
|
+
colSpan: 11,
|
|
201
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
202
|
+
className: "amount-header",
|
|
203
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
204
|
+
children: "\u501F\u65B9\u91D1\u989D"
|
|
205
|
+
})
|
|
206
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
207
|
+
className: "amount-grid",
|
|
208
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
209
|
+
children: "\u4EBF"
|
|
210
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
211
|
+
children: "\u5343"
|
|
212
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
213
|
+
children: "\u767E"
|
|
214
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
215
|
+
children: "\u5341"
|
|
216
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
217
|
+
children: "\u4E07"
|
|
218
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
219
|
+
children: "\u5343"
|
|
220
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
221
|
+
children: "\u767E"
|
|
222
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
223
|
+
children: "\u5341"
|
|
224
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
225
|
+
children: "\u5143"
|
|
226
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
227
|
+
children: "\u89D2"
|
|
228
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
229
|
+
children: "\u5206"
|
|
230
|
+
})]
|
|
231
|
+
})]
|
|
232
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("th", {
|
|
233
|
+
className: "checkmark"
|
|
234
|
+
}), " ", /*#__PURE__*/(0, _jsxRuntime.jsxs)("th", {
|
|
235
|
+
className: "amount",
|
|
236
|
+
colSpan: 11,
|
|
237
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
238
|
+
className: "amount-header",
|
|
239
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
240
|
+
children: "\u8D37\u65B9\u91D1\u989D"
|
|
241
|
+
})
|
|
242
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
243
|
+
className: "amount-grid",
|
|
244
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
245
|
+
children: "\u4EBF"
|
|
246
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
247
|
+
children: "\u5343"
|
|
248
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
249
|
+
children: "\u767E"
|
|
250
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
251
|
+
children: "\u5341"
|
|
252
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
253
|
+
children: "\u4E07"
|
|
254
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
255
|
+
children: "\u5343"
|
|
256
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
257
|
+
children: "\u767E"
|
|
258
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
259
|
+
children: "\u5341"
|
|
260
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
261
|
+
children: "\u5143"
|
|
262
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
263
|
+
children: "\u89D2"
|
|
264
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
265
|
+
children: "\u5206"
|
|
266
|
+
})]
|
|
267
|
+
})]
|
|
268
|
+
})]
|
|
269
|
+
})
|
|
270
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("tbody", {
|
|
271
|
+
children: [pageData.map(function (entry, index) {
|
|
272
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
273
|
+
className: entry.isTotal ? 'total-row' : '',
|
|
274
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
275
|
+
className: "summary",
|
|
276
|
+
style: {
|
|
277
|
+
textAlign: 'left',
|
|
278
|
+
fontFamily: '宋体'
|
|
279
|
+
},
|
|
280
|
+
children: entry.summary || ''
|
|
281
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
282
|
+
className: "subject",
|
|
283
|
+
style: {
|
|
284
|
+
textAlign: 'left',
|
|
285
|
+
fontFamily: '宋体'
|
|
286
|
+
},
|
|
287
|
+
children: entry.account || ''
|
|
288
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
289
|
+
className: "checkmark",
|
|
290
|
+
children: shouldShowAmount(entry, true) ? '✓' : ''
|
|
291
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
292
|
+
className: "amount",
|
|
293
|
+
colSpan: 11,
|
|
294
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
295
|
+
className: "money-grid",
|
|
296
|
+
children: shouldShowAmount(entry, true) ? formatAmount(entry.debit, entry.trade_direction, entry.amount).map(function (digit, i) {
|
|
297
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
298
|
+
className: "money-cell",
|
|
299
|
+
children: digit
|
|
300
|
+
}, i);
|
|
301
|
+
}) : Array(11).fill(' ').map(function (digit, i) {
|
|
302
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
303
|
+
className: "money-cell",
|
|
304
|
+
children: digit
|
|
305
|
+
}, i);
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
309
|
+
className: "checkmark",
|
|
310
|
+
children: shouldShowAmount(entry, false) ? '✓' : ''
|
|
311
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
312
|
+
className: "amount",
|
|
313
|
+
colSpan: 11,
|
|
314
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
315
|
+
className: "money-grid",
|
|
316
|
+
children: shouldShowAmount(entry, false) ? formatAmount(entry.credit, entry.trade_direction, entry.amount).map(function (digit, i) {
|
|
317
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
318
|
+
className: "money-cell",
|
|
319
|
+
children: digit
|
|
320
|
+
}, i);
|
|
321
|
+
}) : Array(11).fill(' ').map(function (digit, i) {
|
|
322
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
323
|
+
className: "money-cell",
|
|
324
|
+
children: digit
|
|
325
|
+
}, i);
|
|
326
|
+
})
|
|
327
|
+
})
|
|
328
|
+
})]
|
|
329
|
+
}, index);
|
|
330
|
+
}), showTotal && isLastPage && /*#__PURE__*/(0, _jsxRuntime.jsxs)("tr", {
|
|
331
|
+
className: "total-row",
|
|
332
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
333
|
+
className: "summary"
|
|
334
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
335
|
+
className: "subject"
|
|
336
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
337
|
+
className: "checkmark",
|
|
338
|
+
children: parseFloat(totalDebit) > 0 ? '✓' : ''
|
|
339
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
340
|
+
className: "amount",
|
|
341
|
+
colSpan: 11,
|
|
342
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
343
|
+
className: "money-grid",
|
|
344
|
+
children: formatAmount(totalDebit).map(function (digit, i) {
|
|
345
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
346
|
+
className: "money-cell",
|
|
347
|
+
children: digit
|
|
348
|
+
}, i);
|
|
349
|
+
})
|
|
350
|
+
})
|
|
351
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
352
|
+
className: "checkmark",
|
|
353
|
+
children: parseFloat(totalCredit) > 0 ? '✓' : ''
|
|
354
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
|
|
355
|
+
className: "amount",
|
|
356
|
+
colSpan: 11,
|
|
357
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
358
|
+
className: "money-grid",
|
|
359
|
+
children: formatAmount(totalCredit).map(function (digit, i) {
|
|
360
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
361
|
+
className: "money-cell",
|
|
362
|
+
children: digit
|
|
363
|
+
}, i);
|
|
364
|
+
})
|
|
365
|
+
})
|
|
366
|
+
})]
|
|
367
|
+
})]
|
|
368
|
+
})]
|
|
369
|
+
})
|
|
370
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
371
|
+
className: "voucher-footer",
|
|
372
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
373
|
+
className: "footer-item",
|
|
374
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
375
|
+
children: "\u4F1A\u8BA1\u4E3B\u7BA1\uFF1A"
|
|
376
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
377
|
+
children: accountant
|
|
378
|
+
})]
|
|
379
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
380
|
+
className: "footer-item",
|
|
381
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
382
|
+
children: "\u8BB0\u8D26\uFF1A"
|
|
383
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
384
|
+
children: recorder
|
|
385
|
+
})]
|
|
386
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
387
|
+
className: "footer-item",
|
|
388
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
389
|
+
children: "\u5236\u5355\uFF1A"
|
|
390
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
391
|
+
children: maker
|
|
392
|
+
})]
|
|
393
|
+
})]
|
|
394
|
+
})]
|
|
395
|
+
})
|
|
396
|
+
});
|
|
397
|
+
};
|
|
398
|
+
var _default = exports.default = AccountingVoucher;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
.voucher-wrapper {
|
|
2
|
+
background-color: #fffbf0;
|
|
3
|
+
color: #000;
|
|
4
|
+
width: 998px;
|
|
5
|
+
height: 560px;
|
|
6
|
+
display: flex;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.voucher-container {
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
max-height: 100%;
|
|
14
|
+
// margin: 0 auto;
|
|
15
|
+
// padding: -60px -60px;
|
|
16
|
+
background-color: #fffbf0;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.voucher-header {
|
|
21
|
+
text-align: center;
|
|
22
|
+
// margin-bottom: 20px;
|
|
23
|
+
|
|
24
|
+
h1 {
|
|
25
|
+
font-size: 24px;
|
|
26
|
+
margin: 0;
|
|
27
|
+
letter-spacing: 4px;
|
|
28
|
+
color: #8b4513;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.header-line {
|
|
32
|
+
height: 1px;
|
|
33
|
+
background-color: #8b4513;
|
|
34
|
+
margin: 8px auto;
|
|
35
|
+
width: 300px;
|
|
36
|
+
position: relative;
|
|
37
|
+
|
|
38
|
+
&::after {
|
|
39
|
+
content: '';
|
|
40
|
+
position: absolute;
|
|
41
|
+
top: 2px;
|
|
42
|
+
left: 0;
|
|
43
|
+
right: 0;
|
|
44
|
+
height: 1px;
|
|
45
|
+
background-color: #8b4513;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.date {
|
|
50
|
+
font-size: 16px;
|
|
51
|
+
margin-top: 10px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.company-info {
|
|
56
|
+
display: flex;
|
|
57
|
+
justify-content: space-between;
|
|
58
|
+
align-items: center;
|
|
59
|
+
margin-bottom: 10px;
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
|
|
62
|
+
.company-name {
|
|
63
|
+
span {
|
|
64
|
+
margin-right: 5px;
|
|
65
|
+
color: #8b4513;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.voucher-no {
|
|
70
|
+
margin-right: 20px;
|
|
71
|
+
|
|
72
|
+
span {
|
|
73
|
+
color: #8b4513;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.voucher-table-wrapper {
|
|
79
|
+
border: 1px solid #8b4513;
|
|
80
|
+
padding: 1px;
|
|
81
|
+
width: 890px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.voucher-table {
|
|
85
|
+
width: 100%;
|
|
86
|
+
border-collapse: collapse;
|
|
87
|
+
border: 1px solid #8b4513;
|
|
88
|
+
|
|
89
|
+
span {
|
|
90
|
+
color: #8b4513;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
tbody {
|
|
94
|
+
tr {
|
|
95
|
+
height: 20px; // 固定行高
|
|
96
|
+
|
|
97
|
+
&.total-row {
|
|
98
|
+
// background-color: #fff9e6;
|
|
99
|
+
|
|
100
|
+
.summary {
|
|
101
|
+
text-align: center;
|
|
102
|
+
color: #8b4513;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.money-cell {
|
|
106
|
+
color: #8b4513;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// 空行样式
|
|
112
|
+
tr:empty {
|
|
113
|
+
height: 20px;
|
|
114
|
+
border: 1px solid #8b4513;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
th,
|
|
119
|
+
td {
|
|
120
|
+
border: 1px solid #8b4513;
|
|
121
|
+
// padding: 6px;
|
|
122
|
+
text-align: center;
|
|
123
|
+
font-size: 14px;
|
|
124
|
+
height: 40px;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.checkmark {
|
|
128
|
+
width: 20px;
|
|
129
|
+
text-align: center;
|
|
130
|
+
border: 1px solid #8b4513;
|
|
131
|
+
color: #000;
|
|
132
|
+
font-weight: normal;
|
|
133
|
+
border-right: none; // 移除右侧边框与金额列融合
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// .amount {
|
|
137
|
+
// border-left: none; // 移除左侧边框与勾选框融合
|
|
138
|
+
// }
|
|
139
|
+
|
|
140
|
+
.summary {
|
|
141
|
+
width: 40%;
|
|
142
|
+
text-align: center;
|
|
143
|
+
// padding-left: 15px;
|
|
144
|
+
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.subject {
|
|
148
|
+
width: 45%;
|
|
149
|
+
text-align: center;
|
|
150
|
+
// padding-left: 15px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.amount {
|
|
154
|
+
width: 22.5%;
|
|
155
|
+
padding: 0;
|
|
156
|
+
|
|
157
|
+
.amount-header {
|
|
158
|
+
border-bottom: 1px solid #8b4513;
|
|
159
|
+
padding: 5px 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.amount-grid,
|
|
163
|
+
.money-grid {
|
|
164
|
+
display: grid;
|
|
165
|
+
grid-template-columns: repeat(11, 1fr);
|
|
166
|
+
|
|
167
|
+
.money-cell {
|
|
168
|
+
width: 100%;
|
|
169
|
+
height: 100%;
|
|
170
|
+
display: flex;
|
|
171
|
+
align-items: center;
|
|
172
|
+
justify-content: center;
|
|
173
|
+
border-right: 1px solid #8b4513;
|
|
174
|
+
|
|
175
|
+
&:last-child {
|
|
176
|
+
border-right: none;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
span {
|
|
181
|
+
// padding: 10px 0;
|
|
182
|
+
border-right: 1px solid #8b4513;
|
|
183
|
+
font-size: 12px;
|
|
184
|
+
height: 24px;
|
|
185
|
+
line-height: 24px;
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
|
|
190
|
+
&:last-child {
|
|
191
|
+
border-right: none;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.money-grid {
|
|
197
|
+
height: 100%;
|
|
198
|
+
|
|
199
|
+
.money-cell {
|
|
200
|
+
color: #000;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.total-row {
|
|
206
|
+
// background-color: #fff9e6;
|
|
207
|
+
|
|
208
|
+
.summary {
|
|
209
|
+
text-align: center;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.voucher-footer {
|
|
215
|
+
display: flex;
|
|
216
|
+
justify-content: space-between;
|
|
217
|
+
margin-top: 20px;
|
|
218
|
+
// padding: 0 20px;
|
|
219
|
+
font-size: 14px;
|
|
220
|
+
|
|
221
|
+
.footer-item {
|
|
222
|
+
span:first-child {
|
|
223
|
+
margin-right: 5px;
|
|
224
|
+
color: #8b4513;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
span:last-child {
|
|
228
|
+
margin-left: 10px;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface ExportModalProps {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
onConfirm: (type: 'pdf' | 'epub') => void;
|
|
7
|
+
themeColor?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const ExportModal: React.FC<ExportModalProps>;
|
|
10
|
+
export default ExportModal;
|