kts-component-invoice-operate 2.0.22 → 3.0.1
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/EndowCode/index.d.ts +1 -1
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.d.ts +3 -1
- package/dist/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.d.ts +5 -5
- package/dist/Invoice/InvoiceController/fns/addGoodDiscount.d.ts +1 -1
- package/dist/Invoice/InvoiceController/fns/delGood.d.ts +1 -1
- package/dist/Invoice/InvoiceController/index.d.ts +1 -1
- package/dist/Invoice/index.d.ts +1 -1
- package/dist/Invoice/tools/idGenerator/index.d.ts +1 -1
- 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/useRowSelection/index.d.ts +1 -1
- 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 +915 -1038
- package/dist/index.js +914 -1037
- package/docs-dist/umi.css +2 -3
- package/docs-dist/umi.js +1 -1
- package/package.json +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/EndowCode/index.tsx +1 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/IGood/index.ts +4 -1
- package/src/Invoice/InvoiceController/InvoiceControllerState/GoodsListState/index.ts +5 -5
- package/src/Invoice/InvoiceController/fns/addGoodDiscount.ts +1 -1
- package/src/Invoice/InvoiceController/fns/delGood.ts +2 -4
- package/src/Invoice/index.tsx +13 -18
- package/src/Invoice/tools/idGenerator/index.ts +3 -2
- package/src/Invoice/ui/GoodsList/hook/useColumns/autoFillFn/index.ts +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 +34 -11
- 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 +53 -19
- package/src/Invoice/ui/GoodsList/hook/useOnRow/index.tsx +0 -1
- package/src/Invoice/ui/GoodsList/hook/useToGenerateId/index.ts +9 -0
- package/src/Invoice/ui/GoodsList/index.less +5 -1
- 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/GoodsList/ui/TableRow/index.tsx +13 -4
- package/src/Invoice/ui/ImportGoodsDrawer/index.tsx +58 -63
package/dist/index.js
CHANGED
|
@@ -1226,9 +1226,8 @@ var delGood = /*#__PURE__*/(function () {
|
|
|
1226
1226
|
};
|
|
1227
1227
|
})();
|
|
1228
1228
|
|
|
1229
|
-
var id = 1;
|
|
1230
1229
|
var idGenerator = (function () {
|
|
1231
|
-
return
|
|
1230
|
+
return uuid.v4();
|
|
1232
1231
|
});
|
|
1233
1232
|
|
|
1234
1233
|
/** 格式化 保留2位小数 */
|
|
@@ -2135,7 +2134,6 @@ var AddRowButton = (function () {
|
|
|
2135
2134
|
})), [controller]);
|
|
2136
2135
|
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
2137
2136
|
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
2138
|
-
icon: "plus-circle",
|
|
2139
2137
|
onClick: onClick,
|
|
2140
2138
|
disabled: disabled
|
|
2141
2139
|
}, "\u6DFB\u52A0\u884C");
|
|
@@ -2354,128 +2352,67 @@ function TableRow(props) {
|
|
|
2354
2352
|
var goodsMap = controller.useMemo(function (s) {
|
|
2355
2353
|
return s.goodsListState.goodsMap;
|
|
2356
2354
|
}, []);
|
|
2357
|
-
var
|
|
2355
|
+
var discount = React__default['default'].useMemo(function () {
|
|
2358
2356
|
var i = goodsMap.get(props['data-row-key']);
|
|
2359
|
-
if (!i) return
|
|
2360
|
-
|
|
2357
|
+
if (!i) return undefined;
|
|
2358
|
+
|
|
2359
|
+
if (i.lineAttribute === LineAttributeType$1.折扣行) {
|
|
2360
|
+
return 'kts-invoice-operate-goods-be-discount';
|
|
2361
|
+
} else if (i.lineAttribute === LineAttributeType$1.被折扣行) {
|
|
2362
|
+
return 'kts-invoice-operate-goods-discount';
|
|
2363
|
+
} else {
|
|
2364
|
+
return undefined;
|
|
2365
|
+
}
|
|
2361
2366
|
}, [props['data-row-key'], goodsMap]);
|
|
2362
|
-
return
|
|
2363
|
-
|
|
2364
|
-
|
|
2367
|
+
return (// <tr {...props} className={`${isR ? 'kts-invoice-operate-goods-discount ' : ''}${props.className}`} />
|
|
2368
|
+
React__default['default'].createElement("tr", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2369
|
+
className: classnames__default['default'](props.className, discount)
|
|
2370
|
+
}))
|
|
2371
|
+
);
|
|
2365
2372
|
}
|
|
2366
2373
|
|
|
2367
|
-
var
|
|
2374
|
+
var _defs$1, _path$2;
|
|
2375
|
+
|
|
2376
|
+
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); }
|
|
2377
|
+
|
|
2378
|
+
function SvgSpot(props) {
|
|
2379
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
2380
|
+
className: "spot_svg__icon",
|
|
2381
|
+
viewBox: "0 0 1024 1024",
|
|
2382
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
2383
|
+
}, props), _defs$1 || (_defs$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("style", null))), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
|
|
2384
|
+
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"
|
|
2385
|
+
})));
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
var useDelItem = (function (goods) {
|
|
2368
2389
|
var controller = Invoice.useInvoiceController();
|
|
2369
2390
|
var model = controller.useMemo(function (s) {
|
|
2370
2391
|
return s.model;
|
|
2371
2392
|
}, []);
|
|
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
2393
|
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
|
-
}
|
|
2394
|
+
controller.delGood(goods.$index);
|
|
2395
|
+
}, [controller, goods.$index]);
|
|
2399
2396
|
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
});
|
|
2397
|
+
if (goods.lineAttribute === LineAttributeType$1.被折扣行) {
|
|
2398
|
+
return undefined;
|
|
2399
|
+
}
|
|
2404
2400
|
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
}, _callee);
|
|
2411
|
-
}));
|
|
2401
|
+
if (!(model !== 'prefab')) {
|
|
2402
|
+
return undefined;
|
|
2403
|
+
}
|
|
2412
2404
|
|
|
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
2405
|
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));
|
|
2406
|
+
key: 'delItem',
|
|
2407
|
+
title: '删除',
|
|
2408
|
+
onClick: onClick
|
|
2409
|
+
}; // return React.useMemo(() => {
|
|
2410
|
+
// return <Menu.Item key="delItem" onClick={onClick}><Text strong type="danger">删除</Text></Menu.Item>
|
|
2411
|
+
// }, [onClick])
|
|
2464
2412
|
});
|
|
2465
2413
|
|
|
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
2414
|
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
|
-
/** 控制器 */
|
|
2415
|
+
var useAddDiscount = (function (goods) {
|
|
2479
2416
|
var controller = Invoice.useInvoiceController();
|
|
2480
2417
|
var model = controller.useMemo(function (s) {
|
|
2481
2418
|
return s.model;
|
|
@@ -2485,92 +2422,61 @@ var useAddDiscountRowButton = (function () {
|
|
|
2485
2422
|
var isAddDiscount = controller.useMemo(function (s) {
|
|
2486
2423
|
return s.goodsListState.isAddDiscount;
|
|
2487
2424
|
}, []);
|
|
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
2425
|
/** 点击了 添加折扣行 按钮 */
|
|
2531
2426
|
|
|
2532
|
-
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
2533
|
-
return _regeneratorRuntime().wrap(function
|
|
2427
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
2428
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2534
2429
|
while (1) {
|
|
2535
|
-
switch (
|
|
2430
|
+
switch (_context2.prev = _context2.next) {
|
|
2536
2431
|
case 0:
|
|
2537
|
-
|
|
2538
|
-
return controller.
|
|
2432
|
+
_context2.next = 2;
|
|
2433
|
+
return controller.wait();
|
|
2539
2434
|
|
|
2540
2435
|
case 2:
|
|
2541
|
-
|
|
2542
|
-
return controller.
|
|
2436
|
+
_context2.next = 4;
|
|
2437
|
+
return controller.saveEditGood();
|
|
2543
2438
|
|
|
2544
2439
|
case 4:
|
|
2545
|
-
|
|
2546
|
-
return controller.
|
|
2547
|
-
var
|
|
2548
|
-
var
|
|
2549
|
-
return _regeneratorRuntime().wrap(function
|
|
2440
|
+
_context2.next = 6;
|
|
2441
|
+
return controller.run( /*#__PURE__*/function () {
|
|
2442
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
2443
|
+
var err, key;
|
|
2444
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
2550
2445
|
while (1) {
|
|
2551
|
-
switch (
|
|
2446
|
+
switch (_context.prev = _context.next) {
|
|
2552
2447
|
case 0:
|
|
2553
|
-
|
|
2448
|
+
if (!s.goodsListState.form) {
|
|
2449
|
+
_context.next = 11;
|
|
2450
|
+
break;
|
|
2451
|
+
}
|
|
2554
2452
|
|
|
2555
|
-
|
|
2556
|
-
|
|
2453
|
+
err = s.goodsListState.form.getFieldsError();
|
|
2454
|
+
_context.t0 = _regeneratorRuntime().keys(err);
|
|
2455
|
+
|
|
2456
|
+
case 3:
|
|
2457
|
+
if ((_context.t1 = _context.t0()).done) {
|
|
2458
|
+
_context.next = 11;
|
|
2557
2459
|
break;
|
|
2558
2460
|
}
|
|
2559
2461
|
|
|
2560
|
-
|
|
2561
|
-
content: '不能给编辑状态的行增加折扣!',
|
|
2562
|
-
key: '不能给编辑状态的行增加折扣!'
|
|
2563
|
-
});
|
|
2564
|
-
return _context2.abrupt("return");
|
|
2462
|
+
key = _context.t1.value;
|
|
2565
2463
|
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
});
|
|
2464
|
+
if (err[key]) {
|
|
2465
|
+
_context.next = 7;
|
|
2466
|
+
break;
|
|
2467
|
+
}
|
|
2571
2468
|
|
|
2572
|
-
|
|
2573
|
-
|
|
2469
|
+
return _context.abrupt("continue", 3);
|
|
2470
|
+
|
|
2471
|
+
case 7:
|
|
2472
|
+
ktsComponentsAntdX3.message.error(err[key][0]);
|
|
2473
|
+
return _context.abrupt("return");
|
|
2474
|
+
|
|
2475
|
+
case 11:
|
|
2476
|
+
goods = s.goodsListState.goodsMap.get(goods.$index);
|
|
2477
|
+
|
|
2478
|
+
if (!(goods.taxRate === 0 && !goods.taxFreeType)) {
|
|
2479
|
+
_context.next = 15;
|
|
2574
2480
|
break;
|
|
2575
2481
|
}
|
|
2576
2482
|
|
|
@@ -2578,16 +2484,11 @@ var useAddDiscountRowButton = (function () {
|
|
|
2578
2484
|
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
2579
2485
|
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
2580
2486
|
});
|
|
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
|
-
});
|
|
2487
|
+
return _context.abrupt("return");
|
|
2588
2488
|
|
|
2589
|
-
|
|
2590
|
-
|
|
2489
|
+
case 15:
|
|
2490
|
+
if (!("".concat(goods.lineAmountIncludeTax) === '0')) {
|
|
2491
|
+
_context.next = 18;
|
|
2591
2492
|
break;
|
|
2592
2493
|
}
|
|
2593
2494
|
|
|
@@ -2595,566 +2496,10 @@ var useAddDiscountRowButton = (function () {
|
|
|
2595
2496
|
content: '金额为0不能添加折扣行',
|
|
2596
2497
|
key: '金额为0不能添加折扣行'
|
|
2597
2498
|
});
|
|
2598
|
-
return
|
|
2499
|
+
return _context.abrupt("return");
|
|
2599
2500
|
|
|
2600
|
-
case
|
|
2601
|
-
s.goodsListState.discountGoodIndex =
|
|
2602
|
-
|
|
2603
|
-
case 13:
|
|
2604
|
-
case "end":
|
|
2605
|
-
return _context2.stop();
|
|
2606
|
-
}
|
|
2607
|
-
}
|
|
2608
|
-
}, _callee2);
|
|
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];
|
|
2501
|
+
case 18:
|
|
2502
|
+
s.goodsListState.discountGoodIndex = [goods.$index];
|
|
3158
2503
|
|
|
3159
2504
|
case 19:
|
|
3160
2505
|
case "end":
|
|
@@ -3167,7 +2512,7 @@ var useAddDiscount = (function (goods) {
|
|
|
3167
2512
|
return function (_x) {
|
|
3168
2513
|
return _ref2.apply(this, arguments);
|
|
3169
2514
|
};
|
|
3170
|
-
}())
|
|
2515
|
+
}());
|
|
3171
2516
|
|
|
3172
2517
|
case 6:
|
|
3173
2518
|
case "end":
|
|
@@ -3181,20 +2526,77 @@ var useAddDiscount = (function (goods) {
|
|
|
3181
2526
|
return undefined;
|
|
3182
2527
|
}
|
|
3183
2528
|
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
}
|
|
2529
|
+
if (!(model !== 'prefab')) {
|
|
2530
|
+
return undefined;
|
|
2531
|
+
}
|
|
3188
2532
|
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
}
|
|
2533
|
+
if (!(isAddDiscount !== false)) {
|
|
2534
|
+
return undefined;
|
|
2535
|
+
}
|
|
2536
|
+
|
|
2537
|
+
if (goods.lineAttribute !== LineAttributeType$1.正常) {
|
|
2538
|
+
return undefined;
|
|
2539
|
+
}
|
|
2540
|
+
|
|
2541
|
+
return {
|
|
2542
|
+
key: 'addDiscount',
|
|
2543
|
+
title: '折扣',
|
|
2544
|
+
onClick: onClick
|
|
2545
|
+
}; // return React.useMemo(() => {
|
|
2546
|
+
// if (goods.lineAttribute !== LineAttributeType.正常) {
|
|
2547
|
+
// return undefined
|
|
2548
|
+
// }
|
|
2549
|
+
// return (
|
|
2550
|
+
// <Menu.Item key="addDiscount" onClick={onClick}><Text strong>折扣</Text></Menu.Item>
|
|
2551
|
+
// );
|
|
2552
|
+
// }, [onClick, goods.lineAttribute]);
|
|
2553
|
+
});
|
|
2554
|
+
|
|
2555
|
+
var math = mathjs.create(mathjs.all, {
|
|
2556
|
+
number: 'BigNumber',
|
|
2557
|
+
precision: 20
|
|
2558
|
+
});
|
|
2559
|
+
var evaluate = (function (expr) {
|
|
2560
|
+
var fractionDigits = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 20;
|
|
2561
|
+
return parseFloat(math.evaluate(expr).toFixed(fractionDigits));
|
|
3196
2562
|
});
|
|
3197
2563
|
|
|
2564
|
+
/** 拆分全称加简称 */
|
|
2565
|
+
var getSN = function getSN(value) {
|
|
2566
|
+
if (!value) return undefined;
|
|
2567
|
+
var arr = value.match(/\*[^*]+\*/);
|
|
2568
|
+
|
|
2569
|
+
if (arr && arr[0]) {
|
|
2570
|
+
return {
|
|
2571
|
+
shorthand: arr[0].split('*')[1],
|
|
2572
|
+
full: value.replace(arr[0], '')
|
|
2573
|
+
};
|
|
2574
|
+
} else {
|
|
2575
|
+
return {
|
|
2576
|
+
shorthand: undefined,
|
|
2577
|
+
full: value
|
|
2578
|
+
};
|
|
2579
|
+
}
|
|
2580
|
+
};
|
|
2581
|
+
/** 组合全称加简称 */
|
|
2582
|
+
|
|
2583
|
+
var getItemName = function getItemName(value) {
|
|
2584
|
+
if (value.shorthand) {
|
|
2585
|
+
return "*".concat(value.shorthand, "*").concat(value.full);
|
|
2586
|
+
} else {
|
|
2587
|
+
return value.full;
|
|
2588
|
+
}
|
|
2589
|
+
};
|
|
2590
|
+
/** 设置简称 */
|
|
2591
|
+
|
|
2592
|
+
var setShorthand = function setShorthand(name, shorthand) {
|
|
2593
|
+
if (!name) return undefined;
|
|
2594
|
+
var sn = getSN(name);
|
|
2595
|
+
if (!sn) return undefined;
|
|
2596
|
+
sn.shorthand = shorthand || '';
|
|
2597
|
+
return getItemName(sn);
|
|
2598
|
+
};
|
|
2599
|
+
|
|
3198
2600
|
//! moment.js
|
|
3199
2601
|
//! version : 2.29.3
|
|
3200
2602
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
@@ -3600,12 +3002,12 @@ function Locale(config) {
|
|
|
3600
3002
|
}
|
|
3601
3003
|
}
|
|
3602
3004
|
|
|
3603
|
-
var keys
|
|
3005
|
+
var keys;
|
|
3604
3006
|
|
|
3605
3007
|
if (Object.keys) {
|
|
3606
|
-
keys
|
|
3008
|
+
keys = Object.keys;
|
|
3607
3009
|
} else {
|
|
3608
|
-
keys
|
|
3010
|
+
keys = function (obj) {
|
|
3609
3011
|
var i,
|
|
3610
3012
|
res = [];
|
|
3611
3013
|
for (i in obj) {
|
|
@@ -5453,7 +4855,7 @@ function getLocale(key) {
|
|
|
5453
4855
|
}
|
|
5454
4856
|
|
|
5455
4857
|
function listLocales() {
|
|
5456
|
-
return keys
|
|
4858
|
+
return keys(locales);
|
|
5457
4859
|
}
|
|
5458
4860
|
|
|
5459
4861
|
function checkOverflow(m) {
|
|
@@ -8873,7 +8275,7 @@ hooks.HTML5_FMT = {
|
|
|
8873
8275
|
|
|
8874
8276
|
/** 延迟函数 */
|
|
8875
8277
|
|
|
8876
|
-
var lazyFn
|
|
8278
|
+
var lazyFn = function lazyFn(fn) {
|
|
8877
8279
|
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
8878
8280
|
var timer;
|
|
8879
8281
|
return function () {
|
|
@@ -8913,7 +8315,7 @@ var promptErr = function promptErr(err) {
|
|
|
8913
8315
|
/** 数量改变了 */
|
|
8914
8316
|
|
|
8915
8317
|
|
|
8916
|
-
var onChangeQuantity = lazyFn
|
|
8318
|
+
var onChangeQuantity = lazyFn(function (controller, form, record) {
|
|
8917
8319
|
form.validateFields( /*#__PURE__*/function () {
|
|
8918
8320
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(err, values) {
|
|
8919
8321
|
var quantity, priceIncludeTax, lineAmountIncludeTax, _lineAmountIncludeTax, _priceIncludeTax, priceExcludeTax, lineAmountExcludeTax, _lineAmountExcludeTax, _priceExcludeTax;
|
|
@@ -9062,7 +8464,7 @@ var onChangeQuantity = lazyFn$1(function (controller, form, record) {
|
|
|
9062
8464
|
}, 1000);
|
|
9063
8465
|
/** 单价(含税) */
|
|
9064
8466
|
|
|
9065
|
-
var onChangePriceIncludeTax = lazyFn
|
|
8467
|
+
var onChangePriceIncludeTax = lazyFn(function (controller, form, record) {
|
|
9066
8468
|
form.validateFields( /*#__PURE__*/function () {
|
|
9067
8469
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(err, values) {
|
|
9068
8470
|
var priceIncludeTax, quantity, lineAmountIncludeTax, _lineAmountIncludeTax2, _quantity;
|
|
@@ -9161,7 +8563,7 @@ var onChangePriceIncludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
9161
8563
|
}, 1000);
|
|
9162
8564
|
/** 单价(不含税) */
|
|
9163
8565
|
|
|
9164
|
-
var onChangePriceExcludeTax = lazyFn
|
|
8566
|
+
var onChangePriceExcludeTax = lazyFn(function (controller, form, record) {
|
|
9165
8567
|
form.validateFields( /*#__PURE__*/function () {
|
|
9166
8568
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(err, values) {
|
|
9167
8569
|
var priceExcludeTax, quantity, lineAmountExcludeTax, _lineAmountExcludeTax2, _quantity2;
|
|
@@ -9260,7 +8662,7 @@ var onChangePriceExcludeTax = lazyFn$1(function (controller, form, record) {
|
|
|
9260
8662
|
}, 1000);
|
|
9261
8663
|
/** 金额(含税) */
|
|
9262
8664
|
|
|
9263
|
-
var onChangeLineAmountIncludeTax = lazyFn
|
|
8665
|
+
var onChangeLineAmountIncludeTax = lazyFn(function (controller, form, record) {
|
|
9264
8666
|
form.validateFields( /*#__PURE__*/function () {
|
|
9265
8667
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(err, values) {
|
|
9266
8668
|
var lineAmountIncludeTax, quantity, priceIncludeTax, _priceIncludeTax2, _quantity3;
|
|
@@ -9352,7 +8754,7 @@ var onChangeLineAmountIncludeTax = lazyFn$1(function (controller, form, record)
|
|
|
9352
8754
|
}, 1000);
|
|
9353
8755
|
/** 金额(不含税) */
|
|
9354
8756
|
|
|
9355
|
-
var onChangeLineAmountExcludeTax = lazyFn
|
|
8757
|
+
var onChangeLineAmountExcludeTax = lazyFn(function (controller, form, record) {
|
|
9356
8758
|
form.validateFields( /*#__PURE__*/function () {
|
|
9357
8759
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(err, values) {
|
|
9358
8760
|
var lineAmountExcludeTax, quantity, priceExcludeTax, _priceExcludeTax2, _quantity4;
|
|
@@ -9444,7 +8846,7 @@ var onChangeLineAmountExcludeTax = lazyFn$1(function (controller, form, record)
|
|
|
9444
8846
|
}, 1000);
|
|
9445
8847
|
/** 税率 */
|
|
9446
8848
|
|
|
9447
|
-
var onChangeTaxRate = lazyFn
|
|
8849
|
+
var onChangeTaxRate = lazyFn(function (controller, form, record) {
|
|
9448
8850
|
form.validateFields( /*#__PURE__*/function () {
|
|
9449
8851
|
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(err, values) {
|
|
9450
8852
|
var taxRate;
|
|
@@ -9683,11 +9085,11 @@ var endowCode = /*#__PURE__*/function () {
|
|
|
9683
9085
|
switch (_context11.prev = _context11.next) {
|
|
9684
9086
|
case 0:
|
|
9685
9087
|
_context11.next = 2;
|
|
9686
|
-
return controller.
|
|
9088
|
+
return controller.wait();
|
|
9687
9089
|
|
|
9688
9090
|
case 2:
|
|
9689
9091
|
_context11.next = 4;
|
|
9690
|
-
return controller.
|
|
9092
|
+
return controller.saveEditGood();
|
|
9691
9093
|
|
|
9692
9094
|
case 4:
|
|
9693
9095
|
_context11.next = 6;
|
|
@@ -9840,151 +9242,63 @@ var onChangeItemName = /*#__PURE__*/function () {
|
|
|
9840
9242
|
return _context12.stop();
|
|
9841
9243
|
}
|
|
9842
9244
|
}
|
|
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;
|
|
9950
|
-
|
|
9951
|
-
case 12:
|
|
9952
|
-
case "end":
|
|
9953
|
-
return _context.stop();
|
|
9954
|
-
}
|
|
9955
|
-
}
|
|
9956
|
-
}, _callee);
|
|
9245
|
+
}, _callee12);
|
|
9957
9246
|
}));
|
|
9958
9247
|
|
|
9959
|
-
return function (
|
|
9960
|
-
return
|
|
9248
|
+
return function (_x25) {
|
|
9249
|
+
return _ref13.apply(this, arguments);
|
|
9961
9250
|
};
|
|
9962
9251
|
}());
|
|
9963
9252
|
|
|
9964
|
-
case
|
|
9253
|
+
case 1:
|
|
9965
9254
|
case "end":
|
|
9966
|
-
return
|
|
9255
|
+
return _context13.stop();
|
|
9967
9256
|
}
|
|
9968
9257
|
}
|
|
9969
|
-
},
|
|
9970
|
-
}))
|
|
9971
|
-
|
|
9972
|
-
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
9979
|
-
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9258
|
+
}, _callee13);
|
|
9259
|
+
}));
|
|
9260
|
+
|
|
9261
|
+
return function onChangeItemName(_x22, _x23, _x24) {
|
|
9262
|
+
return _ref12.apply(this, arguments);
|
|
9263
|
+
};
|
|
9264
|
+
}();
|
|
9265
|
+
|
|
9266
|
+
var useEndowCode = (function (goods) {
|
|
9267
|
+
var controller = Invoice.useInvoiceController();
|
|
9268
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
9269
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9270
|
+
while (1) {
|
|
9271
|
+
switch (_context.prev = _context.next) {
|
|
9272
|
+
case 0:
|
|
9273
|
+
endowCode(controller, goods);
|
|
9274
|
+
|
|
9275
|
+
case 1:
|
|
9276
|
+
case "end":
|
|
9277
|
+
return _context.stop();
|
|
9278
|
+
}
|
|
9279
|
+
}
|
|
9280
|
+
}, _callee);
|
|
9281
|
+
})), [controller, goods]);
|
|
9282
|
+
return {
|
|
9283
|
+
key: 'endowCode',
|
|
9284
|
+
title: '赋码',
|
|
9285
|
+
onClick: onClick
|
|
9286
|
+
}; // return React.useMemo(() => {
|
|
9287
|
+
// return (
|
|
9288
|
+
// <Menu.Item key="endowCode" onClick={onClick} ><Text strong>赋码</Text></Menu.Item>
|
|
9289
|
+
// );
|
|
9290
|
+
// }, [goods.lineAttribute, onClick])
|
|
9291
|
+
// return React.useMemo(() => {
|
|
9292
|
+
// return (
|
|
9293
|
+
// <Button key="endowCode" type="link" onClick={onClick} >赋码</Button>
|
|
9294
|
+
// );
|
|
9295
|
+
// }, [goods.lineAttribute, onClick])
|
|
9983
9296
|
});
|
|
9984
9297
|
|
|
9985
|
-
var css_248z$
|
|
9986
|
-
styleInject(css_248z$
|
|
9298
|
+
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";
|
|
9299
|
+
styleInject(css_248z$5);
|
|
9987
9300
|
|
|
9301
|
+
var Text$1 = ktsComponentsAntdX3.Typography.Text;
|
|
9988
9302
|
var RowMenu = (function (props) {
|
|
9989
9303
|
var controller = Invoice.useInvoiceController();
|
|
9990
9304
|
var model = controller.useMemo(function (s) {
|
|
@@ -10000,16 +9314,16 @@ var RowMenu = (function (props) {
|
|
|
10000
9314
|
}, []);
|
|
10001
9315
|
var delItem = useDelItem(props.goods);
|
|
10002
9316
|
var addDiscount = useAddDiscount(props.goods);
|
|
10003
|
-
var endowCode = useEndowCode(props.goods);
|
|
10004
|
-
|
|
9317
|
+
var endowCode = useEndowCode(props.goods); // const addComparison = useAddComparison(props.goods);
|
|
9318
|
+
|
|
10005
9319
|
var itemList = React__default['default'].useMemo(function () {
|
|
10006
9320
|
var arr = [];
|
|
10007
|
-
|
|
9321
|
+
endowCode && arr.push(endowCode); // 赋码
|
|
10008
9322
|
|
|
10009
|
-
|
|
10010
|
-
// endowCode && arr.push(endowCode); // 赋码
|
|
9323
|
+
addDiscount && arr.push(addDiscount); // 添加折扣行
|
|
10011
9324
|
|
|
10012
|
-
|
|
9325
|
+
delItem && arr.push(delItem); // 删除
|
|
9326
|
+
// addComparison && arr.push(addComparison); // 添加商品对照
|
|
10013
9327
|
|
|
10014
9328
|
if (!goodsMenuExpand || goodsMenuExpand.length === 0) return arr;
|
|
10015
9329
|
arr.unshift(React__default['default'].createElement(ktsComponentsAntdX3.Menu.Divider, {
|
|
@@ -10023,13 +9337,51 @@ var RowMenu = (function (props) {
|
|
|
10023
9337
|
|
|
10024
9338
|
return arr;
|
|
10025
9339
|
}, [controller, endowCode, addDiscount, delItem, goodsMenuExpand, props.goods, model, isAddDiscount]);
|
|
9340
|
+
var overlay = React__default['default'].useMemo(function () {
|
|
9341
|
+
if (itemList.length <= 2) {
|
|
9342
|
+
return undefined;
|
|
9343
|
+
}
|
|
9344
|
+
|
|
9345
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu, null, itemList.slice(2).map(function (e) {
|
|
9346
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
9347
|
+
key: e.key,
|
|
9348
|
+
onClick: e.onClick
|
|
9349
|
+
}, React__default['default'].createElement(Text$1, {
|
|
9350
|
+
strong: true
|
|
9351
|
+
}, e.title));
|
|
9352
|
+
}));
|
|
9353
|
+
}, [itemList]);
|
|
9354
|
+
var buttonList = React__default['default'].useMemo(function () {
|
|
9355
|
+
return React__default['default'].createElement("div", {
|
|
9356
|
+
style: {
|
|
9357
|
+
flex: 1,
|
|
9358
|
+
textAlign: 'left',
|
|
9359
|
+
display: 'flex',
|
|
9360
|
+
gap: 10
|
|
9361
|
+
}
|
|
9362
|
+
}, itemList.slice(0, 2).map(function (e) {
|
|
9363
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
9364
|
+
key: e.key,
|
|
9365
|
+
type: 'link',
|
|
9366
|
+
onClick: e.onClick,
|
|
9367
|
+
style: {
|
|
9368
|
+
padding: 0
|
|
9369
|
+
}
|
|
9370
|
+
}, e.title);
|
|
9371
|
+
}));
|
|
9372
|
+
}, [itemList]);
|
|
10026
9373
|
|
|
10027
9374
|
if (itemList.length === 0) {
|
|
10028
9375
|
return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10029
9376
|
}
|
|
10030
9377
|
|
|
10031
|
-
return React__default['default'].createElement("span",
|
|
10032
|
-
|
|
9378
|
+
return React__default['default'].createElement("span", {
|
|
9379
|
+
style: {
|
|
9380
|
+
padding: '0 0 0 10px',
|
|
9381
|
+
display: 'flex'
|
|
9382
|
+
}
|
|
9383
|
+
}, buttonList, overlay && React__default['default'].createElement(ktsComponentsAntdX3.Dropdown, {
|
|
9384
|
+
overlay: overlay,
|
|
10033
9385
|
trigger: ['click']
|
|
10034
9386
|
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10035
9387
|
className: "kts-invoice-operate-goods-list-columns-row-menu ant-btn-icon-only",
|
|
@@ -10039,7 +9391,7 @@ var RowMenu = (function (props) {
|
|
|
10039
9391
|
}))));
|
|
10040
9392
|
});
|
|
10041
9393
|
|
|
10042
|
-
var Text$
|
|
9394
|
+
var Text$2 = ktsComponentsAntdX3.Typography.Text;
|
|
10043
9395
|
var useColumns = (function (form) {
|
|
10044
9396
|
var getFieldDecorator = form.getFieldDecorator,
|
|
10045
9397
|
getFieldValue = form.getFieldValue;
|
|
@@ -10090,14 +9442,24 @@ var useColumns = (function (form) {
|
|
|
10090
9442
|
|
|
10091
9443
|
var columns = React__default['default'].useMemo(function () {
|
|
10092
9444
|
return [{
|
|
10093
|
-
title:
|
|
9445
|
+
title: '序号',
|
|
9446
|
+
key: 'serialNo',
|
|
9447
|
+
dataIndex: 'serialNo',
|
|
9448
|
+
width: 50,
|
|
9449
|
+
render: function render(e) {
|
|
9450
|
+
return React__default['default'].createElement("span", {
|
|
9451
|
+
style: {
|
|
9452
|
+
padding: '0 10px'
|
|
9453
|
+
}
|
|
9454
|
+
}, e);
|
|
9455
|
+
}
|
|
9456
|
+
}, {
|
|
9457
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10094
9458
|
type: "danger"
|
|
10095
|
-
}, "*"), "\
|
|
9459
|
+
}, "*"), "\u9879\u76EE\u540D\u79F0"),
|
|
10096
9460
|
key: 'itemName',
|
|
10097
9461
|
render: function render(_, record) {
|
|
10098
9462
|
if ((editGood === null || editGood === void 0 ? void 0 : editGood.$index) === record.$index) {
|
|
10099
|
-
var _editGood$itemName;
|
|
10100
|
-
|
|
10101
9463
|
return React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, null, React__default['default'].createElement("div", {
|
|
10102
9464
|
style: {
|
|
10103
9465
|
display: 'flex'
|
|
@@ -10154,13 +9516,9 @@ var useColumns = (function (form) {
|
|
|
10154
9516
|
}
|
|
10155
9517
|
})), React__default['default'].createElement("div", {
|
|
10156
9518
|
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, {
|
|
9519
|
+
}, controller.getGoodsList && React__default['default'].createElement(ktsComponentsAntdX3.Tooltip, {
|
|
9520
|
+
title: "\u70B9\u51FB\u4ECE\u5546\u54C1\u7BA1\u7406\u4E2D\u6DFB\u52A0\u5546\u54C1\u4FE1\u606F"
|
|
9521
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10164
9522
|
onClick: controller.pipeline( /*#__PURE__*/function () {
|
|
10165
9523
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
10166
9524
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -10183,7 +9541,7 @@ var useColumns = (function (form) {
|
|
|
10183
9541
|
}()),
|
|
10184
9542
|
type: "link",
|
|
10185
9543
|
icon: "plus-circle"
|
|
10186
|
-
}))));
|
|
9544
|
+
})))));
|
|
10187
9545
|
} else {
|
|
10188
9546
|
return React__default['default'].createElement(MyItemNameDiv, {
|
|
10189
9547
|
valueT: formatSearch(record.itemNameSelf, searchValue),
|
|
@@ -10288,7 +9646,11 @@ var useColumns = (function (form) {
|
|
|
10288
9646
|
}()
|
|
10289
9647
|
})));
|
|
10290
9648
|
} else {
|
|
10291
|
-
return
|
|
9649
|
+
return React__default['default'].createElement("span", {
|
|
9650
|
+
style: {
|
|
9651
|
+
padding: '0 10px'
|
|
9652
|
+
}
|
|
9653
|
+
}, record.unit);
|
|
10292
9654
|
}
|
|
10293
9655
|
}
|
|
10294
9656
|
}, {
|
|
@@ -10508,7 +9870,7 @@ var useColumns = (function (form) {
|
|
|
10508
9870
|
}
|
|
10509
9871
|
}
|
|
10510
9872
|
}, {
|
|
10511
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
9873
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10512
9874
|
type: "danger"
|
|
10513
9875
|
}, "*"), "\u91D1\u989D(\u542B\u7A0E)"),
|
|
10514
9876
|
dataIndex: 'lineAmountIncludeTax',
|
|
@@ -10595,7 +9957,7 @@ var useColumns = (function (form) {
|
|
|
10595
9957
|
}
|
|
10596
9958
|
}
|
|
10597
9959
|
}, {
|
|
10598
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
9960
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10599
9961
|
type: "danger"
|
|
10600
9962
|
}, "*"), "\u91D1\u989D(\u4E0D\u542B\u7A0E)"),
|
|
10601
9963
|
dataIndex: 'lineAmountExcludeTax',
|
|
@@ -10657,9 +10019,9 @@ var useColumns = (function (form) {
|
|
|
10657
10019
|
}
|
|
10658
10020
|
}
|
|
10659
10021
|
}, {
|
|
10660
|
-
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
10022
|
+
title: React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$2, {
|
|
10661
10023
|
type: "danger"
|
|
10662
|
-
}, "*"), "\u7A0E\u7387"),
|
|
10024
|
+
}, "*"), "\u7A0E\u7387%"),
|
|
10663
10025
|
dataIndex: 'taxRate',
|
|
10664
10026
|
key: 'taxRate',
|
|
10665
10027
|
align: 'right',
|
|
@@ -10725,10 +10087,9 @@ var useColumns = (function (form) {
|
|
|
10725
10087
|
}
|
|
10726
10088
|
}, {
|
|
10727
10089
|
title: '操作',
|
|
10728
|
-
dataIndex: 'operating',
|
|
10729
10090
|
key: 'operating',
|
|
10730
|
-
|
|
10731
|
-
|
|
10091
|
+
align: 'right',
|
|
10092
|
+
width: 110,
|
|
10732
10093
|
render: function render(_value, record) {
|
|
10733
10094
|
return React__default['default'].createElement(RowMenu, {
|
|
10734
10095
|
key: record.lineAttribute,
|
|
@@ -10959,7 +10320,7 @@ var useOnRow = (function () {
|
|
|
10959
10320
|
|
|
10960
10321
|
case 5:
|
|
10961
10322
|
if (!editGood) {
|
|
10962
|
-
_context2.next =
|
|
10323
|
+
_context2.next = 14;
|
|
10963
10324
|
break;
|
|
10964
10325
|
}
|
|
10965
10326
|
|
|
@@ -10976,10 +10337,6 @@ var useOnRow = (function () {
|
|
|
10976
10337
|
|
|
10977
10338
|
case 10:
|
|
10978
10339
|
_context2.next = 12;
|
|
10979
|
-
return controller.wait();
|
|
10980
|
-
|
|
10981
|
-
case 12:
|
|
10982
|
-
_context2.next = 14;
|
|
10983
10340
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
10984
10341
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10985
10342
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -11009,15 +10366,15 @@ var useOnRow = (function () {
|
|
|
11009
10366
|
};
|
|
11010
10367
|
}())();
|
|
11011
10368
|
|
|
11012
|
-
case
|
|
11013
|
-
_context2.next =
|
|
10369
|
+
case 12:
|
|
10370
|
+
_context2.next = 16;
|
|
11014
10371
|
break;
|
|
11015
10372
|
|
|
11016
|
-
case
|
|
11017
|
-
_context2.next =
|
|
10373
|
+
case 14:
|
|
10374
|
+
_context2.next = 16;
|
|
11018
10375
|
return controller.setEditGood(record);
|
|
11019
10376
|
|
|
11020
|
-
case
|
|
10377
|
+
case 16:
|
|
11021
10378
|
case "end":
|
|
11022
10379
|
return _context2.stop();
|
|
11023
10380
|
}
|
|
@@ -11350,154 +10707,654 @@ var useRowSelection = (function () {
|
|
|
11350
10707
|
var goods = s.goodsListState.goodsMap.get($index);
|
|
11351
10708
|
if (!goods || goods.lineAttribute === LineAttributeType$1.正常) return; // 数组位置
|
|
11352
10709
|
|
|
11353
|
-
var t = s.goodsListState.goodsList.indexOf(goods);
|
|
11354
|
-
goods.lineAttribute === LineAttributeType$1.折扣行 ? t-- : t++;
|
|
11355
|
-
var i = s.goodsListState.goodsList[t].$index;
|
|
10710
|
+
var t = s.goodsListState.goodsList.indexOf(goods);
|
|
10711
|
+
goods.lineAttribute === LineAttributeType$1.折扣行 ? t-- : t++;
|
|
10712
|
+
var i = s.goodsListState.goodsList[t].$index;
|
|
10713
|
+
|
|
10714
|
+
if (selected) {
|
|
10715
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(i) < 0) s.goodsListState.selectedGoodIndex = [].concat(_toConsumableArray(s.goodsListState.selectedGoodIndex), [i]);
|
|
10716
|
+
} else {
|
|
10717
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(i) < 0) s.goodsListState.selectedGoodIndex = s.goodsListState.selectedGoodIndex.filter(function (e) {
|
|
10718
|
+
return e !== $index;
|
|
10719
|
+
});
|
|
10720
|
+
}
|
|
10721
|
+
});
|
|
10722
|
+
|
|
10723
|
+
case 1:
|
|
10724
|
+
case "end":
|
|
10725
|
+
return _context7.stop();
|
|
10726
|
+
}
|
|
10727
|
+
}
|
|
10728
|
+
}, _callee7);
|
|
10729
|
+
}));
|
|
10730
|
+
|
|
10731
|
+
return function (_x8) {
|
|
10732
|
+
return _ref8.apply(this, arguments);
|
|
10733
|
+
};
|
|
10734
|
+
}())();
|
|
10735
|
+
|
|
10736
|
+
case 4:
|
|
10737
|
+
case "end":
|
|
10738
|
+
return _context8.stop();
|
|
10739
|
+
}
|
|
10740
|
+
}
|
|
10741
|
+
}, _callee8);
|
|
10742
|
+
}));
|
|
10743
|
+
|
|
10744
|
+
return function (_x7) {
|
|
10745
|
+
return _ref7.apply(this, arguments);
|
|
10746
|
+
};
|
|
10747
|
+
}(), [controller]);
|
|
10748
|
+
React__default['default'].useEffect(function () {
|
|
10749
|
+
sortOut(true);
|
|
10750
|
+
}, [sortOut, goodsList]);
|
|
10751
|
+
return {
|
|
10752
|
+
columnWidth: 45,
|
|
10753
|
+
columnTitle: columnTitle,
|
|
10754
|
+
onSelect: onSelect,
|
|
10755
|
+
selectedRowKeys: selectedRowKeys
|
|
10756
|
+
};
|
|
10757
|
+
});
|
|
10758
|
+
|
|
10759
|
+
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-be-discount,\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-discount {\n background: #f5f5f5;\n}\n.kts-invoice-operate-goods-list-table .kts-invoice-operate-goods-be-discount {\n color: #D9001B;\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";
|
|
10760
|
+
styleInject(css_248z$6);
|
|
10761
|
+
|
|
10762
|
+
var keys$1 = {};
|
|
10763
|
+
/**
|
|
10764
|
+
* 有冷却时间的函数
|
|
10765
|
+
* @param fn 方法
|
|
10766
|
+
* @param key 方法key
|
|
10767
|
+
* @param delayed 冷却时间
|
|
10768
|
+
*/
|
|
10769
|
+
|
|
10770
|
+
var coolingFn = (function () {
|
|
10771
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
|
|
10772
|
+
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
10773
|
+
var fn = arguments.length > 2 ? arguments[2] : undefined;
|
|
10774
|
+
|
|
10775
|
+
if (keys$1[key]) {
|
|
10776
|
+
return;
|
|
10777
|
+
} else {
|
|
10778
|
+
fn();
|
|
10779
|
+
keys$1[key] = setTimeout(function () {
|
|
10780
|
+
delete keys$1[key];
|
|
10781
|
+
}, delayed);
|
|
10782
|
+
}
|
|
10783
|
+
});
|
|
10784
|
+
|
|
10785
|
+
var useEndowCodeButton = (function () {
|
|
10786
|
+
var controller = Invoice.useInvoiceController();
|
|
10787
|
+
/** 是否禁用 */
|
|
10788
|
+
|
|
10789
|
+
var disabled = controller.useMemo(function (s) {
|
|
10790
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
10791
|
+
}, []);
|
|
10792
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
10793
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10794
|
+
while (1) {
|
|
10795
|
+
switch (_context2.prev = _context2.next) {
|
|
10796
|
+
case 0:
|
|
10797
|
+
_context2.next = 2;
|
|
10798
|
+
return controller.saveEditGood();
|
|
10799
|
+
|
|
10800
|
+
case 2:
|
|
10801
|
+
_context2.next = 4;
|
|
10802
|
+
return controller.wait();
|
|
10803
|
+
|
|
10804
|
+
case 4:
|
|
10805
|
+
_context2.next = 6;
|
|
10806
|
+
return controller.pipeline( /*#__PURE__*/function () {
|
|
10807
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10808
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10809
|
+
while (1) {
|
|
10810
|
+
switch (_context.prev = _context.next) {
|
|
10811
|
+
case 0:
|
|
10812
|
+
if (!(s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0)) {
|
|
10813
|
+
_context.next = 3;
|
|
10814
|
+
break;
|
|
10815
|
+
}
|
|
10816
|
+
|
|
10817
|
+
coolingFn('不能给正在编辑的货物赋码', 3000, function () {
|
|
10818
|
+
ktsComponentsAntdX3.message.error('不能给正在编辑的货物赋码');
|
|
10819
|
+
});
|
|
10820
|
+
return _context.abrupt("return");
|
|
10821
|
+
|
|
10822
|
+
case 3:
|
|
10823
|
+
if (!s.goodsListState.selectedGoodIndex.map(function (e) {
|
|
10824
|
+
return s.goodsListState.goodsMap.get(e);
|
|
10825
|
+
}).some(function (e, _, arr) {
|
|
10826
|
+
var _arr$;
|
|
10827
|
+
|
|
10828
|
+
return (e === null || e === void 0 ? void 0 : e.taxRate) !== ((_arr$ = arr[0]) === null || _arr$ === void 0 ? void 0 : _arr$.taxRate);
|
|
10829
|
+
})) {
|
|
10830
|
+
_context.next = 6;
|
|
10831
|
+
break;
|
|
10832
|
+
}
|
|
10833
|
+
|
|
10834
|
+
coolingFn('商品税率不一致不能操作批量赋码', 3000, function () {
|
|
10835
|
+
ktsComponentsAntdX3.message.error('商品税率不一致不能操作批量赋码');
|
|
10836
|
+
});
|
|
10837
|
+
return _context.abrupt("return");
|
|
10838
|
+
|
|
10839
|
+
case 6:
|
|
10840
|
+
// 设置赋码
|
|
10841
|
+
s.goodsListState.endowCode.endowcodeGoodIndex = s.goodsListState.selectedGoodIndex;
|
|
10842
|
+
|
|
10843
|
+
case 7:
|
|
10844
|
+
case "end":
|
|
10845
|
+
return _context.stop();
|
|
10846
|
+
}
|
|
10847
|
+
}
|
|
10848
|
+
}, _callee);
|
|
10849
|
+
}));
|
|
10850
|
+
|
|
10851
|
+
return function (_x) {
|
|
10852
|
+
return _ref2.apply(this, arguments);
|
|
10853
|
+
};
|
|
10854
|
+
}())();
|
|
10855
|
+
|
|
10856
|
+
case 6:
|
|
10857
|
+
case "end":
|
|
10858
|
+
return _context2.stop();
|
|
10859
|
+
}
|
|
10860
|
+
}
|
|
10861
|
+
}, _callee2);
|
|
10862
|
+
})), [controller]);
|
|
10863
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
10864
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10865
|
+
key: "2",
|
|
10866
|
+
onClick: onClick,
|
|
10867
|
+
disabled: disabled
|
|
10868
|
+
}, "\u6279\u91CF\u8D4B\u7801");
|
|
10869
|
+
}, [onClick, disabled]);
|
|
10870
|
+
var button = React__default['default'].useMemo(function () {
|
|
10871
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10872
|
+
onClick: onClick,
|
|
10873
|
+
disabled: disabled
|
|
10874
|
+
}, "\u6279\u91CF\u8D4B\u7801");
|
|
10875
|
+
}, [onClick, disabled]);
|
|
10876
|
+
return {
|
|
10877
|
+
menuItem: menuItem,
|
|
10878
|
+
button: button
|
|
10879
|
+
};
|
|
10880
|
+
});
|
|
10881
|
+
|
|
10882
|
+
var useDelRowButton = (function () {
|
|
10883
|
+
var controller = Invoice.useInvoiceController();
|
|
10884
|
+
var model = controller.useMemo(function (s) {
|
|
10885
|
+
return s.model;
|
|
10886
|
+
}, []);
|
|
10887
|
+
/** 是否禁用 */
|
|
11356
10888
|
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
10889
|
+
var disabled = controller.useMemo(function (s) {
|
|
10890
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) return true;
|
|
10891
|
+
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
10892
|
+
var good = s.goodsListState.goodsMap.get(e);
|
|
10893
|
+
if (!good) return true;
|
|
10894
|
+
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
10895
|
+
});
|
|
10896
|
+
}, []);
|
|
10897
|
+
var onClick = React__default['default'].useCallback(function () {
|
|
10898
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
10899
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
10900
|
+
var goodsList;
|
|
10901
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10902
|
+
while (1) {
|
|
10903
|
+
switch (_context.prev = _context.next) {
|
|
10904
|
+
case 0:
|
|
10905
|
+
goodsList = s.goodsListState.goodsList.filter(function (e) {
|
|
10906
|
+
return s.goodsListState.selectedGoodIndex.indexOf(e.$index) < 0;
|
|
10907
|
+
});
|
|
11365
10908
|
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
}, _callee7);
|
|
11372
|
-
}));
|
|
10909
|
+
if (s.goodsListState.editGood) {
|
|
10910
|
+
if (s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0) {
|
|
10911
|
+
controller.setEditGood();
|
|
10912
|
+
}
|
|
10913
|
+
}
|
|
11373
10914
|
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
10915
|
+
s.goodsListState = _objectSpread2(_objectSpread2({}, s.goodsListState), {}, {
|
|
10916
|
+
goodsList: goodsList,
|
|
10917
|
+
selectedGoodIndex: []
|
|
10918
|
+
});
|
|
11378
10919
|
|
|
11379
|
-
|
|
11380
|
-
|
|
11381
|
-
|
|
10920
|
+
case 3:
|
|
10921
|
+
case "end":
|
|
10922
|
+
return _context.stop();
|
|
10923
|
+
}
|
|
11382
10924
|
}
|
|
11383
|
-
}
|
|
11384
|
-
}
|
|
11385
|
-
}));
|
|
10925
|
+
}, _callee);
|
|
10926
|
+
}));
|
|
11386
10927
|
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
10928
|
+
return function (_x) {
|
|
10929
|
+
return _ref.apply(this, arguments);
|
|
10930
|
+
};
|
|
10931
|
+
}())();
|
|
10932
|
+
}, [controller]);
|
|
10933
|
+
var menuItem = React__default['default'].useMemo(function () {
|
|
10934
|
+
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10935
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
10936
|
+
key: "1",
|
|
10937
|
+
onClick: onClick,
|
|
10938
|
+
disabled: disabled
|
|
10939
|
+
}, "\u5220\u9664\u884C");
|
|
10940
|
+
}, [model, onClick, disabled]);
|
|
10941
|
+
var button = React__default['default'].useMemo(function () {
|
|
10942
|
+
if (model === 'prefab') return React__default['default'].createElement(React__default['default'].Fragment, null);
|
|
10943
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
10944
|
+
onClick: onClick,
|
|
10945
|
+
disabled: disabled
|
|
10946
|
+
}, "\u6279\u91CF\u5220\u9664");
|
|
10947
|
+
}, [model, onClick, disabled]);
|
|
11394
10948
|
return {
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
10949
|
+
button: button,
|
|
10950
|
+
menuItem: menuItem
|
|
10951
|
+
};
|
|
10952
|
+
});
|
|
10953
|
+
|
|
10954
|
+
/** 延迟函数 */
|
|
10955
|
+
var lazyFn$1 = (function (fn) {
|
|
10956
|
+
var delayed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200;
|
|
10957
|
+
// let timer: any = 0;
|
|
10958
|
+
// return (...par: any[]) => {
|
|
10959
|
+
// if (timer === 0) {
|
|
10960
|
+
// timer = setTimeout(() => {
|
|
10961
|
+
// fn.apply(null, par);
|
|
10962
|
+
// timer = 0;
|
|
10963
|
+
// }, delayed);
|
|
10964
|
+
// }
|
|
10965
|
+
// }
|
|
10966
|
+
var timer;
|
|
10967
|
+
return function () {
|
|
10968
|
+
for (var _len = arguments.length, par = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10969
|
+
par[_key] = arguments[_key];
|
|
10970
|
+
}
|
|
10971
|
+
|
|
10972
|
+
if (timer) return;
|
|
10973
|
+
timer = setTimeout(function () {
|
|
10974
|
+
timer = undefined;
|
|
10975
|
+
fn.apply(null, par);
|
|
10976
|
+
}, delayed);
|
|
11399
10977
|
};
|
|
11400
10978
|
});
|
|
11401
10979
|
|
|
11402
|
-
var css_248z$7 = ".kts-invoice-operate-goods-list
|
|
10980
|
+
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
10981
|
styleInject(css_248z$7);
|
|
11404
10982
|
|
|
11405
|
-
var
|
|
10983
|
+
var Text$3 = ktsComponentsAntdX3.Typography.Text;
|
|
10984
|
+
|
|
10985
|
+
var _create = mathjs.create(mathjs.all, {
|
|
10986
|
+
number: 'BigNumber',
|
|
10987
|
+
precision: 20
|
|
10988
|
+
}),
|
|
10989
|
+
chain = _create.chain;
|
|
10990
|
+
|
|
10991
|
+
var useAddDiscountRowButton = (function () {
|
|
10992
|
+
/** 控制器 */
|
|
11406
10993
|
var controller = Invoice.useInvoiceController();
|
|
11407
|
-
|
|
10994
|
+
var model = controller.useMemo(function (s) {
|
|
10995
|
+
return s.model;
|
|
10996
|
+
}, []);
|
|
10997
|
+
/** 是否能添加折扣行 */
|
|
10998
|
+
|
|
10999
|
+
var isAddDiscount = controller.useMemo(function (s) {
|
|
11000
|
+
return s.goodsListState.isAddDiscount;
|
|
11001
|
+
}, []);
|
|
11002
|
+
/** 是否开启抽屉 */
|
|
11003
|
+
|
|
11004
|
+
var visible = controller.useMemo(function (s) {
|
|
11005
|
+
return s.goodsListState.discountGoodIndex.length > 0;
|
|
11006
|
+
}, []);
|
|
11007
|
+
/** 是否禁用 按钮 */
|
|
11408
11008
|
|
|
11409
11009
|
var disabled = controller.useMemo(function (s) {
|
|
11410
|
-
if (s.goodsListState.selectedGoodIndex.length <= 0)
|
|
11010
|
+
if (s.goodsListState.selectedGoodIndex.length <= 0) {
|
|
11011
|
+
return true;
|
|
11012
|
+
}
|
|
11013
|
+
|
|
11014
|
+
return s.goodsListState.selectedGoodIndex.some(function (e) {
|
|
11015
|
+
var good = s.goodsListState.goodsMap.get(e);
|
|
11016
|
+
if (!good) return true;
|
|
11017
|
+
return good.lineAttribute !== LineAttributeType$1.正常;
|
|
11018
|
+
});
|
|
11411
11019
|
}, []);
|
|
11412
|
-
|
|
11413
|
-
|
|
11020
|
+
/** 关闭抽屉 */
|
|
11021
|
+
|
|
11022
|
+
var onClose = React__default['default'].useCallback(function () {
|
|
11023
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
11024
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(s) {
|
|
11025
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11026
|
+
while (1) {
|
|
11027
|
+
switch (_context.prev = _context.next) {
|
|
11028
|
+
case 0:
|
|
11029
|
+
s.goodsListState.discountGoodIndex = [];
|
|
11030
|
+
|
|
11031
|
+
case 1:
|
|
11032
|
+
case "end":
|
|
11033
|
+
return _context.stop();
|
|
11034
|
+
}
|
|
11035
|
+
}
|
|
11036
|
+
}, _callee);
|
|
11037
|
+
}));
|
|
11038
|
+
|
|
11039
|
+
return function (_x) {
|
|
11040
|
+
return _ref.apply(this, arguments);
|
|
11041
|
+
};
|
|
11042
|
+
}())();
|
|
11043
|
+
}, []);
|
|
11044
|
+
/** 点击了 添加折扣行 按钮 */
|
|
11045
|
+
|
|
11046
|
+
var onClick = React__default['default'].useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
11047
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11414
11048
|
while (1) {
|
|
11415
|
-
switch (
|
|
11049
|
+
switch (_context3.prev = _context3.next) {
|
|
11416
11050
|
case 0:
|
|
11417
|
-
|
|
11051
|
+
_context3.next = 2;
|
|
11418
11052
|
return controller.saveEditGood();
|
|
11419
11053
|
|
|
11420
11054
|
case 2:
|
|
11421
|
-
|
|
11055
|
+
_context3.next = 4;
|
|
11422
11056
|
return controller.wait();
|
|
11423
11057
|
|
|
11424
11058
|
case 4:
|
|
11425
|
-
|
|
11059
|
+
_context3.next = 6;
|
|
11426
11060
|
return controller.pipeline( /*#__PURE__*/function () {
|
|
11427
|
-
var
|
|
11428
|
-
|
|
11061
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(s) {
|
|
11062
|
+
var isOk;
|
|
11063
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11429
11064
|
while (1) {
|
|
11430
|
-
switch (
|
|
11065
|
+
switch (_context2.prev = _context2.next) {
|
|
11431
11066
|
case 0:
|
|
11432
|
-
|
|
11433
|
-
|
|
11067
|
+
isOk = s.goodsListState.editGood && s.goodsListState.selectedGoodIndex.indexOf(s.goodsListState.editGood.$index) >= 0;
|
|
11068
|
+
|
|
11069
|
+
if (!isOk) {
|
|
11070
|
+
_context2.next = 4;
|
|
11434
11071
|
break;
|
|
11435
11072
|
}
|
|
11436
11073
|
|
|
11437
|
-
|
|
11438
|
-
|
|
11074
|
+
ktsComponentsAntdX3.message.error({
|
|
11075
|
+
content: '不能给编辑状态的行增加折扣!',
|
|
11076
|
+
key: '不能给编辑状态的行增加折扣!'
|
|
11439
11077
|
});
|
|
11440
|
-
return
|
|
11078
|
+
return _context2.abrupt("return");
|
|
11441
11079
|
|
|
11442
|
-
case
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11080
|
+
case 4:
|
|
11081
|
+
isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
|
|
11082
|
+
var good = s.goodsListState.goodsMap.get($index);
|
|
11083
|
+
return !good || good.taxRate === 0 && !good.taxFreeType;
|
|
11084
|
+
});
|
|
11447
11085
|
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
_context.next = 6;
|
|
11086
|
+
if (!isOk) {
|
|
11087
|
+
_context2.next = 8;
|
|
11451
11088
|
break;
|
|
11452
11089
|
}
|
|
11453
11090
|
|
|
11454
|
-
|
|
11455
|
-
|
|
11091
|
+
ktsComponentsAntdX3.message.error({
|
|
11092
|
+
content: '零税率需要设置免税类型,请在赋码中设置!',
|
|
11093
|
+
key: '零税率需要设置免税类型,请在赋码中设置!'
|
|
11094
|
+
});
|
|
11095
|
+
return _context2.abrupt("return");
|
|
11096
|
+
|
|
11097
|
+
case 8:
|
|
11098
|
+
isOk = s.goodsListState.selectedGoodIndex.some(function ($index) {
|
|
11099
|
+
var good = s.goodsListState.goodsMap.get($index);
|
|
11100
|
+
return "".concat(good === null || good === void 0 ? void 0 : good.lineAmountIncludeTax) === '0';
|
|
11101
|
+
});
|
|
11102
|
+
|
|
11103
|
+
if (!isOk) {
|
|
11104
|
+
_context2.next = 12;
|
|
11105
|
+
break;
|
|
11106
|
+
}
|
|
11107
|
+
|
|
11108
|
+
ktsComponentsAntdX3.message.error({
|
|
11109
|
+
content: '金额为0不能添加折扣行',
|
|
11110
|
+
key: '金额为0不能添加折扣行'
|
|
11456
11111
|
});
|
|
11457
|
-
return
|
|
11112
|
+
return _context2.abrupt("return");
|
|
11458
11113
|
|
|
11459
|
-
case
|
|
11460
|
-
|
|
11461
|
-
s.goodsListState.endowCode.endowcodeGoodIndex = s.goodsListState.selectedGoodIndex;
|
|
11114
|
+
case 12:
|
|
11115
|
+
s.goodsListState.discountGoodIndex = s.goodsListState.selectedGoodIndex.slice();
|
|
11462
11116
|
|
|
11463
|
-
case
|
|
11117
|
+
case 13:
|
|
11464
11118
|
case "end":
|
|
11465
|
-
return
|
|
11119
|
+
return _context2.stop();
|
|
11466
11120
|
}
|
|
11467
11121
|
}
|
|
11468
|
-
},
|
|
11122
|
+
}, _callee2);
|
|
11469
11123
|
}));
|
|
11470
11124
|
|
|
11471
|
-
return function (
|
|
11472
|
-
return
|
|
11125
|
+
return function (_x2) {
|
|
11126
|
+
return _ref3.apply(this, arguments);
|
|
11473
11127
|
};
|
|
11474
11128
|
}())();
|
|
11475
11129
|
|
|
11476
11130
|
case 6:
|
|
11477
11131
|
case "end":
|
|
11478
|
-
return
|
|
11132
|
+
return _context3.stop();
|
|
11479
11133
|
}
|
|
11480
11134
|
}
|
|
11481
|
-
},
|
|
11135
|
+
}, _callee3);
|
|
11482
11136
|
})), [controller]);
|
|
11483
11137
|
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, {
|
|
11138
|
+
return model === 'prefab' ? React__default['default'].createElement(React__default['default'].Fragment, null) : isAddDiscount !== false ? React__default['default'].createElement(ktsComponentsAntdX3.Menu.Item, {
|
|
11139
|
+
key: "0",
|
|
11492
11140
|
onClick: onClick,
|
|
11493
11141
|
disabled: disabled
|
|
11494
|
-
}, "\
|
|
11495
|
-
}, [
|
|
11142
|
+
}, "\u6DFB\u52A0\u6298\u6263\u884C") : undefined;
|
|
11143
|
+
}, [isAddDiscount, disabled, onClick]);
|
|
11144
|
+
var drawer = React__default['default'].useMemo(function () {
|
|
11145
|
+
return React__default['default'].createElement(ktsComponentsAntdX3.Drawer, {
|
|
11146
|
+
className: "kts-invoice-operate-goods-list-add-discount-row",
|
|
11147
|
+
width: 540,
|
|
11148
|
+
title: "\u6DFB\u52A0\u6298\u6263\u884C",
|
|
11149
|
+
placement: "right",
|
|
11150
|
+
destroyOnClose: true,
|
|
11151
|
+
onClose: onClose,
|
|
11152
|
+
visible: visible
|
|
11153
|
+
}, React__default['default'].createElement(DrawerBody, null));
|
|
11154
|
+
}, [visible, onClose]);
|
|
11496
11155
|
return {
|
|
11497
11156
|
menuItem: menuItem,
|
|
11498
|
-
|
|
11157
|
+
drawer: drawer
|
|
11499
11158
|
};
|
|
11500
11159
|
});
|
|
11160
|
+
var DrawerBody = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (props) {
|
|
11161
|
+
var form = props.form;
|
|
11162
|
+
var getFieldDecorator = form.getFieldDecorator;
|
|
11163
|
+
var controller = Invoice.useInvoiceController();
|
|
11164
|
+
/** 选中的货物索引列表 */
|
|
11165
|
+
|
|
11166
|
+
var discountGoodIndex = controller.useMemo(function (s) {
|
|
11167
|
+
return s.goodsListState.discountGoodIndex;
|
|
11168
|
+
}, []);
|
|
11169
|
+
/** 金额合计 */
|
|
11170
|
+
|
|
11171
|
+
var lineAmountSum = controller.useMemo(function (s) {
|
|
11172
|
+
var sum = chain(0);
|
|
11173
|
+
|
|
11174
|
+
if (s.goodsListState.isTaxIncluded) {
|
|
11175
|
+
s.goodsListState.discountGoodIndex.forEach(function (e) {
|
|
11176
|
+
var goods = s.goodsListState.goodsMap.get(e);
|
|
11177
|
+
sum = sum.add((goods === null || goods === void 0 ? void 0 : goods.lineAmountIncludeTax) || 0);
|
|
11178
|
+
});
|
|
11179
|
+
} else {
|
|
11180
|
+
s.goodsListState.discountGoodIndex.forEach(function (e) {
|
|
11181
|
+
var goods = s.goodsListState.goodsMap.get(e);
|
|
11182
|
+
sum = sum.add((goods === null || goods === void 0 ? void 0 : goods.lineAmountExcludeTax) || 0);
|
|
11183
|
+
});
|
|
11184
|
+
}
|
|
11185
|
+
|
|
11186
|
+
return sum.done();
|
|
11187
|
+
}, []);
|
|
11188
|
+
/** 关闭抽屉 */
|
|
11189
|
+
|
|
11190
|
+
var onClose = React__default['default'].useCallback(function () {
|
|
11191
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
11192
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(s) {
|
|
11193
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
11194
|
+
while (1) {
|
|
11195
|
+
switch (_context4.prev = _context4.next) {
|
|
11196
|
+
case 0:
|
|
11197
|
+
s.goodsListState.discountGoodIndex = [];
|
|
11198
|
+
|
|
11199
|
+
case 1:
|
|
11200
|
+
case "end":
|
|
11201
|
+
return _context4.stop();
|
|
11202
|
+
}
|
|
11203
|
+
}
|
|
11204
|
+
}, _callee4);
|
|
11205
|
+
}));
|
|
11206
|
+
|
|
11207
|
+
return function (_x3) {
|
|
11208
|
+
return _ref4.apply(this, arguments);
|
|
11209
|
+
};
|
|
11210
|
+
}())();
|
|
11211
|
+
}, []);
|
|
11212
|
+
/** 点击了保存 */
|
|
11213
|
+
|
|
11214
|
+
var onClickSave = React__default['default'].useCallback(function () {
|
|
11215
|
+
form.validateFields(function (err, values) {
|
|
11216
|
+
if (err) return;
|
|
11217
|
+
var discolineAmountunt = parseFloat(parseFloat(values.discolineAmountunt).toFixed(2));
|
|
11218
|
+
var discount = parseFloat(parseFloat(values.discount).toFixed(4));
|
|
11219
|
+
var indexList = discountGoodIndex;
|
|
11220
|
+
controller.pipeline( /*#__PURE__*/function () {
|
|
11221
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(s) {
|
|
11222
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
11223
|
+
while (1) {
|
|
11224
|
+
switch (_context5.prev = _context5.next) {
|
|
11225
|
+
case 0:
|
|
11226
|
+
s.goodsListState.discountGoodIndex = [];
|
|
11227
|
+
|
|
11228
|
+
case 1:
|
|
11229
|
+
case "end":
|
|
11230
|
+
return _context5.stop();
|
|
11231
|
+
}
|
|
11232
|
+
}
|
|
11233
|
+
}, _callee5);
|
|
11234
|
+
}));
|
|
11235
|
+
|
|
11236
|
+
return function (_x4) {
|
|
11237
|
+
return _ref5.apply(this, arguments);
|
|
11238
|
+
};
|
|
11239
|
+
}())();
|
|
11240
|
+
controller.addGoodDiscount({
|
|
11241
|
+
indexList: indexList,
|
|
11242
|
+
discount: discount,
|
|
11243
|
+
discolineAmountunt: discolineAmountunt
|
|
11244
|
+
});
|
|
11245
|
+
});
|
|
11246
|
+
}, [controller, form, discountGoodIndex]);
|
|
11247
|
+
/** 折扣率变化 */
|
|
11248
|
+
|
|
11249
|
+
var onChangeDiscount = React__default['default'].useCallback(lazyFn$1(function (e) {
|
|
11250
|
+
form.validateFields(function (err, values) {
|
|
11251
|
+
if (err && err.discount) return;
|
|
11252
|
+
var discolineAmountunt = evaluate("".concat(lineAmountSum, " * (").concat(values.discount, "/100)")).toFixed(2);
|
|
11253
|
+
form.setFieldsValue({
|
|
11254
|
+
discolineAmountunt: discolineAmountunt
|
|
11255
|
+
});
|
|
11256
|
+
});
|
|
11257
|
+
}, 300), [form, lineAmountSum]);
|
|
11258
|
+
/** 折扣变化 */
|
|
11259
|
+
|
|
11260
|
+
var onChangeDiscolineAmountunt = React__default['default'].useCallback(lazyFn$1(function (e) {
|
|
11261
|
+
form.validateFields(function (err, values) {
|
|
11262
|
+
if (err && err.discolineAmountunt) return;
|
|
11263
|
+
var discolineAmountunt = parseFloat(values.discolineAmountunt).toFixed(2);
|
|
11264
|
+
var discount = evaluate("(".concat(discolineAmountunt, " / ").concat(lineAmountSum, ") * 100")).toFixed(4);
|
|
11265
|
+
form.setFieldsValue({
|
|
11266
|
+
discount: discount
|
|
11267
|
+
});
|
|
11268
|
+
});
|
|
11269
|
+
}, 300), [form, lineAmountSum]);
|
|
11270
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement("div", {
|
|
11271
|
+
className: "add-discount-row-body"
|
|
11272
|
+
}, React__default['default'].createElement("p", null, "\u5F53\u524D\u9009\u62E9", React__default['default'].createElement(Text$3, {
|
|
11273
|
+
type: "danger"
|
|
11274
|
+
}, discountGoodIndex.length), "\u884C\u88AB\u6298\u6263\u5546\u54C1\u884C\uFF0C\u91D1\u989D\u5408\u8BA1\xA5", React__default['default'].createElement(Text$3, {
|
|
11275
|
+
type: "danger"
|
|
11276
|
+
}, lineAmountSum.toFixed(2))), React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
11277
|
+
label: "\u6298\u6263\u7387\uFF1A"
|
|
11278
|
+
}, getFieldDecorator('discount', {
|
|
11279
|
+
rules: [{
|
|
11280
|
+
required: true,
|
|
11281
|
+
message: '请输入折扣金额'
|
|
11282
|
+
}, {
|
|
11283
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
11284
|
+
message: '请输入数字'
|
|
11285
|
+
}, {
|
|
11286
|
+
validator: function validator(_, value, callback) {
|
|
11287
|
+
var _value$match;
|
|
11288
|
+
|
|
11289
|
+
if (!value) {
|
|
11290
|
+
callback();
|
|
11291
|
+
return;
|
|
11292
|
+
}
|
|
11293
|
+
|
|
11294
|
+
if (!((_value$match = value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)) === null || _value$match === void 0 ? void 0 : _value$match.length)) {
|
|
11295
|
+
callback();
|
|
11296
|
+
return;
|
|
11297
|
+
}
|
|
11298
|
+
|
|
11299
|
+
if (parseFloat(value) > 100 || parseFloat(value) < 0) {
|
|
11300
|
+
callback('请输入大于0小于100的数字');
|
|
11301
|
+
}
|
|
11302
|
+
|
|
11303
|
+
callback();
|
|
11304
|
+
}
|
|
11305
|
+
}]
|
|
11306
|
+
})(React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
11307
|
+
placeholder: "\u8BF7\u8F93\u5165\u5927\u4E8E0\u5C0F\u4E8E100\u7684\u6570\u5B57",
|
|
11308
|
+
suffix: "%",
|
|
11309
|
+
onChange: onChangeDiscount
|
|
11310
|
+
}))), React__default['default'].createElement(ktsComponentsAntdX3.Form.Item, {
|
|
11311
|
+
label: "\u6298\u6263\u91D1\u989D\uFF1A"
|
|
11312
|
+
}, getFieldDecorator('discolineAmountunt', {
|
|
11313
|
+
rules: [{
|
|
11314
|
+
required: true,
|
|
11315
|
+
message: '请输入折扣金额'
|
|
11316
|
+
}, {
|
|
11317
|
+
pattern: /^[+-]?(0|([1-9]\d*))(\.\d+)?$/,
|
|
11318
|
+
message: '请输入数字'
|
|
11319
|
+
}, {
|
|
11320
|
+
validator: function validator(_, value, callback) {
|
|
11321
|
+
var _value$match2;
|
|
11322
|
+
|
|
11323
|
+
if (!value) {
|
|
11324
|
+
callback();
|
|
11325
|
+
return;
|
|
11326
|
+
}
|
|
11327
|
+
|
|
11328
|
+
if (!((_value$match2 = value.match(/^[+-]?(0|([1-9]\d*))(\.\d+)?$/)) === null || _value$match2 === void 0 ? void 0 : _value$match2.length)) {
|
|
11329
|
+
callback();
|
|
11330
|
+
return;
|
|
11331
|
+
}
|
|
11332
|
+
|
|
11333
|
+
if (parseFloat(value) > lineAmountSum || parseFloat(value) < 0) {
|
|
11334
|
+
callback('请输入大于0小于金额合计的数字');
|
|
11335
|
+
}
|
|
11336
|
+
|
|
11337
|
+
callback();
|
|
11338
|
+
}
|
|
11339
|
+
}]
|
|
11340
|
+
})(React__default['default'].createElement(ktsComponentsAntdX3.Input, {
|
|
11341
|
+
placeholder: "\u8BF7\u8F93\u5165\u5927\u4E8E0\u5C0F\u4E8E\u91D1\u989D\u5408\u8BA1\u7684\u6570\u5B57",
|
|
11342
|
+
suffix: "\xA5",
|
|
11343
|
+
onChange: onChangeDiscolineAmountunt
|
|
11344
|
+
})))), React__default['default'].createElement("div", {
|
|
11345
|
+
className: "add-discount-row-footer"
|
|
11346
|
+
}, React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11347
|
+
block: true,
|
|
11348
|
+
style: {
|
|
11349
|
+
marginBottom: 12
|
|
11350
|
+
},
|
|
11351
|
+
onClick: onClose
|
|
11352
|
+
}, "\u53D6\u6D88"), React__default['default'].createElement(ktsComponentsAntdX3.Button, {
|
|
11353
|
+
type: "primary",
|
|
11354
|
+
block: true,
|
|
11355
|
+
onClick: onClickSave
|
|
11356
|
+
}, "\u4FDD\u5B58")));
|
|
11357
|
+
});
|
|
11501
11358
|
|
|
11502
11359
|
var GoodsList = /*#__PURE__*/function (_React$Component) {
|
|
11503
11360
|
_inherits(GoodsList, _React$Component);
|
|
@@ -11549,6 +11406,12 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11549
11406
|
/** 批量赋码 */
|
|
11550
11407
|
|
|
11551
11408
|
var endowCodeButton = useEndowCodeButton();
|
|
11409
|
+
/** 批量删除 */
|
|
11410
|
+
|
|
11411
|
+
var delRowButton = useDelRowButton();
|
|
11412
|
+
/** 添加折扣行 */
|
|
11413
|
+
|
|
11414
|
+
var addDiscountRowButton = useAddDiscountRowButton();
|
|
11552
11415
|
/** 清空自动赋码缓存 */
|
|
11553
11416
|
|
|
11554
11417
|
React__default['default'].useEffect(function () {
|
|
@@ -11706,7 +11569,7 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11706
11569
|
className: "kts-invoice-operate-goods-list-able"
|
|
11707
11570
|
}, React__default['default'].createElement("div", {
|
|
11708
11571
|
className: "kts-invoice-operate-goods-list-able-list"
|
|
11709
|
-
}, React__default['default'].createElement(AddRowButton, null),
|
|
11572
|
+
}, React__default['default'].createElement(AddRowButton, null), endowCodeButton.button, delRowButton.button, addDiscountRowButton.drawer, React__default['default'].createElement(Search, null)), React__default['default'].createElement("div", {
|
|
11710
11573
|
className: "kts-invoice-operate-goods-list-able-extend"
|
|
11711
11574
|
}, props.menuExpansion, React__default['default'].createElement(DescribeSwitch, null), React__default['default'].createElement(TaxIncludedSwitch, null))), React__default['default'].createElement("div", {
|
|
11712
11575
|
className: classnames__default['default']('kts-invoice-operate-goods-list-table', {
|
|
@@ -11738,6 +11601,19 @@ var Main = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function (p
|
|
|
11738
11601
|
})), React__default['default'].createElement("div", null, React__default['default'].createElement(Statistics, null)));
|
|
11739
11602
|
});
|
|
11740
11603
|
|
|
11604
|
+
/** 更新 商品序号 */
|
|
11605
|
+
|
|
11606
|
+
function useToGenerateId(controller) {
|
|
11607
|
+
var goodsList = controller.useMemo(function (s) {
|
|
11608
|
+
return s.goodsListState.goodsList;
|
|
11609
|
+
}, []);
|
|
11610
|
+
React__default['default'].useEffect(function () {
|
|
11611
|
+
goodsList.forEach(function (e, i) {
|
|
11612
|
+
e.serialNo = i + 1;
|
|
11613
|
+
});
|
|
11614
|
+
}, [goodsList]);
|
|
11615
|
+
}
|
|
11616
|
+
|
|
11741
11617
|
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
11618
|
styleInject(css_248z$8);
|
|
11743
11619
|
|
|
@@ -12209,7 +12085,7 @@ function interval(i, t) {
|
|
|
12209
12085
|
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
12086
|
styleInject(css_248z$a);
|
|
12211
12087
|
|
|
12212
|
-
var Text$
|
|
12088
|
+
var Text$4 = ktsComponentsAntdX3.Typography.Text;
|
|
12213
12089
|
|
|
12214
12090
|
var Buyer$1 = /*#__PURE__*/function (_React$Component) {
|
|
12215
12091
|
_inherits(Buyer, _React$Component);
|
|
@@ -12323,7 +12199,7 @@ var Main$2 = GreyReactBox.decorator(ktsComponentsAntdX3.Form.create())(function
|
|
|
12323
12199
|
if (e.options.rules.some(function (e) {
|
|
12324
12200
|
return e.required;
|
|
12325
12201
|
})) {
|
|
12326
|
-
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$
|
|
12202
|
+
return React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(Text$4, {
|
|
12327
12203
|
type: "danger"
|
|
12328
12204
|
}, "*"), e.label);
|
|
12329
12205
|
} else {
|
|
@@ -13702,6 +13578,7 @@ var Main$3 = function Main(props) {
|
|
|
13702
13578
|
key = _React$useState2[0],
|
|
13703
13579
|
setKey = _React$useState2[1];
|
|
13704
13580
|
|
|
13581
|
+
useToGenerateId(controller);
|
|
13705
13582
|
React__default['default'].useEffect(function () {
|
|
13706
13583
|
setKey(key + 1);
|
|
13707
13584
|
}, [controller]);
|