@pisell/pisellos 2.2.180 → 2.2.182

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.
Files changed (175) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/BookingContext/index.d.ts +37 -0
  3. package/dist/modules/BookingContext/index.js +436 -0
  4. package/dist/modules/BookingContext/types.d.ts +102 -0
  5. package/dist/modules/BookingContext/types.js +51 -0
  6. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  7. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
  8. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  9. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +137 -0
  10. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
  11. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +215 -0
  12. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  13. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  14. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  15. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  16. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  17. package/dist/modules/BookingContext/utils/index.js +11 -0
  18. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  19. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  20. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  21. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  22. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  23. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  24. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  25. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  26. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  27. package/dist/modules/BookingContext/utils/resources.js +486 -0
  28. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  29. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  30. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  31. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  32. package/dist/modules/Customer/index.d.ts +6 -0
  33. package/dist/modules/Customer/index.js +129 -83
  34. package/dist/modules/Customer/types.d.ts +2 -0
  35. package/dist/modules/Discount/index.js +4 -3
  36. package/dist/modules/Discount/types.d.ts +1 -0
  37. package/dist/modules/Order/index.d.ts +101 -10
  38. package/dist/modules/Order/index.js +1444 -490
  39. package/dist/modules/Order/types.d.ts +201 -18
  40. package/dist/modules/Order/types.js +31 -0
  41. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  42. package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
  43. package/dist/modules/Order/utils.d.ts +83 -1
  44. package/dist/modules/Order/utils.js +405 -61
  45. package/dist/modules/Product/index.d.ts +1 -1
  46. package/dist/modules/Quotation/index.d.ts +0 -1
  47. package/dist/modules/Quotation/index.js +23 -21
  48. package/dist/modules/Rules/index.d.ts +4 -0
  49. package/dist/modules/Rules/index.js +43 -39
  50. package/dist/modules/Rules/types.d.ts +1 -0
  51. package/dist/modules/SalesSummary/index.js +4 -2
  52. package/dist/modules/SalesSummary/utils.js +21 -7
  53. package/dist/modules/Schedule/index.js +6 -2
  54. package/dist/modules/index.d.ts +1 -0
  55. package/dist/modules/index.js +2 -1
  56. package/dist/server/index.js +87 -29
  57. package/dist/server/modules/order/index.d.ts +23 -0
  58. package/dist/server/modules/order/index.js +123 -46
  59. package/dist/server/modules/order/utils/filterOrders.js +20 -6
  60. package/dist/server/modules/products/index.d.ts +1 -1
  61. package/dist/server/modules/products/index.js +130 -113
  62. package/dist/server/modules/schedule/index.js +13 -6
  63. package/dist/solution/BaseSales/index.d.ts +89 -7
  64. package/dist/solution/BaseSales/index.js +1489 -366
  65. package/dist/solution/BaseSales/types.d.ts +67 -1
  66. package/dist/solution/BaseSales/types.js +3 -1
  67. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +275 -0
  68. package/dist/solution/BaseSales/utils/cartPromotion.js +1258 -0
  69. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  70. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  71. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +68 -16
  72. package/dist/solution/BaseSales/utils.js +46 -8
  73. package/dist/solution/BookingByStep/index.d.ts +1 -1
  74. package/dist/solution/BookingTicket/index.d.ts +152 -2
  75. package/dist/solution/BookingTicket/index.js +848 -184
  76. package/dist/solution/BookingTicket/types.d.ts +2 -0
  77. package/dist/solution/BookingTicket/types.js +3 -0
  78. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
  79. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  80. package/dist/solution/BookingTicket/utils/cartView.js +4 -2
  81. package/dist/solution/ScanOrder/index.d.ts +9 -3
  82. package/dist/solution/ScanOrder/index.js +231 -128
  83. package/dist/solution/ScanOrder/utils.js +46 -8
  84. package/dist/solution/VenueBooking/index.d.ts +5 -2
  85. package/dist/solution/VenueBooking/index.js +103 -55
  86. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  87. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  88. package/lib/model/strategy/adapter/promotion/index.js +49 -0
  89. package/lib/modules/BookingContext/index.d.ts +37 -0
  90. package/lib/modules/BookingContext/index.js +297 -0
  91. package/lib/modules/BookingContext/types.d.ts +102 -0
  92. package/lib/modules/BookingContext/types.js +34 -0
  93. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  94. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +271 -0
  95. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  96. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +141 -0
  97. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
  98. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +198 -0
  99. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  100. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  101. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  102. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  103. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  104. package/lib/modules/BookingContext/utils/index.js +43 -0
  105. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  106. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  107. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  108. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  109. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  110. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  111. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  112. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  113. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  114. package/lib/modules/BookingContext/utils/resources.js +377 -0
  115. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  116. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  117. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  118. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  119. package/lib/modules/Customer/index.d.ts +6 -0
  120. package/lib/modules/Customer/index.js +26 -11
  121. package/lib/modules/Customer/types.d.ts +2 -0
  122. package/lib/modules/Discount/index.js +5 -1
  123. package/lib/modules/Discount/types.d.ts +1 -0
  124. package/lib/modules/Order/index.d.ts +101 -10
  125. package/lib/modules/Order/index.js +751 -114
  126. package/lib/modules/Order/types.d.ts +201 -18
  127. package/lib/modules/Order/types.js +1 -0
  128. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  129. package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
  130. package/lib/modules/Order/utils.d.ts +83 -1
  131. package/lib/modules/Order/utils.js +340 -22
  132. package/lib/modules/Product/index.d.ts +1 -1
  133. package/lib/modules/Quotation/index.d.ts +0 -1
  134. package/lib/modules/Quotation/index.js +18 -15
  135. package/lib/modules/Rules/index.d.ts +4 -0
  136. package/lib/modules/Rules/index.js +26 -27
  137. package/lib/modules/Rules/types.d.ts +1 -0
  138. package/lib/modules/SalesSummary/index.js +4 -2
  139. package/lib/modules/SalesSummary/utils.js +21 -7
  140. package/lib/modules/Schedule/index.js +3 -1
  141. package/lib/modules/index.d.ts +1 -0
  142. package/lib/modules/index.js +3 -1
  143. package/lib/server/index.js +41 -4
  144. package/lib/server/modules/order/index.d.ts +23 -0
  145. package/lib/server/modules/order/index.js +46 -14
  146. package/lib/server/modules/order/utils/filterOrders.js +12 -4
  147. package/lib/server/modules/products/index.d.ts +1 -1
  148. package/lib/server/modules/products/index.js +30 -20
  149. package/lib/server/modules/schedule/index.js +2 -1
  150. package/lib/solution/BaseSales/index.d.ts +89 -7
  151. package/lib/solution/BaseSales/index.js +742 -23
  152. package/lib/solution/BaseSales/types.d.ts +67 -1
  153. package/lib/solution/BaseSales/types.js +3 -1
  154. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +275 -0
  155. package/lib/solution/BaseSales/utils/cartPromotion.js +836 -0
  156. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  157. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  158. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +71 -12
  159. package/lib/solution/BaseSales/utils.js +46 -6
  160. package/lib/solution/BookingByStep/index.d.ts +1 -1
  161. package/lib/solution/BookingTicket/index.d.ts +152 -2
  162. package/lib/solution/BookingTicket/index.js +389 -9
  163. package/lib/solution/BookingTicket/types.d.ts +2 -0
  164. package/lib/solution/BookingTicket/types.js +6 -0
  165. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
  166. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  167. package/lib/solution/BookingTicket/utils/cartView.js +4 -2
  168. package/lib/solution/ScanOrder/index.d.ts +9 -3
  169. package/lib/solution/ScanOrder/index.js +147 -66
  170. package/lib/solution/ScanOrder/utils.js +46 -6
  171. package/lib/solution/VenueBooking/index.d.ts +5 -2
  172. package/lib/solution/VenueBooking/index.js +50 -14
  173. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  174. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  175. package/package.json +1 -1
