kts-component-invoice-operate 2.0.21 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +2 -0
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/{useAddComparison → _useAddComparison}/index.d.ts +1 -1
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.d.ts +5 -2
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.d.ts +5 -2
- package/dist/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.d.ts +5 -2
- package/dist/Invoice/ui/GoodsList/hook/useToGenerateId/index.d.ts +3 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.d.ts +1 -0
- package/dist/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.d.ts +1 -1
- package/dist/index.esm.js +901 -1027
- package/dist/index.js +900 -1026
- package/docs-dist/umi.js +1 -1
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +3 -0
- package/src/Invoice/index.tsx +15 -18
- package/src/Invoice/tools/idGenerator/index.ts +1 -1
- package/src/Invoice/ui/AddComparisonDrawer/index.tsx +1 -1
- package/src/Invoice/ui/GoodsList/hook/useColumns/index.tsx +22 -29
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/{useAddComparison → _useAddComparison}/index.tsx +5 -1
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useAddDiscount/index.tsx +33 -10
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useDelItem/index.tsx +19 -7
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/hook/useEndowCode/index.tsx +11 -5
- package/src/Invoice/ui/GoodsList/hook/useColumns/ui/RowMenu/index.tsx +52 -18
- package/src/Invoice/ui/GoodsList/hook/useToGenerateId/index.ts +13 -0
- package/src/Invoice/ui/GoodsList/index.tsx +17 -3
- package/src/Invoice/ui/GoodsList/ui/AddRowButton/index.tsx +1 -1
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useAddDiscountRowButton/index.tsx +10 -39
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useDelRowButton/index.tsx +11 -2
- package/src/Invoice/ui/GoodsList/ui/BulkMenu/hooks/useEndowCodeButton/index.tsx +2 -2
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +58 -63
package/dist/index.js
CHANGED
|
@@ -1226,7 +1226,7 @@ var delGood = /*#__PURE__*/(function () {
|
|
|
1226
1226
|
};
|
|
1227
1227
|
})();
|
|
1228
1228
|
|
|
1229
|
-
var id =
|
|
1229
|
+
var id = new Date().getTime();
|
|
1230
1230
|
var idGenerator = (function () {
|
|
1231
1231
|
return ++id;
|
|
1232
1232
|
});
|
|
@@ -2135,7 +2135,6 @@ var AddRowButton = (function () {
|
|
|
2135
2135
|
})), [controller]);
|
|
2136
2136
|
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2137
2137
|
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
2138
|
-
icon: "plus-circle",
|
|
2139
2138
|
onClick: onClick,
|
|
2140
2139
|
disabled: disabled
|
|
2141
2140
|
}, "\u6DFB\u52A0\u884C");
|
|
@@ -2364,118 +2363,48 @@ function TableRow(props) {
|
|
|
2364
2363
|
}));
|
|
2365
2364
|
}
|
|
2366
2365
|
|
|
2367
|
-
var
|
|
2366
|
+
var _defs$1, _path$2;
|
|
2367
|
+
|
|
2368
|
+
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); }
|
|
2369
|
+
|
|
2370
|
+
function SvgSpot(props) {
|
|
2371
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
2372
|
+
className: "spot_svg__icon",
|
|
2373
|
+
viewBox: "0 0 1024 1024",
|
|
2374
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2375
|
+
}, props), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("style", null))), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
2376
|
+
d: "M416 512a1.5 1.5 0 10192 0 1.5 1.5 0 10-192 0zM416 96.64a1.5 1.5 0 10192 0 1.5 1.5 0 10-192 0zM416 927.36a1.5 1.5 0 10192 0 1.5 1.5 0 10-192 0z"
|
|
2377
|
+
})));
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
var useDelItem = (function (goods) {
|
|
2368
2381
|
var controller = Invoice.useInvoiceController();
|
|
2369
2382
|
var model = controller.useMemo(function (s) {
|
|
2370
2383
|
return s.model;
|
|
2371
2384
|
}, []);
|
|
2372
|
-
/** 是否禁用 */
|
|
2373
|
-
|
|
2374
|
-
var disabled = controller.useMemo(function (s) {
|
|
2375
|
-
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
2376
|
-
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
2377
|
-
var good = s.goodsListState.goodsMap.get(e);
|
|
2378
|
-
if (!good) return true;
|
|
2379
|
-
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
2380
|
-
});
|
|
2381
|
-
}, []);
|
|
2382
2385
|
var onClick = React__default['default'].useCallback(function () {
|
|
2383
|
-
controller.
|
|
2384
|
-
|
|
2385
|
-
var goodsList;
|
|
2386
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2387
|
-
while (1) {
|
|
2388
|
-
switch (_context.prev = _context.next) {
|
|
2389
|
-
case 0:
|
|
2390
|
-
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
2391
|
-
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
2392
|
-
});
|
|
2393
|
-
|
|
2394
|
-
if (s.goodsListState.editGood) {
|
|
2395
|
-
if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
|
|
2396
|
-
controller.setEditGood();
|
|
2397
|
-
}
|
|
2398
|
-
}
|
|
2386
|
+
controller.delGood(goods.$index);
|
|
2387
|
+
}, [controller, goods.$index]);
|
|
2399
2388
|
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
});
|
|
2389
|
+
if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
|
|
2390
|
+
return undefined;
|
|
2391
|
+
}
|
|
2404
2392
|
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
}, _callee);
|
|
2411
|
-
}));
|
|
2393
|
+
if (!(model !== 'prefab')) {
|
|
2394
|
+
return undefined;
|
|
2395
|
+
}
|
|
2412
2396
|
|
|
2413
|
-
return function (_x) {
|
|
2414
|
-
return _ref.apply(this, arguments);
|
|
2415
|
-
};
|
|
2416
|
-
}())();
|
|
2417
|
-
}, [controller]);
|
|
2418
|
-
var menuItem = React__default['default'].useMemo(function () {
|
|
2419
|
-
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2420
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
2421
|
-
key: "1",
|
|
2422
|
-
onClick: onClick,
|
|
2423
|
-
disabled: disabled
|
|
2424
|
-
}, "\u5220\u9664\u884C");
|
|
2425
|
-
}, [model, onClick, disabled]);
|
|
2426
2397
|
return {
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
2434
|
-
// let timer: any = 0;
|
|
2435
|
-
// return (...par: any[]) => {
|
|
2436
|
-
// if (timer === 0) {
|
|
2437
|
-
// timer = setTimeout(() => {
|
|
2438
|
-
// fn.apply(null, par);
|
|
2439
|
-
// timer = 0;
|
|
2440
|
-
// }, delayed);
|
|
2441
|
-
// }
|
|
2442
|
-
// }
|
|
2443
|
-
var timer;
|
|
2444
|
-
return function () {
|
|
2445
|
-
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2446
|
-
par[_key] = arguments[_key];
|
|
2447
|
-
}
|
|
2448
|
-
|
|
2449
|
-
if (timer) return;
|
|
2450
|
-
timer = setTimeout(function () {
|
|
2451
|
-
timer = undefined;
|
|
2452
|
-
fn.apply(null, par);
|
|
2453
|
-
}, delayed);
|
|
2454
|
-
};
|
|
2455
|
-
});
|
|
2456
|
-
|
|
2457
|
-
var math = mathjs.create(mathjs.all, {
|
|
2458
|
-
number: 'BigNumber',
|
|
2459
|
-
precision: 20
|
|
2460
|
-
});
|
|
2461
|
-
var evaluate = (function (expr) {
|
|
2462
|
-
var fractionDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
|
|
2463
|
-
return parseFloat(math.evaluate(expr).toFixed(fractionDigits));
|
|
2398
|
+
key: 'delItem',
|
|
2399
|
+
title: '删除',
|
|
2400
|
+
onClick: onClick
|
|
2401
|
+
}; // return React.useMemo(() => {
|
|
2402
|
+
// return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
|
|
2403
|
+
// }, [onClick])
|
|
2464
2404
|
});
|
|
2465
2405
|
|
|
2466
|
-
var css_248z$5 = ".kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body .ktsAnt3x-drawer-body {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body .ktsAnt3x-drawer-body .add-discount-row-body {\n flex: 1;\n overflow: auto;\n}\n.kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body .ktsAnt3x-drawer-body .add-discount-row-footer {\n flex: none;\n}\n";
|
|
2467
|
-
styleInject(css_248z$5);
|
|
2468
|
-
|
|
2469
2406
|
var Text = ktsComponentsAntdX3.Typography.Text;
|
|
2470
|
-
|
|
2471
|
-
var _create = mathjs.create(mathjs.all, {
|
|
2472
|
-
number: 'BigNumber',
|
|
2473
|
-
precision: 20
|
|
2474
|
-
}),
|
|
2475
|
-
chain = _create.chain;
|
|
2476
|
-
|
|
2477
|
-
var useAddDiscountRowButton = (function () {
|
|
2478
|
-
/** 控制器 */
|
|
2407
|
+
var useAddDiscount = (function (goods) {
|
|
2479
2408
|
var controller = Invoice.useInvoiceController();
|
|
2480
2409
|
var model = controller.useMemo(function (s) {
|
|
2481
2410
|
return s.model;
|
|
@@ -2485,92 +2414,61 @@ var useAddDiscountRowButton = (function () {
|
|
|
2485
2414
|
var isAddDiscount = controller.useMemo(function (s) {
|
|
2486
2415
|
return s.goodsListState.isAddDiscount;
|
|
2487
2416
|
}, []);
|
|
2488
|
-
/** 是否开启抽屉 */
|
|
2489
|
-
|
|
2490
|
-
var visible = controller.useMemo(function (s) {
|
|
2491
|
-
return s.goodsListState.discountGoodIndex.length > 0;
|
|
2492
|
-
}, []);
|
|
2493
|
-
/** 是否禁用 按钮 */
|
|
2494
|
-
|
|
2495
|
-
var disabled = controller.useMemo(function (s) {
|
|
2496
|
-
if (s.goodsListState.selectedGoodIndex.length <= 0) {
|
|
2497
|
-
return true;
|
|
2498
|
-
}
|
|
2499
|
-
|
|
2500
|
-
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
2501
|
-
var good = s.goodsListState.goodsMap.get(e);
|
|
2502
|
-
if (!good) return true;
|
|
2503
|
-
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
2504
|
-
});
|
|
2505
|
-
}, []);
|
|
2506
|
-
/** 关闭抽屉 */
|
|
2507
|
-
|
|
2508
|
-
var onClose = React__default['default'].useCallback(function () {
|
|
2509
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
2510
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2511
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2512
|
-
while (1) {
|
|
2513
|
-
switch (_context.prev = _context.next) {
|
|
2514
|
-
case 0:
|
|
2515
|
-
s.goodsListState.discountGoodIndex = [];
|
|
2516
|
-
|
|
2517
|
-
case 1:
|
|
2518
|
-
case "end":
|
|
2519
|
-
return _context.stop();
|
|
2520
|
-
}
|
|
2521
|
-
}
|
|
2522
|
-
}, _callee);
|
|
2523
|
-
}));
|
|
2524
|
-
|
|
2525
|
-
return function (_x) {
|
|
2526
|
-
return _ref.apply(this, arguments);
|
|
2527
|
-
};
|
|
2528
|
-
}())();
|
|
2529
|
-
}, []);
|
|
2530
2417
|
/** 点击了 添加折扣行 按钮 */
|
|
2531
2418
|
|
|
2532
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2533
|
-
return _regeneratorRuntime().wrap(function
|
|
2419
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2420
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2534
2421
|
while (1) {
|
|
2535
|
-
switch (
|
|
2422
|
+
switch (_context2.prev = _context2.next) {
|
|
2536
2423
|
case 0:
|
|
2537
|
-
|
|
2424
|
+
_context2.next = 2;
|
|
2538
2425
|
return controller.saveEditGood();
|
|
2539
2426
|
|
|
2540
2427
|
case 2:
|
|
2541
|
-
|
|
2428
|
+
_context2.next = 4;
|
|
2542
2429
|
return controller.wait();
|
|
2543
2430
|
|
|
2544
2431
|
case 4:
|
|
2545
|
-
|
|
2546
|
-
return controller.
|
|
2547
|
-
var
|
|
2548
|
-
var
|
|
2549
|
-
return _regeneratorRuntime().wrap(function
|
|
2432
|
+
_context2.next = 6;
|
|
2433
|
+
return controller.run( /*#__PURE__*/function () {
|
|
2434
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2435
|
+
var err, key;
|
|
2436
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2550
2437
|
while (1) {
|
|
2551
|
-
switch (
|
|
2438
|
+
switch (_context.prev = _context.next) {
|
|
2552
2439
|
case 0:
|
|
2553
|
-
|
|
2440
|
+
if (!s.goodsListState.form) {
|
|
2441
|
+
_context.next = 11;
|
|
2442
|
+
break;
|
|
2443
|
+
}
|
|
2554
2444
|
|
|
2555
|
-
|
|
2556
|
-
|
|
2445
|
+
err = s.goodsListState.form.getFieldsError();
|
|
2446
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
2447
|
+
|
|
2448
|
+
case 3:
|
|
2449
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
2450
|
+
_context.next = 11;
|
|
2557
2451
|
break;
|
|
2558
2452
|
}
|
|
2559
2453
|
|
|
2560
|
-
|
|
2561
|
-
content: '不能给编辑状态的行增加折扣!',
|
|
2562
|
-
key: '不能给编辑状态的行增加折扣!'
|
|
2563
|
-
});
|
|
2564
|
-
return _context2.abrupt("return");
|
|
2454
|
+
key = _context.t1.value;
|
|
2565
2455
|
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
});
|
|
2456
|
+
if (err[key]) {
|
|
2457
|
+
_context.next = 7;
|
|
2458
|
+
break;
|
|
2459
|
+
}
|
|
2571
2460
|
|
|
2572
|
-
|
|
2573
|
-
|
|
2461
|
+
return _context.abrupt("continue", 3);
|
|
2462
|
+
|
|
2463
|
+
case 7:
|
|
2464
|
+
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
2465
|
+
return _context.abrupt("return");
|
|
2466
|
+
|
|
2467
|
+
case 11:
|
|
2468
|
+
goods = s.goodsListState.goodsMap.get(goods.$index);
|
|
2469
|
+
|
|
2470
|
+
if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
|
|
2471
|
+
_context.next = 15;
|
|
2574
2472
|
break;
|
|
2575
2473
|
}
|
|
2576
2474
|
|
|
@@ -2578,16 +2476,11 @@ var useAddDiscountRowButton = (function () {
|
|
|
2578
2476
|
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
2579
2477
|
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
2580
2478
|
});
|
|
2581
|
-
return
|
|
2582
|
-
|
|
2583
|
-
case 8:
|
|
2584
|
-
isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
|
|
2585
|
-
var good = s.goodsListState.goodsMap.get($index);
|
|
2586
|
-
return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
|
|
2587
|
-
});
|
|
2479
|
+
return _context.abrupt("return");
|
|
2588
2480
|
|
|
2589
|
-
|
|
2590
|
-
|
|
2481
|
+
case 15:
|
|
2482
|
+
if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
|
|
2483
|
+
_context.next = 18;
|
|
2591
2484
|
break;
|
|
2592
2485
|
}
|
|
2593
2486
|
|
|
@@ -2595,579 +2488,23 @@ var useAddDiscountRowButton = (function () {
|
|
|
2595
2488
|
content: '金额为0不能添加折扣行',
|
|
2596
2489
|
key: '金额为0不能添加折扣行'
|
|
2597
2490
|
});
|
|
2598
|
-
return
|
|
2491
|
+
return _context.abrupt("return");
|
|
2599
2492
|
|
|
2600
|
-
case
|
|
2601
|
-
s.goodsListState.discountGoodIndex =
|
|
2493
|
+
case 18:
|
|
2494
|
+
s.goodsListState.discountGoodIndex = [goods.$index];
|
|
2602
2495
|
|
|
2603
|
-
case
|
|
2496
|
+
case 19:
|
|
2604
2497
|
case "end":
|
|
2605
|
-
return
|
|
2498
|
+
return _context.stop();
|
|
2606
2499
|
}
|
|
2607
2500
|
}
|
|
2608
|
-
},
|
|
2609
|
-
}));
|
|
2610
|
-
|
|
2611
|
-
return function (_x2) {
|
|
2612
|
-
return _ref3.apply(this, arguments);
|
|
2613
|
-
};
|
|
2614
|
-
}())();
|
|
2615
|
-
|
|
2616
|
-
case 6:
|
|
2617
|
-
case "end":
|
|
2618
|
-
return _context3.stop();
|
|
2619
|
-
}
|
|
2620
|
-
}
|
|
2621
|
-
}, _callee3);
|
|
2622
|
-
})), [controller]);
|
|
2623
|
-
var menuItem = React__default['default'].useMemo(function () {
|
|
2624
|
-
return model === 'prefab' ? React__default['default'].createElement(React__default['default'].Fragment, null) : isAddDiscount !== false ? React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
2625
|
-
key: "0",
|
|
2626
|
-
onClick: onClick,
|
|
2627
|
-
disabled: disabled
|
|
2628
|
-
}, "\u6DFB\u52A0\u6298\u6263\u884C") : undefined;
|
|
2629
|
-
}, [isAddDiscount, disabled, onClick]);
|
|
2630
|
-
var drawer = React__default['default'].useMemo(function () {
|
|
2631
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Drawer, {
|
|
2632
|
-
className: "kts-invoice-operate-goods-list-add-discount-row",
|
|
2633
|
-
width: 540,
|
|
2634
|
-
title: "\u6DFB\u52A0\u6298\u6263\u884C",
|
|
2635
|
-
placement: "right",
|
|
2636
|
-
destroyOnClose: true,
|
|
2637
|
-
onClose: onClose,
|
|
2638
|
-
visible: visible
|
|
2639
|
-
}, React__default['default'].createElement(DrawerBody, null));
|
|
2640
|
-
}, [visible, onClose]);
|
|
2641
|
-
return {
|
|
2642
|
-
menuItem: menuItem,
|
|
2643
|
-
drawer: drawer
|
|
2644
|
-
};
|
|
2645
|
-
});
|
|
2646
|
-
var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
2647
|
-
var form = props.form;
|
|
2648
|
-
var getFieldDecorator = form.getFieldDecorator;
|
|
2649
|
-
var controller = Invoice.useInvoiceController();
|
|
2650
|
-
/** 选中的货物索引列表 */
|
|
2651
|
-
|
|
2652
|
-
var discountGoodIndex = controller.useMemo(function (s) {
|
|
2653
|
-
return s.goodsListState.discountGoodIndex;
|
|
2654
|
-
}, []);
|
|
2655
|
-
/** 金额合计 */
|
|
2656
|
-
|
|
2657
|
-
var lineAmountSum = controller.useMemo(function (s) {
|
|
2658
|
-
var sum = chain(0);
|
|
2659
|
-
|
|
2660
|
-
if (s.goodsListState.isTaxIncluded) {
|
|
2661
|
-
s.goodsListState.discountGoodIndex.forEach(function (e) {
|
|
2662
|
-
var goods = s.goodsListState.goodsMap.get(e);
|
|
2663
|
-
sum = sum.add((goods === null || goods === void 0 ? void 0 : goods.lineAmountIncludeTax) || 0);
|
|
2664
|
-
});
|
|
2665
|
-
} else {
|
|
2666
|
-
s.goodsListState.discountGoodIndex.forEach(function (e) {
|
|
2667
|
-
var goods = s.goodsListState.goodsMap.get(e);
|
|
2668
|
-
sum = sum.add((goods === null || goods === void 0 ? void 0 : goods.lineAmountExcludeTax) || 0);
|
|
2669
|
-
});
|
|
2670
|
-
}
|
|
2671
|
-
|
|
2672
|
-
return sum.done();
|
|
2673
|
-
}, []);
|
|
2674
|
-
/** 关闭抽屉 */
|
|
2675
|
-
|
|
2676
|
-
var onClose = React__default['default'].useCallback(function () {
|
|
2677
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
2678
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
2679
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
2680
|
-
while (1) {
|
|
2681
|
-
switch (_context4.prev = _context4.next) {
|
|
2682
|
-
case 0:
|
|
2683
|
-
s.goodsListState.discountGoodIndex = [];
|
|
2684
|
-
|
|
2685
|
-
case 1:
|
|
2686
|
-
case "end":
|
|
2687
|
-
return _context4.stop();
|
|
2688
|
-
}
|
|
2689
|
-
}
|
|
2690
|
-
}, _callee4);
|
|
2691
|
-
}));
|
|
2692
|
-
|
|
2693
|
-
return function (_x3) {
|
|
2694
|
-
return _ref4.apply(this, arguments);
|
|
2695
|
-
};
|
|
2696
|
-
}())();
|
|
2697
|
-
}, []);
|
|
2698
|
-
/** 点击了保存 */
|
|
2699
|
-
|
|
2700
|
-
var onClickSave = React__default['default'].useCallback(function () {
|
|
2701
|
-
form.validateFields(function (err, values) {
|
|
2702
|
-
if (err) return;
|
|
2703
|
-
var discolineAmountunt = parseFloat(parseFloat(values.discolineAmountunt).toFixed(2));
|
|
2704
|
-
var discount = parseFloat(parseFloat(values.discount).toFixed(4));
|
|
2705
|
-
var indexList = discountGoodIndex;
|
|
2706
|
-
controller.pipeline( /*#__PURE__*/function () {
|
|
2707
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
2708
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
2709
|
-
while (1) {
|
|
2710
|
-
switch (_context5.prev = _context5.next) {
|
|
2711
|
-
case 0:
|
|
2712
|
-
s.goodsListState.discountGoodIndex = [];
|
|
2713
|
-
|
|
2714
|
-
case 1:
|
|
2715
|
-
case "end":
|
|
2716
|
-
return _context5.stop();
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
|
-
}, _callee5);
|
|
2720
|
-
}));
|
|
2721
|
-
|
|
2722
|
-
return function (_x4) {
|
|
2723
|
-
return _ref5.apply(this, arguments);
|
|
2724
|
-
};
|
|
2725
|
-
}())();
|
|
2726
|
-
controller.addGoodDiscount({
|
|
2727
|
-
indexList: indexList,
|
|
2728
|
-
discount: discount,
|
|
2729
|
-
discolineAmountunt: discolineAmountunt
|
|
2730
|
-
});
|
|
2731
|
-
});
|
|
2732
|
-
}, [controller, form, discountGoodIndex]);
|
|
2733
|
-
/** 折扣率变化 */
|
|
2734
|
-
|
|
2735
|
-
var onChangeDiscount = React__default['default'].useCallback(lazyFn(function (e) {
|
|
2736
|
-
form.validateFields(function (err, values) {
|
|
2737
|
-
if (err && err.discount) return;
|
|
2738
|
-
var discolineAmountunt = evaluate("".concat(lineAmountSum, " * (").concat(values.discount, "/100)")).toFixed(2);
|
|
2739
|
-
form.setFieldsValue({
|
|
2740
|
-
discolineAmountunt: discolineAmountunt
|
|
2741
|
-
});
|
|
2742
|
-
});
|
|
2743
|
-
}, 300), [form, lineAmountSum]);
|
|
2744
|
-
/** 折扣变化 */
|
|
2745
|
-
|
|
2746
|
-
var onChangeDiscolineAmountunt = React__default['default'].useCallback(lazyFn(function (e) {
|
|
2747
|
-
form.validateFields(function (err, values) {
|
|
2748
|
-
if (err && err.discolineAmountunt) return;
|
|
2749
|
-
var discolineAmountunt = parseFloat(values.discolineAmountunt).toFixed(2);
|
|
2750
|
-
var discount = evaluate("(".concat(discolineAmountunt, " / ").concat(lineAmountSum, ") * 100")).toFixed(4);
|
|
2751
|
-
form.setFieldsValue({
|
|
2752
|
-
discount: discount
|
|
2753
|
-
});
|
|
2754
|
-
});
|
|
2755
|
-
}, 300), [form, lineAmountSum]);
|
|
2756
|
-
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement("div", {
|
|
2757
|
-
className: "add-discount-row-body"
|
|
2758
|
-
}, React__default['default'].createElement("p", null, "\u5F53\u524D\u9009\u62E9", React__default['default'].createElement(Text, {
|
|
2759
|
-
type: "danger"
|
|
2760
|
-
}, discountGoodIndex.length), "\u884C\u88AB\u6298\u6263\u5546\u54C1\u884C\uFF0C\u91D1\u989D\u5408\u8BA1\xA5", React__default['default'].createElement(Text, {
|
|
2761
|
-
type: "danger"
|
|
2762
|
-
}, lineAmountSum.toFixed(2))), React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
2763
|
-
label: "\u6298\u6263\u7387\uFF1A"
|
|
2764
|
-
}, getFieldDecorator('discount', {
|
|
2765
|
-
rules: [{
|
|
2766
|
-
required: true,
|
|
2767
|
-
message: '请输入折扣金额'
|
|
2768
|
-
}, {
|
|
2769
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
2770
|
-
message: '请输入数字'
|
|
2771
|
-
}, {
|
|
2772
|
-
validator: function validator(_, value, callback) {
|
|
2773
|
-
var _value$match;
|
|
2774
|
-
|
|
2775
|
-
if (!value) {
|
|
2776
|
-
callback();
|
|
2777
|
-
return;
|
|
2778
|
-
}
|
|
2779
|
-
|
|
2780
|
-
if (!((_value$match = value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)) === null || _value$match === void 0 ? void 0 : _value$match.length)) {
|
|
2781
|
-
callback();
|
|
2782
|
-
return;
|
|
2783
|
-
}
|
|
2784
|
-
|
|
2785
|
-
if (parseFloat(value) > 100 || parseFloat(value) < 0) {
|
|
2786
|
-
callback('请输入大于0小于100的数字');
|
|
2787
|
-
}
|
|
2788
|
-
|
|
2789
|
-
callback();
|
|
2790
|
-
}
|
|
2791
|
-
}]
|
|
2792
|
-
})(React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
2793
|
-
placeholder: "\u8BF7\u8F93\u5165\u5927\u4E8E0\u5C0F\u4E8E100\u7684\u6570\u5B57",
|
|
2794
|
-
suffix: "%",
|
|
2795
|
-
onChange: onChangeDiscount
|
|
2796
|
-
}))), React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
2797
|
-
label: "\u6298\u6263\u91D1\u989D\uFF1A"
|
|
2798
|
-
}, getFieldDecorator('discolineAmountunt', {
|
|
2799
|
-
rules: [{
|
|
2800
|
-
required: true,
|
|
2801
|
-
message: '请输入折扣金额'
|
|
2802
|
-
}, {
|
|
2803
|
-
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
2804
|
-
message: '请输入数字'
|
|
2805
|
-
}, {
|
|
2806
|
-
validator: function validator(_, value, callback) {
|
|
2807
|
-
var _value$match2;
|
|
2808
|
-
|
|
2809
|
-
if (!value) {
|
|
2810
|
-
callback();
|
|
2811
|
-
return;
|
|
2812
|
-
}
|
|
2813
|
-
|
|
2814
|
-
if (!((_value$match2 = value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)) === null || _value$match2 === void 0 ? void 0 : _value$match2.length)) {
|
|
2815
|
-
callback();
|
|
2816
|
-
return;
|
|
2817
|
-
}
|
|
2818
|
-
|
|
2819
|
-
if (parseFloat(value) > lineAmountSum || parseFloat(value) < 0) {
|
|
2820
|
-
callback('请输入大于0小于金额合计的数字');
|
|
2821
|
-
}
|
|
2822
|
-
|
|
2823
|
-
callback();
|
|
2824
|
-
}
|
|
2825
|
-
}]
|
|
2826
|
-
})(React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
2827
|
-
placeholder: "\u8BF7\u8F93\u5165\u5927\u4E8E0\u5C0F\u4E8E\u91D1\u989D\u5408\u8BA1\u7684\u6570\u5B57",
|
|
2828
|
-
suffix: "\xA5",
|
|
2829
|
-
onChange: onChangeDiscolineAmountunt
|
|
2830
|
-
})))), React__default['default'].createElement("div", {
|
|
2831
|
-
className: "add-discount-row-footer"
|
|
2832
|
-
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
2833
|
-
block: true,
|
|
2834
|
-
style: {
|
|
2835
|
-
marginBottom: 12
|
|
2836
|
-
},
|
|
2837
|
-
onClick: onClose
|
|
2838
|
-
}, "\u53D6\u6D88"), React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
2839
|
-
type: "primary",
|
|
2840
|
-
block: true,
|
|
2841
|
-
onClick: onClickSave
|
|
2842
|
-
}, "\u4FDD\u5B58")));
|
|
2843
|
-
});
|
|
2844
|
-
|
|
2845
|
-
var keys = {};
|
|
2846
|
-
/**
|
|
2847
|
-
* 有冷却时间的函数
|
|
2848
|
-
* @param fn 方法
|
|
2849
|
-
* @param key 方法key
|
|
2850
|
-
* @param delayed 冷却时间
|
|
2851
|
-
*/
|
|
2852
|
-
|
|
2853
|
-
var coolingFn = (function () {
|
|
2854
|
-
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
2855
|
-
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
2856
|
-
var fn = arguments.length > 2 ? arguments[2] : undefined;
|
|
2857
|
-
|
|
2858
|
-
if (keys[key]) {
|
|
2859
|
-
return;
|
|
2860
|
-
} else {
|
|
2861
|
-
fn();
|
|
2862
|
-
keys[key] = setTimeout(function () {
|
|
2863
|
-
delete keys[key];
|
|
2864
|
-
}, delayed);
|
|
2865
|
-
}
|
|
2866
|
-
});
|
|
2867
|
-
|
|
2868
|
-
/** 拆分全称加简称 */
|
|
2869
|
-
var getSN = function getSN(value) {
|
|
2870
|
-
if (!value) return undefined;
|
|
2871
|
-
var arr = value.match(/\*[^*]+\*/);
|
|
2872
|
-
|
|
2873
|
-
if (arr && arr[0]) {
|
|
2874
|
-
return {
|
|
2875
|
-
shorthand: arr[0].split('*')[1],
|
|
2876
|
-
full: value.replace(arr[0], '')
|
|
2877
|
-
};
|
|
2878
|
-
} else {
|
|
2879
|
-
return {
|
|
2880
|
-
shorthand: undefined,
|
|
2881
|
-
full: value
|
|
2882
|
-
};
|
|
2883
|
-
}
|
|
2884
|
-
};
|
|
2885
|
-
/** 组合全称加简称 */
|
|
2886
|
-
|
|
2887
|
-
var getItemName = function getItemName(value) {
|
|
2888
|
-
if (value.shorthand) {
|
|
2889
|
-
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2890
|
-
} else {
|
|
2891
|
-
return value.full;
|
|
2892
|
-
}
|
|
2893
|
-
};
|
|
2894
|
-
/** 设置简称 */
|
|
2895
|
-
|
|
2896
|
-
var setShorthand = function setShorthand(name, shorthand) {
|
|
2897
|
-
if (!name) return undefined;
|
|
2898
|
-
var sn = getSN(name);
|
|
2899
|
-
if (!sn) return undefined;
|
|
2900
|
-
sn.shorthand = shorthand || '';
|
|
2901
|
-
return getItemName(sn);
|
|
2902
|
-
};
|
|
2903
|
-
|
|
2904
|
-
var useCommodityComparisonButton = (function () {
|
|
2905
|
-
var controller = Invoice.useInvoiceController();
|
|
2906
|
-
|
|
2907
|
-
var _controller$useMemo = controller.useMemo(function (s) {
|
|
2908
|
-
return s.goodsListState.productComparison;
|
|
2909
|
-
}, []),
|
|
2910
|
-
onComply = _controller$useMemo.onComply;
|
|
2911
|
-
/** 是否禁用 */
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
var disabled = controller.useMemo(function (s) {
|
|
2915
|
-
return s.goodsListState.selectedGoodIndex.length <= 0;
|
|
2916
|
-
}, []);
|
|
2917
|
-
/** 点击了 */
|
|
2918
|
-
|
|
2919
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2920
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2921
|
-
while (1) {
|
|
2922
|
-
switch (_context2.prev = _context2.next) {
|
|
2923
|
-
case 0:
|
|
2924
|
-
_context2.next = 2;
|
|
2925
|
-
return controller.saveEditGood();
|
|
2926
|
-
|
|
2927
|
-
case 2:
|
|
2928
|
-
_context2.next = 4;
|
|
2929
|
-
return controller.wait();
|
|
2930
|
-
|
|
2931
|
-
case 4:
|
|
2932
|
-
_context2.next = 6;
|
|
2933
|
-
return controller.run( /*#__PURE__*/function () {
|
|
2934
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2935
|
-
var _s$goodsListState, _s$goodsListState$pro;
|
|
2936
|
-
|
|
2937
|
-
var goods, newGoods;
|
|
2938
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2939
|
-
while (1) {
|
|
2940
|
-
switch (_context.prev = _context.next) {
|
|
2941
|
-
case 0:
|
|
2942
|
-
if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
|
|
2943
|
-
_context.next = 3;
|
|
2944
|
-
break;
|
|
2945
|
-
}
|
|
2946
|
-
|
|
2947
|
-
coolingFn('不能给正在编辑的货物执行商品对照', 3000, function () {
|
|
2948
|
-
ktsComponentsAntdX3.message.error('不能给正在编辑的货物执行商品对照');
|
|
2949
|
-
});
|
|
2950
|
-
return _context.abrupt("return");
|
|
2951
|
-
|
|
2952
|
-
case 3:
|
|
2953
|
-
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) {
|
|
2954
|
-
_context.next = 5;
|
|
2955
|
-
break;
|
|
2956
|
-
}
|
|
2957
|
-
|
|
2958
|
-
return _context.abrupt("return");
|
|
2959
|
-
|
|
2960
|
-
case 5:
|
|
2961
|
-
goods = s.goodsListState.selectedGoodIndex.map(function (e) {
|
|
2962
|
-
var _getSN, _getSN2;
|
|
2963
|
-
|
|
2964
|
-
var t = s.goodsListState.goodsMap.get(e);
|
|
2965
|
-
if (!t) return undefined;
|
|
2966
|
-
return _objectSpread2(_objectSpread2({}, t), {}, {
|
|
2967
|
-
itemName: (_getSN = getSN(t.itemName)) === null || _getSN === void 0 ? void 0 : _getSN.full,
|
|
2968
|
-
itemNameSelf: (_getSN2 = getSN(t.itemNameSelf)) === null || _getSN2 === void 0 ? void 0 : _getSN2.full
|
|
2969
|
-
});
|
|
2970
|
-
}).filter(function (e) {
|
|
2971
|
-
return !!e;
|
|
2972
|
-
}); // 比对后的商品
|
|
2973
|
-
|
|
2974
|
-
_context.next = 8;
|
|
2975
|
-
return s.goodsListState.productComparison.onComply(goods);
|
|
2976
|
-
|
|
2977
|
-
case 8:
|
|
2978
|
-
newGoods = _context.sent;
|
|
2979
|
-
newGoods.forEach(function (e) {
|
|
2980
|
-
var _getSN3, _getSN4;
|
|
2981
|
-
|
|
2982
|
-
var vt = s.goodsListState.goodsMap.get(e.$index);
|
|
2983
|
-
if (!vt) return undefined;
|
|
2984
|
-
vt.itemName = e.itemName ? setShorthand(e.itemName, (_getSN3 = getSN(vt.itemName)) === null || _getSN3 === void 0 ? void 0 : _getSN3.shorthand) : vt.itemName;
|
|
2985
|
-
vt.itemNameSelf = e.itemNameSelf ? setShorthand(e.itemNameSelf, (_getSN4 = getSN(vt.itemNameSelf)) === null || _getSN4 === void 0 ? void 0 : _getSN4.shorthand) : vt.itemNameSelf;
|
|
2986
|
-
vt.itemModelName = e.itemModelName ? e.itemModelName : vt.itemModelName;
|
|
2987
|
-
vt.itemModelNameSelf = e.itemModelNameSelf ? e.itemModelNameSelf : vt.itemModelNameSelf;
|
|
2988
|
-
vt.itemCode = e.itemCode ? e.itemCode : vt.itemCode;
|
|
2989
|
-
vt.itemCodeSelf = e.itemCodeSelf ? e.itemCodeSelf : vt.itemCodeSelf;
|
|
2990
|
-
});
|
|
2991
|
-
|
|
2992
|
-
case 10:
|
|
2993
|
-
case "end":
|
|
2994
|
-
return _context.stop();
|
|
2995
|
-
}
|
|
2996
|
-
}
|
|
2997
|
-
}, _callee);
|
|
2998
|
-
}));
|
|
2999
|
-
|
|
3000
|
-
return function (_x) {
|
|
3001
|
-
return _ref2.apply(this, arguments);
|
|
3002
|
-
};
|
|
3003
|
-
}());
|
|
3004
|
-
|
|
3005
|
-
case 6:
|
|
3006
|
-
case "end":
|
|
3007
|
-
return _context2.stop();
|
|
3008
|
-
}
|
|
3009
|
-
}
|
|
3010
|
-
}, _callee2);
|
|
3011
|
-
})), []);
|
|
3012
|
-
var menuItem = React__default['default'].useMemo(function () {
|
|
3013
|
-
// 没用 执行商品对照 的方法 不显示按钮
|
|
3014
|
-
if (!onComply) return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
3015
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
3016
|
-
key: "3",
|
|
3017
|
-
disabled: disabled,
|
|
3018
|
-
onClick: onClick
|
|
3019
|
-
}, "\u5546\u54C1\u6620\u5C04");
|
|
3020
|
-
}, [disabled, onClick, onComply]);
|
|
3021
|
-
return {
|
|
3022
|
-
menuItem: menuItem
|
|
3023
|
-
};
|
|
3024
|
-
});
|
|
3025
|
-
|
|
3026
|
-
function BulkMenu() {
|
|
3027
|
-
/** 删除行 */
|
|
3028
|
-
var delRowButton = useDelRowButton();
|
|
3029
|
-
/** 添加折扣行 */
|
|
3030
|
-
|
|
3031
|
-
var addDiscountRowButton = useAddDiscountRowButton();
|
|
3032
|
-
/** 执行商品对照 */
|
|
3033
|
-
|
|
3034
|
-
var commodityComparisonButton = useCommodityComparisonButton();
|
|
3035
|
-
var menu = React__default['default'].createElement(ktsComponentsAntdX3.Menu, null, delRowButton.menuItem, addDiscountRowButton.menuItem, commodityComparisonButton.menuItem);
|
|
3036
|
-
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(ktsComponentsAntdX3.Dropdown, {
|
|
3037
|
-
overlay: menu
|
|
3038
|
-
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, null, "\u6279\u91CF\u64CD\u4F5C\u884C")), addDiscountRowButton.drawer);
|
|
3039
|
-
}
|
|
3040
|
-
|
|
3041
|
-
var _defs$1, _path$2;
|
|
3042
|
-
|
|
3043
|
-
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); }
|
|
3044
|
-
|
|
3045
|
-
function SvgSpot(props) {
|
|
3046
|
-
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
3047
|
-
className: "spot_svg__icon",
|
|
3048
|
-
viewBox: "0 0 1024 1024",
|
|
3049
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
3050
|
-
}, props), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("style", null))), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
3051
|
-
d: "M416 512a1.5 1.5 0 10192 0 1.5 1.5 0 10-192 0zM416 96.64a1.5 1.5 0 10192 0 1.5 1.5 0 10-192 0zM416 927.36a1.5 1.5 0 10192 0 1.5 1.5 0 10-192 0z"
|
|
3052
|
-
})));
|
|
3053
|
-
}
|
|
3054
|
-
|
|
3055
|
-
var Text$1 = ktsComponentsAntdX3.Typography.Text;
|
|
3056
|
-
var useDelItem = (function (goods) {
|
|
3057
|
-
var controller = Invoice.useInvoiceController();
|
|
3058
|
-
var onClick = React__default['default'].useCallback(function () {
|
|
3059
|
-
controller.delGood(goods.$index);
|
|
3060
|
-
}, [controller, goods.$index]);
|
|
3061
|
-
|
|
3062
|
-
if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
|
|
3063
|
-
return undefined;
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
|
-
return React__default['default'].useMemo(function () {
|
|
3067
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
3068
|
-
key: "delItem",
|
|
3069
|
-
onClick: onClick
|
|
3070
|
-
}, React__default['default'].createElement(Text$1, {
|
|
3071
|
-
strong: true,
|
|
3072
|
-
type: "danger"
|
|
3073
|
-
}, "\u5220\u9664"));
|
|
3074
|
-
}, [onClick]);
|
|
3075
|
-
});
|
|
3076
|
-
|
|
3077
|
-
var Text$2 = ktsComponentsAntdX3.Typography.Text;
|
|
3078
|
-
var useAddDiscount = (function (goods) {
|
|
3079
|
-
var controller = Invoice.useInvoiceController();
|
|
3080
|
-
/** 点击了 添加折扣行 按钮 */
|
|
3081
|
-
|
|
3082
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
3083
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
3084
|
-
while (1) {
|
|
3085
|
-
switch (_context2.prev = _context2.next) {
|
|
3086
|
-
case 0:
|
|
3087
|
-
_context2.next = 2;
|
|
3088
|
-
return controller.saveEditGood();
|
|
3089
|
-
|
|
3090
|
-
case 2:
|
|
3091
|
-
_context2.next = 4;
|
|
3092
|
-
return controller.wait();
|
|
3093
|
-
|
|
3094
|
-
case 4:
|
|
3095
|
-
_context2.next = 6;
|
|
3096
|
-
return controller.pipeline( /*#__PURE__*/function () {
|
|
3097
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
3098
|
-
var err, key;
|
|
3099
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3100
|
-
while (1) {
|
|
3101
|
-
switch (_context.prev = _context.next) {
|
|
3102
|
-
case 0:
|
|
3103
|
-
if (!s.goodsListState.form) {
|
|
3104
|
-
_context.next = 11;
|
|
3105
|
-
break;
|
|
3106
|
-
}
|
|
3107
|
-
|
|
3108
|
-
err = s.goodsListState.form.getFieldsError();
|
|
3109
|
-
_context.t0 = _regeneratorRuntime().keys(err);
|
|
3110
|
-
|
|
3111
|
-
case 3:
|
|
3112
|
-
if ((_context.t1 = _context.t0()).done) {
|
|
3113
|
-
_context.next = 11;
|
|
3114
|
-
break;
|
|
3115
|
-
}
|
|
3116
|
-
|
|
3117
|
-
key = _context.t1.value;
|
|
3118
|
-
|
|
3119
|
-
if (err[key]) {
|
|
3120
|
-
_context.next = 7;
|
|
3121
|
-
break;
|
|
3122
|
-
}
|
|
3123
|
-
|
|
3124
|
-
return _context.abrupt("continue", 3);
|
|
3125
|
-
|
|
3126
|
-
case 7:
|
|
3127
|
-
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
3128
|
-
return _context.abrupt("return");
|
|
3129
|
-
|
|
3130
|
-
case 11:
|
|
3131
|
-
goods = s.goodsListState.goodsMap.get(goods.$index);
|
|
3132
|
-
|
|
3133
|
-
if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
|
|
3134
|
-
_context.next = 15;
|
|
3135
|
-
break;
|
|
3136
|
-
}
|
|
3137
|
-
|
|
3138
|
-
ktsComponentsAntdX3.message.error({
|
|
3139
|
-
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
3140
|
-
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
3141
|
-
});
|
|
3142
|
-
return _context.abrupt("return");
|
|
3143
|
-
|
|
3144
|
-
case 15:
|
|
3145
|
-
if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
|
|
3146
|
-
_context.next = 18;
|
|
3147
|
-
break;
|
|
3148
|
-
}
|
|
3149
|
-
|
|
3150
|
-
ktsComponentsAntdX3.message.error({
|
|
3151
|
-
content: '金额为0不能添加折扣行',
|
|
3152
|
-
key: '金额为0不能添加折扣行'
|
|
3153
|
-
});
|
|
3154
|
-
return _context.abrupt("return");
|
|
3155
|
-
|
|
3156
|
-
case 18:
|
|
3157
|
-
s.goodsListState.discountGoodIndex = [goods.$index];
|
|
3158
|
-
|
|
3159
|
-
case 19:
|
|
3160
|
-
case "end":
|
|
3161
|
-
return _context.stop();
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
}, _callee);
|
|
2501
|
+
}, _callee);
|
|
3165
2502
|
}));
|
|
3166
2503
|
|
|
3167
2504
|
return function (_x) {
|
|
3168
2505
|
return _ref2.apply(this, arguments);
|
|
3169
2506
|
};
|
|
3170
|
-
}())
|
|
2507
|
+
}());
|
|
3171
2508
|
|
|
3172
2509
|
case 6:
|
|
3173
2510
|
case "end":
|
|
@@ -3181,20 +2518,77 @@ var useAddDiscount = (function (goods) {
|
|
|
3181
2518
|
return undefined;
|
|
3182
2519
|
}
|
|
3183
2520
|
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
}
|
|
2521
|
+
if (!(model !== 'prefab')) {
|
|
2522
|
+
return undefined;
|
|
2523
|
+
}
|
|
3188
2524
|
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
}
|
|
2525
|
+
if (!(isAddDiscount !== false)) {
|
|
2526
|
+
return undefined;
|
|
2527
|
+
}
|
|
2528
|
+
|
|
2529
|
+
if (goods.lineAttribute !== LineAttributeType$1.正常) {
|
|
2530
|
+
return undefined;
|
|
2531
|
+
}
|
|
2532
|
+
|
|
2533
|
+
return {
|
|
2534
|
+
key: 'addDiscount',
|
|
2535
|
+
title: '折扣',
|
|
2536
|
+
onClick: onClick
|
|
2537
|
+
}; // return React.useMemo(() => {
|
|
2538
|
+
// if (goods.lineAttribute !== LineAttributeType.正常) {
|
|
2539
|
+
// return undefined
|
|
2540
|
+
// }
|
|
2541
|
+
// return (
|
|
2542
|
+
// <Menu.Item key="addDiscount" onClick={onClick}><Text strong>折扣</Text></Menu.Item>
|
|
2543
|
+
// );
|
|
2544
|
+
// }, [onClick, goods.lineAttribute]);
|
|
2545
|
+
});
|
|
2546
|
+
|
|
2547
|
+
var math = mathjs.create(mathjs.all, {
|
|
2548
|
+
number: 'BigNumber',
|
|
2549
|
+
precision: 20
|
|
2550
|
+
});
|
|
2551
|
+
var evaluate = (function (expr) {
|
|
2552
|
+
var fractionDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
|
|
2553
|
+
return parseFloat(math.evaluate(expr).toFixed(fractionDigits));
|
|
3196
2554
|
});
|
|
3197
2555
|
|
|
2556
|
+
/** 拆分全称加简称 */
|
|
2557
|
+
var getSN = function getSN(value) {
|
|
2558
|
+
if (!value) return undefined;
|
|
2559
|
+
var arr = value.match(/\*[^*]+\*/);
|
|
2560
|
+
|
|
2561
|
+
if (arr && arr[0]) {
|
|
2562
|
+
return {
|
|
2563
|
+
shorthand: arr[0].split('*')[1],
|
|
2564
|
+
full: value.replace(arr[0], '')
|
|
2565
|
+
};
|
|
2566
|
+
} else {
|
|
2567
|
+
return {
|
|
2568
|
+
shorthand: undefined,
|
|
2569
|
+
full: value
|
|
2570
|
+
};
|
|
2571
|
+
}
|
|
2572
|
+
};
|
|
2573
|
+
/** 组合全称加简称 */
|
|
2574
|
+
|
|
2575
|
+
var getItemName = function getItemName(value) {
|
|
2576
|
+
if (value.shorthand) {
|
|
2577
|
+
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2578
|
+
} else {
|
|
2579
|
+
return value.full;
|
|
2580
|
+
}
|
|
2581
|
+
};
|
|
2582
|
+
/** 设置简称 */
|
|
2583
|
+
|
|
2584
|
+
var setShorthand = function setShorthand(name, shorthand) {
|
|
2585
|
+
if (!name) return undefined;
|
|
2586
|
+
var sn = getSN(name);
|
|
2587
|
+
if (!sn) return undefined;
|
|
2588
|
+
sn.shorthand = shorthand || '';
|
|
2589
|
+
return getItemName(sn);
|
|
2590
|
+
};
|
|
2591
|
+
|
|
3198
2592
|
//! moment.js
|
|
3199
2593
|
//! version : 2.29.3
|
|
3200
2594
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
@@ -3600,12 +2994,12 @@ function Locale(config) {
|
|
|
3600
2994
|
}
|
|
3601
2995
|
}
|
|
3602
2996
|
|
|
3603
|
-
var keys
|
|
2997
|
+
var keys;
|
|
3604
2998
|
|
|
3605
2999
|
if (Object.keys) {
|
|
3606
|
-
keys
|
|
3000
|
+
keys = Object.keys;
|
|
3607
3001
|
} else {
|
|
3608
|
-
keys
|
|
3002
|
+
keys = function (obj) {
|
|
3609
3003
|
var i,
|
|
3610
3004
|
res = [];
|
|
3611
3005
|
for (i in obj) {
|
|
@@ -5453,7 +4847,7 @@ function getLocale(key) {
|
|
|
5453
4847
|
}
|
|
5454
4848
|
|
|
5455
4849
|
function listLocales() {
|
|
5456
|
-
return keys
|
|
4850
|
+
return keys(locales);
|
|
5457
4851
|
}
|
|
5458
4852
|
|
|
5459
4853
|
function checkOverflow(m) {
|
|
@@ -8873,7 +8267,7 @@ hooks.HTML5_FMT = {
|
|
|
8873
8267
|
|
|
8874
8268
|
/** 延迟函数 */
|
|
8875
8269
|
|
|
8876
|
-
var lazyFn
|
|
8270
|
+
var lazyFn = function lazyFn(fn) {
|
|
8877
8271
|
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
8878
8272
|
var timer;
|
|
8879
8273
|
return function () {
|
|
@@ -8913,7 +8307,7 @@ var promptErr = function promptErr(err) {
|
|
|
8913
8307
|
/** 数量改变了 */
|
|
8914
8308
|
|
|
8915
8309
|
|
|
8916
|
-
var onChangeQuantity = lazyFn
|
|
8310
|
+
var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
8917
8311
|
form.validateFields( /*#__PURE__*/function () {
|
|
8918
8312
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, values) {
|
|
8919
8313
|
var quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
|
|
@@ -9062,7 +8456,7 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
|
|
|
9062
8456
|
}, 1000);
|
|
9063
8457
|
/** 单价(含税) */
|
|
9064
8458
|
|
|
9065
|
-
var onChangePriceIncludeTax = lazyFn
|
|
8459
|
+
var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
9066
8460
|
form.validateFields( /*#__PURE__*/function () {
|
|
9067
8461
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
9068
8462
|
var priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
|
|
@@ -9161,7 +8555,7 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
9161
8555
|
}, 1000);
|
|
9162
8556
|
/** 单价(不含税) */
|
|
9163
8557
|
|
|
9164
|
-
var onChangePriceExcludeTax = lazyFn
|
|
8558
|
+
var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
9165
8559
|
form.validateFields( /*#__PURE__*/function () {
|
|
9166
8560
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
|
|
9167
8561
|
var priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
|
|
@@ -9260,7 +8654,7 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
9260
8654
|
}, 1000);
|
|
9261
8655
|
/** 金额(含税) */
|
|
9262
8656
|
|
|
9263
|
-
var onChangeLineAmountIncludeTax = lazyFn
|
|
8657
|
+
var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
9264
8658
|
form.validateFields( /*#__PURE__*/function () {
|
|
9265
8659
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
|
|
9266
8660
|
var lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
|
|
@@ -9352,7 +8746,7 @@ var onChangeLineAmountIncludeTax = lazyFn$1(function (controller, form, record)
|
|
|
9352
8746
|
}, 1000);
|
|
9353
8747
|
/** 金额(不含税) */
|
|
9354
8748
|
|
|
9355
|
-
var onChangeLineAmountExcludeTax = lazyFn
|
|
8749
|
+
var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
9356
8750
|
form.validateFields( /*#__PURE__*/function () {
|
|
9357
8751
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
|
|
9358
8752
|
var lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
|
|
@@ -9444,7 +8838,7 @@ var onChangeLineAmountExcludeTax = lazyFn$1(function (controller, form, record)
|
|
|
9444
8838
|
}, 1000);
|
|
9445
8839
|
/** 税率 */
|
|
9446
8840
|
|
|
9447
|
-
var onChangeTaxRate = lazyFn
|
|
8841
|
+
var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
9448
8842
|
form.validateFields( /*#__PURE__*/function () {
|
|
9449
8843
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
|
|
9450
8844
|
var taxRate;
|
|
@@ -9830,161 +9224,73 @@ var onChangeItemName = /*#__PURE__*/function () {
|
|
|
9830
9224
|
break;
|
|
9831
9225
|
}
|
|
9832
9226
|
|
|
9833
|
-
_context12.next = 17;
|
|
9834
|
-
return controller.setEditGood({
|
|
9835
|
-
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
9836
|
-
});
|
|
9837
|
-
|
|
9838
|
-
case 17:
|
|
9839
|
-
case "end":
|
|
9840
|
-
return _context12.stop();
|
|
9841
|
-
}
|
|
9842
|
-
}
|
|
9843
|
-
}, _callee12);
|
|
9844
|
-
}));
|
|
9845
|
-
|
|
9846
|
-
return function (_x25) {
|
|
9847
|
-
return _ref13.apply(this, arguments);
|
|
9848
|
-
};
|
|
9849
|
-
}());
|
|
9850
|
-
|
|
9851
|
-
case 1:
|
|
9852
|
-
case "end":
|
|
9853
|
-
return _context13.stop();
|
|
9854
|
-
}
|
|
9855
|
-
}
|
|
9856
|
-
}, _callee13);
|
|
9857
|
-
}));
|
|
9858
|
-
|
|
9859
|
-
return function onChangeItemName(_x22, _x23, _x24) {
|
|
9860
|
-
return _ref12.apply(this, arguments);
|
|
9861
|
-
};
|
|
9862
|
-
}();
|
|
9863
|
-
|
|
9864
|
-
var useEndowCode = (function (goods) {
|
|
9865
|
-
var controller = Invoice.useInvoiceController();
|
|
9866
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9867
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9868
|
-
while (1) {
|
|
9869
|
-
switch (_context.prev = _context.next) {
|
|
9870
|
-
case 0:
|
|
9871
|
-
endowCode(controller, goods);
|
|
9872
|
-
|
|
9873
|
-
case 1:
|
|
9874
|
-
case "end":
|
|
9875
|
-
return _context.stop();
|
|
9876
|
-
}
|
|
9877
|
-
}
|
|
9878
|
-
}, _callee);
|
|
9879
|
-
})), [controller, goods]); // return React.useMemo(() => {
|
|
9880
|
-
// return (
|
|
9881
|
-
// <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
|
|
9882
|
-
// );
|
|
9883
|
-
// }, [goods.lineAttribute, onClick])
|
|
9884
|
-
|
|
9885
|
-
return React__default['default'].useMemo(function () {
|
|
9886
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
9887
|
-
key: "endowCode",
|
|
9888
|
-
type: "link",
|
|
9889
|
-
onClick: onClick
|
|
9890
|
-
}, "\u8D4B\u7801");
|
|
9891
|
-
}, [goods.lineAttribute, onClick]);
|
|
9892
|
-
});
|
|
9893
|
-
|
|
9894
|
-
var Text$3 = ktsComponentsAntdX3.Typography.Text;
|
|
9895
|
-
var useAddComparison = (function (goods) {
|
|
9896
|
-
var controller = Invoice.useInvoiceController();
|
|
9897
|
-
var productComparison = controller.useMemo(function (s) {
|
|
9898
|
-
return s.goodsListState.productComparison;
|
|
9899
|
-
}, []);
|
|
9900
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
9901
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9902
|
-
while (1) {
|
|
9903
|
-
switch (_context2.prev = _context2.next) {
|
|
9904
|
-
case 0:
|
|
9905
|
-
_context2.next = 2;
|
|
9906
|
-
return controller.saveEditGood();
|
|
9907
|
-
|
|
9908
|
-
case 2:
|
|
9909
|
-
_context2.next = 4;
|
|
9910
|
-
return controller.wait();
|
|
9911
|
-
|
|
9912
|
-
case 4:
|
|
9913
|
-
_context2.next = 6;
|
|
9914
|
-
return controller.run( /*#__PURE__*/function () {
|
|
9915
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
9916
|
-
var err, key;
|
|
9917
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9918
|
-
while (1) {
|
|
9919
|
-
switch (_context.prev = _context.next) {
|
|
9920
|
-
case 0:
|
|
9921
|
-
if (!s.goodsListState.form) {
|
|
9922
|
-
_context.next = 11;
|
|
9923
|
-
break;
|
|
9924
|
-
}
|
|
9925
|
-
|
|
9926
|
-
err = s.goodsListState.form.getFieldsError();
|
|
9927
|
-
_context.t0 = _regeneratorRuntime().keys(err);
|
|
9928
|
-
|
|
9929
|
-
case 3:
|
|
9930
|
-
if ((_context.t1 = _context.t0()).done) {
|
|
9931
|
-
_context.next = 11;
|
|
9932
|
-
break;
|
|
9933
|
-
}
|
|
9934
|
-
|
|
9935
|
-
key = _context.t1.value;
|
|
9936
|
-
|
|
9937
|
-
if (err[key]) {
|
|
9938
|
-
_context.next = 7;
|
|
9939
|
-
break;
|
|
9940
|
-
}
|
|
9941
|
-
|
|
9942
|
-
return _context.abrupt("continue", 3);
|
|
9943
|
-
|
|
9944
|
-
case 7:
|
|
9945
|
-
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
9946
|
-
return _context.abrupt("return");
|
|
9947
|
-
|
|
9948
|
-
case 11:
|
|
9949
|
-
s.goodsListState.addComparisonIndex = goods.$index;
|
|
9227
|
+
_context12.next = 17;
|
|
9228
|
+
return controller.setEditGood({
|
|
9229
|
+
itemNameSelf: setShorthand(record.itemNameSelf, shorthand)
|
|
9230
|
+
});
|
|
9950
9231
|
|
|
9951
|
-
case
|
|
9232
|
+
case 17:
|
|
9952
9233
|
case "end":
|
|
9953
|
-
return
|
|
9234
|
+
return _context12.stop();
|
|
9954
9235
|
}
|
|
9955
9236
|
}
|
|
9956
|
-
},
|
|
9237
|
+
}, _callee12);
|
|
9957
9238
|
}));
|
|
9958
9239
|
|
|
9959
|
-
return function (
|
|
9960
|
-
return
|
|
9240
|
+
return function (_x25) {
|
|
9241
|
+
return _ref13.apply(this, arguments);
|
|
9961
9242
|
};
|
|
9962
9243
|
}());
|
|
9963
9244
|
|
|
9964
|
-
case
|
|
9245
|
+
case 1:
|
|
9965
9246
|
case "end":
|
|
9966
|
-
return
|
|
9247
|
+
return _context13.stop();
|
|
9967
9248
|
}
|
|
9968
9249
|
}
|
|
9969
|
-
},
|
|
9970
|
-
}))
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9250
|
+
}, _callee13);
|
|
9251
|
+
}));
|
|
9252
|
+
|
|
9253
|
+
return function onChangeItemName(_x22, _x23, _x24) {
|
|
9254
|
+
return _ref12.apply(this, arguments);
|
|
9255
|
+
};
|
|
9256
|
+
}();
|
|
9257
|
+
|
|
9258
|
+
var useEndowCode = (function (goods) {
|
|
9259
|
+
var controller = Invoice.useInvoiceController();
|
|
9260
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9261
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9262
|
+
while (1) {
|
|
9263
|
+
switch (_context.prev = _context.next) {
|
|
9264
|
+
case 0:
|
|
9265
|
+
endowCode(controller, goods);
|
|
9266
|
+
|
|
9267
|
+
case 1:
|
|
9268
|
+
case "end":
|
|
9269
|
+
return _context.stop();
|
|
9270
|
+
}
|
|
9271
|
+
}
|
|
9272
|
+
}, _callee);
|
|
9273
|
+
})), [controller, goods]);
|
|
9274
|
+
return {
|
|
9275
|
+
key: 'endowCode',
|
|
9276
|
+
title: '赋码',
|
|
9277
|
+
onClick: onClick
|
|
9278
|
+
}; // return React.useMemo(() => {
|
|
9279
|
+
// return (
|
|
9280
|
+
// <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
|
|
9281
|
+
// );
|
|
9282
|
+
// }, [goods.lineAttribute, onClick])
|
|
9283
|
+
// return React.useMemo(() => {
|
|
9284
|
+
// return (
|
|
9285
|
+
// <Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
|
|
9286
|
+
// );
|
|
9287
|
+
// }, [goods.lineAttribute, onClick])
|
|
9983
9288
|
});
|
|
9984
9289
|
|
|
9985
|
-
var css_248z$
|
|
9986
|
-
styleInject(css_248z$
|
|
9290
|
+
var css_248z$5 = ".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";
|
|
9291
|
+
styleInject(css_248z$5);
|
|
9987
9292
|
|
|
9293
|
+
var Text$1 = ktsComponentsAntdX3.Typography.Text;
|
|
9988
9294
|
var RowMenu = (function (props) {
|
|
9989
9295
|
var controller = Invoice.useInvoiceController();
|
|
9990
9296
|
var model = controller.useMemo(function (s) {
|
|
@@ -10000,16 +9306,16 @@ var RowMenu = (function (props) {
|
|
|
10000
9306
|
}, []);
|
|
10001
9307
|
var delItem = useDelItem(props.goods);
|
|
10002
9308
|
var addDiscount = useAddDiscount(props.goods);
|
|
10003
|
-
var endowCode = useEndowCode(props.goods);
|
|
10004
|
-
|
|
9309
|
+
var endowCode = useEndowCode(props.goods); // const addComparison = useAddComparison(props.goods);
|
|
9310
|
+
|
|
10005
9311
|
var itemList = React__default['default'].useMemo(function () {
|
|
10006
9312
|
var arr = [];
|
|
10007
|
-
|
|
9313
|
+
endowCode && arr.push(endowCode); // 赋码
|
|
10008
9314
|
|
|
10009
|
-
arr.push(
|
|
10010
|
-
// endowCode && arr.push(endowCode); // 赋码
|
|
9315
|
+
addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
10011
9316
|
|
|
10012
|
-
|
|
9317
|
+
delItem && arr.push(delItem); // 删除
|
|
9318
|
+
// addComparison && arr.push(addComparison); // 添加商品对照
|
|
10013
9319
|
|
|
10014
9320
|
if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
|
|
10015
9321
|
arr.unshift(React__default['default'].createElement(ktsComponentsAntdX3.Menu.Divider, {
|
|
@@ -10023,13 +9329,51 @@ var RowMenu = (function (props) {
|
|
|
10023
9329
|
|
|
10024
9330
|
return arr;
|
|
10025
9331
|
}, [controller, endowCode, addDiscount, delItem, goodsMenuExpand, props.goods, model, isAddDiscount]);
|
|
9332
|
+
var overlay = React__default['default'].useMemo(function () {
|
|
9333
|
+
if (itemList.length <= 2) {
|
|
9334
|
+
return undefined;
|
|
9335
|
+
}
|
|
9336
|
+
|
|
9337
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu, null, itemList.slice(2).map(function (e) {
|
|
9338
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
9339
|
+
key: e.key,
|
|
9340
|
+
onClick: e.onClick
|
|
9341
|
+
}, React__default['default'].createElement(Text$1, {
|
|
9342
|
+
strong: true
|
|
9343
|
+
}, e.title));
|
|
9344
|
+
}));
|
|
9345
|
+
}, [itemList]);
|
|
9346
|
+
var buttonList = React__default['default'].useMemo(function () {
|
|
9347
|
+
return React__default['default'].createElement("div", {
|
|
9348
|
+
style: {
|
|
9349
|
+
flex: 1,
|
|
9350
|
+
textAlign: 'left',
|
|
9351
|
+
display: 'flex',
|
|
9352
|
+
gap: 10
|
|
9353
|
+
}
|
|
9354
|
+
}, itemList.slice(0, 2).map(function (e) {
|
|
9355
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
9356
|
+
key: e.key,
|
|
9357
|
+
type: 'link',
|
|
9358
|
+
onClick: e.onClick,
|
|
9359
|
+
style: {
|
|
9360
|
+
padding: 0
|
|
9361
|
+
}
|
|
9362
|
+
}, e.title);
|
|
9363
|
+
}));
|
|
9364
|
+
}, [itemList]);
|
|
10026
9365
|
|
|
10027
9366
|
if (itemList.length === 0) {
|
|
10028
9367
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10029
9368
|
}
|
|
10030
9369
|
|
|
10031
|
-
return React__default['default'].createElement("span",
|
|
10032
|
-
|
|
9370
|
+
return React__default['default'].createElement("span", {
|
|
9371
|
+
style: {
|
|
9372
|
+
padding: '0 0 0 10px',
|
|
9373
|
+
display: 'flex'
|
|
9374
|
+
}
|
|
9375
|
+
}, buttonList, overlay && React__default['default'].createElement(ktsComponentsAntdX3.Dropdown, {
|
|
9376
|
+
overlay: overlay,
|
|
10033
9377
|
trigger: ['click']
|
|
10034
9378
|
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10035
9379
|
className: "kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only",
|
|
@@ -10039,7 +9383,7 @@ var RowMenu = (function (props) {
|
|
|
10039
9383
|
}))));
|
|
10040
9384
|
});
|
|
10041
9385
|
|
|
10042
|
-
var Text$
|
|
9386
|
+
var Text$2 = ktsComponentsAntdX3.Typography.Text;
|
|
10043
9387
|
var useColumns = (function (form) {
|
|
10044
9388
|
var getFieldDecorator = form.getFieldDecorator,
|
|
10045
9389
|
getFieldValue = form.getFieldValue;
|
|
@@ -10090,14 +9434,24 @@ var useColumns = (function (form) {
|
|
|
10090
9434
|
|
|
10091
9435
|
var columns = React__default['default'].useMemo(function () {
|
|
10092
9436
|
return [{
|
|
10093
|
-
title:
|
|
9437
|
+
title: '序号',
|
|
9438
|
+
key: 'serialNo',
|
|
9439
|
+
dataIndex: 'serialNo',
|
|
9440
|
+
width: 50,
|
|
9441
|
+
render: function render(e) {
|
|
9442
|
+
return React__default['default'].createElement("span", {
|
|
9443
|
+
style: {
|
|
9444
|
+
padding: '0 10px'
|
|
9445
|
+
}
|
|
9446
|
+
}, e);
|
|
9447
|
+
}
|
|
9448
|
+
}, {
|
|
9449
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10094
9450
|
type: "danger"
|
|
10095
|
-
}, "*"), "\
|
|
9451
|
+
}, "*"), "\u9879\u76EE\u540D\u79F0"),
|
|
10096
9452
|
key: 'itemName',
|
|
10097
9453
|
render: function render(_, record) {
|
|
10098
9454
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
10099
|
-
var _editGood$itemName;
|
|
10100
|
-
|
|
10101
9455
|
return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, React__default['default'].createElement("div", {
|
|
10102
9456
|
style: {
|
|
10103
9457
|
display: 'flex'
|
|
@@ -10154,13 +9508,9 @@ var useColumns = (function (form) {
|
|
|
10154
9508
|
}
|
|
10155
9509
|
})), React__default['default'].createElement("div", {
|
|
10156
9510
|
className: "kts-invoice-operate-goods-list-able-list-itemName-import"
|
|
10157
|
-
},
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
},
|
|
10161
|
-
type: "link",
|
|
10162
|
-
icon: "file-add"
|
|
10163
|
-
}), controller.getGoodsList && React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
9511
|
+
}, controller.getGoodsList && React__default['default'].createElement(ktsComponentsAntdX3.Tooltip, {
|
|
9512
|
+
title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F"
|
|
9513
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10164
9514
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
10165
9515
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
10166
9516
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -10183,7 +9533,7 @@ var useColumns = (function (form) {
|
|
|
10183
9533
|
}()),
|
|
10184
9534
|
type: "link",
|
|
10185
9535
|
icon: "plus-circle"
|
|
10186
|
-
}))));
|
|
9536
|
+
})))));
|
|
10187
9537
|
} else {
|
|
10188
9538
|
return React__default['default'].createElement(MyItemNameDiv, {
|
|
10189
9539
|
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
@@ -10288,7 +9638,11 @@ var useColumns = (function (form) {
|
|
|
10288
9638
|
}()
|
|
10289
9639
|
})));
|
|
10290
9640
|
} else {
|
|
10291
|
-
return
|
|
9641
|
+
return React__default['default'].createElement("span", {
|
|
9642
|
+
style: {
|
|
9643
|
+
padding: '0 10px'
|
|
9644
|
+
}
|
|
9645
|
+
}, record.unit);
|
|
10292
9646
|
}
|
|
10293
9647
|
}
|
|
10294
9648
|
}, {
|
|
@@ -10508,7 +9862,7 @@ var useColumns = (function (form) {
|
|
|
10508
9862
|
}
|
|
10509
9863
|
}
|
|
10510
9864
|
}, {
|
|
10511
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
9865
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10512
9866
|
type: "danger"
|
|
10513
9867
|
}, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
|
|
10514
9868
|
dataIndex: 'lineAmountIncludeTax',
|
|
@@ -10595,7 +9949,7 @@ var useColumns = (function (form) {
|
|
|
10595
9949
|
}
|
|
10596
9950
|
}
|
|
10597
9951
|
}, {
|
|
10598
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
9952
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10599
9953
|
type: "danger"
|
|
10600
9954
|
}, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
10601
9955
|
dataIndex: 'lineAmountExcludeTax',
|
|
@@ -10657,9 +10011,9 @@ var useColumns = (function (form) {
|
|
|
10657
10011
|
}
|
|
10658
10012
|
}
|
|
10659
10013
|
}, {
|
|
10660
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
10014
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10661
10015
|
type: "danger"
|
|
10662
|
-
}, "*"), "\u7A0E\u7387"),
|
|
10016
|
+
}, "*"), "\u7A0E\u7387%"),
|
|
10663
10017
|
dataIndex: 'taxRate',
|
|
10664
10018
|
key: 'taxRate',
|
|
10665
10019
|
align: 'right',
|
|
@@ -10725,10 +10079,9 @@ var useColumns = (function (form) {
|
|
|
10725
10079
|
}
|
|
10726
10080
|
}, {
|
|
10727
10081
|
title: '操作',
|
|
10728
|
-
dataIndex: 'operating',
|
|
10729
10082
|
key: 'operating',
|
|
10730
|
-
|
|
10731
|
-
|
|
10083
|
+
align: 'right',
|
|
10084
|
+
width: 110,
|
|
10732
10085
|
render: function render(_value, record) {
|
|
10733
10086
|
return React__default['default'].createElement(RowMenu, {
|
|
10734
10087
|
key: record.lineAttribute,
|
|
@@ -11350,154 +10703,654 @@ var useRowSelection = (function () {
|
|
|
11350
10703
|
var goods = s.goodsListState.goodsMap.get($index);
|
|
11351
10704
|
if (!goods || goods.lineAttribute === LineAttributeType$1.正常) return; // 数组位置
|
|
11352
10705
|
|
|
11353
|
-
var t = s.goodsListState.goodsList.indexOf(goods);
|
|
11354
|
-
goods.lineAttribute === LineAttributeType$1.折扣行 ? t-- : t++;
|
|
11355
|
-
var i = s.goodsListState.goodsList[t].$index;
|
|
10706
|
+
var t = s.goodsListState.goodsList.indexOf(goods);
|
|
10707
|
+
goods.lineAttribute === LineAttributeType$1.折扣行 ? t-- : t++;
|
|
10708
|
+
var i = s.goodsListState.goodsList[t].$index;
|
|
10709
|
+
|
|
10710
|
+
if (selected) {
|
|
10711
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(i) < 0) s.goodsListState.selectedGoodIndex = [].concat(_toConsumableArray(s.goodsListState.selectedGoodIndex), [i]);
|
|
10712
|
+
} else {
|
|
10713
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(i) < 0) s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(function (e) {
|
|
10714
|
+
return e !== $index;
|
|
10715
|
+
});
|
|
10716
|
+
}
|
|
10717
|
+
});
|
|
10718
|
+
|
|
10719
|
+
case 1:
|
|
10720
|
+
case "end":
|
|
10721
|
+
return _context7.stop();
|
|
10722
|
+
}
|
|
10723
|
+
}
|
|
10724
|
+
}, _callee7);
|
|
10725
|
+
}));
|
|
10726
|
+
|
|
10727
|
+
return function (_x8) {
|
|
10728
|
+
return _ref8.apply(this, arguments);
|
|
10729
|
+
};
|
|
10730
|
+
}())();
|
|
10731
|
+
|
|
10732
|
+
case 4:
|
|
10733
|
+
case "end":
|
|
10734
|
+
return _context8.stop();
|
|
10735
|
+
}
|
|
10736
|
+
}
|
|
10737
|
+
}, _callee8);
|
|
10738
|
+
}));
|
|
10739
|
+
|
|
10740
|
+
return function (_x7) {
|
|
10741
|
+
return _ref7.apply(this, arguments);
|
|
10742
|
+
};
|
|
10743
|
+
}(), [controller]);
|
|
10744
|
+
React__default['default'].useEffect(function () {
|
|
10745
|
+
sortOut(true);
|
|
10746
|
+
}, [sortOut, goodsList]);
|
|
10747
|
+
return {
|
|
10748
|
+
columnWidth: 45,
|
|
10749
|
+
columnTitle: columnTitle,
|
|
10750
|
+
onSelect: onSelect,
|
|
10751
|
+
selectedRowKeys: selectedRowKeys
|
|
10752
|
+
};
|
|
10753
|
+
});
|
|
10754
|
+
|
|
10755
|
+
var css_248z$6 = ".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";
|
|
10756
|
+
styleInject(css_248z$6);
|
|
10757
|
+
|
|
10758
|
+
var keys$1 = {};
|
|
10759
|
+
/**
|
|
10760
|
+
* 有冷却时间的函数
|
|
10761
|
+
* @param fn 方法
|
|
10762
|
+
* @param key 方法key
|
|
10763
|
+
* @param delayed 冷却时间
|
|
10764
|
+
*/
|
|
10765
|
+
|
|
10766
|
+
var coolingFn = (function () {
|
|
10767
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
10768
|
+
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
10769
|
+
var fn = arguments.length > 2 ? arguments[2] : undefined;
|
|
10770
|
+
|
|
10771
|
+
if (keys$1[key]) {
|
|
10772
|
+
return;
|
|
10773
|
+
} else {
|
|
10774
|
+
fn();
|
|
10775
|
+
keys$1[key] = setTimeout(function () {
|
|
10776
|
+
delete keys$1[key];
|
|
10777
|
+
}, delayed);
|
|
10778
|
+
}
|
|
10779
|
+
});
|
|
10780
|
+
|
|
10781
|
+
var useEndowCodeButton = (function () {
|
|
10782
|
+
var controller = Invoice.useInvoiceController();
|
|
10783
|
+
/** 是否禁用 */
|
|
10784
|
+
|
|
10785
|
+
var disabled = controller.useMemo(function (s) {
|
|
10786
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
10787
|
+
}, []);
|
|
10788
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
10789
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10790
|
+
while (1) {
|
|
10791
|
+
switch (_context2.prev = _context2.next) {
|
|
10792
|
+
case 0:
|
|
10793
|
+
_context2.next = 2;
|
|
10794
|
+
return controller.saveEditGood();
|
|
10795
|
+
|
|
10796
|
+
case 2:
|
|
10797
|
+
_context2.next = 4;
|
|
10798
|
+
return controller.wait();
|
|
10799
|
+
|
|
10800
|
+
case 4:
|
|
10801
|
+
_context2.next = 6;
|
|
10802
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
10803
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10804
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10805
|
+
while (1) {
|
|
10806
|
+
switch (_context.prev = _context.next) {
|
|
10807
|
+
case 0:
|
|
10808
|
+
if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
|
|
10809
|
+
_context.next = 3;
|
|
10810
|
+
break;
|
|
10811
|
+
}
|
|
10812
|
+
|
|
10813
|
+
coolingFn('不能给正在编辑的货物赋码', 3000, function () {
|
|
10814
|
+
ktsComponentsAntdX3.message.error('不能给正在编辑的货物赋码');
|
|
10815
|
+
});
|
|
10816
|
+
return _context.abrupt("return");
|
|
10817
|
+
|
|
10818
|
+
case 3:
|
|
10819
|
+
if (!s.goodsListState.selectedGoodIndex.map(function (e) {
|
|
10820
|
+
return s.goodsListState.goodsMap.get(e);
|
|
10821
|
+
}).some(function (e, _, arr) {
|
|
10822
|
+
var _arr$;
|
|
10823
|
+
|
|
10824
|
+
return (e === null || e === void 0 ? void 0 : e.taxRate) !== ((_arr$ = arr[0]) === null || _arr$ === void 0 ? void 0 : _arr$.taxRate);
|
|
10825
|
+
})) {
|
|
10826
|
+
_context.next = 6;
|
|
10827
|
+
break;
|
|
10828
|
+
}
|
|
10829
|
+
|
|
10830
|
+
coolingFn('商品税率不一致不能操作批量赋码', 3000, function () {
|
|
10831
|
+
ktsComponentsAntdX3.message.error('商品税率不一致不能操作批量赋码');
|
|
10832
|
+
});
|
|
10833
|
+
return _context.abrupt("return");
|
|
10834
|
+
|
|
10835
|
+
case 6:
|
|
10836
|
+
// 设置赋码
|
|
10837
|
+
s.goodsListState.endowCode.endowcodeGoodIndex = s.goodsListState.selectedGoodIndex;
|
|
10838
|
+
|
|
10839
|
+
case 7:
|
|
10840
|
+
case "end":
|
|
10841
|
+
return _context.stop();
|
|
10842
|
+
}
|
|
10843
|
+
}
|
|
10844
|
+
}, _callee);
|
|
10845
|
+
}));
|
|
10846
|
+
|
|
10847
|
+
return function (_x) {
|
|
10848
|
+
return _ref2.apply(this, arguments);
|
|
10849
|
+
};
|
|
10850
|
+
}())();
|
|
10851
|
+
|
|
10852
|
+
case 6:
|
|
10853
|
+
case "end":
|
|
10854
|
+
return _context2.stop();
|
|
10855
|
+
}
|
|
10856
|
+
}
|
|
10857
|
+
}, _callee2);
|
|
10858
|
+
})), [controller]);
|
|
10859
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
10860
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10861
|
+
key: "2",
|
|
10862
|
+
onClick: onClick,
|
|
10863
|
+
disabled: disabled
|
|
10864
|
+
}, "\u6279\u91CF\u8D4B\u7801");
|
|
10865
|
+
}, [onClick, disabled]);
|
|
10866
|
+
var button = React__default['default'].useMemo(function () {
|
|
10867
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10868
|
+
onClick: onClick,
|
|
10869
|
+
disabled: disabled
|
|
10870
|
+
}, "\u6279\u91CF\u8D4B\u7801");
|
|
10871
|
+
}, [onClick, disabled]);
|
|
10872
|
+
return {
|
|
10873
|
+
menuItem: menuItem,
|
|
10874
|
+
button: button
|
|
10875
|
+
};
|
|
10876
|
+
});
|
|
10877
|
+
|
|
10878
|
+
var useDelRowButton = (function () {
|
|
10879
|
+
var controller = Invoice.useInvoiceController();
|
|
10880
|
+
var model = controller.useMemo(function (s) {
|
|
10881
|
+
return s.model;
|
|
10882
|
+
}, []);
|
|
10883
|
+
/** 是否禁用 */
|
|
11356
10884
|
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
10885
|
+
var disabled = controller.useMemo(function (s) {
|
|
10886
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
10887
|
+
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
10888
|
+
var good = s.goodsListState.goodsMap.get(e);
|
|
10889
|
+
if (!good) return true;
|
|
10890
|
+
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
10891
|
+
});
|
|
10892
|
+
}, []);
|
|
10893
|
+
var onClick = React__default['default'].useCallback(function () {
|
|
10894
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
10895
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10896
|
+
var goodsList;
|
|
10897
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10898
|
+
while (1) {
|
|
10899
|
+
switch (_context.prev = _context.next) {
|
|
10900
|
+
case 0:
|
|
10901
|
+
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
10902
|
+
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
10903
|
+
});
|
|
11365
10904
|
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
}, _callee7);
|
|
11372
|
-
}));
|
|
10905
|
+
if (s.goodsListState.editGood) {
|
|
10906
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
|
|
10907
|
+
controller.setEditGood();
|
|
10908
|
+
}
|
|
10909
|
+
}
|
|
11373
10910
|
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
10911
|
+
s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
|
|
10912
|
+
goodsList: goodsList,
|
|
10913
|
+
selectedGoodIndex: []
|
|
10914
|
+
});
|
|
11378
10915
|
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
10916
|
+
case 3:
|
|
10917
|
+
case "end":
|
|
10918
|
+
return _context.stop();
|
|
10919
|
+
}
|
|
11382
10920
|
}
|
|
11383
|
-
}
|
|
11384
|
-
}
|
|
11385
|
-
}));
|
|
10921
|
+
}, _callee);
|
|
10922
|
+
}));
|
|
11386
10923
|
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
10924
|
+
return function (_x) {
|
|
10925
|
+
return _ref.apply(this, arguments);
|
|
10926
|
+
};
|
|
10927
|
+
}())();
|
|
10928
|
+
}, [controller]);
|
|
10929
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
10930
|
+
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10931
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10932
|
+
key: "1",
|
|
10933
|
+
onClick: onClick,
|
|
10934
|
+
disabled: disabled
|
|
10935
|
+
}, "\u5220\u9664\u884C");
|
|
10936
|
+
}, [model, onClick, disabled]);
|
|
10937
|
+
var button = React__default['default'].useMemo(function () {
|
|
10938
|
+
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10939
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10940
|
+
onClick: onClick,
|
|
10941
|
+
disabled: disabled
|
|
10942
|
+
}, "\u6279\u91CF\u5220\u9664");
|
|
10943
|
+
}, [model, onClick, disabled]);
|
|
11394
10944
|
return {
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
10945
|
+
button: button,
|
|
10946
|
+
menuItem: menuItem
|
|
10947
|
+
};
|
|
10948
|
+
});
|
|
10949
|
+
|
|
10950
|
+
/** 延迟函数 */
|
|
10951
|
+
var lazyFn$1 = (function (fn) {
|
|
10952
|
+
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
10953
|
+
// let timer: any = 0;
|
|
10954
|
+
// return (...par: any[]) => {
|
|
10955
|
+
// if (timer === 0) {
|
|
10956
|
+
// timer = setTimeout(() => {
|
|
10957
|
+
// fn.apply(null, par);
|
|
10958
|
+
// timer = 0;
|
|
10959
|
+
// }, delayed);
|
|
10960
|
+
// }
|
|
10961
|
+
// }
|
|
10962
|
+
var timer;
|
|
10963
|
+
return function () {
|
|
10964
|
+
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10965
|
+
par[_key] = arguments[_key];
|
|
10966
|
+
}
|
|
10967
|
+
|
|
10968
|
+
if (timer) return;
|
|
10969
|
+
timer = setTimeout(function () {
|
|
10970
|
+
timer = undefined;
|
|
10971
|
+
fn.apply(null, par);
|
|
10972
|
+
}, delayed);
|
|
11399
10973
|
};
|
|
11400
10974
|
});
|
|
11401
10975
|
|
|
11402
|
-
var css_248z$7 = ".kts-invoice-operate-goods-list
|
|
10976
|
+
var css_248z$7 = ".kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body {\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body .ktsAnt3x-drawer-body {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body .ktsAnt3x-drawer-body .add-discount-row-body {\n flex: 1;\n overflow: auto;\n}\n.kts-invoice-operate-goods-list-add-discount-row .ktsAnt3x-drawer-wrapper-body .ktsAnt3x-drawer-body .add-discount-row-footer {\n flex: none;\n}\n";
|
|
11403
10977
|
styleInject(css_248z$7);
|
|
11404
10978
|
|
|
11405
|
-
var
|
|
10979
|
+
var Text$3 = ktsComponentsAntdX3.Typography.Text;
|
|
10980
|
+
|
|
10981
|
+
var _create = mathjs.create(mathjs.all, {
|
|
10982
|
+
number: 'BigNumber',
|
|
10983
|
+
precision: 20
|
|
10984
|
+
}),
|
|
10985
|
+
chain = _create.chain;
|
|
10986
|
+
|
|
10987
|
+
var useAddDiscountRowButton = (function () {
|
|
10988
|
+
/** 控制器 */
|
|
11406
10989
|
var controller = Invoice.useInvoiceController();
|
|
11407
|
-
|
|
10990
|
+
var model = controller.useMemo(function (s) {
|
|
10991
|
+
return s.model;
|
|
10992
|
+
}, []);
|
|
10993
|
+
/** 是否能添加折扣行 */
|
|
10994
|
+
|
|
10995
|
+
var isAddDiscount = controller.useMemo(function (s) {
|
|
10996
|
+
return s.goodsListState.isAddDiscount;
|
|
10997
|
+
}, []);
|
|
10998
|
+
/** 是否开启抽屉 */
|
|
10999
|
+
|
|
11000
|
+
var visible = controller.useMemo(function (s) {
|
|
11001
|
+
return s.goodsListState.discountGoodIndex.length > 0;
|
|
11002
|
+
}, []);
|
|
11003
|
+
/** 是否禁用 按钮 */
|
|
11408
11004
|
|
|
11409
11005
|
var disabled = controller.useMemo(function (s) {
|
|
11410
|
-
if (s.goodsListState.selectedGoodIndex.length <= 0)
|
|
11006
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) {
|
|
11007
|
+
return true;
|
|
11008
|
+
}
|
|
11009
|
+
|
|
11010
|
+
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
11011
|
+
var good = s.goodsListState.goodsMap.get(e);
|
|
11012
|
+
if (!good) return true;
|
|
11013
|
+
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
11014
|
+
});
|
|
11411
11015
|
}, []);
|
|
11412
|
-
|
|
11413
|
-
|
|
11016
|
+
/** 关闭抽屉 */
|
|
11017
|
+
|
|
11018
|
+
var onClose = React__default['default'].useCallback(function () {
|
|
11019
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
11020
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
11021
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11022
|
+
while (1) {
|
|
11023
|
+
switch (_context.prev = _context.next) {
|
|
11024
|
+
case 0:
|
|
11025
|
+
s.goodsListState.discountGoodIndex = [];
|
|
11026
|
+
|
|
11027
|
+
case 1:
|
|
11028
|
+
case "end":
|
|
11029
|
+
return _context.stop();
|
|
11030
|
+
}
|
|
11031
|
+
}
|
|
11032
|
+
}, _callee);
|
|
11033
|
+
}));
|
|
11034
|
+
|
|
11035
|
+
return function (_x) {
|
|
11036
|
+
return _ref.apply(this, arguments);
|
|
11037
|
+
};
|
|
11038
|
+
}())();
|
|
11039
|
+
}, []);
|
|
11040
|
+
/** 点击了 添加折扣行 按钮 */
|
|
11041
|
+
|
|
11042
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
11043
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11414
11044
|
while (1) {
|
|
11415
|
-
switch (
|
|
11045
|
+
switch (_context3.prev = _context3.next) {
|
|
11416
11046
|
case 0:
|
|
11417
|
-
|
|
11047
|
+
_context3.next = 2;
|
|
11418
11048
|
return controller.saveEditGood();
|
|
11419
11049
|
|
|
11420
11050
|
case 2:
|
|
11421
|
-
|
|
11051
|
+
_context3.next = 4;
|
|
11422
11052
|
return controller.wait();
|
|
11423
11053
|
|
|
11424
11054
|
case 4:
|
|
11425
|
-
|
|
11055
|
+
_context3.next = 6;
|
|
11426
11056
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
11427
|
-
var
|
|
11428
|
-
|
|
11057
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
11058
|
+
var isOk;
|
|
11059
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11429
11060
|
while (1) {
|
|
11430
|
-
switch (
|
|
11061
|
+
switch (_context2.prev = _context2.next) {
|
|
11431
11062
|
case 0:
|
|
11432
|
-
|
|
11433
|
-
|
|
11063
|
+
isOk = s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0;
|
|
11064
|
+
|
|
11065
|
+
if (!isOk) {
|
|
11066
|
+
_context2.next = 4;
|
|
11434
11067
|
break;
|
|
11435
11068
|
}
|
|
11436
11069
|
|
|
11437
|
-
|
|
11438
|
-
|
|
11070
|
+
ktsComponentsAntdX3.message.error({
|
|
11071
|
+
content: '不能给编辑状态的行增加折扣!',
|
|
11072
|
+
key: '不能给编辑状态的行增加折扣!'
|
|
11439
11073
|
});
|
|
11440
|
-
return
|
|
11074
|
+
return _context2.abrupt("return");
|
|
11441
11075
|
|
|
11442
|
-
case
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11076
|
+
case 4:
|
|
11077
|
+
isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
|
|
11078
|
+
var good = s.goodsListState.goodsMap.get($index);
|
|
11079
|
+
return !good || good.taxRate === 0 && !good.taxFreeType;
|
|
11080
|
+
});
|
|
11447
11081
|
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
_context.next = 6;
|
|
11082
|
+
if (!isOk) {
|
|
11083
|
+
_context2.next = 8;
|
|
11451
11084
|
break;
|
|
11452
11085
|
}
|
|
11453
11086
|
|
|
11454
|
-
|
|
11455
|
-
|
|
11087
|
+
ktsComponentsAntdX3.message.error({
|
|
11088
|
+
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
11089
|
+
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
11090
|
+
});
|
|
11091
|
+
return _context2.abrupt("return");
|
|
11092
|
+
|
|
11093
|
+
case 8:
|
|
11094
|
+
isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
|
|
11095
|
+
var good = s.goodsListState.goodsMap.get($index);
|
|
11096
|
+
return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
|
|
11097
|
+
});
|
|
11098
|
+
|
|
11099
|
+
if (!isOk) {
|
|
11100
|
+
_context2.next = 12;
|
|
11101
|
+
break;
|
|
11102
|
+
}
|
|
11103
|
+
|
|
11104
|
+
ktsComponentsAntdX3.message.error({
|
|
11105
|
+
content: '金额为0不能添加折扣行',
|
|
11106
|
+
key: '金额为0不能添加折扣行'
|
|
11456
11107
|
});
|
|
11457
|
-
return
|
|
11108
|
+
return _context2.abrupt("return");
|
|
11458
11109
|
|
|
11459
|
-
case
|
|
11460
|
-
|
|
11461
|
-
s.goodsListState.endowCode.endowcodeGoodIndex = s.goodsListState.selectedGoodIndex;
|
|
11110
|
+
case 12:
|
|
11111
|
+
s.goodsListState.discountGoodIndex = s.goodsListState.selectedGoodIndex.slice();
|
|
11462
11112
|
|
|
11463
|
-
case
|
|
11113
|
+
case 13:
|
|
11464
11114
|
case "end":
|
|
11465
|
-
return
|
|
11115
|
+
return _context2.stop();
|
|
11466
11116
|
}
|
|
11467
11117
|
}
|
|
11468
|
-
},
|
|
11118
|
+
}, _callee2);
|
|
11469
11119
|
}));
|
|
11470
11120
|
|
|
11471
|
-
return function (
|
|
11472
|
-
return
|
|
11121
|
+
return function (_x2) {
|
|
11122
|
+
return _ref3.apply(this, arguments);
|
|
11473
11123
|
};
|
|
11474
11124
|
}())();
|
|
11475
11125
|
|
|
11476
11126
|
case 6:
|
|
11477
11127
|
case "end":
|
|
11478
|
-
return
|
|
11128
|
+
return _context3.stop();
|
|
11479
11129
|
}
|
|
11480
11130
|
}
|
|
11481
|
-
},
|
|
11131
|
+
}, _callee3);
|
|
11482
11132
|
})), [controller]);
|
|
11483
11133
|
var menuItem = React__default['default'].useMemo(function () {
|
|
11484
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
11485
|
-
key: "
|
|
11486
|
-
onClick: onClick,
|
|
11487
|
-
disabled: disabled
|
|
11488
|
-
}, "\u6279\u91CF\u8D4B\u7801");
|
|
11489
|
-
}, [onClick, disabled]);
|
|
11490
|
-
var buuton = React__default['default'].useMemo(function () {
|
|
11491
|
-
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11134
|
+
return model === 'prefab' ? React__default['default'].createElement(React__default['default'].Fragment, null) : isAddDiscount !== false ? React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
11135
|
+
key: "0",
|
|
11492
11136
|
onClick: onClick,
|
|
11493
11137
|
disabled: disabled
|
|
11494
|
-
}, "\
|
|
11495
|
-
}, [
|
|
11138
|
+
}, "\u6DFB\u52A0\u6298\u6263\u884C") : undefined;
|
|
11139
|
+
}, [isAddDiscount, disabled, onClick]);
|
|
11140
|
+
var drawer = React__default['default'].useMemo(function () {
|
|
11141
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Drawer, {
|
|
11142
|
+
className: "kts-invoice-operate-goods-list-add-discount-row",
|
|
11143
|
+
width: 540,
|
|
11144
|
+
title: "\u6DFB\u52A0\u6298\u6263\u884C",
|
|
11145
|
+
placement: "right",
|
|
11146
|
+
destroyOnClose: true,
|
|
11147
|
+
onClose: onClose,
|
|
11148
|
+
visible: visible
|
|
11149
|
+
}, React__default['default'].createElement(DrawerBody, null));
|
|
11150
|
+
}, [visible, onClose]);
|
|
11496
11151
|
return {
|
|
11497
11152
|
menuItem: menuItem,
|
|
11498
|
-
|
|
11153
|
+
drawer: drawer
|
|
11499
11154
|
};
|
|
11500
11155
|
});
|
|
11156
|
+
var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
11157
|
+
var form = props.form;
|
|
11158
|
+
var getFieldDecorator = form.getFieldDecorator;
|
|
11159
|
+
var controller = Invoice.useInvoiceController();
|
|
11160
|
+
/** 选中的货物索引列表 */
|
|
11161
|
+
|
|
11162
|
+
var discountGoodIndex = controller.useMemo(function (s) {
|
|
11163
|
+
return s.goodsListState.discountGoodIndex;
|
|
11164
|
+
}, []);
|
|
11165
|
+
/** 金额合计 */
|
|
11166
|
+
|
|
11167
|
+
var lineAmountSum = controller.useMemo(function (s) {
|
|
11168
|
+
var sum = chain(0);
|
|
11169
|
+
|
|
11170
|
+
if (s.goodsListState.isTaxIncluded) {
|
|
11171
|
+
s.goodsListState.discountGoodIndex.forEach(function (e) {
|
|
11172
|
+
var goods = s.goodsListState.goodsMap.get(e);
|
|
11173
|
+
sum = sum.add((goods === null || goods === void 0 ? void 0 : goods.lineAmountIncludeTax) || 0);
|
|
11174
|
+
});
|
|
11175
|
+
} else {
|
|
11176
|
+
s.goodsListState.discountGoodIndex.forEach(function (e) {
|
|
11177
|
+
var goods = s.goodsListState.goodsMap.get(e);
|
|
11178
|
+
sum = sum.add((goods === null || goods === void 0 ? void 0 : goods.lineAmountExcludeTax) || 0);
|
|
11179
|
+
});
|
|
11180
|
+
}
|
|
11181
|
+
|
|
11182
|
+
return sum.done();
|
|
11183
|
+
}, []);
|
|
11184
|
+
/** 关闭抽屉 */
|
|
11185
|
+
|
|
11186
|
+
var onClose = React__default['default'].useCallback(function () {
|
|
11187
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
11188
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
11189
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
11190
|
+
while (1) {
|
|
11191
|
+
switch (_context4.prev = _context4.next) {
|
|
11192
|
+
case 0:
|
|
11193
|
+
s.goodsListState.discountGoodIndex = [];
|
|
11194
|
+
|
|
11195
|
+
case 1:
|
|
11196
|
+
case "end":
|
|
11197
|
+
return _context4.stop();
|
|
11198
|
+
}
|
|
11199
|
+
}
|
|
11200
|
+
}, _callee4);
|
|
11201
|
+
}));
|
|
11202
|
+
|
|
11203
|
+
return function (_x3) {
|
|
11204
|
+
return _ref4.apply(this, arguments);
|
|
11205
|
+
};
|
|
11206
|
+
}())();
|
|
11207
|
+
}, []);
|
|
11208
|
+
/** 点击了保存 */
|
|
11209
|
+
|
|
11210
|
+
var onClickSave = React__default['default'].useCallback(function () {
|
|
11211
|
+
form.validateFields(function (err, values) {
|
|
11212
|
+
if (err) return;
|
|
11213
|
+
var discolineAmountunt = parseFloat(parseFloat(values.discolineAmountunt).toFixed(2));
|
|
11214
|
+
var discount = parseFloat(parseFloat(values.discount).toFixed(4));
|
|
11215
|
+
var indexList = discountGoodIndex;
|
|
11216
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
11217
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
11218
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
11219
|
+
while (1) {
|
|
11220
|
+
switch (_context5.prev = _context5.next) {
|
|
11221
|
+
case 0:
|
|
11222
|
+
s.goodsListState.discountGoodIndex = [];
|
|
11223
|
+
|
|
11224
|
+
case 1:
|
|
11225
|
+
case "end":
|
|
11226
|
+
return _context5.stop();
|
|
11227
|
+
}
|
|
11228
|
+
}
|
|
11229
|
+
}, _callee5);
|
|
11230
|
+
}));
|
|
11231
|
+
|
|
11232
|
+
return function (_x4) {
|
|
11233
|
+
return _ref5.apply(this, arguments);
|
|
11234
|
+
};
|
|
11235
|
+
}())();
|
|
11236
|
+
controller.addGoodDiscount({
|
|
11237
|
+
indexList: indexList,
|
|
11238
|
+
discount: discount,
|
|
11239
|
+
discolineAmountunt: discolineAmountunt
|
|
11240
|
+
});
|
|
11241
|
+
});
|
|
11242
|
+
}, [controller, form, discountGoodIndex]);
|
|
11243
|
+
/** 折扣率变化 */
|
|
11244
|
+
|
|
11245
|
+
var onChangeDiscount = React__default['default'].useCallback(lazyFn$1(function (e) {
|
|
11246
|
+
form.validateFields(function (err, values) {
|
|
11247
|
+
if (err && err.discount) return;
|
|
11248
|
+
var discolineAmountunt = evaluate("".concat(lineAmountSum, " * (").concat(values.discount, "/100)")).toFixed(2);
|
|
11249
|
+
form.setFieldsValue({
|
|
11250
|
+
discolineAmountunt: discolineAmountunt
|
|
11251
|
+
});
|
|
11252
|
+
});
|
|
11253
|
+
}, 300), [form, lineAmountSum]);
|
|
11254
|
+
/** 折扣变化 */
|
|
11255
|
+
|
|
11256
|
+
var onChangeDiscolineAmountunt = React__default['default'].useCallback(lazyFn$1(function (e) {
|
|
11257
|
+
form.validateFields(function (err, values) {
|
|
11258
|
+
if (err && err.discolineAmountunt) return;
|
|
11259
|
+
var discolineAmountunt = parseFloat(values.discolineAmountunt).toFixed(2);
|
|
11260
|
+
var discount = evaluate("(".concat(discolineAmountunt, " / ").concat(lineAmountSum, ") * 100")).toFixed(4);
|
|
11261
|
+
form.setFieldsValue({
|
|
11262
|
+
discount: discount
|
|
11263
|
+
});
|
|
11264
|
+
});
|
|
11265
|
+
}, 300), [form, lineAmountSum]);
|
|
11266
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement("div", {
|
|
11267
|
+
className: "add-discount-row-body"
|
|
11268
|
+
}, React__default['default'].createElement("p", null, "\u5F53\u524D\u9009\u62E9", React__default['default'].createElement(Text$3, {
|
|
11269
|
+
type: "danger"
|
|
11270
|
+
}, discountGoodIndex.length), "\u884C\u88AB\u6298\u6263\u5546\u54C1\u884C\uFF0C\u91D1\u989D\u5408\u8BA1\xA5", React__default['default'].createElement(Text$3, {
|
|
11271
|
+
type: "danger"
|
|
11272
|
+
}, lineAmountSum.toFixed(2))), React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
11273
|
+
label: "\u6298\u6263\u7387\uFF1A"
|
|
11274
|
+
}, getFieldDecorator('discount', {
|
|
11275
|
+
rules: [{
|
|
11276
|
+
required: true,
|
|
11277
|
+
message: '请输入折扣金额'
|
|
11278
|
+
}, {
|
|
11279
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
11280
|
+
message: '请输入数字'
|
|
11281
|
+
}, {
|
|
11282
|
+
validator: function validator(_, value, callback) {
|
|
11283
|
+
var _value$match;
|
|
11284
|
+
|
|
11285
|
+
if (!value) {
|
|
11286
|
+
callback();
|
|
11287
|
+
return;
|
|
11288
|
+
}
|
|
11289
|
+
|
|
11290
|
+
if (!((_value$match = value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)) === null || _value$match === void 0 ? void 0 : _value$match.length)) {
|
|
11291
|
+
callback();
|
|
11292
|
+
return;
|
|
11293
|
+
}
|
|
11294
|
+
|
|
11295
|
+
if (parseFloat(value) > 100 || parseFloat(value) < 0) {
|
|
11296
|
+
callback('请输入大于0小于100的数字');
|
|
11297
|
+
}
|
|
11298
|
+
|
|
11299
|
+
callback();
|
|
11300
|
+
}
|
|
11301
|
+
}]
|
|
11302
|
+
})(React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
11303
|
+
placeholder: "\u8BF7\u8F93\u5165\u5927\u4E8E0\u5C0F\u4E8E100\u7684\u6570\u5B57",
|
|
11304
|
+
suffix: "%",
|
|
11305
|
+
onChange: onChangeDiscount
|
|
11306
|
+
}))), React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
11307
|
+
label: "\u6298\u6263\u91D1\u989D\uFF1A"
|
|
11308
|
+
}, getFieldDecorator('discolineAmountunt', {
|
|
11309
|
+
rules: [{
|
|
11310
|
+
required: true,
|
|
11311
|
+
message: '请输入折扣金额'
|
|
11312
|
+
}, {
|
|
11313
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
11314
|
+
message: '请输入数字'
|
|
11315
|
+
}, {
|
|
11316
|
+
validator: function validator(_, value, callback) {
|
|
11317
|
+
var _value$match2;
|
|
11318
|
+
|
|
11319
|
+
if (!value) {
|
|
11320
|
+
callback();
|
|
11321
|
+
return;
|
|
11322
|
+
}
|
|
11323
|
+
|
|
11324
|
+
if (!((_value$match2 = value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)) === null || _value$match2 === void 0 ? void 0 : _value$match2.length)) {
|
|
11325
|
+
callback();
|
|
11326
|
+
return;
|
|
11327
|
+
}
|
|
11328
|
+
|
|
11329
|
+
if (parseFloat(value) > lineAmountSum || parseFloat(value) < 0) {
|
|
11330
|
+
callback('请输入大于0小于金额合计的数字');
|
|
11331
|
+
}
|
|
11332
|
+
|
|
11333
|
+
callback();
|
|
11334
|
+
}
|
|
11335
|
+
}]
|
|
11336
|
+
})(React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
11337
|
+
placeholder: "\u8BF7\u8F93\u5165\u5927\u4E8E0\u5C0F\u4E8E\u91D1\u989D\u5408\u8BA1\u7684\u6570\u5B57",
|
|
11338
|
+
suffix: "\xA5",
|
|
11339
|
+
onChange: onChangeDiscolineAmountunt
|
|
11340
|
+
})))), React__default['default'].createElement("div", {
|
|
11341
|
+
className: "add-discount-row-footer"
|
|
11342
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11343
|
+
block: true,
|
|
11344
|
+
style: {
|
|
11345
|
+
marginBottom: 12
|
|
11346
|
+
},
|
|
11347
|
+
onClick: onClose
|
|
11348
|
+
}, "\u53D6\u6D88"), React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11349
|
+
type: "primary",
|
|
11350
|
+
block: true,
|
|
11351
|
+
onClick: onClickSave
|
|
11352
|
+
}, "\u4FDD\u5B58")));
|
|
11353
|
+
});
|
|
11501
11354
|
|
|
11502
11355
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
11503
11356
|
_inherits(GoodsList, _React$Component);
|
|
@@ -11549,6 +11402,12 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11549
11402
|
/** 批量赋码 */
|
|
11550
11403
|
|
|
11551
11404
|
var endowCodeButton = useEndowCodeButton();
|
|
11405
|
+
/** 批量删除 */
|
|
11406
|
+
|
|
11407
|
+
var delRowButton = useDelRowButton();
|
|
11408
|
+
/** 添加折扣行 */
|
|
11409
|
+
|
|
11410
|
+
var addDiscountRowButton = useAddDiscountRowButton();
|
|
11552
11411
|
/** 清空自动赋码缓存 */
|
|
11553
11412
|
|
|
11554
11413
|
React__default['default'].useEffect(function () {
|
|
@@ -11706,7 +11565,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11706
11565
|
className: "kts-invoice-operate-goods-list-able"
|
|
11707
11566
|
}, React__default['default'].createElement("div", {
|
|
11708
11567
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
11709
|
-
}, React__default['default'].createElement(AddRowButton, null),
|
|
11568
|
+
}, React__default['default'].createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, addDiscountRowButton.drawer, React__default['default'].createElement(Search, null)), React__default['default'].createElement("div", {
|
|
11710
11569
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
11711
11570
|
}, props.menuExpansion, React__default['default'].createElement(DescribeSwitch, null), React__default['default'].createElement(TaxIncludedSwitch, null))), React__default['default'].createElement("div", {
|
|
11712
11571
|
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
@@ -11738,6 +11597,19 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11738
11597
|
})), React__default['default'].createElement("div", null, React__default['default'].createElement(Statistics, null)));
|
|
11739
11598
|
});
|
|
11740
11599
|
|
|
11600
|
+
/** 更新 商品序号 */
|
|
11601
|
+
|
|
11602
|
+
function useToGenerateId(controller) {
|
|
11603
|
+
var goodsList = controller.useMemo(function (s) {
|
|
11604
|
+
return s.goodsListState.goodsList;
|
|
11605
|
+
}, []);
|
|
11606
|
+
React__default['default'].useEffect(function () {
|
|
11607
|
+
goodsList.forEach(function (e, i) {
|
|
11608
|
+
e.serialNo = i + 1;
|
|
11609
|
+
});
|
|
11610
|
+
}, [goodsList]);
|
|
11611
|
+
}
|
|
11612
|
+
|
|
11741
11613
|
var css_248z$8 = ".kts-invoice-operate-seller {\n display: flex;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message {\n flex: 1;\n display: flex;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .ktsAnt3x-descriptions-item-label {\n width: 179px;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list {\n width: 100%;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-descriptions-view {\n border: none;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-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-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-descriptions-item-label::before {\n content: '*';\n position: relative;\n color: red;\n font-weight: bold;\n margin-right: 2px;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-descriptions-item-content {\n padding: 0;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-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: 30px;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-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-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-descriptions-item-content .has-error .ktsAnt3x-input,\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-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-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-form-item {\n margin: 0;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-form-item-control {\n line-height: 0;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-message .kts-invoice-operate-seller-message-list .ktsAnt3x-form-explain {\n position: absolute;\n right: 5px;\n top: 6px;\n z-index: 10;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-remarks {\n border-left: 1px solid #dcdcdc;\n display: flex;\n flex: none;\n width: 458px;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-remarks-value {\n flex: 1;\n display: flex;\n flex-direction: column;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-remarks-value textarea {\n flex: 1;\n margin-bottom: 0;\n border: none;\n border-radius: 0;\n}\n.kts-invoice-operate-seller .kts-invoice-operate-seller-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-seller .kts-invoice-operate-seller-title label {\n display: table-cell;\n vertical-align: middle;\n}\n";
|
|
11742
11614
|
styleInject(css_248z$8);
|
|
11743
11615
|
|
|
@@ -12209,7 +12081,7 @@ function interval(i, t) {
|
|
|
12209
12081
|
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";
|
|
12210
12082
|
styleInject(css_248z$a);
|
|
12211
12083
|
|
|
12212
|
-
var Text$
|
|
12084
|
+
var Text$4 = ktsComponentsAntdX3.Typography.Text;
|
|
12213
12085
|
|
|
12214
12086
|
var Buyer$1 = /*#__PURE__*/function (_React$Component) {
|
|
12215
12087
|
_inherits(Buyer, _React$Component);
|
|
@@ -12323,7 +12195,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
12323
12195
|
if (e.options.rules.some(function (e) {
|
|
12324
12196
|
return e.required;
|
|
12325
12197
|
})) {
|
|
12326
|
-
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
12198
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$4, {
|
|
12327
12199
|
type: "danger"
|
|
12328
12200
|
}, "*"), e.label);
|
|
12329
12201
|
} else {
|
|
@@ -13535,7 +13407,7 @@ function AddComparisonDrawer() {
|
|
|
13535
13407
|
good.itemName = shorthand ? "*".concat(shorthand, "*").concat(values.itemName) : values.itemName;
|
|
13536
13408
|
good.itemNameSelf = shorthand ? "*".concat(shorthand, "*").concat(values.itemNameSelf) : values.itemNameSelf;
|
|
13537
13409
|
|
|
13538
|
-
if (good.lineAttribute
|
|
13410
|
+
if (good.lineAttribute !== LineAttributeType$1.折扣行) {
|
|
13539
13411
|
good.itemModelName = values.itemModelName;
|
|
13540
13412
|
good.itemModelNameSelf = values.itemModelNameSelf;
|
|
13541
13413
|
}
|
|
@@ -13702,9 +13574,11 @@ var Main$3 = function Main(props) {
|
|
|
13702
13574
|
key = _React$useState2[0],
|
|
13703
13575
|
setKey = _React$useState2[1];
|
|
13704
13576
|
|
|
13577
|
+
useToGenerateId(controller);
|
|
13705
13578
|
React__default['default'].useEffect(function () {
|
|
13706
13579
|
setKey(key + 1);
|
|
13707
13580
|
}, [controller]);
|
|
13581
|
+
React__default['default'].useEffect(function () {}, []);
|
|
13708
13582
|
return React__default['default'].createElement(InvoiceContext.Provider, {
|
|
13709
13583
|
key: key,
|
|
13710
13584
|
value: controller
|