kts-component-invoice-operate 1.2.26 → 1.2.27
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/d.dio +2 -69
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{EndowCode.d.ts → EndowCode/index.d.ts} +2 -2
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{IGood.d.ts → IGood/index.d.ts} +13 -5
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{ImportGoods.d.ts → ImportGoods/index.d.ts} +0 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{LineAttributeType.d.ts → LineAttributeType/index.d.ts} +0 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.d.ts +5 -0
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +7 -0
- package/dist/Invoice/index.d.ts +1 -1
- package/dist/Invoice/tools/itemName/index.d.ts +14 -0
- package/dist/Invoice/ui/AddComparisonDrawer/index.d.ts +2 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.d.ts +2 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.d.ts +5 -0
- package/dist/Invoice/ui/GoodsList/ui/{AddDiscountRowButton → BulkMenu/hooks/useAddDiscountRowButton}/index.d.ts +5 -2
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.d.ts +5 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +5 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +5 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/index.d.ts +2 -0
- package/dist/Invoice/ui/GoodsList/ui/{DelRowButton → DescribeSwitch}/index.d.ts +0 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +1073 -314
- package/dist/index.js +1072 -313
- package/docs/index.md +1 -1
- package/docs-dist/umi.css +8 -7
- package/docs-dist/umi.js +1 -1
- package/package.json +8 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{EndowCode.tsx → EndowCode/index.tsx} +3 -3
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{IGood.ts → IGood/index.ts} +17 -5
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{ImportGoods.ts → ImportGoods/index.ts} +0 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/{LineAttributeType.ts → LineAttributeType/index.ts} +0 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/ProductComparison/index.ts +10 -0
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +10 -0
- package/src/Invoice/_test/importGoods/index.tsx +38 -3
- package/src/Invoice/index.tsx +5 -1
- package/src/Invoice/tools/itemName/index.ts +47 -0
- package/src/Invoice/ui/AddComparisonDrawer/index.tsx +135 -0
- package/src/Invoice/ui/EndowCodeDrawer/index.tsx +6 -17
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +16 -0
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +101 -36
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddComparison/index.tsx +39 -0
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +5 -2
- package/src/Invoice/ui/GoodsList/index.less +1 -4
- package/src/Invoice/ui/GoodsList/index.tsx +11 -17
- package/src/Invoice/ui/GoodsList/ui/{AddDiscountRowButton → BulkMenu/hooks/useAddDiscountRowButton}/index.less +0 -0
- package/src/Invoice/ui/GoodsList/ui/{AddDiscountRowButton → BulkMenu/hooks/useAddDiscountRowButton}/index.tsx +20 -17
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useCommodityComparisonButton/index.tsx +75 -0
- package/src/Invoice/ui/GoodsList/ui/{DelRowButton → BulkMenu/hooks/useDelRowButton}/index.tsx +15 -7
- package/src/Invoice/ui/GoodsList/ui/{EndowCodeButton → BulkMenu/hooks/useEndowCodeButton}/index.tsx +13 -9
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/index.tsx +43 -0
- package/src/Invoice/ui/GoodsList/ui/DescribeSwitch/index.tsx +37 -0
- package/src/Invoice/ui/GoodsList/ui/TaxIncludedSwitch/index.tsx +2 -2
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +70 -18
- package/src/index.ts +1 -0
- package/yarn.e.lock +14331 -0
- package/yarn.o.lock +14800 -0
- package/dist/Invoice/ui/GoodsList/ui/EndowCodeButton/index.d.ts +0 -3
package/dist/index.esm.js
CHANGED
|
@@ -2,11 +2,12 @@ import 'kts-components-antd-x3/dist/kts-components-antd-x3.css';
|
|
|
2
2
|
import React, { createElement } from 'react';
|
|
3
3
|
import GreyReactBox, { decorator } from 'grey-react-box';
|
|
4
4
|
import { chain as chain$1, bignumber, create, all } from 'mathjs';
|
|
5
|
-
import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Typography, Drawer,
|
|
5
|
+
import { message, Form, Input, Icon, Tag, Select, Row, Col, Table, Button, Switch, Tooltip, Menu, Typography, Drawer, Dropdown, AutoComplete, Spin, Checkbox, Descriptions, Empty, Divider, Popover, Tree, Modal } from 'kts-components-antd-x3';
|
|
6
6
|
import { v4 } from 'uuid';
|
|
7
7
|
import classnames from 'classnames';
|
|
8
8
|
import { Input as Input$1, NumberPicker } from '@formily/antd-components';
|
|
9
9
|
import { createAsyncFormActions, FormEffectHooks, SchemaForm, FormButtonGroup, SchemaMarkupField } from '@formily/antd';
|
|
10
|
+
import { Form as Form$1, Drawer as Drawer$1 } from 'kts-xui';
|
|
10
11
|
|
|
11
12
|
function ownKeys(object, enumerableOnly) {
|
|
12
13
|
var keys = Object.keys(object);
|
|
@@ -972,6 +973,12 @@ function draft(value) {
|
|
|
972
973
|
}
|
|
973
974
|
}
|
|
974
975
|
|
|
976
|
+
var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
|
|
977
|
+
_classCallCheck(this, ProductComparison);
|
|
978
|
+
|
|
979
|
+
this.onComply = void 0;
|
|
980
|
+
});
|
|
981
|
+
|
|
975
982
|
var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
976
983
|
_classCallCheck(this, GoodsListState);
|
|
977
984
|
|
|
@@ -980,6 +987,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
980
987
|
this.isSwitchTax = void 0;
|
|
981
988
|
this.isAddDiscount = void 0;
|
|
982
989
|
this.isTaxIncluded = true;
|
|
990
|
+
this.isMyShow = false;
|
|
983
991
|
this.editGood = void 0;
|
|
984
992
|
this.form = void 0;
|
|
985
993
|
this.unitList = [];
|
|
@@ -993,7 +1001,9 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
993
1001
|
this.discountGoodIndex = [];
|
|
994
1002
|
this.endowCode = new EndowCode();
|
|
995
1003
|
this.importGoods = new ImportGoods();
|
|
1004
|
+
this.productComparison = new ProductComparison();
|
|
996
1005
|
this.isVisibleDrawer = false;
|
|
1006
|
+
this.addComparisonIndex = void 0;
|
|
997
1007
|
});
|
|
998
1008
|
|
|
999
1009
|
var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
|
|
@@ -1598,7 +1608,7 @@ var InvoiceHeader = decorator(Form.create())(function (props) {
|
|
|
1598
1608
|
/** 控制器 */
|
|
1599
1609
|
|
|
1600
1610
|
|
|
1601
|
-
var controller =
|
|
1611
|
+
var controller = Invoice.useInvoiceController();
|
|
1602
1612
|
var model = controller.useMemo(function (s) {
|
|
1603
1613
|
return s.model;
|
|
1604
1614
|
}, []);
|
|
@@ -1912,7 +1922,7 @@ styleInject(css_248z$3);
|
|
|
1912
1922
|
var nzhcn = require('nzh').cn;
|
|
1913
1923
|
|
|
1914
1924
|
var Statistics = (function () {
|
|
1915
|
-
var controller =
|
|
1925
|
+
var controller = Invoice.useInvoiceController();
|
|
1916
1926
|
/** 是否不含税) */
|
|
1917
1927
|
|
|
1918
1928
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
@@ -2020,7 +2030,7 @@ var Statistics = (function () {
|
|
|
2020
2030
|
});
|
|
2021
2031
|
|
|
2022
2032
|
var AddRowButton = (function () {
|
|
2023
|
-
var controller =
|
|
2033
|
+
var controller = Invoice.useInvoiceController();
|
|
2024
2034
|
var model = controller.useMemo(function (s) {
|
|
2025
2035
|
return s.model;
|
|
2026
2036
|
}, []);
|
|
@@ -2114,7 +2124,7 @@ var AddRowButton = (function () {
|
|
|
2114
2124
|
});
|
|
2115
2125
|
|
|
2116
2126
|
var TaxIncludedSwitch = (function () {
|
|
2117
|
-
var controller =
|
|
2127
|
+
var controller = Invoice.useInvoiceController();
|
|
2118
2128
|
/** 是否含税 */
|
|
2119
2129
|
|
|
2120
2130
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
@@ -2149,7 +2159,11 @@ var TaxIncludedSwitch = (function () {
|
|
|
2149
2159
|
};
|
|
2150
2160
|
}())();
|
|
2151
2161
|
}, []);
|
|
2152
|
-
return React.createElement("span", null, React.createElement("label",
|
|
2162
|
+
return React.createElement("span", null, React.createElement("label", {
|
|
2163
|
+
style: {
|
|
2164
|
+
marginRight: 2
|
|
2165
|
+
}
|
|
2166
|
+
}, "\u542B\u7A0E:"), React.createElement(Switch, {
|
|
2153
2167
|
disabled: isSwitchTax === false,
|
|
2154
2168
|
checked: isTaxIncluded,
|
|
2155
2169
|
checkedChildren: "\u5F00",
|
|
@@ -2159,6 +2173,57 @@ var TaxIncludedSwitch = (function () {
|
|
|
2159
2173
|
}));
|
|
2160
2174
|
});
|
|
2161
2175
|
|
|
2176
|
+
var DescribeSwitch = (function () {
|
|
2177
|
+
var controller = Invoice.useInvoiceController();
|
|
2178
|
+
var productComparison = controller.useMemo(function (s) {
|
|
2179
|
+
return s.goodsListState.productComparison;
|
|
2180
|
+
}, []);
|
|
2181
|
+
var isMyShow = controller.useMemo(function (s) {
|
|
2182
|
+
return s.goodsListState.isMyShow;
|
|
2183
|
+
}, []);
|
|
2184
|
+
var onChange = React.useCallback(function (e) {
|
|
2185
|
+
controller.run( /*#__PURE__*/function () {
|
|
2186
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2187
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2188
|
+
while (1) {
|
|
2189
|
+
switch (_context.prev = _context.next) {
|
|
2190
|
+
case 0:
|
|
2191
|
+
return _context.abrupt("return", s.goodsListState.isMyShow = !s.goodsListState.isMyShow);
|
|
2192
|
+
|
|
2193
|
+
case 1:
|
|
2194
|
+
case "end":
|
|
2195
|
+
return _context.stop();
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}, _callee);
|
|
2199
|
+
}));
|
|
2200
|
+
|
|
2201
|
+
return function (_x) {
|
|
2202
|
+
return _ref.apply(this, arguments);
|
|
2203
|
+
};
|
|
2204
|
+
}());
|
|
2205
|
+
}, []);
|
|
2206
|
+
if (!productComparison.onComply) return React.createElement(React.Fragment, null);
|
|
2207
|
+
return React.createElement("span", null, React.createElement("label", {
|
|
2208
|
+
style: {
|
|
2209
|
+
marginRight: 2
|
|
2210
|
+
}
|
|
2211
|
+
}, React.createElement(Tooltip, {
|
|
2212
|
+
title: "\u84DD\u8272\u4EE3\u8868\u6211\u65B9\u5546\u54C1\u63CF\u8FF0\uFF0C\u9ED1\u8272\u4EE3\u8868\u5BF9\u65B9\u7684\u5546\u54C1\u63CF\u8FF0\u3002"
|
|
2213
|
+
}, React.createElement(Icon, {
|
|
2214
|
+
style: {
|
|
2215
|
+
marginRight: 3
|
|
2216
|
+
},
|
|
2217
|
+
type: "info-circle"
|
|
2218
|
+
})), "\u4F7F\u7528\u54EA\u65B9\u5546\u54C1\u63CF\u8FF0:"), React.createElement(Switch, {
|
|
2219
|
+
checked: isMyShow,
|
|
2220
|
+
checkedChildren: "\u6211\u65B9",
|
|
2221
|
+
unCheckedChildren: "\u5BF9\u65B9",
|
|
2222
|
+
defaultChecked: true,
|
|
2223
|
+
onChange: onChange
|
|
2224
|
+
}));
|
|
2225
|
+
});
|
|
2226
|
+
|
|
2162
2227
|
var _path$1;
|
|
2163
2228
|
|
|
2164
2229
|
function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
|
|
@@ -2179,7 +2244,7 @@ var css_248z$4 = ".kts-invoice-operate-goods-list-able-list .kts-invoice-operate
|
|
|
2179
2244
|
styleInject(css_248z$4);
|
|
2180
2245
|
|
|
2181
2246
|
function Search() {
|
|
2182
|
-
var controller =
|
|
2247
|
+
var controller = Invoice.useInvoiceController();
|
|
2183
2248
|
|
|
2184
2249
|
var _React$useState = React.useState(''),
|
|
2185
2250
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -2262,7 +2327,7 @@ function Search() {
|
|
|
2262
2327
|
}
|
|
2263
2328
|
|
|
2264
2329
|
function TableRow(props) {
|
|
2265
|
-
var controller =
|
|
2330
|
+
var controller = Invoice.useInvoiceController();
|
|
2266
2331
|
var goodsMap = controller.useMemo(function (s) {
|
|
2267
2332
|
return s.goodsListState.goodsMap;
|
|
2268
2333
|
}, []);
|
|
@@ -2276,6 +2341,70 @@ function TableRow(props) {
|
|
|
2276
2341
|
}));
|
|
2277
2342
|
}
|
|
2278
2343
|
|
|
2344
|
+
var useDelRowButton = (function () {
|
|
2345
|
+
var controller = Invoice.useInvoiceController();
|
|
2346
|
+
var model = controller.useMemo(function (s) {
|
|
2347
|
+
return s.model;
|
|
2348
|
+
}, []);
|
|
2349
|
+
/** 是否禁用 */
|
|
2350
|
+
|
|
2351
|
+
var disabled = controller.useMemo(function (s) {
|
|
2352
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
2353
|
+
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
2354
|
+
var good = s.goodsListState.goodsMap.get(e);
|
|
2355
|
+
if (!good) return true;
|
|
2356
|
+
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
2357
|
+
});
|
|
2358
|
+
}, []);
|
|
2359
|
+
var onClick = React.useCallback(function () {
|
|
2360
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
2361
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2362
|
+
var goodsList;
|
|
2363
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2364
|
+
while (1) {
|
|
2365
|
+
switch (_context.prev = _context.next) {
|
|
2366
|
+
case 0:
|
|
2367
|
+
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
2368
|
+
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
2369
|
+
});
|
|
2370
|
+
|
|
2371
|
+
if (s.goodsListState.editGood) {
|
|
2372
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
|
|
2373
|
+
controller.setEditGood();
|
|
2374
|
+
}
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
|
|
2378
|
+
goodsList: goodsList,
|
|
2379
|
+
selectedGoodIndex: []
|
|
2380
|
+
});
|
|
2381
|
+
|
|
2382
|
+
case 3:
|
|
2383
|
+
case "end":
|
|
2384
|
+
return _context.stop();
|
|
2385
|
+
}
|
|
2386
|
+
}
|
|
2387
|
+
}, _callee);
|
|
2388
|
+
}));
|
|
2389
|
+
|
|
2390
|
+
return function (_x) {
|
|
2391
|
+
return _ref.apply(this, arguments);
|
|
2392
|
+
};
|
|
2393
|
+
}())();
|
|
2394
|
+
}, [controller]);
|
|
2395
|
+
var menuItem = React.useMemo(function () {
|
|
2396
|
+
if (model === 'prefab') return React.createElement(React.Fragment, null);
|
|
2397
|
+
return React.createElement(Menu.Item, {
|
|
2398
|
+
key: "1",
|
|
2399
|
+
onClick: onClick,
|
|
2400
|
+
disabled: disabled
|
|
2401
|
+
}, "\u5220\u9664\u884C");
|
|
2402
|
+
}, [model, onClick, disabled]);
|
|
2403
|
+
return {
|
|
2404
|
+
menuItem: menuItem
|
|
2405
|
+
};
|
|
2406
|
+
});
|
|
2407
|
+
|
|
2279
2408
|
/** 延迟函数 */
|
|
2280
2409
|
var lazyFn = (function (fn) {
|
|
2281
2410
|
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
@@ -2322,9 +2451,9 @@ var _create = create(all, {
|
|
|
2322
2451
|
}),
|
|
2323
2452
|
chain = _create.chain;
|
|
2324
2453
|
|
|
2325
|
-
var
|
|
2454
|
+
var useAddDiscountRowButton = (function () {
|
|
2326
2455
|
/** 控制器 */
|
|
2327
|
-
var controller =
|
|
2456
|
+
var controller = Invoice.useInvoiceController();
|
|
2328
2457
|
var model = controller.useMemo(function (s) {
|
|
2329
2458
|
return s.model;
|
|
2330
2459
|
}, []);
|
|
@@ -2468,25 +2597,33 @@ var AddDiscountRowButton = decorator(Form.create())(function (props) {
|
|
|
2468
2597
|
}
|
|
2469
2598
|
}, _callee3);
|
|
2470
2599
|
})), [controller]);
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2600
|
+
var menuItem = React.useMemo(function () {
|
|
2601
|
+
return model === 'prefab' ? React.createElement(React.Fragment, null) : isAddDiscount !== false ? React.createElement(Menu.Item, {
|
|
2602
|
+
key: "0",
|
|
2603
|
+
onClick: onClick,
|
|
2604
|
+
disabled: disabled
|
|
2605
|
+
}, "\u6DFB\u52A0\u6298\u6263\u884C") : undefined;
|
|
2606
|
+
}, [isAddDiscount, disabled, onClick]);
|
|
2607
|
+
var drawer = React.useMemo(function () {
|
|
2608
|
+
return React.createElement(Drawer, {
|
|
2609
|
+
className: "kts-invoice-operate-goods-list-add-discount-row",
|
|
2610
|
+
width: 540,
|
|
2611
|
+
title: "\u6DFB\u52A0\u6298\u6263\u884C",
|
|
2612
|
+
placement: "right",
|
|
2613
|
+
destroyOnClose: true,
|
|
2614
|
+
onClose: onClose,
|
|
2615
|
+
visible: visible
|
|
2616
|
+
}, React.createElement(DrawerBody, null));
|
|
2617
|
+
}, [visible, onClose]);
|
|
2618
|
+
return {
|
|
2619
|
+
menuItem: menuItem,
|
|
2620
|
+
drawer: drawer
|
|
2621
|
+
};
|
|
2485
2622
|
});
|
|
2486
2623
|
var DrawerBody = decorator(Form.create())(function (props) {
|
|
2487
2624
|
var form = props.form;
|
|
2488
2625
|
var getFieldDecorator = form.getFieldDecorator;
|
|
2489
|
-
var controller =
|
|
2626
|
+
var controller = Invoice.useInvoiceController();
|
|
2490
2627
|
/** 选中的货物索引列表 */
|
|
2491
2628
|
|
|
2492
2629
|
var discountGoodIndex = controller.useMemo(function (s) {
|
|
@@ -2705,8 +2842,8 @@ var coolingFn = (function () {
|
|
|
2705
2842
|
}
|
|
2706
2843
|
});
|
|
2707
2844
|
|
|
2708
|
-
var
|
|
2709
|
-
var controller =
|
|
2845
|
+
var useEndowCodeButton = (function () {
|
|
2846
|
+
var controller = Invoice.useInvoiceController();
|
|
2710
2847
|
/** 是否禁用 */
|
|
2711
2848
|
|
|
2712
2849
|
var disabled = controller.useMemo(function (s) {
|
|
@@ -2783,72 +2920,194 @@ var EndowCodeButton = (function () {
|
|
|
2783
2920
|
}
|
|
2784
2921
|
}, _callee2);
|
|
2785
2922
|
})), [controller]);
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2923
|
+
var menuItem = React.useMemo(function () {
|
|
2924
|
+
return React.createElement(Menu.Item, {
|
|
2925
|
+
key: "2",
|
|
2926
|
+
onClick: onClick,
|
|
2927
|
+
disabled: disabled
|
|
2928
|
+
}, "\u6279\u91CF\u8D4B\u7801");
|
|
2929
|
+
}, [onClick, disabled]);
|
|
2930
|
+
return {
|
|
2931
|
+
menuItem: menuItem
|
|
2932
|
+
};
|
|
2791
2933
|
});
|
|
2792
2934
|
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2935
|
+
/** 拆分全称加简称 */
|
|
2936
|
+
var getSN = function getSN(value) {
|
|
2937
|
+
if (!value) return undefined;
|
|
2938
|
+
var arr = value.match(/\*[^*]+\*/);
|
|
2939
|
+
|
|
2940
|
+
if (arr && arr[0]) {
|
|
2941
|
+
return {
|
|
2942
|
+
shorthand: arr[0].split('*')[1],
|
|
2943
|
+
full: value.replace(arr[0], '')
|
|
2944
|
+
};
|
|
2945
|
+
} else {
|
|
2946
|
+
return {
|
|
2947
|
+
shorthand: undefined,
|
|
2948
|
+
full: value
|
|
2949
|
+
};
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
/** 组合全称加简称 */
|
|
2953
|
+
|
|
2954
|
+
var getItemName = function getItemName(value) {
|
|
2955
|
+
if (value.shorthand) {
|
|
2956
|
+
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2957
|
+
} else {
|
|
2958
|
+
return value.full;
|
|
2959
|
+
}
|
|
2960
|
+
};
|
|
2961
|
+
/** 设置简称 */
|
|
2962
|
+
|
|
2963
|
+
var setShorthand = function setShorthand(name, shorthand) {
|
|
2964
|
+
if (!name) return undefined;
|
|
2965
|
+
var sn = getSN(name);
|
|
2966
|
+
if (!sn) return undefined;
|
|
2967
|
+
sn.shorthand = shorthand || '';
|
|
2968
|
+
return getItemName(sn);
|
|
2969
|
+
};
|
|
2970
|
+
|
|
2971
|
+
var useCommodityComparisonButton = (function () {
|
|
2972
|
+
var controller = Invoice.useInvoiceController();
|
|
2973
|
+
|
|
2974
|
+
var _controller$useMemo = controller.useMemo(function (s) {
|
|
2975
|
+
return s.goodsListState.productComparison;
|
|
2976
|
+
}, []),
|
|
2977
|
+
onComply = _controller$useMemo.onComply;
|
|
2798
2978
|
/** 是否禁用 */
|
|
2799
2979
|
|
|
2980
|
+
|
|
2800
2981
|
var disabled = controller.useMemo(function (s) {
|
|
2801
|
-
|
|
2802
|
-
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
2803
|
-
var good = s.goodsListState.goodsMap.get(e);
|
|
2804
|
-
if (!good) return true;
|
|
2805
|
-
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
2806
|
-
});
|
|
2982
|
+
return s.goodsListState.selectedGoodIndex.length <= 0;
|
|
2807
2983
|
}, []);
|
|
2808
|
-
|
|
2809
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
2810
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2811
|
-
var goodsList;
|
|
2812
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2813
|
-
while (1) {
|
|
2814
|
-
switch (_context.prev = _context.next) {
|
|
2815
|
-
case 0:
|
|
2816
|
-
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
2817
|
-
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
2818
|
-
});
|
|
2984
|
+
/** 点击了 */
|
|
2819
2985
|
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2986
|
+
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2987
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2988
|
+
while (1) {
|
|
2989
|
+
switch (_context2.prev = _context2.next) {
|
|
2990
|
+
case 0:
|
|
2991
|
+
_context2.next = 2;
|
|
2992
|
+
return controller.saveEditGood();
|
|
2825
2993
|
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
});
|
|
2994
|
+
case 2:
|
|
2995
|
+
_context2.next = 4;
|
|
2996
|
+
return controller.wait();
|
|
2830
2997
|
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
}, _callee);
|
|
2837
|
-
}));
|
|
2998
|
+
case 4:
|
|
2999
|
+
_context2.next = 6;
|
|
3000
|
+
return controller.run( /*#__PURE__*/function () {
|
|
3001
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
3002
|
+
var _s$goodsListState, _s$goodsListState$pro;
|
|
2838
3003
|
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
3004
|
+
var goods, newGoods;
|
|
3005
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3006
|
+
while (1) {
|
|
3007
|
+
switch (_context.prev = _context.next) {
|
|
3008
|
+
case 0:
|
|
3009
|
+
if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
|
|
3010
|
+
_context.next = 3;
|
|
3011
|
+
break;
|
|
3012
|
+
}
|
|
3013
|
+
|
|
3014
|
+
coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
|
|
3015
|
+
message.error('不能给正在编辑的货物执行商品对照');
|
|
3016
|
+
});
|
|
3017
|
+
return _context.abrupt("return");
|
|
3018
|
+
|
|
3019
|
+
case 3:
|
|
3020
|
+
if ((_s$goodsListState = s.goodsListState) === null || _s$goodsListState === void 0 ? void 0 : (_s$goodsListState$pro = _s$goodsListState.productComparison) === null || _s$goodsListState$pro === void 0 ? void 0 : _s$goodsListState$pro.onComply) {
|
|
3021
|
+
_context.next = 5;
|
|
3022
|
+
break;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
return _context.abrupt("return");
|
|
3026
|
+
|
|
3027
|
+
case 5:
|
|
3028
|
+
goods = s.goodsListState.selectedGoodIndex.map(function (e) {
|
|
3029
|
+
var _getSN, _getSN2;
|
|
3030
|
+
|
|
3031
|
+
var t = s.goodsListState.goodsMap.get(e);
|
|
3032
|
+
if (!t) return undefined;
|
|
3033
|
+
return _objectSpread2(_objectSpread2({}, t), {}, {
|
|
3034
|
+
itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
|
|
3035
|
+
itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
|
|
3036
|
+
});
|
|
3037
|
+
}).filter(function (e) {
|
|
3038
|
+
return !!e;
|
|
3039
|
+
}); // 比对后的商品
|
|
3040
|
+
|
|
3041
|
+
_context.next = 8;
|
|
3042
|
+
return s.goodsListState.productComparison.onComply(goods);
|
|
3043
|
+
|
|
3044
|
+
case 8:
|
|
3045
|
+
newGoods = _context.sent;
|
|
3046
|
+
newGoods.forEach(function (e) {
|
|
3047
|
+
var _getSN3, _getSN4;
|
|
3048
|
+
|
|
3049
|
+
var vt = s.goodsListState.goodsMap.get(e.$index);
|
|
3050
|
+
if (!vt) return undefined;
|
|
3051
|
+
vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
|
|
3052
|
+
vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
|
|
3053
|
+
vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
|
|
3054
|
+
vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
|
|
3055
|
+
vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
|
|
3056
|
+
vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
|
|
3057
|
+
});
|
|
3058
|
+
|
|
3059
|
+
case 10:
|
|
3060
|
+
case "end":
|
|
3061
|
+
return _context.stop();
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
}, _callee);
|
|
3065
|
+
}));
|
|
3066
|
+
|
|
3067
|
+
return function (_x) {
|
|
3068
|
+
return _ref2.apply(this, arguments);
|
|
3069
|
+
};
|
|
3070
|
+
}());
|
|
3071
|
+
|
|
3072
|
+
case 6:
|
|
3073
|
+
case "end":
|
|
3074
|
+
return _context2.stop();
|
|
3075
|
+
}
|
|
3076
|
+
}
|
|
3077
|
+
}, _callee2);
|
|
3078
|
+
})), []);
|
|
3079
|
+
var menuItem = React.useMemo(function () {
|
|
3080
|
+
// 没用 执行商品对照 的方法 不显示按钮
|
|
3081
|
+
if (!onComply) return React.createElement(React.Fragment, null);
|
|
3082
|
+
return React.createElement(Menu.Item, {
|
|
3083
|
+
key: "3",
|
|
3084
|
+
disabled: disabled,
|
|
3085
|
+
onClick: onClick
|
|
3086
|
+
}, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
|
|
3087
|
+
}, [disabled, onClick, onComply]);
|
|
3088
|
+
return {
|
|
3089
|
+
menuItem: menuItem
|
|
3090
|
+
};
|
|
2850
3091
|
});
|
|
2851
3092
|
|
|
3093
|
+
function BulkMenu() {
|
|
3094
|
+
/** 删除行 */
|
|
3095
|
+
var delRowButton = useDelRowButton();
|
|
3096
|
+
/** 添加折扣行 */
|
|
3097
|
+
|
|
3098
|
+
var addDiscountRowButton = useAddDiscountRowButton();
|
|
3099
|
+
/** 批量赋码 */
|
|
3100
|
+
|
|
3101
|
+
var endowCodeButton = useEndowCodeButton();
|
|
3102
|
+
/** 执行商品对照 */
|
|
3103
|
+
|
|
3104
|
+
var commodityComparisonButton = useCommodityComparisonButton();
|
|
3105
|
+
var menu = React.createElement(Menu, null, delRowButton.menuItem, addDiscountRowButton.menuItem, endowCodeButton.menuItem, commodityComparisonButton.menuItem);
|
|
3106
|
+
return React.createElement(React.Fragment, null, React.createElement(Dropdown, {
|
|
3107
|
+
overlay: menu
|
|
3108
|
+
}, React.createElement(Button, null, "\u6279\u91CF\u64CD\u4F5C\u884C")), addDiscountRowButton.drawer);
|
|
3109
|
+
}
|
|
3110
|
+
|
|
2852
3111
|
var _defs$1, _path$2;
|
|
2853
3112
|
|
|
2854
3113
|
function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
|
|
@@ -2865,7 +3124,7 @@ function SvgSpot(props) {
|
|
|
2865
3124
|
|
|
2866
3125
|
var Text$1 = Typography.Text;
|
|
2867
3126
|
var useDelItem = (function (goods) {
|
|
2868
|
-
var controller =
|
|
3127
|
+
var controller = Invoice.useInvoiceController();
|
|
2869
3128
|
var onClick = React.useCallback(function () {
|
|
2870
3129
|
controller.delGood(goods.$index);
|
|
2871
3130
|
}, [controller, goods.$index]);
|
|
@@ -2887,7 +3146,7 @@ var useDelItem = (function (goods) {
|
|
|
2887
3146
|
|
|
2888
3147
|
var Text$2 = Typography.Text;
|
|
2889
3148
|
var useAddDiscount = (function (goods) {
|
|
2890
|
-
var controller =
|
|
3149
|
+
var controller = Invoice.useInvoiceController();
|
|
2891
3150
|
/** 点击了 添加折扣行 按钮 */
|
|
2892
3151
|
|
|
2893
3152
|
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -9485,44 +9744,6 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
9485
9744
|
};
|
|
9486
9745
|
}());
|
|
9487
9746
|
};
|
|
9488
|
-
/** 保存到编辑货物 */
|
|
9489
|
-
|
|
9490
|
-
var onSaveEditGood = lazyFn$1(function (controller, form, record, id) {
|
|
9491
|
-
form.validateFields( /*#__PURE__*/function () {
|
|
9492
|
-
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
|
|
9493
|
-
var v;
|
|
9494
|
-
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
9495
|
-
while (1) {
|
|
9496
|
-
switch (_context9.prev = _context9.next) {
|
|
9497
|
-
case 0:
|
|
9498
|
-
err = err || {};
|
|
9499
|
-
|
|
9500
|
-
if (!err[id]) {
|
|
9501
|
-
_context9.next = 3;
|
|
9502
|
-
break;
|
|
9503
|
-
}
|
|
9504
|
-
|
|
9505
|
-
return _context9.abrupt("return");
|
|
9506
|
-
|
|
9507
|
-
case 3:
|
|
9508
|
-
v = {};
|
|
9509
|
-
v[id] = values[id];
|
|
9510
|
-
_context9.next = 7;
|
|
9511
|
-
return controller.setEditGood(_objectSpread2({}, v));
|
|
9512
|
-
|
|
9513
|
-
case 7:
|
|
9514
|
-
case "end":
|
|
9515
|
-
return _context9.stop();
|
|
9516
|
-
}
|
|
9517
|
-
}
|
|
9518
|
-
}, _callee9);
|
|
9519
|
-
}));
|
|
9520
|
-
|
|
9521
|
-
return function (_x17, _x18) {
|
|
9522
|
-
return _ref9.apply(this, arguments);
|
|
9523
|
-
};
|
|
9524
|
-
}());
|
|
9525
|
-
}, 1000);
|
|
9526
9747
|
/** 单调赋码 */
|
|
9527
9748
|
|
|
9528
9749
|
var endowCode = /*#__PURE__*/function () {
|
|
@@ -9618,10 +9839,101 @@ var endowCode = /*#__PURE__*/function () {
|
|
|
9618
9839
|
return _ref10.apply(this, arguments);
|
|
9619
9840
|
};
|
|
9620
9841
|
}();
|
|
9842
|
+
/** 修改了 货物名称 */
|
|
9621
9843
|
|
|
9622
|
-
var
|
|
9844
|
+
var onChangeItemName = /*#__PURE__*/function () {
|
|
9845
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
|
|
9846
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
9847
|
+
while (1) {
|
|
9848
|
+
switch (_context13.prev = _context13.next) {
|
|
9849
|
+
case 0:
|
|
9850
|
+
controller.run( /*#__PURE__*/function () {
|
|
9851
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
|
|
9852
|
+
var _getSN$shorthand, _getSN;
|
|
9853
|
+
|
|
9854
|
+
var value, shorthand;
|
|
9855
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
9856
|
+
while (1) {
|
|
9857
|
+
switch (_context12.prev = _context12.next) {
|
|
9858
|
+
case 0:
|
|
9859
|
+
value = form.getFieldsValue().itemName;
|
|
9860
|
+
shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
|
|
9861
|
+
|
|
9862
|
+
if (!s.goodsListState.isMyShow) {
|
|
9863
|
+
_context12.next = 11;
|
|
9864
|
+
break;
|
|
9865
|
+
}
|
|
9866
|
+
|
|
9867
|
+
_context12.next = 5;
|
|
9868
|
+
return controller.setEditGood({
|
|
9869
|
+
itemNameSelf: value
|
|
9870
|
+
});
|
|
9871
|
+
|
|
9872
|
+
case 5:
|
|
9873
|
+
_context12.t0 = record.itemName;
|
|
9874
|
+
|
|
9875
|
+
if (!_context12.t0) {
|
|
9876
|
+
_context12.next = 9;
|
|
9877
|
+
break;
|
|
9878
|
+
}
|
|
9879
|
+
|
|
9880
|
+
_context12.next = 9;
|
|
9881
|
+
return controller.setEditGood({
|
|
9882
|
+
itemName: setShorthand(record.itemName, shorthand)
|
|
9883
|
+
});
|
|
9884
|
+
|
|
9885
|
+
case 9:
|
|
9886
|
+
_context12.next = 17;
|
|
9887
|
+
break;
|
|
9888
|
+
|
|
9889
|
+
case 11:
|
|
9890
|
+
_context12.next = 13;
|
|
9891
|
+
return controller.setEditGood({
|
|
9892
|
+
itemName: value
|
|
9893
|
+
});
|
|
9894
|
+
|
|
9895
|
+
case 13:
|
|
9896
|
+
_context12.t1 = record.itemNameSelf;
|
|
9897
|
+
|
|
9898
|
+
if (!_context12.t1) {
|
|
9899
|
+
_context12.next = 17;
|
|
9900
|
+
break;
|
|
9901
|
+
}
|
|
9902
|
+
|
|
9903
|
+
_context12.next = 17;
|
|
9904
|
+
return controller.setEditGood({
|
|
9905
|
+
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
9906
|
+
});
|
|
9907
|
+
|
|
9908
|
+
case 17:
|
|
9909
|
+
case "end":
|
|
9910
|
+
return _context12.stop();
|
|
9911
|
+
}
|
|
9912
|
+
}
|
|
9913
|
+
}, _callee12);
|
|
9914
|
+
}));
|
|
9915
|
+
|
|
9916
|
+
return function (_x25) {
|
|
9917
|
+
return _ref13.apply(this, arguments);
|
|
9918
|
+
};
|
|
9919
|
+
}());
|
|
9920
|
+
|
|
9921
|
+
case 1:
|
|
9922
|
+
case "end":
|
|
9923
|
+
return _context13.stop();
|
|
9924
|
+
}
|
|
9925
|
+
}
|
|
9926
|
+
}, _callee13);
|
|
9927
|
+
}));
|
|
9928
|
+
|
|
9929
|
+
return function onChangeItemName(_x22, _x23, _x24) {
|
|
9930
|
+
return _ref12.apply(this, arguments);
|
|
9931
|
+
};
|
|
9932
|
+
}();
|
|
9933
|
+
|
|
9934
|
+
var Text$3 = Typography.Text;
|
|
9623
9935
|
var useEndowCode = (function (goods) {
|
|
9624
|
-
var controller =
|
|
9936
|
+
var controller = Invoice.useInvoiceController();
|
|
9625
9937
|
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9626
9938
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9627
9939
|
while (1) {
|
|
@@ -9646,11 +9958,102 @@ var useEndowCode = (function (goods) {
|
|
|
9646
9958
|
}, [goods.lineAttribute, onClick]);
|
|
9647
9959
|
});
|
|
9648
9960
|
|
|
9961
|
+
var Text$4 = Typography.Text;
|
|
9962
|
+
var useAddComparison = (function (goods) {
|
|
9963
|
+
var controller = Invoice.useInvoiceController();
|
|
9964
|
+
var productComparison = controller.useMemo(function (s) {
|
|
9965
|
+
return s.goodsListState.productComparison;
|
|
9966
|
+
}, []);
|
|
9967
|
+
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9968
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9969
|
+
while (1) {
|
|
9970
|
+
switch (_context2.prev = _context2.next) {
|
|
9971
|
+
case 0:
|
|
9972
|
+
_context2.next = 2;
|
|
9973
|
+
return controller.saveEditGood();
|
|
9974
|
+
|
|
9975
|
+
case 2:
|
|
9976
|
+
_context2.next = 4;
|
|
9977
|
+
return controller.wait();
|
|
9978
|
+
|
|
9979
|
+
case 4:
|
|
9980
|
+
_context2.next = 6;
|
|
9981
|
+
return controller.run( /*#__PURE__*/function () {
|
|
9982
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
9983
|
+
var err, key;
|
|
9984
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9985
|
+
while (1) {
|
|
9986
|
+
switch (_context.prev = _context.next) {
|
|
9987
|
+
case 0:
|
|
9988
|
+
if (!s.goodsListState.form) {
|
|
9989
|
+
_context.next = 11;
|
|
9990
|
+
break;
|
|
9991
|
+
}
|
|
9992
|
+
|
|
9993
|
+
err = s.goodsListState.form.getFieldsError();
|
|
9994
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
9995
|
+
|
|
9996
|
+
case 3:
|
|
9997
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
9998
|
+
_context.next = 11;
|
|
9999
|
+
break;
|
|
10000
|
+
}
|
|
10001
|
+
|
|
10002
|
+
key = _context.t1.value;
|
|
10003
|
+
|
|
10004
|
+
if (err[key]) {
|
|
10005
|
+
_context.next = 7;
|
|
10006
|
+
break;
|
|
10007
|
+
}
|
|
10008
|
+
|
|
10009
|
+
return _context.abrupt("continue", 3);
|
|
10010
|
+
|
|
10011
|
+
case 7:
|
|
10012
|
+
message.error(err[key][0]);
|
|
10013
|
+
return _context.abrupt("return");
|
|
10014
|
+
|
|
10015
|
+
case 11:
|
|
10016
|
+
s.goodsListState.addComparisonIndex = goods.$index;
|
|
10017
|
+
|
|
10018
|
+
case 12:
|
|
10019
|
+
case "end":
|
|
10020
|
+
return _context.stop();
|
|
10021
|
+
}
|
|
10022
|
+
}
|
|
10023
|
+
}, _callee);
|
|
10024
|
+
}));
|
|
10025
|
+
|
|
10026
|
+
return function (_x) {
|
|
10027
|
+
return _ref2.apply(this, arguments);
|
|
10028
|
+
};
|
|
10029
|
+
}());
|
|
10030
|
+
|
|
10031
|
+
case 6:
|
|
10032
|
+
case "end":
|
|
10033
|
+
return _context2.stop();
|
|
10034
|
+
}
|
|
10035
|
+
}
|
|
10036
|
+
}, _callee2);
|
|
10037
|
+
})), [controller, goods.$index]);
|
|
10038
|
+
return React.useMemo(function () {
|
|
10039
|
+
if (productComparison.onComply) {
|
|
10040
|
+
return React.createElement(Menu.Item, {
|
|
10041
|
+
key: "delItem",
|
|
10042
|
+
onClick: onClick
|
|
10043
|
+
}, React.createElement(Text$4, {
|
|
10044
|
+
strong: true
|
|
10045
|
+
}, "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167"));
|
|
10046
|
+
} else {
|
|
10047
|
+
return React.createElement(React.Fragment, null);
|
|
10048
|
+
}
|
|
10049
|
+
}, [onClick, productComparison]);
|
|
10050
|
+
});
|
|
10051
|
+
|
|
9649
10052
|
var css_248z$6 = ".ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:focus,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu {\n font-size: 16px;\n color: #000;\n text-align: center;\n padding: 0;\n}\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu:hover,\n.ktsAnt3x-btn.kts-invoice-operate-goods-list-columns-row-menu.ktsAnt3x-dropdown-open {\n background: #ebebeb;\n border-radius: 9999px;\n}\n";
|
|
9650
10053
|
styleInject(css_248z$6);
|
|
9651
10054
|
|
|
9652
10055
|
var RowMenu = (function (props) {
|
|
9653
|
-
var controller =
|
|
10056
|
+
var controller = Invoice.useInvoiceController();
|
|
9654
10057
|
var model = controller.useMemo(function (s) {
|
|
9655
10058
|
return s.model;
|
|
9656
10059
|
}, []);
|
|
@@ -9665,10 +10068,13 @@ var RowMenu = (function (props) {
|
|
|
9665
10068
|
var delItem = useDelItem(props.goods);
|
|
9666
10069
|
var addDiscount = useAddDiscount(props.goods);
|
|
9667
10070
|
var endowCode = useEndowCode(props.goods);
|
|
10071
|
+
var addComparison = useAddComparison(props.goods);
|
|
9668
10072
|
var itemList = React.useMemo(function () {
|
|
9669
10073
|
var arr = [];
|
|
9670
10074
|
model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
9671
10075
|
|
|
10076
|
+
arr.push(addComparison); // 添加商品对照
|
|
10077
|
+
|
|
9672
10078
|
endowCode && arr.push(endowCode); // 赋码
|
|
9673
10079
|
|
|
9674
10080
|
model !== 'prefab' && delItem && arr.push(delItem); // 删除
|
|
@@ -9701,16 +10107,21 @@ var RowMenu = (function (props) {
|
|
|
9701
10107
|
})));
|
|
9702
10108
|
});
|
|
9703
10109
|
|
|
9704
|
-
var Text$
|
|
10110
|
+
var Text$5 = Typography.Text;
|
|
9705
10111
|
var useColumns = (function (form) {
|
|
9706
10112
|
var getFieldDecorator = form.getFieldDecorator,
|
|
9707
10113
|
getFieldValue = form.getFieldValue;
|
|
9708
|
-
var controller =
|
|
10114
|
+
var controller = Invoice.useInvoiceController();
|
|
9709
10115
|
/** 是否含税 */
|
|
9710
10116
|
|
|
9711
10117
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
9712
10118
|
return e.goodsListState.isTaxIncluded;
|
|
9713
10119
|
}, []);
|
|
10120
|
+
/** 是否显示我方 */
|
|
10121
|
+
|
|
10122
|
+
var isMyShow = controller.useMemo(function (e) {
|
|
10123
|
+
return e.goodsListState.isMyShow;
|
|
10124
|
+
}, []);
|
|
9714
10125
|
/** 正在编辑的货物 */
|
|
9715
10126
|
|
|
9716
10127
|
var editGood = controller.useMemo(function (e) {
|
|
@@ -9747,12 +10158,11 @@ var useColumns = (function (form) {
|
|
|
9747
10158
|
|
|
9748
10159
|
var columns = React.useMemo(function () {
|
|
9749
10160
|
return [{
|
|
9750
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10161
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
9751
10162
|
type: "danger"
|
|
9752
10163
|
}, "*"), "\u8D27\u7269\u540D\u79F0"),
|
|
9753
|
-
dataIndex: 'itemName',
|
|
9754
10164
|
key: 'itemName',
|
|
9755
|
-
render: function render(
|
|
10165
|
+
render: function render(_, record) {
|
|
9756
10166
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9757
10167
|
var _editGood$itemName;
|
|
9758
10168
|
|
|
@@ -9761,17 +10171,54 @@ var useColumns = (function (form) {
|
|
|
9761
10171
|
display: 'flex'
|
|
9762
10172
|
}
|
|
9763
10173
|
}, getFieldDecorator('itemName', {
|
|
9764
|
-
initialValue:
|
|
10174
|
+
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
9765
10175
|
rules: [{
|
|
9766
|
-
|
|
9767
|
-
|
|
10176
|
+
validator: function () {
|
|
10177
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
|
|
10178
|
+
var value;
|
|
10179
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10180
|
+
while (1) {
|
|
10181
|
+
switch (_context.prev = _context.next) {
|
|
10182
|
+
case 0:
|
|
10183
|
+
_context.next = 2;
|
|
10184
|
+
return controller.wait();
|
|
10185
|
+
|
|
10186
|
+
case 2:
|
|
10187
|
+
value = controller.state.goodsListState.editGood;
|
|
10188
|
+
|
|
10189
|
+
if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
|
|
10190
|
+
_context.next = 7;
|
|
10191
|
+
break;
|
|
10192
|
+
}
|
|
10193
|
+
|
|
10194
|
+
callback('货物名称不能为空');
|
|
10195
|
+
_context.next = 8;
|
|
10196
|
+
break;
|
|
10197
|
+
|
|
10198
|
+
case 7:
|
|
10199
|
+
return _context.abrupt("return");
|
|
10200
|
+
|
|
10201
|
+
case 8:
|
|
10202
|
+
case "end":
|
|
10203
|
+
return _context.stop();
|
|
10204
|
+
}
|
|
10205
|
+
}
|
|
10206
|
+
}, _callee);
|
|
10207
|
+
}));
|
|
10208
|
+
|
|
10209
|
+
function validator(_x, _x2, _x3) {
|
|
10210
|
+
return _validator.apply(this, arguments);
|
|
10211
|
+
}
|
|
10212
|
+
|
|
10213
|
+
return validator;
|
|
10214
|
+
}()
|
|
9768
10215
|
}]
|
|
9769
10216
|
})(React.createElement(MyInput, {
|
|
9770
10217
|
style: {
|
|
9771
10218
|
flex: 1
|
|
9772
10219
|
},
|
|
9773
10220
|
onChange: function onChange() {
|
|
9774
|
-
|
|
10221
|
+
onChangeItemName(controller, form, record);
|
|
9775
10222
|
}
|
|
9776
10223
|
})), React.createElement("div", {
|
|
9777
10224
|
className: "kts-invoice-operate-goods-list-able-list-itemName-import"
|
|
@@ -9782,67 +10229,92 @@ var useColumns = (function (form) {
|
|
|
9782
10229
|
type: "link",
|
|
9783
10230
|
icon: "file-add"
|
|
9784
10231
|
}), controller.getGoodsList && React.createElement(Button, {
|
|
9785
|
-
onClick: function
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
10232
|
+
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
10233
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
10234
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10235
|
+
while (1) {
|
|
10236
|
+
switch (_context2.prev = _context2.next) {
|
|
10237
|
+
case 0:
|
|
10238
|
+
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
9793
10239
|
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
}
|
|
10240
|
+
case 1:
|
|
10241
|
+
case "end":
|
|
10242
|
+
return _context2.stop();
|
|
9798
10243
|
}
|
|
9799
|
-
}
|
|
9800
|
-
})
|
|
10244
|
+
}
|
|
10245
|
+
}, _callee2);
|
|
10246
|
+
}));
|
|
9801
10247
|
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
},
|
|
10248
|
+
return function (_x4) {
|
|
10249
|
+
return _ref.apply(this, arguments);
|
|
10250
|
+
};
|
|
10251
|
+
}()),
|
|
9807
10252
|
type: "link",
|
|
9808
10253
|
icon: "plus-circle"
|
|
9809
10254
|
}))));
|
|
9810
10255
|
} else {
|
|
9811
|
-
return React.createElement(
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
}
|
|
10256
|
+
return React.createElement(MyItemNameDiv, {
|
|
10257
|
+
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
10258
|
+
valueF: formatSearch(record.itemName, searchValue),
|
|
10259
|
+
isMyShow: isMyShow
|
|
10260
|
+
}); // return (
|
|
10261
|
+
// <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
|
|
10262
|
+
// );
|
|
9816
10263
|
}
|
|
9817
10264
|
}
|
|
9818
10265
|
}, {
|
|
9819
10266
|
title: '货物规格型号',
|
|
9820
|
-
dataIndex: 'itemModelName',
|
|
9821
10267
|
key: 'itemModelName',
|
|
9822
10268
|
width: 119,
|
|
9823
|
-
render: function render(
|
|
10269
|
+
render: function render(_, record) {
|
|
9824
10270
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9825
10271
|
return React.createElement(Form.Item, null, getFieldDecorator('itemModelName', {
|
|
9826
|
-
initialValue: editGood.itemModelName
|
|
10272
|
+
initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName
|
|
9827
10273
|
})(React.createElement(MyInput, {
|
|
9828
|
-
onChange: function
|
|
9829
|
-
|
|
9830
|
-
|
|
10274
|
+
onChange: function () {
|
|
10275
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
10276
|
+
var key, value;
|
|
10277
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10278
|
+
while (1) {
|
|
10279
|
+
switch (_context3.prev = _context3.next) {
|
|
10280
|
+
case 0:
|
|
10281
|
+
_context3.next = 2;
|
|
10282
|
+
return controller.wait();
|
|
10283
|
+
|
|
10284
|
+
case 2:
|
|
10285
|
+
key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
|
|
10286
|
+
value = {};
|
|
10287
|
+
value[key] = form.getFieldsValue().itemModelName;
|
|
10288
|
+
controller.setEditGood(value);
|
|
10289
|
+
|
|
10290
|
+
case 6:
|
|
10291
|
+
case "end":
|
|
10292
|
+
return _context3.stop();
|
|
10293
|
+
}
|
|
10294
|
+
}
|
|
10295
|
+
}, _callee3);
|
|
10296
|
+
}));
|
|
10297
|
+
|
|
10298
|
+
function onChange() {
|
|
10299
|
+
return _onChange.apply(this, arguments);
|
|
10300
|
+
}
|
|
10301
|
+
|
|
10302
|
+
return onChange;
|
|
10303
|
+
}()
|
|
9831
10304
|
})));
|
|
9832
10305
|
} else {
|
|
9833
|
-
return React.createElement(
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
}
|
|
10306
|
+
return React.createElement(MyItemNameDiv, {
|
|
10307
|
+
valueT: formatSearch(record.itemModelNameSelf, searchValue),
|
|
10308
|
+
valueF: formatSearch(record.itemModelName, searchValue),
|
|
10309
|
+
isMyShow: isMyShow
|
|
10310
|
+
});
|
|
9838
10311
|
}
|
|
9839
10312
|
}
|
|
9840
10313
|
}, {
|
|
9841
10314
|
title: '单位',
|
|
9842
|
-
dataIndex: 'unit',
|
|
9843
10315
|
key: 'unit',
|
|
9844
10316
|
width: 70,
|
|
9845
|
-
render: function render(
|
|
10317
|
+
render: function render(_, record) {
|
|
9846
10318
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9847
10319
|
return React.createElement(Form.Item, null, getFieldDecorator('unit', {
|
|
9848
10320
|
initialValue: editGood.unit
|
|
@@ -9851,16 +10323,39 @@ var useColumns = (function (form) {
|
|
|
9851
10323
|
width: '100%'
|
|
9852
10324
|
},
|
|
9853
10325
|
dataSource: unitList,
|
|
9854
|
-
onChange: function
|
|
9855
|
-
|
|
9856
|
-
|
|
10326
|
+
onChange: function () {
|
|
10327
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
10328
|
+
var key, value;
|
|
10329
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
10330
|
+
while (1) {
|
|
10331
|
+
switch (_context4.prev = _context4.next) {
|
|
10332
|
+
case 0:
|
|
10333
|
+
_context4.next = 2;
|
|
10334
|
+
return controller.wait();
|
|
10335
|
+
|
|
10336
|
+
case 2:
|
|
10337
|
+
key = isMyShow ? 'unit' : 'unitOther';
|
|
10338
|
+
value = {};
|
|
10339
|
+
value[key] = form.getFieldsValue().unit;
|
|
10340
|
+
controller.setEditGood(value);
|
|
10341
|
+
|
|
10342
|
+
case 6:
|
|
10343
|
+
case "end":
|
|
10344
|
+
return _context4.stop();
|
|
10345
|
+
}
|
|
10346
|
+
}
|
|
10347
|
+
}, _callee4);
|
|
10348
|
+
}));
|
|
10349
|
+
|
|
10350
|
+
function onChange() {
|
|
10351
|
+
return _onChange2.apply(this, arguments);
|
|
10352
|
+
}
|
|
10353
|
+
|
|
10354
|
+
return onChange;
|
|
10355
|
+
}()
|
|
9857
10356
|
})));
|
|
9858
10357
|
} else {
|
|
9859
|
-
return
|
|
9860
|
-
style: {
|
|
9861
|
-
padding: '0 10px'
|
|
9862
|
-
}
|
|
9863
|
-
}, value);
|
|
10358
|
+
return record.unit;
|
|
9864
10359
|
}
|
|
9865
10360
|
}
|
|
9866
10361
|
}, {
|
|
@@ -9878,13 +10373,13 @@ var useColumns = (function (form) {
|
|
|
9878
10373
|
message: '数量必须为数字'
|
|
9879
10374
|
}, {
|
|
9880
10375
|
validator: function () {
|
|
9881
|
-
var
|
|
10376
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
|
|
9882
10377
|
var isvalue, isPrice;
|
|
9883
|
-
return _regeneratorRuntime().wrap(function
|
|
10378
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
9884
10379
|
while (1) {
|
|
9885
|
-
switch (
|
|
10380
|
+
switch (_context5.prev = _context5.next) {
|
|
9886
10381
|
case 0:
|
|
9887
|
-
|
|
10382
|
+
_context5.next = 2;
|
|
9888
10383
|
return controller.wait();
|
|
9889
10384
|
|
|
9890
10385
|
case 2:
|
|
@@ -9892,25 +10387,25 @@ var useColumns = (function (form) {
|
|
|
9892
10387
|
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
9893
10388
|
|
|
9894
10389
|
if (!(isvalue || isPrice === isvalue)) {
|
|
9895
|
-
|
|
10390
|
+
_context5.next = 6;
|
|
9896
10391
|
break;
|
|
9897
10392
|
}
|
|
9898
10393
|
|
|
9899
|
-
return
|
|
10394
|
+
return _context5.abrupt("return");
|
|
9900
10395
|
|
|
9901
10396
|
case 6:
|
|
9902
10397
|
callback('请输入数量');
|
|
9903
10398
|
|
|
9904
10399
|
case 7:
|
|
9905
10400
|
case "end":
|
|
9906
|
-
return
|
|
10401
|
+
return _context5.stop();
|
|
9907
10402
|
}
|
|
9908
10403
|
}
|
|
9909
|
-
},
|
|
10404
|
+
}, _callee5);
|
|
9910
10405
|
}));
|
|
9911
10406
|
|
|
9912
|
-
function validator(
|
|
9913
|
-
return
|
|
10407
|
+
function validator(_x5, _x6, _x7) {
|
|
10408
|
+
return _validator2.apply(this, arguments);
|
|
9914
10409
|
}
|
|
9915
10410
|
|
|
9916
10411
|
return validator;
|
|
@@ -9950,13 +10445,13 @@ var useColumns = (function (form) {
|
|
|
9950
10445
|
message: '单价必须为数字'
|
|
9951
10446
|
}, {
|
|
9952
10447
|
validator: function () {
|
|
9953
|
-
var
|
|
10448
|
+
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
|
|
9954
10449
|
var isQuantity, isvalue;
|
|
9955
|
-
return _regeneratorRuntime().wrap(function
|
|
10450
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
9956
10451
|
while (1) {
|
|
9957
|
-
switch (
|
|
10452
|
+
switch (_context6.prev = _context6.next) {
|
|
9958
10453
|
case 0:
|
|
9959
|
-
|
|
10454
|
+
_context6.next = 2;
|
|
9960
10455
|
return controller.wait();
|
|
9961
10456
|
|
|
9962
10457
|
case 2:
|
|
@@ -9964,25 +10459,25 @@ var useColumns = (function (form) {
|
|
|
9964
10459
|
isvalue = !!value || value === 0;
|
|
9965
10460
|
|
|
9966
10461
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
9967
|
-
|
|
10462
|
+
_context6.next = 6;
|
|
9968
10463
|
break;
|
|
9969
10464
|
}
|
|
9970
10465
|
|
|
9971
|
-
return
|
|
10466
|
+
return _context6.abrupt("return");
|
|
9972
10467
|
|
|
9973
10468
|
case 6:
|
|
9974
10469
|
callback('请输入单价');
|
|
9975
10470
|
|
|
9976
10471
|
case 7:
|
|
9977
10472
|
case "end":
|
|
9978
|
-
return
|
|
10473
|
+
return _context6.stop();
|
|
9979
10474
|
}
|
|
9980
10475
|
}
|
|
9981
|
-
},
|
|
10476
|
+
}, _callee6);
|
|
9982
10477
|
}));
|
|
9983
10478
|
|
|
9984
|
-
function validator(
|
|
9985
|
-
return
|
|
10479
|
+
function validator(_x8, _x9, _x10) {
|
|
10480
|
+
return _validator3.apply(this, arguments);
|
|
9986
10481
|
}
|
|
9987
10482
|
|
|
9988
10483
|
return validator;
|
|
@@ -10022,13 +10517,13 @@ var useColumns = (function (form) {
|
|
|
10022
10517
|
message: '单价必须为数字'
|
|
10023
10518
|
}, {
|
|
10024
10519
|
validator: function () {
|
|
10025
|
-
var
|
|
10520
|
+
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
|
|
10026
10521
|
var isQuantity, isvalue;
|
|
10027
|
-
return _regeneratorRuntime().wrap(function
|
|
10522
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
10028
10523
|
while (1) {
|
|
10029
|
-
switch (
|
|
10524
|
+
switch (_context7.prev = _context7.next) {
|
|
10030
10525
|
case 0:
|
|
10031
|
-
|
|
10526
|
+
_context7.next = 2;
|
|
10032
10527
|
return controller.wait();
|
|
10033
10528
|
|
|
10034
10529
|
case 2:
|
|
@@ -10036,25 +10531,25 @@ var useColumns = (function (form) {
|
|
|
10036
10531
|
isvalue = !!value || value === 0;
|
|
10037
10532
|
|
|
10038
10533
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
10039
|
-
|
|
10534
|
+
_context7.next = 6;
|
|
10040
10535
|
break;
|
|
10041
10536
|
}
|
|
10042
10537
|
|
|
10043
|
-
return
|
|
10538
|
+
return _context7.abrupt("return");
|
|
10044
10539
|
|
|
10045
10540
|
case 6:
|
|
10046
10541
|
callback('请输入单价');
|
|
10047
10542
|
|
|
10048
10543
|
case 7:
|
|
10049
10544
|
case "end":
|
|
10050
|
-
return
|
|
10545
|
+
return _context7.stop();
|
|
10051
10546
|
}
|
|
10052
10547
|
}
|
|
10053
|
-
},
|
|
10548
|
+
}, _callee7);
|
|
10054
10549
|
}));
|
|
10055
10550
|
|
|
10056
|
-
function validator(
|
|
10057
|
-
return
|
|
10551
|
+
function validator(_x11, _x12, _x13) {
|
|
10552
|
+
return _validator4.apply(this, arguments);
|
|
10058
10553
|
}
|
|
10059
10554
|
|
|
10060
10555
|
return validator;
|
|
@@ -10080,7 +10575,7 @@ var useColumns = (function (form) {
|
|
|
10080
10575
|
}
|
|
10081
10576
|
}
|
|
10082
10577
|
}, {
|
|
10083
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10578
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
10084
10579
|
type: "danger"
|
|
10085
10580
|
}, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
|
|
10086
10581
|
dataIndex: 'lineAmountIncludeTax',
|
|
@@ -10099,10 +10594,10 @@ var useColumns = (function (form) {
|
|
|
10099
10594
|
message: '金额必须为数字'
|
|
10100
10595
|
}, {
|
|
10101
10596
|
validator: function () {
|
|
10102
|
-
var
|
|
10103
|
-
return _regeneratorRuntime().wrap(function
|
|
10597
|
+
var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
10598
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
10104
10599
|
while (1) {
|
|
10105
|
-
switch (
|
|
10600
|
+
switch (_context8.prev = _context8.next) {
|
|
10106
10601
|
case 0:
|
|
10107
10602
|
if ("".concat(value).split('.')[0].length > 9) {
|
|
10108
10603
|
callback('金额整数部分不能大于9位,小数点后最多2位');
|
|
@@ -10110,24 +10605,24 @@ var useColumns = (function (form) {
|
|
|
10110
10605
|
|
|
10111
10606
|
case 1:
|
|
10112
10607
|
case "end":
|
|
10113
|
-
return
|
|
10608
|
+
return _context8.stop();
|
|
10114
10609
|
}
|
|
10115
10610
|
}
|
|
10116
|
-
},
|
|
10611
|
+
}, _callee8);
|
|
10117
10612
|
}));
|
|
10118
10613
|
|
|
10119
|
-
function validator(
|
|
10120
|
-
return
|
|
10614
|
+
function validator(_x14, _x15, _x16) {
|
|
10615
|
+
return _validator5.apply(this, arguments);
|
|
10121
10616
|
}
|
|
10122
10617
|
|
|
10123
10618
|
return validator;
|
|
10124
10619
|
}()
|
|
10125
10620
|
}, {
|
|
10126
10621
|
validator: function () {
|
|
10127
|
-
var
|
|
10128
|
-
return _regeneratorRuntime().wrap(function
|
|
10622
|
+
var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
10623
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
10129
10624
|
while (1) {
|
|
10130
|
-
switch (
|
|
10625
|
+
switch (_context9.prev = _context9.next) {
|
|
10131
10626
|
case 0:
|
|
10132
10627
|
if (deduction && parseFloat(value) <= deduction) {
|
|
10133
10628
|
callback('扣除额不能大于等于价税合计');
|
|
@@ -10135,14 +10630,14 @@ var useColumns = (function (form) {
|
|
|
10135
10630
|
|
|
10136
10631
|
case 1:
|
|
10137
10632
|
case "end":
|
|
10138
|
-
return
|
|
10633
|
+
return _context9.stop();
|
|
10139
10634
|
}
|
|
10140
10635
|
}
|
|
10141
|
-
},
|
|
10636
|
+
}, _callee9);
|
|
10142
10637
|
}));
|
|
10143
10638
|
|
|
10144
|
-
function validator(
|
|
10145
|
-
return
|
|
10639
|
+
function validator(_x17, _x18, _x19) {
|
|
10640
|
+
return _validator6.apply(this, arguments);
|
|
10146
10641
|
}
|
|
10147
10642
|
|
|
10148
10643
|
return validator;
|
|
@@ -10167,7 +10662,7 @@ var useColumns = (function (form) {
|
|
|
10167
10662
|
}
|
|
10168
10663
|
}
|
|
10169
10664
|
}, {
|
|
10170
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10665
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
10171
10666
|
type: "danger"
|
|
10172
10667
|
}, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
10173
10668
|
dataIndex: 'lineAmountExcludeTax',
|
|
@@ -10186,10 +10681,10 @@ var useColumns = (function (form) {
|
|
|
10186
10681
|
message: '金额必须为数字'
|
|
10187
10682
|
}, {
|
|
10188
10683
|
validator: function () {
|
|
10189
|
-
var
|
|
10190
|
-
return _regeneratorRuntime().wrap(function
|
|
10684
|
+
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
10685
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
10191
10686
|
while (1) {
|
|
10192
|
-
switch (
|
|
10687
|
+
switch (_context10.prev = _context10.next) {
|
|
10193
10688
|
case 0:
|
|
10194
10689
|
if ("".concat(value).split('.')[0].length > 9) {
|
|
10195
10690
|
callback('金额整数部分不能大于9位,小数点后最多2位');
|
|
@@ -10197,14 +10692,14 @@ var useColumns = (function (form) {
|
|
|
10197
10692
|
|
|
10198
10693
|
case 1:
|
|
10199
10694
|
case "end":
|
|
10200
|
-
return
|
|
10695
|
+
return _context10.stop();
|
|
10201
10696
|
}
|
|
10202
10697
|
}
|
|
10203
|
-
},
|
|
10698
|
+
}, _callee10);
|
|
10204
10699
|
}));
|
|
10205
10700
|
|
|
10206
|
-
function validator(
|
|
10207
|
-
return
|
|
10701
|
+
function validator(_x20, _x21, _x22) {
|
|
10702
|
+
return _validator7.apply(this, arguments);
|
|
10208
10703
|
}
|
|
10209
10704
|
|
|
10210
10705
|
return validator;
|
|
@@ -10229,7 +10724,7 @@ var useColumns = (function (form) {
|
|
|
10229
10724
|
}
|
|
10230
10725
|
}
|
|
10231
10726
|
}, {
|
|
10232
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10727
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
10233
10728
|
type: "danger"
|
|
10234
10729
|
}, "*"), "\u7A0E\u7387"),
|
|
10235
10730
|
dataIndex: 'taxRate',
|
|
@@ -10257,6 +10752,7 @@ var useColumns = (function (form) {
|
|
|
10257
10752
|
width: '100%'
|
|
10258
10753
|
},
|
|
10259
10754
|
onChange: function onChange() {
|
|
10755
|
+
setChangeField('taxRate');
|
|
10260
10756
|
onChangeTaxRate(controller, form, record);
|
|
10261
10757
|
}
|
|
10262
10758
|
}, taxRateList.map(function (e, i) {
|
|
@@ -10283,7 +10779,9 @@ var useColumns = (function (form) {
|
|
|
10283
10779
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
10284
10780
|
return getFieldDecorator('taxAmount', {
|
|
10285
10781
|
initialValue: editGood.taxAmount
|
|
10286
|
-
})(React.createElement(MyDiv,
|
|
10782
|
+
})(React.createElement(MyDiv, {
|
|
10783
|
+
loading: isCipher(changeField, 'taxAmount')
|
|
10784
|
+
}));
|
|
10287
10785
|
} else {
|
|
10288
10786
|
return React.createElement("span", {
|
|
10289
10787
|
style: {
|
|
@@ -10315,7 +10813,7 @@ var useColumns = (function (form) {
|
|
|
10315
10813
|
ellipsis: true
|
|
10316
10814
|
});
|
|
10317
10815
|
});
|
|
10318
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, searchValue]);
|
|
10816
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
|
|
10319
10817
|
React.useEffect(function () {
|
|
10320
10818
|
if (!changeField) return;
|
|
10321
10819
|
var t = setTimeout(function () {
|
|
@@ -10379,16 +10877,82 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
|
|
|
10379
10877
|
_createClass(MyDiv, [{
|
|
10380
10878
|
key: "render",
|
|
10381
10879
|
value: function render() {
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
}
|
|
10386
|
-
|
|
10880
|
+
if (this.props.loading) {
|
|
10881
|
+
return React.createElement(Spin, {
|
|
10882
|
+
size: "small"
|
|
10883
|
+
}, React.createElement("span", {
|
|
10884
|
+
style: {
|
|
10885
|
+
padding: '0 10px'
|
|
10886
|
+
}
|
|
10887
|
+
}, this.props.value));
|
|
10888
|
+
} else {
|
|
10889
|
+
return React.createElement("span", {
|
|
10890
|
+
style: {
|
|
10891
|
+
padding: '0 10px'
|
|
10892
|
+
}
|
|
10893
|
+
}, this.props.value);
|
|
10894
|
+
}
|
|
10387
10895
|
}
|
|
10388
10896
|
}]);
|
|
10389
10897
|
|
|
10390
10898
|
return MyDiv;
|
|
10391
10899
|
}(React.Component);
|
|
10900
|
+
|
|
10901
|
+
var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
|
|
10902
|
+
_inherits(MyItemNameDiv, _React$Component3);
|
|
10903
|
+
|
|
10904
|
+
var _super3 = _createSuper(MyItemNameDiv);
|
|
10905
|
+
|
|
10906
|
+
function MyItemNameDiv() {
|
|
10907
|
+
_classCallCheck(this, MyItemNameDiv);
|
|
10908
|
+
|
|
10909
|
+
return _super3.apply(this, arguments);
|
|
10910
|
+
}
|
|
10911
|
+
|
|
10912
|
+
_createClass(MyItemNameDiv, [{
|
|
10913
|
+
key: "render",
|
|
10914
|
+
value: function render() {
|
|
10915
|
+
var _this$props = this.props,
|
|
10916
|
+
isMyShow = _this$props.isMyShow,
|
|
10917
|
+
valueT = _this$props.valueT,
|
|
10918
|
+
valueF = _this$props.valueF;
|
|
10919
|
+
|
|
10920
|
+
if (isMyShow) {
|
|
10921
|
+
if (valueT) {
|
|
10922
|
+
return React.createElement("span", {
|
|
10923
|
+
style: {
|
|
10924
|
+
padding: '0 10px',
|
|
10925
|
+
color: '#0074ff'
|
|
10926
|
+
}
|
|
10927
|
+
}, valueT);
|
|
10928
|
+
} else {
|
|
10929
|
+
return React.createElement("span", {
|
|
10930
|
+
style: {
|
|
10931
|
+
padding: '0 10px'
|
|
10932
|
+
}
|
|
10933
|
+
}, valueF);
|
|
10934
|
+
}
|
|
10935
|
+
} else {
|
|
10936
|
+
if (valueF) {
|
|
10937
|
+
return React.createElement("span", {
|
|
10938
|
+
style: {
|
|
10939
|
+
padding: '0 10px'
|
|
10940
|
+
}
|
|
10941
|
+
}, valueF);
|
|
10942
|
+
} else {
|
|
10943
|
+
return React.createElement("span", {
|
|
10944
|
+
style: {
|
|
10945
|
+
padding: '0 10px',
|
|
10946
|
+
color: '#0074ff'
|
|
10947
|
+
}
|
|
10948
|
+
}, valueT);
|
|
10949
|
+
}
|
|
10950
|
+
}
|
|
10951
|
+
}
|
|
10952
|
+
}]);
|
|
10953
|
+
|
|
10954
|
+
return MyItemNameDiv;
|
|
10955
|
+
}(React.Component);
|
|
10392
10956
|
/** 格式搜索结果 */
|
|
10393
10957
|
|
|
10394
10958
|
|
|
@@ -10424,7 +10988,7 @@ function dcoding(v) {
|
|
|
10424
10988
|
|
|
10425
10989
|
var useOnRow = (function () {
|
|
10426
10990
|
/** 控制器 */
|
|
10427
|
-
var controller =
|
|
10991
|
+
var controller = Invoice.useInvoiceController();
|
|
10428
10992
|
var model = controller.useMemo(function (s) {
|
|
10429
10993
|
return s.model;
|
|
10430
10994
|
}, []);
|
|
@@ -10607,7 +11171,7 @@ function useWindowClick(controller) {
|
|
|
10607
11171
|
|
|
10608
11172
|
var useRowSelection = (function () {
|
|
10609
11173
|
/** 控制器 */
|
|
10610
|
-
var controller =
|
|
11174
|
+
var controller = Invoice.useInvoiceController();
|
|
10611
11175
|
/** 列表选中的货物索引列表 */
|
|
10612
11176
|
|
|
10613
11177
|
var selectedRowKeys = controller.useMemo(function (s) {
|
|
@@ -10894,7 +11458,7 @@ var useRowSelection = (function () {
|
|
|
10894
11458
|
};
|
|
10895
11459
|
});
|
|
10896
11460
|
|
|
10897
|
-
var css_248z$7 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n display: flex;\n gap: 10px;\n padding-right: 10px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n
|
|
11461
|
+
var css_248z$7 = ".kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-table-tax-rate .ktsAnt3x-select-selection-selected-value {\n float: right;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able {\n display: flex;\n padding: 10px;\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list {\n flex: 1;\n display: flex;\n gap: 10px;\n padding-right: 10px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button {\n padding-left: 10px;\n padding-right: 10px;\n border-radius: 12px;\n color: #0074ff;\n border: 1px solid #0074ff;\n height: 24px;\n line-height: 22px;\n cursor: pointer;\n font-size: 12px;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-list button[disabled] {\n color: rgba(0, 0, 0, 0.25);\n border: 1px solid;\n}\n.kts-invoice-operate-goods-list .kts-invoice-operate-goods-list-able-extend {\n flex: none;\n display: flex;\n gap: 5px;\n}\n.kts-invoice-operate-goods-list-table.kts-invoice-operate-prefab .ktsAnt3x-table-row {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table {\n border-bottom: 1px solid #dcdcdc;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n color: rgba(0, 0, 0, 0.25);\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import {\n display: flex;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-list-able-list-itemName-import .ktsAnt3x-btn {\n display: block;\n line-height: 0;\n width: auto;\n padding-right: 5px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-table-body {\n height: 263px;\n}\n.kts-invoice-operate-goods-list-table .ktsAnt3x-form-explain {\n position: absolute;\n right: 6px;\n top: 6px;\n}\n.kts-invoice-operate-goods-list-table table {\n border-bottom: 1px solid #d9d9d9 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td {\n padding: 0 !important;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-explain {\n display: none;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item {\n padding: 0;\n margin: 0;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-form-item .ktsAnt3x-form-item-control {\n line-height: inherit;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-select-selection,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .has-error .ktsAnt3x-input:hover {\n border-right-width: 1px !important;\n border-top-width: 1px;\n border-left-width: 1px;\n border-bottom-width: 1px;\n}\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-selection--single,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-select-auto-complete.ktsAnt3x-select .ktsAnt3x-input:hover,\n.kts-invoice-operate-goods-list-table table > .ktsAnt3x-table-tbody > tr > td .ktsAnt3x-input {\n height: 30px;\n border-radius: 0;\n border-right-width: 0 !important;\n border-top-width: 0;\n border-left-width: 0;\n border-bottom-width: 0;\n box-shadow: none;\n}\n.kts-invoice-operate-goods-list-table-search-protrude {\n background: #ff0;\n color: #000;\n font-weight: bold;\n}\n";
|
|
10898
11462
|
styleInject(css_248z$7);
|
|
10899
11463
|
|
|
10900
11464
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
@@ -10919,7 +11483,7 @@ var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
|
10919
11483
|
}(React.Component);
|
|
10920
11484
|
var Main = decorator(Form.create())(function (props) {
|
|
10921
11485
|
/** 控制器 */
|
|
10922
|
-
var controller =
|
|
11486
|
+
var controller = Invoice.useInvoiceController();
|
|
10923
11487
|
var goodsList = controller.useMemo(function (s) {
|
|
10924
11488
|
return s.goodsListState.goodsList;
|
|
10925
11489
|
}, []);
|
|
@@ -10993,7 +11557,7 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
10993
11557
|
}, [controller, props.form]); // 跟新 货物
|
|
10994
11558
|
|
|
10995
11559
|
React.useEffect(function () {
|
|
10996
|
-
controller.
|
|
11560
|
+
controller.run( /*#__PURE__*/function () {
|
|
10997
11561
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
10998
11562
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10999
11563
|
while (1) {
|
|
@@ -11015,7 +11579,7 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
11015
11579
|
return function (_x4) {
|
|
11016
11580
|
return _ref3.apply(this, arguments);
|
|
11017
11581
|
};
|
|
11018
|
-
}())
|
|
11582
|
+
}());
|
|
11019
11583
|
}, [controller, goodsList]);
|
|
11020
11584
|
/** props 产品最大数 更新 */
|
|
11021
11585
|
|
|
@@ -11098,9 +11662,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
11098
11662
|
className: "kts-invoice-operate-goods-list-able"
|
|
11099
11663
|
}, React.createElement("div", {
|
|
11100
11664
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
11101
|
-
}, React.createElement(AddRowButton, null), React.createElement(
|
|
11665
|
+
}, React.createElement(AddRowButton, null), React.createElement(BulkMenu, null), React.createElement(Search, null)), React.createElement("div", {
|
|
11102
11666
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
11103
|
-
}, props.menuExpansion, React.createElement(TaxIncludedSwitch, null))), React.createElement("div", {
|
|
11667
|
+
}, props.menuExpansion, React.createElement(DescribeSwitch, null), React.createElement(TaxIncludedSwitch, null))), React.createElement("div", {
|
|
11104
11668
|
className: classnames('kts-invoice-operate-goods-list-table', {
|
|
11105
11669
|
'kts-invoice-operate-prefab': isprefab
|
|
11106
11670
|
})
|
|
@@ -11165,7 +11729,7 @@ var Main$1 = decorator(Form.create())(function (props) {
|
|
|
11165
11729
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11166
11730
|
/** 控制器 */
|
|
11167
11731
|
|
|
11168
|
-
var controller =
|
|
11732
|
+
var controller = Invoice.useInvoiceController();
|
|
11169
11733
|
/** 控制器 */
|
|
11170
11734
|
|
|
11171
11735
|
var model = controller.useMemo(function (s) {
|
|
@@ -11283,7 +11847,7 @@ var Sign = decorator(Form.create())(function (props) {
|
|
|
11283
11847
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11284
11848
|
/** 控制器 */
|
|
11285
11849
|
|
|
11286
|
-
var controller =
|
|
11850
|
+
var controller = Invoice.useInvoiceController();
|
|
11287
11851
|
var model = controller.useMemo(function (s) {
|
|
11288
11852
|
return s.model;
|
|
11289
11853
|
}, []); // 注册 form
|
|
@@ -11325,7 +11889,7 @@ var formItemLayout = {
|
|
|
11325
11889
|
};
|
|
11326
11890
|
|
|
11327
11891
|
var ImportBuyerButton = (function () {
|
|
11328
|
-
var controller =
|
|
11892
|
+
var controller = Invoice.useInvoiceController();
|
|
11329
11893
|
var onClick = React.useCallback(function () {
|
|
11330
11894
|
controller.pipeline( /*#__PURE__*/function () {
|
|
11331
11895
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
@@ -11357,7 +11921,7 @@ var ImportBuyerButton = (function () {
|
|
|
11357
11921
|
|
|
11358
11922
|
var BuyerNameInput = (function (props) {
|
|
11359
11923
|
/** 控制器 */
|
|
11360
|
-
var controller =
|
|
11924
|
+
var controller = Invoice.useInvoiceController();
|
|
11361
11925
|
/** 组件模式 */
|
|
11362
11926
|
|
|
11363
11927
|
var model = controller.useMemo(function (s) {
|
|
@@ -11517,7 +12081,7 @@ var BuyerNameInput = (function (props) {
|
|
|
11517
12081
|
|
|
11518
12082
|
function useDataSource() {
|
|
11519
12083
|
/** 控制器 */
|
|
11520
|
-
var controller =
|
|
12084
|
+
var controller = Invoice.useInvoiceController();
|
|
11521
12085
|
|
|
11522
12086
|
var _React$useState3 = React.useState(false),
|
|
11523
12087
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
@@ -11601,7 +12165,7 @@ function interval(i, t) {
|
|
|
11601
12165
|
var css_248z$a = ".kts-invoice-operate-buyer {\n display: flex;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message {\n flex: 1;\n display: flex;\n position: relative;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .ktsAnt3x-descriptions-item-label {\n width: 179px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list {\n width: 100%;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-view {\n border: none;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-label {\n padding: 0 10px;\n font-size: 12px;\n background-color: #fff;\n line-height: 30px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content {\n padding: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .ktsAnt3x-input {\n box-shadow: none;\n border-color: #fff;\n border-radius: 0;\n padding: 0 10px;\n font-size: 12px;\n line-height: 30px;\n width: 100%;\n height: 100%;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .ktsAnt3x-input:hover {\n border: 1 solid;\n border-color: #40a9ff;\n border-right-width: 1px !important;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input,\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input:hover {\n background-color: #fff;\n border: 1 solid;\n border-color: #f5222d;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-control {\n line-height: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-children {\n height: 30px;\n display: block;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-item-children .ktsAnt3x-btn {\n line-height: 0;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-list .ktsAnt3x-form-explain {\n position: absolute;\n left: 5px;\n top: 6px;\n z-index: 10;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-message .kts-invoice-operate-buyer-message-Import {\n position: absolute;\n right: 0px;\n top: 0px;\n z-index: 10;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-password {\n border-left: 1px solid #dcdcdc;\n display: flex;\n flex: none;\n width: 458px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-title {\n flex: none;\n width: 30px;\n height: 100%;\n text-align: center;\n border-right: 1px solid #dcdcdc;\n display: table;\n padding: 0 5px;\n}\n.kts-invoice-operate-buyer .kts-invoice-operate-buyer-title label {\n display: table-cell;\n vertical-align: middle;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover {\n padding-top: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .ktsAnt3x-popover-inner-content {\n padding: 6px 0;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .ktsAnt3x-popover-arrow {\n display: none;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content {\n width: 567px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-block {\n padding: 14px 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-block label {\n display: block;\n font-size: 12px;\n color: #666666;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued {\n padding: 0;\n margin: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued li {\n list-style: none;\n width: 50%;\n float: left;\n margin-bottom: 20px;\n padding: 0 10px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-recently-issued::after {\n content: \".\";\n display: block;\n height: 0;\n clear: left;\n visibility: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company {\n padding: 0;\n margin: 0;\n font-size: 12px;\n padding: 10px;\n font-weight: bold;\n color: #000000;\n cursor: pointer;\n transition: background 0.4s;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company:hover {\n background: #e6e6e6e6;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company:last-child {\n margin-bottom: 0;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company li {\n list-style: none;\n width: 50%;\n float: left;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n padding-right: 10px;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content .kts-invoice-operate-buyer-name-content-select-company::after {\n content: \".\";\n display: block;\n height: 0;\n clear: left;\n visibility: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content-tag {\n line-height: 1;\n padding: 4px 12px;\n background: #F3F3F3;\n border-radius: 9999px;\n font-size: 12px;\n font-weight: bold;\n color: #000;\n cursor: pointer;\n transition: background 0.4s;\n display: inline-block;\n max-width: 100%;\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n}\n.ktsAnt3x-popover.kts-invoice-operate-buyer-name-popover .kts-invoice-operate-buyer-name-content-tag:hover {\n background: #e6e6e6e6;\n}\n";
|
|
11602
12166
|
styleInject(css_248z$a);
|
|
11603
12167
|
|
|
11604
|
-
var Text$
|
|
12168
|
+
var Text$6 = Typography.Text;
|
|
11605
12169
|
|
|
11606
12170
|
var Buyer$1 = /*#__PURE__*/function (_React$Component) {
|
|
11607
12171
|
_inherits(Buyer, _React$Component);
|
|
@@ -11633,7 +12197,7 @@ var Main$2 = decorator(Form.create())(function (props) {
|
|
|
11633
12197
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11634
12198
|
/** 控制器 */
|
|
11635
12199
|
|
|
11636
|
-
var controller =
|
|
12200
|
+
var controller = Invoice.useInvoiceController();
|
|
11637
12201
|
/** 组件模式 */
|
|
11638
12202
|
|
|
11639
12203
|
var model = controller.useMemo(function (s) {
|
|
@@ -11715,7 +12279,7 @@ var Main$2 = decorator(Form.create())(function (props) {
|
|
|
11715
12279
|
if (e.options.rules.some(function (e) {
|
|
11716
12280
|
return e.required;
|
|
11717
12281
|
})) {
|
|
11718
|
-
return React.createElement(React.Fragment, null, React.createElement(Text$
|
|
12282
|
+
return React.createElement(React.Fragment, null, React.createElement(Text$6, {
|
|
11719
12283
|
type: "danger"
|
|
11720
12284
|
}, "*"), e.label);
|
|
11721
12285
|
} else {
|
|
@@ -11751,7 +12315,7 @@ var Main$2 = decorator(Form.create())(function (props) {
|
|
|
11751
12315
|
});
|
|
11752
12316
|
|
|
11753
12317
|
var ImportBuyerDrawer = (function () {
|
|
11754
|
-
var controller =
|
|
12318
|
+
var controller = Invoice.useInvoiceController();
|
|
11755
12319
|
var visible = controller.useMemo(function (s) {
|
|
11756
12320
|
return s.buyerState.isVisibleDrawer;
|
|
11757
12321
|
}, []);
|
|
@@ -11793,7 +12357,7 @@ var ImportBuyerDrawer = (function () {
|
|
|
11793
12357
|
});
|
|
11794
12358
|
|
|
11795
12359
|
var DrawerBody$1 = function DrawerBody() {
|
|
11796
|
-
var controller =
|
|
12360
|
+
var controller = Invoice.useInvoiceController();
|
|
11797
12361
|
var columns = controller.useMemo(function (e) {
|
|
11798
12362
|
return e.buyerState.columns;
|
|
11799
12363
|
}, []);
|
|
@@ -11881,7 +12445,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
11881
12445
|
};
|
|
11882
12446
|
|
|
11883
12447
|
var ImportGoodsDrawer = (function () {
|
|
11884
|
-
var controller =
|
|
12448
|
+
var controller = Invoice.useInvoiceController();
|
|
11885
12449
|
var visible = controller.useMemo(function (s) {
|
|
11886
12450
|
return s.goodsListState.importGoods.isVisibleDrawer;
|
|
11887
12451
|
}, []);
|
|
@@ -11927,7 +12491,7 @@ var ImportGoodsDrawer = (function () {
|
|
|
11927
12491
|
});
|
|
11928
12492
|
|
|
11929
12493
|
var DrawerBody$2 = function DrawerBody() {
|
|
11930
|
-
var controller =
|
|
12494
|
+
var controller = Invoice.useInvoiceController();
|
|
11931
12495
|
var columns = controller.useMemo(function (s) {
|
|
11932
12496
|
return s.goodsListState.importGoods.columns;
|
|
11933
12497
|
}, []);
|
|
@@ -11961,6 +12525,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11961
12525
|
onClick: function onClick() {
|
|
11962
12526
|
controller.run( /*#__PURE__*/function () {
|
|
11963
12527
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
12528
|
+
var between, editGood;
|
|
11964
12529
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11965
12530
|
while (1) {
|
|
11966
12531
|
switch (_context2.prev = _context2.next) {
|
|
@@ -11969,7 +12534,8 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11969
12534
|
return !record[e] && record[e] !== 0;
|
|
11970
12535
|
}).forEach(function (e) {
|
|
11971
12536
|
delete record[e];
|
|
11972
|
-
});
|
|
12537
|
+
}); // 导入时校验函数
|
|
12538
|
+
|
|
11973
12539
|
_context2.next = 3;
|
|
11974
12540
|
return s.goodsListState.importGoods.verifyFn(record);
|
|
11975
12541
|
|
|
@@ -11997,30 +12563,40 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11997
12563
|
record.priceIncludeTax = s.goodsListState.editGood.priceIncludeTax;
|
|
11998
12564
|
record.lineAmountExcludeTax = s.goodsListState.editGood.lineAmountExcludeTax;
|
|
11999
12565
|
record.lineAmountIncludeTax = s.goodsListState.editGood.lineAmountIncludeTax;
|
|
12000
|
-
}
|
|
12566
|
+
} // 中间数据
|
|
12001
12567
|
|
|
12002
|
-
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
|
|
12003
12568
|
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12569
|
+
between = _objectSpread2({}, record);
|
|
12570
|
+
between.itemName = getItemName$1(record, s.goodsListState.editGood);
|
|
12571
|
+
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
|
|
12572
|
+
|
|
12573
|
+
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
12574
|
+
|
|
12575
|
+
if (editGood.taxRate) {
|
|
12576
|
+
editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
|
|
12007
12577
|
}
|
|
12008
12578
|
|
|
12009
|
-
|
|
12579
|
+
if ("".concat(editGood.priceIncludeTax) === '0') {
|
|
12580
|
+
editGood.priceIncludeTax = undefined;
|
|
12581
|
+
editGood.priceExcludeTax = undefined;
|
|
12582
|
+
} else {
|
|
12583
|
+
editGood.priceExcludeTax = getPriceExcludeTax(editGood, record);
|
|
12584
|
+
}
|
|
12585
|
+
|
|
12586
|
+
if (editGood.quantity && editGood.priceIncludeTax) {
|
|
12587
|
+
editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax);
|
|
12588
|
+
} // 导入FORM里
|
|
12010
12589
|
|
|
12011
|
-
case 12:
|
|
12012
|
-
if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
|
|
12013
12590
|
|
|
12014
|
-
if (
|
|
12015
|
-
s.goodsListState.
|
|
12016
|
-
|
|
12591
|
+
if (s.goodsListState.isMyShow) {
|
|
12592
|
+
s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
12593
|
+
itemName: editGood.itemNameSelf,
|
|
12594
|
+
itemModelName: editGood.itemModelNameSelf
|
|
12595
|
+
}));
|
|
12017
12596
|
} else {
|
|
12018
|
-
s.goodsListState.
|
|
12597
|
+
s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
|
|
12019
12598
|
}
|
|
12020
12599
|
|
|
12021
|
-
if (s.goodsListState.editGood.quantity && s.goodsListState.editGood.priceIncludeTax) s.goodsListState.editGood.lineAmountIncludeTax = countAmountIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
|
|
12022
|
-
s.goodsListState.editGood.itemName = getItemName(record);
|
|
12023
|
-
s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
|
|
12024
12600
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
12025
12601
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
12026
12602
|
|
|
@@ -12042,11 +12618,12 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
12042
12618
|
});
|
|
12043
12619
|
};
|
|
12044
12620
|
/** 货物名称 */
|
|
12621
|
+
// const getItemName = (record: any) => {
|
|
12622
|
+
// return record.shorthand
|
|
12623
|
+
// ? `*${record.shorthand}*${record.itemName}`
|
|
12624
|
+
// : record.itemName;
|
|
12625
|
+
// };
|
|
12045
12626
|
|
|
12046
|
-
|
|
12047
|
-
var getItemName = function getItemName(record) {
|
|
12048
|
-
return record.shorthand ? "*".concat(record.shorthand, "*").concat(record.itemName) : record.itemName;
|
|
12049
|
-
};
|
|
12050
12627
|
/** 货物单价,不含税 */
|
|
12051
12628
|
|
|
12052
12629
|
|
|
@@ -12054,6 +12631,39 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record) {
|
|
|
12054
12631
|
if (!s.taxRate && s.taxRate !== 0 || !record.priceIncludeTax && record.priceIncludeTax !== 0) return; // 单价(含税)/(1+税率) = 单价(不含税)
|
|
12055
12632
|
|
|
12056
12633
|
return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")));
|
|
12634
|
+
}; // 获取我方名称
|
|
12635
|
+
|
|
12636
|
+
|
|
12637
|
+
var getItemName$1 = function getItemName(record, editGood) {
|
|
12638
|
+
var _getSN;
|
|
12639
|
+
|
|
12640
|
+
var shorthand;
|
|
12641
|
+
shorthand = record.shorthand;
|
|
12642
|
+
|
|
12643
|
+
if (shorthand) {
|
|
12644
|
+
return "*".concat(shorthand, "*").concat(record.itemName);
|
|
12645
|
+
}
|
|
12646
|
+
|
|
12647
|
+
shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
|
|
12648
|
+
|
|
12649
|
+
if (shorthand) {
|
|
12650
|
+
return "*".concat(shorthand, "*").concat(record.itemNameSelf);
|
|
12651
|
+
}
|
|
12652
|
+
|
|
12653
|
+
return record.itemName;
|
|
12654
|
+
}; // 获取他方名称
|
|
12655
|
+
|
|
12656
|
+
|
|
12657
|
+
var getItemNameOther = function getItemNameOther(record, editGood) {
|
|
12658
|
+
if (!editGood.itemName) return editGood.itemName;
|
|
12659
|
+
var shorthand;
|
|
12660
|
+
shorthand = record.shorthand;
|
|
12661
|
+
|
|
12662
|
+
if (shorthand) {
|
|
12663
|
+
return "*".concat(shorthand, "*").concat(record.itemNameSelf);
|
|
12664
|
+
}
|
|
12665
|
+
|
|
12666
|
+
return record.itemName;
|
|
12057
12667
|
};
|
|
12058
12668
|
|
|
12059
12669
|
/**
|
|
@@ -12113,7 +12723,7 @@ styleInject(css_248z$b);
|
|
|
12113
12723
|
var TreeNode = Tree.TreeNode;
|
|
12114
12724
|
var confirm = Modal.confirm;
|
|
12115
12725
|
var EndowCodeDrawer = (function () {
|
|
12116
|
-
var controller =
|
|
12726
|
+
var controller = Invoice.useInvoiceController();
|
|
12117
12727
|
var visible = controller.useMemo(function (s) {
|
|
12118
12728
|
return s.goodsListState.endowCode.endowcodeGoodIndex.length > 0;
|
|
12119
12729
|
}, []);
|
|
@@ -12228,7 +12838,7 @@ var EndowCodeDrawer = (function () {
|
|
|
12228
12838
|
var DrawerBody$3 = function DrawerBody(props) {
|
|
12229
12839
|
var _defaultValue$taxRate, _defaultValue$favoure;
|
|
12230
12840
|
|
|
12231
|
-
var controller =
|
|
12841
|
+
var controller = Invoice.useInvoiceController();
|
|
12232
12842
|
var defaultValue = props.defaultValue;
|
|
12233
12843
|
var actions = React.useMemo(function () {
|
|
12234
12844
|
return createAsyncFormActions();
|
|
@@ -12613,9 +13223,10 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
12613
13223
|
}); // 赋码
|
|
12614
13224
|
|
|
12615
13225
|
endowCodeGood.forEach(function (good) {
|
|
12616
|
-
if (!good) return;
|
|
12617
|
-
|
|
12618
|
-
good.
|
|
13226
|
+
if (!good) return;
|
|
13227
|
+
good.itemName = setShorthand(good.itemName, values.shorthand);
|
|
13228
|
+
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
|
|
13229
|
+
// good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
|
|
12619
13230
|
|
|
12620
13231
|
good.taxClassificationCode = values.taxClassificationCode;
|
|
12621
13232
|
good.taxRate = values.taxRate;
|
|
@@ -12863,41 +13474,189 @@ var getShorthand = function getShorthand(value) {
|
|
|
12863
13474
|
return undefined;
|
|
12864
13475
|
}
|
|
12865
13476
|
};
|
|
12866
|
-
/** 简称填入名称 */
|
|
12867
13477
|
|
|
13478
|
+
function AddComparisonDrawer() {
|
|
13479
|
+
var _Form$useForm = Form$1.useForm(),
|
|
13480
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
13481
|
+
form = _Form$useForm2[0];
|
|
13482
|
+
/** 控制器 */
|
|
12868
13483
|
|
|
12869
|
-
var getItemName$1 = function getItemName(value, shorthand) {
|
|
12870
|
-
if (!value) value = '';
|
|
12871
13484
|
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
}
|
|
13485
|
+
var controller = Invoice.useInvoiceController();
|
|
13486
|
+
/** 正在 添加商品对照 的货物索引 */
|
|
12875
13487
|
|
|
12876
|
-
var
|
|
13488
|
+
var addComparisonIndex = controller.useMemo(function (s) {
|
|
13489
|
+
return s.goodsListState.addComparisonIndex;
|
|
13490
|
+
}, []);
|
|
13491
|
+
/** 货物字典 */
|
|
12877
13492
|
|
|
12878
|
-
|
|
12879
|
-
return
|
|
12880
|
-
}
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
13493
|
+
var goodsMap = controller.useMemo(function (s) {
|
|
13494
|
+
return s.goodsListState.goodsMap;
|
|
13495
|
+
}, []);
|
|
13496
|
+
/** 正在 对照 的货物 */
|
|
13497
|
+
|
|
13498
|
+
var good = React.useMemo(function () {
|
|
13499
|
+
return addComparisonIndex ? goodsMap.get(addComparisonIndex) : undefined;
|
|
13500
|
+
}, [addComparisonIndex]);
|
|
13501
|
+
/** 关闭对照 */
|
|
13502
|
+
|
|
13503
|
+
var onClose = React.useCallback(controller.pipeline( /*#__PURE__*/function () {
|
|
13504
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
13505
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13506
|
+
while (1) {
|
|
13507
|
+
switch (_context.prev = _context.next) {
|
|
13508
|
+
case 0:
|
|
13509
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
13510
|
+
|
|
13511
|
+
case 1:
|
|
13512
|
+
case "end":
|
|
13513
|
+
return _context.stop();
|
|
13514
|
+
}
|
|
13515
|
+
}
|
|
13516
|
+
}, _callee);
|
|
13517
|
+
}));
|
|
13518
|
+
|
|
13519
|
+
return function (_x) {
|
|
13520
|
+
return _ref.apply(this, arguments);
|
|
13521
|
+
};
|
|
13522
|
+
}()), [controller]);
|
|
13523
|
+
/** 提交数据 */
|
|
13524
|
+
|
|
13525
|
+
var onSubmit = React.useCallback(function () {
|
|
13526
|
+
controller.run( /*#__PURE__*/function () {
|
|
13527
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
13528
|
+
var _getSN, _getSN2, values, shorthand;
|
|
13529
|
+
|
|
13530
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
13531
|
+
while (1) {
|
|
13532
|
+
switch (_context2.prev = _context2.next) {
|
|
13533
|
+
case 0:
|
|
13534
|
+
if (good) {
|
|
13535
|
+
_context2.next = 2;
|
|
13536
|
+
break;
|
|
13537
|
+
}
|
|
13538
|
+
|
|
13539
|
+
return _context2.abrupt("return");
|
|
13540
|
+
|
|
13541
|
+
case 2:
|
|
13542
|
+
_context2.prev = 2;
|
|
13543
|
+
_context2.next = 5;
|
|
13544
|
+
return form.validateFields();
|
|
13545
|
+
|
|
13546
|
+
case 5:
|
|
13547
|
+
values = _context2.sent;
|
|
13548
|
+
shorthand = s.goodsListState.isMyShow ? (_getSN = getSN(good.itemNameSelf)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand : (_getSN2 = getSN(good.itemName)) === null || _getSN2 === void 0 ? void 0 : _getSN2.shorthand;
|
|
13549
|
+
good.itemCode = values.itemCode;
|
|
13550
|
+
good.itemCodeSelf = values.itemCodeSelf;
|
|
13551
|
+
good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
|
|
13552
|
+
good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
|
|
13553
|
+
good.itemModelName = values.itemModelName;
|
|
13554
|
+
good.itemModelNameSelf = values.itemModelNameSelf;
|
|
13555
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
13556
|
+
s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
|
|
13557
|
+
_context2.next = 19;
|
|
13558
|
+
break;
|
|
13559
|
+
|
|
13560
|
+
case 17:
|
|
13561
|
+
_context2.prev = 17;
|
|
13562
|
+
_context2.t0 = _context2["catch"](2);
|
|
13563
|
+
|
|
13564
|
+
case 19:
|
|
13565
|
+
case "end":
|
|
13566
|
+
return _context2.stop();
|
|
13567
|
+
}
|
|
13568
|
+
}
|
|
13569
|
+
}, _callee2, null, [[2, 17]]);
|
|
13570
|
+
}));
|
|
13571
|
+
|
|
13572
|
+
return function (_x2) {
|
|
13573
|
+
return _ref2.apply(this, arguments);
|
|
13574
|
+
};
|
|
13575
|
+
}());
|
|
13576
|
+
}, [form, good]);
|
|
13577
|
+
React.useEffect(function () {
|
|
13578
|
+
form.resetFields();
|
|
13579
|
+
|
|
13580
|
+
if (good) {
|
|
13581
|
+
var _getSN3, _getSN4;
|
|
13582
|
+
|
|
13583
|
+
form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
|
|
13584
|
+
itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
|
|
13585
|
+
itemNameSelf: (_getSN4 = getSN(good.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
|
|
13586
|
+
}));
|
|
13587
|
+
}
|
|
13588
|
+
}, [good]);
|
|
13589
|
+
return React.createElement(Drawer$1, {
|
|
13590
|
+
width: 500,
|
|
13591
|
+
onClose: onClose,
|
|
13592
|
+
placement: "right",
|
|
13593
|
+
title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
|
|
13594
|
+
visible: !!good,
|
|
13595
|
+
footer: React.createElement("div", {
|
|
13596
|
+
style: {
|
|
13597
|
+
display: 'flex',
|
|
13598
|
+
justifyContent: 'flex-end',
|
|
13599
|
+
gap: 10
|
|
13600
|
+
}
|
|
13601
|
+
}, React.createElement(Button, {
|
|
13602
|
+
type: "primary",
|
|
13603
|
+
onClick: onSubmit
|
|
13604
|
+
}, "\u63D0\u4EA4"), React.createElement(Button, {
|
|
13605
|
+
onClick: onClose
|
|
13606
|
+
}, "\u53D6\u6D88"))
|
|
13607
|
+
}, !!good && React.createElement(Form$1, {
|
|
13608
|
+
layout: "vertical",
|
|
13609
|
+
style: {
|
|
13610
|
+
flex: 1
|
|
13611
|
+
},
|
|
13612
|
+
form: form
|
|
13613
|
+
}, React.createElement(Row, {
|
|
13614
|
+
gutter: [8, 8]
|
|
13615
|
+
}, React.createElement(Col, {
|
|
13616
|
+
span: 12
|
|
13617
|
+
}, React.createElement(Form$1.Item, {
|
|
13618
|
+
name: "itemNameSelf",
|
|
13619
|
+
label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
|
|
13620
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13621
|
+
span: 12
|
|
13622
|
+
}, React.createElement(Form$1.Item, {
|
|
13623
|
+
name: "itemName",
|
|
13624
|
+
label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
|
|
13625
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13626
|
+
span: 12
|
|
13627
|
+
}, React.createElement(Form$1.Item, {
|
|
13628
|
+
name: 'itemModelNameSelf',
|
|
13629
|
+
label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
|
|
13630
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13631
|
+
span: 12
|
|
13632
|
+
}, React.createElement(Form$1.Item, {
|
|
13633
|
+
name: "itemModelName",
|
|
13634
|
+
label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
|
|
13635
|
+
}, React.createElement(Input, null))))));
|
|
13636
|
+
} // function validateFields(form: WrappedFormUtils<any>) {
|
|
13637
|
+
// return new Promise<{ err: any, values: any }>(resolve => {
|
|
13638
|
+
// form.validateFields((err, values) => {
|
|
13639
|
+
// resolve({ err, values })
|
|
13640
|
+
// })
|
|
13641
|
+
// })
|
|
13642
|
+
// }
|
|
12884
13643
|
|
|
12885
13644
|
/** 发票组件的上下文 */
|
|
12886
13645
|
|
|
12887
13646
|
var InvoiceContext = React.createContext(undefined);
|
|
12888
13647
|
|
|
12889
|
-
var
|
|
12890
|
-
_inherits(
|
|
13648
|
+
var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
13649
|
+
_inherits(Invoice, _React$PureComponent);
|
|
12891
13650
|
|
|
12892
|
-
var _super = _createSuper(
|
|
13651
|
+
var _super = _createSuper(Invoice);
|
|
12893
13652
|
|
|
12894
|
-
function
|
|
12895
|
-
_classCallCheck(this,
|
|
13653
|
+
function Invoice() {
|
|
13654
|
+
_classCallCheck(this, Invoice);
|
|
12896
13655
|
|
|
12897
13656
|
return _super.apply(this, arguments);
|
|
12898
13657
|
}
|
|
12899
13658
|
|
|
12900
|
-
_createClass(
|
|
13659
|
+
_createClass(Invoice, [{
|
|
12901
13660
|
key: "render",
|
|
12902
13661
|
value:
|
|
12903
13662
|
/** 控制器 */
|
|
@@ -12920,18 +13679,18 @@ var default_1 = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
12920
13679
|
}
|
|
12921
13680
|
}]);
|
|
12922
13681
|
|
|
12923
|
-
return
|
|
13682
|
+
return Invoice;
|
|
12924
13683
|
}(React.PureComponent);
|
|
12925
13684
|
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
13685
|
+
Invoice.InvoiceController = InvoiceController;
|
|
13686
|
+
Invoice.InvoiceHeader = InvoiceHeader;
|
|
13687
|
+
Invoice.GoodsList = GoodsList;
|
|
13688
|
+
Invoice.Seller = Buyer;
|
|
13689
|
+
Invoice.Sign = Sign;
|
|
13690
|
+
Invoice.Buyer = Buyer$1;
|
|
13691
|
+
Invoice.idGenerator = idGenerator;
|
|
12933
13692
|
|
|
12934
|
-
|
|
13693
|
+
Invoice.useInvoiceController = function () {
|
|
12935
13694
|
return React.useContext(InvoiceContext);
|
|
12936
13695
|
};
|
|
12937
13696
|
|
|
@@ -12963,7 +13722,7 @@ var Main$3 = function Main(props) {
|
|
|
12963
13722
|
/** 销售方 */
|
|
12964
13723
|
, props.sign || React.createElement(Sign, null)
|
|
12965
13724
|
/** 落款 */
|
|
12966
|
-
, props.footExpand), React.createElement(ImportBuyerDrawer, null), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null));
|
|
13725
|
+
, props.footExpand), React.createElement(ImportBuyerDrawer, null), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null), React.createElement(AddComparisonDrawer, null));
|
|
12967
13726
|
};
|
|
12968
13727
|
|
|
12969
|
-
export {
|
|
13728
|
+
export { Invoice, InvoiceController };
|