@@ -18,6 +18,7 @@ export declare class OrderModule extends BaseModule implements Module {
18
18
  private resourceIdIndex;
19
19
  private logger;
20
20
  private storage;
21
+ private orderSQLiteSaveQueue;
21
22
  constructor(name?: string, version?: string);
22
23
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
23
24
  /**
@@ -130,6 +131,28 @@ export declare class OrderModule extends BaseModule implements Module {
130
131
  private getStorageItem;
131
132
  private setStorageItem;
132
133
  private loadOrdersFromSQLite;
134
+ /**
135
+ * 串行执行订单 SQLite 保存任务,保证 clear + bulkAdd 组合不会被其它订单保存插入。
136
+ *
137
+ * @example
138
+ * await this.runInOrderSQLiteSaveQueue(async () => {
139
+ * await this.dbManager.clear(INDEXDB_STORE_NAME)
140
+ * await this.dbManager.bulkAdd(INDEXDB_STORE_NAME, orders)
141
+ * })
142
+ */
143
+ private runInOrderSQLiteSaveQueue;
144
+ /**
145
+ * 保存订单列表到 SQLite,内部会先清空 orders 表再批量写入当前快照。
146
+ *
147
+ * @example
148
+ * await this.saveOrdersToSQLite(this.store.list)
149
+ */
133
150
  private saveOrdersToSQLite;
151
+ /**
152
+ * 清空订单模块的内存数据和本地 SQLite 订单表。
153
+ *
154
+ * @example
155
+ * await orderModule.clear()
156
+ */
134
157
  clear(): Promise<void>;
135
158
  }
