kts-component-invoice-operate 3.2.181-22 → 3.2.181-23
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/Invoice/ui/digtal/GoodsList/ui/BatchImportRows/index.d.ts +3 -0
- package/dist/Invoice/ui/digtal/ImportBatchGoodsDrawer/index.d.ts +3 -0
- package/dist/index.esm.js +58 -53
- package/dist/index.js +58 -53
- package/package.json +1 -1
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/index.tsx +4 -124
- package/src/Invoice/ui/digtal/GoodsList/index.tsx +4 -1
- package/src/Invoice/ui/digtal/GoodsList/ui/BatchImportRows/index.tsx +49 -0
- package/src/Invoice/ui/digtal/ImportBatchGoodsDrawer/icon/download.svg +1 -0
- package/src/Invoice/ui/digtal/ImportBatchGoodsDrawer/icon/gogo.svg +1 -0
- package/src/Invoice/ui/digtal/ImportBatchGoodsDrawer/icon/sigh.svg +1 -0
- package/src/Invoice/ui/digtal/ImportBatchGoodsDrawer/icon/upload.svg +1 -0
- package/src/Invoice/ui/digtal/ImportBatchGoodsDrawer/index.module.less +65 -0
- package/src/Invoice/ui/digtal/ImportBatchGoodsDrawer/index.tsx +69 -0
package/dist/index.esm.js
CHANGED
|
@@ -19870,6 +19870,61 @@ function _rollBottom$1() {
|
|
|
19870
19870
|
return _rollBottom$1.apply(this, arguments);
|
|
19871
19871
|
}
|
|
19872
19872
|
|
|
19873
|
+
var BatchImportRows$1 = (function () {
|
|
19874
|
+
var controller = Invoice.useInvoiceController();
|
|
19875
|
+
var model = controller.useMemo(function (s) {
|
|
19876
|
+
return s.model;
|
|
19877
|
+
}, []);
|
|
19878
|
+
var onClick = React.useCallback(function () {
|
|
19879
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
19880
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
19881
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
19882
|
+
while (1) {
|
|
19883
|
+
switch (_context.prev = _context.next) {
|
|
19884
|
+
case 0:
|
|
19885
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = true;
|
|
19886
|
+
|
|
19887
|
+
case 1:
|
|
19888
|
+
case "end":
|
|
19889
|
+
return _context.stop();
|
|
19890
|
+
}
|
|
19891
|
+
}
|
|
19892
|
+
}, _callee);
|
|
19893
|
+
}));
|
|
19894
|
+
|
|
19895
|
+
return function (_x) {
|
|
19896
|
+
return _ref.apply(this, arguments);
|
|
19897
|
+
};
|
|
19898
|
+
}())();
|
|
19899
|
+
}, [controller]);
|
|
19900
|
+
if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
19901
|
+
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
19902
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
19903
|
+
onClick: onClick
|
|
19904
|
+
}, "\u6279\u91CF\u5BFC\u5165");
|
|
19905
|
+
}); // /** 添加一个空货物 */
|
|
19906
|
+
// async function addGood(controller: InvoiceController) {
|
|
19907
|
+
// await controller.saveEditGood();
|
|
19908
|
+
// await controller.wait();
|
|
19909
|
+
// await controller.run(async (s) => {
|
|
19910
|
+
// if (s.goodsListState.editGood) {
|
|
19911
|
+
// message.error({
|
|
19912
|
+
// content: '你正在编辑一个货物',
|
|
19913
|
+
// key: '你正在编辑一个货物',
|
|
19914
|
+
// });
|
|
19915
|
+
// return;
|
|
19916
|
+
// }
|
|
19917
|
+
// s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
19918
|
+
// });
|
|
19919
|
+
// }
|
|
19920
|
+
// /** 货物列表,滚动到底部 */
|
|
19921
|
+
// async function rollBottom(controller: InvoiceController, rootElement: HTMLDivElement | null | undefined) {
|
|
19922
|
+
// await controller.wait();
|
|
19923
|
+
// const cont = rootElement?.querySelector('.ktsAntX-table-body');
|
|
19924
|
+
// if (!cont) return;
|
|
19925
|
+
// cont.scrollTop = cont.scrollHeight;
|
|
19926
|
+
// }
|
|
19927
|
+
|
|
19873
19928
|
/** 延迟函数 */
|
|
19874
19929
|
|
|
19875
19930
|
var lazyFn$1 = function lazyFn(fn) {
|
|
@@ -24868,7 +24923,7 @@ var Main$3 = decorator(Form.create())(function (props) {
|
|
|
24868
24923
|
}
|
|
24869
24924
|
}, /*#__PURE__*/React.createElement("div", {
|
|
24870
24925
|
className: "kts-invoice-operate-goods-list-able"
|
|
24871
|
-
}, /*#__PURE__*/React.createElement(AddRowButton$1, null), delRowButton.button, addDiscountRowButton.button, endowCodeButton.button, /*#__PURE__*/React.createElement(TaxIncludedSwitch$1, null), /*#__PURE__*/React.createElement(Search$1, null), /*#__PURE__*/React.createElement("div", {
|
|
24926
|
+
}, /*#__PURE__*/React.createElement(AddRowButton$1, null), /*#__PURE__*/React.createElement(BatchImportRows$1, null), delRowButton.button, addDiscountRowButton.button, endowCodeButton.button, /*#__PURE__*/React.createElement(TaxIncludedSwitch$1, null), /*#__PURE__*/React.createElement(Search$1, null), /*#__PURE__*/React.createElement("div", {
|
|
24872
24927
|
style: {
|
|
24873
24928
|
flex: 1
|
|
24874
24929
|
}
|
|
@@ -27288,57 +27343,7 @@ var ImportBatchGoodsDrawer = (function () {
|
|
|
27288
27343
|
|
|
27289
27344
|
if (controller.importdApplicationLines) {
|
|
27290
27345
|
controller.importdApplicationLines(e, type);
|
|
27291
|
-
}
|
|
27292
|
-
// let data;
|
|
27293
|
-
// if (type === 'txt') {
|
|
27294
|
-
// data = await billingApplicationTxtImport(e);
|
|
27295
|
-
// } else {
|
|
27296
|
-
// data = await billingApplicationDataImport(e);
|
|
27297
|
-
// }
|
|
27298
|
-
// await controllerApplicationData?.getInvoiceApplication();
|
|
27299
|
-
// let onDownload
|
|
27300
|
-
// if (type === 'xls') {
|
|
27301
|
-
// onDownload = async () => {
|
|
27302
|
-
// await billingApplicationDownloadExcelResult({ fileId: data.errorExcelPath })
|
|
27303
|
-
// }
|
|
27304
|
-
// } else {
|
|
27305
|
-
// onDownload = async () => {
|
|
27306
|
-
// await billingApplicationTxtDownload({ fileId: data.errorExcelPath })
|
|
27307
|
-
// }
|
|
27308
|
-
// }
|
|
27309
|
-
// if (data.failSize === 0) {
|
|
27310
|
-
// Modal.success({
|
|
27311
|
-
// title: '完成导入',
|
|
27312
|
-
// okText: '确定',
|
|
27313
|
-
// content: (
|
|
27314
|
-
// <div>
|
|
27315
|
-
// 模版发票数量
|
|
27316
|
-
// <span className={styles.size} >{data.totalSize}</span>
|
|
27317
|
-
// 条,导入成功
|
|
27318
|
-
// <span className={styles.size} >{data.totalSize}</span>
|
|
27319
|
-
// 条
|
|
27320
|
-
// </div>
|
|
27321
|
-
// ),
|
|
27322
|
-
// });
|
|
27323
|
-
// } else {
|
|
27324
|
-
// Modal.confirm({
|
|
27325
|
-
// title: '导入结果',
|
|
27326
|
-
// okText: '下载失败结果',
|
|
27327
|
-
// cancelText: '关闭',
|
|
27328
|
-
// onOk: onDownload,
|
|
27329
|
-
// content: (
|
|
27330
|
-
// <div>
|
|
27331
|
-
// 模版发票数量
|
|
27332
|
-
// <span className={styles.size} >{data.totalSize}</span>条,导入成功
|
|
27333
|
-
// <span className={styles.size} >{data.totalSize - data.failSize}</span>条,导入失败
|
|
27334
|
-
// <span className={styles.size} >{data.failSize}</span>条!<br />
|
|
27335
|
-
// 您可以下载失败结果调整后重新导入。
|
|
27336
|
-
// </div>
|
|
27337
|
-
// ),
|
|
27338
|
-
// });
|
|
27339
|
-
// }
|
|
27340
|
-
// })
|
|
27341
|
-
|
|
27346
|
+
}
|
|
27342
27347
|
|
|
27343
27348
|
return _context2.abrupt("return", false);
|
|
27344
27349
|
|
|
@@ -27362,7 +27367,7 @@ var ImportBatchGoodsDrawer = (function () {
|
|
|
27362
27367
|
};
|
|
27363
27368
|
|
|
27364
27369
|
return /*#__PURE__*/React.createElement(Drawer$2, {
|
|
27365
|
-
title: "\u6279\u91CF\u5BFC\u5165
|
|
27370
|
+
title: "\u6279\u91CF\u5BFC\u5165",
|
|
27366
27371
|
placement: "right",
|
|
27367
27372
|
// closable={false}
|
|
27368
27373
|
destroyOnClose: true,
|
package/dist/index.js
CHANGED
|
@@ -19880,6 +19880,61 @@ function _rollBottom$1() {
|
|
|
19880
19880
|
return _rollBottom$1.apply(this, arguments);
|
|
19881
19881
|
}
|
|
19882
19882
|
|
|
19883
|
+
var BatchImportRows$1 = (function () {
|
|
19884
|
+
var controller = Invoice.useInvoiceController();
|
|
19885
|
+
var model = controller.useMemo(function (s) {
|
|
19886
|
+
return s.model;
|
|
19887
|
+
}, []);
|
|
19888
|
+
var onClick = React__default['default'].useCallback(function () {
|
|
19889
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
19890
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
19891
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
19892
|
+
while (1) {
|
|
19893
|
+
switch (_context.prev = _context.next) {
|
|
19894
|
+
case 0:
|
|
19895
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = true;
|
|
19896
|
+
|
|
19897
|
+
case 1:
|
|
19898
|
+
case "end":
|
|
19899
|
+
return _context.stop();
|
|
19900
|
+
}
|
|
19901
|
+
}
|
|
19902
|
+
}, _callee);
|
|
19903
|
+
}));
|
|
19904
|
+
|
|
19905
|
+
return function (_x) {
|
|
19906
|
+
return _ref.apply(this, arguments);
|
|
19907
|
+
};
|
|
19908
|
+
}())();
|
|
19909
|
+
}, [controller]);
|
|
19910
|
+
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
19911
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
19912
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
19913
|
+
onClick: onClick
|
|
19914
|
+
}, "\u6279\u91CF\u5BFC\u5165");
|
|
19915
|
+
}); // /** 添加一个空货物 */
|
|
19916
|
+
// async function addGood(controller: InvoiceController) {
|
|
19917
|
+
// await controller.saveEditGood();
|
|
19918
|
+
// await controller.wait();
|
|
19919
|
+
// await controller.run(async (s) => {
|
|
19920
|
+
// if (s.goodsListState.editGood) {
|
|
19921
|
+
// message.error({
|
|
19922
|
+
// content: '你正在编辑一个货物',
|
|
19923
|
+
// key: '你正在编辑一个货物',
|
|
19924
|
+
// });
|
|
19925
|
+
// return;
|
|
19926
|
+
// }
|
|
19927
|
+
// s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
19928
|
+
// });
|
|
19929
|
+
// }
|
|
19930
|
+
// /** 货物列表,滚动到底部 */
|
|
19931
|
+
// async function rollBottom(controller: InvoiceController, rootElement: HTMLDivElement | null | undefined) {
|
|
19932
|
+
// await controller.wait();
|
|
19933
|
+
// const cont = rootElement?.querySelector('.ktsAntX-table-body');
|
|
19934
|
+
// if (!cont) return;
|
|
19935
|
+
// cont.scrollTop = cont.scrollHeight;
|
|
19936
|
+
// }
|
|
19937
|
+
|
|
19883
19938
|
/** 延迟函数 */
|
|
19884
19939
|
|
|
19885
19940
|
var lazyFn$1 = function lazyFn(fn) {
|
|
@@ -24878,7 +24933,7 @@ var Main$3 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
24878
24933
|
}
|
|
24879
24934
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24880
24935
|
className: "kts-invoice-operate-goods-list-able"
|
|
24881
|
-
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton$1, null), delRowButton.button, addDiscountRowButton.button, endowCodeButton.button, /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch$1, null), /*#__PURE__*/React__default['default'].createElement(Search$1, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24936
|
+
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton$1, null), /*#__PURE__*/React__default['default'].createElement(BatchImportRows$1, null), delRowButton.button, addDiscountRowButton.button, endowCodeButton.button, /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch$1, null), /*#__PURE__*/React__default['default'].createElement(Search$1, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
24882
24937
|
style: {
|
|
24883
24938
|
flex: 1
|
|
24884
24939
|
}
|
|
@@ -27298,57 +27353,7 @@ var ImportBatchGoodsDrawer = (function () {
|
|
|
27298
27353
|
|
|
27299
27354
|
if (controller.importdApplicationLines) {
|
|
27300
27355
|
controller.importdApplicationLines(e, type);
|
|
27301
|
-
}
|
|
27302
|
-
// let data;
|
|
27303
|
-
// if (type === 'txt') {
|
|
27304
|
-
// data = await billingApplicationTxtImport(e);
|
|
27305
|
-
// } else {
|
|
27306
|
-
// data = await billingApplicationDataImport(e);
|
|
27307
|
-
// }
|
|
27308
|
-
// await controllerApplicationData?.getInvoiceApplication();
|
|
27309
|
-
// let onDownload
|
|
27310
|
-
// if (type === 'xls') {
|
|
27311
|
-
// onDownload = async () => {
|
|
27312
|
-
// await billingApplicationDownloadExcelResult({ fileId: data.errorExcelPath })
|
|
27313
|
-
// }
|
|
27314
|
-
// } else {
|
|
27315
|
-
// onDownload = async () => {
|
|
27316
|
-
// await billingApplicationTxtDownload({ fileId: data.errorExcelPath })
|
|
27317
|
-
// }
|
|
27318
|
-
// }
|
|
27319
|
-
// if (data.failSize === 0) {
|
|
27320
|
-
// Modal.success({
|
|
27321
|
-
// title: '完成导入',
|
|
27322
|
-
// okText: '确定',
|
|
27323
|
-
// content: (
|
|
27324
|
-
// <div>
|
|
27325
|
-
// 模版发票数量
|
|
27326
|
-
// <span className={styles.size} >{data.totalSize}</span>
|
|
27327
|
-
// 条,导入成功
|
|
27328
|
-
// <span className={styles.size} >{data.totalSize}</span>
|
|
27329
|
-
// 条
|
|
27330
|
-
// </div>
|
|
27331
|
-
// ),
|
|
27332
|
-
// });
|
|
27333
|
-
// } else {
|
|
27334
|
-
// Modal.confirm({
|
|
27335
|
-
// title: '导入结果',
|
|
27336
|
-
// okText: '下载失败结果',
|
|
27337
|
-
// cancelText: '关闭',
|
|
27338
|
-
// onOk: onDownload,
|
|
27339
|
-
// content: (
|
|
27340
|
-
// <div>
|
|
27341
|
-
// 模版发票数量
|
|
27342
|
-
// <span className={styles.size} >{data.totalSize}</span>条,导入成功
|
|
27343
|
-
// <span className={styles.size} >{data.totalSize - data.failSize}</span>条,导入失败
|
|
27344
|
-
// <span className={styles.size} >{data.failSize}</span>条!<br />
|
|
27345
|
-
// 您可以下载失败结果调整后重新导入。
|
|
27346
|
-
// </div>
|
|
27347
|
-
// ),
|
|
27348
|
-
// });
|
|
27349
|
-
// }
|
|
27350
|
-
// })
|
|
27351
|
-
|
|
27356
|
+
}
|
|
27352
27357
|
|
|
27353
27358
|
return _context2.abrupt("return", false);
|
|
27354
27359
|
|
|
@@ -27372,7 +27377,7 @@ var ImportBatchGoodsDrawer = (function () {
|
|
|
27372
27377
|
};
|
|
27373
27378
|
|
|
27374
27379
|
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Drawer, {
|
|
27375
|
-
title: "\u6279\u91CF\u5BFC\u5165
|
|
27380
|
+
title: "\u6279\u91CF\u5BFC\u5165",
|
|
27376
27381
|
placement: "right",
|
|
27377
27382
|
// closable={false}
|
|
27378
27383
|
destroyOnClose: true,
|
package/package.json
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Drawer, Table, Upload, Modal } from 'kts-components-antd-x4';
|
|
3
3
|
import { RcFile } from 'kts-components-antd-x4/lib/upload';
|
|
4
|
-
import Invoice from '../../..';
|
|
5
|
-
import { updateUnitPriceExcludingTax, updateUnitPriceTax, dutyFree, format15 } from '../GoodsList/hook/useColumns/autoFillFn';
|
|
6
|
-
import { countAmountIncludeTax } from '../../../tools/calculate'
|
|
7
|
-
import { IGood } from '../../../InvoiceController';
|
|
8
|
-
import evaluate from '../../../tools/evaluate';
|
|
4
|
+
import Invoice from '../../..';
|
|
9
5
|
import Icon from '@ant-design/icons';
|
|
10
6
|
import { ReactComponent as DownloadSvg } from './icon/download.svg';
|
|
11
7
|
import { ReactComponent as UploadSvg } from './icon/upload.svg';
|
|
@@ -23,60 +19,7 @@ export default () => {
|
|
|
23
19
|
const beforeUpload = React.useCallback(async (e: RcFile, type: string = 'xls') => {
|
|
24
20
|
if (controller.importdApplicationLines) {
|
|
25
21
|
controller.importdApplicationLines(e, type);
|
|
26
|
-
}
|
|
27
|
-
// await startMantle(async () => {
|
|
28
|
-
// let data;
|
|
29
|
-
// if (type === 'txt') {
|
|
30
|
-
// data = await billingApplicationTxtImport(e);
|
|
31
|
-
// } else {
|
|
32
|
-
// data = await billingApplicationDataImport(e);
|
|
33
|
-
// }
|
|
34
|
-
// await controllerApplicationData?.getInvoiceApplication();
|
|
35
|
-
|
|
36
|
-
// let onDownload
|
|
37
|
-
// if (type === 'xls') {
|
|
38
|
-
// onDownload = async () => {
|
|
39
|
-
// await billingApplicationDownloadExcelResult({ fileId: data.errorExcelPath })
|
|
40
|
-
// }
|
|
41
|
-
// } else {
|
|
42
|
-
// onDownload = async () => {
|
|
43
|
-
// await billingApplicationTxtDownload({ fileId: data.errorExcelPath })
|
|
44
|
-
// }
|
|
45
|
-
// }
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// if (data.failSize === 0) {
|
|
49
|
-
// Modal.success({
|
|
50
|
-
// title: '完成导入',
|
|
51
|
-
// okText: '确定',
|
|
52
|
-
// content: (
|
|
53
|
-
// <div>
|
|
54
|
-
// 模版发票数量
|
|
55
|
-
// <span className={styles.size} >{data.totalSize}</span>
|
|
56
|
-
// 条,导入成功
|
|
57
|
-
// <span className={styles.size} >{data.totalSize}</span>
|
|
58
|
-
// 条
|
|
59
|
-
// </div>
|
|
60
|
-
// ),
|
|
61
|
-
// });
|
|
62
|
-
// } else {
|
|
63
|
-
// Modal.confirm({
|
|
64
|
-
// title: '导入结果',
|
|
65
|
-
// okText: '下载失败结果',
|
|
66
|
-
// cancelText: '关闭',
|
|
67
|
-
// onOk: onDownload,
|
|
68
|
-
// content: (
|
|
69
|
-
// <div>
|
|
70
|
-
// 模版发票数量
|
|
71
|
-
// <span className={styles.size} >{data.totalSize}</span>条,导入成功
|
|
72
|
-
// <span className={styles.size} >{data.totalSize - data.failSize}</span>条,导入失败
|
|
73
|
-
// <span className={styles.size} >{data.failSize}</span>条!<br />
|
|
74
|
-
// 您可以下载失败结果调整后重新导入。
|
|
75
|
-
// </div>
|
|
76
|
-
// ),
|
|
77
|
-
// });
|
|
78
|
-
// }
|
|
79
|
-
// })
|
|
22
|
+
}
|
|
80
23
|
return false;
|
|
81
24
|
}, [controller])
|
|
82
25
|
|
|
@@ -87,7 +30,7 @@ export default () => {
|
|
|
87
30
|
}
|
|
88
31
|
return (
|
|
89
32
|
<Drawer
|
|
90
|
-
title="
|
|
33
|
+
title="批量导入"
|
|
91
34
|
placement="right"
|
|
92
35
|
// closable={false}
|
|
93
36
|
destroyOnClose={true}
|
|
@@ -123,67 +66,4 @@ export default () => {
|
|
|
123
66
|
</div >
|
|
124
67
|
</Drawer>
|
|
125
68
|
);
|
|
126
|
-
};
|
|
127
|
-
/** 项目名称 */
|
|
128
|
-
// const getItemName = (record: any) => {
|
|
129
|
-
// return record.shorthand
|
|
130
|
-
// ? `*${record.shorthand}*${record.itemName}`
|
|
131
|
-
// : record.itemName;
|
|
132
|
-
// };
|
|
133
|
-
|
|
134
|
-
/** 货物单价,不含税 */
|
|
135
|
-
const getPriceExcludeTax = (s: IGood, record: any, calculatingDigits?: number) => {
|
|
136
|
-
if ((!s.taxRate && s.taxRate !== 0) || (!record.priceIncludeTax && record.priceIncludeTax !== 0)) return;
|
|
137
|
-
|
|
138
|
-
// 单价(含税)/(1+税率) = 单价(不含税)
|
|
139
|
-
return format15(evaluate(`${record.priceIncludeTax} / (1+${s.taxRate}/100)`), calculatingDigits);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// 获取我方名称
|
|
143
|
-
const getItemName = (record: any, editGood: IGood) => {
|
|
144
|
-
|
|
145
|
-
// let shorthand;
|
|
146
|
-
|
|
147
|
-
// shorthand = record.shorthand;
|
|
148
|
-
// if (shorthand) {
|
|
149
|
-
// return `*${shorthand}*${record.itemName}`;
|
|
150
|
-
// }
|
|
151
|
-
|
|
152
|
-
// shorthand = getSN(editGood.itemName)?.shorthand;
|
|
153
|
-
// if (shorthand) {
|
|
154
|
-
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
155
|
-
// }
|
|
156
|
-
|
|
157
|
-
return record.itemName;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// 获取他方名称
|
|
161
|
-
const getItemNameOther = (record: any, editGood: IGood) => {
|
|
162
|
-
// if (!editGood.itemName) return editGood.itemName;
|
|
163
|
-
|
|
164
|
-
// let shorthand;
|
|
165
|
-
|
|
166
|
-
// shorthand = record.shorthand;
|
|
167
|
-
// if (shorthand) {
|
|
168
|
-
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
169
|
-
// }
|
|
170
|
-
return record.itemName;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
// 获取商品编号
|
|
174
|
-
const getItemCode = (record: any, editGood: IGood) => {
|
|
175
|
-
|
|
176
|
-
// let shorthand;
|
|
177
|
-
|
|
178
|
-
// shorthand = record.shorthand;
|
|
179
|
-
// if (shorthand) {
|
|
180
|
-
// return `*${shorthand}*${record.itemName}`;
|
|
181
|
-
// }
|
|
182
|
-
|
|
183
|
-
// shorthand = getSN(editGood.itemName)?.shorthand;
|
|
184
|
-
// if (shorthand) {
|
|
185
|
-
// return `*${shorthand}*${record.itemNameSelf}`;
|
|
186
|
-
// }
|
|
187
|
-
|
|
188
|
-
return record.productCode;
|
|
189
|
-
}
|
|
69
|
+
};
|
|
@@ -10,6 +10,7 @@ import Invoice from '../../..';
|
|
|
10
10
|
import TableVirtual from './ui/TableVirtual';
|
|
11
11
|
import Statistics from './ui/Statistics';
|
|
12
12
|
import AddRowButton from './ui/AddRowButton';
|
|
13
|
+
import BatchImportRows from './ui/BatchImportRows';
|
|
13
14
|
import TaxIncludedSwitch from './ui/TaxIncludedSwitch';
|
|
14
15
|
import Search from './ui/Search';
|
|
15
16
|
import TableRow from './ui/TableRow';
|
|
@@ -44,7 +45,7 @@ export interface IGoodsListProps {
|
|
|
44
45
|
isSwitchTax?: boolean;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
export default class GoodsList extends React.Component<IGoodsListProps>{
|
|
48
|
+
export default class GoodsList extends React.Component<IGoodsListProps> {
|
|
48
49
|
render() {
|
|
49
50
|
return <Main {...this.props} />
|
|
50
51
|
}
|
|
@@ -127,6 +128,8 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
127
128
|
{/* 添加行 */}
|
|
128
129
|
<AddRowButton />
|
|
129
130
|
|
|
131
|
+
<BatchImportRows />
|
|
132
|
+
|
|
130
133
|
{/* 批量删除 */}
|
|
131
134
|
{delRowButton.button}
|
|
132
135
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Invoice from '../../../../..';
|
|
3
|
+
import { Button } from 'kts-components-antd-x3';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
const controller = Invoice.useInvoiceController();
|
|
7
|
+
|
|
8
|
+
const model = controller.useMemo(s => s.model, []);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
const onClick = React.useCallback(() => {
|
|
12
|
+
controller.pipeline(async (s) => {
|
|
13
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = true
|
|
14
|
+
})();
|
|
15
|
+
}, [controller]);
|
|
16
|
+
|
|
17
|
+
if (model === 'prefab') return <></>;
|
|
18
|
+
if (model === 'readOnly') return <></>;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Button onClick={onClick}>
|
|
22
|
+
批量导入
|
|
23
|
+
</Button>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// /** 添加一个空货物 */
|
|
28
|
+
// async function addGood(controller: InvoiceController) {
|
|
29
|
+
// await controller.saveEditGood();
|
|
30
|
+
// await controller.wait();
|
|
31
|
+
// await controller.run(async (s) => {
|
|
32
|
+
// if (s.goodsListState.editGood) {
|
|
33
|
+
// message.error({
|
|
34
|
+
// content: '你正在编辑一个货物',
|
|
35
|
+
// key: '你正在编辑一个货物',
|
|
36
|
+
// });
|
|
37
|
+
// return;
|
|
38
|
+
// }
|
|
39
|
+
// s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
40
|
+
// });
|
|
41
|
+
// }
|
|
42
|
+
|
|
43
|
+
// /** 货物列表,滚动到底部 */
|
|
44
|
+
// async function rollBottom(controller: InvoiceController, rootElement: HTMLDivElement | null | undefined) {
|
|
45
|
+
// await controller.wait();
|
|
46
|
+
// const cont = rootElement?.querySelector('.ktsAntX-table-body');
|
|
47
|
+
// if (!cont) return;
|
|
48
|
+
// cont.scrollTop = cont.scrollHeight;
|
|
49
|
+
// }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg t="1670833534624" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8020" width="200" height="200"><path d="M748.51214222 770.64874667h-70.48760889v-45.43829334h70.48760889c109.51793778 0 198.64689778-89.12896 198.64689778-198.64689778 0-106.60522667-83.30353778-193.98656-189.90876445-198.64689777l-16.31118222-0.58254223-4.66033778-15.72864c-30.87473778-110.10048-132.81962667-187.57859555-247.58044444-187.57859555-140.97521778 0-256.31857778 114.76081778-256.90112 255.15349333v16.89372445l-16.89372444 4.66033777c-69.90506667 19.80643555-118.25607111 83.88608-118.25607112 156.12131556 0 89.71150222 72.81777778 162.52928 162.52928 162.52928h82.13845334v45.43829334H259.17667555c-114.76081778 0-207.96757333-93.20675555-207.96757333-207.96757334 0-46.02083555 14.56355555-89.71150222 43.10812445-126.41166222 23.88423111-30.87473778 55.92405333-54.75896889 92.62421333-68.15744 4.66033778-73.98286222 35.53507555-143.30538667 88.54641778-196.31672889 57.08913778-56.50659555 132.81962667-87.96387555 213.21045333-87.96387555 67.57489778 0 131.072 21.55406222 184.08334222 62.33201777 47.18592 36.11761778 83.30353778 86.79879111 102.52743112 142.72284445 56.50659555 6.40796445 109.51793778 32.03982222 149.13080888 73.40032 43.69066667 45.43829333 68.15744 105.44014222 68.15744 168.93724444 0 65.24472889-25.63185778 126.41166222-71.65269333 172.43249778-46.02083555 47.18592-107.18776889 72.81777778-172.43249778 72.81777778z" p-id="8021"></path><path d="M539.96202667 785.21230222H494.52373333V479.37763555h45.43829334v305.83466667z" p-id="8022"></path><path d="M600.54641778 704.82147555l31.45728 32.62236445-118.83861333 115.34336-111.26556445-115.92590222 32.62236445-31.45728 79.80828444 83.30353777 86.21624889-83.88608z" p-id="8023"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg t="1670918138605" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13021" width="200" height="200"><path d="M512 2.4697363c-280.24164503 0-509.5302637 229.28861867-509.5302637 509.5302637s229.28861867 509.5302637 509.5302637 509.5302637 509.5302637-229.28861867 509.5302637-509.5302637-229.28861867-509.5302637-509.5302637-509.5302637m0 955.05855525c-248.55134815 0-445.52829155-197.59832178-445.52829155-446.14966992S263.44865185 65.85033008 512 65.85033008 957.52829155 263.44865185 957.52829155 512 760.55134815 957.52829155 512 957.52829155" p-id="13022"></path><path d="M308.80927289 462.91110875l213.75415941 213.7541594-42.87510755 42.87510755L266.5555437 505.7862163l42.25372919-42.87510755z" p-id="13023"></path><path d="M738.80310518 372.18986667l42.87510757 42.87510755-298.88299616 298.88299615-42.87510756-42.87510755 298.88299615-298.88299615z" p-id="13024"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg t="1672126518948" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10130" width="200" height="200"><path d="M512 75.09333333c59.16444445 0 116.50844445 11.83288889 170.21155555 34.58844445 51.88266667 21.84533333 98.304 53.70311111 139.264 93.75288889s71.90755555 86.47111111 93.7528889 139.264c22.75555555 53.70311111 34.58844445 111.04711111 34.58844444 170.21155555s-11.83288889 116.50844445-34.58844444 170.21155556c-21.84533333 51.88266667-53.70311111 98.304-93.7528889 139.264s-87.38133333 71.90755555-139.264 93.75288889c-53.70311111 22.75555555-111.04711111 34.58844445-170.21155555 34.58844444s-116.50844445-11.83288889-170.21155555-34.58844444c-51.88266667-21.84533333-99.21422222-53.70311111-139.264-93.75288889s-71.90755555-87.38133333-93.7528889-139.264C86.92622222 628.50844445 75.09333333 571.16444445 75.09333333 512s11.83288889-116.50844445 34.58844445-170.21155555c21.84533333-51.88266667 53.70311111-98.304 93.75288889-139.264s86.47111111-71.90755555 139.264-93.7528889A442.368 442.368 0 0 1 512 75.09333333m0-72.81777778C230.74133333 2.27555555 2.27555555 230.74133333 2.27555555 512s228.46577778 509.72444445 509.72444445 509.72444445 509.72444445-228.46577778 509.72444445-509.72444445S793.25866667 2.27555555 512 2.27555555z" p-id="10131"></path><path d="M511.08977778 766.86222222m-45.51111111 0a45.51111111 45.51111111 0 1 0 91.02222222 0 45.51111111 45.51111111 0 1 0-91.02222222 0Z" p-id="10132"></path><path d="M511.08977778 211.62666667c-25.48622222 0-45.51111111 20.02488889-45.51111111 45.51111111v364.08888889c0 25.48622222 20.02488889 45.51111111 45.51111111 45.51111111s45.51111111-20.02488889 45.51111111-45.51111111V257.13777778c0-25.48622222-20.02488889-45.51111111-45.51111111-45.51111111z" p-id="10133"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg t="1670833567548" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8168" width="200" height="200"><path d="M748.43022222 770.38933333h-70.42844444v-45.51111111h70.42844444c109.568 0 198.656-89.088 198.656-198.656 0-106.60977778-83.39911111-193.76355555-189.78133333-198.42844444l-16.49777778-0.68266667-4.43733333-15.81511111c-30.94755555-110.36444445-132.77866667-187.50577778-247.58044445-187.50577778-140.85688889 0-256.11377778 114.57422222-257.13777778 255.31733333l-0.11377777 17.06666667-16.49777778 4.66488889c-69.632 19.68355555-118.21511111 83.968-118.21511111 156.33066667 0 89.54311111 72.93155555 162.47466667 162.47466666 162.47466667h82.37511112v45.5111111H259.41333333c-114.688 0-207.98577778-93.29777778-207.98577778-207.98577777 0-46.19377778 14.79111111-89.99822222 42.89422223-126.52088889 23.77955555-30.94755555 56.09244445-54.72711111 92.38755555-68.38044444 4.43733333-74.18311111 35.61244445-143.24622222 88.74666667-196.03911112 57.11644445-56.66133333 132.77866667-87.95022222 213.33333333-87.95022222 67.35644445 0 131.072 21.61777778 184.32 62.57777778 47.33155555 36.40888889 83.17155555 86.58488889 102.28622222 142.79111111 56.77511111 6.25777778 109.22666667 32.08533333 149.16266667 73.61422222 43.80444445 45.62488889 67.92533333 105.69955555 67.92533333 168.96 0 65.19466667-25.37244445 126.52088889-71.45244444 172.60088889-46.08 46.19377778-107.40622222 71.56622222-172.60088889 71.56622222z" p-id="8169"></path><path d="M494.36444445 546.816h45.5111111v306.06222222h-45.5111111z" p-id="8170"></path><path d="M433.60711111 627.37066667l-31.63022222-32.65422222 118.89777778-115.48444445 111.38844444 116.05333333-32.768 31.51644445-79.75822222-83.05777778z" p-id="8171"></path></svg>
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.excel {
|
|
2
|
+
|
|
3
|
+
display : flex;
|
|
4
|
+
text-align : center;
|
|
5
|
+
padding-top: 20px;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
justify-content: space-around;
|
|
8
|
+
|
|
9
|
+
.right,
|
|
10
|
+
.left {
|
|
11
|
+
// flex : 1;
|
|
12
|
+
cursor : pointer;
|
|
13
|
+
border : 1px solid #fff;
|
|
14
|
+
padding-top: 20px;
|
|
15
|
+
|
|
16
|
+
&:hover {
|
|
17
|
+
border: 1px solid #0074ff;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.upload,
|
|
22
|
+
.download {
|
|
23
|
+
p {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
:global {
|
|
28
|
+
.anticon {
|
|
29
|
+
font-size: 72px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&>div {
|
|
34
|
+
display : inline-block;
|
|
35
|
+
background : #f8f8f8;
|
|
36
|
+
padding : 40px;
|
|
37
|
+
border-radius: 9999px;
|
|
38
|
+
margin-bottom: 20px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.modal {
|
|
44
|
+
label {
|
|
45
|
+
text-align : center;
|
|
46
|
+
display : block;
|
|
47
|
+
font-weight : bold;
|
|
48
|
+
font-size : 16px;
|
|
49
|
+
margin-bottom: 20px;
|
|
50
|
+
|
|
51
|
+
:global {
|
|
52
|
+
.anticon {
|
|
53
|
+
color : #117fff;
|
|
54
|
+
font-size : 22px;
|
|
55
|
+
margin-right: 10px;
|
|
56
|
+
position : relative;
|
|
57
|
+
top : 3px;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.size{
|
|
63
|
+
color: #0074ff;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Drawer, Table, Upload, Modal } from 'kts-components-antd-x4';
|
|
3
|
+
import { RcFile } from 'kts-components-antd-x4/lib/upload';
|
|
4
|
+
import Invoice from '../../..';
|
|
5
|
+
import Icon from '@ant-design/icons';
|
|
6
|
+
import { ReactComponent as DownloadSvg } from './icon/download.svg';
|
|
7
|
+
import { ReactComponent as UploadSvg } from './icon/upload.svg';
|
|
8
|
+
import styles from './index.module.less';
|
|
9
|
+
|
|
10
|
+
export default () => {
|
|
11
|
+
const controller = Invoice.useInvoiceController();
|
|
12
|
+
|
|
13
|
+
const visible = controller.useMemo(s => s.goodsListState.importGoods.isVisibleBatchImportDrawer, []);
|
|
14
|
+
|
|
15
|
+
const onClose = React.useCallback(() => {
|
|
16
|
+
controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleBatchImportDrawer = false })();
|
|
17
|
+
}, [controller]);
|
|
18
|
+
|
|
19
|
+
const beforeUpload = React.useCallback(async (e: RcFile, type: string = 'xls') => {
|
|
20
|
+
if (controller.importInvoiceLines) {
|
|
21
|
+
controller.importInvoiceLines(e, type);
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}, [controller])
|
|
25
|
+
|
|
26
|
+
const downloadInvoiceTempalte = () => {
|
|
27
|
+
if (controller.downloadInvoiceTempalte) {
|
|
28
|
+
controller.downloadInvoiceTempalte();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return (
|
|
32
|
+
<Drawer
|
|
33
|
+
title="批量导入"
|
|
34
|
+
placement="right"
|
|
35
|
+
// closable={false}
|
|
36
|
+
destroyOnClose={true}
|
|
37
|
+
width={500}
|
|
38
|
+
onClose={onClose}
|
|
39
|
+
visible={visible}
|
|
40
|
+
>
|
|
41
|
+
<div className={styles.excel} >
|
|
42
|
+
<div className={styles.left} >
|
|
43
|
+
<div className={styles.download} onClick={downloadInvoiceTempalte} >
|
|
44
|
+
<div>
|
|
45
|
+
<Icon component={DownloadSvg} />
|
|
46
|
+
</div>
|
|
47
|
+
<p style={{ fontWeight: 'bold' }} >Excel 模板下载</p>
|
|
48
|
+
<p>点击图标下载模板</p>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<div className={styles.right} >
|
|
52
|
+
<Upload
|
|
53
|
+
showUploadList={false}
|
|
54
|
+
beforeUpload={(e) => { beforeUpload(e, 'xls') }}
|
|
55
|
+
accept=".xlsx,.xls"
|
|
56
|
+
>
|
|
57
|
+
<div className={styles.upload} >
|
|
58
|
+
<div>
|
|
59
|
+
<Icon component={UploadSvg} />
|
|
60
|
+
</div>
|
|
61
|
+
<p style={{ fontWeight: 'bold' }} >Excel 上传</p>
|
|
62
|
+
<p>点击图标上传Excel文件</p>
|
|
63
|
+
</div>
|
|
64
|
+
</Upload>
|
|
65
|
+
</div>
|
|
66
|
+
</div >
|
|
67
|
+
</Drawer>
|
|
68
|
+
);
|
|
69
|
+
};
|