@pisell/private-materials 3.4.82 → 3.4.83
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/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +152 -152
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +18 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +18 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/index.js +3 -2
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +3 -1
- package/es/plus/contactInfo/components/SwipeAction/index.js +1 -1
- package/es/plus/orderList/components/HandleActions.d.ts +1 -0
- package/es/plus/orderList/components/HandleActions.js +5 -2
- package/es/plus/orderList/components/Toolbar.d.ts +1 -0
- package/es/plus/orderList/components/Toolbar.js +4 -2
- package/es/plus/orderList/index.d.ts +1 -0
- package/es/plus/orderList/index.js +7 -2
- package/es/plus/pisellSalesGrid/PisellSalesGrid.d.ts +5 -0
- package/es/plus/pisellSalesGrid/PisellSalesGrid.js +363 -0
- package/es/plus/pisellSalesGrid/PisellSalesGrid.less +16 -0
- package/es/plus/pisellSalesGrid/PisellSalesGrid.stories.d.ts +14 -0
- package/es/plus/pisellSalesGrid/PisellSalesGrid.stories.js +559 -0
- package/es/plus/pisellSalesGrid/hooks/useActions.d.ts +19 -0
- package/es/plus/pisellSalesGrid/hooks/useActions.js +723 -0
- package/es/plus/pisellSalesGrid/index.d.ts +4 -0
- package/es/plus/pisellSalesGrid/index.js +3 -0
- package/es/plus/pisellSalesGrid/locales.d.ts +9 -0
- package/es/plus/pisellSalesGrid/locales.js +8 -0
- package/es/plus/pisellSalesGrid/serve.d.ts +19 -0
- package/es/plus/pisellSalesGrid/serve.js +151 -0
- package/es/plus/pisellSalesGrid/types.d.ts +170 -0
- package/es/plus/pisellSalesGrid/types.js +1 -0
- package/es/plus/pisellSalesManagement/components/BookingFormsPreview.d.ts +15 -0
- package/es/plus/pisellSalesManagement/components/BookingFormsPreview.js +211 -0
- package/es/plus/pisellSalesManagement/components/BookingNotesPreview.d.ts +19 -0
- package/es/plus/pisellSalesManagement/components/BookingNotesPreview.js +167 -0
- package/es/plus/pisellSalesManagement/components/ResourceSelector.d.ts +9 -0
- package/es/plus/pisellSalesManagement/components/ResourceSelector.js +102 -0
- package/es/plus/pisellSalesManagement/config/booking.d.ts +185 -0
- package/es/plus/pisellSalesManagement/config/booking.js +380 -0
- package/es/plus/pisellSalesManagement/config/index.d.ts +2 -0
- package/es/plus/pisellSalesManagement/config/index.js +11 -0
- package/es/plus/pisellSalesManagement/config/order.d.ts +172 -0
- package/es/plus/pisellSalesManagement/config/order.js +460 -0
- package/es/plus/pisellSalesManagement/hooks/perspectiveUtils.d.ts +15 -0
- package/es/plus/pisellSalesManagement/hooks/perspectiveUtils.js +66 -0
- package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.d.ts +2 -0
- package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.js +651 -0
- package/es/plus/pisellSalesManagement/hooks/useOrderPerspective.d.ts +2 -0
- package/es/plus/pisellSalesManagement/hooks/useOrderPerspective.js +656 -0
- package/es/plus/pisellSalesManagement/hooks/usePerspectives.d.ts +5 -0
- package/es/plus/pisellSalesManagement/hooks/usePerspectives.js +12 -0
- package/es/plus/pisellSalesManagement/index.d.ts +10 -0
- package/es/plus/pisellSalesManagement/index.js +84 -0
- package/es/plus/pisellSalesManagement/locales.d.ts +303 -0
- package/es/plus/pisellSalesManagement/locales.js +302 -0
- package/es/plus/pisellSalesManagement/serve.d.ts +26 -0
- package/es/plus/pisellSalesManagement/serve.js +222 -0
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/passDetail/index.js +2 -26
- package/es/plus/walletPassGallery/components/passList/index.js +8 -1
- package/es/plus/walletPassGallery/index.js +0 -31
- package/es/pro/Selector/Selector.d.ts +1 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/notes/NoteBlock/index.js +2 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +8 -2
- package/lib/plus/contactInfo/components/SwipeAction/index.js +23 -23
- package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
- package/lib/plus/orderList/components/HandleActions.js +2 -2
- package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
- package/lib/plus/orderList/components/Toolbar.js +2 -2
- package/lib/plus/orderList/index.d.ts +1 -0
- package/lib/plus/orderList/index.js +3 -3
- package/lib/plus/pisellSalesGrid/PisellSalesGrid.d.ts +5 -0
- package/lib/plus/pisellSalesGrid/PisellSalesGrid.js +339 -0
- package/lib/plus/pisellSalesGrid/PisellSalesGrid.less +16 -0
- package/lib/plus/pisellSalesGrid/PisellSalesGrid.stories.d.ts +14 -0
- package/lib/plus/pisellSalesGrid/PisellSalesGrid.stories.js +455 -0
- package/lib/plus/pisellSalesGrid/hooks/useActions.d.ts +19 -0
- package/lib/plus/pisellSalesGrid/hooks/useActions.js +545 -0
- package/lib/plus/pisellSalesGrid/index.d.ts +4 -0
- package/lib/plus/pisellSalesGrid/index.js +42 -0
- package/lib/plus/pisellSalesGrid/locales.d.ts +9 -0
- package/lib/plus/pisellSalesGrid/locales.js +29 -0
- package/lib/plus/pisellSalesGrid/serve.d.ts +19 -0
- package/lib/plus/pisellSalesGrid/serve.js +142 -0
- package/lib/plus/pisellSalesGrid/types.d.ts +170 -0
- package/lib/plus/pisellSalesGrid/types.js +17 -0
- package/lib/plus/pisellSalesManagement/components/BookingFormsPreview.d.ts +15 -0
- package/lib/plus/pisellSalesManagement/components/BookingFormsPreview.js +250 -0
- package/lib/plus/pisellSalesManagement/components/BookingNotesPreview.d.ts +19 -0
- package/lib/plus/pisellSalesManagement/components/BookingNotesPreview.js +193 -0
- package/lib/plus/pisellSalesManagement/components/ResourceSelector.d.ts +9 -0
- package/lib/plus/pisellSalesManagement/components/ResourceSelector.js +106 -0
- package/lib/plus/pisellSalesManagement/config/booking.d.ts +185 -0
- package/lib/plus/pisellSalesManagement/config/booking.js +500 -0
- package/lib/plus/pisellSalesManagement/config/index.d.ts +2 -0
- package/lib/plus/pisellSalesManagement/config/index.js +43 -0
- package/lib/plus/pisellSalesManagement/config/order.d.ts +172 -0
- package/lib/plus/pisellSalesManagement/config/order.js +492 -0
- package/lib/plus/pisellSalesManagement/hooks/perspectiveUtils.d.ts +15 -0
- package/lib/plus/pisellSalesManagement/hooks/perspectiveUtils.js +113 -0
- package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.d.ts +2 -0
- package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.js +699 -0
- package/lib/plus/pisellSalesManagement/hooks/useOrderPerspective.d.ts +2 -0
- package/lib/plus/pisellSalesManagement/hooks/useOrderPerspective.js +700 -0
- package/lib/plus/pisellSalesManagement/hooks/usePerspectives.d.ts +5 -0
- package/lib/plus/pisellSalesManagement/hooks/usePerspectives.js +42 -0
- package/lib/plus/pisellSalesManagement/index.d.ts +10 -0
- package/lib/plus/pisellSalesManagement/index.js +113 -0
- package/lib/plus/pisellSalesManagement/locales.d.ts +303 -0
- package/lib/plus/pisellSalesManagement/locales.js +326 -0
- package/lib/plus/pisellSalesManagement/serve.d.ts +26 -0
- package/lib/plus/pisellSalesManagement/serve.js +120 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/passDetail/index.js +1 -16
- package/lib/plus/walletPassGallery/components/passList/index.js +9 -3
- package/lib/plus/walletPassGallery/index.js +0 -29
- package/lib/pro/Selector/Selector.d.ts +1 -1
- package/lowcode/eco-cup-list/meta.ts +1 -1
- package/lowcode/eco-customer-list/meta.ts +1 -1
- package/lowcode/pisell-sales-management/meta.ts +88 -0
- package/package.json +4 -4
|
@@ -0,0 +1,723 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
9
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
13
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
17
|
+
import { Checkbox, Button } from 'antd';
|
|
18
|
+
import { PisellQuickFilter, PisellModal } from '@pisell/materials';
|
|
19
|
+
import { locales } from '@pisell/utils';
|
|
20
|
+
import { editordership, postSendInvoice, printPack, printPicking, batchAddOrderTags, batchDeleteOrderTags, batchPutOrderStatus, getTagSelectOptions } from "../../orderList/serve";
|
|
21
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
22
|
+
var useActions = function useActions() {
|
|
23
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
|
+
var onClearSelection = options.onClearSelection,
|
|
25
|
+
onRefresh = options.onRefresh;
|
|
26
|
+
var context = useEngineContext();
|
|
27
|
+
var _useState = useState({}),
|
|
28
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
29
|
+
loadingStates = _useState2[0],
|
|
30
|
+
setLoadingStates = _useState2[1];
|
|
31
|
+
var handleSuccess = useCallback(function (successMessage) {
|
|
32
|
+
onRefresh === null || onRefresh === void 0 || onRefresh();
|
|
33
|
+
onClearSelection === null || onClearSelection === void 0 || onClearSelection();
|
|
34
|
+
}, [onRefresh, onClearSelection]);
|
|
35
|
+
var handleError = useCallback(function (error, defaultMessage) {}, []);
|
|
36
|
+
var handleShip = useCallback( /*#__PURE__*/function () {
|
|
37
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(keys, rows) {
|
|
38
|
+
var checked;
|
|
39
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
40
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
checked = true;
|
|
43
|
+
PisellModal.confirm({
|
|
44
|
+
title: locales.getText('pisell2.orderList.batchAction.ship.title')(keys.length),
|
|
45
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
46
|
+
okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
47
|
+
content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", null, locales.getText('pisell2.orderList.batchAction.ship.content')), /*#__PURE__*/React.createElement(Checkbox, {
|
|
48
|
+
defaultChecked: true,
|
|
49
|
+
onChange: function onChange(e) {
|
|
50
|
+
checked = e.target.checked;
|
|
51
|
+
}
|
|
52
|
+
}, locales.getText('page.order.fa.check'))),
|
|
53
|
+
onOk: function () {
|
|
54
|
+
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
55
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
56
|
+
while (1) switch (_context.prev = _context.next) {
|
|
57
|
+
case 0:
|
|
58
|
+
_context.prev = 0;
|
|
59
|
+
setLoadingStates(function (prev) {
|
|
60
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
61
|
+
ship: true
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
_context.next = 4;
|
|
65
|
+
return editordership({
|
|
66
|
+
ids: keys,
|
|
67
|
+
is_notice: checked ? 1 : 0
|
|
68
|
+
});
|
|
69
|
+
case 4:
|
|
70
|
+
handleSuccess();
|
|
71
|
+
_context.next = 10;
|
|
72
|
+
break;
|
|
73
|
+
case 7:
|
|
74
|
+
_context.prev = 7;
|
|
75
|
+
_context.t0 = _context["catch"](0);
|
|
76
|
+
handleError();
|
|
77
|
+
case 10:
|
|
78
|
+
_context.prev = 10;
|
|
79
|
+
setLoadingStates(function (prev) {
|
|
80
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
81
|
+
ship: false
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
return _context.finish(10);
|
|
85
|
+
case 13:
|
|
86
|
+
case "end":
|
|
87
|
+
return _context.stop();
|
|
88
|
+
}
|
|
89
|
+
}, _callee, null, [[0, 7, 10, 13]]);
|
|
90
|
+
}));
|
|
91
|
+
function onOk() {
|
|
92
|
+
return _onOk.apply(this, arguments);
|
|
93
|
+
}
|
|
94
|
+
return onOk;
|
|
95
|
+
}()
|
|
96
|
+
});
|
|
97
|
+
case 2:
|
|
98
|
+
case "end":
|
|
99
|
+
return _context2.stop();
|
|
100
|
+
}
|
|
101
|
+
}, _callee2);
|
|
102
|
+
}));
|
|
103
|
+
return function (_x, _x2) {
|
|
104
|
+
return _ref.apply(this, arguments);
|
|
105
|
+
};
|
|
106
|
+
}(), [handleSuccess, handleError]);
|
|
107
|
+
var handleInvoice = useCallback( /*#__PURE__*/function () {
|
|
108
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(keys, rows) {
|
|
109
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
110
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
111
|
+
case 0:
|
|
112
|
+
PisellModal.confirm({
|
|
113
|
+
title: locales.getText('page.order.table.list.button.send.invoice.tip'),
|
|
114
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
115
|
+
okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
116
|
+
onOk: function () {
|
|
117
|
+
var _onOk2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
118
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
119
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
_context3.prev = 0;
|
|
122
|
+
setLoadingStates(function (prev) {
|
|
123
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
124
|
+
invoice: true
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
_context3.next = 4;
|
|
128
|
+
return postSendInvoice({
|
|
129
|
+
order_ids: keys
|
|
130
|
+
});
|
|
131
|
+
case 4:
|
|
132
|
+
handleSuccess();
|
|
133
|
+
_context3.next = 10;
|
|
134
|
+
break;
|
|
135
|
+
case 7:
|
|
136
|
+
_context3.prev = 7;
|
|
137
|
+
_context3.t0 = _context3["catch"](0);
|
|
138
|
+
handleError();
|
|
139
|
+
case 10:
|
|
140
|
+
_context3.prev = 10;
|
|
141
|
+
setLoadingStates(function (prev) {
|
|
142
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
143
|
+
invoice: false
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
return _context3.finish(10);
|
|
147
|
+
case 13:
|
|
148
|
+
case "end":
|
|
149
|
+
return _context3.stop();
|
|
150
|
+
}
|
|
151
|
+
}, _callee3, null, [[0, 7, 10, 13]]);
|
|
152
|
+
}));
|
|
153
|
+
function onOk() {
|
|
154
|
+
return _onOk2.apply(this, arguments);
|
|
155
|
+
}
|
|
156
|
+
return onOk;
|
|
157
|
+
}()
|
|
158
|
+
});
|
|
159
|
+
case 1:
|
|
160
|
+
case "end":
|
|
161
|
+
return _context4.stop();
|
|
162
|
+
}
|
|
163
|
+
}, _callee4);
|
|
164
|
+
}));
|
|
165
|
+
return function (_x3, _x4) {
|
|
166
|
+
return _ref2.apply(this, arguments);
|
|
167
|
+
};
|
|
168
|
+
}(), [handleSuccess, handleError]);
|
|
169
|
+
var handlePrintPack = useCallback(function (keys, rows) {
|
|
170
|
+
var _window, _window$getStorage, _JSON$parse;
|
|
171
|
+
var coreStorage = (_window = window) === null || _window === void 0 || (_window = _window.app) === null || _window === void 0 || (_window = _window.data) === null || _window === void 0 || (_window = _window.storage) === null || _window === void 0 || (_window$getStorage = _window.getStorage) === null || _window$getStorage === void 0 ? void 0 : _window$getStorage.call(_window, 'core');
|
|
172
|
+
var shopId = coreStorage ? (_JSON$parse = JSON.parse(coreStorage)) === null || _JSON$parse === void 0 || (_JSON$parse = _JSON$parse.mypisell_data) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.shop_id : undefined;
|
|
173
|
+
if (!shopId) {
|
|
174
|
+
console.log('shopId is not found');
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
printPack({
|
|
178
|
+
host: '',
|
|
179
|
+
shop_id: shopId,
|
|
180
|
+
ids: keys
|
|
181
|
+
});
|
|
182
|
+
}, [context]);
|
|
183
|
+
var handlePrintPicking = useCallback(function (keys, rows) {
|
|
184
|
+
var _window2, _window2$getStorage, _JSON$parse2;
|
|
185
|
+
var coreStorage = (_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.app) === null || _window2 === void 0 || (_window2 = _window2.data) === null || _window2 === void 0 || (_window2 = _window2.storage) === null || _window2 === void 0 || (_window2$getStorage = _window2.getStorage) === null || _window2$getStorage === void 0 ? void 0 : _window2$getStorage.call(_window2, 'core');
|
|
186
|
+
var shopId = coreStorage ? (_JSON$parse2 = JSON.parse(coreStorage)) === null || _JSON$parse2 === void 0 || (_JSON$parse2 = _JSON$parse2.mypisell_data) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2.shop_id : undefined;
|
|
187
|
+
if (!shopId) {
|
|
188
|
+
console.log('shopId is not found');
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
printPicking({
|
|
192
|
+
host: '',
|
|
193
|
+
shop_id: shopId,
|
|
194
|
+
ids: keys
|
|
195
|
+
});
|
|
196
|
+
}, [context]);
|
|
197
|
+
var handleAddTags = useCallback( /*#__PURE__*/function () {
|
|
198
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(keys, rows) {
|
|
199
|
+
var tags;
|
|
200
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
201
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
202
|
+
case 0:
|
|
203
|
+
tags = [];
|
|
204
|
+
PisellModal.confirm({
|
|
205
|
+
title: locales.getText('pisell2.orderList.batchAction.addTags.title')(keys.length),
|
|
206
|
+
width: 520,
|
|
207
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
208
|
+
okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
209
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
style: {
|
|
211
|
+
paddingTop: 16
|
|
212
|
+
}
|
|
213
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
214
|
+
style: {
|
|
215
|
+
marginBottom: 8,
|
|
216
|
+
color: '#666'
|
|
217
|
+
}
|
|
218
|
+
}, locales.getText('pisell2.orderList.column.tags')), /*#__PURE__*/React.createElement(PisellQuickFilter, {
|
|
219
|
+
hasForm: false,
|
|
220
|
+
filterList: [{
|
|
221
|
+
name: 'tag_ids',
|
|
222
|
+
type: 'select',
|
|
223
|
+
key: 'tag_ids',
|
|
224
|
+
label: locales.getText('pisell2.orderList.filter.tags.label'),
|
|
225
|
+
other: {
|
|
226
|
+
allowClear: true,
|
|
227
|
+
mode: 'multiple',
|
|
228
|
+
isSearchServer: true,
|
|
229
|
+
showSearch: true,
|
|
230
|
+
onChange: function onChange(value, options) {
|
|
231
|
+
tags = options.map(function (opt) {
|
|
232
|
+
return opt.label;
|
|
233
|
+
});
|
|
234
|
+
},
|
|
235
|
+
style: {
|
|
236
|
+
width: '470px'
|
|
237
|
+
},
|
|
238
|
+
placeholder: locales.getText('pisell2.orderList.filter.tags.placeholder'),
|
|
239
|
+
options: function options(params) {
|
|
240
|
+
return getTagSelectOptions(params).then(function (res) {
|
|
241
|
+
return res.map(function (item) {
|
|
242
|
+
return {
|
|
243
|
+
label: item.name,
|
|
244
|
+
value: item.id
|
|
245
|
+
};
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}]
|
|
251
|
+
})),
|
|
252
|
+
onOk: function () {
|
|
253
|
+
var _onOk3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
254
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
255
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
256
|
+
case 0:
|
|
257
|
+
_context5.prev = 0;
|
|
258
|
+
setLoadingStates(function (prev) {
|
|
259
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
260
|
+
addTags: true
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
_context5.next = 4;
|
|
264
|
+
return batchAddOrderTags({
|
|
265
|
+
name: tags,
|
|
266
|
+
ids: keys
|
|
267
|
+
});
|
|
268
|
+
case 4:
|
|
269
|
+
handleSuccess();
|
|
270
|
+
_context5.next = 10;
|
|
271
|
+
break;
|
|
272
|
+
case 7:
|
|
273
|
+
_context5.prev = 7;
|
|
274
|
+
_context5.t0 = _context5["catch"](0);
|
|
275
|
+
handleError();
|
|
276
|
+
case 10:
|
|
277
|
+
_context5.prev = 10;
|
|
278
|
+
setLoadingStates(function (prev) {
|
|
279
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
280
|
+
addTags: false
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
return _context5.finish(10);
|
|
284
|
+
case 13:
|
|
285
|
+
case "end":
|
|
286
|
+
return _context5.stop();
|
|
287
|
+
}
|
|
288
|
+
}, _callee5, null, [[0, 7, 10, 13]]);
|
|
289
|
+
}));
|
|
290
|
+
function onOk() {
|
|
291
|
+
return _onOk3.apply(this, arguments);
|
|
292
|
+
}
|
|
293
|
+
return onOk;
|
|
294
|
+
}()
|
|
295
|
+
});
|
|
296
|
+
case 2:
|
|
297
|
+
case "end":
|
|
298
|
+
return _context6.stop();
|
|
299
|
+
}
|
|
300
|
+
}, _callee6);
|
|
301
|
+
}));
|
|
302
|
+
return function (_x5, _x6) {
|
|
303
|
+
return _ref3.apply(this, arguments);
|
|
304
|
+
};
|
|
305
|
+
}(), [handleSuccess, handleError]);
|
|
306
|
+
var handleRemoveTags = useCallback( /*#__PURE__*/function () {
|
|
307
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(keys, rows) {
|
|
308
|
+
var tags;
|
|
309
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
310
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
311
|
+
case 0:
|
|
312
|
+
tags = [];
|
|
313
|
+
PisellModal.confirm({
|
|
314
|
+
title: locales.getText('pisell2.orderList.batchAction.removeTags.title')(keys.length),
|
|
315
|
+
width: 520,
|
|
316
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
317
|
+
okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
318
|
+
content: /*#__PURE__*/React.createElement("div", {
|
|
319
|
+
style: {
|
|
320
|
+
paddingTop: 16
|
|
321
|
+
}
|
|
322
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
323
|
+
style: {
|
|
324
|
+
marginBottom: 8,
|
|
325
|
+
color: '#666'
|
|
326
|
+
}
|
|
327
|
+
}, locales.getText('pisell2.orderList.column.tags')), /*#__PURE__*/React.createElement(PisellQuickFilter, {
|
|
328
|
+
hasForm: false,
|
|
329
|
+
filterList: [{
|
|
330
|
+
name: 'tag_ids',
|
|
331
|
+
type: 'select',
|
|
332
|
+
key: 'tag_ids',
|
|
333
|
+
label: locales.getText('pisell2.orderList.filter.tags.label'),
|
|
334
|
+
other: {
|
|
335
|
+
allowClear: true,
|
|
336
|
+
mode: 'multiple',
|
|
337
|
+
isSearchServer: true,
|
|
338
|
+
showSearch: true,
|
|
339
|
+
onChange: function onChange(value, options) {
|
|
340
|
+
tags = options.map(function (opt) {
|
|
341
|
+
return opt.label;
|
|
342
|
+
});
|
|
343
|
+
},
|
|
344
|
+
style: {
|
|
345
|
+
width: '470px'
|
|
346
|
+
},
|
|
347
|
+
placeholder: locales.getText('pisell2.orderList.filter.tags.placeholder'),
|
|
348
|
+
options: function options(params) {
|
|
349
|
+
return getTagSelectOptions(params).then(function (res) {
|
|
350
|
+
return res.map(function (item) {
|
|
351
|
+
return {
|
|
352
|
+
label: item.name,
|
|
353
|
+
value: item.id
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}]
|
|
360
|
+
})),
|
|
361
|
+
onOk: function () {
|
|
362
|
+
var _onOk4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
363
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
364
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
365
|
+
case 0:
|
|
366
|
+
_context7.prev = 0;
|
|
367
|
+
setLoadingStates(function (prev) {
|
|
368
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
369
|
+
removeTags: true
|
|
370
|
+
});
|
|
371
|
+
});
|
|
372
|
+
_context7.next = 4;
|
|
373
|
+
return batchDeleteOrderTags({
|
|
374
|
+
name: tags,
|
|
375
|
+
ids: keys
|
|
376
|
+
});
|
|
377
|
+
case 4:
|
|
378
|
+
handleSuccess();
|
|
379
|
+
_context7.next = 10;
|
|
380
|
+
break;
|
|
381
|
+
case 7:
|
|
382
|
+
_context7.prev = 7;
|
|
383
|
+
_context7.t0 = _context7["catch"](0);
|
|
384
|
+
handleError();
|
|
385
|
+
case 10:
|
|
386
|
+
_context7.prev = 10;
|
|
387
|
+
setLoadingStates(function (prev) {
|
|
388
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
389
|
+
removeTags: false
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
return _context7.finish(10);
|
|
393
|
+
case 13:
|
|
394
|
+
case "end":
|
|
395
|
+
return _context7.stop();
|
|
396
|
+
}
|
|
397
|
+
}, _callee7, null, [[0, 7, 10, 13]]);
|
|
398
|
+
}));
|
|
399
|
+
function onOk() {
|
|
400
|
+
return _onOk4.apply(this, arguments);
|
|
401
|
+
}
|
|
402
|
+
return onOk;
|
|
403
|
+
}()
|
|
404
|
+
});
|
|
405
|
+
case 2:
|
|
406
|
+
case "end":
|
|
407
|
+
return _context8.stop();
|
|
408
|
+
}
|
|
409
|
+
}, _callee8);
|
|
410
|
+
}));
|
|
411
|
+
return function (_x7, _x8) {
|
|
412
|
+
return _ref4.apply(this, arguments);
|
|
413
|
+
};
|
|
414
|
+
}(), [handleSuccess, handleError]);
|
|
415
|
+
var handleMarkAsOpen = useCallback( /*#__PURE__*/function () {
|
|
416
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(keys, rows) {
|
|
417
|
+
var open, completed, cancelled;
|
|
418
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
419
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
420
|
+
case 0:
|
|
421
|
+
open = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
422
|
+
return item.status === 'open';
|
|
423
|
+
}).length;
|
|
424
|
+
completed = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
425
|
+
return item.status === 'completed';
|
|
426
|
+
}).length;
|
|
427
|
+
cancelled = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
428
|
+
return item.status === 'cancelled';
|
|
429
|
+
}).length;
|
|
430
|
+
PisellModal.confirm({
|
|
431
|
+
title: locales.getText('page.order.cancel.title')(locales.getText('pisell2.orderList.orderStatus.open')),
|
|
432
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
433
|
+
okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
434
|
+
content: locales.getText('page.order.lists.cancel.content')(open, completed, cancelled, locales.getText('pisell2.orderList.orderStatus.completed'), true, 'void'),
|
|
435
|
+
onOk: function () {
|
|
436
|
+
var _onOk5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
437
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
438
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
439
|
+
case 0:
|
|
440
|
+
_context9.prev = 0;
|
|
441
|
+
setLoadingStates(function (prev) {
|
|
442
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
443
|
+
markAsOpen: true
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
_context9.next = 4;
|
|
447
|
+
return batchPutOrderStatus({
|
|
448
|
+
order_ids: keys,
|
|
449
|
+
status: 'open'
|
|
450
|
+
});
|
|
451
|
+
case 4:
|
|
452
|
+
handleSuccess();
|
|
453
|
+
_context9.next = 10;
|
|
454
|
+
break;
|
|
455
|
+
case 7:
|
|
456
|
+
_context9.prev = 7;
|
|
457
|
+
_context9.t0 = _context9["catch"](0);
|
|
458
|
+
handleError();
|
|
459
|
+
case 10:
|
|
460
|
+
_context9.prev = 10;
|
|
461
|
+
setLoadingStates(function (prev) {
|
|
462
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
463
|
+
markAsOpen: false
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
return _context9.finish(10);
|
|
467
|
+
case 13:
|
|
468
|
+
case "end":
|
|
469
|
+
return _context9.stop();
|
|
470
|
+
}
|
|
471
|
+
}, _callee9, null, [[0, 7, 10, 13]]);
|
|
472
|
+
}));
|
|
473
|
+
function onOk() {
|
|
474
|
+
return _onOk5.apply(this, arguments);
|
|
475
|
+
}
|
|
476
|
+
return onOk;
|
|
477
|
+
}()
|
|
478
|
+
});
|
|
479
|
+
case 4:
|
|
480
|
+
case "end":
|
|
481
|
+
return _context10.stop();
|
|
482
|
+
}
|
|
483
|
+
}, _callee10);
|
|
484
|
+
}));
|
|
485
|
+
return function (_x9, _x10) {
|
|
486
|
+
return _ref5.apply(this, arguments);
|
|
487
|
+
};
|
|
488
|
+
}(), [handleSuccess, handleError]);
|
|
489
|
+
var handleMarkAsCompleted = useCallback( /*#__PURE__*/function () {
|
|
490
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(keys, rows) {
|
|
491
|
+
var open, completed, cancelled;
|
|
492
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
493
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
494
|
+
case 0:
|
|
495
|
+
open = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
496
|
+
return item.status === 'open';
|
|
497
|
+
}).length;
|
|
498
|
+
completed = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
499
|
+
return item.status === 'completed';
|
|
500
|
+
}).length;
|
|
501
|
+
cancelled = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
502
|
+
return item.status === 'cancelled';
|
|
503
|
+
}).length;
|
|
504
|
+
PisellModal.confirm({
|
|
505
|
+
title: locales.getText('page.order.cancel.title')(locales.getText('pisell2.orderList.orderStatus.completed')),
|
|
506
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
507
|
+
okText: locales.getText('pisell2.orderList.batchAction.button.ok'),
|
|
508
|
+
content: locales.getText('page.order.lists.cancel.content')(open, completed, cancelled, locales.getText('pisell2.orderList.orderStatus.open'), true, ''),
|
|
509
|
+
onOk: function () {
|
|
510
|
+
var _onOk6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
|
|
511
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
512
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
513
|
+
case 0:
|
|
514
|
+
_context11.prev = 0;
|
|
515
|
+
setLoadingStates(function (prev) {
|
|
516
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
517
|
+
markAsCompleted: true
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
_context11.next = 4;
|
|
521
|
+
return batchPutOrderStatus({
|
|
522
|
+
order_ids: keys,
|
|
523
|
+
status: 'completed'
|
|
524
|
+
});
|
|
525
|
+
case 4:
|
|
526
|
+
handleSuccess();
|
|
527
|
+
_context11.next = 10;
|
|
528
|
+
break;
|
|
529
|
+
case 7:
|
|
530
|
+
_context11.prev = 7;
|
|
531
|
+
_context11.t0 = _context11["catch"](0);
|
|
532
|
+
handleError();
|
|
533
|
+
case 10:
|
|
534
|
+
_context11.prev = 10;
|
|
535
|
+
setLoadingStates(function (prev) {
|
|
536
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
537
|
+
markAsCompleted: false
|
|
538
|
+
});
|
|
539
|
+
});
|
|
540
|
+
return _context11.finish(10);
|
|
541
|
+
case 13:
|
|
542
|
+
case "end":
|
|
543
|
+
return _context11.stop();
|
|
544
|
+
}
|
|
545
|
+
}, _callee11, null, [[0, 7, 10, 13]]);
|
|
546
|
+
}));
|
|
547
|
+
function onOk() {
|
|
548
|
+
return _onOk6.apply(this, arguments);
|
|
549
|
+
}
|
|
550
|
+
return onOk;
|
|
551
|
+
}()
|
|
552
|
+
});
|
|
553
|
+
case 4:
|
|
554
|
+
case "end":
|
|
555
|
+
return _context12.stop();
|
|
556
|
+
}
|
|
557
|
+
}, _callee12);
|
|
558
|
+
}));
|
|
559
|
+
return function (_x11, _x12) {
|
|
560
|
+
return _ref6.apply(this, arguments);
|
|
561
|
+
};
|
|
562
|
+
}(), [handleSuccess, handleError]);
|
|
563
|
+
var handleMarkAsCancelled = useCallback( /*#__PURE__*/function () {
|
|
564
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(keys, rows) {
|
|
565
|
+
var open, completed, cancelled, executeCancelOrder, modalInstance;
|
|
566
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
567
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
568
|
+
case 0:
|
|
569
|
+
open = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
570
|
+
return item.status === 'open';
|
|
571
|
+
}).length;
|
|
572
|
+
completed = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
573
|
+
return item.status === 'completed';
|
|
574
|
+
}).length;
|
|
575
|
+
cancelled = rows === null || rows === void 0 ? void 0 : rows.filter(function (item) {
|
|
576
|
+
return item.status === 'cancelled';
|
|
577
|
+
}).length;
|
|
578
|
+
executeCancelOrder = /*#__PURE__*/function () {
|
|
579
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(isVoid) {
|
|
580
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
581
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
582
|
+
case 0:
|
|
583
|
+
_context13.prev = 0;
|
|
584
|
+
setLoadingStates(function (prev) {
|
|
585
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
586
|
+
markAsCancelled: true
|
|
587
|
+
});
|
|
588
|
+
});
|
|
589
|
+
_context13.next = 4;
|
|
590
|
+
return batchPutOrderStatus(_objectSpread({
|
|
591
|
+
order_ids: keys,
|
|
592
|
+
status: 'cancelled'
|
|
593
|
+
}, isVoid === 1 && {
|
|
594
|
+
is_void: isVoid
|
|
595
|
+
}));
|
|
596
|
+
case 4:
|
|
597
|
+
handleSuccess();
|
|
598
|
+
modalInstance.destroy();
|
|
599
|
+
_context13.next = 11;
|
|
600
|
+
break;
|
|
601
|
+
case 8:
|
|
602
|
+
_context13.prev = 8;
|
|
603
|
+
_context13.t0 = _context13["catch"](0);
|
|
604
|
+
handleError();
|
|
605
|
+
case 11:
|
|
606
|
+
_context13.prev = 11;
|
|
607
|
+
setLoadingStates(function (prev) {
|
|
608
|
+
return _objectSpread(_objectSpread({}, prev), {}, {
|
|
609
|
+
markAsCancelled: false
|
|
610
|
+
});
|
|
611
|
+
});
|
|
612
|
+
return _context13.finish(11);
|
|
613
|
+
case 14:
|
|
614
|
+
case "end":
|
|
615
|
+
return _context13.stop();
|
|
616
|
+
}
|
|
617
|
+
}, _callee13, null, [[0, 8, 11, 14]]);
|
|
618
|
+
}));
|
|
619
|
+
return function executeCancelOrder(_x15) {
|
|
620
|
+
return _ref8.apply(this, arguments);
|
|
621
|
+
};
|
|
622
|
+
}();
|
|
623
|
+
modalInstance = PisellModal.confirm({
|
|
624
|
+
title: locales.getText('page.order.cancel.title')(locales.getText('pisell2.orderList.orderStatus.cancelled')),
|
|
625
|
+
content: locales.getText('page.order.lists.cancel.content')(open, completed, cancelled, locales.getText('pisell2.orderList.orderStatus.cancelled'), true, ''),
|
|
626
|
+
cancelText: locales.getText('pisell2.orderList.batchAction.button.cancel'),
|
|
627
|
+
footer: function footer() {
|
|
628
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
629
|
+
style: {
|
|
630
|
+
display: 'flex',
|
|
631
|
+
gap: 10,
|
|
632
|
+
justifyContent: 'flex-end',
|
|
633
|
+
width: '100%'
|
|
634
|
+
}
|
|
635
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
636
|
+
key: "cancel",
|
|
637
|
+
onClick: function onClick() {
|
|
638
|
+
return modalInstance.destroy();
|
|
639
|
+
}
|
|
640
|
+
}, locales.getText('pisell2.orderList.batchAction.button.cancel')), /*#__PURE__*/React.createElement(Button, {
|
|
641
|
+
key: "only-cancel",
|
|
642
|
+
onClick: function onClick() {
|
|
643
|
+
return executeCancelOrder(0);
|
|
644
|
+
},
|
|
645
|
+
loading: loadingStates.markAsCancelled
|
|
646
|
+
}, locales.getText('pisell2.orderList.batchAction.button.onlyCancel')), /*#__PURE__*/React.createElement(Button, {
|
|
647
|
+
key: "cancel-void",
|
|
648
|
+
type: "primary",
|
|
649
|
+
onClick: function onClick() {
|
|
650
|
+
return executeCancelOrder(1);
|
|
651
|
+
},
|
|
652
|
+
loading: loadingStates.markAsCancelled
|
|
653
|
+
}, locales.getText('pisell2.orderList.batchAction.button.cancelAndVoid')));
|
|
654
|
+
}
|
|
655
|
+
});
|
|
656
|
+
case 5:
|
|
657
|
+
case "end":
|
|
658
|
+
return _context14.stop();
|
|
659
|
+
}
|
|
660
|
+
}, _callee14);
|
|
661
|
+
}));
|
|
662
|
+
return function (_x13, _x14) {
|
|
663
|
+
return _ref7.apply(this, arguments);
|
|
664
|
+
};
|
|
665
|
+
}(), [handleSuccess, handleError, loadingStates.markAsCancelled]);
|
|
666
|
+
var actions = useMemo(function () {
|
|
667
|
+
return [{
|
|
668
|
+
key: 'ship',
|
|
669
|
+
label: locales.getText('page.order.table.shipping_status.mark.fulfilled'),
|
|
670
|
+
icon: 'pisell2-check-circle-broken',
|
|
671
|
+
loading: loadingStates.ship,
|
|
672
|
+
onClick: handleShip
|
|
673
|
+
}, {
|
|
674
|
+
key: 'invoice',
|
|
675
|
+
label: locales.getText('page.order.table.list.button.send.invoice'),
|
|
676
|
+
icon: 'pisell2-sticker-square',
|
|
677
|
+
loading: loadingStates.invoice,
|
|
678
|
+
onClick: handleInvoice
|
|
679
|
+
}, {
|
|
680
|
+
key: 'print-pack',
|
|
681
|
+
label: locales.getText('page.order.table.list.printpack'),
|
|
682
|
+
icon: 'pisell2-cube-01',
|
|
683
|
+
onClick: handlePrintPack
|
|
684
|
+
}, {
|
|
685
|
+
key: 'print-picking',
|
|
686
|
+
label: locales.getText('page.order.table.list.printpink'),
|
|
687
|
+
icon: 'pisell2-package',
|
|
688
|
+
onClick: handlePrintPicking
|
|
689
|
+
}, {
|
|
690
|
+
key: 'add-tags',
|
|
691
|
+
label: locales.getText('page.order.text.addtags.button'),
|
|
692
|
+
icon: 'pisell2-tag-01',
|
|
693
|
+
loading: loadingStates.addTags,
|
|
694
|
+
onClick: handleAddTags
|
|
695
|
+
}, {
|
|
696
|
+
key: 'remove-tags',
|
|
697
|
+
label: locales.getText('page.order.table.list.deletetag'),
|
|
698
|
+
icon: 'pisell2-tag-01',
|
|
699
|
+
loading: loadingStates.removeTags,
|
|
700
|
+
onClick: handleRemoveTags
|
|
701
|
+
}, {
|
|
702
|
+
key: 'mark-as-open',
|
|
703
|
+
label: locales.getText('page.order.open'),
|
|
704
|
+
icon: 'pisell2-clipboard',
|
|
705
|
+
loading: loadingStates.markAsOpen,
|
|
706
|
+
onClick: handleMarkAsOpen
|
|
707
|
+
}, {
|
|
708
|
+
key: 'mark-as-completed',
|
|
709
|
+
label: locales.getText('page.order.completeds'),
|
|
710
|
+
icon: 'pisell2-clipboard-check',
|
|
711
|
+
loading: loadingStates.markAsCompleted,
|
|
712
|
+
onClick: handleMarkAsCompleted
|
|
713
|
+
}, {
|
|
714
|
+
key: 'mark-as-cancelled',
|
|
715
|
+
label: locales.getText('page.order.cancelleds'),
|
|
716
|
+
icon: 'pisell2-slash-circle-01',
|
|
717
|
+
loading: loadingStates.markAsCancelled,
|
|
718
|
+
onClick: handleMarkAsCancelled
|
|
719
|
+
}];
|
|
720
|
+
}, [loadingStates.ship, loadingStates.invoice, loadingStates.addTags, loadingStates.removeTags, loadingStates.markAsOpen, loadingStates.markAsCompleted, loadingStates.markAsCancelled, handleShip, handleInvoice, handlePrintPack, handlePrintPicking, handleAddTags, handleRemoveTags, handleMarkAsOpen, handleMarkAsCompleted, handleMarkAsCancelled]);
|
|
721
|
+
return actions;
|
|
722
|
+
};
|
|
723
|
+
export default useActions;
|