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.js
CHANGED
|
@@ -11,6 +11,7 @@ var uuid = require('uuid');
|
|
|
11
11
|
var classnames = require('classnames');
|
|
12
12
|
var antdComponents = require('@formily/antd-components');
|
|
13
13
|
var antd = require('@formily/antd');
|
|
14
|
+
var ktsXui = require('kts-xui');
|
|
14
15
|
|
|
15
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
17
|
|
|
@@ -982,6 +983,12 @@ function draft(value) {
|
|
|
982
983
|
}
|
|
983
984
|
}
|
|
984
985
|
|
|
986
|
+
var ProductComparison = /*#__PURE__*/_createClass(function ProductComparison() {
|
|
987
|
+
_classCallCheck(this, ProductComparison);
|
|
988
|
+
|
|
989
|
+
this.onComply = void 0;
|
|
990
|
+
});
|
|
991
|
+
|
|
985
992
|
var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
986
993
|
_classCallCheck(this, GoodsListState);
|
|
987
994
|
|
|
@@ -990,6 +997,7 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
990
997
|
this.isSwitchTax = void 0;
|
|
991
998
|
this.isAddDiscount = void 0;
|
|
992
999
|
this.isTaxIncluded = true;
|
|
1000
|
+
this.isMyShow = false;
|
|
993
1001
|
this.editGood = void 0;
|
|
994
1002
|
this.form = void 0;
|
|
995
1003
|
this.unitList = [];
|
|
@@ -1003,7 +1011,9 @@ var GoodsListState = /*#__PURE__*/_createClass(function GoodsListState() {
|
|
|
1003
1011
|
this.discountGoodIndex = [];
|
|
1004
1012
|
this.endowCode = new EndowCode();
|
|
1005
1013
|
this.importGoods = new ImportGoods();
|
|
1014
|
+
this.productComparison = new ProductComparison();
|
|
1006
1015
|
this.isVisibleDrawer = false;
|
|
1016
|
+
this.addComparisonIndex = void 0;
|
|
1007
1017
|
});
|
|
1008
1018
|
|
|
1009
1019
|
var BuyerState = /*#__PURE__*/_createClass(function BuyerState() {
|
|
@@ -1608,7 +1618,7 @@ var InvoiceHeader = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(fu
|
|
|
1608
1618
|
/** 控制器 */
|
|
1609
1619
|
|
|
1610
1620
|
|
|
1611
|
-
var controller =
|
|
1621
|
+
var controller = Invoice.useInvoiceController();
|
|
1612
1622
|
var model = controller.useMemo(function (s) {
|
|
1613
1623
|
return s.model;
|
|
1614
1624
|
}, []);
|
|
@@ -1922,7 +1932,7 @@ styleInject(css_248z$3);
|
|
|
1922
1932
|
var nzhcn = require('nzh').cn;
|
|
1923
1933
|
|
|
1924
1934
|
var Statistics = (function () {
|
|
1925
|
-
var controller =
|
|
1935
|
+
var controller = Invoice.useInvoiceController();
|
|
1926
1936
|
/** 是否不含税) */
|
|
1927
1937
|
|
|
1928
1938
|
var isTaxIncluded = controller.useMemo(function (s) {
|
|
@@ -2030,7 +2040,7 @@ var Statistics = (function () {
|
|
|
2030
2040
|
});
|
|
2031
2041
|
|
|
2032
2042
|
var AddRowButton = (function () {
|
|
2033
|
-
var controller =
|
|
2043
|
+
var controller = Invoice.useInvoiceController();
|
|
2034
2044
|
var model = controller.useMemo(function (s) {
|
|
2035
2045
|
return s.model;
|
|
2036
2046
|
}, []);
|
|
@@ -2124,7 +2134,7 @@ var AddRowButton = (function () {
|
|
|
2124
2134
|
});
|
|
2125
2135
|
|
|
2126
2136
|
var TaxIncludedSwitch = (function () {
|
|
2127
|
-
var controller =
|
|
2137
|
+
var controller = Invoice.useInvoiceController();
|
|
2128
2138
|
/** 是否含税 */
|
|
2129
2139
|
|
|
2130
2140
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
@@ -2159,7 +2169,11 @@ var TaxIncludedSwitch = (function () {
|
|
|
2159
2169
|
};
|
|
2160
2170
|
}())();
|
|
2161
2171
|
}, []);
|
|
2162
|
-
return React__default['default'].createElement("span", null, React__default['default'].createElement("label",
|
|
2172
|
+
return React__default['default'].createElement("span", null, React__default['default'].createElement("label", {
|
|
2173
|
+
style: {
|
|
2174
|
+
marginRight: 2
|
|
2175
|
+
}
|
|
2176
|
+
}, "\u542B\u7A0E:"), React__default['default'].createElement(ktsComponentsAntdX3.Switch, {
|
|
2163
2177
|
disabled: isSwitchTax === false,
|
|
2164
2178
|
checked: isTaxIncluded,
|
|
2165
2179
|
checkedChildren: "\u5F00",
|
|
@@ -2169,6 +2183,57 @@ var TaxIncludedSwitch = (function () {
|
|
|
2169
2183
|
}));
|
|
2170
2184
|
});
|
|
2171
2185
|
|
|
2186
|
+
var DescribeSwitch = (function () {
|
|
2187
|
+
var controller = Invoice.useInvoiceController();
|
|
2188
|
+
var productComparison = controller.useMemo(function (s) {
|
|
2189
|
+
return s.goodsListState.productComparison;
|
|
2190
|
+
}, []);
|
|
2191
|
+
var isMyShow = controller.useMemo(function (s) {
|
|
2192
|
+
return s.goodsListState.isMyShow;
|
|
2193
|
+
}, []);
|
|
2194
|
+
var onChange = React__default['default'].useCallback(function (e) {
|
|
2195
|
+
controller.run( /*#__PURE__*/function () {
|
|
2196
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2197
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2198
|
+
while (1) {
|
|
2199
|
+
switch (_context.prev = _context.next) {
|
|
2200
|
+
case 0:
|
|
2201
|
+
return _context.abrupt("return", s.goodsListState.isMyShow = !s.goodsListState.isMyShow);
|
|
2202
|
+
|
|
2203
|
+
case 1:
|
|
2204
|
+
case "end":
|
|
2205
|
+
return _context.stop();
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
}, _callee);
|
|
2209
|
+
}));
|
|
2210
|
+
|
|
2211
|
+
return function (_x) {
|
|
2212
|
+
return _ref.apply(this, arguments);
|
|
2213
|
+
};
|
|
2214
|
+
}());
|
|
2215
|
+
}, []);
|
|
2216
|
+
if (!productComparison.onComply) return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2217
|
+
return React__default['default'].createElement("span", null, React__default['default'].createElement("label", {
|
|
2218
|
+
style: {
|
|
2219
|
+
marginRight: 2
|
|
2220
|
+
}
|
|
2221
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Tooltip, {
|
|
2222
|
+
title: "\u84DD\u8272\u4EE3\u8868\u6211\u65B9\u5546\u54C1\u63CF\u8FF0\uFF0C\u9ED1\u8272\u4EE3\u8868\u5BF9\u65B9\u7684\u5546\u54C1\u63CF\u8FF0\u3002"
|
|
2223
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Icon, {
|
|
2224
|
+
style: {
|
|
2225
|
+
marginRight: 3
|
|
2226
|
+
},
|
|
2227
|
+
type: "info-circle"
|
|
2228
|
+
})), "\u4F7F\u7528\u54EA\u65B9\u5546\u54C1\u63CF\u8FF0:"), React__default['default'].createElement(ktsComponentsAntdX3.Switch, {
|
|
2229
|
+
checked: isMyShow,
|
|
2230
|
+
checkedChildren: "\u6211\u65B9",
|
|
2231
|
+
unCheckedChildren: "\u5BF9\u65B9",
|
|
2232
|
+
defaultChecked: true,
|
|
2233
|
+
onChange: onChange
|
|
2234
|
+
}));
|
|
2235
|
+
});
|
|
2236
|
+
|
|
2172
2237
|
var _path$1;
|
|
2173
2238
|
|
|
2174
2239
|
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); }
|
|
@@ -2189,7 +2254,7 @@ var css_248z$4 = ".kts-invoice-operate-goods-list-able-list .kts-invoice-operate
|
|
|
2189
2254
|
styleInject(css_248z$4);
|
|
2190
2255
|
|
|
2191
2256
|
function Search() {
|
|
2192
|
-
var controller =
|
|
2257
|
+
var controller = Invoice.useInvoiceController();
|
|
2193
2258
|
|
|
2194
2259
|
var _React$useState = React__default['default'].useState(''),
|
|
2195
2260
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
@@ -2272,7 +2337,7 @@ function Search() {
|
|
|
2272
2337
|
}
|
|
2273
2338
|
|
|
2274
2339
|
function TableRow(props) {
|
|
2275
|
-
var controller =
|
|
2340
|
+
var controller = Invoice.useInvoiceController();
|
|
2276
2341
|
var goodsMap = controller.useMemo(function (s) {
|
|
2277
2342
|
return s.goodsListState.goodsMap;
|
|
2278
2343
|
}, []);
|
|
@@ -2286,6 +2351,70 @@ function TableRow(props) {
|
|
|
2286
2351
|
}));
|
|
2287
2352
|
}
|
|
2288
2353
|
|
|
2354
|
+
var useDelRowButton = (function () {
|
|
2355
|
+
var controller = Invoice.useInvoiceController();
|
|
2356
|
+
var model = controller.useMemo(function (s) {
|
|
2357
|
+
return s.model;
|
|
2358
|
+
}, []);
|
|
2359
|
+
/** 是否禁用 */
|
|
2360
|
+
|
|
2361
|
+
var disabled = controller.useMemo(function (s) {
|
|
2362
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
2363
|
+
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
2364
|
+
var good = s.goodsListState.goodsMap.get(e);
|
|
2365
|
+
if (!good) return true;
|
|
2366
|
+
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
2367
|
+
});
|
|
2368
|
+
}, []);
|
|
2369
|
+
var onClick = React__default['default'].useCallback(function () {
|
|
2370
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
2371
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2372
|
+
var goodsList;
|
|
2373
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2374
|
+
while (1) {
|
|
2375
|
+
switch (_context.prev = _context.next) {
|
|
2376
|
+
case 0:
|
|
2377
|
+
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
2378
|
+
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
2379
|
+
});
|
|
2380
|
+
|
|
2381
|
+
if (s.goodsListState.editGood) {
|
|
2382
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
|
|
2383
|
+
controller.setEditGood();
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2387
|
+
s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
|
|
2388
|
+
goodsList: goodsList,
|
|
2389
|
+
selectedGoodIndex: []
|
|
2390
|
+
});
|
|
2391
|
+
|
|
2392
|
+
case 3:
|
|
2393
|
+
case "end":
|
|
2394
|
+
return _context.stop();
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
}, _callee);
|
|
2398
|
+
}));
|
|
2399
|
+
|
|
2400
|
+
return function (_x) {
|
|
2401
|
+
return _ref.apply(this, arguments);
|
|
2402
|
+
};
|
|
2403
|
+
}())();
|
|
2404
|
+
}, [controller]);
|
|
2405
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
2406
|
+
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2407
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
2408
|
+
key: "1",
|
|
2409
|
+
onClick: onClick,
|
|
2410
|
+
disabled: disabled
|
|
2411
|
+
}, "\u5220\u9664\u884C");
|
|
2412
|
+
}, [model, onClick, disabled]);
|
|
2413
|
+
return {
|
|
2414
|
+
menuItem: menuItem
|
|
2415
|
+
};
|
|
2416
|
+
});
|
|
2417
|
+
|
|
2289
2418
|
/** 延迟函数 */
|
|
2290
2419
|
var lazyFn = (function (fn) {
|
|
2291
2420
|
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
@@ -2332,9 +2461,9 @@ var _create = mathjs.create(mathjs.all, {
|
|
|
2332
2461
|
}),
|
|
2333
2462
|
chain = _create.chain;
|
|
2334
2463
|
|
|
2335
|
-
var
|
|
2464
|
+
var useAddDiscountRowButton = (function () {
|
|
2336
2465
|
/** 控制器 */
|
|
2337
|
-
var controller =
|
|
2466
|
+
var controller = Invoice.useInvoiceController();
|
|
2338
2467
|
var model = controller.useMemo(function (s) {
|
|
2339
2468
|
return s.model;
|
|
2340
2469
|
}, []);
|
|
@@ -2478,25 +2607,33 @@ var AddDiscountRowButton = GreyReactBox.decorator(ktsComponentsAntdX3.Form.creat
|
|
|
2478
2607
|
}
|
|
2479
2608
|
}, _callee3);
|
|
2480
2609
|
})), [controller]);
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2610
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
2611
|
+
return model === 'prefab' ? React__default['default'].createElement(React__default['default'].Fragment, null) : isAddDiscount !== false ? React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
2612
|
+
key: "0",
|
|
2613
|
+
onClick: onClick,
|
|
2614
|
+
disabled: disabled
|
|
2615
|
+
}, "\u6DFB\u52A0\u6298\u6263\u884C") : undefined;
|
|
2616
|
+
}, [isAddDiscount, disabled, onClick]);
|
|
2617
|
+
var drawer = React__default['default'].useMemo(function () {
|
|
2618
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Drawer, {
|
|
2619
|
+
className: "kts-invoice-operate-goods-list-add-discount-row",
|
|
2620
|
+
width: 540,
|
|
2621
|
+
title: "\u6DFB\u52A0\u6298\u6263\u884C",
|
|
2622
|
+
placement: "right",
|
|
2623
|
+
destroyOnClose: true,
|
|
2624
|
+
onClose: onClose,
|
|
2625
|
+
visible: visible
|
|
2626
|
+
}, React__default['default'].createElement(DrawerBody, null));
|
|
2627
|
+
}, [visible, onClose]);
|
|
2628
|
+
return {
|
|
2629
|
+
menuItem: menuItem,
|
|
2630
|
+
drawer: drawer
|
|
2631
|
+
};
|
|
2495
2632
|
});
|
|
2496
2633
|
var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
2497
2634
|
var form = props.form;
|
|
2498
2635
|
var getFieldDecorator = form.getFieldDecorator;
|
|
2499
|
-
var controller =
|
|
2636
|
+
var controller = Invoice.useInvoiceController();
|
|
2500
2637
|
/** 选中的货物索引列表 */
|
|
2501
2638
|
|
|
2502
2639
|
var discountGoodIndex = controller.useMemo(function (s) {
|
|
@@ -2715,8 +2852,8 @@ var coolingFn = (function () {
|
|
|
2715
2852
|
}
|
|
2716
2853
|
});
|
|
2717
2854
|
|
|
2718
|
-
var
|
|
2719
|
-
var controller =
|
|
2855
|
+
var useEndowCodeButton = (function () {
|
|
2856
|
+
var controller = Invoice.useInvoiceController();
|
|
2720
2857
|
/** 是否禁用 */
|
|
2721
2858
|
|
|
2722
2859
|
var disabled = controller.useMemo(function (s) {
|
|
@@ -2793,72 +2930,195 @@ var EndowCodeButton = (function () {
|
|
|
2793
2930
|
}
|
|
2794
2931
|
}, _callee2);
|
|
2795
2932
|
})), [controller]);
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2933
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
2934
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
2935
|
+
key: "2",
|
|
2936
|
+
onClick: onClick,
|
|
2937
|
+
disabled: disabled
|
|
2938
|
+
}, "\u6279\u91CF\u8D4B\u7801");
|
|
2939
|
+
}, [onClick, disabled]);
|
|
2940
|
+
return {
|
|
2941
|
+
menuItem: menuItem
|
|
2942
|
+
};
|
|
2801
2943
|
});
|
|
2802
2944
|
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2945
|
+
/** 拆分全称加简称 */
|
|
2946
|
+
var getSN = function getSN(value) {
|
|
2947
|
+
debugger;
|
|
2948
|
+
if (!value) return undefined;
|
|
2949
|
+
var arr = value.match(/\*[^*]+\*/);
|
|
2950
|
+
|
|
2951
|
+
if (arr && arr[0]) {
|
|
2952
|
+
return {
|
|
2953
|
+
shorthand: arr[0].split('*')[1],
|
|
2954
|
+
full: value.replace(arr[0], '')
|
|
2955
|
+
};
|
|
2956
|
+
} else {
|
|
2957
|
+
return {
|
|
2958
|
+
shorthand: undefined,
|
|
2959
|
+
full: value
|
|
2960
|
+
};
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2963
|
+
/** 组合全称加简称 */
|
|
2964
|
+
|
|
2965
|
+
var getItemName = function getItemName(value) {
|
|
2966
|
+
if (value.shorthand) {
|
|
2967
|
+
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2968
|
+
} else {
|
|
2969
|
+
return value.full;
|
|
2970
|
+
}
|
|
2971
|
+
};
|
|
2972
|
+
/** 设置简称 */
|
|
2973
|
+
|
|
2974
|
+
var setShorthand = function setShorthand(name, shorthand) {
|
|
2975
|
+
if (!name) return undefined;
|
|
2976
|
+
var sn = getSN(name);
|
|
2977
|
+
if (!sn) return undefined;
|
|
2978
|
+
sn.shorthand = shorthand || '';
|
|
2979
|
+
return getItemName(sn);
|
|
2980
|
+
};
|
|
2981
|
+
|
|
2982
|
+
var useCommodityComparisonButton = (function () {
|
|
2983
|
+
var controller = Invoice.useInvoiceController();
|
|
2984
|
+
|
|
2985
|
+
var _controller$useMemo = controller.useMemo(function (s) {
|
|
2986
|
+
return s.goodsListState.productComparison;
|
|
2987
|
+
}, []),
|
|
2988
|
+
onComply = _controller$useMemo.onComply;
|
|
2808
2989
|
/** 是否禁用 */
|
|
2809
2990
|
|
|
2991
|
+
|
|
2810
2992
|
var disabled = controller.useMemo(function (s) {
|
|
2811
|
-
|
|
2812
|
-
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
2813
|
-
var good = s.goodsListState.goodsMap.get(e);
|
|
2814
|
-
if (!good) return true;
|
|
2815
|
-
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
2816
|
-
});
|
|
2993
|
+
return s.goodsListState.selectedGoodIndex.length <= 0;
|
|
2817
2994
|
}, []);
|
|
2818
|
-
|
|
2819
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
2820
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2821
|
-
var goodsList;
|
|
2822
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2823
|
-
while (1) {
|
|
2824
|
-
switch (_context.prev = _context.next) {
|
|
2825
|
-
case 0:
|
|
2826
|
-
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
2827
|
-
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
2828
|
-
});
|
|
2995
|
+
/** 点击了 */
|
|
2829
2996
|
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2997
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2998
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2999
|
+
while (1) {
|
|
3000
|
+
switch (_context2.prev = _context2.next) {
|
|
3001
|
+
case 0:
|
|
3002
|
+
_context2.next = 2;
|
|
3003
|
+
return controller.saveEditGood();
|
|
2835
3004
|
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
});
|
|
3005
|
+
case 2:
|
|
3006
|
+
_context2.next = 4;
|
|
3007
|
+
return controller.wait();
|
|
2840
3008
|
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
}, _callee);
|
|
2847
|
-
}));
|
|
3009
|
+
case 4:
|
|
3010
|
+
_context2.next = 6;
|
|
3011
|
+
return controller.run( /*#__PURE__*/function () {
|
|
3012
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
3013
|
+
var _s$goodsListState, _s$goodsListState$pro;
|
|
2848
3014
|
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
3015
|
+
var goods, newGoods;
|
|
3016
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3017
|
+
while (1) {
|
|
3018
|
+
switch (_context.prev = _context.next) {
|
|
3019
|
+
case 0:
|
|
3020
|
+
if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
|
|
3021
|
+
_context.next = 3;
|
|
3022
|
+
break;
|
|
3023
|
+
}
|
|
3024
|
+
|
|
3025
|
+
coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
|
|
3026
|
+
ktsComponentsAntdX3.message.error('不能给正在编辑的货物执行商品对照');
|
|
3027
|
+
});
|
|
3028
|
+
return _context.abrupt("return");
|
|
3029
|
+
|
|
3030
|
+
case 3:
|
|
3031
|
+
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) {
|
|
3032
|
+
_context.next = 5;
|
|
3033
|
+
break;
|
|
3034
|
+
}
|
|
3035
|
+
|
|
3036
|
+
return _context.abrupt("return");
|
|
3037
|
+
|
|
3038
|
+
case 5:
|
|
3039
|
+
goods = s.goodsListState.selectedGoodIndex.map(function (e) {
|
|
3040
|
+
var _getSN, _getSN2;
|
|
3041
|
+
|
|
3042
|
+
var t = s.goodsListState.goodsMap.get(e);
|
|
3043
|
+
if (!t) return undefined;
|
|
3044
|
+
return _objectSpread2(_objectSpread2({}, t), {}, {
|
|
3045
|
+
itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
|
|
3046
|
+
itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
|
|
3047
|
+
});
|
|
3048
|
+
}).filter(function (e) {
|
|
3049
|
+
return !!e;
|
|
3050
|
+
}); // 比对后的商品
|
|
3051
|
+
|
|
3052
|
+
_context.next = 8;
|
|
3053
|
+
return s.goodsListState.productComparison.onComply(goods);
|
|
3054
|
+
|
|
3055
|
+
case 8:
|
|
3056
|
+
newGoods = _context.sent;
|
|
3057
|
+
newGoods.filter(function (e) {
|
|
3058
|
+
var _getSN3, _getSN4;
|
|
3059
|
+
|
|
3060
|
+
var vt = s.goodsListState.goodsMap.get(e.$index);
|
|
3061
|
+
if (!vt) return undefined;
|
|
3062
|
+
vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
|
|
3063
|
+
vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
|
|
3064
|
+
vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
|
|
3065
|
+
vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
|
|
3066
|
+
vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
|
|
3067
|
+
vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
|
|
3068
|
+
});
|
|
3069
|
+
|
|
3070
|
+
case 10:
|
|
3071
|
+
case "end":
|
|
3072
|
+
return _context.stop();
|
|
3073
|
+
}
|
|
3074
|
+
}
|
|
3075
|
+
}, _callee);
|
|
3076
|
+
}));
|
|
3077
|
+
|
|
3078
|
+
return function (_x) {
|
|
3079
|
+
return _ref2.apply(this, arguments);
|
|
3080
|
+
};
|
|
3081
|
+
}());
|
|
3082
|
+
|
|
3083
|
+
case 6:
|
|
3084
|
+
case "end":
|
|
3085
|
+
return _context2.stop();
|
|
3086
|
+
}
|
|
3087
|
+
}
|
|
3088
|
+
}, _callee2);
|
|
3089
|
+
})), []);
|
|
3090
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
3091
|
+
// 没用 执行商品对照 的方法 不显示按钮
|
|
3092
|
+
if (!onComply) return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
3093
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
3094
|
+
key: "3",
|
|
3095
|
+
disabled: disabled,
|
|
3096
|
+
onClick: onClick
|
|
3097
|
+
}, "\u6267\u884C\u5546\u54C1\u5BF9\u7167");
|
|
3098
|
+
}, [disabled, onClick, onComply]);
|
|
3099
|
+
return {
|
|
3100
|
+
menuItem: menuItem
|
|
3101
|
+
};
|
|
2860
3102
|
});
|
|
2861
3103
|
|
|
3104
|
+
function BulkMenu() {
|
|
3105
|
+
/** 删除行 */
|
|
3106
|
+
var delRowButton = useDelRowButton();
|
|
3107
|
+
/** 添加折扣行 */
|
|
3108
|
+
|
|
3109
|
+
var addDiscountRowButton = useAddDiscountRowButton();
|
|
3110
|
+
/** 批量赋码 */
|
|
3111
|
+
|
|
3112
|
+
var endowCodeButton = useEndowCodeButton();
|
|
3113
|
+
/** 执行商品对照 */
|
|
3114
|
+
|
|
3115
|
+
var commodityComparisonButton = useCommodityComparisonButton();
|
|
3116
|
+
var menu = React__default['default'].createElement(ktsComponentsAntdX3.Menu, null, delRowButton.menuItem, addDiscountRowButton.menuItem, endowCodeButton.menuItem, commodityComparisonButton.menuItem);
|
|
3117
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(ktsComponentsAntdX3.Dropdown, {
|
|
3118
|
+
overlay: menu
|
|
3119
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, null, "\u6279\u91CF\u64CD\u4F5C\u884C")), addDiscountRowButton.drawer);
|
|
3120
|
+
}
|
|
3121
|
+
|
|
2862
3122
|
var _defs$1, _path$2;
|
|
2863
3123
|
|
|
2864
3124
|
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); }
|
|
@@ -2875,7 +3135,7 @@ function SvgSpot(props) {
|
|
|
2875
3135
|
|
|
2876
3136
|
var Text$1 = ktsComponentsAntdX3.Typography.Text;
|
|
2877
3137
|
var useDelItem = (function (goods) {
|
|
2878
|
-
var controller =
|
|
3138
|
+
var controller = Invoice.useInvoiceController();
|
|
2879
3139
|
var onClick = React__default['default'].useCallback(function () {
|
|
2880
3140
|
controller.delGood(goods.$index);
|
|
2881
3141
|
}, [controller, goods.$index]);
|
|
@@ -2897,7 +3157,7 @@ var useDelItem = (function (goods) {
|
|
|
2897
3157
|
|
|
2898
3158
|
var Text$2 = ktsComponentsAntdX3.Typography.Text;
|
|
2899
3159
|
var useAddDiscount = (function (goods) {
|
|
2900
|
-
var controller =
|
|
3160
|
+
var controller = Invoice.useInvoiceController();
|
|
2901
3161
|
/** 点击了 添加折扣行 按钮 */
|
|
2902
3162
|
|
|
2903
3163
|
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
@@ -9495,44 +9755,6 @@ var updateUnitPriceTax = function updateUnitPriceTax(controller, form, record) {
|
|
|
9495
9755
|
};
|
|
9496
9756
|
}());
|
|
9497
9757
|
};
|
|
9498
|
-
/** 保存到编辑货物 */
|
|
9499
|
-
|
|
9500
|
-
var onSaveEditGood = lazyFn$1(function (controller, form, record, id) {
|
|
9501
|
-
form.validateFields( /*#__PURE__*/function () {
|
|
9502
|
-
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(err, values) {
|
|
9503
|
-
var v;
|
|
9504
|
-
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
9505
|
-
while (1) {
|
|
9506
|
-
switch (_context9.prev = _context9.next) {
|
|
9507
|
-
case 0:
|
|
9508
|
-
err = err || {};
|
|
9509
|
-
|
|
9510
|
-
if (!err[id]) {
|
|
9511
|
-
_context9.next = 3;
|
|
9512
|
-
break;
|
|
9513
|
-
}
|
|
9514
|
-
|
|
9515
|
-
return _context9.abrupt("return");
|
|
9516
|
-
|
|
9517
|
-
case 3:
|
|
9518
|
-
v = {};
|
|
9519
|
-
v[id] = values[id];
|
|
9520
|
-
_context9.next = 7;
|
|
9521
|
-
return controller.setEditGood(_objectSpread2({}, v));
|
|
9522
|
-
|
|
9523
|
-
case 7:
|
|
9524
|
-
case "end":
|
|
9525
|
-
return _context9.stop();
|
|
9526
|
-
}
|
|
9527
|
-
}
|
|
9528
|
-
}, _callee9);
|
|
9529
|
-
}));
|
|
9530
|
-
|
|
9531
|
-
return function (_x17, _x18) {
|
|
9532
|
-
return _ref9.apply(this, arguments);
|
|
9533
|
-
};
|
|
9534
|
-
}());
|
|
9535
|
-
}, 1000);
|
|
9536
9758
|
/** 单调赋码 */
|
|
9537
9759
|
|
|
9538
9760
|
var endowCode = /*#__PURE__*/function () {
|
|
@@ -9628,10 +9850,101 @@ var endowCode = /*#__PURE__*/function () {
|
|
|
9628
9850
|
return _ref10.apply(this, arguments);
|
|
9629
9851
|
};
|
|
9630
9852
|
}();
|
|
9853
|
+
/** 修改了 货物名称 */
|
|
9631
9854
|
|
|
9632
|
-
var
|
|
9855
|
+
var onChangeItemName = /*#__PURE__*/function () {
|
|
9856
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(controller, form, record) {
|
|
9857
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
9858
|
+
while (1) {
|
|
9859
|
+
switch (_context13.prev = _context13.next) {
|
|
9860
|
+
case 0:
|
|
9861
|
+
controller.run( /*#__PURE__*/function () {
|
|
9862
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(s) {
|
|
9863
|
+
var _getSN$shorthand, _getSN;
|
|
9864
|
+
|
|
9865
|
+
var value, shorthand;
|
|
9866
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
9867
|
+
while (1) {
|
|
9868
|
+
switch (_context12.prev = _context12.next) {
|
|
9869
|
+
case 0:
|
|
9870
|
+
value = form.getFieldsValue().itemName;
|
|
9871
|
+
shorthand = (_getSN$shorthand = (_getSN = getSN(value)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand) !== null && _getSN$shorthand !== void 0 ? _getSN$shorthand : '';
|
|
9872
|
+
|
|
9873
|
+
if (!s.goodsListState.isMyShow) {
|
|
9874
|
+
_context12.next = 11;
|
|
9875
|
+
break;
|
|
9876
|
+
}
|
|
9877
|
+
|
|
9878
|
+
_context12.next = 5;
|
|
9879
|
+
return controller.setEditGood({
|
|
9880
|
+
itemNameSelf: value
|
|
9881
|
+
});
|
|
9882
|
+
|
|
9883
|
+
case 5:
|
|
9884
|
+
_context12.t0 = record.itemName;
|
|
9885
|
+
|
|
9886
|
+
if (!_context12.t0) {
|
|
9887
|
+
_context12.next = 9;
|
|
9888
|
+
break;
|
|
9889
|
+
}
|
|
9890
|
+
|
|
9891
|
+
_context12.next = 9;
|
|
9892
|
+
return controller.setEditGood({
|
|
9893
|
+
itemName: setShorthand(record.itemName, shorthand)
|
|
9894
|
+
});
|
|
9895
|
+
|
|
9896
|
+
case 9:
|
|
9897
|
+
_context12.next = 17;
|
|
9898
|
+
break;
|
|
9899
|
+
|
|
9900
|
+
case 11:
|
|
9901
|
+
_context12.next = 13;
|
|
9902
|
+
return controller.setEditGood({
|
|
9903
|
+
itemName: value
|
|
9904
|
+
});
|
|
9905
|
+
|
|
9906
|
+
case 13:
|
|
9907
|
+
_context12.t1 = record.itemNameSelf;
|
|
9908
|
+
|
|
9909
|
+
if (!_context12.t1) {
|
|
9910
|
+
_context12.next = 17;
|
|
9911
|
+
break;
|
|
9912
|
+
}
|
|
9913
|
+
|
|
9914
|
+
_context12.next = 17;
|
|
9915
|
+
return controller.setEditGood({
|
|
9916
|
+
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
9917
|
+
});
|
|
9918
|
+
|
|
9919
|
+
case 17:
|
|
9920
|
+
case "end":
|
|
9921
|
+
return _context12.stop();
|
|
9922
|
+
}
|
|
9923
|
+
}
|
|
9924
|
+
}, _callee12);
|
|
9925
|
+
}));
|
|
9926
|
+
|
|
9927
|
+
return function (_x25) {
|
|
9928
|
+
return _ref13.apply(this, arguments);
|
|
9929
|
+
};
|
|
9930
|
+
}());
|
|
9931
|
+
|
|
9932
|
+
case 1:
|
|
9933
|
+
case "end":
|
|
9934
|
+
return _context13.stop();
|
|
9935
|
+
}
|
|
9936
|
+
}
|
|
9937
|
+
}, _callee13);
|
|
9938
|
+
}));
|
|
9939
|
+
|
|
9940
|
+
return function onChangeItemName(_x22, _x23, _x24) {
|
|
9941
|
+
return _ref12.apply(this, arguments);
|
|
9942
|
+
};
|
|
9943
|
+
}();
|
|
9944
|
+
|
|
9945
|
+
var Text$3 = ktsComponentsAntdX3.Typography.Text;
|
|
9633
9946
|
var useEndowCode = (function (goods) {
|
|
9634
|
-
var controller =
|
|
9947
|
+
var controller = Invoice.useInvoiceController();
|
|
9635
9948
|
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9636
9949
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9637
9950
|
while (1) {
|
|
@@ -9656,11 +9969,102 @@ var useEndowCode = (function (goods) {
|
|
|
9656
9969
|
}, [goods.lineAttribute, onClick]);
|
|
9657
9970
|
});
|
|
9658
9971
|
|
|
9972
|
+
var Text$4 = ktsComponentsAntdX3.Typography.Text;
|
|
9973
|
+
var useAddComparison = (function (goods) {
|
|
9974
|
+
var controller = Invoice.useInvoiceController();
|
|
9975
|
+
var productComparison = controller.useMemo(function (s) {
|
|
9976
|
+
return s.goodsListState.productComparison;
|
|
9977
|
+
}, []);
|
|
9978
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9979
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9980
|
+
while (1) {
|
|
9981
|
+
switch (_context2.prev = _context2.next) {
|
|
9982
|
+
case 0:
|
|
9983
|
+
_context2.next = 2;
|
|
9984
|
+
return controller.saveEditGood();
|
|
9985
|
+
|
|
9986
|
+
case 2:
|
|
9987
|
+
_context2.next = 4;
|
|
9988
|
+
return controller.wait();
|
|
9989
|
+
|
|
9990
|
+
case 4:
|
|
9991
|
+
_context2.next = 6;
|
|
9992
|
+
return controller.run( /*#__PURE__*/function () {
|
|
9993
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
9994
|
+
var err, key;
|
|
9995
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9996
|
+
while (1) {
|
|
9997
|
+
switch (_context.prev = _context.next) {
|
|
9998
|
+
case 0:
|
|
9999
|
+
if (!s.goodsListState.form) {
|
|
10000
|
+
_context.next = 11;
|
|
10001
|
+
break;
|
|
10002
|
+
}
|
|
10003
|
+
|
|
10004
|
+
err = s.goodsListState.form.getFieldsError();
|
|
10005
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
10006
|
+
|
|
10007
|
+
case 3:
|
|
10008
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
10009
|
+
_context.next = 11;
|
|
10010
|
+
break;
|
|
10011
|
+
}
|
|
10012
|
+
|
|
10013
|
+
key = _context.t1.value;
|
|
10014
|
+
|
|
10015
|
+
if (err[key]) {
|
|
10016
|
+
_context.next = 7;
|
|
10017
|
+
break;
|
|
10018
|
+
}
|
|
10019
|
+
|
|
10020
|
+
return _context.abrupt("continue", 3);
|
|
10021
|
+
|
|
10022
|
+
case 7:
|
|
10023
|
+
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
10024
|
+
return _context.abrupt("return");
|
|
10025
|
+
|
|
10026
|
+
case 11:
|
|
10027
|
+
s.goodsListState.addComparisonIndex = goods.$index;
|
|
10028
|
+
|
|
10029
|
+
case 12:
|
|
10030
|
+
case "end":
|
|
10031
|
+
return _context.stop();
|
|
10032
|
+
}
|
|
10033
|
+
}
|
|
10034
|
+
}, _callee);
|
|
10035
|
+
}));
|
|
10036
|
+
|
|
10037
|
+
return function (_x) {
|
|
10038
|
+
return _ref2.apply(this, arguments);
|
|
10039
|
+
};
|
|
10040
|
+
}());
|
|
10041
|
+
|
|
10042
|
+
case 6:
|
|
10043
|
+
case "end":
|
|
10044
|
+
return _context2.stop();
|
|
10045
|
+
}
|
|
10046
|
+
}
|
|
10047
|
+
}, _callee2);
|
|
10048
|
+
})), [controller, goods.$index]);
|
|
10049
|
+
return React__default['default'].useMemo(function () {
|
|
10050
|
+
if (productComparison.onComply) {
|
|
10051
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10052
|
+
key: "delItem",
|
|
10053
|
+
onClick: onClick
|
|
10054
|
+
}, React__default['default'].createElement(Text$4, {
|
|
10055
|
+
strong: true
|
|
10056
|
+
}, "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167"));
|
|
10057
|
+
} else {
|
|
10058
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10059
|
+
}
|
|
10060
|
+
}, [onClick, productComparison]);
|
|
10061
|
+
});
|
|
10062
|
+
|
|
9659
10063
|
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";
|
|
9660
10064
|
styleInject(css_248z$6);
|
|
9661
10065
|
|
|
9662
10066
|
var RowMenu = (function (props) {
|
|
9663
|
-
var controller =
|
|
10067
|
+
var controller = Invoice.useInvoiceController();
|
|
9664
10068
|
var model = controller.useMemo(function (s) {
|
|
9665
10069
|
return s.model;
|
|
9666
10070
|
}, []);
|
|
@@ -9675,10 +10079,13 @@ var RowMenu = (function (props) {
|
|
|
9675
10079
|
var delItem = useDelItem(props.goods);
|
|
9676
10080
|
var addDiscount = useAddDiscount(props.goods);
|
|
9677
10081
|
var endowCode = useEndowCode(props.goods);
|
|
10082
|
+
var addComparison = useAddComparison(props.goods);
|
|
9678
10083
|
var itemList = React__default['default'].useMemo(function () {
|
|
9679
10084
|
var arr = [];
|
|
9680
10085
|
model !== 'prefab' && isAddDiscount !== false && addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
9681
10086
|
|
|
10087
|
+
arr.push(addComparison); // 添加商品对照
|
|
10088
|
+
|
|
9682
10089
|
endowCode && arr.push(endowCode); // 赋码
|
|
9683
10090
|
|
|
9684
10091
|
model !== 'prefab' && delItem && arr.push(delItem); // 删除
|
|
@@ -9711,16 +10118,21 @@ var RowMenu = (function (props) {
|
|
|
9711
10118
|
})));
|
|
9712
10119
|
});
|
|
9713
10120
|
|
|
9714
|
-
var Text$
|
|
10121
|
+
var Text$5 = ktsComponentsAntdX3.Typography.Text;
|
|
9715
10122
|
var useColumns = (function (form) {
|
|
9716
10123
|
var getFieldDecorator = form.getFieldDecorator,
|
|
9717
10124
|
getFieldValue = form.getFieldValue;
|
|
9718
|
-
var controller =
|
|
10125
|
+
var controller = Invoice.useInvoiceController();
|
|
9719
10126
|
/** 是否含税 */
|
|
9720
10127
|
|
|
9721
10128
|
var isTaxIncluded = controller.useMemo(function (e) {
|
|
9722
10129
|
return e.goodsListState.isTaxIncluded;
|
|
9723
10130
|
}, []);
|
|
10131
|
+
/** 是否显示我方 */
|
|
10132
|
+
|
|
10133
|
+
var isMyShow = controller.useMemo(function (e) {
|
|
10134
|
+
return e.goodsListState.isMyShow;
|
|
10135
|
+
}, []);
|
|
9724
10136
|
/** 正在编辑的货物 */
|
|
9725
10137
|
|
|
9726
10138
|
var editGood = controller.useMemo(function (e) {
|
|
@@ -9757,12 +10169,11 @@ var useColumns = (function (form) {
|
|
|
9757
10169
|
|
|
9758
10170
|
var columns = React__default['default'].useMemo(function () {
|
|
9759
10171
|
return [{
|
|
9760
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
10172
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$5, {
|
|
9761
10173
|
type: "danger"
|
|
9762
10174
|
}, "*"), "\u8D27\u7269\u540D\u79F0"),
|
|
9763
|
-
dataIndex: 'itemName',
|
|
9764
10175
|
key: 'itemName',
|
|
9765
|
-
render: function render(
|
|
10176
|
+
render: function render(_, record) {
|
|
9766
10177
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9767
10178
|
var _editGood$itemName;
|
|
9768
10179
|
|
|
@@ -9771,17 +10182,54 @@ var useColumns = (function (form) {
|
|
|
9771
10182
|
display: 'flex'
|
|
9772
10183
|
}
|
|
9773
10184
|
}, getFieldDecorator('itemName', {
|
|
9774
|
-
initialValue:
|
|
10185
|
+
initialValue: isMyShow ? record.itemNameSelf : record.itemName,
|
|
9775
10186
|
rules: [{
|
|
9776
|
-
|
|
9777
|
-
|
|
10187
|
+
validator: function () {
|
|
10188
|
+
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, __, callback) {
|
|
10189
|
+
var value;
|
|
10190
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10191
|
+
while (1) {
|
|
10192
|
+
switch (_context.prev = _context.next) {
|
|
10193
|
+
case 0:
|
|
10194
|
+
_context.next = 2;
|
|
10195
|
+
return controller.wait();
|
|
10196
|
+
|
|
10197
|
+
case 2:
|
|
10198
|
+
value = controller.state.goodsListState.editGood;
|
|
10199
|
+
|
|
10200
|
+
if (!(!(value === null || value === void 0 ? void 0 : value.itemName) && !(value === null || value === void 0 ? void 0 : value.itemNameSelf))) {
|
|
10201
|
+
_context.next = 7;
|
|
10202
|
+
break;
|
|
10203
|
+
}
|
|
10204
|
+
|
|
10205
|
+
callback('货物名称不能为空');
|
|
10206
|
+
_context.next = 8;
|
|
10207
|
+
break;
|
|
10208
|
+
|
|
10209
|
+
case 7:
|
|
10210
|
+
return _context.abrupt("return");
|
|
10211
|
+
|
|
10212
|
+
case 8:
|
|
10213
|
+
case "end":
|
|
10214
|
+
return _context.stop();
|
|
10215
|
+
}
|
|
10216
|
+
}
|
|
10217
|
+
}, _callee);
|
|
10218
|
+
}));
|
|
10219
|
+
|
|
10220
|
+
function validator(_x, _x2, _x3) {
|
|
10221
|
+
return _validator.apply(this, arguments);
|
|
10222
|
+
}
|
|
10223
|
+
|
|
10224
|
+
return validator;
|
|
10225
|
+
}()
|
|
9778
10226
|
}]
|
|
9779
10227
|
})(React__default['default'].createElement(MyInput, {
|
|
9780
10228
|
style: {
|
|
9781
10229
|
flex: 1
|
|
9782
10230
|
},
|
|
9783
10231
|
onChange: function onChange() {
|
|
9784
|
-
|
|
10232
|
+
onChangeItemName(controller, form, record);
|
|
9785
10233
|
}
|
|
9786
10234
|
})), React__default['default'].createElement("div", {
|
|
9787
10235
|
className: "kts-invoice-operate-goods-list-able-list-itemName-import"
|
|
@@ -9792,67 +10240,92 @@ var useColumns = (function (form) {
|
|
|
9792
10240
|
type: "link",
|
|
9793
10241
|
icon: "file-add"
|
|
9794
10242
|
}), controller.getGoodsList && React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
9795
|
-
onClick: function
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
10243
|
+
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
10244
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
10245
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10246
|
+
while (1) {
|
|
10247
|
+
switch (_context2.prev = _context2.next) {
|
|
10248
|
+
case 0:
|
|
10249
|
+
s.goodsListState.importGoods.isVisibleDrawer = true;
|
|
9803
10250
|
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
}
|
|
10251
|
+
case 1:
|
|
10252
|
+
case "end":
|
|
10253
|
+
return _context2.stop();
|
|
9808
10254
|
}
|
|
9809
|
-
}
|
|
9810
|
-
})
|
|
10255
|
+
}
|
|
10256
|
+
}, _callee2);
|
|
10257
|
+
}));
|
|
9811
10258
|
|
|
9812
|
-
|
|
9813
|
-
|
|
9814
|
-
|
|
9815
|
-
|
|
9816
|
-
},
|
|
10259
|
+
return function (_x4) {
|
|
10260
|
+
return _ref.apply(this, arguments);
|
|
10261
|
+
};
|
|
10262
|
+
}()),
|
|
9817
10263
|
type: "link",
|
|
9818
10264
|
icon: "plus-circle"
|
|
9819
10265
|
}))));
|
|
9820
10266
|
} else {
|
|
9821
|
-
return React__default['default'].createElement(
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
}
|
|
10267
|
+
return React__default['default'].createElement(MyItemNameDiv, {
|
|
10268
|
+
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
10269
|
+
valueF: formatSearch(record.itemName, searchValue),
|
|
10270
|
+
isMyShow: isMyShow
|
|
10271
|
+
}); // return (
|
|
10272
|
+
// <span style={{ padding: '0 10px' }}>{formatSearch(value, searchValue)}</span>
|
|
10273
|
+
// );
|
|
9826
10274
|
}
|
|
9827
10275
|
}
|
|
9828
10276
|
}, {
|
|
9829
10277
|
title: '货物规格型号',
|
|
9830
|
-
dataIndex: 'itemModelName',
|
|
9831
10278
|
key: 'itemModelName',
|
|
9832
10279
|
width: 119,
|
|
9833
|
-
render: function render(
|
|
10280
|
+
render: function render(_, record) {
|
|
9834
10281
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9835
10282
|
return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('itemModelName', {
|
|
9836
|
-
initialValue: editGood.itemModelName
|
|
10283
|
+
initialValue: isMyShow ? editGood.itemModelNameSelf : editGood.itemModelName
|
|
9837
10284
|
})(React__default['default'].createElement(MyInput, {
|
|
9838
|
-
onChange: function
|
|
9839
|
-
|
|
9840
|
-
|
|
10285
|
+
onChange: function () {
|
|
10286
|
+
var _onChange = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
10287
|
+
var key, value;
|
|
10288
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10289
|
+
while (1) {
|
|
10290
|
+
switch (_context3.prev = _context3.next) {
|
|
10291
|
+
case 0:
|
|
10292
|
+
_context3.next = 2;
|
|
10293
|
+
return controller.wait();
|
|
10294
|
+
|
|
10295
|
+
case 2:
|
|
10296
|
+
key = isMyShow ? 'itemModelNameSelf' : 'itemModelName';
|
|
10297
|
+
value = {};
|
|
10298
|
+
value[key] = form.getFieldsValue().itemModelName;
|
|
10299
|
+
controller.setEditGood(value);
|
|
10300
|
+
|
|
10301
|
+
case 6:
|
|
10302
|
+
case "end":
|
|
10303
|
+
return _context3.stop();
|
|
10304
|
+
}
|
|
10305
|
+
}
|
|
10306
|
+
}, _callee3);
|
|
10307
|
+
}));
|
|
10308
|
+
|
|
10309
|
+
function onChange() {
|
|
10310
|
+
return _onChange.apply(this, arguments);
|
|
10311
|
+
}
|
|
10312
|
+
|
|
10313
|
+
return onChange;
|
|
10314
|
+
}()
|
|
9841
10315
|
})));
|
|
9842
10316
|
} else {
|
|
9843
|
-
return React__default['default'].createElement(
|
|
9844
|
-
|
|
9845
|
-
|
|
9846
|
-
|
|
9847
|
-
}
|
|
10317
|
+
return React__default['default'].createElement(MyItemNameDiv, {
|
|
10318
|
+
valueT: formatSearch(record.itemModelNameSelf, searchValue),
|
|
10319
|
+
valueF: formatSearch(record.itemModelName, searchValue),
|
|
10320
|
+
isMyShow: isMyShow
|
|
10321
|
+
});
|
|
9848
10322
|
}
|
|
9849
10323
|
}
|
|
9850
10324
|
}, {
|
|
9851
10325
|
title: '单位',
|
|
9852
|
-
dataIndex: 'unit',
|
|
9853
10326
|
key: 'unit',
|
|
9854
10327
|
width: 70,
|
|
9855
|
-
render: function render(
|
|
10328
|
+
render: function render(_, record) {
|
|
9856
10329
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
9857
10330
|
return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, getFieldDecorator('unit', {
|
|
9858
10331
|
initialValue: editGood.unit
|
|
@@ -9861,16 +10334,39 @@ var useColumns = (function (form) {
|
|
|
9861
10334
|
width: '100%'
|
|
9862
10335
|
},
|
|
9863
10336
|
dataSource: unitList,
|
|
9864
|
-
onChange: function
|
|
9865
|
-
|
|
9866
|
-
|
|
10337
|
+
onChange: function () {
|
|
10338
|
+
var _onChange2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
10339
|
+
var key, value;
|
|
10340
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
10341
|
+
while (1) {
|
|
10342
|
+
switch (_context4.prev = _context4.next) {
|
|
10343
|
+
case 0:
|
|
10344
|
+
_context4.next = 2;
|
|
10345
|
+
return controller.wait();
|
|
10346
|
+
|
|
10347
|
+
case 2:
|
|
10348
|
+
key = isMyShow ? 'unit' : 'unitOther';
|
|
10349
|
+
value = {};
|
|
10350
|
+
value[key] = form.getFieldsValue().unit;
|
|
10351
|
+
controller.setEditGood(value);
|
|
10352
|
+
|
|
10353
|
+
case 6:
|
|
10354
|
+
case "end":
|
|
10355
|
+
return _context4.stop();
|
|
10356
|
+
}
|
|
10357
|
+
}
|
|
10358
|
+
}, _callee4);
|
|
10359
|
+
}));
|
|
10360
|
+
|
|
10361
|
+
function onChange() {
|
|
10362
|
+
return _onChange2.apply(this, arguments);
|
|
10363
|
+
}
|
|
10364
|
+
|
|
10365
|
+
return onChange;
|
|
10366
|
+
}()
|
|
9867
10367
|
})));
|
|
9868
10368
|
} else {
|
|
9869
|
-
return
|
|
9870
|
-
style: {
|
|
9871
|
-
padding: '0 10px'
|
|
9872
|
-
}
|
|
9873
|
-
}, value);
|
|
10369
|
+
return record.unit;
|
|
9874
10370
|
}
|
|
9875
10371
|
}
|
|
9876
10372
|
}, {
|
|
@@ -9888,13 +10384,13 @@ var useColumns = (function (form) {
|
|
|
9888
10384
|
message: '数量必须为数字'
|
|
9889
10385
|
}, {
|
|
9890
10386
|
validator: function () {
|
|
9891
|
-
var
|
|
10387
|
+
var _validator2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_, value, callback) {
|
|
9892
10388
|
var isvalue, isPrice;
|
|
9893
|
-
return _regeneratorRuntime().wrap(function
|
|
10389
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
9894
10390
|
while (1) {
|
|
9895
|
-
switch (
|
|
10391
|
+
switch (_context5.prev = _context5.next) {
|
|
9896
10392
|
case 0:
|
|
9897
|
-
|
|
10393
|
+
_context5.next = 2;
|
|
9898
10394
|
return controller.wait();
|
|
9899
10395
|
|
|
9900
10396
|
case 2:
|
|
@@ -9902,25 +10398,25 @@ var useColumns = (function (form) {
|
|
|
9902
10398
|
isPrice = !!getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') || getFieldValue(isTaxIncluded ? 'priceIncludeTax' : 'priceExcludeTax') === 0;
|
|
9903
10399
|
|
|
9904
10400
|
if (!(isvalue || isPrice === isvalue)) {
|
|
9905
|
-
|
|
10401
|
+
_context5.next = 6;
|
|
9906
10402
|
break;
|
|
9907
10403
|
}
|
|
9908
10404
|
|
|
9909
|
-
return
|
|
10405
|
+
return _context5.abrupt("return");
|
|
9910
10406
|
|
|
9911
10407
|
case 6:
|
|
9912
10408
|
callback('请输入数量');
|
|
9913
10409
|
|
|
9914
10410
|
case 7:
|
|
9915
10411
|
case "end":
|
|
9916
|
-
return
|
|
10412
|
+
return _context5.stop();
|
|
9917
10413
|
}
|
|
9918
10414
|
}
|
|
9919
|
-
},
|
|
10415
|
+
}, _callee5);
|
|
9920
10416
|
}));
|
|
9921
10417
|
|
|
9922
|
-
function validator(
|
|
9923
|
-
return
|
|
10418
|
+
function validator(_x5, _x6, _x7) {
|
|
10419
|
+
return _validator2.apply(this, arguments);
|
|
9924
10420
|
}
|
|
9925
10421
|
|
|
9926
10422
|
return validator;
|
|
@@ -9960,13 +10456,13 @@ var useColumns = (function (form) {
|
|
|
9960
10456
|
message: '单价必须为数字'
|
|
9961
10457
|
}, {
|
|
9962
10458
|
validator: function () {
|
|
9963
|
-
var
|
|
10459
|
+
var _validator3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_, value, callback) {
|
|
9964
10460
|
var isQuantity, isvalue;
|
|
9965
|
-
return _regeneratorRuntime().wrap(function
|
|
10461
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
9966
10462
|
while (1) {
|
|
9967
|
-
switch (
|
|
10463
|
+
switch (_context6.prev = _context6.next) {
|
|
9968
10464
|
case 0:
|
|
9969
|
-
|
|
10465
|
+
_context6.next = 2;
|
|
9970
10466
|
return controller.wait();
|
|
9971
10467
|
|
|
9972
10468
|
case 2:
|
|
@@ -9974,25 +10470,25 @@ var useColumns = (function (form) {
|
|
|
9974
10470
|
isvalue = !!value || value === 0;
|
|
9975
10471
|
|
|
9976
10472
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
9977
|
-
|
|
10473
|
+
_context6.next = 6;
|
|
9978
10474
|
break;
|
|
9979
10475
|
}
|
|
9980
10476
|
|
|
9981
|
-
return
|
|
10477
|
+
return _context6.abrupt("return");
|
|
9982
10478
|
|
|
9983
10479
|
case 6:
|
|
9984
10480
|
callback('请输入单价');
|
|
9985
10481
|
|
|
9986
10482
|
case 7:
|
|
9987
10483
|
case "end":
|
|
9988
|
-
return
|
|
10484
|
+
return _context6.stop();
|
|
9989
10485
|
}
|
|
9990
10486
|
}
|
|
9991
|
-
},
|
|
10487
|
+
}, _callee6);
|
|
9992
10488
|
}));
|
|
9993
10489
|
|
|
9994
|
-
function validator(
|
|
9995
|
-
return
|
|
10490
|
+
function validator(_x8, _x9, _x10) {
|
|
10491
|
+
return _validator3.apply(this, arguments);
|
|
9996
10492
|
}
|
|
9997
10493
|
|
|
9998
10494
|
return validator;
|
|
@@ -10032,13 +10528,13 @@ var useColumns = (function (form) {
|
|
|
10032
10528
|
message: '单价必须为数字'
|
|
10033
10529
|
}, {
|
|
10034
10530
|
validator: function () {
|
|
10035
|
-
var
|
|
10531
|
+
var _validator4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(_, value, callback) {
|
|
10036
10532
|
var isQuantity, isvalue;
|
|
10037
|
-
return _regeneratorRuntime().wrap(function
|
|
10533
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
10038
10534
|
while (1) {
|
|
10039
|
-
switch (
|
|
10535
|
+
switch (_context7.prev = _context7.next) {
|
|
10040
10536
|
case 0:
|
|
10041
|
-
|
|
10537
|
+
_context7.next = 2;
|
|
10042
10538
|
return controller.wait();
|
|
10043
10539
|
|
|
10044
10540
|
case 2:
|
|
@@ -10046,25 +10542,25 @@ var useColumns = (function (form) {
|
|
|
10046
10542
|
isvalue = !!value || value === 0;
|
|
10047
10543
|
|
|
10048
10544
|
if (!(isvalue || isQuantity === isvalue)) {
|
|
10049
|
-
|
|
10545
|
+
_context7.next = 6;
|
|
10050
10546
|
break;
|
|
10051
10547
|
}
|
|
10052
10548
|
|
|
10053
|
-
return
|
|
10549
|
+
return _context7.abrupt("return");
|
|
10054
10550
|
|
|
10055
10551
|
case 6:
|
|
10056
10552
|
callback('请输入单价');
|
|
10057
10553
|
|
|
10058
10554
|
case 7:
|
|
10059
10555
|
case "end":
|
|
10060
|
-
return
|
|
10556
|
+
return _context7.stop();
|
|
10061
10557
|
}
|
|
10062
10558
|
}
|
|
10063
|
-
},
|
|
10559
|
+
}, _callee7);
|
|
10064
10560
|
}));
|
|
10065
10561
|
|
|
10066
|
-
function validator(
|
|
10067
|
-
return
|
|
10562
|
+
function validator(_x11, _x12, _x13) {
|
|
10563
|
+
return _validator4.apply(this, arguments);
|
|
10068
10564
|
}
|
|
10069
10565
|
|
|
10070
10566
|
return validator;
|
|
@@ -10090,7 +10586,7 @@ var useColumns = (function (form) {
|
|
|
10090
10586
|
}
|
|
10091
10587
|
}
|
|
10092
10588
|
}, {
|
|
10093
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
10589
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$5, {
|
|
10094
10590
|
type: "danger"
|
|
10095
10591
|
}, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
|
|
10096
10592
|
dataIndex: 'lineAmountIncludeTax',
|
|
@@ -10109,10 +10605,10 @@ var useColumns = (function (form) {
|
|
|
10109
10605
|
message: '金额必须为数字'
|
|
10110
10606
|
}, {
|
|
10111
10607
|
validator: function () {
|
|
10112
|
-
var
|
|
10113
|
-
return _regeneratorRuntime().wrap(function
|
|
10608
|
+
var _validator5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(_, value, callback) {
|
|
10609
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
10114
10610
|
while (1) {
|
|
10115
|
-
switch (
|
|
10611
|
+
switch (_context8.prev = _context8.next) {
|
|
10116
10612
|
case 0:
|
|
10117
10613
|
if ("".concat(value).split('.')[0].length > 9) {
|
|
10118
10614
|
callback('金额整数部分不能大于9位,小数点后最多2位');
|
|
@@ -10120,24 +10616,24 @@ var useColumns = (function (form) {
|
|
|
10120
10616
|
|
|
10121
10617
|
case 1:
|
|
10122
10618
|
case "end":
|
|
10123
|
-
return
|
|
10619
|
+
return _context8.stop();
|
|
10124
10620
|
}
|
|
10125
10621
|
}
|
|
10126
|
-
},
|
|
10622
|
+
}, _callee8);
|
|
10127
10623
|
}));
|
|
10128
10624
|
|
|
10129
|
-
function validator(
|
|
10130
|
-
return
|
|
10625
|
+
function validator(_x14, _x15, _x16) {
|
|
10626
|
+
return _validator5.apply(this, arguments);
|
|
10131
10627
|
}
|
|
10132
10628
|
|
|
10133
10629
|
return validator;
|
|
10134
10630
|
}()
|
|
10135
10631
|
}, {
|
|
10136
10632
|
validator: function () {
|
|
10137
|
-
var
|
|
10138
|
-
return _regeneratorRuntime().wrap(function
|
|
10633
|
+
var _validator6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_, value, callback) {
|
|
10634
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
10139
10635
|
while (1) {
|
|
10140
|
-
switch (
|
|
10636
|
+
switch (_context9.prev = _context9.next) {
|
|
10141
10637
|
case 0:
|
|
10142
10638
|
if (deduction && parseFloat(value) <= deduction) {
|
|
10143
10639
|
callback('扣除额不能大于等于价税合计');
|
|
@@ -10145,14 +10641,14 @@ var useColumns = (function (form) {
|
|
|
10145
10641
|
|
|
10146
10642
|
case 1:
|
|
10147
10643
|
case "end":
|
|
10148
|
-
return
|
|
10644
|
+
return _context9.stop();
|
|
10149
10645
|
}
|
|
10150
10646
|
}
|
|
10151
|
-
},
|
|
10647
|
+
}, _callee9);
|
|
10152
10648
|
}));
|
|
10153
10649
|
|
|
10154
|
-
function validator(
|
|
10155
|
-
return
|
|
10650
|
+
function validator(_x17, _x18, _x19) {
|
|
10651
|
+
return _validator6.apply(this, arguments);
|
|
10156
10652
|
}
|
|
10157
10653
|
|
|
10158
10654
|
return validator;
|
|
@@ -10177,7 +10673,7 @@ var useColumns = (function (form) {
|
|
|
10177
10673
|
}
|
|
10178
10674
|
}
|
|
10179
10675
|
}, {
|
|
10180
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
10676
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$5, {
|
|
10181
10677
|
type: "danger"
|
|
10182
10678
|
}, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
10183
10679
|
dataIndex: 'lineAmountExcludeTax',
|
|
@@ -10196,10 +10692,10 @@ var useColumns = (function (form) {
|
|
|
10196
10692
|
message: '金额必须为数字'
|
|
10197
10693
|
}, {
|
|
10198
10694
|
validator: function () {
|
|
10199
|
-
var
|
|
10200
|
-
return _regeneratorRuntime().wrap(function
|
|
10695
|
+
var _validator7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_, value, callback) {
|
|
10696
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
10201
10697
|
while (1) {
|
|
10202
|
-
switch (
|
|
10698
|
+
switch (_context10.prev = _context10.next) {
|
|
10203
10699
|
case 0:
|
|
10204
10700
|
if ("".concat(value).split('.')[0].length > 9) {
|
|
10205
10701
|
callback('金额整数部分不能大于9位,小数点后最多2位');
|
|
@@ -10207,14 +10703,14 @@ var useColumns = (function (form) {
|
|
|
10207
10703
|
|
|
10208
10704
|
case 1:
|
|
10209
10705
|
case "end":
|
|
10210
|
-
return
|
|
10706
|
+
return _context10.stop();
|
|
10211
10707
|
}
|
|
10212
10708
|
}
|
|
10213
|
-
},
|
|
10709
|
+
}, _callee10);
|
|
10214
10710
|
}));
|
|
10215
10711
|
|
|
10216
|
-
function validator(
|
|
10217
|
-
return
|
|
10712
|
+
function validator(_x20, _x21, _x22) {
|
|
10713
|
+
return _validator7.apply(this, arguments);
|
|
10218
10714
|
}
|
|
10219
10715
|
|
|
10220
10716
|
return validator;
|
|
@@ -10239,7 +10735,7 @@ var useColumns = (function (form) {
|
|
|
10239
10735
|
}
|
|
10240
10736
|
}
|
|
10241
10737
|
}, {
|
|
10242
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
10738
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$5, {
|
|
10243
10739
|
type: "danger"
|
|
10244
10740
|
}, "*"), "\u7A0E\u7387"),
|
|
10245
10741
|
dataIndex: 'taxRate',
|
|
@@ -10267,6 +10763,7 @@ var useColumns = (function (form) {
|
|
|
10267
10763
|
width: '100%'
|
|
10268
10764
|
},
|
|
10269
10765
|
onChange: function onChange() {
|
|
10766
|
+
setChangeField('taxRate');
|
|
10270
10767
|
onChangeTaxRate(controller, form, record);
|
|
10271
10768
|
}
|
|
10272
10769
|
}, taxRateList.map(function (e, i) {
|
|
@@ -10293,7 +10790,9 @@ var useColumns = (function (form) {
|
|
|
10293
10790
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
10294
10791
|
return getFieldDecorator('taxAmount', {
|
|
10295
10792
|
initialValue: editGood.taxAmount
|
|
10296
|
-
})(React__default['default'].createElement(MyDiv,
|
|
10793
|
+
})(React__default['default'].createElement(MyDiv, {
|
|
10794
|
+
loading: isCipher(changeField, 'taxAmount')
|
|
10795
|
+
}));
|
|
10297
10796
|
} else {
|
|
10298
10797
|
return React__default['default'].createElement("span", {
|
|
10299
10798
|
style: {
|
|
@@ -10325,7 +10824,7 @@ var useColumns = (function (form) {
|
|
|
10325
10824
|
ellipsis: true
|
|
10326
10825
|
});
|
|
10327
10826
|
});
|
|
10328
|
-
}, [isTaxIncluded, editGood, controller, changeField, deduction, searchValue]);
|
|
10827
|
+
}, [isTaxIncluded, editGood, controller, changeField, deduction, isMyShow, searchValue]);
|
|
10329
10828
|
React__default['default'].useEffect(function () {
|
|
10330
10829
|
if (!changeField) return;
|
|
10331
10830
|
var t = setTimeout(function () {
|
|
@@ -10389,16 +10888,82 @@ var MyDiv = /*#__PURE__*/function (_React$Component2) {
|
|
|
10389
10888
|
_createClass(MyDiv, [{
|
|
10390
10889
|
key: "render",
|
|
10391
10890
|
value: function render() {
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
}
|
|
10396
|
-
|
|
10891
|
+
if (this.props.loading) {
|
|
10892
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Spin, {
|
|
10893
|
+
size: "small"
|
|
10894
|
+
}, React__default['default'].createElement("span", {
|
|
10895
|
+
style: {
|
|
10896
|
+
padding: '0 10px'
|
|
10897
|
+
}
|
|
10898
|
+
}, this.props.value));
|
|
10899
|
+
} else {
|
|
10900
|
+
return React__default['default'].createElement("span", {
|
|
10901
|
+
style: {
|
|
10902
|
+
padding: '0 10px'
|
|
10903
|
+
}
|
|
10904
|
+
}, this.props.value);
|
|
10905
|
+
}
|
|
10397
10906
|
}
|
|
10398
10907
|
}]);
|
|
10399
10908
|
|
|
10400
10909
|
return MyDiv;
|
|
10401
10910
|
}(React__default['default'].Component);
|
|
10911
|
+
|
|
10912
|
+
var MyItemNameDiv = /*#__PURE__*/function (_React$Component3) {
|
|
10913
|
+
_inherits(MyItemNameDiv, _React$Component3);
|
|
10914
|
+
|
|
10915
|
+
var _super3 = _createSuper(MyItemNameDiv);
|
|
10916
|
+
|
|
10917
|
+
function MyItemNameDiv() {
|
|
10918
|
+
_classCallCheck(this, MyItemNameDiv);
|
|
10919
|
+
|
|
10920
|
+
return _super3.apply(this, arguments);
|
|
10921
|
+
}
|
|
10922
|
+
|
|
10923
|
+
_createClass(MyItemNameDiv, [{
|
|
10924
|
+
key: "render",
|
|
10925
|
+
value: function render() {
|
|
10926
|
+
var _this$props = this.props,
|
|
10927
|
+
isMyShow = _this$props.isMyShow,
|
|
10928
|
+
valueT = _this$props.valueT,
|
|
10929
|
+
valueF = _this$props.valueF;
|
|
10930
|
+
|
|
10931
|
+
if (isMyShow) {
|
|
10932
|
+
if (valueT) {
|
|
10933
|
+
return React__default['default'].createElement("span", {
|
|
10934
|
+
style: {
|
|
10935
|
+
padding: '0 10px',
|
|
10936
|
+
color: '#0074ff'
|
|
10937
|
+
}
|
|
10938
|
+
}, valueT);
|
|
10939
|
+
} else {
|
|
10940
|
+
return React__default['default'].createElement("span", {
|
|
10941
|
+
style: {
|
|
10942
|
+
padding: '0 10px'
|
|
10943
|
+
}
|
|
10944
|
+
}, valueF);
|
|
10945
|
+
}
|
|
10946
|
+
} else {
|
|
10947
|
+
if (valueF) {
|
|
10948
|
+
return React__default['default'].createElement("span", {
|
|
10949
|
+
style: {
|
|
10950
|
+
padding: '0 10px'
|
|
10951
|
+
}
|
|
10952
|
+
}, valueF);
|
|
10953
|
+
} else {
|
|
10954
|
+
return React__default['default'].createElement("span", {
|
|
10955
|
+
style: {
|
|
10956
|
+
padding: '0 10px',
|
|
10957
|
+
color: '#0074ff'
|
|
10958
|
+
}
|
|
10959
|
+
}, valueT);
|
|
10960
|
+
}
|
|
10961
|
+
}
|
|
10962
|
+
}
|
|
10963
|
+
}]);
|
|
10964
|
+
|
|
10965
|
+
return MyItemNameDiv;
|
|
10966
|
+
}(React__default['default'].Component);
|
|
10402
10967
|
/** 格式搜索结果 */
|
|
10403
10968
|
|
|
10404
10969
|
|
|
@@ -10434,7 +10999,7 @@ function dcoding(v) {
|
|
|
10434
10999
|
|
|
10435
11000
|
var useOnRow = (function () {
|
|
10436
11001
|
/** 控制器 */
|
|
10437
|
-
var controller =
|
|
11002
|
+
var controller = Invoice.useInvoiceController();
|
|
10438
11003
|
var model = controller.useMemo(function (s) {
|
|
10439
11004
|
return s.model;
|
|
10440
11005
|
}, []);
|
|
@@ -10617,7 +11182,7 @@ function useWindowClick(controller) {
|
|
|
10617
11182
|
|
|
10618
11183
|
var useRowSelection = (function () {
|
|
10619
11184
|
/** 控制器 */
|
|
10620
|
-
var controller =
|
|
11185
|
+
var controller = Invoice.useInvoiceController();
|
|
10621
11186
|
/** 列表选中的货物索引列表 */
|
|
10622
11187
|
|
|
10623
11188
|
var selectedRowKeys = controller.useMemo(function (s) {
|
|
@@ -10904,7 +11469,7 @@ var useRowSelection = (function () {
|
|
|
10904
11469
|
};
|
|
10905
11470
|
});
|
|
10906
11471
|
|
|
10907
|
-
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
|
|
11472
|
+
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";
|
|
10908
11473
|
styleInject(css_248z$7);
|
|
10909
11474
|
|
|
10910
11475
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
@@ -10929,7 +11494,7 @@ var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
|
10929
11494
|
}(React__default['default'].Component);
|
|
10930
11495
|
var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
10931
11496
|
/** 控制器 */
|
|
10932
|
-
var controller =
|
|
11497
|
+
var controller = Invoice.useInvoiceController();
|
|
10933
11498
|
var goodsList = controller.useMemo(function (s) {
|
|
10934
11499
|
return s.goodsListState.goodsList;
|
|
10935
11500
|
}, []);
|
|
@@ -11003,7 +11568,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11003
11568
|
}, [controller, props.form]); // 跟新 货物
|
|
11004
11569
|
|
|
11005
11570
|
React__default['default'].useEffect(function () {
|
|
11006
|
-
controller.
|
|
11571
|
+
controller.run( /*#__PURE__*/function () {
|
|
11007
11572
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(s) {
|
|
11008
11573
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11009
11574
|
while (1) {
|
|
@@ -11025,7 +11590,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11025
11590
|
return function (_x4) {
|
|
11026
11591
|
return _ref3.apply(this, arguments);
|
|
11027
11592
|
};
|
|
11028
|
-
}())
|
|
11593
|
+
}());
|
|
11029
11594
|
}, [controller, goodsList]);
|
|
11030
11595
|
/** props 产品最大数 更新 */
|
|
11031
11596
|
|
|
@@ -11108,9 +11673,9 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11108
11673
|
className: "kts-invoice-operate-goods-list-able"
|
|
11109
11674
|
}, React__default['default'].createElement("div", {
|
|
11110
11675
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
11111
|
-
}, React__default['default'].createElement(AddRowButton, null), React__default['default'].createElement(
|
|
11676
|
+
}, React__default['default'].createElement(AddRowButton, null), React__default['default'].createElement(BulkMenu, null), React__default['default'].createElement(Search, null)), React__default['default'].createElement("div", {
|
|
11112
11677
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
11113
|
-
}, props.menuExpansion, React__default['default'].createElement(TaxIncludedSwitch, null))), React__default['default'].createElement("div", {
|
|
11678
|
+
}, props.menuExpansion, React__default['default'].createElement(DescribeSwitch, null), React__default['default'].createElement(TaxIncludedSwitch, null))), React__default['default'].createElement("div", {
|
|
11114
11679
|
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
11115
11680
|
'kts-invoice-operate-prefab': isprefab
|
|
11116
11681
|
})
|
|
@@ -11175,7 +11740,7 @@ var Main$1 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
11175
11740
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11176
11741
|
/** 控制器 */
|
|
11177
11742
|
|
|
11178
|
-
var controller =
|
|
11743
|
+
var controller = Invoice.useInvoiceController();
|
|
11179
11744
|
/** 控制器 */
|
|
11180
11745
|
|
|
11181
11746
|
var model = controller.useMemo(function (s) {
|
|
@@ -11293,7 +11858,7 @@ var Sign = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11293
11858
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11294
11859
|
/** 控制器 */
|
|
11295
11860
|
|
|
11296
|
-
var controller =
|
|
11861
|
+
var controller = Invoice.useInvoiceController();
|
|
11297
11862
|
var model = controller.useMemo(function (s) {
|
|
11298
11863
|
return s.model;
|
|
11299
11864
|
}, []); // 注册 form
|
|
@@ -11335,7 +11900,7 @@ var formItemLayout = {
|
|
|
11335
11900
|
};
|
|
11336
11901
|
|
|
11337
11902
|
var ImportBuyerButton = (function () {
|
|
11338
|
-
var controller =
|
|
11903
|
+
var controller = Invoice.useInvoiceController();
|
|
11339
11904
|
var onClick = React__default['default'].useCallback(function () {
|
|
11340
11905
|
controller.pipeline( /*#__PURE__*/function () {
|
|
11341
11906
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
@@ -11367,7 +11932,7 @@ var ImportBuyerButton = (function () {
|
|
|
11367
11932
|
|
|
11368
11933
|
var BuyerNameInput = (function (props) {
|
|
11369
11934
|
/** 控制器 */
|
|
11370
|
-
var controller =
|
|
11935
|
+
var controller = Invoice.useInvoiceController();
|
|
11371
11936
|
/** 组件模式 */
|
|
11372
11937
|
|
|
11373
11938
|
var model = controller.useMemo(function (s) {
|
|
@@ -11527,7 +12092,7 @@ var BuyerNameInput = (function (props) {
|
|
|
11527
12092
|
|
|
11528
12093
|
function useDataSource() {
|
|
11529
12094
|
/** 控制器 */
|
|
11530
|
-
var controller =
|
|
12095
|
+
var controller = Invoice.useInvoiceController();
|
|
11531
12096
|
|
|
11532
12097
|
var _React$useState3 = React__default['default'].useState(false),
|
|
11533
12098
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
@@ -11611,7 +12176,7 @@ function interval(i, t) {
|
|
|
11611
12176
|
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";
|
|
11612
12177
|
styleInject(css_248z$a);
|
|
11613
12178
|
|
|
11614
|
-
var Text$
|
|
12179
|
+
var Text$6 = ktsComponentsAntdX3.Typography.Text;
|
|
11615
12180
|
|
|
11616
12181
|
var Buyer$1 = /*#__PURE__*/function (_React$Component) {
|
|
11617
12182
|
_inherits(Buyer, _React$Component);
|
|
@@ -11643,7 +12208,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
11643
12208
|
var getFieldDecorator = form.getFieldDecorator;
|
|
11644
12209
|
/** 控制器 */
|
|
11645
12210
|
|
|
11646
|
-
var controller =
|
|
12211
|
+
var controller = Invoice.useInvoiceController();
|
|
11647
12212
|
/** 组件模式 */
|
|
11648
12213
|
|
|
11649
12214
|
var model = controller.useMemo(function (s) {
|
|
@@ -11725,7 +12290,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
11725
12290
|
if (e.options.rules.some(function (e) {
|
|
11726
12291
|
return e.required;
|
|
11727
12292
|
})) {
|
|
11728
|
-
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
12293
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$6, {
|
|
11729
12294
|
type: "danger"
|
|
11730
12295
|
}, "*"), e.label);
|
|
11731
12296
|
} else {
|
|
@@ -11761,7 +12326,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
11761
12326
|
});
|
|
11762
12327
|
|
|
11763
12328
|
var ImportBuyerDrawer = (function () {
|
|
11764
|
-
var controller =
|
|
12329
|
+
var controller = Invoice.useInvoiceController();
|
|
11765
12330
|
var visible = controller.useMemo(function (s) {
|
|
11766
12331
|
return s.buyerState.isVisibleDrawer;
|
|
11767
12332
|
}, []);
|
|
@@ -11803,7 +12368,7 @@ var ImportBuyerDrawer = (function () {
|
|
|
11803
12368
|
});
|
|
11804
12369
|
|
|
11805
12370
|
var DrawerBody$1 = function DrawerBody() {
|
|
11806
|
-
var controller =
|
|
12371
|
+
var controller = Invoice.useInvoiceController();
|
|
11807
12372
|
var columns = controller.useMemo(function (e) {
|
|
11808
12373
|
return e.buyerState.columns;
|
|
11809
12374
|
}, []);
|
|
@@ -11891,7 +12456,7 @@ var DrawerBody$1 = function DrawerBody() {
|
|
|
11891
12456
|
};
|
|
11892
12457
|
|
|
11893
12458
|
var ImportGoodsDrawer = (function () {
|
|
11894
|
-
var controller =
|
|
12459
|
+
var controller = Invoice.useInvoiceController();
|
|
11895
12460
|
var visible = controller.useMemo(function (s) {
|
|
11896
12461
|
return s.goodsListState.importGoods.isVisibleDrawer;
|
|
11897
12462
|
}, []);
|
|
@@ -11937,7 +12502,7 @@ var ImportGoodsDrawer = (function () {
|
|
|
11937
12502
|
});
|
|
11938
12503
|
|
|
11939
12504
|
var DrawerBody$2 = function DrawerBody() {
|
|
11940
|
-
var controller =
|
|
12505
|
+
var controller = Invoice.useInvoiceController();
|
|
11941
12506
|
var columns = controller.useMemo(function (s) {
|
|
11942
12507
|
return s.goodsListState.importGoods.columns;
|
|
11943
12508
|
}, []);
|
|
@@ -11971,6 +12536,7 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11971
12536
|
onClick: function onClick() {
|
|
11972
12537
|
controller.run( /*#__PURE__*/function () {
|
|
11973
12538
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
12539
|
+
var between, editGood;
|
|
11974
12540
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11975
12541
|
while (1) {
|
|
11976
12542
|
switch (_context2.prev = _context2.next) {
|
|
@@ -11979,7 +12545,8 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
11979
12545
|
return !record[e] && record[e] !== 0;
|
|
11980
12546
|
}).forEach(function (e) {
|
|
11981
12547
|
delete record[e];
|
|
11982
|
-
});
|
|
12548
|
+
}); // 导入时校验函数
|
|
12549
|
+
|
|
11983
12550
|
_context2.next = 3;
|
|
11984
12551
|
return s.goodsListState.importGoods.verifyFn(record);
|
|
11985
12552
|
|
|
@@ -12007,30 +12574,40 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
12007
12574
|
record.priceIncludeTax = s.goodsListState.editGood.priceIncludeTax;
|
|
12008
12575
|
record.lineAmountExcludeTax = s.goodsListState.editGood.lineAmountExcludeTax;
|
|
12009
12576
|
record.lineAmountIncludeTax = s.goodsListState.editGood.lineAmountIncludeTax;
|
|
12010
|
-
}
|
|
12577
|
+
} // 中间数据
|
|
12011
12578
|
|
|
12012
|
-
s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), record);
|
|
12013
12579
|
|
|
12014
|
-
|
|
12015
|
-
|
|
12016
|
-
|
|
12580
|
+
between = _objectSpread2({}, record);
|
|
12581
|
+
between.itemName = getItemName$1(record, s.goodsListState.editGood);
|
|
12582
|
+
between.itemNameOther = getItemNameOther(record, s.goodsListState.editGood); // 设置编辑货物
|
|
12583
|
+
|
|
12584
|
+
editGood = s.goodsListState.editGood = _objectSpread2(_objectSpread2({}, s.goodsListState.editGood), between);
|
|
12585
|
+
|
|
12586
|
+
if (editGood.taxRate) {
|
|
12587
|
+
editGood.taxRate = dutyFree(controller, editGood.taxRate, s.goodsListState.form, editGood);
|
|
12017
12588
|
}
|
|
12018
12589
|
|
|
12019
|
-
|
|
12590
|
+
if ("".concat(editGood.priceIncludeTax) === '0') {
|
|
12591
|
+
editGood.priceIncludeTax = undefined;
|
|
12592
|
+
editGood.priceExcludeTax = undefined;
|
|
12593
|
+
} else {
|
|
12594
|
+
editGood.priceExcludeTax = getPriceExcludeTax(editGood, record);
|
|
12595
|
+
}
|
|
12596
|
+
|
|
12597
|
+
if (editGood.quantity && editGood.priceIncludeTax) {
|
|
12598
|
+
editGood.lineAmountIncludeTax = countAmountIncludeTax(editGood.quantity, editGood.priceIncludeTax);
|
|
12599
|
+
} // 导入FORM里
|
|
12020
12600
|
|
|
12021
|
-
case 12:
|
|
12022
|
-
if (s.goodsListState.editGood.taxRate) s.goodsListState.editGood.taxRate = dutyFree(controller, s.goodsListState.editGood.taxRate, s.goodsListState.form, s.goodsListState.editGood);
|
|
12023
12601
|
|
|
12024
|
-
if (
|
|
12025
|
-
s.goodsListState.
|
|
12026
|
-
|
|
12602
|
+
if (s.goodsListState.isMyShow) {
|
|
12603
|
+
s.goodsListState.form.setFieldsValue(_objectSpread2(_objectSpread2({}, editGood), {}, {
|
|
12604
|
+
itemName: editGood.itemNameSelf,
|
|
12605
|
+
itemModelName: editGood.itemModelNameSelf
|
|
12606
|
+
}));
|
|
12027
12607
|
} else {
|
|
12028
|
-
s.goodsListState.
|
|
12608
|
+
s.goodsListState.form.setFieldsValue(_objectSpread2({}, editGood));
|
|
12029
12609
|
}
|
|
12030
12610
|
|
|
12031
|
-
if (s.goodsListState.editGood.quantity && s.goodsListState.editGood.priceIncludeTax) s.goodsListState.editGood.lineAmountIncludeTax = countAmountIncludeTax(s.goodsListState.editGood.quantity, s.goodsListState.editGood.priceIncludeTax);
|
|
12032
|
-
s.goodsListState.editGood.itemName = getItemName(record);
|
|
12033
|
-
s.goodsListState.form.setFieldsValue(s.goodsListState.editGood);
|
|
12034
12611
|
s.goodsListState.importGoods.isVisibleDrawer = false;
|
|
12035
12612
|
s.goodsListState.isTaxIncluded ? updateUnitPriceExcludingTax(controller, s.goodsListState.form) : updateUnitPriceTax(controller, s.goodsListState.form);
|
|
12036
12613
|
|
|
@@ -12052,11 +12629,12 @@ var DrawerBody$2 = function DrawerBody() {
|
|
|
12052
12629
|
});
|
|
12053
12630
|
};
|
|
12054
12631
|
/** 货物名称 */
|
|
12632
|
+
// const getItemName = (record: any) => {
|
|
12633
|
+
// return record.shorthand
|
|
12634
|
+
// ? `*${record.shorthand}*${record.itemName}`
|
|
12635
|
+
// : record.itemName;
|
|
12636
|
+
// };
|
|
12055
12637
|
|
|
12056
|
-
|
|
12057
|
-
var getItemName = function getItemName(record) {
|
|
12058
|
-
return record.shorthand ? "*".concat(record.shorthand, "*").concat(record.itemName) : record.itemName;
|
|
12059
|
-
};
|
|
12060
12638
|
/** 货物单价,不含税 */
|
|
12061
12639
|
|
|
12062
12640
|
|
|
@@ -12064,6 +12642,39 @@ var getPriceExcludeTax = function getPriceExcludeTax(s, record) {
|
|
|
12064
12642
|
if (!s.taxRate && s.taxRate !== 0 || !record.priceIncludeTax && record.priceIncludeTax !== 0) return; // 单价(含税)/(1+税率) = 单价(不含税)
|
|
12065
12643
|
|
|
12066
12644
|
return format15(evaluate("".concat(record.priceIncludeTax, " / (1+").concat(s.taxRate, "/100)")));
|
|
12645
|
+
}; // 获取我方名称
|
|
12646
|
+
|
|
12647
|
+
|
|
12648
|
+
var getItemName$1 = function getItemName(record, editGood) {
|
|
12649
|
+
var _getSN;
|
|
12650
|
+
|
|
12651
|
+
var shorthand;
|
|
12652
|
+
shorthand = record.shorthand;
|
|
12653
|
+
|
|
12654
|
+
if (shorthand) {
|
|
12655
|
+
return "*".concat(shorthand, "*").concat(record.itemName);
|
|
12656
|
+
}
|
|
12657
|
+
|
|
12658
|
+
shorthand = (_getSN = getSN(editGood.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.shorthand;
|
|
12659
|
+
|
|
12660
|
+
if (shorthand) {
|
|
12661
|
+
return "*".concat(shorthand, "*").concat(record.itemNameSelf);
|
|
12662
|
+
}
|
|
12663
|
+
|
|
12664
|
+
return record.itemName;
|
|
12665
|
+
}; // 获取他方名称
|
|
12666
|
+
|
|
12667
|
+
|
|
12668
|
+
var getItemNameOther = function getItemNameOther(record, editGood) {
|
|
12669
|
+
if (!editGood.itemName) return editGood.itemName;
|
|
12670
|
+
var shorthand;
|
|
12671
|
+
shorthand = record.shorthand;
|
|
12672
|
+
|
|
12673
|
+
if (shorthand) {
|
|
12674
|
+
return "*".concat(shorthand, "*").concat(record.itemNameSelf);
|
|
12675
|
+
}
|
|
12676
|
+
|
|
12677
|
+
return record.itemName;
|
|
12067
12678
|
};
|
|
12068
12679
|
|
|
12069
12680
|
/**
|
|
@@ -12123,7 +12734,7 @@ styleInject(css_248z$b);
|
|
|
12123
12734
|
var TreeNode = ktsComponentsAntdX3.Tree.TreeNode;
|
|
12124
12735
|
var confirm = ktsComponentsAntdX3.Modal.confirm;
|
|
12125
12736
|
var EndowCodeDrawer = (function () {
|
|
12126
|
-
var controller =
|
|
12737
|
+
var controller = Invoice.useInvoiceController();
|
|
12127
12738
|
var visible = controller.useMemo(function (s) {
|
|
12128
12739
|
return s.goodsListState.endowCode.endowcodeGoodIndex.length > 0;
|
|
12129
12740
|
}, []);
|
|
@@ -12238,7 +12849,7 @@ var EndowCodeDrawer = (function () {
|
|
|
12238
12849
|
var DrawerBody$3 = function DrawerBody(props) {
|
|
12239
12850
|
var _defaultValue$taxRate, _defaultValue$favoure;
|
|
12240
12851
|
|
|
12241
|
-
var controller =
|
|
12852
|
+
var controller = Invoice.useInvoiceController();
|
|
12242
12853
|
var defaultValue = props.defaultValue;
|
|
12243
12854
|
var actions = React__default['default'].useMemo(function () {
|
|
12244
12855
|
return antd.createAsyncFormActions();
|
|
@@ -12623,9 +13234,10 @@ var DrawerBody$3 = function DrawerBody(props) {
|
|
|
12623
13234
|
}); // 赋码
|
|
12624
13235
|
|
|
12625
13236
|
endowCodeGood.forEach(function (good) {
|
|
12626
|
-
if (!good) return;
|
|
12627
|
-
|
|
12628
|
-
good.
|
|
13237
|
+
if (!good) return;
|
|
13238
|
+
good.itemName = setShorthand(good.itemName, values.shorthand);
|
|
13239
|
+
good.itemNameSelf = setShorthand(good.itemNameSelf, values.shorthand); // const name = getItemName(good.itemName, values.shorthand);
|
|
13240
|
+
// good.itemName = getItemName(good.itemName, values.shorthand); // `*${values.shorthand}*${name}`;
|
|
12629
13241
|
|
|
12630
13242
|
good.taxClassificationCode = values.taxClassificationCode;
|
|
12631
13243
|
good.taxRate = values.taxRate;
|
|
@@ -12873,41 +13485,199 @@ var getShorthand = function getShorthand(value) {
|
|
|
12873
13485
|
return undefined;
|
|
12874
13486
|
}
|
|
12875
13487
|
};
|
|
12876
|
-
/** 简称填入名称 */
|
|
12877
13488
|
|
|
13489
|
+
function AddComparisonDrawer() {
|
|
13490
|
+
var _Form$useForm = ktsXui.Form.useForm(),
|
|
13491
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
13492
|
+
form = _Form$useForm2[0];
|
|
13493
|
+
/** 控制器 */
|
|
12878
13494
|
|
|
12879
|
-
var getItemName$1 = function getItemName(value, shorthand) {
|
|
12880
|
-
if (!value) value = '';
|
|
12881
13495
|
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
}
|
|
13496
|
+
var controller = Invoice.useInvoiceController();
|
|
13497
|
+
/** 正在 添加商品对照 的货物索引 */
|
|
12885
13498
|
|
|
12886
|
-
var
|
|
13499
|
+
var addComparisonIndex = controller.useMemo(function (s) {
|
|
13500
|
+
return s.goodsListState.addComparisonIndex;
|
|
13501
|
+
}, []);
|
|
13502
|
+
/** 货物字典 */
|
|
12887
13503
|
|
|
12888
|
-
|
|
12889
|
-
return
|
|
12890
|
-
}
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
13504
|
+
var goodsMap = controller.useMemo(function (s) {
|
|
13505
|
+
return s.goodsListState.goodsMap;
|
|
13506
|
+
}, []);
|
|
13507
|
+
/** 正在 对照 的货物 */
|
|
13508
|
+
|
|
13509
|
+
var good = React__default['default'].useMemo(function () {
|
|
13510
|
+
return addComparisonIndex ? goodsMap.get(addComparisonIndex) : undefined;
|
|
13511
|
+
}, [addComparisonIndex]);
|
|
13512
|
+
/** 关闭对照 */
|
|
13513
|
+
|
|
13514
|
+
var onClose = React__default['default'].useCallback(controller.pipeline( /*#__PURE__*/function () {
|
|
13515
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
13516
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13517
|
+
while (1) {
|
|
13518
|
+
switch (_context.prev = _context.next) {
|
|
13519
|
+
case 0:
|
|
13520
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
13521
|
+
|
|
13522
|
+
case 1:
|
|
13523
|
+
case "end":
|
|
13524
|
+
return _context.stop();
|
|
13525
|
+
}
|
|
13526
|
+
}
|
|
13527
|
+
}, _callee);
|
|
13528
|
+
}));
|
|
13529
|
+
|
|
13530
|
+
return function (_x) {
|
|
13531
|
+
return _ref.apply(this, arguments);
|
|
13532
|
+
};
|
|
13533
|
+
}()), [controller]);
|
|
13534
|
+
/** 提交数据 */
|
|
13535
|
+
|
|
13536
|
+
var onSubmit = React__default['default'].useCallback(function () {
|
|
13537
|
+
controller.run( /*#__PURE__*/function () {
|
|
13538
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
13539
|
+
var _getSN, _getSN2, values, shorthand;
|
|
13540
|
+
|
|
13541
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
13542
|
+
while (1) {
|
|
13543
|
+
switch (_context2.prev = _context2.next) {
|
|
13544
|
+
case 0:
|
|
13545
|
+
if (good) {
|
|
13546
|
+
_context2.next = 2;
|
|
13547
|
+
break;
|
|
13548
|
+
}
|
|
13549
|
+
|
|
13550
|
+
return _context2.abrupt("return");
|
|
13551
|
+
|
|
13552
|
+
case 2:
|
|
13553
|
+
_context2.prev = 2;
|
|
13554
|
+
_context2.next = 5;
|
|
13555
|
+
return form.validateFields();
|
|
13556
|
+
|
|
13557
|
+
case 5:
|
|
13558
|
+
values = _context2.sent;
|
|
13559
|
+
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;
|
|
13560
|
+
good.itemCode = values.itemCode;
|
|
13561
|
+
good.itemCodeSelf = values.itemCodeSelf;
|
|
13562
|
+
good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
|
|
13563
|
+
good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
|
|
13564
|
+
good.itemModelName = values.itemModelName;
|
|
13565
|
+
good.itemModelNameSelf = values.itemModelNameSelf;
|
|
13566
|
+
s.goodsListState.addComparisonIndex = undefined;
|
|
13567
|
+
s.goodsListState.goodsList = _toConsumableArray(s.goodsListState.goodsList);
|
|
13568
|
+
_context2.next = 19;
|
|
13569
|
+
break;
|
|
13570
|
+
|
|
13571
|
+
case 17:
|
|
13572
|
+
_context2.prev = 17;
|
|
13573
|
+
_context2.t0 = _context2["catch"](2);
|
|
13574
|
+
|
|
13575
|
+
case 19:
|
|
13576
|
+
case "end":
|
|
13577
|
+
return _context2.stop();
|
|
13578
|
+
}
|
|
13579
|
+
}
|
|
13580
|
+
}, _callee2, null, [[2, 17]]);
|
|
13581
|
+
}));
|
|
13582
|
+
|
|
13583
|
+
return function (_x2) {
|
|
13584
|
+
return _ref2.apply(this, arguments);
|
|
13585
|
+
};
|
|
13586
|
+
}());
|
|
13587
|
+
}, [form, good]);
|
|
13588
|
+
React__default['default'].useEffect(function () {
|
|
13589
|
+
form.resetFields();
|
|
13590
|
+
|
|
13591
|
+
if (good) {
|
|
13592
|
+
var _getSN3, _getSN4;
|
|
13593
|
+
|
|
13594
|
+
form.setFieldsValue(_objectSpread2(_objectSpread2({}, good), {}, {
|
|
13595
|
+
itemName: (_getSN3 = getSN(good.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.full,
|
|
13596
|
+
itemNameSelf: (_getSN4 = getSN(good.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.full
|
|
13597
|
+
}));
|
|
13598
|
+
}
|
|
13599
|
+
}, [good]);
|
|
13600
|
+
return React__default['default'].createElement(ktsXui.Drawer, {
|
|
13601
|
+
width: 500,
|
|
13602
|
+
onClose: onClose,
|
|
13603
|
+
placement: "right",
|
|
13604
|
+
title: "\u6DFB\u52A0\u5546\u54C1\u5BF9\u7167",
|
|
13605
|
+
visible: !!good,
|
|
13606
|
+
footer: React__default['default'].createElement("div", {
|
|
13607
|
+
style: {
|
|
13608
|
+
display: 'flex',
|
|
13609
|
+
justifyContent: 'flex-end',
|
|
13610
|
+
gap: 10
|
|
13611
|
+
}
|
|
13612
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
13613
|
+
type: "primary",
|
|
13614
|
+
onClick: onSubmit
|
|
13615
|
+
}, "\u63D0\u4EA4"), React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
13616
|
+
onClick: onClose
|
|
13617
|
+
}, "\u53D6\u6D88"))
|
|
13618
|
+
}, !!good && React__default['default'].createElement(ktsXui.Form, {
|
|
13619
|
+
layout: "vertical",
|
|
13620
|
+
style: {
|
|
13621
|
+
flex: 1
|
|
13622
|
+
},
|
|
13623
|
+
form: form
|
|
13624
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Row, {
|
|
13625
|
+
gutter: [8, 8]
|
|
13626
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Col, {
|
|
13627
|
+
span: 12
|
|
13628
|
+
}, React__default['default'].createElement(ktsXui.Form.Item, {
|
|
13629
|
+
name: "itemCodeSelf",
|
|
13630
|
+
label: "\u6211\u65B9\u5546\u54C1\u7F16\u7801"
|
|
13631
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, null))), React__default['default'].createElement(ktsComponentsAntdX3.Col, {
|
|
13632
|
+
span: 12
|
|
13633
|
+
}, React__default['default'].createElement(ktsXui.Form.Item, {
|
|
13634
|
+
name: "itemCode",
|
|
13635
|
+
label: "\u5BF9\u65B9\u5546\u54C1\u7F16\u7801"
|
|
13636
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, null))), React__default['default'].createElement(ktsComponentsAntdX3.Col, {
|
|
13637
|
+
span: 12
|
|
13638
|
+
}, React__default['default'].createElement(ktsXui.Form.Item, {
|
|
13639
|
+
name: "itemNameSelf",
|
|
13640
|
+
label: "\u6211\u65B9\u5546\u54C1\u540D\u79F0"
|
|
13641
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, null))), React__default['default'].createElement(ktsComponentsAntdX3.Col, {
|
|
13642
|
+
span: 12
|
|
13643
|
+
}, React__default['default'].createElement(ktsXui.Form.Item, {
|
|
13644
|
+
name: "itemName",
|
|
13645
|
+
label: "\u5BF9\u65B9\u5546\u54C1\u540D\u79F0"
|
|
13646
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, null))), React__default['default'].createElement(ktsComponentsAntdX3.Col, {
|
|
13647
|
+
span: 12
|
|
13648
|
+
}, React__default['default'].createElement(ktsXui.Form.Item, {
|
|
13649
|
+
name: 'itemModelNameSelf',
|
|
13650
|
+
label: "\u6211\u65B9\u89C4\u683C\u578B\u53F7"
|
|
13651
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, null))), React__default['default'].createElement(ktsComponentsAntdX3.Col, {
|
|
13652
|
+
span: 12
|
|
13653
|
+
}, React__default['default'].createElement(ktsXui.Form.Item, {
|
|
13654
|
+
name: "itemModelName",
|
|
13655
|
+
label: "\u5BF9\u65B9\u89C4\u683C\u578B\u53F7"
|
|
13656
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Input, null))))));
|
|
13657
|
+
} // function validateFields(form: WrappedFormUtils<any>) {
|
|
13658
|
+
// return new Promise<{ err: any, values: any }>(resolve => {
|
|
13659
|
+
// form.validateFields((err, values) => {
|
|
13660
|
+
// resolve({ err, values })
|
|
13661
|
+
// })
|
|
13662
|
+
// })
|
|
13663
|
+
// }
|
|
12894
13664
|
|
|
12895
13665
|
/** 发票组件的上下文 */
|
|
12896
13666
|
|
|
12897
13667
|
var InvoiceContext = React__default['default'].createContext(undefined);
|
|
12898
13668
|
|
|
12899
|
-
var
|
|
12900
|
-
_inherits(
|
|
13669
|
+
var Invoice = /*#__PURE__*/function (_React$PureComponent) {
|
|
13670
|
+
_inherits(Invoice, _React$PureComponent);
|
|
12901
13671
|
|
|
12902
|
-
var _super = _createSuper(
|
|
13672
|
+
var _super = _createSuper(Invoice);
|
|
12903
13673
|
|
|
12904
|
-
function
|
|
12905
|
-
_classCallCheck(this,
|
|
13674
|
+
function Invoice() {
|
|
13675
|
+
_classCallCheck(this, Invoice);
|
|
12906
13676
|
|
|
12907
13677
|
return _super.apply(this, arguments);
|
|
12908
13678
|
}
|
|
12909
13679
|
|
|
12910
|
-
_createClass(
|
|
13680
|
+
_createClass(Invoice, [{
|
|
12911
13681
|
key: "render",
|
|
12912
13682
|
value:
|
|
12913
13683
|
/** 控制器 */
|
|
@@ -12930,18 +13700,18 @@ var default_1 = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
12930
13700
|
}
|
|
12931
13701
|
}]);
|
|
12932
13702
|
|
|
12933
|
-
return
|
|
13703
|
+
return Invoice;
|
|
12934
13704
|
}(React__default['default'].PureComponent);
|
|
12935
13705
|
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
13706
|
+
Invoice.InvoiceController = InvoiceController;
|
|
13707
|
+
Invoice.InvoiceHeader = InvoiceHeader;
|
|
13708
|
+
Invoice.GoodsList = GoodsList;
|
|
13709
|
+
Invoice.Seller = Buyer;
|
|
13710
|
+
Invoice.Sign = Sign;
|
|
13711
|
+
Invoice.Buyer = Buyer$1;
|
|
13712
|
+
Invoice.idGenerator = idGenerator;
|
|
12943
13713
|
|
|
12944
|
-
|
|
13714
|
+
Invoice.useInvoiceController = function () {
|
|
12945
13715
|
return React__default['default'].useContext(InvoiceContext);
|
|
12946
13716
|
};
|
|
12947
13717
|
|
|
@@ -12973,8 +13743,8 @@ var Main$3 = function Main(props) {
|
|
|
12973
13743
|
/** 销售方 */
|
|
12974
13744
|
, props.sign || React__default['default'].createElement(Sign, null)
|
|
12975
13745
|
/** 落款 */
|
|
12976
|
-
, props.footExpand), React__default['default'].createElement(ImportBuyerDrawer, null), React__default['default'].createElement(ImportGoodsDrawer, null), React__default['default'].createElement(EndowCodeDrawer, null));
|
|
13746
|
+
, props.footExpand), React__default['default'].createElement(ImportBuyerDrawer, null), React__default['default'].createElement(ImportGoodsDrawer, null), React__default['default'].createElement(EndowCodeDrawer, null), React__default['default'].createElement(AddComparisonDrawer, null));
|
|
12977
13747
|
};
|
|
12978
13748
|
|
|
12979
|
-
exports.Invoice =
|
|
13749
|
+
exports.Invoice = Invoice;
|
|
12980
13750
|
exports.InvoiceController = InvoiceController;
|