@pisell/pisellos 0.10.17 → 0.10.19

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.
@@ -6,6 +6,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
6
6
  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); }
7
7
  import dayjs from 'dayjs';
8
8
  import { getDateIsInSchedule } from "../Schedule/getDateIsInSchedule";
9
+ import { INVOICE_MODULE_KEYS } from "./types";
9
10
  function isRecord(value) {
10
11
  return !!value && _typeof(value) === 'object' && !Array.isArray(value);
11
12
  }
@@ -22,7 +23,12 @@ function parseInvoiceRecord(value) {
22
23
  }
23
24
  export function getDefaultInvoiceLayoutConfig() {
24
25
  return {
25
- module: []
26
+ module: INVOICE_MODULE_KEYS.map(function (key) {
27
+ return {
28
+ key: key,
29
+ is_show: 1
30
+ };
31
+ })
26
32
  };
27
33
  }
28
34
  export function getDefaultInvoiceTemplateSettings() {
@@ -82,8 +88,10 @@ export function normalizeInvoiceTemplateSettings(config) {
82
88
  * 将 invoice_edit.modules 原样投影为 Web Invoice 使用的 module 字段。
83
89
  */
84
90
  export function normalizeInvoiceLayoutConfig(config) {
91
+ var modules = normalizeInvoiceTemplateSettings(config).modules;
92
+ if (modules.length === 0) return getDefaultInvoiceLayoutConfig();
85
93
  return {
86
- module: normalizeInvoiceTemplateSettings(config).modules
94
+ module: modules
87
95
  };
88
96
  }
89
97
  function toBoolean(value) {
@@ -5751,23 +5751,18 @@ var Server = /*#__PURE__*/function () {
5751
5751
  device_id: (_params$deviceId = params.deviceId) !== null && _params$deviceId !== void 0 ? _params$deviceId : deviceId,
5752
5752
  payload: {
5753
5753
  type: params.isManualPrint ? '0' : '99',
5754
+ template_settings: this.normalizePrintInvoiceTemplateSettings(params.invoiceTemplateSettings),
5754
5755
  data: params.receiptOnly ? {
5755
5756
  order_id: printIdentity,
5756
5757
  small_ticket_data: (_params$syncedOrder = params.syncedOrder) === null || _params$syncedOrder === void 0 || (_params$syncedOrder = _params$syncedOrder.payment_info) === null || _params$syncedOrder === void 0 ? void 0 : _params$syncedOrder.small_ticket_data,
5757
- invoice: this.normalizePrintInvoiceLayoutConfig(params.invoiceLayoutConfig),
5758
- template_settings: this.normalizePrintInvoiceTemplateSettings(params.invoiceTemplateSettings),
5759
5758
  skip_wristband: true,
5760
5759
  skip_voucher: true
5761
- } : _objectSpread(_objectSpread({
5760
+ } : {
5762
5761
  order_id: printIdentity,
5763
5762
  machine_code_print_info: (_params$syncedOrder2 = params.syncedOrder) === null || _params$syncedOrder2 === void 0 || (_params$syncedOrder2 = _params$syncedOrder2.payment_info) === null || _params$syncedOrder2 === void 0 ? void 0 : _params$syncedOrder2.machine_code_print_info,
5764
- machine_code_print_info_v2: (_params$syncedOrder3 = params.syncedOrder) === null || _params$syncedOrder3 === void 0 ? void 0 : _params$syncedOrder3.machine_code_print_info_v2
5765
- }, params.invoiceLayoutConfig ? {
5766
- invoice: this.normalizePrintInvoiceLayoutConfig(params.invoiceLayoutConfig)
5767
- } : {}), {}, {
5768
- template_settings: this.normalizePrintInvoiceTemplateSettings(params.invoiceTemplateSettings),
5763
+ machine_code_print_info_v2: (_params$syncedOrder3 = params.syncedOrder) === null || _params$syncedOrder3 === void 0 ? void 0 : _params$syncedOrder3.machine_code_print_info_v2,
5769
5764
  skip_receipt: true
5770
- })
5765
+ }
5771
5766
  },
5772
5767
  idempotency_key: this.buildPrintOtherReceiptIdempotencyKey(params.syncedOrder, {
5773
5768
  receiptOnly: params.receiptOnly
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
329
+ weekNum: 0 | 1 | 2 | 3 | 4 | 6 | 5;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -339,7 +339,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
339
339
  * 获取当前的客户搜索条件
340
340
  * @returns 当前搜索条件
341
341
  */
342
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
342
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
343
343
  /**
344
344
  * 获取客户列表状态(包含滚动加载相关状态)
345
345
  * @returns 客户状态
@@ -253,11 +253,15 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
253
253
  }, {
254
254
  key: "getBookingTicketBusinessCode",
255
255
  value: function getBookingTicketBusinessCode() {
256
- var _this$otherParams$bus, _this$otherParams2, _this$otherParams3;
257
- var businessCode = (_this$otherParams$bus = (_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.businessCode) !== null && _this$otherParams$bus !== void 0 ? _this$otherParams$bus : (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.business_code;
258
- if (businessCode === undefined || businessCode === null) return null;
259
- var normalized = String(businessCode).trim();
260
- return normalized || null;
256
+ var _this$otherParams2, _this$otherParams3, _this$getOrderHeader, _this$store$order, _this$getSalesOrder;
257
+ var candidates = [(_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.businessCode, (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.business_code, (_this$getOrderHeader = this.getOrderHeader()) === null || _this$getOrderHeader === void 0 ? void 0 : _this$getOrderHeader.business_code, (_this$store$order = this.store.order) === null || _this$store$order === void 0 || (_this$store$order = _this$store$order.getTempOrder()) === null || _this$store$order === void 0 ? void 0 : _this$store$order.business_code, (_this$getSalesOrder = this.getSalesOrder()) === null || _this$getSalesOrder === void 0 || (_this$getSalesOrder = _this$getSalesOrder.raw) === null || _this$getSalesOrder === void 0 ? void 0 : _this$getSalesOrder.business_code];
258
+ for (var _i = 0, _candidates = candidates; _i < _candidates.length; _i++) {
259
+ var candidate = _candidates[_i];
260
+ if (candidate === undefined || candidate === null) continue;
261
+ var normalized = String(candidate).trim();
262
+ if (normalized) return normalized;
263
+ }
264
+ return null;
261
265
  }
262
266
  }, {
263
267
  key: "getIdGeneratorPlugin",
@@ -916,12 +920,12 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
916
920
  key: "setBookingStatus",
917
921
  value: (function () {
918
922
  var _setBookingStatus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(status) {
919
- var _this$store$order, _this$store$order$get;
923
+ var _this$store$order2, _this$store$order2$ge;
920
924
  var tempOrder, orderId, scheduleId, bookings, previous, _data, res;
921
925
  return _regeneratorRuntime().wrap(function _callee12$(_context12) {
922
926
  while (1) switch (_context12.prev = _context12.next) {
923
927
  case 0:
924
- tempOrder = (_this$store$order = this.store.order) === null || _this$store$order === void 0 || (_this$store$order$get = _this$store$order.getTempOrder) === null || _this$store$order$get === void 0 ? void 0 : _this$store$order$get.call(_this$store$order);
928
+ tempOrder = (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || (_this$store$order2$ge = _this$store$order2.getTempOrder) === null || _this$store$order2$ge === void 0 ? void 0 : _this$store$order2$ge.call(_this$store$order2);
925
929
  if (tempOrder) {
926
930
  _context12.next = 3;
927
931
  break;
@@ -1000,7 +1004,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1000
1004
  key: "transitionChildBooking",
1001
1005
  value: (function () {
1002
1006
  var _transitionChildBooking = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(params) {
1003
- var _this$store$order2, _this$store$order2$ge;
1007
+ var _this$store$order3, _this$store$order3$ge;
1004
1008
  var schedule_event_id, action, tempOrder, orderId, bookings, targetStatus, previous, _data2, res;
1005
1009
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1006
1010
  while (1) switch (_context13.prev = _context13.next) {
@@ -1018,7 +1022,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1018
1022
  }
1019
1023
  throw new Error('transitionChildBooking: action 不能为空');
1020
1024
  case 5:
1021
- tempOrder = (_this$store$order2 = this.store.order) === null || _this$store$order2 === void 0 || (_this$store$order2$ge = _this$store$order2.getTempOrder) === null || _this$store$order2$ge === void 0 ? void 0 : _this$store$order2$ge.call(_this$store$order2);
1025
+ tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getTempOrder) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
1022
1026
  if (tempOrder) {
1023
1027
  _context13.next = 8;
1024
1028
  break;
@@ -1085,7 +1089,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1085
1089
  key: "refreshSalesDetail",
1086
1090
  value: (function () {
1087
1091
  var _refreshSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14() {
1088
- var _this$store$order3, _this$store$order3$ge;
1092
+ var _this$store$order4, _this$store$order4$ge;
1089
1093
  var params,
1090
1094
  tempOrder,
1091
1095
  orderId,
@@ -1094,7 +1098,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1094
1098
  while (1) switch (_context14.prev = _context14.next) {
1095
1099
  case 0:
1096
1100
  params = _args14.length > 0 && _args14[0] !== undefined ? _args14[0] : {};
1097
- tempOrder = (_this$store$order3 = this.store.order) === null || _this$store$order3 === void 0 || (_this$store$order3$ge = _this$store$order3.getTempOrder) === null || _this$store$order3$ge === void 0 ? void 0 : _this$store$order3$ge.call(_this$store$order3);
1101
+ tempOrder = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 || (_this$store$order4$ge = _this$store$order4.getTempOrder) === null || _this$store$order4$ge === void 0 ? void 0 : _this$store$order4$ge.call(_this$store$order4);
1098
1102
  if (tempOrder) {
1099
1103
  _context14.next = 4;
1100
1104
  break;
@@ -1377,8 +1381,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1377
1381
  }, {
1378
1382
  key: "getCart",
1379
1383
  value: function getCart() {
1380
- var _this$store$order$get2, _this$store$order4, _salesDetail$bookings, _operatingDayBoundary, _operatingDayBoundary2, _tempOrder$_extend;
1381
- var tempOrder = (_this$store$order$get2 = (_this$store$order4 = this.store.order) === null || _this$store$order4 === void 0 ? void 0 : _this$store$order4.getTempOrder()) !== null && _this$store$order$get2 !== void 0 ? _this$store$order$get2 : null;
1384
+ var _this$store$order$get, _this$store$order5, _salesDetail$bookings, _operatingDayBoundary, _operatingDayBoundary2, _tempOrder$_extend;
1385
+ var tempOrder = (_this$store$order$get = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 ? void 0 : _this$store$order5.getTempOrder()) !== null && _this$store$order$get !== void 0 ? _this$store$order$get : null;
1382
1386
  var salesDetail = this.getSalesOrder();
1383
1387
  var bookings = (_salesDetail$bookings = salesDetail === null || salesDetail === void 0 ? void 0 : salesDetail.bookings) !== null && _salesDetail$bookings !== void 0 ? _salesDetail$bookings : (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.bookings) || [];
1384
1388
  var operatingDayBoundary;
@@ -1665,13 +1669,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1665
1669
  }, {
1666
1670
  key: "setOrderCustomer",
1667
1671
  value: function setOrderCustomer(customer, options) {
1668
- var _this$store$order$get3,
1672
+ var _this$store$order$get2,
1669
1673
  _this3 = this;
1670
1674
  if (!customer) {
1671
1675
  this.clearOrderCustomer();
1672
1676
  return;
1673
1677
  }
1674
- var previousCustomerId = (_this$store$order$get3 = this.store.order.getOrderCustomer()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id;
1678
+ var previousCustomerId = (_this$store$order$get2 = this.store.order.getOrderCustomer()) === null || _this$store$order$get2 === void 0 ? void 0 : _this$store$order$get2.customer_id;
1675
1679
  var snapshotBeforeSet = this.store.order.getOrderCustomerSnapshot();
1676
1680
  var patch = formatOrderCustomerPatch(customer);
1677
1681
  var customerUnchanged = Number(previousCustomerId || 0) === Number(patch.customer_id || 0);
@@ -2428,10 +2432,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2428
2432
  }, {
2429
2433
  key: "buildAddProductCtx",
2430
2434
  value: function buildAddProductCtx(extra) {
2431
- var _extra$date2, _ref12, _this$getOrderCustome4, _this$getOrderCustome5, _this$store$order$get4, _extra$presetStartTim2;
2435
+ var _extra$date2, _ref12, _this$getOrderCustome4, _this$getOrderCustome5, _this$store$order$get3, _extra$presetStartTim2;
2432
2436
  var bookingContextState = this.store.bookingContext.getState();
2433
2437
  var date = (_extra$date2 = extra === null || extra === void 0 ? void 0 : extra.date) !== null && _extra$date2 !== void 0 ? _extra$date2 : bookingContextState.date;
2434
- var orderCustomerId = (_ref12 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get4 = this.store.order.getTempOrder()) === null || _this$store$order$get4 === void 0 ? void 0 : _this$store$order$get4.customer_id) !== null && _ref12 !== void 0 ? _ref12 : undefined;
2438
+ var orderCustomerId = (_ref12 = (_this$getOrderCustome4 = (_this$getOrderCustome5 = this.getOrderCustomerSnapshot()) === null || _this$getOrderCustome5 === void 0 ? void 0 : _this$getOrderCustome5.id) !== null && _this$getOrderCustome4 !== void 0 ? _this$getOrderCustome4 : (_this$store$order$get3 = this.store.order.getTempOrder()) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.customer_id) !== null && _ref12 !== void 0 ? _ref12 : undefined;
2435
2439
  return _objectSpread(_objectSpread({
2436
2440
  bookingConfig: bookingContextState.bookingConfig,
2437
2441
  resourcesOrigin: bookingContextState.resourcesOrigin,
@@ -2987,7 +2991,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2987
2991
  key: "handleRedeem",
2988
2992
  value: function () {
2989
2993
  var _handleRedeem = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(params) {
2990
- var _this$store$order5, _this$store$order5$ge, _this$store$order6, _ref20, _tempOrder$order_id2;
2994
+ var _this$store$order6, _this$store$order6$ge, _this$store$order7, _ref20, _tempOrder$order_id2;
2991
2995
  var voucherIds, status, voucherIdSet, tempOrder, vouchers, hasUpdatedVoucher, nextVouchers, identity, externalSaleNumber, orderId, orderLookup;
2992
2996
  return _regeneratorRuntime().wrap(function _callee36$(_context36) {
2993
2997
  while (1) switch (_context36.prev = _context36.next) {
@@ -3003,8 +3007,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3003
3007
  }
3004
3008
  });
3005
3009
  voucherIdSet = new Set(voucherIds);
3006
- tempOrder = (_this$store$order5 = this.store.order) === null || _this$store$order5 === void 0 || (_this$store$order5$ge = _this$store$order5.getTempOrder) === null || _this$store$order5$ge === void 0 ? void 0 : _this$store$order5$ge.call(_this$store$order5);
3007
- vouchers = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.vouchers) || ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 ? void 0 : _this$store$order6.getVouchers()) || [];
3010
+ tempOrder = (_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 || (_this$store$order6$ge = _this$store$order6.getTempOrder) === null || _this$store$order6$ge === void 0 ? void 0 : _this$store$order6$ge.call(_this$store$order6);
3011
+ vouchers = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.vouchers) || ((_this$store$order7 = this.store.order) === null || _this$store$order7 === void 0 ? void 0 : _this$store$order7.getVouchers()) || [];
3008
3012
  hasUpdatedVoucher = false;
3009
3013
  nextVouchers = vouchers.map(function (voucher) {
3010
3014
  if (!voucherIdSet.has(voucher.voucher_id)) return voucher;
@@ -11,6 +11,7 @@ exports.normalizeInvoiceTemplateSettings = normalizeInvoiceTemplateSettings;
11
11
  exports.normalizeRawInvoiceTemplateSettings = normalizeRawInvoiceTemplateSettings;
12
12
  var _dayjs = _interopRequireDefault(require("dayjs"));
13
13
  var _getDateIsInSchedule = require("../Schedule/getDateIsInSchedule");
14
+ var _types = require("./types");
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
16
  function isRecord(value) {
16
17
  return !!value && typeof value === 'object' && !Array.isArray(value);
@@ -28,7 +29,10 @@ function parseInvoiceRecord(value) {
28
29
  }
29
30
  function getDefaultInvoiceLayoutConfig() {
30
31
  return {
31
- module: []
32
+ module: _types.INVOICE_MODULE_KEYS.map(key => ({
33
+ key,
34
+ is_show: 1
35
+ }))
32
36
  };
33
37
  }
34
38
  function getDefaultInvoiceTemplateSettings() {
@@ -88,8 +92,10 @@ function normalizeInvoiceTemplateSettings(config) {
88
92
  * 将 invoice_edit.modules 原样投影为 Web Invoice 使用的 module 字段。
89
93
  */
90
94
  function normalizeInvoiceLayoutConfig(config) {
95
+ const modules = normalizeInvoiceTemplateSettings(config).modules;
96
+ if (modules.length === 0) return getDefaultInvoiceLayoutConfig();
91
97
  return {
92
- module: normalizeInvoiceTemplateSettings(config).modules
98
+ module: modules
93
99
  };
94
100
  }
95
101
  function toBoolean(value) {
@@ -3682,21 +3682,16 @@ class Server {
3682
3682
  device_id: params.deviceId ?? deviceId,
3683
3683
  payload: {
3684
3684
  type: params.isManualPrint ? '0' : '99',
3685
+ template_settings: this.normalizePrintInvoiceTemplateSettings(params.invoiceTemplateSettings),
3685
3686
  data: params.receiptOnly ? {
3686
3687
  order_id: printIdentity,
3687
3688
  small_ticket_data: params.syncedOrder?.payment_info?.small_ticket_data,
3688
- invoice: this.normalizePrintInvoiceLayoutConfig(params.invoiceLayoutConfig),
3689
- template_settings: this.normalizePrintInvoiceTemplateSettings(params.invoiceTemplateSettings),
3690
3689
  skip_wristband: true,
3691
3690
  skip_voucher: true
3692
3691
  } : {
3693
3692
  order_id: printIdentity,
3694
3693
  machine_code_print_info: params.syncedOrder?.payment_info?.machine_code_print_info,
3695
3694
  machine_code_print_info_v2: params.syncedOrder?.machine_code_print_info_v2,
3696
- ...(params.invoiceLayoutConfig ? {
3697
- invoice: this.normalizePrintInvoiceLayoutConfig(params.invoiceLayoutConfig)
3698
- } : {}),
3699
- template_settings: this.normalizePrintInvoiceTemplateSettings(params.invoiceTemplateSettings),
3700
3695
  skip_receipt: true
3701
3696
  }
3702
3697
  },
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
329
+ weekNum: 0 | 1 | 2 | 3 | 4 | 6 | 5;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -339,7 +339,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
339
339
  * 获取当前的客户搜索条件
340
340
  * @returns 当前搜索条件
341
341
  */
342
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
342
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
343
343
  /**
344
344
  * 获取客户列表状态(包含滚动加载相关状态)
345
345
  * @returns 客户状态
@@ -196,10 +196,13 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
196
196
  await this.configureIdGeneratorFromOpenData();
197
197
  }
198
198
  getBookingTicketBusinessCode() {
199
- const businessCode = this.otherParams?.businessCode ?? this.otherParams?.business_code;
200
- if (businessCode === undefined || businessCode === null) return null;
201
- const normalized = String(businessCode).trim();
202
- return normalized || null;
199
+ const candidates = [this.otherParams?.businessCode, this.otherParams?.business_code, this.getOrderHeader()?.business_code, this.store.order?.getTempOrder()?.business_code, this.getSalesOrder()?.raw?.business_code];
200
+ for (const candidate of candidates) {
201
+ if (candidate === undefined || candidate === null) continue;
202
+ const normalized = String(candidate).trim();
203
+ if (normalized) return normalized;
204
+ }
205
+ return null;
203
206
  }
204
207
  getIdGeneratorPlugin() {
205
208
  const appPlugin = this.core.getPlugin('app');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.17",
4
+ "version": "0.10.19",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",