@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.
@@ -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, batchVoidedOrder } from "../serve";
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
- var handleMarkAsVoid = useCallback( /*#__PURE__*/function () {
719
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(keys, rows) {
720
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
721
- while (1) switch (_context16.prev = _context16.next) {
722
- case 0:
723
- PisellModal.confirm({
724
- title: locales.getText('pisell2.orderList.batchAction.void.title'),
725
- cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
726
- okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
727
- content: locales.getText('page.order.lists.cancel.content')(0, 0, 0, '', false, 'void'),
728
- onOk: function () {
729
- var _onOk7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
730
- return _regeneratorRuntime().wrap(function _callee15$(_context15) {
731
- while (1) switch (_context15.prev = _context15.next) {
732
- case 0:
733
- _context15.prev = 0;
734
- setLoadingStates(function (prev) {
735
- return _objectSpread(_objectSpread({}, prev), {}, {
736
- markAsVoid: true
737
- });
738
- });
739
- _context15.next = 4;
740
- return batchVoidedOrder({
741
- order_ids: keys
742
- });
743
- case 4:
744
- handleSuccess();
745
- _context15.next = 10;
746
- break;
747
- case 7:
748
- _context15.prev = 7;
749
- _context15.t0 = _context15["catch"](0);
750
- handleError();
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
- key: 'mark-as-void',
840
- label: locales.getText('page.order.void'),
841
- icon: 'pisell2-alert-circle',
842
- loading: loadingStates.markAsVoid,
843
- onClick: handleMarkAsVoid
844
- }];
845
- }, [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, handleMarkAsVoid, locales]);
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)((error, defaultMessage) => {
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("div", { style: { display: "flex", gap: 10, justifyContent: "flex-end", width: "100%" } }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { key: "cancel", onClick: () => modalInstance.destroy() }, locales.getText("pisell2.orderList.batchAction.button.cancel")), /* @__PURE__ */ import_react.default.createElement(
413
- import_antd.Button,
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
- key: "cancel-void",
426
- type: "primary",
427
- onClick: () => executeCancelOrder(1),
428
- loading: loadingStates.markAsCancelled
418
+ style: {
419
+ display: "flex",
420
+ gap: 10,
421
+ justifyContent: "flex-end",
422
+ width: "100%"
423
+ }
429
424
  },
430
- locales.getText(
431
- "pisell2.orderList.batchAction.button.cancelAndVoid"
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.70",
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/date-picker": "3.0.4",
82
- "@pisell/icon": "0.0.11"
81
+ "@pisell/icon": "0.0.11",
82
+ "@pisell/date-picker": "3.0.4"
83
83
  },
84
84
  "peerDependencies": {
85
85
  "react": "^18.0.0",