@@ -63,6 +63,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
63
63
  _defineProperty(_assertThisInitialized(_this), "logger", void 0);
64
64
  // LoggerManager 实例
65
65
  _defineProperty(_assertThisInitialized(_this), "storage", void 0);
66
+ _defineProperty(_assertThisInitialized(_this), "orderSQLiteSaveQueue", Promise.resolve());
66
67
  return _this;
67
68
  }
68
69
  _createClass(OrderModule, [{
@@ -1276,92 +1277,168 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
1276
1277
  }
1277
1278
  return loadOrdersFromSQLite;
1278
1279
  }()
1280
+ /**
1281
+ * 串行执行订单 SQLite 保存任务,保证 clear + bulkAdd 组合不会被其它订单保存插入。
1282
+ *
1283
+ * @example
1284
+ * await this.runInOrderSQLiteSaveQueue(async () => {
1285
+ * await this.dbManager.clear(INDEXDB_STORE_NAME)
1286
+ * await this.dbManager.bulkAdd(INDEXDB_STORE_NAME, orders)
1287
+ * })
1288
+ */
1279
1289
  }, {
1280
- key: "saveOrdersToSQLite",
1281
- value: function () {
1282
- var _saveOrdersToSQLite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(orderList) {
1290
+ key: "runInOrderSQLiteSaveQueue",
1291
+ value: (function () {
1292
+ var _runInOrderSQLiteSaveQueue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(task) {
1293
+ var queuedTask;
1283
1294
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1284
1295
  while (1) switch (_context15.prev = _context15.next) {
1296
+ case 0:
1297
+ queuedTask = this.orderSQLiteSaveQueue.then(task, task);
1298
+ this.orderSQLiteSaveQueue = queuedTask.then(function () {
1299
+ return undefined;
1300
+ }, function () {
1301
+ return undefined;
1302
+ });
1303
+ return _context15.abrupt("return", queuedTask);
1304
+ case 3:
1305
+ case "end":
1306
+ return _context15.stop();
1307
+ }
1308
+ }, _callee15, this);
1309
+ }));
1310
+ function runInOrderSQLiteSaveQueue(_x8) {
1311
+ return _runInOrderSQLiteSaveQueue.apply(this, arguments);
1312
+ }
1313
+ return runInOrderSQLiteSaveQueue;
1314
+ }()
1315
+ /**
1316
+ * 保存订单列表到 SQLite,内部会先清空 orders 表再批量写入当前快照。
1317
+ *
1318
+ * @example
1319
+ * await this.saveOrdersToSQLite(this.store.list)
1320
+ */
1321
+ )
1322
+ }, {
1323
+ key: "saveOrdersToSQLite",
1324
+ value: (function () {
1325
+ var _saveOrdersToSQLite = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(orderList) {
1326
+ var _this10 = this;
1327
+ var orderListSnapshot;
1328
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1329
+ while (1) switch (_context17.prev = _context17.next) {
1285
1330
  case 0:
1286
1331
  if (this.dbManager) {
1287
- _context15.next = 2;
1332
+ _context17.next = 2;
1288
1333
  break;
1289
1334
  }
1290
- return _context15.abrupt("return");
1335
+ return _context17.abrupt("return");
1291
1336
  case 2:
1292
- _context15.prev = 2;
1293
- this.logInfo('saveOrdersToSQLite-开始', {
1294
- count: orderList.length
1295
- });
1296
- _context15.next = 6;
1297
- return this.dbManager.clear(INDEXDB_STORE_NAME);
1337
+ orderListSnapshot = cloneDeep(orderList);
1338
+ _context17.prev = 3;
1339
+ _context17.next = 6;
1340
+ return this.runInOrderSQLiteSaveQueue( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1341
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1342
+ while (1) switch (_context16.prev = _context16.next) {
1343
+ case 0:
1344
+ _this10.logInfo('saveOrdersToSQLite-开始', {
1345
+ count: orderListSnapshot.length
1346
+ });
1347
+ _context16.next = 3;
1348
+ return _this10.dbManager.clear(INDEXDB_STORE_NAME);
1349
+ case 3:
1350
+ _this10.logInfo('saveOrdersToSQLite-clear完成', {
1351
+ count: orderListSnapshot.length
1352
+ });
1353
+ if (!(orderListSnapshot.length === 0)) {
1354
+ _context16.next = 6;
1355
+ break;
1356
+ }
1357
+ return _context16.abrupt("return");
1358
+ case 6:
1359
+ _context16.next = 8;
1360
+ return _this10.dbManager.bulkAdd(INDEXDB_STORE_NAME, orderListSnapshot);
1361
+ case 8:
1362
+ _this10.logInfo('saveOrdersToSQLite-bulkAdd完成', {
1363
+ count: orderListSnapshot.length
1364
+ });
1365
+ case 9:
1366
+ case "end":
1367
+ return _context16.stop();
1368
+ }
1369
+ }, _callee16);
1370
+ })));
1298
1371
  case 6:
