kts-component-invoice-operate 3.2.181-20 → 3.2.181-22
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/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods/index.d.ts +1 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +2 -0
- package/dist/Invoice/InvoiceController/index.d.ts +8 -0
- package/dist/Invoice/ui/default/GoodsList/ui/BatchImportRows/index.d.ts +3 -0
- package/dist/Invoice/ui/default/ImportBatchGoodsDrawer/index.d.ts +3 -0
- package/dist/index.esm.js +270 -7
- package/dist/index.js +269 -6
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ImportGoods/index.ts +1 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +2 -1
- package/src/Invoice/InvoiceController/index.ts +13 -1
- package/src/Invoice/index.tsx +3 -3
- package/src/Invoice/ui/default/GoodsList/index.tsx +2 -1
- package/src/Invoice/ui/default/GoodsList/ui/BatchImportRows/index.tsx +50 -0
- package/src/Invoice/ui/default/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +3 -3
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/icon/download.svg +1 -0
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/icon/gogo.svg +1 -0
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/icon/sigh.svg +1 -0
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/icon/upload.svg +1 -0
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/index.module.less +65 -0
- package/src/Invoice/ui/default/ImportBatchGoodsDrawer/index.tsx +189 -0
|
@@ -55,4 +55,12 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
55
55
|
/** 商品列表配置器 */
|
|
56
56
|
setColumnsConfig?: (columns: any[]) => any[];
|
|
57
57
|
addProductionByTax?: (params: any) => Promise<any>;
|
|
58
|
+
/** 下载申请单明细模版 */
|
|
59
|
+
downloadApplicationTempalte?: () => Promise<any>;
|
|
60
|
+
/** 上传申请单明细 */
|
|
61
|
+
importdApplicationLines?: (e: any, type: string) => Promise<any>;
|
|
62
|
+
/** 下载发票明细模版 */
|
|
63
|
+
downloadInvoiceTempalte?: () => Promise<any>;
|
|
64
|
+
/** 上传发票明细 */
|
|
65
|
+
importInvoiceLines?: (e: any, type: string) => Promise<any>;
|
|
58
66
|
}
|
package/dist/index.esm.js
CHANGED
|
@@ -8,7 +8,7 @@ import { message as message$1, TableManual, Switch, AutoComplete as AutoComplete
|
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import { Table } from 'kts-components-antd-x4-v4';
|
|
10
10
|
import { render } from 'react-dom';
|
|
11
|
-
import { DatePicker, Row as Row$1, Col as Col$1, Cascader, Input as Input$2, Select as Select$2 } from 'kts-components-antd-x4';
|
|
11
|
+
import { DatePicker, Row as Row$1, Col as Col$1, Cascader, Input as Input$2, Select as Select$2, Drawer as Drawer$2, Upload } from 'kts-components-antd-x4';
|
|
12
12
|
import { Input as Input$3, NumberPicker } from '@formily/antd-components';
|
|
13
13
|
import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
|
|
14
14
|
|
|
@@ -1004,6 +1004,8 @@ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
|
|
|
1004
1004
|
return _ref.apply(this, arguments);
|
|
1005
1005
|
};
|
|
1006
1006
|
}();
|
|
1007
|
+
|
|
1008
|
+
this.isVisibleBatchImportDrawer = false;
|
|
1007
1009
|
});
|
|
1008
1010
|
|
|
1009
1011
|
var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
|
|
@@ -1121,6 +1123,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1121
1123
|
this.isAddDiscount = void 0;
|
|
1122
1124
|
this.isAddRow = true;
|
|
1123
1125
|
this.isRemRow = true;
|
|
1126
|
+
this.isBatchRemRow = true;
|
|
1124
1127
|
this.isTaxIncluded = true;
|
|
1125
1128
|
this.calculateType = '3';
|
|
1126
1129
|
this.isMyShow = false;
|
|
@@ -10084,6 +10087,10 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
|
|
|
10084
10087
|
_this.getGoodsTaxRateList = void 0;
|
|
10085
10088
|
_this.setColumnsConfig = void 0;
|
|
10086
10089
|
_this.addProductionByTax = void 0;
|
|
10090
|
+
_this.downloadApplicationTempalte = void 0;
|
|
10091
|
+
_this.importdApplicationLines = void 0;
|
|
10092
|
+
_this.downloadInvoiceTempalte = void 0;
|
|
10093
|
+
_this.importInvoiceLines = void 0;
|
|
10087
10094
|
return _this;
|
|
10088
10095
|
} // ----------------- 发票头 模块相关 -----------------
|
|
10089
10096
|
|
|
@@ -10839,6 +10846,61 @@ function _rollBottom() {
|
|
|
10839
10846
|
return _rollBottom.apply(this, arguments);
|
|
10840
10847
|
}
|
|
10841
10848
|
|
|
10849
|
+
var BatchImportRows = (function () {
|
|
10850
|
+
var controller = Invoice.useInvoiceController();
|
|
10851
|
+
var model = controller.useMemo(function (s) {
|
|
10852
|
+
return s.model;
|
|
10853
|
+
}, []);
|
|
10854
|
+
var onClick = React.useCallback(function () {
|
|
10855
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
10856
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10857
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10858
|
+
while (1) {
|
|
10859
|
+
switch (_context.prev = _context.next) {
|
|
10860
|
+
case 0:
|
|
10861
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = true;
|
|
10862
|
+
|
|
10863
|
+
case 1:
|
|
10864
|
+
case "end":
|
|
10865
|
+
return _context.stop();
|
|
10866
|
+
}
|
|
10867
|
+
}
|
|
10868
|
+
}, _callee);
|
|
10869
|
+
}));
|
|
10870
|
+
|
|
10871
|
+
return function (_x) {
|
|
10872
|
+
return _ref.apply(this, arguments);
|
|
10873
|
+
};
|
|
10874
|
+
}())();
|
|
10875
|
+
}, [controller]);
|
|
10876
|
+
if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
10877
|
+
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
10878
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
10879
|
+
onClick: onClick
|
|
10880
|
+
}, "\u6279\u91CF\u5BFC\u5165");
|
|
10881
|
+
}); // /** 添加一个空货物 */
|
|
10882
|
+
// async function addGood(controller: InvoiceController) {
|
|
10883
|
+
// await controller.saveEditGood();
|
|
10884
|
+
// await controller.wait();
|
|
10885
|
+
// await controller.run(async (s) => {
|
|
10886
|
+
// if (s.goodsListState.editGood) {
|
|
10887
|
+
// message.error({
|
|
10888
|
+
// content: '你正在编辑一个货物',
|
|
10889
|
+
// key: '你正在编辑一个货物',
|
|
10890
|
+
// });
|
|
10891
|
+
// return;
|
|
10892
|
+
// }
|
|
10893
|
+
// s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
10894
|
+
// });
|
|
10895
|
+
// }
|
|
10896
|
+
// /** 货物列表,滚动到底部 */
|
|
10897
|
+
// async function rollBottom(controller: InvoiceController, rootElement: HTMLDivElement | null | undefined) {
|
|
10898
|
+
// await controller.wait();
|
|
10899
|
+
// const cont = rootElement?.querySelector('.ktsAntX-table-body');
|
|
10900
|
+
// if (!cont) return;
|
|
10901
|
+
// cont.scrollTop = cont.scrollHeight;
|
|
10902
|
+
// }
|
|
10903
|
+
|
|
10842
10904
|
var TaxIncludedSwitch = (function () {
|
|
10843
10905
|
var controller = Invoice.useInvoiceController();
|
|
10844
10906
|
/** 是否含税 */
|
|
@@ -15373,6 +15435,9 @@ var useDelRowButton = (function () {
|
|
|
15373
15435
|
var isRemRow = controller.useMemo(function (s) {
|
|
15374
15436
|
return s.goodsListState.isRemRow;
|
|
15375
15437
|
}, []);
|
|
15438
|
+
var isBatchRemRow = controller.useMemo(function (s) {
|
|
15439
|
+
return s.goodsListState.isBatchRemRow;
|
|
15440
|
+
}, []);
|
|
15376
15441
|
/** 是否禁用 */
|
|
15377
15442
|
|
|
15378
15443
|
var disabled = controller.useMemo(function (s) {
|
|
@@ -15429,6 +15494,7 @@ var useDelRowButton = (function () {
|
|
|
15429
15494
|
}, " \u5220\u9664\u884C ");
|
|
15430
15495
|
}, [model, onClick, disabled]);
|
|
15431
15496
|
var button = React.useMemo(function () {
|
|
15497
|
+
if (isBatchRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
15432
15498
|
if (isRemRow === false) return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
15433
15499
|
if (model === 'prefab') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
15434
15500
|
if (model === 'readOnly') return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
@@ -15436,7 +15502,7 @@ var useDelRowButton = (function () {
|
|
|
15436
15502
|
onClick: onClick,
|
|
15437
15503
|
disabled: disabled
|
|
15438
15504
|
}, "\u6279\u91CF\u5220\u9664");
|
|
15439
|
-
}, [model, onClick, disabled, isRemRow]);
|
|
15505
|
+
}, [model, onClick, disabled, isRemRow, isBatchRemRow]);
|
|
15440
15506
|
return {
|
|
15441
15507
|
button: button,
|
|
15442
15508
|
menuItem: menuItem
|
|
@@ -17110,7 +17176,7 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
17110
17176
|
className: "kts-invoice-operate-goods-list-able"
|
|
17111
17177
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17112
17178
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
17113
|
-
}, /*#__PURE__*/React.createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, addDiscountRowButton.button, mergeDetails.button, mergeDiscount.button, salesDiscount.button, salesGifts.button, /*#__PURE__*/React.createElement(Search, null)), /*#__PURE__*/React.createElement("div", {
|
|
17179
|
+
}, /*#__PURE__*/React.createElement(AddRowButton, null), /*#__PURE__*/React.createElement(BatchImportRows, null), endowCodeButton.button, delRowButton.button, addDiscountRowButton.button, mergeDetails.button, mergeDiscount.button, salesDiscount.button, salesGifts.button, /*#__PURE__*/React.createElement(Search, null)), /*#__PURE__*/React.createElement("div", {
|
|
17114
17180
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
17115
17181
|
}, props.menuExpansion, /*#__PURE__*/React.createElement(DescribeSwitch, null), /*#__PURE__*/React.createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React.createElement("div", {
|
|
17116
17182
|
className: classnames('kts-invoice-operate-goods-list-table', {
|
|
@@ -27138,9 +27204,206 @@ var getItemCode = function getItemCode(record, editGood) {
|
|
|
27138
27204
|
return record.productCode;
|
|
27139
27205
|
};
|
|
27140
27206
|
|
|
27141
|
-
var
|
|
27207
|
+
var _path$a, _path2$1, _path3$1;
|
|
27208
|
+
|
|
27209
|
+
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
|
|
27210
|
+
|
|
27211
|
+
function SvgDownload(props) {
|
|
27212
|
+
return /*#__PURE__*/createElement("svg", _extends$e({
|
|
27213
|
+
className: "download_svg__icon",
|
|
27214
|
+
viewBox: "0 0 1024 1024",
|
|
27215
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27216
|
+
width: 200,
|
|
27217
|
+
height: 200
|
|
27218
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/createElement("path", {
|
|
27219
|
+
d: "M748.512 770.649h-70.487V725.21h70.487c109.518 0 198.647-89.129 198.647-198.646 0-106.606-83.303-193.987-189.909-198.647l-16.31-.583-4.661-15.729c-30.875-110.1-132.82-187.578-247.58-187.578-140.976 0-256.32 114.76-256.902 255.153v16.894l-16.894 4.66c-69.905 19.807-118.256 83.887-118.256 156.122 0 89.711 72.818 162.529 162.53 162.529h82.138v45.438h-82.138c-114.761 0-207.968-93.206-207.968-207.967 0-46.021 14.564-89.712 43.108-126.412 23.884-30.875 55.924-54.759 92.624-68.157 4.66-73.983 35.536-143.306 88.547-196.317 57.089-56.507 132.82-87.964 213.21-87.964 67.575 0 131.072 21.554 184.084 62.332 47.186 36.118 83.303 86.799 102.527 142.723 56.507 6.408 109.518 32.04 149.13 73.4 43.692 45.439 68.158 105.44 68.158 168.937 0 65.245-25.632 126.412-71.652 172.433-46.021 47.186-107.188 72.818-172.433 72.818z"
|
|
27220
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/createElement("path", {
|
|
27221
|
+
d: "M539.962 785.212h-45.438V479.378h45.438v305.834z"
|
|
27222
|
+
})), _path3$1 || (_path3$1 = /*#__PURE__*/createElement("path", {
|
|
27223
|
+
d: "M600.546 704.821l31.458 32.623-118.839 115.343L401.9 736.861l32.622-31.457 79.808 83.304 86.216-83.887z"
|
|
27224
|
+
})));
|
|
27225
|
+
}
|
|
27226
|
+
|
|
27227
|
+
var _path$b, _path2$2, _path3$2;
|
|
27228
|
+
|
|
27229
|
+
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
|
|
27230
|
+
|
|
27231
|
+
function SvgUpload(props) {
|
|
27232
|
+
return /*#__PURE__*/createElement("svg", _extends$f({
|
|
27233
|
+
className: "upload_svg__icon",
|
|
27234
|
+
viewBox: "0 0 1024 1024",
|
|
27235
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27236
|
+
width: 200,
|
|
27237
|
+
height: 200
|
|
27238
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/createElement("path", {
|
|
27239
|
+
d: "M748.43 770.39h-70.428v-45.512h70.428c109.568 0 198.656-89.088 198.656-198.656 0-106.61-83.399-193.763-189.781-198.428l-16.498-.683-4.437-15.815C705.422 200.932 603.59 123.79 488.79 123.79c-140.858 0-256.114 114.574-257.138 255.318l-.114 17.066-16.498 4.665c-69.632 19.684-118.215 83.968-118.215 156.33 0 89.544 72.931 162.475 162.475 162.475h82.375v45.512h-82.262c-114.688 0-207.985-93.298-207.985-207.986 0-46.194 14.79-89.998 42.894-126.521 23.78-30.948 56.092-54.727 92.387-68.38 4.438-74.184 35.613-143.247 88.747-196.04 57.116-56.661 132.779-87.95 213.333-87.95 67.357 0 131.072 21.618 184.32 62.578 47.332 36.409 83.172 86.585 102.287 142.791 56.775 6.258 109.226 32.085 149.162 73.614 43.805 45.625 67.926 105.7 67.926 168.96 0 65.195-25.373 126.521-71.453 172.601-46.08 46.194-107.406 71.566-172.6 71.566z"
|
|
27240
|
+
})), _path2$2 || (_path2$2 = /*#__PURE__*/createElement("path", {
|
|
27241
|
+
d: "M494.364 546.816h45.512v306.062h-45.512z"
|
|
27242
|
+
})), _path3$2 || (_path3$2 = /*#__PURE__*/createElement("path", {
|
|
27243
|
+
d: "M433.607 627.37l-31.63-32.654 118.898-115.484 111.388 116.053-32.768 31.517-79.758-83.058z"
|
|
27244
|
+
})));
|
|
27245
|
+
}
|
|
27246
|
+
|
|
27247
|
+
var css_248z$w = ".index-module_excel__1eBoo {\n display: flex;\n text-align: center;\n padding-top: 20px;\n flex-wrap: wrap;\n justify-content: space-around;\n}\n.index-module_excel__1eBoo .index-module_right__JewuO,\n.index-module_excel__1eBoo .index-module_left__3MZ4C {\n cursor: pointer;\n border: 1px solid #fff;\n padding-top: 20px;\n}\n.index-module_excel__1eBoo .index-module_right__JewuO:hover,\n.index-module_excel__1eBoo .index-module_left__3MZ4C:hover {\n border: 1px solid #0074ff;\n}\n.index-module_excel__1eBoo .index-module_upload__3jf1F p,\n.index-module_excel__1eBoo .index-module_download__1G-fp p {\n margin: 0;\n}\n.index-module_excel__1eBoo .index-module_upload__3jf1F .anticon,\n.index-module_excel__1eBoo .index-module_download__1G-fp .anticon {\n font-size: 72px;\n}\n.index-module_excel__1eBoo .index-module_upload__3jf1F > div,\n.index-module_excel__1eBoo .index-module_download__1G-fp > div {\n display: inline-block;\n background: #f8f8f8;\n padding: 40px;\n border-radius: 9999px;\n margin-bottom: 20px;\n}\n.index-module_modal__2dIaR label {\n text-align: center;\n display: block;\n font-weight: bold;\n font-size: 16px;\n margin-bottom: 20px;\n}\n.index-module_modal__2dIaR label .anticon {\n color: #117fff;\n font-size: 22px;\n margin-right: 10px;\n position: relative;\n top: 3px;\n}\n.index-module_modal__2dIaR .index-module_size__1HypC {\n color: #0074ff;\n}\n";
|
|
27248
|
+
var styles = {"excel":"index-module_excel__1eBoo","right":"index-module_right__JewuO","left":"index-module_left__3MZ4C","upload":"index-module_upload__3jf1F","download":"index-module_download__1G-fp","modal":"index-module_modal__2dIaR","size":"index-module_size__1HypC"};
|
|
27142
27249
|
styleInject(css_248z$w);
|
|
27143
27250
|
|
|
27251
|
+
var ImportBatchGoodsDrawer = (function () {
|
|
27252
|
+
var controller = Invoice.useInvoiceController();
|
|
27253
|
+
var visible = controller.useMemo(function (s) {
|
|
27254
|
+
return s.goodsListState.importGoods.isVisibleBatchImportDrawer;
|
|
27255
|
+
}, []);
|
|
27256
|
+
var onClose = React.useCallback(function () {
|
|
27257
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
27258
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
27259
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27260
|
+
while (1) {
|
|
27261
|
+
switch (_context.prev = _context.next) {
|
|
27262
|
+
case 0:
|
|
27263
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = false;
|
|
27264
|
+
|
|
27265
|
+
case 1:
|
|
27266
|
+
case "end":
|
|
27267
|
+
return _context.stop();
|
|
27268
|
+
}
|
|
27269
|
+
}
|
|
27270
|
+
}, _callee);
|
|
27271
|
+
}));
|
|
27272
|
+
|
|
27273
|
+
return function (_x) {
|
|
27274
|
+
return _ref.apply(this, arguments);
|
|
27275
|
+
};
|
|
27276
|
+
}())();
|
|
27277
|
+
}, [controller]);
|
|
27278
|
+
|
|
27279
|
+
var _beforeUpload = React.useCallback( /*#__PURE__*/function () {
|
|
27280
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
27281
|
+
var type,
|
|
27282
|
+
_args2 = arguments;
|
|
27283
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
27284
|
+
while (1) {
|
|
27285
|
+
switch (_context2.prev = _context2.next) {
|
|
27286
|
+
case 0:
|
|
27287
|
+
type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 'xls';
|
|
27288
|
+
|
|
27289
|
+
if (controller.importdApplicationLines) {
|
|
27290
|
+
controller.importdApplicationLines(e, type);
|
|
27291
|
+
} // await startMantle(async () => {
|
|
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
|
+
|
|
27342
|
+
|
|
27343
|
+
return _context2.abrupt("return", false);
|
|
27344
|
+
|
|
27345
|
+
case 3:
|
|
27346
|
+
case "end":
|
|
27347
|
+
return _context2.stop();
|
|
27348
|
+
}
|
|
27349
|
+
}
|
|
27350
|
+
}, _callee2);
|
|
27351
|
+
}));
|
|
27352
|
+
|
|
27353
|
+
return function (_x2) {
|
|
27354
|
+
return _ref2.apply(this, arguments);
|
|
27355
|
+
};
|
|
27356
|
+
}(), [controller]);
|
|
27357
|
+
|
|
27358
|
+
var downloadApplicationTempalte = function downloadApplicationTempalte() {
|
|
27359
|
+
if (controller.downloadApplicationTempalte) {
|
|
27360
|
+
controller.downloadApplicationTempalte();
|
|
27361
|
+
}
|
|
27362
|
+
};
|
|
27363
|
+
|
|
27364
|
+
return /*#__PURE__*/React.createElement(Drawer$2, {
|
|
27365
|
+
title: "\u6279\u91CF\u5BFC\u5165\u5546\u54C1",
|
|
27366
|
+
placement: "right",
|
|
27367
|
+
// closable={false}
|
|
27368
|
+
destroyOnClose: true,
|
|
27369
|
+
width: 500,
|
|
27370
|
+
onClose: onClose,
|
|
27371
|
+
visible: visible
|
|
27372
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27373
|
+
className: styles.excel
|
|
27374
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27375
|
+
className: styles.left
|
|
27376
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27377
|
+
className: styles.download,
|
|
27378
|
+
onClick: downloadApplicationTempalte
|
|
27379
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
|
|
27380
|
+
component: SvgDownload
|
|
27381
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
27382
|
+
style: {
|
|
27383
|
+
fontWeight: 'bold'
|
|
27384
|
+
}
|
|
27385
|
+
}, "Excel \u6A21\u677F\u4E0B\u8F7D"), /*#__PURE__*/React.createElement("p", null, "\u70B9\u51FB\u56FE\u6807\u4E0B\u8F7D\u6A21\u677F"))), /*#__PURE__*/React.createElement("div", {
|
|
27386
|
+
className: styles.right
|
|
27387
|
+
}, /*#__PURE__*/React.createElement(Upload, {
|
|
27388
|
+
showUploadList: false,
|
|
27389
|
+
beforeUpload: function beforeUpload(e) {
|
|
27390
|
+
_beforeUpload(e, 'xls');
|
|
27391
|
+
},
|
|
27392
|
+
accept: ".xlsx,.xls"
|
|
27393
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27394
|
+
className: styles.upload
|
|
27395
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Icon, {
|
|
27396
|
+
component: SvgUpload
|
|
27397
|
+
})), /*#__PURE__*/React.createElement("p", {
|
|
27398
|
+
style: {
|
|
27399
|
+
fontWeight: 'bold'
|
|
27400
|
+
}
|
|
27401
|
+
}, "Excel \u4E0A\u4F20"), /*#__PURE__*/React.createElement("p", null, "\u70B9\u51FB\u56FE\u6807\u4E0A\u4F20Excel\u6587\u4EF6"))))));
|
|
27402
|
+
});
|
|
27403
|
+
|
|
27404
|
+
var css_248z$x = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
|
|
27405
|
+
styleInject(css_248z$x);
|
|
27406
|
+
|
|
27144
27407
|
var TreeNode = Tree.TreeNode;
|
|
27145
27408
|
var confirm = Modal$1.confirm;
|
|
27146
27409
|
var EndowCodeDrawer = (function () {
|
|
@@ -28558,7 +28821,7 @@ var Main$5 = function Main(props) {
|
|
|
28558
28821
|
/** 销售方 */
|
|
28559
28822
|
, props.sign || /*#__PURE__*/React.createElement(Sign, null)
|
|
28560
28823
|
/** 落款 */
|
|
28561
|
-
, props.footExpand), /*#__PURE__*/React.createElement(ImportBuyerDrawer, null), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(AddComparisonDrawer, null));
|
|
28824
|
+
, props.footExpand), /*#__PURE__*/React.createElement(ImportBatchGoodsDrawer, null), " ", /*#__PURE__*/React.createElement(ImportBuyerDrawer, null), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null), /*#__PURE__*/React.createElement(AddComparisonDrawer, null));
|
|
28562
28825
|
};
|
|
28563
28826
|
/** 数电 */
|
|
28564
28827
|
|
|
@@ -28617,8 +28880,8 @@ var Digtal = function Digtal(props) {
|
|
|
28617
28880
|
), /*#__PURE__*/React.createElement(ImportGoodsDrawer, null), /*#__PURE__*/React.createElement(EndowCodeDrawer, null));
|
|
28618
28881
|
};
|
|
28619
28882
|
|
|
28620
|
-
var css_248z$
|
|
28621
|
-
styleInject(css_248z$
|
|
28883
|
+
var css_248z$y = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
|
|
28884
|
+
styleInject(css_248z$y);
|
|
28622
28885
|
|
|
28623
28886
|
function TaxClassificationModal(props) {
|
|
28624
28887
|
var _props$info6;
|
package/dist/index.js
CHANGED
|
@@ -1014,6 +1014,8 @@ var ImportGoods = /*#__PURE__*/_createClass(function ImportGoods() {
|
|
|
1014
1014
|
return _ref.apply(this, arguments);
|
|
1015
1015
|
};
|
|
1016
1016
|
}();
|
|
1017
|
+
|
|
1018
|
+
this.isVisibleBatchImportDrawer = false;
|
|
1017
1019
|
});
|
|
1018
1020
|
|
|
1019
1021
|
var EndowCode = /*#__PURE__*/_createClass(function EndowCode() {
|
|
@@ -1131,6 +1133,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1131
1133
|
this.isAddDiscount = void 0;
|
|
1132
1134
|
this.isAddRow = true;
|
|
1133
1135
|
this.isRemRow = true;
|
|
1136
|
+
this.isBatchRemRow = true;
|
|
1134
1137
|
this.isTaxIncluded = true;
|
|
1135
1138
|
this.calculateType = '3';
|
|
1136
1139
|
this.isMyShow = false;
|
|
@@ -10094,6 +10097,10 @@ var InvoiceController = /*#__PURE__*/function (_InvoiceControllerFor) {
|
|
|
10094
10097
|
_this.getGoodsTaxRateList = void 0;
|
|
10095
10098
|
_this.setColumnsConfig = void 0;
|
|
10096
10099
|
_this.addProductionByTax = void 0;
|
|
10100
|
+
_this.downloadApplicationTempalte = void 0;
|
|
10101
|
+
_this.importdApplicationLines = void 0;
|
|
10102
|
+
_this.downloadInvoiceTempalte = void 0;
|
|
10103
|
+
_this.importInvoiceLines = void 0;
|
|
10097
10104
|
return _this;
|
|
10098
10105
|
} // ----------------- 发票头 模块相关 -----------------
|
|
10099
10106
|
|
|
@@ -10849,6 +10856,61 @@ function _rollBottom() {
|
|
|
10849
10856
|
return _rollBottom.apply(this, arguments);
|
|
10850
10857
|
}
|
|
10851
10858
|
|
|
10859
|
+
var BatchImportRows = (function () {
|
|
10860
|
+
var controller = Invoice.useInvoiceController();
|
|
10861
|
+
var model = controller.useMemo(function (s) {
|
|
10862
|
+
return s.model;
|
|
10863
|
+
}, []);
|
|
10864
|
+
var onClick = React__default['default'].useCallback(function () {
|
|
10865
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
10866
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10867
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10868
|
+
while (1) {
|
|
10869
|
+
switch (_context.prev = _context.next) {
|
|
10870
|
+
case 0:
|
|
10871
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = true;
|
|
10872
|
+
|
|
10873
|
+
case 1:
|
|
10874
|
+
case "end":
|
|
10875
|
+
return _context.stop();
|
|
10876
|
+
}
|
|
10877
|
+
}
|
|
10878
|
+
}, _callee);
|
|
10879
|
+
}));
|
|
10880
|
+
|
|
10881
|
+
return function (_x) {
|
|
10882
|
+
return _ref.apply(this, arguments);
|
|
10883
|
+
};
|
|
10884
|
+
}())();
|
|
10885
|
+
}, [controller]);
|
|
10886
|
+
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10887
|
+
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10888
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10889
|
+
onClick: onClick
|
|
10890
|
+
}, "\u6279\u91CF\u5BFC\u5165");
|
|
10891
|
+
}); // /** 添加一个空货物 */
|
|
10892
|
+
// async function addGood(controller: InvoiceController) {
|
|
10893
|
+
// await controller.saveEditGood();
|
|
10894
|
+
// await controller.wait();
|
|
10895
|
+
// await controller.run(async (s) => {
|
|
10896
|
+
// if (s.goodsListState.editGood) {
|
|
10897
|
+
// message.error({
|
|
10898
|
+
// content: '你正在编辑一个货物',
|
|
10899
|
+
// key: '你正在编辑一个货物',
|
|
10900
|
+
// });
|
|
10901
|
+
// return;
|
|
10902
|
+
// }
|
|
10903
|
+
// s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
10904
|
+
// });
|
|
10905
|
+
// }
|
|
10906
|
+
// /** 货物列表,滚动到底部 */
|
|
10907
|
+
// async function rollBottom(controller: InvoiceController, rootElement: HTMLDivElement | null | undefined) {
|
|
10908
|
+
// await controller.wait();
|
|
10909
|
+
// const cont = rootElement?.querySelector('.ktsAntX-table-body');
|
|
10910
|
+
// if (!cont) return;
|
|
10911
|
+
// cont.scrollTop = cont.scrollHeight;
|
|
10912
|
+
// }
|
|
10913
|
+
|
|
10852
10914
|
var TaxIncludedSwitch = (function () {
|
|
10853
10915
|
var controller = Invoice.useInvoiceController();
|
|
10854
10916
|
/** 是否含税 */
|
|
@@ -15383,6 +15445,9 @@ var useDelRowButton = (function () {
|
|
|
15383
15445
|
var isRemRow = controller.useMemo(function (s) {
|
|
15384
15446
|
return s.goodsListState.isRemRow;
|
|
15385
15447
|
}, []);
|
|
15448
|
+
var isBatchRemRow = controller.useMemo(function (s) {
|
|
15449
|
+
return s.goodsListState.isBatchRemRow;
|
|
15450
|
+
}, []);
|
|
15386
15451
|
/** 是否禁用 */
|
|
15387
15452
|
|
|
15388
15453
|
var disabled = controller.useMemo(function (s) {
|
|
@@ -15439,6 +15504,7 @@ var useDelRowButton = (function () {
|
|
|
15439
15504
|
}, " \u5220\u9664\u884C ");
|
|
15440
15505
|
}, [model, onClick, disabled]);
|
|
15441
15506
|
var button = React__default['default'].useMemo(function () {
|
|
15507
|
+
if (isBatchRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
15442
15508
|
if (isRemRow === false) return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
15443
15509
|
if (model === 'prefab') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
15444
15510
|
if (model === 'readOnly') return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
@@ -15446,7 +15512,7 @@ var useDelRowButton = (function () {
|
|
|
15446
15512
|
onClick: onClick,
|
|
15447
15513
|
disabled: disabled
|
|
15448
15514
|
}, "\u6279\u91CF\u5220\u9664");
|
|
15449
|
-
}, [model, onClick, disabled, isRemRow]);
|
|
15515
|
+
}, [model, onClick, disabled, isRemRow, isBatchRemRow]);
|
|
15450
15516
|
return {
|
|
15451
15517
|
button: button,
|
|
15452
15518
|
menuItem: menuItem
|
|
@@ -17120,7 +17186,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
17120
17186
|
className: "kts-invoice-operate-goods-list-able"
|
|
17121
17187
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17122
17188
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
17123
|
-
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, addDiscountRowButton.button, mergeDetails.button, mergeDiscount.button, salesDiscount.button, salesGifts.button, /*#__PURE__*/React__default['default'].createElement(Search, null)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17189
|
+
}, /*#__PURE__*/React__default['default'].createElement(AddRowButton, null), /*#__PURE__*/React__default['default'].createElement(BatchImportRows, null), endowCodeButton.button, delRowButton.button, addDiscountRowButton.button, mergeDetails.button, mergeDiscount.button, salesDiscount.button, salesGifts.button, /*#__PURE__*/React__default['default'].createElement(Search, null)), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17124
17190
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
17125
17191
|
}, props.menuExpansion, /*#__PURE__*/React__default['default'].createElement(DescribeSwitch, null), /*#__PURE__*/React__default['default'].createElement(TaxIncludedSwitch, null))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17126
17192
|
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
@@ -27148,9 +27214,206 @@ var getItemCode = function getItemCode(record, editGood) {
|
|
|
27148
27214
|
return record.productCode;
|
|
27149
27215
|
};
|
|
27150
27216
|
|
|
27151
|
-
var
|
|
27217
|
+
var _path$a, _path2$1, _path3$1;
|
|
27218
|
+
|
|
27219
|
+
function _extends$e() { _extends$e = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
|
|
27220
|
+
|
|
27221
|
+
function SvgDownload(props) {
|
|
27222
|
+
return /*#__PURE__*/React.createElement("svg", _extends$e({
|
|
27223
|
+
className: "download_svg__icon",
|
|
27224
|
+
viewBox: "0 0 1024 1024",
|
|
27225
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27226
|
+
width: 200,
|
|
27227
|
+
height: 200
|
|
27228
|
+
}, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
|
|
27229
|
+
d: "M748.512 770.649h-70.487V725.21h70.487c109.518 0 198.647-89.129 198.647-198.646 0-106.606-83.303-193.987-189.909-198.647l-16.31-.583-4.661-15.729c-30.875-110.1-132.82-187.578-247.58-187.578-140.976 0-256.32 114.76-256.902 255.153v16.894l-16.894 4.66c-69.905 19.807-118.256 83.887-118.256 156.122 0 89.711 72.818 162.529 162.53 162.529h82.138v45.438h-82.138c-114.761 0-207.968-93.206-207.968-207.967 0-46.021 14.564-89.712 43.108-126.412 23.884-30.875 55.924-54.759 92.624-68.157 4.66-73.983 35.536-143.306 88.547-196.317 57.089-56.507 132.82-87.964 213.21-87.964 67.575 0 131.072 21.554 184.084 62.332 47.186 36.118 83.303 86.799 102.527 142.723 56.507 6.408 109.518 32.04 149.13 73.4 43.692 45.439 68.158 105.44 68.158 168.937 0 65.245-25.632 126.412-71.652 172.433-46.021 47.186-107.188 72.818-172.433 72.818z"
|
|
27230
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React.createElement("path", {
|
|
27231
|
+
d: "M539.962 785.212h-45.438V479.378h45.438v305.834z"
|
|
27232
|
+
})), _path3$1 || (_path3$1 = /*#__PURE__*/React.createElement("path", {
|
|
27233
|
+
d: "M600.546 704.821l31.458 32.623-118.839 115.343L401.9 736.861l32.622-31.457 79.808 83.304 86.216-83.887z"
|
|
27234
|
+
})));
|
|
27235
|
+
}
|
|
27236
|
+
|
|
27237
|
+
var _path$b, _path2$2, _path3$2;
|
|
27238
|
+
|
|
27239
|
+
function _extends$f() { _extends$f = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
|
|
27240
|
+
|
|
27241
|
+
function SvgUpload(props) {
|
|
27242
|
+
return /*#__PURE__*/React.createElement("svg", _extends$f({
|
|
27243
|
+
className: "upload_svg__icon",
|
|
27244
|
+
viewBox: "0 0 1024 1024",
|
|
27245
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
27246
|
+
width: 200,
|
|
27247
|
+
height: 200
|
|
27248
|
+
}, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
|
|
27249
|
+
d: "M748.43 770.39h-70.428v-45.512h70.428c109.568 0 198.656-89.088 198.656-198.656 0-106.61-83.399-193.763-189.781-198.428l-16.498-.683-4.437-15.815C705.422 200.932 603.59 123.79 488.79 123.79c-140.858 0-256.114 114.574-257.138 255.318l-.114 17.066-16.498 4.665c-69.632 19.684-118.215 83.968-118.215 156.33 0 89.544 72.931 162.475 162.475 162.475h82.375v45.512h-82.262c-114.688 0-207.985-93.298-207.985-207.986 0-46.194 14.79-89.998 42.894-126.521 23.78-30.948 56.092-54.727 92.387-68.38 4.438-74.184 35.613-143.247 88.747-196.04 57.116-56.661 132.779-87.95 213.333-87.95 67.357 0 131.072 21.618 184.32 62.578 47.332 36.409 83.172 86.585 102.287 142.791 56.775 6.258 109.226 32.085 149.162 73.614 43.805 45.625 67.926 105.7 67.926 168.96 0 65.195-25.373 126.521-71.453 172.601-46.08 46.194-107.406 71.566-172.6 71.566z"
|
|
27250
|
+
})), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
|
|
27251
|
+
d: "M494.364 546.816h45.512v306.062h-45.512z"
|
|
27252
|
+
})), _path3$2 || (_path3$2 = /*#__PURE__*/React.createElement("path", {
|
|
27253
|
+
d: "M433.607 627.37l-31.63-32.654 118.898-115.484 111.388 116.053-32.768 31.517-79.758-83.058z"
|
|
27254
|
+
})));
|
|
27255
|
+
}
|
|
27256
|
+
|
|
27257
|
+
var css_248z$w = ".index-module_excel__1eBoo {\n display: flex;\n text-align: center;\n padding-top: 20px;\n flex-wrap: wrap;\n justify-content: space-around;\n}\n.index-module_excel__1eBoo .index-module_right__JewuO,\n.index-module_excel__1eBoo .index-module_left__3MZ4C {\n cursor: pointer;\n border: 1px solid #fff;\n padding-top: 20px;\n}\n.index-module_excel__1eBoo .index-module_right__JewuO:hover,\n.index-module_excel__1eBoo .index-module_left__3MZ4C:hover {\n border: 1px solid #0074ff;\n}\n.index-module_excel__1eBoo .index-module_upload__3jf1F p,\n.index-module_excel__1eBoo .index-module_download__1G-fp p {\n margin: 0;\n}\n.index-module_excel__1eBoo .index-module_upload__3jf1F .anticon,\n.index-module_excel__1eBoo .index-module_download__1G-fp .anticon {\n font-size: 72px;\n}\n.index-module_excel__1eBoo .index-module_upload__3jf1F > div,\n.index-module_excel__1eBoo .index-module_download__1G-fp > div {\n display: inline-block;\n background: #f8f8f8;\n padding: 40px;\n border-radius: 9999px;\n margin-bottom: 20px;\n}\n.index-module_modal__2dIaR label {\n text-align: center;\n display: block;\n font-weight: bold;\n font-size: 16px;\n margin-bottom: 20px;\n}\n.index-module_modal__2dIaR label .anticon {\n color: #117fff;\n font-size: 22px;\n margin-right: 10px;\n position: relative;\n top: 3px;\n}\n.index-module_modal__2dIaR .index-module_size__1HypC {\n color: #0074ff;\n}\n";
|
|
27258
|
+
var styles = {"excel":"index-module_excel__1eBoo","right":"index-module_right__JewuO","left":"index-module_left__3MZ4C","upload":"index-module_upload__3jf1F","download":"index-module_download__1G-fp","modal":"index-module_modal__2dIaR","size":"index-module_size__1HypC"};
|
|
27152
27259
|
styleInject(css_248z$w);
|
|
27153
27260
|
|
|
27261
|
+
var ImportBatchGoodsDrawer = (function () {
|
|
27262
|
+
var controller = Invoice.useInvoiceController();
|
|
27263
|
+
var visible = controller.useMemo(function (s) {
|
|
27264
|
+
return s.goodsListState.importGoods.isVisibleBatchImportDrawer;
|
|
27265
|
+
}, []);
|
|
27266
|
+
var onClose = React__default['default'].useCallback(function () {
|
|
27267
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
27268
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
27269
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27270
|
+
while (1) {
|
|
27271
|
+
switch (_context.prev = _context.next) {
|
|
27272
|
+
case 0:
|
|
27273
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = false;
|
|
27274
|
+
|
|
27275
|
+
case 1:
|
|
27276
|
+
case "end":
|
|
27277
|
+
return _context.stop();
|
|
27278
|
+
}
|
|
27279
|
+
}
|
|
27280
|
+
}, _callee);
|
|
27281
|
+
}));
|
|
27282
|
+
|
|
27283
|
+
return function (_x) {
|
|
27284
|
+
return _ref.apply(this, arguments);
|
|
27285
|
+
};
|
|
27286
|
+
}())();
|
|
27287
|
+
}, [controller]);
|
|
27288
|
+
|
|
27289
|
+
var _beforeUpload = React__default['default'].useCallback( /*#__PURE__*/function () {
|
|
27290
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
27291
|
+
var type,
|
|
27292
|
+
_args2 = arguments;
|
|
27293
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
27294
|
+
while (1) {
|
|
27295
|
+
switch (_context2.prev = _context2.next) {
|
|
27296
|
+
case 0:
|
|
27297
|
+
type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 'xls';
|
|
27298
|
+
|
|
27299
|
+
if (controller.importdApplicationLines) {
|
|
27300
|
+
controller.importdApplicationLines(e, type);
|
|
27301
|
+
} // await startMantle(async () => {
|
|
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
|
+
|
|
27352
|
+
|
|
27353
|
+
return _context2.abrupt("return", false);
|
|
27354
|
+
|
|
27355
|
+
case 3:
|
|
27356
|
+
case "end":
|
|
27357
|
+
return _context2.stop();
|
|
27358
|
+
}
|
|
27359
|
+
}
|
|
27360
|
+
}, _callee2);
|
|
27361
|
+
}));
|
|
27362
|
+
|
|
27363
|
+
return function (_x2) {
|
|
27364
|
+
return _ref2.apply(this, arguments);
|
|
27365
|
+
};
|
|
27366
|
+
}(), [controller]);
|
|
27367
|
+
|
|
27368
|
+
var downloadApplicationTempalte = function downloadApplicationTempalte() {
|
|
27369
|
+
if (controller.downloadApplicationTempalte) {
|
|
27370
|
+
controller.downloadApplicationTempalte();
|
|
27371
|
+
}
|
|
27372
|
+
};
|
|
27373
|
+
|
|
27374
|
+
return /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Drawer, {
|
|
27375
|
+
title: "\u6279\u91CF\u5BFC\u5165\u5546\u54C1",
|
|
27376
|
+
placement: "right",
|
|
27377
|
+
// closable={false}
|
|
27378
|
+
destroyOnClose: true,
|
|
27379
|
+
width: 500,
|
|
27380
|
+
onClose: onClose,
|
|
27381
|
+
visible: visible
|
|
27382
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27383
|
+
className: styles.excel
|
|
27384
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27385
|
+
className: styles.left
|
|
27386
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27387
|
+
className: styles.download,
|
|
27388
|
+
onClick: downloadApplicationTempalte
|
|
27389
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Icon, {
|
|
27390
|
+
component: SvgDownload
|
|
27391
|
+
})), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
27392
|
+
style: {
|
|
27393
|
+
fontWeight: 'bold'
|
|
27394
|
+
}
|
|
27395
|
+
}, "Excel \u6A21\u677F\u4E0B\u8F7D"), /*#__PURE__*/React__default['default'].createElement("p", null, "\u70B9\u51FB\u56FE\u6807\u4E0B\u8F7D\u6A21\u677F"))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27396
|
+
className: styles.right
|
|
27397
|
+
}, /*#__PURE__*/React__default['default'].createElement(ktsComponentsAntdX4.Upload, {
|
|
27398
|
+
showUploadList: false,
|
|
27399
|
+
beforeUpload: function beforeUpload(e) {
|
|
27400
|
+
_beforeUpload(e, 'xls');
|
|
27401
|
+
},
|
|
27402
|
+
accept: ".xlsx,.xls"
|
|
27403
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
27404
|
+
className: styles.upload
|
|
27405
|
+
}, /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(Icon, {
|
|
27406
|
+
component: SvgUpload
|
|
27407
|
+
})), /*#__PURE__*/React__default['default'].createElement("p", {
|
|
27408
|
+
style: {
|
|
27409
|
+
fontWeight: 'bold'
|
|
27410
|
+
}
|
|
27411
|
+
}, "Excel \u4E0A\u4F20"), /*#__PURE__*/React__default['default'].createElement("p", null, "\u70B9\u51FB\u56FE\u6807\u4E0A\u4F20Excel\u6587\u4EF6"))))));
|
|
27412
|
+
});
|
|
27413
|
+
|
|
27414
|
+
var css_248z$x = ".kts-invoice-operate-goods-endow-code-button-list {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-endow-code-button-list > button {\n margin-bottom: 10px;\n}\n";
|
|
27415
|
+
styleInject(css_248z$x);
|
|
27416
|
+
|
|
27154
27417
|
var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
|
|
27155
27418
|
var confirm = ktsComponentsAntdX3.Modal.confirm;
|
|
27156
27419
|
var EndowCodeDrawer = (function () {
|
|
@@ -28568,7 +28831,7 @@ var Main$5 = function Main(props) {
|
|
|
28568
28831
|
/** 销售方 */
|
|
28569
28832
|
, props.sign || /*#__PURE__*/React__default['default'].createElement(Sign, null)
|
|
28570
28833
|
/** 落款 */
|
|
28571
|
-
, props.footExpand), /*#__PURE__*/React__default['default'].createElement(ImportBuyerDrawer, null), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null), /*#__PURE__*/React__default['default'].createElement(AddComparisonDrawer, null));
|
|
28834
|
+
, props.footExpand), /*#__PURE__*/React__default['default'].createElement(ImportBatchGoodsDrawer, null), " ", /*#__PURE__*/React__default['default'].createElement(ImportBuyerDrawer, null), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null), /*#__PURE__*/React__default['default'].createElement(AddComparisonDrawer, null));
|
|
28572
28835
|
};
|
|
28573
28836
|
/** 数电 */
|
|
28574
28837
|
|
|
@@ -28627,8 +28890,8 @@ var Digtal = function Digtal(props) {
|
|
|
28627
28890
|
), /*#__PURE__*/React__default['default'].createElement(ImportGoodsDrawer, null), /*#__PURE__*/React__default['default'].createElement(EndowCodeDrawer, null));
|
|
28628
28891
|
};
|
|
28629
28892
|
|
|
28630
|
-
var css_248z$
|
|
28631
|
-
styleInject(css_248z$
|
|
28893
|
+
var css_248z$y = ".taxdetailsbox {\n display: flex;\n justify-content: flex-start;\n flex-direction: row;\n}\n.taxdetailsbox .taxrightbox {\n width: 340px;\n position: absolute;\n right: 30px;\n top: 79px;\n bottom: 50px;\n min-height: 300px;\n}\n.taxdetailsbox .taxrightbox .taxdesc {\n height: calc(100vh - 323px);\n min-height: 105px;\n overflow: auto;\n}\n";
|
|
28894
|
+
styleInject(css_248z$y);
|
|
28632
28895
|
|
|
28633
28896
|
function TaxClassificationModal(props) {
|
|
28634
28897
|
var _props$info6;
|
package/package.json
CHANGED
|
@@ -104,5 +104,17 @@ export default class InvoiceController extends InvoiceControllerForm {
|
|
|
104
104
|
/** 商品列表配置器 */
|
|
105
105
|
setColumnsConfig?: (columns: any[]) => any[];
|
|
106
106
|
|
|
107
|
-
addProductionByTax?:
|
|
107
|
+
addProductionByTax?: (params: any) => Promise<any>;
|
|
108
|
+
|
|
109
|
+
/** 下载申请单明细模版 */
|
|
110
|
+
downloadApplicationTempalte?: () => Promise<any>;
|
|
111
|
+
|
|
112
|
+
/** 上传申请单明细 */
|
|
113
|
+
importdApplicationLines?: (e: any, type: string) => Promise<any>;
|
|
114
|
+
|
|
115
|
+
/** 下载发票明细模版 */
|
|
116
|
+
downloadInvoiceTempalte?: () => Promise<any>;
|
|
117
|
+
|
|
118
|
+
/** 上传发票明细 */
|
|
119
|
+
importInvoiceLines?: (e: any, type: string) => Promise<any>;
|
|
108
120
|
}
|
package/src/Invoice/index.tsx
CHANGED
|
@@ -24,6 +24,7 @@ import FreightList from './ui/digtal/FreightList';
|
|
|
24
24
|
|
|
25
25
|
import ImportBuyerDrawer from './ui/default/ImportBuyerDrawer';
|
|
26
26
|
import ImportGoodsDrawer from './ui/default/ImportGoodsDrawer';
|
|
27
|
+
import ImportBatchGoodsDrawer from './ui/default/ImportBatchGoodsDrawer';
|
|
27
28
|
import EndowCodeDrawer from './ui/default/EndowCodeDrawer';
|
|
28
29
|
import AddComparisonDrawer from './ui/default/AddComparisonDrawer';
|
|
29
30
|
// import { create, all } from 'mathjs';
|
|
@@ -144,7 +145,6 @@ const Main = (props: IInvoiceProps) => {
|
|
|
144
145
|
useToGenerateId(controller);
|
|
145
146
|
|
|
146
147
|
React.useEffect(() => { setKey(key + 1) }, [controller]);
|
|
147
|
-
|
|
148
148
|
return (
|
|
149
149
|
<InvoiceContext.Provider key={key} value={controller}>
|
|
150
150
|
|
|
@@ -156,7 +156,7 @@ const Main = (props: IInvoiceProps) => {
|
|
|
156
156
|
{props.sign || <Sign /> /** 落款 */}
|
|
157
157
|
{props.footExpand}
|
|
158
158
|
</div>
|
|
159
|
-
|
|
159
|
+
<ImportBatchGoodsDrawer /> {/** 批量导入商品 */}
|
|
160
160
|
<ImportBuyerDrawer />{/* 导入购买方的抽屉 */}
|
|
161
161
|
<ImportGoodsDrawer />{/* 导入货品的抽屉 */}
|
|
162
162
|
<EndowCodeDrawer />{/* 给货品赋码的抽屉 */}
|
|
@@ -187,7 +187,7 @@ const Digtal = (props: IInvoiceProps) => {
|
|
|
187
187
|
{props.specialInfor /** 特殊信息 */}
|
|
188
188
|
{props.sign || <SignDigtal /> /** 落款 */}
|
|
189
189
|
</div>
|
|
190
|
-
|
|
190
|
+
|
|
191
191
|
<ImportGoodsDrawer />{ /** 导入货品的抽屉 */}
|
|
192
192
|
<EndowCodeDrawer />{ /** 给货品赋码的抽屉 */}
|
|
193
193
|
</InvoiceContext.Provider>
|
|
@@ -9,6 +9,7 @@ import { FormComponentProps } from 'kts-components-antd-x3/lib/form';
|
|
|
9
9
|
import TableVirtual from './ui/TableVirtual';
|
|
10
10
|
import Statistics from './ui/Statistics';
|
|
11
11
|
import AddRowButton from './ui/AddRowButton';
|
|
12
|
+
import BatchImportRows from './ui/BatchImportRows';
|
|
12
13
|
import TaxIncludedSwitch from './ui/TaxIncludedSwitch';
|
|
13
14
|
import DescribeSwitch from './ui/DescribeSwitch';
|
|
14
15
|
import Search from './ui/Search';
|
|
@@ -137,7 +138,7 @@ const Main = decorator<IGoodsListProps, FormComponentProps & IGoodsListProps>(Fo
|
|
|
137
138
|
<div className="kts-invoice-operate-goods-list-able-list">
|
|
138
139
|
{/* 添加行 */}
|
|
139
140
|
<AddRowButton />
|
|
140
|
-
|
|
141
|
+
<BatchImportRows />
|
|
141
142
|
{/* 批量菜单 */}
|
|
142
143
|
{/* <BulkMenu /> */}
|
|
143
144
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Invoice from '../../../../..';
|
|
3
|
+
import { Button, message } from 'kts-components-antd-x3';
|
|
4
|
+
import InvoiceController, { LineAttributeType } from '../../../../../InvoiceController';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
const controller = Invoice.useInvoiceController();
|
|
8
|
+
|
|
9
|
+
const model = controller.useMemo(s => s.model, []);
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const onClick = React.useCallback(() => {
|
|
13
|
+
controller.pipeline(async (s) => {
|
|
14
|
+
s.goodsListState.importGoods.isVisibleBatchImportDrawer = true
|
|
15
|
+
})();
|
|
16
|
+
}, [controller]);
|
|
17
|
+
|
|
18
|
+
if (model === 'prefab') return <></>;
|
|
19
|
+
if (model === 'readOnly') return <></>;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Button onClick={onClick}>
|
|
23
|
+
批量导入
|
|
24
|
+
</Button>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// /** 添加一个空货物 */
|
|
29
|
+
// async function addGood(controller: InvoiceController) {
|
|
30
|
+
// await controller.saveEditGood();
|
|
31
|
+
// await controller.wait();
|
|
32
|
+
// await controller.run(async (s) => {
|
|
33
|
+
// if (s.goodsListState.editGood) {
|
|
34
|
+
// message.error({
|
|
35
|
+
// content: '你正在编辑一个货物',
|
|
36
|
+
// key: '你正在编辑一个货物',
|
|
37
|
+
// });
|
|
38
|
+
// return;
|
|
39
|
+
// }
|
|
40
|
+
// s.goodsListState.editGood = await controller.addGood({ taxRate: s.goodsListState.defaultRate, lineAttribute: LineAttributeType.正常 });
|
|
41
|
+
// });
|
|
42
|
+
// }
|
|
43
|
+
|
|
44
|
+
// /** 货物列表,滚动到底部 */
|
|
45
|
+
// async function rollBottom(controller: InvoiceController, rootElement: HTMLDivElement | null | undefined) {
|
|
46
|
+
// await controller.wait();
|
|
47
|
+
// const cont = rootElement?.querySelector('.ktsAntX-table-body');
|
|
48
|
+
// if (!cont) return;
|
|
49
|
+
// cont.scrollTop = cont.scrollHeight;
|
|
50
|
+
// }
|
|
@@ -10,7 +10,7 @@ export default () => {
|
|
|
10
10
|
const model = controller.useMemo(s => s.model, []);
|
|
11
11
|
|
|
12
12
|
const isRemRow = controller.useMemo(s => s.goodsListState.isRemRow, []);
|
|
13
|
-
|
|
13
|
+
const isBatchRemRow = controller.useMemo(s => s.goodsListState.isBatchRemRow, []);
|
|
14
14
|
/** 是否禁用 */
|
|
15
15
|
const disabled = controller.useMemo((s) => {
|
|
16
16
|
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
@@ -55,7 +55,7 @@ export default () => {
|
|
|
55
55
|
}, [model, onClick, disabled])
|
|
56
56
|
|
|
57
57
|
const button = React.useMemo(() => {
|
|
58
|
-
|
|
58
|
+
if (isBatchRemRow === false) return <></>;
|
|
59
59
|
if (isRemRow === false) return <></>;
|
|
60
60
|
if (model === 'prefab') return <></>;
|
|
61
61
|
if (model === 'readOnly') return <></>;
|
|
@@ -63,7 +63,7 @@ export default () => {
|
|
|
63
63
|
return (
|
|
64
64
|
<Button onClick={onClick} disabled={disabled} >批量删除</Button>
|
|
65
65
|
)
|
|
66
|
-
}, [model, onClick, disabled, isRemRow])
|
|
66
|
+
}, [model, onClick, disabled, isRemRow, isBatchRemRow])
|
|
67
67
|
|
|
68
68
|
return { button, menuItem };
|
|
69
69
|
};
|
|
@@ -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,189 @@
|
|
|
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 { 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';
|
|
9
|
+
import Icon from '@ant-design/icons';
|
|
10
|
+
import { ReactComponent as DownloadSvg } from './icon/download.svg';
|
|
11
|
+
import { ReactComponent as UploadSvg } from './icon/upload.svg';
|
|
12
|
+
import styles from './index.module.less';
|
|
13
|
+
|
|
14
|
+
export default () => {
|
|
15
|
+
const controller = Invoice.useInvoiceController();
|
|
16
|
+
|
|
17
|
+
const visible = controller.useMemo(s => s.goodsListState.importGoods.isVisibleBatchImportDrawer, []);
|
|
18
|
+
|
|
19
|
+
const onClose = React.useCallback(() => {
|
|
20
|
+
controller.pipeline(async s => { s.goodsListState.importGoods.isVisibleBatchImportDrawer = false })();
|
|
21
|
+
}, [controller]);
|
|
22
|
+
|
|
23
|
+
const beforeUpload = React.useCallback(async (e: RcFile, type: string = 'xls') => {
|
|
24
|
+
if (controller.importdApplicationLines) {
|
|
25
|
+
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
|
+
// })
|
|
80
|
+
return false;
|
|
81
|
+
}, [controller])
|
|
82
|
+
|
|
83
|
+
const downloadApplicationTempalte = () => {
|
|
84
|
+
if (controller.downloadApplicationTempalte) {
|
|
85
|
+
controller.downloadApplicationTempalte();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return (
|
|
89
|
+
<Drawer
|
|
90
|
+
title="批量导入商品"
|
|
91
|
+
placement="right"
|
|
92
|
+
// closable={false}
|
|
93
|
+
destroyOnClose={true}
|
|
94
|
+
width={500}
|
|
95
|
+
onClose={onClose}
|
|
96
|
+
visible={visible}
|
|
97
|
+
>
|
|
98
|
+
<div className={styles.excel} >
|
|
99
|
+
<div className={styles.left} >
|
|
100
|
+
<div className={styles.download} onClick={downloadApplicationTempalte} >
|
|
101
|
+
<div>
|
|
102
|
+
<Icon component={DownloadSvg} />
|
|
103
|
+
</div>
|
|
104
|
+
<p style={{ fontWeight: 'bold' }} >Excel 模板下载</p>
|
|
105
|
+
<p>点击图标下载模板</p>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div className={styles.right} >
|
|
109
|
+
<Upload
|
|
110
|
+
showUploadList={false}
|
|
111
|
+
beforeUpload={(e) => { beforeUpload(e, 'xls') }}
|
|
112
|
+
accept=".xlsx,.xls"
|
|
113
|
+
>
|
|
114
|
+
<div className={styles.upload} >
|
|
115
|
+
<div>
|
|
116
|
+
<Icon component={UploadSvg} />
|
|
117
|
+
</div>
|
|
118
|
+
<p style={{ fontWeight: 'bold' }} >Excel 上传</p>
|
|
119
|
+
<p>点击图标上传Excel文件</p>
|
|
120
|
+
</div>
|
|
121
|
+
</Upload>
|
|
122
|
+
</div>
|
|
123
|
+
</div >
|
|
124
|
+
</Drawer>
|
|
125
|
+
);
|
|
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
|
+
}
|