kts-component-invoice-operate 1.2.25 → 2.0.2
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 +1084 -314
- package/dist/index.js +1083 -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 +21 -3
- package/src/Invoice/index.tsx +5 -1
- package/src/Invoice/tools/itemName/index.ts +48 -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,195 @@ 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
|
+
debugger;
|
|
2938
|
+
if (!value) return undefined;
|
|
2939
|
+
var arr = value.match(/\*[^*]+\*/);
|
|
2940
|
+
|
|
2941
|
+
if (arr && arr[0]) {
|
|
2942
|
+
return {
|
|
2943
|
+
shorthand: arr[0].split('*')[1],
|
|
2944
|
+
full: value.replace(arr[0], '')
|
|
2945
|
+
};
|
|
2946
|
+
} else {
|
|
2947
|
+
return {
|
|
2948
|
+
shorthand: undefined,
|
|
2949
|
+
full: value
|
|
2950
|
+
};
|
|
2951
|
+
}
|
|
2952
|
+
};
|
|
2953
|
+
/** 组合全称加简称 */
|
|
2954
|
+
|
|
2955
|
+
var getItemName = function getItemName(value) {
|
|
2956
|
+
if (value.shorthand) {
|
|
2957
|
+
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2958
|
+
} else {
|
|
2959
|
+
return value.full;
|
|
2960
|
+
}
|
|
2961
|
+
};
|
|
2962
|
+
/** 设置简称 */
|
|
2963
|
+
|
|
2964
|
+
var setShorthand = function setShorthand(name, shorthand) {
|
|
2965
|
+
if (!name) return undefined;
|
|
2966
|
+
var sn = getSN(name);
|
|
2967
|
+
if (!sn) return undefined;
|
|
2968
|
+
sn.shorthand = shorthand || '';
|
|
2969
|
+
return getItemName(sn);
|
|
2970
|
+
};
|
|
2971
|
+
|
|
2972
|
+
var useCommodityComparisonButton = (function () {
|
|
2973
|
+
var controller = Invoice.useInvoiceController();
|
|
2974
|
+
|
|
2975
|
+
var _controller$useMemo = controller.useMemo(function (s) {
|
|
2976
|
+
return s.goodsListState.productComparison;
|
|
2977
|
+
}, []),
|
|
2978
|
+
onComply = _controller$useMemo.onComply;
|
|
2798
2979
|
/** 是否禁用 */
|
|
2799
2980
|
|
|
2981
|
+
|
|
2800
2982
|
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
|
-
});
|
|
2983
|
+
return s.goodsListState.selectedGoodIndex.length <= 0;
|
|
2807
2984
|
}, []);
|
|
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
|
-
});
|
|
2985
|
+
/** 点击了 */
|
|
2819
2986
|
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2987
|
+
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2988
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2989
|
+
while (1) {
|
|
2990
|
+
switch (_context2.prev = _context2.next) {
|
|
2991
|
+
case 0:
|
|
2992
|
+
_context2.next = 2;
|
|
2993
|
+
return controller.saveEditGood();
|
|
2825
2994
|
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
});
|
|
2995
|
+
case 2:
|
|
2996
|
+
_context2.next = 4;
|
|
2997
|
+
return controller.wait();
|
|
2830
2998
|
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
}, _callee);
|
|
2837
|
-
}));
|
|
2999
|
+
case 4:
|
|
3000
|
+
_context2.next = 6;
|
|
3001
|
+
return controller.run( /*#__PURE__*/function () {
|
|
3002
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
3003
|
+
var _s$goodsListState, _s$goodsListState$pro;
|
|
2838
3004
|
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
3005
|
+
var goods, newGoods;
|
|
3006
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3007
|
+
while (1) {
|
|
3008
|
+
switch (_context.prev = _context.next) {
|
|
3009
|
+
case 0:
|
|
3010
|
+
if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
|
|
3011
|
+
_context.next = 3;
|
|
3012
|
+
break;
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3015
|
+
coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
|
|
3016
|
+
message.error('不能给正在编辑的货物执行商品对照');
|
|
3017
|
+
});
|
|
3018
|
+
return _context.abrupt("return");
|
|
3019
|
+
|
|
3020
|
+
case 3:
|
|
3021
|
+
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) {
|
|
3022
|
+
_context.next = 5;
|
|
3023
|
+
break;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
return _context.abrupt("return");
|
|
3027
|
+
|
|
3028
|
+
case 5:
|
|
3029
|
+
goods = s.goodsListState.selectedGoodIndex.map(function (e) {
|
|
3030
|
+
var _getSN, _getSN2;
|
|
3031
|
+
|
|
3032
|
+
var t = s.goodsListState.goodsMap.get(e);
|
|
3033
|
+
if (!t) return undefined;
|
|
3034
|
+
return _objectSpread2(_objectSpread2({}, t), {}, {
|
|
3035
|
+
itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
|
|
3036
|
+
itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
|
|
3037
|
+
});
|
|
3038
|
+
}).filter(function (e) {
|
|
3039
|
+
return !!e;
|
|
3040
|
+
}); // 比对后的商品
|
|
3041
|
+
|
|
3042
|
+
_context.next = 8;
|
|
3043
|
+
return s.goodsListState.productComparison.onComply(goods);
|
|
3044
|
+
|
|
3045
|
+
case 8:
|
|
3046
|
+
newGoods = _context.sent;
|
|
3047
|
+
newGoods.filter(function (e) {
|
|
3048
|
+
var _getSN3, _getSN4;
|
|
3049
|
+
|
|
3050
|
+
var vt = s.goodsListState.goodsMap.get(e.$index);
|
|
3051
|
+
if (!vt) return undefined;
|
|
3052
|
+
vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
|
|
3053
|
+
vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
|
|
3054
|
+
vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
|
|
3055
|
+
vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
|
|
3056
|
+
vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
|
|
3057
|
+
vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
|
|
3058
|
+
});
|
|
3059
|
+
|
|
3060
|
+
case 10:
|
|
3061
|
+
case "end":
|
|
3062
|
+
return _context.stop();
|
|
3063
|
+
}
|
|
3064
|
+
}
|
|
3065
|
+
}, _callee);
|
|
3066
|
+
}));
|
|
3067
|
+
|
|
3068
|
+
return function (_x) {
|
|
3069
|
+
return _ref2.apply(this, arguments);
|
|
3070
|
+
};
|
|
3071
|
+
}());
|
|
3072
|
+
|
|
3073
|
+
case 6:
|
|
3074
|
+
case "end":
|
|
3075
|
+
return _context2.stop();
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
}, _callee2);
|
|
3079
|
+
})), []);
|
|
3080
|
+
var menuItem = React.useMemo(function () {
|
|
3081
|
+
// 没用 执行商品对照 的方法 不显示按钮
|
|
3082
|
+
if (!onComply) return React.createElement(React.Fragment, null);
|
|
3083
|
+
return React.createElement(Menu.Item, {
|
|
3084
|
+
key: "3",
|
|
3085
|
+
disabled: disabled,
|
|
3086
|
+
onClick: onClick
|
|
3087
|
+
}, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
|
|
3088
|
+
}, [disabled, onClick, onComply]);
|
|
3089
|
+
return {
|
|
3090
|
+
menuItem: menuItem
|
|
3091
|
+
};
|
|
2850
3092
|
});
|
|
2851
3093
|
|
|
3094
|
+
function BulkMenu() {
|
|
3095
|
+
/** 删除行 */
|
|
3096
|
+
var delRowButton = useDelRowButton();
|
|
3097
|
+
/** 添加折扣行 */
|
|
3098
|
+
|
|
3099
|
+
var addDiscountRowButton = useAddDiscountRowButton();
|
|
3100
|
+
/** 批量赋码 */
|
|
3101
|
+
|
|
3102
|
+
var endowCodeButton = useEndowCodeButton();
|
|
3103
|
+
/** 执行商品对照 */
|
|
3104
|
+
|
|
3105
|
+
var commodityComparisonButton = useCommodityComparisonButton();
|
|
3106
|
+
var menu = React.createElement(Menu, null, delRowButton.menuItem, addDiscountRowButton.menuItem, endowCodeButton.menuItem, commodityComparisonButton.menuItem);
|
|
3107
|
+
return React.createElement(React.Fragment, null, React.createElement(Dropdown, {
|
|
3108
|
+
overlay: menu
|
|
3109
|
+
}, React.createElement(Button, null, "\u6279\u91CF\u64CD\u4F5C\u884C")), addDiscountRowButton.drawer);
|
|
3110
|
+
}
|
|
3111
|
+
|
|
2852
3112
|
var _defs$1, _path$2;
|
|
2853
3113
|
|
|
2854
3114
|
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 +3125,7 @@ function SvgSpot(props) {
|
|
|
2865
3125
|
|
|
2866
3126
|
var Text$1 = Typography.Text;
|
|
2867
3127
|
var useDelItem = (function (goods) {
|
|
2868
|
-
var controller =
|
|
3128
|
+
var controller = Invoice.useInvoiceController();
|
|
2869
3129
|
var onClick = React.useCallback(function () {
|
|
2870
3130
|
controller.delGood(goods.$index);
|
|
2871
3131
|
}, [controller, goods.$index]);
|
|
@@ -2887,7 +3147,7 @@ var useDelItem = (function (goods) {
|
|
|
2887
3147
|
|
|
2888
3148
|
var Text$2 = Typography.Text;
|
|
2889
3149
|
var useAddDiscount = (function (goods) {
|
|
2890
|
-
var controller =
|
|
3150
|
+
var controller = Invoice.useInvoiceController();
|
|
2891
3151
|
/** 点击了 添加折扣行 按钮 */
|
|
2892
3152
|
|
|
2893
3153
|
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -9485,44 +9745,6 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
9485
9745
|
};
|
|
9486
9746
|
}());
|
|
9487
9747
|
};
|
|
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
9748
|
/** 单调赋码 */
|
|
9527
9749
|
|
|
9528
9750
|
var endowCode = /*#__PURE__*/function () {
|
|
@@ -9618,10 +9840,101 @@ var endowCode = /*#__PURE__*/function () {
|
|
|
9618
9840
|
return _ref10.apply(this, arguments);
|
|
9619
9841
|
};
|
|
9620
9842
|
}();
|
|
9843
|
+
/** 修改了 货物名称 */
|
|
9621
9844
|
|
|
9622
|
-
var
|
|
9845
|
+
var onChangeItemName = /*#__PURE__*/function () {
|
|
9846
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
|
|
9847
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
9848
|
+
while (1) {
|
|
9849
|
+
switch (_context13.prev = _context13.next) {
|
|
9850
|
+
case 0:
|
|
9851
|
+
controller.run( /*#__PURE__*/function () {
|
|
9852
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
|
|
9853
|
+
var _getSN$shorthand, _getSN;
|
|
9854
|
+
|
|
9855
|
+
var value, shorthand;
|
|
9856
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
9857
|
+
while (1) {
|
|
9858
|
+
switch (_context12.prev = _context12.next) {
|
|
9859
|
+
case 0:
|
|
9860
|
+
value = form.getFieldsValue().itemName;
|
|
9861
|
+
shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
|
|
9862
|
+
|
|
9863
|
+
if (!s.goodsListState.isMyShow) {
|
|
9864
|
+
_context12.next = 11;
|
|
9865
|
+
break;
|
|
9866
|
+
}
|
|
9867
|
+
|
|
9868
|
+
_context12.next = 5;
|
|
9869
|
+
return controller.setEditGood({
|
|
9870
|
+
itemNameSelf: value
|
|
9871
|
+
});
|
|
9872
|
+
|
|
9873
|
+
case 5:
|
|
9874
|
+
_context12.t0 = record.itemName;
|
|
9875
|
+
|
|
9876
|
+
if (!_context12.t0) {
|
|
9877
|
+
_context12.next = 9;
|
|
9878
|
+
break;
|
|
9879
|
+
}
|
|
9880
|
+
|
|
9881
|
+
_context12.next = 9;
|
|
9882
|
+
return controller.setEditGood({
|
|
9883
|
+
itemName: setShorthand(record.itemName, shorthand)
|
|
9884
|
+
});
|
|
9885
|
+
|
|
9886
|
+
case 9:
|
|
9887
|
+
_context12.next = 17;
|
|
9888
|
+
break;
|
|
9889
|
+
|
|
9890
|
+
case 11:
|
|
9891
|
+
_context12.next = 13;
|
|
9892
|
+
return controller.setEditGood({
|
|
9893
|
+
itemName: value
|
|
9894
|
+
});
|
|
9895
|
+
|
|
9896
|
+
case 13:
|
|
9897
|
+
_context12.t1 = record.itemNameSelf;
|
|
9898
|
+
|
|
9899
|
+
if (!_context12.t1) {
|
|
9900
|
+
_context12.next = 17;
|
|
9901
|
+
break;
|
|
9902
|
+
}
|
|
9903
|
+
|
|
9904
|
+
_context12.next = 17;
|
|
9905
|
+
return controller.setEditGood({
|
|
9906
|
+
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
9907
|
+
});
|
|
9908
|
+
|
|
9909
|
+
case 17:
|
|
9910
|
+
case "end":
|
|
9911
|
+
return _context12.stop();
|
|
9912
|
+
}
|
|
9913
|
+
}
|
|
9914
|
+
}, _callee12);
|
|
9915
|
+
}));
|
|
9916
|
+
|
|
9917
|
+
return function (_x25) {
|
|
9918
|
+
return _ref13.apply(this, arguments);
|
|
9919
|
+
};
|
|
9920
|
+
}());
|
|
9921
|
+
|
|
9922
|
+
case 1:
|
|
9923
|
+
case "end":
|
|
9924
|
+
return _context13.stop();
|
|
9925
|
+
}
|
|
9926
|
+
}
|
|
9927
|
+
}, _callee13);
|
|
9928
|
+
}));
|
|
9929
|
+
|
|
9930
|
+
return function onChangeItemName(_x22, _x23, _x24) {
|
|
9931
|
+
return _ref12.apply(this, arguments);
|
|
9932
|
+
};
|
|
9933
|
+
}();
|
|
9934
|
+
|
|
9935
|
+
var Text$3 = Typography.Text;
|
|
9623
9936
|
var useEndowCode = (function (goods) {
|
|
9624
|
-
var controller =
|
|
9937
|
+
var controller = Invoice.useInvoiceController();
|
|
9625
9938
|
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9626
9939
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9627
9940
|
while (1) {
|
|
@@ -9646,11 +9959,102 @@ var useEndowCode = (function (goods) {
|
|
|
9646
9959
|
}, [goods.lineAttribute, onClick]);
|
|
9647
9960
|
});
|
|
9648
9961
|
|
|
9962
|
+
var Text$4 = Typography.Text;
|
|
9963
|
+
var useAddComparison = (function (goods) {
|
|
9964
|
+
var controller = Invoice.useInvoiceController();
|
|
9965
|
+
var productComparison = controller.useMemo(function (s) {
|
|
9966
|
+
return s.goodsListState.productComparison;
|
|
9967
|
+
}, []);
|
|
9968
|
+
var onClick = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9969
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9970
|
+
while (1) {
|
|
9971
|
+
switch (_context2.prev = _context2.next) {
|
|
9972
|
+
case 0:
|
|
9973
|
+
_context2.next = 2;
|
|
9974
|
+
return controller.saveEditGood();
|
|
9975
|
+
|
|
9976
|
+
case 2:
|
|
9977
|
+
_context2.next = 4;
|
|
9978
|
+
return controller.wait();
|
|
9979
|
+
|
|
9980
|
+
case 4:
|
|
9981
|
+
_context2.next = 6;
|
|
9982
|
+
return controller.run( /*#__PURE__*/function () {
|
|
9983
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
9984
|
+
var err, key;
|
|
9985
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9986
|
+
while (1) {
|
|
9987
|
+
switch (_context.prev = _context.next) {
|
|
9988
|
+
case 0:
|
|
9989
|
+
if (!s.goodsListState.form) {
|
|
9990
|
+
_context.next = 11;
|
|
9991
|
+
break;
|
|
9992
|
+
}
|
|
9993
|
+
|
|
9994
|
+
err = s.goodsListState.form.getFieldsError();
|
|
9995
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
9996
|
+
|
|
9997
|
+
case 3:
|
|
9998
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
9999
|
+
_context.next = 11;
|
|
10000
|
+
break;
|
|
10001
|
+
}
|
|
10002
|
+
|
|
10003
|
+
key = _context.t1.value;
|
|
10004
|
+
|
|
10005
|
+
if (err[key]) {
|
|
10006
|
+
_context.next = 7;
|
|
10007
|
+
break;
|
|
10008
|
+
}
|
|
10009
|
+
|
|
10010
|
+
return _context.abrupt("continue", 3);
|
|
10011
|
+
|
|
10012
|
+
case 7:
|
|
10013
|
+
message.error(err[key][0]);
|
|
10014
|
+
return _context.abrupt("return");
|
|
10015
|
+
|
|
10016
|
+
case 11:
|
|
10017
|
+
s.goodsListState.addComparisonIndex = goods.$index;
|
|
10018
|
+
|
|
10019
|
+
case 12:
|
|
10020
|
+
case "end":
|
|
10021
|
+
return _context.stop();
|
|
10022
|
+
}
|
|
10023
|
+
}
|
|
10024
|
+
}, _callee);
|
|
10025
|
+
}));
|
|
10026
|
+
|
|
10027
|
+
return function (_x) {
|
|
10028
|
+
return _ref2.apply(this, arguments);
|
|
10029
|
+
};
|
|
10030
|
+
}());
|
|
10031
|
+
|
|
10032
|
+
case 6:
|
|
10033
|
+
case "end":
|
|
10034
|
+
return _context2.stop();
|
|
10035
|
+
}
|
|
10036
|
+
}
|
|
10037
|
+
}, _callee2);
|
|
10038
|
+
})), [controller, goods.$index]);
|
|
10039
|
+
return React.useMemo(function () {
|
|
10040
|
+
if (productComparison.onComply) {
|
|
10041
|
+
return React.createElement(Menu.Item, {
|
|
10042
|
+
key: "delItem",
|
|
10043
|
+
onClick: onClick
|
|
10044
|
+
}, React.createElement(Text$4, {
|
|
10045
|
+
strong: true
|
|
10046
|
+
}, "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167"));
|
|
10047
|
+
} else {
|
|
10048
|
+
return React.createElement(React.Fragment, null);
|
|
10049
|
+
}
|
|
10050
|
+
}, [onClick, productComparison]);
|
|
10051
|
+
});
|
|
10052
|
+
|
|
9649
10053
|
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
10054
|
styleInject(css_248z$6);
|
|
9651
10055
|
|
|
9652
10056
|
var RowMenu = (function (props) {
|
|
9653
|
-
var controller =
|
|
10057
|
+
var controller = Invoice.useInvoiceController();
|
|
9654
10058
|
var model = controller.useMemo(function (s) {
|
|
9655
10059
|
return s.model;
|
|
9656
10060
|
}, []);
|
|
@@ -9665,10 +10069,13 @@ var RowMenu = (function (props) {
|
|
|
9665
10069
|
var delItem = useDelItem(props.goods);
|
|
9666
10070
|
var addDiscount = useAddDiscount(props.goods);
|
|
9667
10071
|
var endowCode = useEndowCode(props.goods);
|
|
10072
|
+
var addComparison = useAddComparison(props.goods);
|
|
9668
10073
|
var itemList = React.useMemo(function () {
|
|
9669
10074
|
var arr = [];
|
|
9670
10075
|
model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
9671
10076
|
|
|
10077
|
+
arr.push(addComparison); // 添加商品对照
|
|
10078
|
+
|
|
9672
10079
|
endowCode && arr.push(endowCode); // 赋码
|
|
9673
10080
|
|
|
9674
10081
|
model !== 'prefab' && delItem && arr.push(delItem); // 删除
|
|
@@ -9701,16 +10108,21 @@ var RowMenu = (function (props) {
|
|
|
9701
10108
|
})));
|
|
9702
10109
|
});
|
|
9703
10110
|
|
|
9704
|
-
var Text$
|
|
10111
|
+
var Text$5 = Typography.Text;
|
|
9705
10112
|
var useColumns = (function (form) {
|
|
9706
10113
|
var getFieldDecorator = form.getFieldDecorator,
|
|
9707
10114
|
getFieldValue = form.getFieldValue;
|
|
9708
|
-
var controller =
|
|
10115
|
+
var controller = Invoice.useInvoiceController();
|
|
9709
10116
|
/** 是否含税 */
|
|
9710
10117
|
|
|
9711
10118
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
9712
10119
|
return e.goodsListState.isTaxIncluded;
|
|
9713
10120
|
}, []);
|
|
10121
|
+
/** 是否显示我方 */
|
|
10122
|
+
|
|
10123
|
+
var isMyShow = controller.useMemo(function (e) {
|
|
10124
|
+
return e.goodsListState.isMyShow;
|
|
10125
|
+
}, []);
|
|
9714
10126
|
/** 正在编辑的货物 */
|
|
9715
10127
|
|
|
9716
10128
|
var editGood = controller.useMemo(function (e) {
|
|
@@ -9747,12 +10159,11 @@ var useColumns = (function (form) {
|
|
|
9747
10159
|
|
|
9748
10160
|
var columns = React.useMemo(function () {
|
|
9749
10161
|
return [{
|
|
9750
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10162
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
9751
10163
|
type: "danger"
|
|
9752
10164
|
}, "*"), "\u8D27\u7269\u540D\u79F0"),
|
|
9753
|
-
dataIndex: 'itemName',
|
|
9754
10165
|
key: 'itemName',
|
|
9755
|
-
render: function render(
|
|
10166
|
+
render: function render(_, record) {
|
|
9756
10167
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9757
10168
|
var _editGood$itemName;
|
|
9758
10169
|
|
|
@@ -9761,17 +10172,54 @@ var useColumns = (function (form) {
|
|
|
9761
10172
|
display: 'flex'
|
|
9762
10173
|
}
|
|
9763
10174
|
}, getFieldDecorator('itemName', {
|
|
9764
|
-
initialValue:
|
|
10175
|
+
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
9765
10176
|
rules: [{
|
|
9766
|
-
|
|
9767
|
-
|
|
10177
|
+
validator: function () {
|
|
10178
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
|
|
10179
|
+
var value;
|
|
10180
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10181
|
+
while (1) {
|
|
10182
|
+
switch (_context.prev = _context.next) {
|
|
10183
|
+
case 0:
|
|
10184
|
+
_context.next = 2;
|
|
10185
|
+
return controller.wait();
|
|
10186
|
+
|
|
10187
|
+
case 2:
|
|
10188
|
+
value = controller.state.goodsListState.editGood;
|
|
10189
|
+
|
|
10190
|
+
if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
|
|
10191
|
+
_context.next = 7;
|
|
10192
|
+
break;
|
|
10193
|
+
}
|
|
10194
|
+
|
|
10195
|
+
callback('货物名称不能为空');
|
|
10196
|
+
_context.next = 8;
|
|
10197
|
+
break;
|
|
10198
|
+
|
|
10199
|
+
case 7:
|
|
10200
|
+
return _context.abrupt("return");
|
|
10201
|
+
|
|
10202
|
+
case 8:
|
|
10203
|
+
case "end":
|
|
10204
|
+
return _context.stop();
|
|
10205
|
+
}
|
|
10206
|
+
}
|
|
10207
|
+
}, _callee);
|
|
10208
|
+
}));
|
|
10209
|
+
|
|
10210
|
+
function validator(_x, _x2, _x3) {
|
|
10211
|
+
return _validator.apply(this, arguments);
|
|
10212
|
+
}
|
|
10213
|
+
|
|
10214
|
+
return validator;
|
|
10215
|
+
}()
|
|
9768
10216
|
}]
|
|
9769
10217
|
})(React.createElement(MyInput, {
|
|
9770
10218
|
style: {
|
|
9771
10219
|
flex: 1
|
|
9772
10220
|
},
|
|
9773
10221
|
onChange: function onChange() {
|
|
9774
|
-
|
|
10222
|
+
onChangeItemName(controller, form, record);
|
|
9775
10223
|
}
|
|
9776
10224
|
})), React.createElement("div", {
|
|
9777
10225
|
className: "kts-invoice-operate-goods-list-able-list-itemName-import"
|
|
@@ -9782,67 +10230,92 @@ var useColumns = (function (form) {
|
|
|
9782
10230
|
type: "link",
|
|
9783
10231
|
icon: "file-add"
|
|
9784
10232
|
}), controller.getGoodsList && React.createElement(Button, {
|
|
9785
|
-
onClick: function
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
10233
|
+
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
10234
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
10235
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10236
|
+
while (1) {
|
|
10237
|
+
switch (_context2.prev = _context2.next) {
|
|
10238
|
+
case 0:
|
|
10239
|
+
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
9793
10240
|
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
}
|
|
10241
|
+
case 1:
|
|
10242
|
+
case "end":
|
|
10243
|
+
return _context2.stop();
|
|
9798
10244
|
}
|
|
9799
|
-
}
|
|
9800
|
-
})
|
|
10245
|
+
}
|
|
10246
|
+
}, _callee2);
|
|
10247
|
+
}));
|
|
9801
10248
|
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
},
|
|
10249
|
+
return function (_x4) {
|
|
10250
|
+
return _ref.apply(this, arguments);
|
|
10251
|
+
};
|
|
10252
|
+
}()),
|
|
9807
10253
|
type: "link",
|
|
9808
10254
|
icon: "plus-circle"
|
|
9809
10255
|
}))));
|
|
9810
10256
|
} else {
|
|
9811
|
-
return React.createElement(
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
}
|
|
10257
|
+
return React.createElement(MyItemNameDiv, {
|
|
10258
|
+
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
10259
|
+
valueF: formatSearch(record.itemName, searchValue),
|
|
10260
|
+
isMyShow: isMyShow
|
|
10261
|
+
}); // return (
|
|
10262
|
+
// <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
|
|
10263
|
+
// );
|
|
9816
10264
|
}
|
|
9817
10265
|
}
|
|
9818
10266
|
}, {
|
|
9819
10267
|
title: '货物规格型号',
|
|
9820
|
-
dataIndex: 'itemModelName',
|
|
9821
10268
|
key: 'itemModelName',
|
|
9822
10269
|
width: 119,
|
|
9823
|
-
render: function render(
|
|
10270
|
+
render: function render(_, record) {
|
|
9824
10271
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9825
10272
|
return React.createElement(Form.Item, null, getFieldDecorator('itemModelName', {
|
|
9826
|
-
initialValue: editGood.itemModelName
|
|
10273
|
+
initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName
|
|
9827
10274
|
})(React.createElement(MyInput, {
|
|
9828
|
-
onChange: function
|
|
9829
|
-
|
|
9830
|
-
|
|
10275
|
+
onChange: function () {
|
|
10276
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
10277
|
+
var key, value;
|
|
10278
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10279
|
+
while (1) {
|
|
10280
|
+
switch (_context3.prev = _context3.next) {
|
|
10281
|
+
case 0:
|
|
10282
|
+
_context3.next = 2;
|
|
10283
|
+
return controller.wait();
|
|
10284
|
+
|
|
10285
|
+
case 2:
|
|
10286
|
+
key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
|
|
10287
|
+
value = {};
|
|
10288
|
+
value[key] = form.getFieldsValue().itemModelName;
|
|
10289
|
+
controller.setEditGood(value);
|
|
10290
|
+
|
|
10291
|
+
case 6:
|
|
10292
|
+
case "end":
|
|
10293
|
+
return _context3.stop();
|
|
10294
|
+
}
|
|
10295
|
+
}
|
|
10296
|
+
}, _callee3);
|
|
10297
|
+
}));
|
|
10298
|
+
|
|
10299
|
+
function onChange() {
|
|
10300
|
+
return _onChange.apply(this, arguments);
|
|
10301
|
+
}
|
|
10302
|
+
|
|
10303
|
+
return onChange;
|
|
10304
|
+
}()
|
|
9831
10305
|
})));
|
|
9832
10306
|
} else {
|
|
9833
|
-
return React.createElement(
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
}
|
|
10307
|
+
return React.createElement(MyItemNameDiv, {
|
|
10308
|
+
valueT: formatSearch(record.itemModelNameSelf, searchValue),
|
|
10309
|
+
valueF: formatSearch(record.itemModelName, searchValue),
|
|
10310
|
+
isMyShow: isMyShow
|
|
10311
|
+
});
|
|
9838
10312
|
}
|
|
9839
10313
|
}
|
|
9840
10314
|
}, {
|
|
9841
10315
|
title: '单位',
|
|
9842
|
-
dataIndex: 'unit',
|
|
9843
10316
|
key: 'unit',
|
|
9844
10317
|
width: 70,
|
|
9845
|
-
render: function render(
|
|
10318
|
+
render: function render(_, record) {
|
|
9846
10319
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9847
10320
|
return React.createElement(Form.Item, null, getFieldDecorator('unit', {
|
|
9848
10321
|
initialValue: editGood.unit
|
|
@@ -9851,16 +10324,39 @@ var useColumns = (function (form) {
|
|
|
9851
10324
|
width: '100%'
|
|
9852
10325
|
},
|
|
9853
10326
|
dataSource: unitList,
|
|
9854
|
-
onChange: function
|
|
9855
|
-
|
|
9856
|
-
|
|
10327
|
+
onChange: function () {
|
|
10328
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
10329
|
+
var key, value;
|
|
10330
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
10331
|
+
while (1) {
|
|
10332
|
+
switch (_context4.prev = _context4.next) {
|
|
10333
|
+
case 0:
|
|
10334
|
+
_context4.next = 2;
|
|
10335
|
+
return controller.wait();
|
|
10336
|
+
|
|
10337
|
+
case 2:
|
|
10338
|
+
key = isMyShow ? 'unit' : 'unitOther';
|
|
10339
|
+
value = {};
|
|
10340
|
+
value[key] = form.getFieldsValue().unit;
|
|
10341
|
+
controller.setEditGood(value);
|
|
10342
|
+
|
|
10343
|
+
case 6:
|
|
10344
|
+
case "end":
|
|
10345
|
+
return _context4.stop();
|
|
10346
|
+
}
|
|
10347
|
+
}
|
|
10348
|
+
}, _callee4);
|
|
10349
|
+
}));
|
|
10350
|
+
|
|
10351
|
+
function onChange() {
|
|
10352
|
+
return _onChange2.apply(this, arguments);
|
|
10353
|
+
}
|
|
10354
|
+
|
|
10355
|
+
return onChange;
|
|
10356
|
+
}()
|
|
9857
10357
|
})));
|
|
9858
10358
|
} else {
|
|
9859
|
-
return
|
|
9860
|
-
style: {
|
|
9861
|
-
padding: '0 10px'
|
|
9862
|
-
}
|
|
9863
|
-
}, value);
|
|
10359
|
+
return record.unit;
|
|
9864
10360
|
}
|
|
9865
10361
|
}
|
|
9866
10362
|
}, {
|
|
@@ -9878,13 +10374,13 @@ var useColumns = (function (form) {
|
|
|
9878
10374
|
message: '数量必须为数字'
|
|
9879
10375
|
}, {
|
|
9880
10376
|
validator: function () {
|
|
9881
|
-
var
|
|
10377
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
|
|
9882
10378
|
var isvalue, isPrice;
|
|
9883
|
-
return _regeneratorRuntime().wrap(function
|
|
10379
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
9884
10380
|
while (1) {
|
|
9885
|
-
switch (
|
|
10381
|
+
switch (_context5.prev = _context5.next) {
|
|
9886
10382
|
case 0:
|
|
9887
|
-
|
|
10383
|
+
_context5.next = 2;
|
|
9888
10384
|
return controller.wait();
|
|
9889
10385
|
|
|
9890
10386
|
case 2:
|
|
@@ -9892,25 +10388,25 @@ var useColumns = (function (form) {
|
|
|
9892
10388
|
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
9893
10389
|
|
|
9894
10390
|
if (!(isvalue || isPrice === isvalue)) {
|
|
9895
|
-
|
|
10391
|
+
_context5.next = 6;
|
|
9896
10392
|
break;
|
|
9897
10393
|
}
|
|
9898
10394
|
|
|
9899
|
-
return
|
|
10395
|
+
return _context5.abrupt("return");
|
|
9900
10396
|
|
|
9901
10397
|
case 6:
|
|
9902
10398
|
callback('请输入数量');
|
|
9903
10399
|
|
|
9904
10400
|
case 7:
|
|
9905
10401
|
case "end":
|
|
9906
|
-
return
|
|
10402
|
+
return _context5.stop();
|
|
9907
10403
|
}
|
|
9908
10404
|
}
|
|
9909
|
-
},
|
|
10405
|
+
}, _callee5);
|
|
9910
10406
|
}));
|
|
9911
10407
|
|
|
9912
|
-
function validator(
|
|
9913
|
-
return
|
|
10408
|
+
function validator(_x5, _x6, _x7) {
|
|
10409
|
+
return _validator2.apply(this, arguments);
|
|
9914
10410
|
}
|
|
9915
10411
|
|
|
9916
10412
|
return validator;
|
|
@@ -9950,13 +10446,13 @@ var useColumns = (function (form) {
|
|
|
9950
10446
|
message: '单价必须为数字'
|
|
9951
10447
|
}, {
|
|
9952
10448
|
validator: function () {
|
|
9953
|
-
var
|
|
10449
|
+
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
|
|
9954
10450
|
var isQuantity, isvalue;
|
|
9955
|
-
return _regeneratorRuntime().wrap(function
|
|
10451
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
9956
10452
|
while (1) {
|
|
9957
|
-
switch (
|
|
10453
|
+
switch (_context6.prev = _context6.next) {
|
|
9958
10454
|
case 0:
|
|
9959
|
-
|
|
10455
|
+
_context6.next = 2;
|
|
9960
10456
|
return controller.wait();
|
|
9961
10457
|
|
|
9962
10458
|
case 2:
|
|
@@ -9964,25 +10460,25 @@ var useColumns = (function (form) {
|
|
|
9964
10460
|
isvalue = !!value || value === 0;
|
|
9965
10461
|
|
|
9966
10462
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
9967
|
-
|
|
10463
|
+
_context6.next = 6;
|
|
9968
10464
|
break;
|
|
9969
10465
|
}
|
|
9970
10466
|
|
|
9971
|
-
return
|
|
10467
|
+
return _context6.abrupt("return");
|
|
9972
10468
|
|
|
9973
10469
|
case 6:
|
|
9974
10470
|
callback('请输入单价');
|
|
9975
10471
|
|
|
9976
10472
|
case 7:
|
|
9977
10473
|
case "end":
|
|
9978
|
-
return
|
|
10474
|
+
return _context6.stop();
|
|
9979
10475
|
}
|
|
9980
10476
|
}
|
|
9981
|
-
},
|
|
10477
|
+
}, _callee6);
|
|
9982
10478
|
}));
|
|
9983
10479
|
|
|
9984
|
-
function validator(
|
|
9985
|
-
return
|
|
10480
|
+
function validator(_x8, _x9, _x10) {
|
|
10481
|
+
return _validator3.apply(this, arguments);
|
|
9986
10482
|
}
|
|
9987
10483
|
|
|
9988
10484
|
return validator;
|
|
@@ -10022,13 +10518,13 @@ var useColumns = (function (form) {
|
|
|
10022
10518
|
message: '单价必须为数字'
|
|
10023
10519
|
}, {
|
|
10024
10520
|
validator: function () {
|
|
10025
|
-
var
|
|
10521
|
+
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
|
|
10026
10522
|
var isQuantity, isvalue;
|
|
10027
|
-
return _regeneratorRuntime().wrap(function
|
|
10523
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
10028
10524
|
while (1) {
|
|
10029
|
-
switch (
|
|
10525
|
+
switch (_context7.prev = _context7.next) {
|
|
10030
10526
|
case 0:
|
|
10031
|
-
|
|
10527
|
+
_context7.next = 2;
|
|
10032
10528
|
return controller.wait();
|
|
10033
10529
|
|
|
10034
10530
|
case 2:
|
|
@@ -10036,25 +10532,25 @@ var useColumns = (function (form) {
|
|
|
10036
10532
|
isvalue = !!value || value === 0;
|
|
10037
10533
|
|
|
10038
10534
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
10039
|
-
|
|
10535
|
+
_context7.next = 6;
|
|
10040
10536
|
break;
|
|
10041
10537
|
}
|
|
10042
10538
|
|
|
10043
|
-
return
|
|
10539
|
+
return _context7.abrupt("return");
|
|
10044
10540
|
|
|
10045
10541
|
case 6:
|
|
10046
10542
|
callback('请输入单价');
|
|
10047
10543
|
|
|
10048
10544
|
case 7:
|
|
10049
10545
|
case "end":
|
|
10050
|
-
return
|
|
10546
|
+
return _context7.stop();
|
|
10051
10547
|
}
|
|
10052
10548
|
}
|
|
10053
|
-
},
|
|
10549
|
+
}, _callee7);
|
|
10054
10550
|
}));
|
|
10055
10551
|
|
|
10056
|
-
function validator(
|
|
10057
|
-
return
|
|
10552
|
+
function validator(_x11, _x12, _x13) {
|
|
10553
|
+
return _validator4.apply(this, arguments);
|
|
10058
10554
|
}
|
|
10059
10555
|
|
|
10060
10556
|
return validator;
|
|
@@ -10080,7 +10576,7 @@ var useColumns = (function (form) {
|
|
|
10080
10576
|
}
|
|
10081
10577
|
}
|
|
10082
10578
|
}, {
|
|
10083
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10579
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
10084
10580
|
type: "danger"
|
|
10085
10581
|
}, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
|
|
10086
10582
|
dataIndex: 'lineAmountIncludeTax',
|
|
@@ -10099,10 +10595,10 @@ var useColumns = (function (form) {
|
|
|
10099
10595
|
message: '金额必须为数字'
|
|
10100
10596
|
}, {
|
|
10101
10597
|
validator: function () {
|
|
10102
|
-
var
|
|
10103
|
-
return _regeneratorRuntime().wrap(function
|
|
10598
|
+
var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
10599
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
10104
10600
|
while (1) {
|
|
10105
|
-
switch (
|
|
10601
|
+
switch (_context8.prev = _context8.next) {
|
|
10106
10602
|
case 0:
|
|
10107
10603
|
if ("".concat(value).split('.')[0].length > 9) {
|
|
10108
10604
|
callback('金额整数部分不能大于9位,小数点后最多2位');
|
|
@@ -10110,24 +10606,24 @@ var useColumns = (function (form) {
|
|
|
10110
10606
|
|
|
10111
10607
|
case 1:
|
|
10112
10608
|
case "end":
|
|
10113
|
-
return
|
|
10609
|
+
return _context8.stop();
|
|
10114
10610
|
}
|
|
10115
10611
|
}
|
|
10116
|
-
},
|
|
10612
|
+
}, _callee8);
|
|
10117
10613
|
}));
|
|
10118
10614
|
|
|
10119
|
-
function validator(
|
|
10120
|
-
return
|
|
10615
|
+
function validator(_x14, _x15, _x16) {
|
|
10616
|
+
return _validator5.apply(this, arguments);
|
|
10121
10617
|
}
|
|
10122
10618
|
|
|
10123
10619
|
return validator;
|
|
10124
10620
|
}()
|
|
10125
10621
|
}, {
|
|
10126
10622
|
validator: function () {
|
|
10127
|
-
var
|
|
10128
|
-
return _regeneratorRuntime().wrap(function
|
|
10623
|
+
var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
10624
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
10129
10625
|
while (1) {
|
|
10130
|
-
switch (
|
|
10626
|
+
switch (_context9.prev = _context9.next) {
|
|
10131
10627
|
case 0:
|
|
10132
10628
|
if (deduction && parseFloat(value) <= deduction) {
|
|
10133
10629
|
callback('扣除额不能大于等于价税合计');
|
|
@@ -10135,14 +10631,14 @@ var useColumns = (function (form) {
|
|
|
10135
10631
|
|
|
10136
10632
|
case 1:
|
|
10137
10633
|
case "end":
|
|
10138
|
-
return
|
|
10634
|
+
return _context9.stop();
|
|
10139
10635
|
}
|
|
10140
10636
|
}
|
|
10141
|
-
},
|
|
10637
|
+
}, _callee9);
|
|
10142
10638
|
}));
|
|
10143
10639
|
|
|
10144
|
-
function validator(
|
|
10145
|
-
return
|
|
10640
|
+
function validator(_x17, _x18, _x19) {
|
|
10641
|
+
return _validator6.apply(this, arguments);
|
|
10146
10642
|
}
|
|
10147
10643
|
|
|
10148
10644
|
return validator;
|
|
@@ -10167,7 +10663,7 @@ var useColumns = (function (form) {
|
|
|
10167
10663
|
}
|
|
10168
10664
|
}
|
|
10169
10665
|
}, {
|
|
10170
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10666
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
10171
10667
|
type: "danger"
|
|
10172
10668
|
}, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
10173
10669
|
dataIndex: 'lineAmountExcludeTax',
|
|
@@ -10186,10 +10682,10 @@ var useColumns = (function (form) {
|
|
|
10186
10682
|
message: '金额必须为数字'
|
|
10187
10683
|
}, {
|
|
10188
10684
|
validator: function () {
|
|
10189
|
-
var
|
|
10190
|
-
return _regeneratorRuntime().wrap(function
|
|
10685
|
+
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
10686
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
10191
10687
|
while (1) {
|
|
10192
|
-
switch (
|
|
10688
|
+
switch (_context10.prev = _context10.next) {
|
|
10193
10689
|
case 0:
|
|
10194
10690
|
if ("".concat(value).split('.')[0].length > 9) {
|
|
10195
10691
|
callback('金额整数部分不能大于9位,小数点后最多2位');
|
|
@@ -10197,14 +10693,14 @@ var useColumns = (function (form) {
|
|
|
10197
10693
|
|
|
10198
10694
|
case 1:
|
|
10199
10695
|
case "end":
|
|
10200
|
-
return
|
|
10696
|
+
return _context10.stop();
|
|
10201
10697
|
}
|
|
10202
10698
|
}
|
|
10203
|
-
},
|
|
10699
|
+
}, _callee10);
|
|
10204
10700
|
}));
|
|
10205
10701
|
|
|
10206
|
-
function validator(
|
|
10207
|
-
return
|
|
10702
|
+
function validator(_x20, _x21, _x22) {
|
|
10703
|
+
return _validator7.apply(this, arguments);
|
|
10208
10704
|
}
|
|
10209
10705
|
|
|
10210
10706
|
return validator;
|
|
@@ -10229,7 +10725,7 @@ var useColumns = (function (form) {
|
|
|
10229
10725
|
}
|
|
10230
10726
|
}
|
|
10231
10727
|
}, {
|
|
10232
|
-
title: React.createElement(React.Fragment, null, React.createElement(Text$
|
|
10728
|
+
title: React.createElement(React.Fragment, null, React.createElement(Text$5, {
|
|
10233
10729
|
type: "danger"
|
|
10234
10730
|
}, "*"), "\u7A0E\u7387"),
|
|
10235
10731
|
dataIndex: 'taxRate',
|
|
@@ -10257,6 +10753,7 @@ var useColumns = (function (form) {
|
|
|
10257
10753
|
width: '100%'
|
|
10258
10754
|
},
|
|
10259
10755
|
onChange: function onChange() {
|
|
10756
|
+
setChangeField('taxRate');
|
|
10260
10757
|
onChangeTaxRate(controller, form, record);
|
|
10261
10758
|
}
|
|
10262
10759
|
}, taxRateList.map(function (e, i) {
|
|
@@ -10283,7 +10780,9 @@ var useColumns = (function (form) {
|
|
|
10283
10780
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
10284
10781
|
return getFieldDecorator('taxAmount', {
|
|
10285
10782
|
initialValue: editGood.taxAmount
|
|
10286
|
-
})(React.createElement(MyDiv,
|
|
10783
|
+
})(React.createElement(MyDiv, {
|
|
10784
|
+
loading: isCipher(changeField, 'taxAmount')
|
|
10785
|
+
}));
|
|
10287
10786
|
} else {
|
|
10288
10787
|
return React.createElement("span", {
|
|
10289
10788
|
style: {
|
|
@@ -10315,7 +10814,7 @@ var useColumns = (function (form) {
|
|
|
10315
10814
|
ellipsis: true
|
|
10316
10815
|
});
|
|
10317
10816
|
});
|
|
10318
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, searchValue]);
|
|
10817
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
|
|
10319
10818
|
React.useEffect(function () {
|
|
10320
10819
|
if (!changeField) return;
|
|
10321
10820
|
var t = setTimeout(function () {
|
|
@@ -10379,16 +10878,82 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
|
|
|
10379
10878
|
_createClass(MyDiv, [{
|
|
10380
10879
|
key: "render",
|
|
10381
10880
|
value: function render() {
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
}
|
|
10386
|
-
|
|
10881
|
+
if (this.props.loading) {
|
|
10882
|
+
return React.createElement(Spin, {
|
|
10883
|
+
size: "small"
|
|
10884
|
+
}, React.createElement("span", {
|
|
10885
|
+
style: {
|
|
10886
|
+
padding: '0 10px'
|
|
10887
|
+
}
|
|
10888
|
+
}, this.props.value));
|
|
10889
|
+
} else {
|
|
10890
|
+
return React.createElement("span", {
|
|
10891
|
+
style: {
|
|
10892
|
+
padding: '0 10px'
|
|
10893
|
+
}
|
|
10894
|
+
}, this.props.value);
|
|
10895
|
+
}
|
|
10387
10896
|
}
|
|
10388
10897
|
}]);
|
|
10389
10898
|
|
|
10390
10899
|
return MyDiv;
|
|
10391
10900
|
}(React.Component);
|
|
10901
|
+
|
|
10902
|
+
var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
|
|
10903
|
+
_inherits(MyItemNameDiv, _React$Component3);
|
|
10904
|
+
|
|
10905
|
+
var _super3 = _createSuper(MyItemNameDiv);
|
|
10906
|
+
|
|
10907
|
+
function MyItemNameDiv() {
|
|
10908
|
+
_classCallCheck(this, MyItemNameDiv);
|
|
10909
|
+
|
|
10910
|
+
return _super3.apply(this, arguments);
|
|
10911
|
+
}
|
|
10912
|
+
|
|
10913
|
+
_createClass(MyItemNameDiv, [{
|
|
10914
|
+
key: "render",
|
|
10915
|
+
value: function render() {
|
|
10916
|
+
var _this$props = this.props,
|
|
10917
|
+
isMyShow = _this$props.isMyShow,
|
|
10918
|
+
valueT = _this$props.valueT,
|
|
10919
|
+
valueF = _this$props.valueF;
|
|
10920
|
+
|
|
10921
|
+
if (isMyShow) {
|
|
10922
|
+
if (valueT) {
|
|
10923
|
+
return React.createElement("span", {
|
|
10924
|
+
style: {
|
|
10925
|
+
padding: '0 10px',
|
|
10926
|
+
color: '#0074ff'
|
|
10927
|
+
}
|
|
10928
|
+
}, valueT);
|
|
10929
|
+
} else {
|
|
10930
|
+
return React.createElement("span", {
|
|
10931
|
+
style: {
|
|
10932
|
+
padding: '0 10px'
|
|
10933
|
+
}
|
|
10934
|
+
}, valueF);
|
|
10935
|
+
}
|
|
10936
|
+
} else {
|
|
10937
|
+
if (valueF) {
|
|
10938
|
+
return React.createElement("span", {
|
|
10939
|
+
style: {
|
|
10940
|
+
padding: '0 10px'
|
|
10941
|
+
}
|
|
10942
|
+
}, valueF);
|
|
10943
|
+
} else {
|
|
10944
|
+
return React.createElement("span", {
|
|
10945
|
+
style: {
|
|
10946
|
+
padding: '0 10px',
|
|
10947
|
+
color: '#0074ff'
|
|
10948
|
+
}
|
|
10949
|
+
}, valueT);
|
|
10950
|
+
}
|
|
10951
|
+
}
|
|
10952
|
+
}
|
|
10953
|
+
}]);
|
|
10954
|
+
|
|
10955
|
+
return MyItemNameDiv;
|
|
10956
|
+
}(React.Component);
|
|
10392
10957
|
/** 格式搜索结果 */
|
|
10393
10958
|
|
|
10394
10959
|
|
|
@@ -10424,7 +10989,7 @@ function dcoding(v) {
|
|
|
10424
10989
|
|
|
10425
10990
|
var useOnRow = (function () {
|
|
10426
10991
|
/** 控制器 */
|
|
10427
|
-
var controller =
|
|
10992
|
+
var controller = Invoice.useInvoiceController();
|
|
10428
10993
|
var model = controller.useMemo(function (s) {
|
|
10429
10994
|
return s.model;
|
|
10430
10995
|
}, []);
|
|
@@ -10607,7 +11172,7 @@ function useWindowClick(controller) {
|
|
|
10607
11172
|
|
|
10608
11173
|
var useRowSelection = (function () {
|
|
10609
11174
|
/** 控制器 */
|
|
10610
|
-
var controller =
|
|
11175
|
+
var controller = Invoice.useInvoiceController();
|
|
10611
11176
|
/** 列表选中的货物索引列表 */
|
|
10612
11177
|
|
|
10613
11178
|
var selectedRowKeys = controller.useMemo(function (s) {
|
|
@@ -10894,7 +11459,7 @@ var useRowSelection = (function () {
|
|
|
10894
11459
|
};
|
|
10895
11460
|
});
|
|
10896
11461
|
|
|
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
|
|
11462
|
+
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
11463
|
styleInject(css_248z$7);
|
|
10899
11464
|
|
|
10900
11465
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
@@ -10919,7 +11484,7 @@ var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
|
10919
11484
|
}(React.Component);
|
|
10920
11485
|
var Main = decorator(Form.create())(function (props) {
|
|
10921
11486
|
/** 控制器 */
|
|
10922
|
-
var controller =
|
|
11487
|
+
var controller = Invoice.useInvoiceController();
|
|
10923
11488
|
var goodsList = controller.useMemo(function (s) {
|
|
10924
11489
|
return s.goodsListState.goodsList;
|
|
10925
11490
|
}, []);
|
|
@@ -10993,7 +11558,7 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
10993
11558
|
}, [controller, props.form]); // 跟新 货物
|
|
10994
11559
|
|
|
10995
11560
|
React.useEffect(function () {
|
|
10996
|
-
controller.
|
|
11561
|
+
controller.run( /*#__PURE__*/function () {
|
|
10997
11562
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
10998
11563
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10999
11564
|
while (1) {
|
|
@@ -11015,7 +11580,7 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
11015
11580
|
return function (_x4) {
|
|
11016
11581
|
return _ref3.apply(this, arguments);
|
|
11017
11582
|
};
|
|
11018
|
-
}())
|
|
11583
|
+
}());
|
|
11019
11584
|
}, [controller, goodsList]);
|
|
11020
11585
|
/** props 产品最大数 更新 */
|
|
11021
11586
|
|
|
@@ -11098,9 +11663,9 @@ var Main = decorator(Form.create())(function (props) {
|
|
|
11098
11663
|
className: "kts-invoice-operate-goods-list-able"
|
|
11099
11664
|
}, React.createElement("div", {
|
|
11100
11665
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
11101
|
-
}, React.createElement(AddRowButton, null), React.createElement(
|
|
11666
|
+
}, React.createElement(AddRowButton, null), React.createElement(BulkMenu, null), React.createElement(Search, null)), React.createElement("div", {
|
|
11102
11667
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
11103
|
-
}, props.menuExpansion, React.createElement(TaxIncludedSwitch, null))), React.createElement("div", {
|
|
11668
|
+
}, props.menuExpansion, React.createElement(DescribeSwitch, null), React.createElement(TaxIncludedSwitch, null))), React.createElement("div", {
|
|
11104
11669
|
className: classnames('kts-invoice-operate-goods-list-table', {
|
|
11105
11670
|
'kts-invoice-operate-prefab': isprefab
|
|
11106
11671
|
})
|
|
@@ -11165,7 +11730,7 @@ var Main$1 = decorator(Form.create())(function (props) {
|
|
|
11165
11730
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11166
11731
|
/** 控制器 */
|
|
11167
11732
|
|
|
11168
|
-
var controller =
|
|
11733
|
+
var controller = Invoice.useInvoiceController();
|
|
11169
11734
|
/** 控制器 */
|
|
11170
11735
|
|
|
11171
11736
|
var model = controller.useMemo(function (s) {
|
|
@@ -11283,7 +11848,7 @@ var Sign = decorator(Form.create())(function (props) {
|
|
|
11283
11848
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11284
11849
|
/** 控制器 */
|
|
11285
11850
|
|
|
11286
|
-
var controller =
|
|
11851
|
+
var controller = Invoice.useInvoiceController();
|
|
11287
11852
|
var model = controller.useMemo(function (s) {
|
|
11288
11853
|
return s.model;
|
|
11289
11854
|
}, []); // 注册 form
|
|
@@ -11325,7 +11890,7 @@ var formItemLayout = {
|
|
|
11325
11890
|
};
|
|
11326
11891
|
|
|
11327
11892
|
var ImportBuyerButton = (function () {
|
|
11328
|
-
var controller =
|
|
11893
|
+
var controller = Invoice.useInvoiceController();
|
|
11329
11894
|
var onClick = React.useCallback(function () {
|
|
11330
11895
|
controller.pipeline( /*#__PURE__*/function () {
|
|
11331
11896
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
@@ -11357,7 +11922,7 @@ var ImportBuyerButton = (function () {
|
|
|
11357
11922
|
|
|
11358
11923
|
var BuyerNameInput = (function (props) {
|
|
11359
11924
|
/** 控制器 */
|
|
11360
|
-
var controller =
|
|
11925
|
+
var controller = Invoice.useInvoiceController();
|
|
11361
11926
|
/** 组件模式 */
|
|
11362
11927
|
|
|
11363
11928
|
var model = controller.useMemo(function (s) {
|
|
@@ -11517,7 +12082,7 @@ var BuyerNameInput = (function (props) {
|
|
|
11517
12082
|
|
|
11518
12083
|
function useDataSource() {
|
|
11519
12084
|
/** 控制器 */
|
|
11520
|
-
var controller =
|
|
12085
|
+
var controller = Invoice.useInvoiceController();
|
|
11521
12086
|
|
|
11522
12087
|
var _React$useState3 = React.useState(false),
|
|
11523
12088
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
@@ -11601,7 +12166,7 @@ function interval(i, t) {
|
|
|
11601
12166
|
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
12167
|
styleInject(css_248z$a);
|
|
11603
12168
|
|
|
11604
|
-
var Text$
|
|
12169
|
+
var Text$6 = Typography.Text;
|
|
11605
12170
|
|
|
11606
12171
|
var Buyer$1 = /*#__PURE__*/function (_React$Component) {
|
|
11607
12172
|
_inherits(Buyer, _React$Component);
|
|
@@ -11633,7 +12198,7 @@ var Main$2 = decorator(Form.create())(function (props) {
|
|
|
11633
12198
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11634
12199
|
/** 控制器 */
|
|
11635
12200
|
|
|
11636
|
-
var controller =
|
|
12201
|
+
var controller = Invoice.useInvoiceController();
|
|
11637
12202
|
/** 组件模式 */
|
|
11638
12203
|
|
|
11639
12204
|
var model = controller.useMemo(function (s) {
|
|
@@ -11715,7 +12280,7 @@ var Main$2 = decorator(Form.create())(function (props) {
|
|
|
11715
12280
|
if (e.options.rules.some(function (e) {
|
|
11716
12281
|
return e.required;
|
|
11717
12282
|
})) {
|
|
11718
|
-
return React.createElement(React.Fragment, null, React.createElement(Text$
|
|
12283
|
+
return React.createElement(React.Fragment, null, React.createElement(Text$6, {
|
|
11719
12284
|
type: "danger"
|
|
11720
12285
|
}, "*"), e.label);
|
|
11721
12286
|
} else {
|
|
@@ -11751,7 +12316,7 @@ var Main$2 = decorator(Form.create())(function (props) {
|
|
|
11751
12316
|
});
|
|
11752
12317
|
|
|
11753
12318
|
var ImportBuyerDrawer = (function () {
|
|
11754
|
-
var controller =
|
|
12319
|
+
var controller = Invoice.useInvoiceController();
|
|
11755
12320
|
var visible = controller.useMemo(function (s) {
|
|
11756
12321
|
return s.buyerState.isVisibleDrawer;
|
|
11757
12322
|
}, []);
|
|
@@ -11793,7 +12358,7 @@ var ImportBuyerDrawer = (function () {
|
|
|
11793
12358
|
});
|
|
11794
12359
|
|
|
11795
12360
|
var DrawerBody$1 = function DrawerBody() {
|
|
11796
|
-
var controller =
|
|
12361
|
+
var controller = Invoice.useInvoiceController();
|
|
11797
12362
|
var columns = controller.useMemo(function (e) {
|
|
11798
12363
|
return e.buyerState.columns;
|
|
11799
12364
|
}, []);
|
|
@@ -11881,7 +12446,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
11881
12446
|
};
|
|
11882
12447
|
|
|
11883
12448
|
var ImportGoodsDrawer = (function () {
|
|
11884
|
-
var controller =
|
|
12449
|
+
var controller = Invoice.useInvoiceController();
|
|
11885
12450
|
var visible = controller.useMemo(function (s) {
|
|
11886
12451
|
return s.goodsListState.importGoods.isVisibleDrawer;
|
|
11887
12452
|
}, []);
|
|
@@ -11927,7 +12492,7 @@ var ImportGoodsDrawer = (function () {
|
|
|
11927
12492
|
});
|
|
11928
12493
|
|
|
11929
12494
|
var DrawerBody$2 = function DrawerBody() {
|
|
11930
|
-
var controller =
|
|
12495
|
+
var controller = Invoice.useInvoiceController();
|
|
11931
12496
|
var columns = controller.useMemo(function (s) {
|
|
11932
12497
|
return s.goodsListState.importGoods.columns;
|
|
11933
12498
|
}, []);
|
|
@@ -11961,6 +12526,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11961
12526
|
onClick: function onClick() {
|
|
11962
12527
|
controller.run( /*#__PURE__*/function () {
|
|
11963
12528
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
12529
|
+
var between, editGood;
|
|
11964
12530
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11965
12531
|
while (1) {
|
|
11966
12532
|
switch (_context2.prev = _context2.next) {
|
|
@@ -11969,7 +12535,8 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11969
12535
|
return !record[e] && record[e] !== 0;
|
|
11970
12536
|
}).forEach(function (e) {
|
|
11971
12537
|
delete record[e];
|
|
11972
|
-
});
|
|
12538
|
+
}); // 导入时校验函数
|
|
12539
|
+
|
|
11973
12540
|
_context2.next = 3;
|
|
11974
12541
|
return s.goodsListState.importGoods.verifyFn(record);
|
|
11975
12542
|
|
|
@@ -11997,30 +12564,40 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11997
12564
|
record.priceIncludeTax = s.goodsListState.editGood.priceIncludeTax;
|
|
11998
12565
|
record.lineAmountExcludeTax = s.goodsListState.editGood.lineAmountExcludeTax;
|
|
11999
12566
|
record.lineAmountIncludeTax = s.goodsListState.editGood.lineAmountIncludeTax;
|
|
12000
|
-
}
|
|
12567
|
+
} // 中间数据
|
|
12001
12568
|
|
|
12002
|
-
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
|
|
12003
12569
|
|
|
12004
|
-
|
|
12005
|
-
|
|
12006
|
-
|
|
12570
|
+
between = _objectSpread2({}, record);
|
|
12571
|
+
between.itemName = getItemName$1(record, s.goodsListState.editGood);
|
|
12572
|
+
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
|
|
12573
|
+
|
|
12574
|
+
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
12575
|
+
|
|
12576
|
+
if (editGood.taxRate) {
|
|
12577
|
+
editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
|
|
12007
12578
|
}
|
|
12008
12579
|
|
|
12009
|
-
|
|
12580
|
+
if ("".concat(editGood.priceIncludeTax) === '0') {
|
|
12581
|
+
editGood.priceIncludeTax = undefined;
|
|
12582
|
+
editGood.priceExcludeTax = undefined;
|
|
12583
|
+
} else {
|
|
12584
|
+
editGood.priceExcludeTax = getPriceExcludeTax(editGood, record);
|
|
12585
|
+
}
|
|
12586
|
+
|
|
12587
|
+
if (editGood.quantity && editGood.priceIncludeTax) {
|
|
12588
|
+
editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax);
|
|
12589
|
+
} // 导入FORM里
|
|
12010
12590
|
|
|
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
12591
|
|
|
12014
|
-
if (
|
|
12015
|
-
s.goodsListState.
|
|
12016
|
-
|
|
12592
|
+
if (s.goodsListState.isMyShow) {
|
|
12593
|
+
s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
12594
|
+
itemName: editGood.itemNameSelf,
|
|
12595
|
+
itemModelName: editGood.itemModelNameSelf
|
|
12596
|
+
}));
|
|
12017
12597
|
} else {
|
|
12018
|
-
s.goodsListState.
|
|
12598
|
+
s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
|
|
12019
12599
|
}
|
|
12020
12600
|
|
|
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
12601
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
12025
12602
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
12026
12603
|
|
|
@@ -12042,11 +12619,12 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
12042
12619
|
});
|
|
12043
12620
|
};
|
|
12044
12621
|
/** 货物名称 */
|
|
12622
|
+
// const getItemName = (record: any) => {
|
|
12623
|
+
// return record.shorthand
|
|
12624
|
+
// ? `*${record.shorthand}*${record.itemName}`
|
|
12625
|
+
// : record.itemName;
|
|
12626
|
+
// };
|
|
12045
12627
|
|
|
12046
|
-
|
|
12047
|
-
var getItemName = function getItemName(record) {
|
|
12048
|
-
return record.shorthand ? "*".concat(record.shorthand, "*").concat(record.itemName) : record.itemName;
|
|
12049
|
-
};
|
|
12050
12628
|
/** 货物单价,不含税 */
|
|
12051
12629
|
|
|
12052
12630
|
|
|
@@ -12054,6 +12632,39 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record) {
|
|
|
12054
12632
|
if (!s.taxRate && s.taxRate !== 0 || !record.priceIncludeTax && record.priceIncludeTax !== 0) return; // 单价(含税)/(1+税率) = 单价(不含税)
|
|
12055
12633
|
|
|
12056
12634
|
return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")));
|
|
12635
|
+
}; // 获取我方名称
|
|
12636
|
+
|
|
12637
|
+
|
|
12638
|
+
var getItemName$1 = function getItemName(record, editGood) {
|
|
12639
|
+
var _getSN;
|
|
12640
|
+
|
|
12641
|
+
var shorthand;
|
|
12642
|
+
shorthand = record.shorthand;
|
|
12643
|
+
|
|
12644
|
+
if (shorthand) {
|
|
12645
|
+
return "*".concat(shorthand, "*").concat(record.itemName);
|
|
12646
|
+
}
|
|
12647
|
+
|
|
12648
|
+
shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
|
|
12649
|
+
|
|
12650
|
+
if (shorthand) {
|
|
12651
|
+
return "*".concat(shorthand, "*").concat(record.itemNameSelf);
|
|
12652
|
+
}
|
|
12653
|
+
|
|
12654
|
+
return record.itemName;
|
|
12655
|
+
}; // 获取他方名称
|
|
12656
|
+
|
|
12657
|
+
|
|
12658
|
+
var getItemNameOther = function getItemNameOther(record, editGood) {
|
|
12659
|
+
if (!editGood.itemName) return editGood.itemName;
|
|
12660
|
+
var shorthand;
|
|
12661
|
+
shorthand = record.shorthand;
|
|
12662
|
+
|
|
12663
|
+
if (shorthand) {
|
|
12664
|
+
return "*".concat(shorthand, "*").concat(record.itemNameSelf);
|
|
12665
|
+
}
|
|
12666
|
+
|
|
12667
|
+
return record.itemName;
|
|
12057
12668
|
};
|
|
12058
12669
|
|
|
12059
12670
|
/**
|
|
@@ -12113,7 +12724,7 @@ styleInject(css_248z$b);
|
|
|
12113
12724
|
var TreeNode = Tree.TreeNode;
|
|
12114
12725
|
var confirm = Modal.confirm;
|
|
12115
12726
|
var EndowCodeDrawer = (function () {
|
|
12116
|
-
var controller =
|
|
12727
|
+
var controller = Invoice.useInvoiceController();
|
|
12117
12728
|
var visible = controller.useMemo(function (s) {
|
|
12118
12729
|
return s.goodsListState.endowCode.endowcodeGoodIndex.length > 0;
|
|
12119
12730
|
}, []);
|
|
@@ -12228,7 +12839,7 @@ var EndowCodeDrawer = (function () {
|
|
|
12228
12839
|
var DrawerBody$3 = function DrawerBody(props) {
|
|
12229
12840
|
var _defaultValue$taxRate, _defaultValue$favoure;
|
|
12230
12841
|
|
|
12231
|
-
var controller =
|
|
12842
|
+
var controller = Invoice.useInvoiceController();
|
|
12232
12843
|
var defaultValue = props.defaultValue;
|
|
12233
12844
|
var actions = React.useMemo(function () {
|
|
12234
12845
|
return createAsyncFormActions();
|
|
@@ -12613,9 +13224,10 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
12613
13224
|
}); // 赋码
|
|
12614
13225
|
|
|
12615
13226
|
endowCodeGood.forEach(function (good) {
|
|
12616
|
-
if (!good) return;
|
|
12617
|
-
|
|
12618
|
-
good.
|
|
13227
|
+
if (!good) return;
|
|
13228
|
+
good.itemName = setShorthand(good.itemName, values.shorthand);
|
|
13229
|
+
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
|
|
13230
|
+
// good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
|
|
12619
13231
|
|
|
12620
13232
|
good.taxClassificationCode = values.taxClassificationCode;
|
|
12621
13233
|
good.taxRate = values.taxRate;
|
|
@@ -12863,41 +13475,199 @@ var getShorthand = function getShorthand(value) {
|
|
|
12863
13475
|
return undefined;
|
|
12864
13476
|
}
|
|
12865
13477
|
};
|
|
12866
|
-
/** 简称填入名称 */
|
|
12867
13478
|
|
|
13479
|
+
function AddComparisonDrawer() {
|
|
13480
|
+
var _Form$useForm = Form$1.useForm(),
|
|
13481
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
13482
|
+
form = _Form$useForm2[0];
|
|
13483
|
+
/** 控制器 */
|
|
12868
13484
|
|
|
12869
|
-
var getItemName$1 = function getItemName(value, shorthand) {
|
|
12870
|
-
if (!value) value = '';
|
|
12871
13485
|
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
}
|
|
13486
|
+
var controller = Invoice.useInvoiceController();
|
|
13487
|
+
/** 正在 添加商品对照 的货物索引 */
|
|
12875
13488
|
|
|
12876
|
-
var
|
|
13489
|
+
var addComparisonIndex = controller.useMemo(function (s) {
|
|
13490
|
+
return s.goodsListState.addComparisonIndex;
|
|
13491
|
+
}, []);
|
|
13492
|
+
/** 货物字典 */
|
|
12877
13493
|
|
|
12878
|
-
|
|
12879
|
-
return
|
|
12880
|
-
}
|
|
12881
|
-
|
|
12882
|
-
|
|
12883
|
-
|
|
13494
|
+
var goodsMap = controller.useMemo(function (s) {
|
|
13495
|
+
return s.goodsListState.goodsMap;
|
|
13496
|
+
}, []);
|
|
13497
|
+
/** 正在 对照 的货物 */
|
|
13498
|
+
|
|
13499
|
+
var good = React.useMemo(function () {
|
|
13500
|
+
return addComparisonIndex ? goodsMap.get(addComparisonIndex) : undefined;
|
|
13501
|
+
}, [addComparisonIndex]);
|
|
13502
|
+
/** 关闭对照 */
|
|
13503
|
+
|
|
13504
|
+
var onClose = React.useCallback(controller.pipeline( /*#__PURE__*/function () {
|
|
13505
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
13506
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13507
|
+
while (1) {
|
|
13508
|
+
switch (_context.prev = _context.next) {
|
|
13509
|
+
case 0:
|
|
13510
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
13511
|
+
|
|
13512
|
+
case 1:
|
|
13513
|
+
case "end":
|
|
13514
|
+
return _context.stop();
|
|
13515
|
+
}
|
|
13516
|
+
}
|
|
13517
|
+
}, _callee);
|
|
13518
|
+
}));
|
|
13519
|
+
|
|
13520
|
+
return function (_x) {
|
|
13521
|
+
return _ref.apply(this, arguments);
|
|
13522
|
+
};
|
|
13523
|
+
}()), [controller]);
|
|
13524
|
+
/** 提交数据 */
|
|
13525
|
+
|
|
13526
|
+
var onSubmit = React.useCallback(function () {
|
|
13527
|
+
controller.run( /*#__PURE__*/function () {
|
|
13528
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
13529
|
+
var _getSN, _getSN2, values, shorthand;
|
|
13530
|
+
|
|
13531
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
13532
|
+
while (1) {
|
|
13533
|
+
switch (_context2.prev = _context2.next) {
|
|
13534
|
+
case 0:
|
|
13535
|
+
if (good) {
|
|
13536
|
+
_context2.next = 2;
|
|
13537
|
+
break;
|
|
13538
|
+
}
|
|
13539
|
+
|
|
13540
|
+
return _context2.abrupt("return");
|
|
13541
|
+
|
|
13542
|
+
case 2:
|
|
13543
|
+
_context2.prev = 2;
|
|
13544
|
+
_context2.next = 5;
|
|
13545
|
+
return form.validateFields();
|
|
13546
|
+
|
|
13547
|
+
case 5:
|
|
13548
|
+
values = _context2.sent;
|
|
13549
|
+
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;
|
|
13550
|
+
good.itemCode = values.itemCode;
|
|
13551
|
+
good.itemCodeSelf = values.itemCodeSelf;
|
|
13552
|
+
good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
|
|
13553
|
+
good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
|
|
13554
|
+
good.itemModelName = values.itemModelName;
|
|
13555
|
+
good.itemModelNameSelf = values.itemModelNameSelf;
|
|
13556
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
13557
|
+
s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
|
|
13558
|
+
_context2.next = 19;
|
|
13559
|
+
break;
|
|
13560
|
+
|
|
13561
|
+
case 17:
|
|
13562
|
+
_context2.prev = 17;
|
|
13563
|
+
_context2.t0 = _context2["catch"](2);
|
|
13564
|
+
|
|
13565
|
+
case 19:
|
|
13566
|
+
case "end":
|
|
13567
|
+
return _context2.stop();
|
|
13568
|
+
}
|
|
13569
|
+
}
|
|
13570
|
+
}, _callee2, null, [[2, 17]]);
|
|
13571
|
+
}));
|
|
13572
|
+
|
|
13573
|
+
return function (_x2) {
|
|
13574
|
+
return _ref2.apply(this, arguments);
|
|
13575
|
+
};
|
|
13576
|
+
}());
|
|
13577
|
+
}, [form, good]);
|
|
13578
|
+
React.useEffect(function () {
|
|
13579
|
+
form.resetFields();
|
|
13580
|
+
|
|
13581
|
+
if (good) {
|
|
13582
|
+
var _getSN3, _getSN4;
|
|
13583
|
+
|
|
13584
|
+
form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
|
|
13585
|
+
itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
|
|
13586
|
+
itemNameSelf: (_getSN4 = getSN(good.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
|
|
13587
|
+
}));
|
|
13588
|
+
}
|
|
13589
|
+
}, [good]);
|
|
13590
|
+
return React.createElement(Drawer$1, {
|
|
13591
|
+
width: 500,
|
|
13592
|
+
onClose: onClose,
|
|
13593
|
+
placement: "right",
|
|
13594
|
+
title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
|
|
13595
|
+
visible: !!good,
|
|
13596
|
+
footer: React.createElement("div", {
|
|
13597
|
+
style: {
|
|
13598
|
+
display: 'flex',
|
|
13599
|
+
justifyContent: 'flex-end',
|
|
13600
|
+
gap: 10
|
|
13601
|
+
}
|
|
13602
|
+
}, React.createElement(Button, {
|
|
13603
|
+
type: "primary",
|
|
13604
|
+
onClick: onSubmit
|
|
13605
|
+
}, "\u63D0\u4EA4"), React.createElement(Button, {
|
|
13606
|
+
onClick: onClose
|
|
13607
|
+
}, "\u53D6\u6D88"))
|
|
13608
|
+
}, !!good && React.createElement(Form$1, {
|
|
13609
|
+
layout: "vertical",
|
|
13610
|
+
style: {
|
|
13611
|
+
flex: 1
|
|
13612
|
+
},
|
|
13613
|
+
form: form
|
|
13614
|
+
}, React.createElement(Row, {
|
|
13615
|
+
gutter: [8, 8]
|
|
13616
|
+
}, React.createElement(Col, {
|
|
13617
|
+
span: 12
|
|
13618
|
+
}, React.createElement(Form$1.Item, {
|
|
13619
|
+
name: "itemCodeSelf",
|
|
13620
|
+
label: "\u6211\u65B9\u5546\u54C1\u7F16\u7801"
|
|
13621
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13622
|
+
span: 12
|
|
13623
|
+
}, React.createElement(Form$1.Item, {
|
|
13624
|
+
name: "itemCode",
|
|
13625
|
+
label: "\u5BF9\u65B9\u5546\u54C1\u7F16\u7801"
|
|
13626
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13627
|
+
span: 12
|
|
13628
|
+
}, React.createElement(Form$1.Item, {
|
|
13629
|
+
name: "itemNameSelf",
|
|
13630
|
+
label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
|
|
13631
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13632
|
+
span: 12
|
|
13633
|
+
}, React.createElement(Form$1.Item, {
|
|
13634
|
+
name: "itemName",
|
|
13635
|
+
label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
|
|
13636
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13637
|
+
span: 12
|
|
13638
|
+
}, React.createElement(Form$1.Item, {
|
|
13639
|
+
name: 'itemModelNameSelf',
|
|
13640
|
+
label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
|
|
13641
|
+
}, React.createElement(Input, null))), React.createElement(Col, {
|
|
13642
|
+
span: 12
|
|
13643
|
+
}, React.createElement(Form$1.Item, {
|
|
13644
|
+
name: "itemModelName",
|
|
13645
|
+
label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
|
|
13646
|
+
}, React.createElement(Input, null))))));
|
|
13647
|
+
} // function validateFields(form: WrappedFormUtils<any>) {
|
|
13648
|
+
// return new Promise<{ err: any, values: any }>(resolve => {
|
|
13649
|
+
// form.validateFields((err, values) => {
|
|
13650
|
+
// resolve({ err, values })
|
|
13651
|
+
// })
|
|
13652
|
+
// })
|
|
13653
|
+
// }
|
|
12884
13654
|
|
|
12885
13655
|
/** 发票组件的上下文 */
|
|
12886
13656
|
|
|
12887
13657
|
var InvoiceContext = React.createContext(undefined);
|
|
12888
13658
|
|
|
12889
|
-
var
|
|
12890
|
-
_inherits(
|
|
13659
|
+
var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
13660
|
+
_inherits(Invoice, _React$PureComponent);
|
|
12891
13661
|
|
|
12892
|
-
var _super = _createSuper(
|
|
13662
|
+
var _super = _createSuper(Invoice);
|
|
12893
13663
|
|
|
12894
|
-
function
|
|
12895
|
-
_classCallCheck(this,
|
|
13664
|
+
function Invoice() {
|
|
13665
|
+
_classCallCheck(this, Invoice);
|
|
12896
13666
|
|
|
12897
13667
|
return _super.apply(this, arguments);
|
|
12898
13668
|
}
|
|
12899
13669
|
|
|
12900
|
-
_createClass(
|
|
13670
|
+
_createClass(Invoice, [{
|
|
12901
13671
|
key: "render",
|
|
12902
13672
|
value:
|
|
12903
13673
|
/** 控制器 */
|
|
@@ -12920,18 +13690,18 @@ var default_1 = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
12920
13690
|
}
|
|
12921
13691
|
}]);
|
|
12922
13692
|
|
|
12923
|
-
return
|
|
13693
|
+
return Invoice;
|
|
12924
13694
|
}(React.PureComponent);
|
|
12925
13695
|
|
|
12926
|
-
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
13696
|
+
Invoice.InvoiceController = InvoiceController;
|
|
13697
|
+
Invoice.InvoiceHeader = InvoiceHeader;
|
|
13698
|
+
Invoice.GoodsList = GoodsList;
|
|
13699
|
+
Invoice.Seller = Buyer;
|
|
13700
|
+
Invoice.Sign = Sign;
|
|
13701
|
+
Invoice.Buyer = Buyer$1;
|
|
13702
|
+
Invoice.idGenerator = idGenerator;
|
|
12933
13703
|
|
|
12934
|
-
|
|
13704
|
+
Invoice.useInvoiceController = function () {
|
|
12935
13705
|
return React.useContext(InvoiceContext);
|
|
12936
13706
|
};
|
|
12937
13707
|
|
|
@@ -12963,7 +13733,7 @@ var Main$3 = function Main(props) {
|
|
|
12963
13733
|
/** 销售方 */
|
|
12964
13734
|
, props.sign || React.createElement(Sign, null)
|
|
12965
13735
|
/** 落款 */
|
|
12966
|
-
, props.footExpand), React.createElement(ImportBuyerDrawer, null), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null));
|
|
13736
|
+
, props.footExpand), React.createElement(ImportBuyerDrawer, null), React.createElement(ImportGoodsDrawer, null), React.createElement(EndowCodeDrawer, null), React.createElement(AddComparisonDrawer, null));
|
|
12967
13737
|
};
|
|
12968
13738
|
|
|
12969
|
-
export {
|
|
13739
|
+
export { Invoice, InvoiceController };
|