1299
- this.logInfo('saveOrdersToSQLite-clear完成', {
1300
- count: orderList.length
1301
- });
1302
- if (!(orderList.length === 0)) {
1303
- _context15.next = 9;
1304
- break;
1305
- }
1306
- return _context15.abrupt("return");
1307
- case 9:
1308
- _context15.next = 11;
1309
- return this.dbManager.bulkAdd(INDEXDB_STORE_NAME, orderList);
1310
- case 11:
1311
- this.logInfo('saveOrdersToSQLite-bulkAdd完成', {
1312
- count: orderList.length
1313
- });
1314
- _context15.next = 17;
1372
+ _context17.next = 11;
1315
1373
  break;
1316
- case 14:
1317
- _context15.prev = 14;
1318
- _context15.t0 = _context15["catch"](2);
1374
+ case 8:
1375
+ _context17.prev = 8;
1376
+ _context17.t0 = _context17["catch"](3);
1319
1377
  // SQLite 异常,避免影响主流程
1320
1378
  this.logError('保存订单到 SQLite 失败', {
1321
- error: _context15.t0 instanceof Error ? _context15.t0.message : String(_context15.t0),
1322
- orderList: orderList.length
1379
+ error: _context17.t0 instanceof Error ? _context17.t0.message : String(_context17.t0),
1380
+ orderList: orderListSnapshot.length
1323
1381
  });
1324
- case 17:
1382
+ case 11:
1325
1383
  case "end":
1326
- return _context15.stop();
1384
+ return _context17.stop();
1327
1385
  }
1328
- }, _callee15, this, [[2, 14]]);
1386
+ }, _callee17, this, [[3, 8]]);
1329
1387
  }));
1330
- function saveOrdersToSQLite(_x8) {
1388
+ function saveOrdersToSQLite(_x9) {
1331
1389
  return _saveOrdersToSQLite.apply(this, arguments);
1332
1390
  }
1333
1391
  return saveOrdersToSQLite;
1334
1392
  }()
