@pisell/private-materials 6.1.32 → 6.1.34
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 +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/amount.d.ts +16 -1
- package/es/components/booking/components/footer/amount.js +73 -47
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/editBookingModal/index.js +3 -4
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/single/RenderValueById.d.ts +1 -0
- package/es/components/booking/forms/single/RenderValueById.js +68 -17
- package/es/components/booking/forms/single/index.less +67 -1
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/utils.js +3 -2
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info2/utilsByBooking.js +3 -2
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +6 -3
- package/es/components/booking/materiels/duration/index.js +1 -1
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/booking/utils.js +3 -3
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +4 -1
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/pro/pisellPriceRadio/index.js +2 -2
- package/es/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.d.ts +16 -1
- package/lib/components/booking/components/footer/amount.js +31 -33
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/editBookingModal/index.js +3 -4
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/single/RenderValueById.d.ts +1 -0
- package/lib/components/booking/forms/single/RenderValueById.js +37 -9
- package/lib/components/booking/forms/single/index.less +67 -1
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/utils.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.js +4 -4
- package/lib/components/booking/info2/service/editService/index.js +5 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info2/utilsByBooking.js +4 -4
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/materiels/duration/index.js +1 -1
- package/lib/components/booking/materiels/startTime/index.js +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/booking/utils.js +3 -3
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +9 -4
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/pro/pisellPriceRadio/index.js +2 -2
- package/lib/utils/index.d.ts +1 -1
- package/package.json +12 -12
@@ -10,7 +10,7 @@ export declare const getSumTotal: (state: any, isEdit: boolean) => {
|
|
10
10
|
duration: string;
|
11
11
|
tax: number;
|
12
12
|
shopDiscount: number;
|
13
|
-
otherAmount: number;
|
13
|
+
otherAmount: number | undefined;
|
14
14
|
sumTotalAmount: number;
|
15
15
|
paidAmount: number;
|
16
16
|
notPaidAmount: number;
|
@@ -23,3 +23,18 @@ export declare const getSumTotal: (state: any, isEdit: boolean) => {
|
|
23
23
|
roundingAmount: number;
|
24
24
|
originExpectAmount: number;
|
25
25
|
};
|
26
|
+
/**
|
27
|
+
*
|
28
|
+
{
|
29
|
+
schedule[1,2,3,4];
|
30
|
+
products:{
|
31
|
+
// 全部 , 商品组 , 指定商品
|
32
|
+
},
|
33
|
+
|
34
|
+
// productExpectAmount: 订单小计金额, 如果商品的规则是全部, 就不用一个一个的算商品的了, productExpectAmount * 百分比 + 固定金额
|
35
|
+
|
36
|
+
// 百分比 + 固定金额
|
37
|
+
|
38
|
+
// 渠道
|
39
|
+
}
|
40
|
+
*/
|
@@ -18,8 +18,8 @@ export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_d
|
|
18
18
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
19
19
|
var item = _step.value;
|
20
20
|
var number = item.product_quantity || item.num;
|
21
|
-
var
|
22
|
-
total += Number(
|
21
|
+
var _price = item.selling_price || item.payment_price || item.price;
|
22
|
+
total += Number(_price) * Number(number);
|
23
23
|
}
|
24
24
|
} catch (err) {
|
25
25
|
_iterator.e(err);
|
@@ -33,7 +33,7 @@ export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_d
|
|
33
33
|
* @param state
|
34
34
|
* @returns
|
35
35
|
*/
|
36
|
-
var
|
36
|
+
var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
37
37
|
var price = 0;
|
38
38
|
var duration = 0;
|
39
39
|
// 是否是跨日预约
|
@@ -103,7 +103,7 @@ var getProductAmount = function getProductAmount(state, isEdit) {
|
|
103
103
|
}, 0);
|
104
104
|
}
|
105
105
|
return {
|
106
|
-
|
106
|
+
productExpectAmount: Number(price),
|
107
107
|
duration: getDiscountTime(duration, isDay)
|
108
108
|
};
|
109
109
|
};
|
@@ -112,6 +112,7 @@ var getProductItemTax = function getProductItemTax(item, bookingDetail) {
|
|
112
112
|
// 折扣后的金额 = 商品金额 - 商品折扣
|
113
113
|
var productDiscountPrice = Number(item.total);
|
114
114
|
// 店铺税 = 折扣后的金额 * 店铺税率 * 商品是否收税 (is_charge_tax 0 为不收税)
|
115
|
+
// todo: tax_rate 和 is_price_include_tax 优先从bookingDetail取,快照, 取不到从getData取,
|
115
116
|
var shopTax = productDiscountPrice * Number(bookingDetail.tax_rate) * Number(item.is_charge_tax);
|
116
117
|
// 店铺税率 = 1 + 店铺税率 * 是否含税
|
117
118
|
var shopTaxRate = 1 + bookingDetail.tax_rate * bookingDetail.is_price_include_tax;
|
@@ -131,6 +132,7 @@ var getProductItemTax = function getProductItemTax(item, bookingDetail) {
|
|
131
132
|
* @Date: 2024-02-28 10:56
|
132
133
|
*/
|
133
134
|
var getTotal = function getTotal(item) {
|
135
|
+
// 改为只使用item._extend.total, 不采用均摊逻辑. 税费的钱根据整单折扣的百分比进行换算
|
134
136
|
return item._extend.payment_price !== undefined ? item._extend.payment_price : item._extend.total;
|
135
137
|
};
|
136
138
|
|
@@ -140,12 +142,14 @@ var getTotal = function getTotal(item) {
|
|
140
142
|
* @returns
|
141
143
|
*/
|
142
144
|
var getTax = function getTax(state, isEdit) {
|
143
|
-
var
|
145
|
+
var tax = 0;
|
144
146
|
|
145
147
|
// 新建不计算税费
|
146
148
|
if (!state.bookingId || !state.bookingDetail) {
|
147
149
|
return 0;
|
148
150
|
}
|
151
|
+
|
152
|
+
// 详情时未编辑的状态下, 取后端的值
|
149
153
|
if (!isEdit) {
|
150
154
|
var _state$bookingDetail2;
|
151
155
|
return Number((_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : _state$bookingDetail2.tax_fee);
|
@@ -156,7 +160,7 @@ var getTax = function getTax(state, isEdit) {
|
|
156
160
|
try {
|
157
161
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
158
162
|
var item = _step4.value;
|
159
|
-
|
163
|
+
tax += getProductItemTax(_objectSpread(_objectSpread({}, item), {}, {
|
160
164
|
total: getTotal(item),
|
161
165
|
price: item._extend.price,
|
162
166
|
quantity: item._extend.quantity
|
@@ -172,7 +176,7 @@ var getTax = function getTax(state, isEdit) {
|
|
172
176
|
try {
|
173
177
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
174
178
|
var _item2 = _step5.value;
|
175
|
-
|
179
|
+
tax += getProductItemTax(_objectSpread(_objectSpread({}, _item2), {}, {
|
176
180
|
total: getTotal(_item2),
|
177
181
|
price: _item2._extend.price,
|
178
182
|
quantity: _item2._extend.quantity
|
@@ -184,7 +188,9 @@ var getTax = function getTax(state, isEdit) {
|
|
184
188
|
_iterator5.f();
|
185
189
|
}
|
186
190
|
}
|
187
|
-
|
191
|
+
|
192
|
+
// todo: tax * (1 - shopDiscount / productExpectAmount)
|
193
|
+
return tax;
|
188
194
|
};
|
189
195
|
var getPaySurchargeFee = function getPaySurchargeFee(state) {
|
190
196
|
var bookingDetail = state.bookingDetail,
|
@@ -216,16 +222,20 @@ var getPaySurchargeFee = function getPaySurchargeFee(state) {
|
|
216
222
|
// }
|
217
223
|
|
218
224
|
/**
|
219
|
-
*
|
225
|
+
* 订单附加费
|
220
226
|
* @param state
|
221
227
|
* @returns
|
222
228
|
*/
|
223
|
-
var
|
229
|
+
var getSurchargeAmount = function getSurchargeAmount(state) {
|
224
230
|
var bookingDetail = state.bookingDetail,
|
225
231
|
bookingId = state.bookingId;
|
226
232
|
|
233
|
+
// todo:编辑场景下附加费计算问题?
|
227
234
|
// 新增为 0
|
228
|
-
if (!bookingDetail || !bookingId)
|
235
|
+
if (!bookingDetail || !bookingId) {
|
236
|
+
return;
|
237
|
+
}
|
238
|
+
// 方案1: 只处理新增时, 编辑时附加费直接使用后端的数据.
|
229
239
|
return Number(bookingDetail.surcharge_fee);
|
230
240
|
};
|
231
241
|
|
@@ -263,35 +273,30 @@ export var is_price_include_tax = function is_price_include_tax(state) {
|
|
263
273
|
var getExpectAmount = function getExpectAmount(_ref) {
|
264
274
|
var price = _ref.price,
|
265
275
|
tax = _ref.tax,
|
266
|
-
|
276
|
+
surchargeAmount = _ref.surchargeAmount,
|
267
277
|
shopDiscount = _ref.shopDiscount,
|
268
|
-
state = _ref.state
|
269
|
-
isEdit = _ref.isEdit;
|
270
|
-
if (!isEdit) {
|
271
|
-
var _state$bookingDetail6;
|
272
|
-
return Number((_state$bookingDetail6 = state.bookingDetail) === null || _state$bookingDetail6 === void 0 ? void 0 : _state$bookingDetail6.expect_amount) || 0;
|
273
|
-
}
|
278
|
+
state = _ref.state;
|
274
279
|
var _tax = tax;
|
275
280
|
|
276
|
-
//
|
277
|
-
if (
|
281
|
+
// 如果价格含税, 则将税费改为0
|
282
|
+
if (is_price_include_tax(state)) {
|
278
283
|
_tax = 0;
|
279
284
|
}
|
280
|
-
// 商品价格 + 税费 +
|
281
|
-
return price + _tax +
|
285
|
+
// 商品价格 + 税费 + 附加费 - 整单折扣
|
286
|
+
return price + _tax + surchargeAmount - shopDiscount;
|
282
287
|
};
|
283
288
|
var getTotalRefundAmount = function getTotalRefundAmount(state) {
|
284
|
-
var _state$
|
285
|
-
return Number((_state$
|
289
|
+
var _state$bookingDetail6;
|
290
|
+
return Number((_state$bookingDetail6 = state.bookingDetail) === null || _state$bookingDetail6 === void 0 ? void 0 : _state$bookingDetail6.total_refund_amount) || 0;
|
286
291
|
};
|
287
292
|
var getShopDiscount = function getShopDiscount(state) {
|
288
|
-
var _state$
|
293
|
+
var _state$bookingDetail7;
|
289
294
|
// 优先使用手动设置的折扣(字符串格式),否则使用bookingDetail中的折扣
|
290
|
-
return Number(state.shop_discount) || Number((_state$
|
295
|
+
return Number(state.shop_discount) || Number((_state$bookingDetail7 = state.bookingDetail) === null || _state$bookingDetail7 === void 0 ? void 0 : _state$bookingDetail7.shop_discount) || 0;
|
291
296
|
};
|
292
297
|
var getRoundingAmount = function getRoundingAmount(state) {
|
293
|
-
var _state$
|
294
|
-
return Number(state === null || state === void 0 || (_state$
|
298
|
+
var _state$bookingDetail8;
|
299
|
+
return Number(state === null || state === void 0 || (_state$bookingDetail8 = state.bookingDetail) === null || _state$bookingDetail8 === void 0 ? void 0 : _state$bookingDetail8.rounding_amount) || 0;
|
295
300
|
};
|
296
301
|
var getSumTotalAmount = function getSumTotalAmount(_ref2) {
|
297
302
|
var expectAmount = _ref2.expectAmount,
|
@@ -305,22 +310,27 @@ var getSumTotalAmount = function getSumTotalAmount(_ref2) {
|
|
305
310
|
* @returns
|
306
311
|
*/
|
307
312
|
export var getSumTotal = function getSumTotal(state, isEdit) {
|
308
|
-
//
|
309
|
-
var
|
310
|
-
|
311
|
-
duration =
|
313
|
+
// 商品总金额, 包含 商品折扣 报价单 子商品
|
314
|
+
var _getProductExpectAmou = getProductExpectAmount(state, isEdit),
|
315
|
+
productExpectAmount = _getProductExpectAmou.productExpectAmount,
|
316
|
+
duration = _getProductExpectAmou.duration;
|
312
317
|
|
313
|
-
//
|
314
|
-
var
|
318
|
+
// 整单折扣金额
|
319
|
+
var shopDiscount = getShopDiscount(state);
|
315
320
|
|
316
|
-
//
|
317
|
-
var
|
321
|
+
// 舍入金额, 新增时不处理, 支付后才会产生
|
322
|
+
var roundingAmount = getRoundingAmount(state);
|
318
323
|
|
319
|
-
//
|
324
|
+
// 支付手续费, 新增时不处理, 支付后才会产生
|
320
325
|
var paySurchargeFee = getPaySurchargeFee(state);
|
321
326
|
|
322
|
-
//
|
323
|
-
var
|
327
|
+
// 订单附加费金额
|
328
|
+
var surchargeAmount = getSurchargeAmount(state);
|
329
|
+
|
330
|
+
// 算出整单折扣的百分比 shopDiscount / productExpectAmount
|
331
|
+
|
332
|
+
// 税费
|
333
|
+
var tax = getTax(state, isEdit);
|
324
334
|
|
325
335
|
// 已付金额 (包含手续费)
|
326
336
|
var paidAmount = getPaidAmount(state);
|
@@ -331,19 +341,19 @@ export var getSumTotal = function getSumTotal(state, isEdit) {
|
|
331
341
|
// 退款金额
|
332
342
|
var totalRefundAmount = getTotalRefundAmount(state);
|
333
343
|
|
334
|
-
// 整单折扣
|
335
|
-
var shopDiscount = getShopDiscount(state);
|
336
|
-
|
337
344
|
// 总计(总订单金额) 商品金额 + 税费 + 附加费
|
338
345
|
var expectAmount = getExpectAmount({
|
339
|
-
price:
|
346
|
+
price: productExpectAmount,
|
340
347
|
tax: tax,
|
341
|
-
|
348
|
+
surchargeAmount: surchargeAmount,
|
342
349
|
shopDiscount: shopDiscount,
|
343
350
|
state: state,
|
344
351
|
isEdit: isEdit
|
345
352
|
});
|
346
353
|
|
354
|
+
// 订单原价(不包含整单折扣的价格)
|
355
|
+
// const originExpectAmount = getExpectAmount({ price: productExpectAmount, tax, shopDiscount: 0, surchargeAmount, state, isEdit });
|
356
|
+
|
347
357
|
// 订单原价(不包含整单折扣的价格)
|
348
358
|
var originExpectAmount = getExpectAmount({
|
349
359
|
price: price,
|
@@ -369,12 +379,12 @@ export var getSumTotal = function getSumTotal(state, isEdit) {
|
|
369
379
|
// 欠款金额
|
370
380
|
var dueAmount = notPaidAmount < 0 ? Number(formatAmount(notPaidAmount + totalRefundAmount, 2, '')) : 0;
|
371
381
|
return {
|
372
|
-
productAmount:
|
382
|
+
productAmount: productExpectAmount,
|
373
383
|
duration: duration,
|
374
384
|
tax: tax,
|
375
385
|
shopDiscount: shopDiscount,
|
376
386
|
// taxText,
|
377
|
-
otherAmount:
|
387
|
+
otherAmount: surchargeAmount,
|
378
388
|
sumTotalAmount: sumTotalAmount,
|
379
389
|
paidAmount: paidAmount,
|
380
390
|
notPaidAmount: notPaidAmount,
|
@@ -387,4 +397,20 @@ export var getSumTotal = function getSumTotal(state, isEdit) {
|
|
387
397
|
roundingAmount: roundingAmount,
|
388
398
|
originExpectAmount: originExpectAmount
|
389
399
|
};
|
390
|
-
};
|
400
|
+
};
|
401
|
+
|
402
|
+
/**
|
403
|
+
*
|
404
|
+
{
|
405
|
+
schedule[1,2,3,4];
|
406
|
+
products:{
|
407
|
+
// 全部 , 商品组 , 指定商品
|
408
|
+
},
|
409
|
+
|
410
|
+
// productExpectAmount: 订单小计金额, 如果商品的规则是全部, 就不用一个一个的算商品的了, productExpectAmount * 百分比 + 固定金额
|
411
|
+
|
412
|
+
// 百分比 + 固定金额
|
413
|
+
|
414
|
+
// 渠道
|
415
|
+
}
|
416
|
+
*/
|
@@ -62,6 +62,7 @@ var EditBookingModal = function EditBookingModal(props, ref) {
|
|
62
62
|
return {
|
63
63
|
open: function open(params) {
|
64
64
|
console.log('change', params);
|
65
|
+
form.resetFields();
|
65
66
|
setParams(params);
|
66
67
|
setOpen(true);
|
67
68
|
}
|
@@ -173,9 +174,7 @@ var EditBookingModal = function EditBookingModal(props, ref) {
|
|
173
174
|
});
|
174
175
|
}, [data]);
|
175
176
|
var updateResource = function updateResource(resource) {
|
176
|
-
form.
|
177
|
-
resource: resource
|
178
|
-
});
|
177
|
+
form.setFieldValue('resource', resource);
|
179
178
|
};
|
180
179
|
var originCacheItem = useMemo(function () {
|
181
180
|
if (!data) {
|
@@ -224,9 +223,9 @@ var EditBookingModal = function EditBookingModal(props, ref) {
|
|
224
223
|
});
|
225
224
|
}, [data, useToDate, useResource]);
|
226
225
|
var initState = function initState() {
|
227
|
-
form.resetFields();
|
228
226
|
setData(null);
|
229
227
|
setOpen(false);
|
228
|
+
form.resetFields();
|
230
229
|
};
|
231
230
|
var onCancel = function onCancel() {
|
232
231
|
initState();
|
@@ -4,6 +4,6 @@ declare const useSendModal: (bookingId?: number) => {
|
|
4
4
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
5
5
|
handleOpen: () => void;
|
6
6
|
handleValuesChange: (val: any) => void;
|
7
|
-
handleOk: (values: SendModalValues) => Promise<
|
7
|
+
handleOk: (values: SendModalValues) => Promise<boolean | undefined>;
|
8
8
|
};
|
9
9
|
export default useSendModal;
|
@@ -1,24 +1,38 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
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."); }
|
3
|
+
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); }
|
4
|
+
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; }
|
5
|
+
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; } }
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
7
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
8
|
+
import { isArr, isUndefined, locales } from '@pisell/utils';
|
9
|
+
import { Iconfont } from '@pisell/materials';
|
10
|
+
import { Tag, Tooltip } from 'antd';
|
11
|
+
import { useRequest } from 'ahooks';
|
5
12
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
6
13
|
import { getFormData } from "../serve";
|
14
|
+
import "./index.less";
|
7
15
|
var RenderValueById = function RenderValueById(props) {
|
8
|
-
var _field$setting, _field$setting6;
|
16
|
+
var _field$setting, _ref, _ref$toString, _field$setting6;
|
9
17
|
var field = props.field,
|
10
18
|
propsValue = props.value;
|
11
19
|
var _useEngineContext = useEngineContext(),
|
12
20
|
appHelper = _useEngineContext.appHelper;
|
21
|
+
|
22
|
+
// 关联表单展示数量
|
23
|
+
var _useState = useState(10),
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
25
|
+
displayCount = _useState2[0],
|
26
|
+
setDisplayCount = _useState2[1];
|
13
27
|
var _getFormData = useRequest(getFormData, {
|
14
28
|
manual: true,
|
15
|
-
cacheKey: "formOption-".concat((_field$setting = field.setting) === null || _field$setting === void 0 ? void 0 : _field$setting.linkedTable),
|
29
|
+
cacheKey: "formOption-".concat((_field$setting = field.setting) === null || _field$setting === void 0 ? void 0 : _field$setting.linkedTable, "-").concat((_ref = propsValue || []) === null || _ref === void 0 || (_ref$toString = _ref.toString) === null || _ref$toString === void 0 ? void 0 : _ref$toString.call(_ref)),
|
16
30
|
staleTime: 500,
|
17
31
|
cacheTime: 5000
|
18
32
|
});
|
19
33
|
var value = useMemo(function () {
|
20
34
|
var v = propsValue;
|
21
|
-
if (field.filed_type ===
|
35
|
+
if (field.filed_type === 'form_to_form') {
|
22
36
|
if (isArr(propsValue)) {
|
23
37
|
v = propsValue;
|
24
38
|
} else if (propsValue !== null && propsValue !== void 0 && propsValue.form_ids) {
|
@@ -31,7 +45,7 @@ var RenderValueById = function RenderValueById(props) {
|
|
31
45
|
}, [propsValue]);
|
32
46
|
useEffect(function () {
|
33
47
|
var _field$setting2;
|
34
|
-
if (field.filed_type ===
|
48
|
+
if (field.filed_type === 'form_to_form' && (_field$setting2 = field.setting) !== null && _field$setting2 !== void 0 && _field$setting2.linkedTable) {
|
35
49
|
var _field$setting3;
|
36
50
|
_getFormData.run({
|
37
51
|
form_record_ids: value,
|
@@ -43,7 +57,7 @@ var RenderValueById = function RenderValueById(props) {
|
|
43
57
|
}, [field.filed_type, value]);
|
44
58
|
var options = useMemo(function () {
|
45
59
|
var _field$setting4, _field$setting5;
|
46
|
-
if (field.filed_type ===
|
60
|
+
if (field.filed_type === 'form_to_form' && field !== null && field !== void 0 && (_field$setting4 = field.setting) !== null && _field$setting4 !== void 0 && _field$setting4.linkedTable) {
|
47
61
|
var _getFormData$data;
|
48
62
|
return ((_getFormData$data = _getFormData.data) === null || _getFormData$data === void 0 || (_getFormData$data = _getFormData$data.data) === null || _getFormData$data === void 0 || (_getFormData$data = _getFormData$data.list) === null || _getFormData$data === void 0 ? void 0 : _getFormData$data.map(function (item) {
|
49
63
|
return {
|
@@ -55,24 +69,61 @@ var RenderValueById = function RenderValueById(props) {
|
|
55
69
|
return field === null || field === void 0 || (_field$setting5 = field.setting) === null || _field$setting5 === void 0 ? void 0 : _field$setting5.customTypeList;
|
56
70
|
}, [field.filed_type, field === null || field === void 0 || (_field$setting6 = field.setting) === null || _field$setting6 === void 0 ? void 0 : _field$setting6.customTypeList, _getFormData.data]);
|
57
71
|
if (isArr(value)) {
|
72
|
+
var _field$setting7;
|
73
|
+
// 是否是关联表单列表展示样式
|
74
|
+
var formListDisplay = (field === null || field === void 0 || (_field$setting7 = field.setting) === null || _field$setting7 === void 0 ? void 0 : _field$setting7.displayStyle) === 'list' && (field === null || field === void 0 ? void 0 : field.filed_type) === 'form_to_form';
|
58
75
|
var _list = options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
59
76
|
return value === null || value === void 0 ? void 0 : value.includes((i === null || i === void 0 ? void 0 : i.id) || i.value);
|
60
77
|
});
|
61
|
-
var _str = (_list === null || _list === void 0 ? void 0 : _list.map(function (i) {
|
78
|
+
var _str = !formListDisplay && (_list === null || _list === void 0 ? void 0 : _list.map(function (i) {
|
62
79
|
var _appHelper$utils;
|
63
|
-
|
64
|
-
|
65
|
-
|
80
|
+
var title = appHelper === null || appHelper === void 0 || (_appHelper$utils = appHelper.utils) === null || _appHelper$utils === void 0 ? void 0 : _appHelper$utils.translationShop((i === null || i === void 0 ? void 0 : i.title) || (i === null || i === void 0 ? void 0 : i.label));
|
81
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
82
|
+
title: title
|
83
|
+
}, /*#__PURE__*/React.createElement(Tag, {
|
84
|
+
className: "pisell-lowcode__booking-form-link-tag-title"
|
85
|
+
}, title));
|
86
|
+
})) || '-';
|
87
|
+
|
88
|
+
// 如果列表式展示
|
89
|
+
if (formListDisplay) {
|
90
|
+
var displayList = (_list === null || _list === void 0 ? void 0 : _list.slice(0, displayCount)) || [];
|
91
|
+
_str = (displayList === null || displayList === void 0 ? void 0 : displayList.map(function (i, index) {
|
92
|
+
var _appHelper$utils2;
|
93
|
+
var title = appHelper === null || appHelper === void 0 || (_appHelper$utils2 = appHelper.utils) === null || _appHelper$utils2 === void 0 ? void 0 : _appHelper$utils2.translationShop((i === null || i === void 0 ? void 0 : i.title) || (i === null || i === void 0 ? void 0 : i.label));
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
95
|
+
className: "pisell-lowcode__booking-form-link-to-list-item"
|
96
|
+
}, /*#__PURE__*/React.createElement("span", {
|
97
|
+
className: "pisell-lowcode__booking-form-link-to-list-item-index"
|
98
|
+
}, index + 1), /*#__PURE__*/React.createElement(Tooltip, {
|
99
|
+
title: title
|
100
|
+
}, /*#__PURE__*/React.createElement("span", {
|
101
|
+
className: "pisell-lowcode__booking-form-link-to-list-item-title"
|
102
|
+
}, title)));
|
103
|
+
})) || '-';
|
104
|
+
}
|
105
|
+
return /*#__PURE__*/React.createElement("span", {
|
106
|
+
className: formListDisplay ? 'pisell-lowcode__booking-form-link-to-list-wrap' : ''
|
107
|
+
}, _str || '-', formListDisplay && (_list === null || _list === void 0 ? void 0 : _list.length) > displayCount && /*#__PURE__*/React.createElement("div", {
|
108
|
+
className: "pisell-lowcode__booking-form-link-to-list-item-more",
|
109
|
+
onClick: function onClick() {
|
110
|
+
return setDisplayCount(function (prev) {
|
111
|
+
return Math.min(prev + 10, (_list === null || _list === void 0 ? void 0 : _list.length) || 0);
|
112
|
+
});
|
113
|
+
}
|
114
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.form.link.to.another.record.more')), /*#__PURE__*/React.createElement(Iconfont, {
|
115
|
+
type: "icona-IconStroke"
|
116
|
+
})));
|
66
117
|
}
|
67
118
|
if (!isUndefined(value)) {
|
68
|
-
var _field$
|
69
|
-
if ((field === null || field === void 0 ? void 0 : field.filed_type) ===
|
70
|
-
return /*#__PURE__*/React.createElement("span", null, value ||
|
119
|
+
var _field$setting8, _appHelper$utils3, _item$, _item$2;
|
120
|
+
if ((field === null || field === void 0 ? void 0 : field.filed_type) === 'select' && !(field !== null && field !== void 0 && (_field$setting8 = field.setting) !== null && _field$setting8 !== void 0 && _field$setting8.version)) {
|
121
|
+
return /*#__PURE__*/React.createElement("span", null, value || '-');
|
71
122
|
}
|
72
123
|
var _item = options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
73
124
|
return (i === null || i === void 0 ? void 0 : i.id) == value;
|
74
125
|
});
|
75
|
-
return (appHelper === null || appHelper === void 0 || (_appHelper$
|
126
|
+
return (appHelper === null || appHelper === void 0 || (_appHelper$utils3 = appHelper.utils) === null || _appHelper$utils3 === void 0 ? void 0 : _appHelper$utils3.translationShop((_item === null || _item === void 0 || (_item$ = _item[0]) === null || _item$ === void 0 ? void 0 : _item$.title) || (_item === null || _item === void 0 || (_item$2 = _item[0]) === null || _item$2 === void 0 ? void 0 : _item$2.label))) || '-';
|
76
127
|
}
|
77
128
|
return null;
|
78
129
|
};
|
@@ -1,3 +1,69 @@
|
|
1
1
|
.attachment-item {
|
2
2
|
width: 100%;
|
3
|
-
}
|
3
|
+
}
|
4
|
+
|
5
|
+
.pisell-lowcode__booking-form-link-tag-title {
|
6
|
+
overflow: hidden;
|
7
|
+
text-overflow: ellipsis;
|
8
|
+
white-space: nowrap;
|
9
|
+
display: inline-block;
|
10
|
+
max-width: 100%;
|
11
|
+
}
|
12
|
+
|
13
|
+
.pisell-lowcode__booking-form-link-to-list-wrap {
|
14
|
+
display: flex;
|
15
|
+
flex-direction: column;
|
16
|
+
gap: 12px;
|
17
|
+
|
18
|
+
|
19
|
+
.pisell-lowcode__booking-form-link-to-list-item-more {
|
20
|
+
padding: 4px 6px;
|
21
|
+
color: #705dff;
|
22
|
+
font-size: 14px;
|
23
|
+
cursor: pointer;
|
24
|
+
background-color: #f9fafb;
|
25
|
+
border-radius: 8px;
|
26
|
+
border: 1px solid #eaecf0;
|
27
|
+
display: flex;
|
28
|
+
justify-content: center;
|
29
|
+
align-items: center;
|
30
|
+
gap: 4px;
|
31
|
+
}
|
32
|
+
|
33
|
+
.pisell-lowcode__booking-form-link-to-list-item {
|
34
|
+
display: flex;
|
35
|
+
align-items: center;
|
36
|
+
gap: 8px;
|
37
|
+
background-color: #f9fafb;
|
38
|
+
padding: 12px 14px;
|
39
|
+
border-radius: 8px;
|
40
|
+
border: 1px solid #eaecf0;
|
41
|
+
color: #101828;
|
42
|
+
font-size: 16px;
|
43
|
+
font-weight: 500;
|
44
|
+
white-space: normal;
|
45
|
+
|
46
|
+
.pisell-lowcode__booking-form-link-to-list-item-index {
|
47
|
+
padding: 0 5px;
|
48
|
+
min-width: 20px;
|
49
|
+
min-height: 20px;
|
50
|
+
line-height: 20px;
|
51
|
+
border-radius: 20px;
|
52
|
+
font-size: 14px;
|
53
|
+
font-weight: 600;
|
54
|
+
background-color: #705dff;
|
55
|
+
display: flex;
|
56
|
+
align-items: center;
|
57
|
+
justify-content: center;
|
58
|
+
color: #fff;
|
59
|
+
}
|
60
|
+
|
61
|
+
.pisell-lowcode__booking-form-link-to-list-item-title {
|
62
|
+
flex: 1;
|
63
|
+
overflow: hidden;
|
64
|
+
text-overflow: ellipsis;
|
65
|
+
white-space: nowrap;
|
66
|
+
display: block;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}
|