@pisell/private-materials 3.0.87 → 3.0.89
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/render/default/view.js +3 -3
- package/build/lowcode/view.js +7 -7
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/footer/index.d.ts +2 -2
- package/es/components/booking/components/footer/index.js +172 -157
- package/es/components/booking/deposit/DepositItem/index.d.ts +4 -3
- package/es/components/booking/deposit/DepositItem/index.js +22 -21
- package/es/components/booking/deposit/index.d.ts +1 -1
- package/es/components/booking/deposit/index.js +23 -18
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +5 -3
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +140 -77
- package/es/components/booking/info/clientVariant/vertical/index.js +8 -4
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/info/service/addService/index.js +1 -1
- package/es/components/booking/info/service/editService/index.d.ts +2 -2
- package/es/components/booking/info/service/editService/index.js +60 -59
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.js +3 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/footer/index.d.ts +2 -2
- package/lib/components/booking/components/footer/index.js +27 -12
- package/lib/components/booking/deposit/DepositItem/index.d.ts +4 -3
- package/lib/components/booking/deposit/DepositItem/index.js +3 -2
- package/lib/components/booking/deposit/index.d.ts +1 -1
- package/lib/components/booking/deposit/index.js +32 -6
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +5 -3
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +16 -12
- package/lib/components/booking/info/clientVariant/vertical/index.js +17 -13
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/info/service/addService/index.js +1 -1
- package/lib/components/booking/info/service/editService/index.d.ts +2 -2
- package/lib/components/booking/info/service/editService/index.js +16 -15
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.js +1 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
3
|
declare type DepositItemProps = {
|
|
4
|
-
status:
|
|
4
|
+
status: 'paid' | 'unpaid';
|
|
5
5
|
onEdit: React.MouseEventHandler<HTMLSpanElement>;
|
|
6
6
|
customer: any;
|
|
7
7
|
totalAmountStr: string;
|
|
@@ -16,6 +16,7 @@ declare type DepositItemProps = {
|
|
|
16
16
|
createdTime: string;
|
|
17
17
|
isPaid: boolean;
|
|
18
18
|
isBookingCancelled: boolean;
|
|
19
|
+
hideOrderDetail?: boolean;
|
|
19
20
|
};
|
|
20
21
|
declare const DepositItem: (props: DepositItemProps) => React.JSX.Element;
|
|
21
22
|
export default DepositItem;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import React, { useEffect } from
|
|
2
|
-
import { Button, Dropdown } from
|
|
3
|
-
import { DownOutlined } from
|
|
4
|
-
import { formatAmount, locales } from
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Button, Dropdown } from 'antd';
|
|
3
|
+
import { DownOutlined } from '@ant-design/icons';
|
|
4
|
+
import { formatAmount, locales } from '@pisell/utils';
|
|
5
5
|
import ClientItem from "../ClientItem";
|
|
6
|
-
import Edit05 from
|
|
6
|
+
import Edit05 from '@pisell/icon/src/Edit05';
|
|
7
7
|
import "./index.less";
|
|
8
8
|
var statusTagColor = {
|
|
9
|
-
unpaid:
|
|
10
|
-
paid:
|
|
9
|
+
unpaid: '#B2DDFF',
|
|
10
|
+
paid: '#ABEFC6'
|
|
11
11
|
};
|
|
12
12
|
var statusBgColor = {
|
|
13
|
-
unpaid:
|
|
14
|
-
paid:
|
|
13
|
+
unpaid: '#EFF8FF',
|
|
14
|
+
paid: '#ECFDF3'
|
|
15
15
|
};
|
|
16
16
|
var DepositItem = function DepositItem(props) {
|
|
17
17
|
var status = props.status,
|
|
@@ -27,21 +27,22 @@ var DepositItem = function DepositItem(props) {
|
|
|
27
27
|
createdTime = props.createdTime,
|
|
28
28
|
isPaid = props.isPaid,
|
|
29
29
|
isBookingCancelled = props.isBookingCancelled,
|
|
30
|
-
sendEmail = props.sendEmail
|
|
30
|
+
sendEmail = props.sendEmail,
|
|
31
|
+
hideOrderDetail = props.hideOrderDetail;
|
|
31
32
|
var statusText = {
|
|
32
|
-
unpaid: locales.getText(
|
|
33
|
-
paid: locales.getText(
|
|
33
|
+
unpaid: locales.getText('pisell2.text.deposit-item-status-unpaid'),
|
|
34
|
+
paid: locales.getText('pisell2.text.deposit-item-status-paid')
|
|
34
35
|
};
|
|
35
36
|
useEffect(function () {
|
|
36
|
-
document.body.id =
|
|
37
|
+
document.body.id = 'body';
|
|
37
38
|
}, []);
|
|
38
39
|
var items = [{
|
|
39
|
-
key:
|
|
40
|
+
key: 'send',
|
|
40
41
|
label: /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.text.send-mail'))
|
|
41
42
|
}, {
|
|
42
|
-
key:
|
|
43
|
+
key: '1',
|
|
43
44
|
disabled: isPaid || isBookingCancelled,
|
|
44
|
-
label: /*#__PURE__*/React.createElement("div", null, locales.getText(
|
|
45
|
+
label: /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.text.copy-to-clipboard'))
|
|
45
46
|
}];
|
|
46
47
|
var onClick = function onClick(_ref) {
|
|
47
48
|
var key = _ref.key;
|
|
@@ -74,7 +75,7 @@ var DepositItem = function DepositItem(props) {
|
|
|
74
75
|
className: "pisell-lowcode__deposit-item-content"
|
|
75
76
|
}, /*#__PURE__*/React.createElement("div", {
|
|
76
77
|
className: "pisell-lowcode__deposit-item-content-line1"
|
|
77
|
-
}, locales.getText(
|
|
78
|
+
}, locales.getText('pisell2.text.deposit-order-no'), " ", orderNumber), /*#__PURE__*/React.createElement("div", {
|
|
78
79
|
className: "pisell-lowcode__deposit-item-content-line2"
|
|
79
80
|
}, createdTime), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(ClientItem, {
|
|
80
81
|
data: customer,
|
|
@@ -84,13 +85,13 @@ var DepositItem = function DepositItem(props) {
|
|
|
84
85
|
className: "pisell-lowcode__deposit-item-footer"
|
|
85
86
|
}, /*#__PURE__*/React.createElement("div", {
|
|
86
87
|
className: "pisell-lowcode__deposit-item-footer-total"
|
|
87
|
-
}, /*#__PURE__*/React.createElement("div", null, locales.getText(
|
|
88
|
+
}, /*#__PURE__*/React.createElement("div", null, locales.getText('pisell2.text.deposit-order-total')), /*#__PURE__*/React.createElement("div", null, totalAmountStr)), /*#__PURE__*/React.createElement("div", {
|
|
88
89
|
className: "pisell-lowcode__deposit-item-footer-action"
|
|
89
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
90
|
+
}, !hideOrderDetail && /*#__PURE__*/React.createElement(Button, {
|
|
90
91
|
block: true,
|
|
91
92
|
size: "large",
|
|
92
93
|
onClick: handleGoOrderDetail
|
|
93
|
-
}, locales.getText(
|
|
94
|
+
}, locales.getText('pisell2.text.deposit-order-detail')), /*#__PURE__*/React.createElement(Dropdown, {
|
|
94
95
|
menu: {
|
|
95
96
|
items: items,
|
|
96
97
|
onClick: onClick
|
|
@@ -100,6 +101,6 @@ var DepositItem = function DepositItem(props) {
|
|
|
100
101
|
block: true,
|
|
101
102
|
type: "primary",
|
|
102
103
|
size: "large"
|
|
103
|
-
}, locales.getText(
|
|
104
|
+
}, locales.getText('pisell2.text.deposit-collect-deposit'), ' ', /*#__PURE__*/React.createElement(DownOutlined, null))))));
|
|
104
105
|
};
|
|
105
106
|
export default DepositItem;
|
|
@@ -11,18 +11,18 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
11
|
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; }
|
|
12
12
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
import React, { useMemo, useRef, useState } from
|
|
15
|
-
import { formatAmount, locales } from
|
|
14
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
15
|
+
import { formatAmount, locales } from '@pisell/utils';
|
|
16
16
|
import EmptyBooking from "../components/emptyBooking";
|
|
17
17
|
import TabPane from "../components/tabPane";
|
|
18
18
|
import DepositItem from "./DepositItem";
|
|
19
19
|
import EditDepositModal from "./EditDepositModal";
|
|
20
|
-
import { Button, Modal } from
|
|
20
|
+
import { Button, Modal } from 'antd';
|
|
21
21
|
import { getSumTotal } from "../components/footer/amount";
|
|
22
22
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
23
23
|
import { request } from "../utils";
|
|
24
24
|
import { editDepositAmount } from "./serve";
|
|
25
|
-
import dayjs from
|
|
25
|
+
import dayjs from 'dayjs';
|
|
26
26
|
var Deposit = function Deposit(props) {
|
|
27
27
|
var _context$appHelper, _bookingDetail$bookin;
|
|
28
28
|
var globalState = props.globalState,
|
|
@@ -40,7 +40,11 @@ var Deposit = function Deposit(props) {
|
|
|
40
40
|
var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
41
41
|
isTerminal = _ref.isTerminal,
|
|
42
42
|
interaction = _ref.interaction,
|
|
43
|
-
action = _ref.action
|
|
43
|
+
action = _ref.action,
|
|
44
|
+
storage = _ref.storage;
|
|
45
|
+
var isTeam = useMemo(function () {
|
|
46
|
+
return storage.get('channel') === 'android_team_portal' || storage.get('channel') === 'ios_team_portal';
|
|
47
|
+
}, []);
|
|
44
48
|
request.setRequest(context.appHelper.utils.request);
|
|
45
49
|
var bookingDetail = globalState.bookingDetail,
|
|
46
50
|
bookingId = globalState.bookingId,
|
|
@@ -67,7 +71,7 @@ var Deposit = function Deposit(props) {
|
|
|
67
71
|
};
|
|
68
72
|
var deleteDeposit = function deleteDeposit() {
|
|
69
73
|
modal.confirm({
|
|
70
|
-
title: locales.getText(
|
|
74
|
+
title: locales.getText('pisell2.text.deposit-delete-message-title'),
|
|
71
75
|
content: locales.getText('pisell2.text.deposit-delete-message'),
|
|
72
76
|
onOk: function onOk() {
|
|
73
77
|
editDepositAmount(bookingDetail.id, {
|
|
@@ -96,14 +100,14 @@ var Deposit = function Deposit(props) {
|
|
|
96
100
|
if (Number(bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.deposit_amount) === 0) return [];
|
|
97
101
|
return [{
|
|
98
102
|
customer: bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.customer,
|
|
99
|
-
status: bookingDetail !== null && bookingDetail !== void 0 && bookingDetail.deposit_payment_time ?
|
|
103
|
+
status: bookingDetail !== null && bookingDetail !== void 0 && bookingDetail.deposit_payment_time ? 'paid' : 'unpaid',
|
|
100
104
|
totalAmount: total.expectAmount,
|
|
101
105
|
depositAmount: bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.deposit_amount,
|
|
102
|
-
createdTime: dayjs(bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.created_at).format(locale === 'en' ?
|
|
106
|
+
createdTime: dayjs(bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.created_at).format(locale === 'en' ? 'dddd, D MMMM YYYY HH:mm' : 'YYYY-MM-DD HH:mm'),
|
|
103
107
|
orderId: bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.id,
|
|
104
108
|
orderNumber: bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.shop_full_order_number,
|
|
105
|
-
amountSymbol: (globalState === null || globalState === void 0 ? void 0 : globalState.amountSymbol) ||
|
|
106
|
-
totalAmountStr: formatAmount(total.expectAmount, 2, (globalState === null || globalState === void 0 ? void 0 : globalState.amountSymbol) ||
|
|
109
|
+
amountSymbol: (globalState === null || globalState === void 0 ? void 0 : globalState.amountSymbol) || '$',
|
|
110
|
+
totalAmountStr: formatAmount(total.expectAmount, 2, (globalState === null || globalState === void 0 ? void 0 : globalState.amountSymbol) || '$')
|
|
107
111
|
}];
|
|
108
112
|
}, [bookingDetail, total === null || total === void 0 ? void 0 : total.expectAmount, globalState === null || globalState === void 0 ? void 0 : globalState.amountSymbol, bookingDetail === null || bookingDetail === void 0 ? void 0 : bookingDetail.deposit_amount]);
|
|
109
113
|
var isBookingCancelled = (bookingDetail === null || bookingDetail === void 0 ? void 0 : (_bookingDetail$bookin = bookingDetail.bookings) === null || _bookingDetail$bookin === void 0 ? void 0 : _bookingDetail$bookin.appointment_status) === 'cancelled';
|
|
@@ -120,7 +124,7 @@ var Deposit = function Deposit(props) {
|
|
|
120
124
|
size: "large",
|
|
121
125
|
block: true,
|
|
122
126
|
onClick: depositList.length > 0 ? deleteDeposit : create
|
|
123
|
-
}, depositList.length > 0 ? locales.getText(
|
|
127
|
+
}, depositList.length > 0 ? locales.getText('pisell2.text.deposit-delete') : locales.getText('pisell2.text.add')));
|
|
124
128
|
}, [depositList, isBookingCancelled, isPaid]);
|
|
125
129
|
var handleEdit = function handleEdit(e, item) {
|
|
126
130
|
var _editDepositModalRef$3, _editDepositModalRef$4;
|
|
@@ -145,26 +149,26 @@ var Deposit = function Deposit(props) {
|
|
|
145
149
|
if (isTerminal !== null && isTerminal !== void 0 && isTerminal()) {
|
|
146
150
|
var _interaction$utils, _interaction$utils$po;
|
|
147
151
|
return interaction === null || interaction === void 0 ? void 0 : (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 ? void 0 : (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 ? void 0 : _interaction$utils$po.call(_interaction$utils, {
|
|
148
|
-
module:
|
|
149
|
-
key:
|
|
152
|
+
module: 'booking',
|
|
153
|
+
key: 'edit_order',
|
|
150
154
|
data: {
|
|
151
155
|
order_id: bookingDetail.id
|
|
152
156
|
}
|
|
153
157
|
});
|
|
154
158
|
}
|
|
155
159
|
globalState.action({
|
|
156
|
-
type:
|
|
160
|
+
type: 'pisell1.goOrderDetail',
|
|
157
161
|
data: {
|
|
158
|
-
|
|
162
|
+
'[unique_order_id]': bookingDetail.id
|
|
159
163
|
}
|
|
160
164
|
});
|
|
161
165
|
};
|
|
162
166
|
return /*#__PURE__*/React.createElement(TabPane, {
|
|
163
167
|
loading: loading,
|
|
164
|
-
header: locales.getText(
|
|
168
|
+
header: locales.getText('pisell2.text.deposit-list'),
|
|
165
169
|
footer: footer
|
|
166
170
|
}, !bookingId || !depositList.length ? /*#__PURE__*/React.createElement(EmptyBooking, {
|
|
167
|
-
description: !bookingId ? undefined : locales.getText(
|
|
171
|
+
description: !bookingId ? undefined : locales.getText('pisell2.text.deposit-list-empty')
|
|
168
172
|
}) : depositList.map(function (item) {
|
|
169
173
|
return /*#__PURE__*/React.createElement(DepositItem, _extends({
|
|
170
174
|
key: item.status
|
|
@@ -176,7 +180,8 @@ var Deposit = function Deposit(props) {
|
|
|
176
180
|
return handleEdit(e, item);
|
|
177
181
|
},
|
|
178
182
|
isPaid: isPaid,
|
|
179
|
-
isBookingCancelled: isBookingCancelled
|
|
183
|
+
isBookingCancelled: isBookingCancelled,
|
|
184
|
+
hideOrderDetail: isTeam
|
|
180
185
|
}));
|
|
181
186
|
}), /*#__PURE__*/React.createElement(EditDepositModal, {
|
|
182
187
|
totalAmount: total.expectAmount,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -89,14 +89,15 @@ var useClientFn = function useClientFn(_params) {
|
|
|
89
89
|
case 6:
|
|
90
90
|
data = _context.sent;
|
|
91
91
|
list = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (d) {
|
|
92
|
+
var _d$form_record;
|
|
92
93
|
return _objectSpread(_objectSpread({}, d), {}, {
|
|
93
94
|
name: getNickname(d),
|
|
94
95
|
id: d.franchisee_customer_id || d.id,
|
|
95
|
-
form_record: d.form_record.map(function (item) {
|
|
96
|
+
form_record: ((_d$form_record = d.form_record) === null || _d$form_record === void 0 ? void 0 : _d$form_record.map(function (item) {
|
|
96
97
|
return _objectSpread(_objectSpread(_objectSpread({}, item), item.data), {}, {
|
|
97
98
|
form_record_id: item.id
|
|
98
99
|
});
|
|
99
|
-
})
|
|
100
|
+
})) || []
|
|
100
101
|
});
|
|
101
102
|
});
|
|
102
103
|
_payload = {
|
|
@@ -373,7 +374,8 @@ var useClientFn = function useClientFn(_params) {
|
|
|
373
374
|
loading: loading,
|
|
374
375
|
loadMore: loadMore,
|
|
375
376
|
handleOpenClientModal: handleOpenClientModal,
|
|
376
|
-
getNickname: getNickname
|
|
377
|
+
getNickname: getNickname,
|
|
378
|
+
franchiseeLoading: franchiseeLoading
|
|
377
379
|
};
|
|
378
380
|
};
|
|
379
381
|
export default useClientFn;
|
|
@@ -17,6 +17,7 @@ interface SelectDrawerProps {
|
|
|
17
17
|
holder: any;
|
|
18
18
|
handleAddPet: any;
|
|
19
19
|
modalOpen: boolean;
|
|
20
|
+
franchiseeLoading?: number;
|
|
20
21
|
}
|
|
21
22
|
declare const _default: React.ForwardRefExoticComponent<SelectDrawerProps & React.RefAttributes<unknown>>;
|
|
22
23
|
export default _default;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
2
3
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
4
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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); } }
|
|
8
|
+
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); }); }; }
|
|
6
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
@@ -49,7 +52,8 @@ var Item = function Item(_ref) {
|
|
|
49
52
|
desc = _ref.desc,
|
|
50
53
|
coverSize = _ref.coverSize,
|
|
51
54
|
checked = _ref.checked,
|
|
52
|
-
style = _ref.style
|
|
55
|
+
style = _ref.style,
|
|
56
|
+
loading = _ref.loading;
|
|
53
57
|
return /*#__PURE__*/React.createElement("div", {
|
|
54
58
|
className: classNames("vertical-client-select-drawer-item-wrap", _defineProperty({}, "checked", checked)),
|
|
55
59
|
onClick: onClick,
|
|
@@ -72,7 +76,9 @@ var Item = function Item(_ref) {
|
|
|
72
76
|
className: "",
|
|
73
77
|
title: d
|
|
74
78
|
}, d);
|
|
75
|
-
})))
|
|
79
|
+
}))), /*#__PURE__*/React.createElement(Spin, {
|
|
80
|
+
spinning: !!loading
|
|
81
|
+
}));
|
|
76
82
|
};
|
|
77
83
|
var defaultArr = [];
|
|
78
84
|
var SelectDrawer = function SelectDrawer(props, ref) {
|
|
@@ -91,7 +97,8 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
91
97
|
loadMore = props.loadMore,
|
|
92
98
|
showPet = props.showPet,
|
|
93
99
|
handleAddPet = props.handleAddPet,
|
|
94
|
-
modalOpen = props.modalOpen
|
|
100
|
+
modalOpen = props.modalOpen,
|
|
101
|
+
franchiseeLoading = props.franchiseeLoading;
|
|
95
102
|
var form = (formData === null || formData === void 0 ? void 0 : formData[0]) || {};
|
|
96
103
|
var valList = (childrenValue === null || childrenValue === void 0 ? void 0 : childrenValue[form.id]) || defaultArr;
|
|
97
104
|
var _useState = useState(valList),
|
|
@@ -162,48 +169,69 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
162
169
|
var handleAddClient = function handleAddClient() {
|
|
163
170
|
handleCreateItem();
|
|
164
171
|
};
|
|
165
|
-
var handleChildrenValueChange = function
|
|
166
|
-
var
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
172
|
+
var handleChildrenValueChange = /*#__PURE__*/function () {
|
|
173
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(value, item) {
|
|
174
|
+
var clientId, _clientRef$current, index, newList;
|
|
175
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
176
|
+
while (1) switch (_context.prev = _context.next) {
|
|
177
|
+
case 0:
|
|
178
|
+
clientId = client.id;
|
|
179
|
+
if (!(client !== null && client !== void 0 && client.id) || client.id === 1) {
|
|
180
|
+
clientId = ((_clientRef$current = clientRef.current) === null || _clientRef$current === void 0 ? void 0 : _clientRef$current.id) || item.id;
|
|
181
|
+
}
|
|
182
|
+
if (!(mode === "single")) {
|
|
183
|
+
_context.next = 10;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
if (!(!(client !== null && client !== void 0 && client.id) || client.id === 1)) {
|
|
187
|
+
_context.next = 6;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
_context.next = 6;
|
|
191
|
+
return handleSelectClient([item]);
|
|
192
|
+
case 6:
|
|
193
|
+
handleSelectPet(_defineProperty({}, form.id, formatAddFormValues({
|
|
194
|
+
clientId: clientId,
|
|
195
|
+
value: [value],
|
|
196
|
+
data_range: holder.data_range
|
|
197
|
+
})));
|
|
198
|
+
setTimeout(function () {
|
|
199
|
+
closeDrawer();
|
|
200
|
+
});
|
|
201
|
+
_context.next = 13;
|
|
202
|
+
break;
|
|
203
|
+
case 10:
|
|
204
|
+
index = _value.findIndex(function (item) {
|
|
205
|
+
return item.id === value.id || item.form_record_id === value.id;
|
|
206
|
+
});
|
|
207
|
+
if (!clientRef.current) {
|
|
208
|
+
clientRef.current = item;
|
|
209
|
+
}
|
|
210
|
+
if (index >= 0) {
|
|
211
|
+
newList = _toConsumableArray(_value);
|
|
212
|
+
newList.splice(index, 1);
|
|
213
|
+
setValue(formatAddFormValues({
|
|
214
|
+
clientId: clientId,
|
|
215
|
+
value: newList,
|
|
216
|
+
data_range: holder.data_range
|
|
217
|
+
}));
|
|
218
|
+
} else {
|
|
219
|
+
setValue(formatAddFormValues({
|
|
220
|
+
clientId: clientId,
|
|
221
|
+
value: [].concat(_toConsumableArray(_value), [value]),
|
|
222
|
+
data_range: holder.data_range
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
case 13:
|
|
226
|
+
case "end":
|
|
227
|
+
return _context.stop();
|
|
228
|
+
}
|
|
229
|
+
}, _callee);
|
|
230
|
+
}));
|
|
231
|
+
return function handleChildrenValueChange(_x2, _x3) {
|
|
232
|
+
return _ref2.apply(this, arguments);
|
|
233
|
+
};
|
|
234
|
+
}();
|
|
207
235
|
var mode = useMemo(function () {
|
|
208
236
|
if (["form"].includes(holder === null || holder === void 0 ? void 0 : holder.type)) {
|
|
209
237
|
return "single";
|
|
@@ -213,35 +241,67 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
213
241
|
}
|
|
214
242
|
return holder === null || holder === void 0 ? void 0 : holder.type;
|
|
215
243
|
}, [holder === null || holder === void 0 ? void 0 : holder.type]);
|
|
216
|
-
var handleOk = function
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
var handleOk = /*#__PURE__*/function () {
|
|
245
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
246
|
+
var _holder$form;
|
|
247
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
248
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
249
|
+
case 0:
|
|
250
|
+
if (!(!(client !== null && client !== void 0 && client.id) || (client === null || client === void 0 ? void 0 : client.id) === 1)) {
|
|
251
|
+
_context2.next = 3;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
_context2.next = 3;
|
|
255
|
+
return handleSelectClient([clientRef.current]);
|
|
256
|
+
case 3:
|
|
257
|
+
handleSelectPet(_defineProperty({}, holder === null || holder === void 0 ? void 0 : (_holder$form = holder.form) === null || _holder$form === void 0 ? void 0 : _holder$form.id, _value));
|
|
258
|
+
closeDrawer();
|
|
259
|
+
case 5:
|
|
260
|
+
case "end":
|
|
261
|
+
return _context2.stop();
|
|
262
|
+
}
|
|
263
|
+
}, _callee2);
|
|
264
|
+
}));
|
|
265
|
+
return function handleOk() {
|
|
266
|
+
return _ref3.apply(this, arguments);
|
|
267
|
+
};
|
|
268
|
+
}();
|
|
269
|
+
var handleClientClick = /*#__PURE__*/function () {
|
|
270
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(item) {
|
|
271
|
+
var _item$form_record, isHasChildren;
|
|
272
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
273
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
274
|
+
case 0:
|
|
275
|
+
_context3.next = 2;
|
|
276
|
+
return handleSelectClient([item]);
|
|
277
|
+
case 2:
|
|
278
|
+
if (mode === "multiple") {
|
|
279
|
+
isHasChildren = _value.some(function (val) {
|
|
280
|
+
return item.form_record.some(function (f) {
|
|
281
|
+
return f.id || f.form_record_id === val.id || val.form_record_id;
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
handleSelectPet(_defineProperty({}, form.id, uniqueByField([].concat(_toConsumableArray(sortFormValues(_value, item.id)), _toConsumableArray(isHasChildren ? [] : formatAddFormValues({
|
|
285
|
+
clientId: item.id,
|
|
286
|
+
data_range: holder.data_range,
|
|
287
|
+
value: (_item$form_record = item.form_record) === null || _item$form_record === void 0 ? void 0 : _item$form_record.map(function (f) {
|
|
288
|
+
return _objectSpread(_objectSpread({}, f), {}, {
|
|
289
|
+
customer: item
|
|
290
|
+
});
|
|
291
|
+
})
|
|
292
|
+
}))), "id")));
|
|
293
|
+
}
|
|
294
|
+
closeDrawer();
|
|
295
|
+
case 4:
|
|
296
|
+
case "end":
|
|
297
|
+
return _context3.stop();
|
|
298
|
+
}
|
|
299
|
+
}, _callee3);
|
|
300
|
+
}));
|
|
301
|
+
return function handleClientClick(_x4) {
|
|
302
|
+
return _ref4.apply(this, arguments);
|
|
303
|
+
};
|
|
304
|
+
}();
|
|
245
305
|
return /*#__PURE__*/React.createElement(Drawer, {
|
|
246
306
|
title: locales.getText("pisell2.text.select-customer"),
|
|
247
307
|
open: open,
|
|
@@ -274,7 +334,8 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
274
334
|
footer: mode === "multiple" && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
|
|
275
335
|
block: true,
|
|
276
336
|
type: "primary",
|
|
277
|
-
onClick: handleOk
|
|
337
|
+
onClick: handleOk,
|
|
338
|
+
loading: !!franchiseeLoading
|
|
278
339
|
}, locales.getText("pisell2.text.apply")))
|
|
279
340
|
}, /*#__PURE__*/React.createElement(Spin, {
|
|
280
341
|
spinning: loading
|
|
@@ -306,7 +367,8 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
306
367
|
checked: item.id === client.id,
|
|
307
368
|
style: showPet ? {
|
|
308
369
|
marginBottom: 6
|
|
309
|
-
} : {}
|
|
370
|
+
} : {},
|
|
371
|
+
loading: franchiseeLoading === item.id
|
|
310
372
|
}), showPet && /*#__PURE__*/React.createElement("div", {
|
|
311
373
|
className: "vertical-client-select-drawer-content-item-children"
|
|
312
374
|
}, ((item === null || item === void 0 ? void 0 : item.form_record) || []).map(function (f) {
|
|
@@ -326,7 +388,8 @@ var SelectDrawer = function SelectDrawer(props, ref) {
|
|
|
326
388
|
checked: checked
|
|
327
389
|
}), /*#__PURE__*/React.createElement(Item, {
|
|
328
390
|
coverSize: 48,
|
|
329
|
-
title: f.main_field
|
|
391
|
+
title: f.main_field,
|
|
392
|
+
loading: false
|
|
330
393
|
}));
|
|
331
394
|
}), /*#__PURE__*/React.createElement("div", {
|
|
332
395
|
className: "pisell-lowcode__custom-select-create",
|