1393
+ /**
1394
+ * 清空订单模块的内存数据和本地 SQLite 订单表。
1395
+ *
1396
+ * @example
1397
+ * await orderModule.clear()
1398
+ */
1399
+ )
1335
1400
  }, {
1336
1401
  key: "clear",
1337
- value: function () {
1338
- var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
1339
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1340
- while (1) switch (_context16.prev = _context16.next) {
1402
+ value: (function () {
1403
+ var _clear = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
1404
+ var _this11 = this;
1405
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1406
+ while (1) switch (_context19.prev = _context19.next) {
1341
1407
  case 0:
1342
1408
  this.store.list = [];
1343
1409
  this.store.map = new Map();
1344
1410
  this.resourceIdIndex.clear();
1345
1411
  if (!this.dbManager) {
1346
- _context16.next = 6;
1412
+ _context19.next = 6;
1347
1413
  break;
1348
1414
  }
1349
- _context16.next = 6;
1350
- return this.dbManager.clear(INDEXDB_STORE_NAME);
1415
+ _context19.next = 6;
1416
+ return this.runInOrderSQLiteSaveQueue( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
1417
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1418
+ while (1) switch (_context18.prev = _context18.next) {
1419
+ case 0:
1420
+ _context18.next = 2;
1421
+ return _this11.dbManager.clear(INDEXDB_STORE_NAME);
1422
+ case 2:
1423
+ case "end":
1424
+ return _context18.stop();
1425
+ }
1426
+ }, _callee18);
1427
+ })));
1351
1428
  case 6:
1352
1429
  this.setStorageItem(ORDER_LAST_FULL_FETCH_AT_STORAGE_KEY, '');
1353
1430
  this.core.effects.emit(OrderHooks.onOrdersChanged, this.store.list);
1354
1431
  case 8:
1355
1432
  case "end":
1356
- return _context16.stop();
1433
+ return _context19.stop();
1357
1434
  }
1358
- }, _callee16, this);
1435
+ }, _callee19, this);
1359
1436
  }));
1360
1437
  function clear() {
1361
1438
  return _clear.apply(this, arguments);
1362
1439
  }
1363
1440
  return clear;
1364
- }()
1441
+ }())
1365
1442
  }]);
1366
1443
  return OrderModule;
1367
1444
  }(BaseModule);
@@ -1,4 +1,17 @@
1
1
  import dayjs from 'dayjs';
2
+ /** 从订单 payments 提取支付方式 code,与 UI 筛选选项及 filterBookings 一致 */
3
+ function getOrderPaymentCodes(order) {
4
+ var payments = order.payments;
5
+ if (!Array.isArray(payments) || payments.length === 0) {
6
+ return [];
7
+ }
8
+ return payments.map(function (item) {
9
+ return item === null || item === void 0 ? void 0 : item.code;
10
+ }).filter(function (code) {
11
+ return typeof code === 'string' && code.length > 0;
12
+ });
13
+ }
14
+
2
15
  /**
3
16
  * 订单过滤函数
4
17
  * @param orders 原始订单列表
@@ -126,22 +139,23 @@ export function filterOrders(orders, filters) {
126
139
  }
127
140
  }
128
141
 
129
- // payment_methods - 支付方式
142
+ // payment_methods - 支付方式(按 payments[].code 匹配,不再使用 order.payment_methods)
130
143
  if (safeFilters.payment_methods && safeFilters.payment_methods.length > 0) {
131
- if (!order.payment_methods || !Array.isArray(order.payment_methods) || order.payment_methods.length === 0) {
144
+ var orderPaymentCodes = getOrderPaymentCodes(order);
145
+ if (orderPaymentCodes.length === 0) {
132
146
  rejected.push({
133
147
  order_id: order.order_id,
134
148
  order_number: order.order_number,
135
149
  reason: {
136
150
  field: 'payment_methods',
137
- actual: order.payment_methods,
151
+ actual: order.payments,
138
152
  expected: safeFilters.payment_methods
139
153
  }
140
154
  });
141
155
  return false;
142
156
  }
143
- var hasMatch = order.payment_methods.some(function (pm) {
144
- return safeFilters.payment_methods.includes(pm);
157
+ var hasMatch = orderPaymentCodes.some(function (code) {
158
+ return safeFilters.payment_methods.includes(code);
145
159
  });
146
160
  if (!hasMatch) {
147
161
  rejected.push({
@@ -149,7 +163,7 @@ export function filterOrders(orders, filters) {
149
163
  order_number: order.order_number,
150
164
  reason: {
151
165
  field: 'payment_methods',
152
- actual: order.payment_methods,
166
+ actual: orderPaymentCodes,
153
167
  expected: safeFilters.payment_methods
154
168
  }
155
169
  });
@@ -21,7 +21,7 @@ export declare class ProductsModule extends BaseModule implements Module {
21
21
  private isPriceFormatterRegistered;
22
22
  private quotationPriceBridge?;
23
23
  private quotationBridgeChannel?;
24
- private quotationBridgeCustomerId?;
24
+ private quotationBridgeLoadedKey?;
25
25
  private quotationBridgeRefreshPromise?;
26
26
  private quotationBridgeRefreshKey?;
27
27
  private productDataSource;