@pisell/private-materials 3.4.70 → 3.4.71
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/plus/orderList/components/BatchActionBar.js +46 -72
- package/lib/plus/orderList/components/BatchActionBar.js +45 -62
- package/package.json +3 -3
|
@@ -16,7 +16,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
16
16
|
import React, { useState, useCallback, useMemo } from 'react';
|
|
17
17
|
import { Checkbox, Button } from 'antd';
|
|
18
18
|
import { PisellBatchActionBar, PisellQuickFilter, PisellDataSourceContainer, PisellModal } from '@pisell/materials';
|
|
19
|
-
import { editordership, postSendInvoice, printPack, printPicking, batchAddOrderTags, batchDeleteOrderTags, batchPutOrderStatus
|
|
19
|
+
import { editordership, postSendInvoice, printPack, printPicking, batchAddOrderTags, batchDeleteOrderTags, batchPutOrderStatus } from "../serve";
|
|
20
20
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
21
21
|
import { getTagSelectOptions } from "../serve";
|
|
22
22
|
var useContainerContext = PisellDataSourceContainer.useContainerContext;
|
|
@@ -715,69 +715,39 @@ var OrderBatchActionBar = function OrderBatchActionBar(props) {
|
|
|
715
715
|
/**
|
|
716
716
|
* 作废订单(voided)
|
|
717
717
|
*/
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
case 10:
|
|
752
|
-
_context15.prev = 10;
|
|
753
|
-
setLoadingStates(function (prev) {
|
|
754
|
-
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
755
|
-
markAsVoid: false
|
|
756
|
-
});
|
|
757
|
-
});
|
|
758
|
-
return _context15.finish(10);
|
|
759
|
-
case 13:
|
|
760
|
-
case "end":
|
|
761
|
-
return _context15.stop();
|
|
762
|
-
}
|
|
763
|
-
}, _callee15, null, [[0, 7, 10, 13]]);
|
|
764
|
-
}));
|
|
765
|
-
function onOk() {
|
|
766
|
-
return _onOk7.apply(this, arguments);
|
|
767
|
-
}
|
|
768
|
-
return onOk;
|
|
769
|
-
}()
|
|
770
|
-
});
|
|
771
|
-
case 1:
|
|
772
|
-
case "end":
|
|
773
|
-
return _context16.stop();
|
|
774
|
-
}
|
|
775
|
-
}, _callee16);
|
|
776
|
-
}));
|
|
777
|
-
return function (_x16, _x17) {
|
|
778
|
-
return _ref9.apply(this, arguments);
|
|
779
|
-
};
|
|
780
|
-
}(), [handleSuccess, handleError, locales]);
|
|
718
|
+
// const handleMarkAsVoid = useCallback(
|
|
719
|
+
// async (keys: React.Key[], rows?: any[]) => {
|
|
720
|
+
// PisellModal.confirm({
|
|
721
|
+
// title: locales.getText('pisell2.orderList.batchAction.void.title'),
|
|
722
|
+
// cancelText: locales.getText(
|
|
723
|
+
// 'pisell2.orderList.batchAction.button.cancel'
|
|
724
|
+
// ),
|
|
725
|
+
// okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
726
|
+
// content: locales.getText('page.order.lists.cancel.content')(
|
|
727
|
+
// 0,
|
|
728
|
+
// 0,
|
|
729
|
+
// 0,
|
|
730
|
+
// '',
|
|
731
|
+
// false,
|
|
732
|
+
// 'void'
|
|
733
|
+
// ),
|
|
734
|
+
// onOk: async () => {
|
|
735
|
+
// try {
|
|
736
|
+
// setLoadingStates((prev) => ({ ...prev, markAsVoid: true }));
|
|
737
|
+
// await batchVoidedOrder({
|
|
738
|
+
// order_ids: keys as number[],
|
|
739
|
+
// });
|
|
740
|
+
// handleSuccess();
|
|
741
|
+
// } catch (error: any) {
|
|
742
|
+
// handleError();
|
|
743
|
+
// } finally {
|
|
744
|
+
// setLoadingStates((prev) => ({ ...prev, markAsVoid: false }));
|
|
745
|
+
// }
|
|
746
|
+
// },
|
|
747
|
+
// });
|
|
748
|
+
// },
|
|
749
|
+
// [handleSuccess, handleError, locales]
|
|
750
|
+
// );
|
|
781
751
|
|
|
782
752
|
/**
|
|
783
753
|
* 批量操作按钮配置
|
|
@@ -835,14 +805,18 @@ var OrderBatchActionBar = function OrderBatchActionBar(props) {
|
|
|
835
805
|
icon: 'pisell2-slash-circle-01',
|
|
836
806
|
loading: loadingStates.markAsCancelled,
|
|
837
807
|
onClick: handleMarkAsCancelled
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
808
|
+
}
|
|
809
|
+
// {
|
|
810
|
+
// key: 'mark-as-void',
|
|
811
|
+
// label: locales.getText('page.order.void'),
|
|
812
|
+
// icon: 'pisell2-alert-circle',
|
|
813
|
+
// loading: loadingStates.markAsVoid,
|
|
814
|
+
// onClick: handleMarkAsVoid,
|
|
815
|
+
// },
|
|
816
|
+
];
|
|
817
|
+
}, [loadingStates.ship, loadingStates.invoice, loadingStates.addTags, loadingStates.removeTags, loadingStates.markAsOpen, loadingStates.markAsCompleted, loadingStates.markAsCancelled, loadingStates.markAsVoid, handleShip, handleInvoice, handlePrintPack, handlePrintPicking, handleAddTags, handleRemoveTags, handleMarkAsOpen, handleMarkAsCompleted, handleMarkAsCancelled,
|
|
818
|
+
// handleMarkAsVoid,
|
|
819
|
+
locales]);
|
|
846
820
|
if (selectedKeys.length === 0) {
|
|
847
821
|
return null;
|
|
848
822
|
}
|
|
@@ -55,8 +55,11 @@ var OrderBatchActionBar = (props) => {
|
|
|
55
55
|
},
|
|
56
56
|
[onClearSelection]
|
|
57
57
|
);
|
|
58
|
-
const handleError = (0, import_react.useCallback)(
|
|
59
|
-
|
|
58
|
+
const handleError = (0, import_react.useCallback)(
|
|
59
|
+
(error, defaultMessage) => {
|
|
60
|
+
},
|
|
61
|
+
[]
|
|
62
|
+
);
|
|
60
63
|
const handleShip = (0, import_react.useCallback)(
|
|
61
64
|
async (keys, rows) => {
|
|
62
65
|
let checked = true;
|
|
@@ -409,65 +412,45 @@ var OrderBatchActionBar = (props) => {
|
|
|
409
412
|
cancelText: locales.getText(
|
|
410
413
|
"pisell2.orderList.batchAction.button.cancel"
|
|
411
414
|
),
|
|
412
|
-
footer: () => /* @__PURE__ */ import_react.default.createElement(
|
|
413
|
-
|
|
414
|
-
{
|
|
415
|
-
key: "only-cancel",
|
|
416
|
-
onClick: () => executeCancelOrder(0),
|
|
417
|
-
loading: loadingStates.markAsCancelled
|
|
418
|
-
},
|
|
419
|
-
locales.getText(
|
|
420
|
-
"pisell2.orderList.batchAction.button.onlyCancel"
|
|
421
|
-
)
|
|
422
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
423
|
-
import_antd.Button,
|
|
415
|
+
footer: () => /* @__PURE__ */ import_react.default.createElement(
|
|
416
|
+
"div",
|
|
424
417
|
{
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
418
|
+
style: {
|
|
419
|
+
display: "flex",
|
|
420
|
+
gap: 10,
|
|
421
|
+
justifyContent: "flex-end",
|
|
422
|
+
width: "100%"
|
|
423
|
+
}
|
|
429
424
|
},
|
|
430
|
-
locales.getText(
|
|
431
|
-
|
|
425
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Button, { key: "cancel", onClick: () => modalInstance.destroy() }, locales.getText("pisell2.orderList.batchAction.button.cancel")),
|
|
426
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
427
|
+
import_antd.Button,
|
|
428
|
+
{
|
|
429
|
+
key: "only-cancel",
|
|
430
|
+
onClick: () => executeCancelOrder(0),
|
|
431
|
+
loading: loadingStates.markAsCancelled
|
|
432
|
+
},
|
|
433
|
+
locales.getText(
|
|
434
|
+
"pisell2.orderList.batchAction.button.onlyCancel"
|
|
435
|
+
)
|
|
436
|
+
),
|
|
437
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
438
|
+
import_antd.Button,
|
|
439
|
+
{
|
|
440
|
+
key: "cancel-void",
|
|
441
|
+
type: "primary",
|
|
442
|
+
onClick: () => executeCancelOrder(1),
|
|
443
|
+
loading: loadingStates.markAsCancelled
|
|
444
|
+
},
|
|
445
|
+
locales.getText(
|
|
446
|
+
"pisell2.orderList.batchAction.button.cancelAndVoid"
|
|
447
|
+
)
|
|
432
448
|
)
|
|
433
|
-
)
|
|
449
|
+
)
|
|
434
450
|
});
|
|
435
451
|
},
|
|
436
452
|
[handleSuccess, handleError, loadingStates.markAsCancelled]
|
|
437
453
|
);
|
|
438
|
-
const handleMarkAsVoid = (0, import_react.useCallback)(
|
|
439
|
-
async (keys, rows) => {
|
|
440
|
-
import_materials.PisellModal.confirm({
|
|
441
|
-
title: locales.getText("pisell2.orderList.batchAction.void.title"),
|
|
442
|
-
cancelText: locales.getText(
|
|
443
|
-
"pisell2.orderList.batchAction.button.cancel"
|
|
444
|
-
),
|
|
445
|
-
okText: locales.getText("pisell2.orderList.batchAction.button.ok"),
|
|
446
|
-
content: locales.getText("page.order.lists.cancel.content")(
|
|
447
|
-
0,
|
|
448
|
-
0,
|
|
449
|
-
0,
|
|
450
|
-
"",
|
|
451
|
-
false,
|
|
452
|
-
"void"
|
|
453
|
-
),
|
|
454
|
-
onOk: async () => {
|
|
455
|
-
try {
|
|
456
|
-
setLoadingStates((prev) => ({ ...prev, markAsVoid: true }));
|
|
457
|
-
await (0, import_serve.batchVoidedOrder)({
|
|
458
|
-
order_ids: keys
|
|
459
|
-
});
|
|
460
|
-
handleSuccess();
|
|
461
|
-
} catch (error) {
|
|
462
|
-
handleError();
|
|
463
|
-
} finally {
|
|
464
|
-
setLoadingStates((prev) => ({ ...prev, markAsVoid: false }));
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
});
|
|
468
|
-
},
|
|
469
|
-
[handleSuccess, handleError, locales]
|
|
470
|
-
);
|
|
471
454
|
const actions = (0, import_react.useMemo)(
|
|
472
455
|
() => [
|
|
473
456
|
{
|
|
@@ -532,14 +515,14 @@ var OrderBatchActionBar = (props) => {
|
|
|
532
515
|
icon: "pisell2-slash-circle-01",
|
|
533
516
|
loading: loadingStates.markAsCancelled,
|
|
534
517
|
onClick: handleMarkAsCancelled
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
key: "mark-as-void",
|
|
538
|
-
label: locales.getText("page.order.void"),
|
|
539
|
-
icon: "pisell2-alert-circle",
|
|
540
|
-
loading: loadingStates.markAsVoid,
|
|
541
|
-
onClick: handleMarkAsVoid
|
|
542
518
|
}
|
|
519
|
+
// {
|
|
520
|
+
// key: 'mark-as-void',
|
|
521
|
+
// label: locales.getText('page.order.void'),
|
|
522
|
+
// icon: 'pisell2-alert-circle',
|
|
523
|
+
// loading: loadingStates.markAsVoid,
|
|
524
|
+
// onClick: handleMarkAsVoid,
|
|
525
|
+
// },
|
|
543
526
|
],
|
|
544
527
|
[
|
|
545
528
|
loadingStates.ship,
|
|
@@ -559,7 +542,7 @@ var OrderBatchActionBar = (props) => {
|
|
|
559
542
|
handleMarkAsOpen,
|
|
560
543
|
handleMarkAsCompleted,
|
|
561
544
|
handleMarkAsCancelled,
|
|
562
|
-
handleMarkAsVoid,
|
|
545
|
+
// handleMarkAsVoid,
|
|
563
546
|
locales
|
|
564
547
|
]
|
|
565
548
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.71",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"styled-components": "^6.0.0-rc.3",
|
|
79
79
|
"@pisell/utils": "3.0.2",
|
|
80
80
|
"@pisell/materials": "3.3.79",
|
|
81
|
-
"@pisell/
|
|
82
|
-
"@pisell/
|
|
81
|
+
"@pisell/icon": "0.0.11",
|
|
82
|
+
"@pisell/date-picker": "3.0.4"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"react": "^18.0.0",
|