@pisell/pisellos 2.2.306 → 2.2.307
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/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/Sales/index.d.ts +2 -0
- package/dist/solution/Sales/index.js +15 -1
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/Sales/index.d.ts +2 -0
- package/lib/solution/Sales/index.js +10 -1
- package/package.json +1 -1
|
@@ -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 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -105,6 +105,8 @@ export declare class SalesImpl extends BaseModule implements Module, SalesModule
|
|
|
105
105
|
private groupBookingsByResource;
|
|
106
106
|
private isBookingMatchedResource;
|
|
107
107
|
private sortMatchedBookings;
|
|
108
|
+
/** 已完成:按订单创建时间降序,避免实时追加和重新加载导致显示顺序不同。 */
|
|
109
|
+
private sortCompletedBookings;
|
|
108
110
|
/** Unpaid:与 Current 重合的订单沿用 Current 顺序,其余欠款订单按开始时间降序追加。 */
|
|
109
111
|
private sortUnpaidBookings;
|
|
110
112
|
/**
|
|
@@ -760,6 +760,20 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
760
760
|
});
|
|
761
761
|
}
|
|
762
762
|
|
|
763
|
+
/** 已完成:按订单创建时间降序,避免实时追加和重新加载导致显示顺序不同。 */
|
|
764
|
+
}, {
|
|
765
|
+
key: "sortCompletedBookings",
|
|
766
|
+
value: function sortCompletedBookings(bookings) {
|
|
767
|
+
var createdAt = function createdAt(booking) {
|
|
768
|
+
var _booking$order3;
|
|
769
|
+
var timestamp = dayjs(((_booking$order3 = booking.order) === null || _booking$order3 === void 0 ? void 0 : _booking$order3.created_at) || '').valueOf();
|
|
770
|
+
return Number.isFinite(timestamp) ? timestamp : 0;
|
|
771
|
+
};
|
|
772
|
+
return _toConsumableArray(bookings).sort(function (left, right) {
|
|
773
|
+
return createdAt(right) - createdAt(left);
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
|
|
763
777
|
/** Unpaid:与 Current 重合的订单沿用 Current 顺序,其余欠款订单按开始时间降序追加。 */
|
|
764
778
|
}, {
|
|
765
779
|
key: "sortUnpaidBookings",
|
|
@@ -1260,7 +1274,7 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1260
1274
|
bookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, matchedBookingList), {
|
|
1261
1275
|
includeAllFuture: true
|
|
1262
1276
|
});
|
|
1263
|
-
completedBookings = completedBookingList.map(function (booking) {
|
|
1277
|
+
completedBookings = this.sortCompletedBookings(completedBookingList).map(function (booking) {
|
|
1264
1278
|
return _objectSpread(_objectSpread({}, booking), {}, {
|
|
1265
1279
|
status: 'compelete',
|
|
1266
1280
|
isTimeout: false,
|
|
@@ -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 |
|
|
329
|
+
weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -105,6 +105,8 @@ export declare class SalesImpl extends BaseModule implements Module, SalesModule
|
|
|
105
105
|
private groupBookingsByResource;
|
|
106
106
|
private isBookingMatchedResource;
|
|
107
107
|
private sortMatchedBookings;
|
|
108
|
+
/** 已完成:按订单创建时间降序,避免实时追加和重新加载导致显示顺序不同。 */
|
|
109
|
+
private sortCompletedBookings;
|
|
108
110
|
/** Unpaid:与 Current 重合的订单沿用 Current 顺序,其余欠款订单按开始时间降序追加。 */
|
|
109
111
|
private sortUnpaidBookings;
|
|
110
112
|
/**
|
|
@@ -507,6 +507,15 @@ class SalesImpl extends _BaseModule.BaseModule {
|
|
|
507
507
|
});
|
|
508
508
|
}
|
|
509
509
|
|
|
510
|
+
/** 已完成:按订单创建时间降序,避免实时追加和重新加载导致显示顺序不同。 */
|
|
511
|
+
sortCompletedBookings(bookings) {
|
|
512
|
+
const createdAt = booking => {
|
|
513
|
+
const timestamp = (0, _dayjs.default)(booking.order?.created_at || '').valueOf();
|
|
514
|
+
return Number.isFinite(timestamp) ? timestamp : 0;
|
|
515
|
+
};
|
|
516
|
+
return [...bookings].sort((left, right) => createdAt(right) - createdAt(left));
|
|
517
|
+
}
|
|
518
|
+
|
|
510
519
|
/** Unpaid:与 Current 重合的订单沿用 Current 顺序,其余欠款订单按开始时间降序追加。 */
|
|
511
520
|
sortUnpaidBookings(bookings, currentBookings) {
|
|
512
521
|
const currentOrderIndexes = new Map(currentBookings.map((booking, index) => [String(booking.order.order_id), index]));
|
|
@@ -881,7 +890,7 @@ class SalesImpl extends _BaseModule.BaseModule {
|
|
|
881
890
|
const bookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, matchedBookingList), {
|
|
882
891
|
includeAllFuture: true
|
|
883
892
|
});
|
|
884
|
-
const completedBookings = completedBookingList.map(booking => {
|
|
893
|
+
const completedBookings = this.sortCompletedBookings(completedBookingList).map(booking => {
|
|
885
894
|
return {
|
|
886
895
|
...booking,
|
|
887
896
|
status: 'compelete',
|