@pisell/private-materials 3.0.60 → 3.0.62

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 (63) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.js +6 -6
  8. package/build/lowcode/view.js +5 -5
  9. package/es/components/booking/addons/index.d.ts +1 -1
  10. package/es/components/booking/addons/model.d.ts +2 -1
  11. package/es/components/booking/components/customSelect/index.js +40 -7
  12. package/es/components/booking/components/footer/index.js +11 -10
  13. package/es/components/booking/components/footer/utils.js +12 -7
  14. package/es/components/booking/deposit/index.js +2 -1
  15. package/es/components/booking/forms/forms.d.ts +1 -1
  16. package/es/components/booking/forms/index.d.ts +1 -1
  17. package/es/components/booking/forms/index.js +136 -63
  18. package/es/components/booking/forms/model.d.ts +2 -1
  19. package/es/components/booking/forms/single/index.js +1 -1
  20. package/es/components/booking/index.d.ts +1 -1
  21. package/es/components/booking/info/client/index.js +124 -31
  22. package/es/components/booking/info/client/serve.d.ts +2 -0
  23. package/es/components/booking/info/client/serve.js +51 -0
  24. package/es/components/booking/info/index.d.ts +1 -1
  25. package/es/components/booking/info/index.js +8 -5
  26. package/es/components/booking/info/model.d.ts +2 -1
  27. package/es/components/booking/info/pet/index.js +4 -2
  28. package/es/components/booking/info/service/addService/index.js +0 -1
  29. package/es/components/booking/model.d.ts +3 -1
  30. package/es/components/booking/notes/index.d.ts +1 -1
  31. package/es/components/booking/notes/model.d.ts +2 -1
  32. package/es/components/booking/payments/index.d.ts +1 -1
  33. package/es/components/booking/payments/model.d.ts +2 -1
  34. package/es/components/schedules/index.d.ts +1 -1
  35. package/es/components/schedules/model.d.ts +2 -1
  36. package/lib/components/booking/addons/index.d.ts +1 -1
  37. package/lib/components/booking/addons/model.d.ts +2 -1
  38. package/lib/components/booking/components/customSelect/index.js +4 -4
  39. package/lib/components/booking/components/footer/index.js +3 -2
  40. package/lib/components/booking/components/footer/utils.js +8 -5
  41. package/lib/components/booking/deposit/index.js +2 -1
  42. package/lib/components/booking/forms/forms.d.ts +1 -1
  43. package/lib/components/booking/forms/index.d.ts +1 -1
  44. package/lib/components/booking/forms/index.js +38 -3
  45. package/lib/components/booking/forms/model.d.ts +2 -1
  46. package/lib/components/booking/forms/single/index.js +1 -1
  47. package/lib/components/booking/index.d.ts +1 -1
  48. package/lib/components/booking/info/client/index.js +40 -9
  49. package/lib/components/booking/info/client/serve.d.ts +2 -0
  50. package/lib/components/booking/info/client/serve.js +39 -0
  51. package/lib/components/booking/info/index.d.ts +1 -1
  52. package/lib/components/booking/info/index.js +5 -2
  53. package/lib/components/booking/info/model.d.ts +2 -1
  54. package/lib/components/booking/info/pet/index.js +2 -1
  55. package/lib/components/booking/info/service/addService/index.js +0 -1
  56. package/lib/components/booking/model.d.ts +3 -1
  57. package/lib/components/booking/notes/index.d.ts +1 -1
  58. package/lib/components/booking/notes/model.d.ts +2 -1
  59. package/lib/components/booking/payments/index.d.ts +1 -1
  60. package/lib/components/booking/payments/model.d.ts +2 -1
  61. package/lib/components/schedules/index.d.ts +1 -1
  62. package/lib/components/schedules/model.d.ts +2 -1
  63. package/package.json +3 -3
@@ -25,12 +25,12 @@ import PlusCircle from "@pisell/icon/es/PlusCircle";
25
25
  import DotsVertical from "@pisell/icon/es/DotsVertical";
26
26
  import User01 from "@pisell/icon/es/User01";
27
27
  import { Context, walkInData } from "../model";
28
- import { Avatar, Dropdown, Button } from "antd";
28
+ import { Avatar, Dropdown, Button, Spin } from "antd";
29
29
  import CustomSelect from "../../components/customSelect";
30
30
  import "./index.less";
31
31
  import { image, locales } from "@pisell/utils";
32
32
  import { isWalkIn as getIsWalkIn } from "../../utils";
33
- import useEngineContext from "../../../../hooks/useEngineContext";
33
+ import { getFranchiseeCustomerInfo, getFranchiseeCustomerList } from "./serve";
34
34
  var Info = function Info() {
35
35
  var _state$client$value2, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7;
36
36
  var modalRef = useRef();
@@ -45,16 +45,19 @@ var Info = function Info() {
45
45
  var _useContext = useContext(Context),
46
46
  state = _useContext.state,
47
47
  dispatch = _useContext.dispatch;
48
- var _useState5 = useState({
48
+ var _useState5 = useState(0),
49
+ _useState6 = _slicedToArray(_useState5, 2),
50
+ franchiseeLoading = _useState6[0],
51
+ setFranchiseeLoading = _useState6[1];
52
+ var _useState7 = useState({
49
53
  skip: 1,
50
54
  num: 50,
51
55
  total: 0,
52
56
  search: ""
53
57
  }),
54
- _useState6 = _slicedToArray(_useState5, 2),
55
- params = _useState6[0],
56
- setParams = _useState6[1];
57
- var context = useEngineContext();
58
+ _useState8 = _slicedToArray(_useState7, 2),
59
+ params = _useState8[0],
60
+ setParams = _useState8[1];
58
61
  var menus = useMemo(function () {
59
62
  var list = [{
60
63
  key: "view",
@@ -75,22 +78,27 @@ var Info = function Info() {
75
78
  }, [state.disabledEdit]);
76
79
  var getClients = /*#__PURE__*/function () {
77
80
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
78
- var customer_id, resetParams, _setLoading, data, list, _payload, customerItem, totalList;
81
+ var customer_id, resetParams, _setLoading, api, data, list, _payload, customerItem, totalList;
79
82
  return _regeneratorRuntime().wrap(function _callee$(_context) {
80
83
  while (1) switch (_context.prev = _context.next) {
81
84
  case 0:
82
85
  customer_id = _ref.customer_id, resetParams = _objectWithoutProperties(_ref, _excluded);
83
86
  _setLoading = resetParams.skip === 1 ? setLoading : setLoadLoading;
84
87
  _setLoading(true);
85
- _context.next = 5;
86
- return state.apis.getClients(_objectSpread(_objectSpread({}, resetParams), {}, {
88
+ api = state.isFranchisee ? getFranchiseeCustomerList : state.apis.getClients;
89
+ _context.next = 6;
90
+ return api(_objectSpread(_objectSpread({}, resetParams), !state.isFranchisee ? {
87
91
  _config: {
88
92
  abort: true
89
93
  }
90
- }));
91
- case 5:
94
+ } : {}));
95
+ case 6:
92
96
  data = _context.sent;
93
- list = (data === null || data === void 0 ? void 0 : data.list) || [];
97
+ list = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (d) {
98
+ return _objectSpread(_objectSpread({}, d), {}, {
99
+ id: d.franchisee_customer_id || d.id
100
+ });
101
+ });
94
102
  _payload = {
95
103
  clients: list
96
104
  }; // 有传递, 则表示新增客户之后刷新列表的, 应该默认选中
@@ -119,7 +127,7 @@ var Info = function Info() {
119
127
  });
120
128
  _setLoading(false);
121
129
  return _context.abrupt("return", {});
122
- case 16:
130
+ case 17:
123
131
  case "end":
124
132
  return _context.stop();
125
133
  }
@@ -146,21 +154,103 @@ var Info = function Info() {
146
154
  }
147
155
  return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
148
156
  }, [locales.localeMap]);
149
- var handleSelectClient = function handleSelectClient(value) {
150
- var _value = (value === null || value === void 0 ? void 0 : value[value.length - 1]) || walkInData;
151
- if (_value.loading) {
152
- return;
153
- }
154
- dispatch({
155
- type: "setClient",
156
- payload: {
157
- value: _objectSpread(_objectSpread({}, _value), {}, {
158
- name: getNickname(_value)
159
- }),
160
- edit: true
161
- }
162
- });
163
- };
157
+
158
+ /**
159
+ * @title: 置换客户id到子店铺
160
+ * @description:
161
+ * @param {number} id
162
+ * @return {*}
163
+ * @Author: zhiwei.Wang
164
+ * @Date: 2024-05-29 17:26
165
+ */
166
+ var _getFranchiseeCustomerInfo = /*#__PURE__*/function () {
167
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(customer) {
168
+ var res;
169
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
170
+ while (1) switch (_context2.prev = _context2.next) {
171
+ case 0:
172
+ _context2.prev = 0;
173
+ setFranchiseeLoading(customer.id);
174
+ _context2.next = 4;
175
+ return getFranchiseeCustomerInfo({
176
+ franchisor_customer_id: customer.id
177
+ });
178
+ case 4:
179
+ res = _context2.sent;
180
+ setFranchiseeLoading(0);
181
+ return _context2.abrupt("return", _objectSpread(_objectSpread({}, customer), {}, {
182
+ id: res.franchisee_customer_id
183
+ }));
184
+ case 9:
185
+ _context2.prev = 9;
186
+ _context2.t0 = _context2["catch"](0);
187
+ setFranchiseeLoading(0);
188
+ case 12:
189
+ case "end":
190
+ return _context2.stop();
191
+ }
192
+ }, _callee2, null, [[0, 9]]);
193
+ }));
194
+ return function _getFranchiseeCustomerInfo(_x3) {
195
+ return _ref3.apply(this, arguments);
196
+ };
197
+ }();
198
+ var handleSelectClient = /*#__PURE__*/function () {
199
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value) {
200
+ var _value;
201
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
202
+ while (1) switch (_context3.prev = _context3.next) {
203
+ case 0:
204
+ _value = (value === null || value === void 0 ? void 0 : value[value.length - 1]) || walkInData;
205
+ if (!_value.loading) {
206
+ _context3.next = 3;
207
+ break;
208
+ }
209
+ return _context3.abrupt("return");
210
+ case 3:
211
+ if (!(state.isFranchisee && _value.franchisee_customer_id === 0)) {
212
+ _context3.next = 14;
213
+ break;
214
+ }
215
+ _context3.prev = 4;
216
+ _context3.next = 7;
217
+ return _getFranchiseeCustomerInfo(_value);
218
+ case 7:
219
+ _value = _context3.sent;
220
+ _context3.next = 12;
221
+ break;
222
+ case 10:
223
+ _context3.prev = 10;
224
+ _context3.t0 = _context3["catch"](4);
225
+ case 12:
226
+ if (_value) {
227
+ _context3.next = 14;
228
+ break;
229
+ }
230
+ return _context3.abrupt("return");
231
+ case 14:
232
+ dispatch({
233
+ type: "setClient",
234
+ payload: {
235
+ value: _objectSpread(_objectSpread({}, _value), {}, {
236
+ name: getNickname(_value)
237
+ }),
238
+ edit: true
239
+ }
240
+ });
241
+ return _context3.abrupt("return", new Promise(function (resolve) {
242
+ resolve(0);
243
+ }));
244
+ case 16:
245
+ case "end":
246
+ return _context3.stop();
247
+ }
248
+ }, _callee3, null, [[4, 10]]);
249
+ }));
250
+ return function handleSelectClient(_x4) {
251
+ return _ref4.apply(this, arguments);
252
+ };
253
+ }();
164
254
  var handleViewClient = function handleViewClient() {
165
255
  state.action({
166
256
  type: "pisell1.handleOpenCustomerModal",
@@ -216,7 +306,6 @@ var Info = function Info() {
216
306
  var _state$client$value;
217
307
  return getIsWalkIn((_state$client$value = state.client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id);
218
308
  }, [(_state$client$value2 = state.client.value) === null || _state$client$value2 === void 0 ? void 0 : _state$client$value2.id]);
219
- useEffect(function () {}, []);
220
309
  useEffect(function () {
221
310
  if (state.action) {
222
311
  state.action({
@@ -352,7 +441,11 @@ var Info = function Info() {
352
441
  className: ""
353
442
  }, item.email) : null, item.phone ? /*#__PURE__*/React.createElement("div", {
354
443
  className: ""
355
- }, item.phone) : null)));
444
+ }, item.phone) : null)), /*#__PURE__*/React.createElement("div", {
445
+ className: "pisell-lowcode__booking-client-list-item-loading"
446
+ }, /*#__PURE__*/React.createElement(Spin, {
447
+ spinning: franchiseeLoading === item.id
448
+ })));
356
449
  },
357
450
  searchChange: searchChange,
358
451
  searchValue: params.search
@@ -0,0 +1,2 @@
1
+ export declare const getFranchiseeCustomerInfo: (params: any) => Promise<any>;
2
+ export declare const getFranchiseeCustomerList: (params: any) => Promise<any>;
@@ -0,0 +1,51 @@
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; }
3
+ 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); } }
4
+ 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); }); }; }
5
+ import { request } from "../../utils";
6
+ export var getFranchiseeCustomerInfo = /*#__PURE__*/function () {
7
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
8
+ var _yield$request$getReq, data;
9
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10
+ while (1) switch (_context.prev = _context.next) {
11
+ case 0:
12
+ _context.next = 2;
13
+ return request.getRequest().get("/shop/franchisee/customer/id", params);
14
+ case 2:
15
+ _yield$request$getReq = _context.sent;
16
+ data = _yield$request$getReq.data;
17
+ return _context.abrupt("return", data);
18
+ case 5:
19
+ case "end":
20
+ return _context.stop();
21
+ }
22
+ }, _callee);
23
+ }));
24
+ return function getFranchiseeCustomerInfo(_x) {
25
+ return _ref.apply(this, arguments);
26
+ };
27
+ }();
28
+ export var getFranchiseeCustomerList = /*#__PURE__*/function () {
29
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
30
+ var _yield$request$getReq2, data;
31
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
32
+ while (1) switch (_context2.prev = _context2.next) {
33
+ case 0:
34
+ _context2.next = 2;
35
+ return request.getRequest().get("/shop/franchisee/customer/select-list", params, {
36
+ abort: true
37
+ });
38
+ case 2:
39
+ _yield$request$getReq2 = _context2.sent;
40
+ data = _yield$request$getReq2.data;
41
+ return _context2.abrupt("return", data);
42
+ case 5:
43
+ case "end":
44
+ return _context2.stop();
45
+ }
46
+ }, _callee2);
47
+ }));
48
+ return function getFranchiseeCustomerList(_x2) {
49
+ return _ref2.apply(this, arguments);
50
+ };
51
+ }();
@@ -8,5 +8,5 @@ export interface InfoProps {
8
8
  slot: any;
9
9
  setState: any;
10
10
  }
11
- declare const Info: (props: any) => JSX.Element;
11
+ declare const Info: (props: any) => any;
12
12
  export default Info;
@@ -16,7 +16,7 @@ import AddNote from "../notes/addNote";
16
16
  import Header from "./header";
17
17
  import localeTexts from "../locales";
18
18
  import { locales } from "@pisell/utils";
19
- import { findNextDuration, flexibleObj, formatResource, getErrorList, sliceDayIntoFiveMinutes } from "../utils";
19
+ import { findNextDuration, flexibleObj, formatResource, getErrorList, sliceDayIntoFiveMinutes, request } from "../utils";
20
20
  import { updateServiceDate } from "./date";
21
21
  import useEngineContext from "../../../hooks/useEngineContext";
22
22
  import Notes from "./notes";
@@ -30,7 +30,7 @@ var defaultModules = {
30
30
  };
31
31
  locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
32
32
  var Info = Provider(function (props) {
33
- var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _context$appHelper2, _context$appHelper2$u, _modal$state5, _React$createElement;
33
+ var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _context$appHelper3, _context$appHelper3$u, _modal$state5, _React$createElement;
34
34
  // return <Payments {...props} />;
35
35
  var style = props.style,
36
36
  globalState = props.globalState,
@@ -39,6 +39,7 @@ var Info = Provider(function (props) {
39
39
  slot = props.slot;
40
40
  var modal = useContext(Context);
41
41
  var context = useEngineContext();
42
+ request.setRequest(context.appHelper.utils.request);
42
43
  var params = useMemo(function () {
43
44
  var _modal$state, _modal$state$bookingC, _modal$state$bookingC2, _modal$state$bookingC3;
44
45
  return ((_modal$state = modal.state) === null || _modal$state === void 0 ? void 0 : (_modal$state$bookingC = _modal$state.bookingConfig) === null || _modal$state$bookingC === void 0 ? void 0 : (_modal$state$bookingC2 = _modal$state$bookingC.config) === null || _modal$state$bookingC2 === void 0 ? void 0 : (_modal$state$bookingC3 = _modal$state$bookingC2.basic) === null || _modal$state$bookingC3 === void 0 ? void 0 : _modal$state$bookingC3.appointment_subject) || {};
@@ -60,13 +61,15 @@ var Info = Provider(function (props) {
60
61
  }
61
62
  }, []);
62
63
  useEffect(function () {
63
- var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2;
64
+ var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2;
65
+ var isFranchisee = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.businessUtils) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.getAppByModal) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2, "franchisee");
64
66
  modal.dispatch({
65
67
  type: "setState",
66
68
  payload: _objectSpread(_objectSpread({
67
69
  setGlobalState: props.setGlobalState
68
70
  }, globalState), {}, {
69
- isTerminal: context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.isTerminal) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.call(_context$appHelper$ut)
71
+ isTerminal: context === null || context === void 0 ? void 0 : (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : (_context$appHelper2$u = _context$appHelper2.utils) === null || _context$appHelper2$u === void 0 ? void 0 : (_context$appHelper2$u2 = _context$appHelper2$u.isTerminal) === null || _context$appHelper2$u2 === void 0 ? void 0 : _context$appHelper2$u2.call(_context$appHelper2$u),
72
+ isFranchisee: isFranchisee
70
73
  })
71
74
  });
72
75
  }, [globalState]);
@@ -112,7 +115,7 @@ var Info = Provider(function (props) {
112
115
  source: "info"
113
116
  })
114
117
  }, _defineProperty(_React$createElement, "style", {
115
- height: context !== null && context !== void 0 && (_context$appHelper2 = context.appHelper) !== null && _context$appHelper2 !== void 0 && (_context$appHelper2$u = _context$appHelper2.utils) !== null && _context$appHelper2$u !== void 0 && _context$appHelper2$u.isMobile ? "100%" : "100vh"
118
+ height: context !== null && context !== void 0 && (_context$appHelper3 = context.appHelper) !== null && _context$appHelper3 !== void 0 && (_context$appHelper3$u = _context$appHelper3.utils) !== null && _context$appHelper3$u !== void 0 && _context$appHelper3$u.isMobile ? "100%" : "100vh"
116
119
  }), _defineProperty(_React$createElement, "bodyClassName", "booking-info-warp"), _React$createElement), /*#__PURE__*/React.createElement("div", {
117
120
  className: "booking-info"
118
121
  }, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state5 = modal.state) !== null && _modal$state5 !== void 0 && _modal$state5.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === "form" ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null)) : null);
@@ -1,9 +1,10 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
3
  export declare const walkInData: {
3
4
  id: number;
4
5
  nickname: string;
5
6
  };
6
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
7
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
7
8
  state: FormState;
8
9
  } & {
9
10
  dispatch: (params: {
@@ -119,9 +119,11 @@ var Pet = function Pet() {
119
119
  _context.next = 14;
120
120
  break;
121
121
  }
122
- _values = _objectSpread({
122
+ _values = _objectSpread(_objectSpread({
123
123
  form_id: boardParams.form_id
124
- }, _params);
124
+ }, _params), {}, {
125
+ source_shop_customer: petForm === null || petForm === void 0 ? void 0 : petForm.is_franchisor
126
+ });
125
127
  if (formData.data_range === "customer") {
126
128
  _values.customer_id = (_state$client2 = state.client) === null || _state$client2 === void 0 ? void 0 : (_state$client2$value = _state$client2.value) === null || _state$client2$value === void 0 ? void 0 : _state$client2$value.id;
127
129
  }
@@ -360,7 +360,6 @@ var Info = function Info() {
360
360
  }
361
361
  });
362
362
  }, [state.renderType, showAddButton, isService, state.service.value, loading]);
363
- console.log(state.service.addModal, "state.service.addModal");
364
363
  return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : (_state$service3$cache = _state$service3.cacheItem) === null || _state$service3$cache === void 0 ? void 0 : _state$service3$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
365
364
  loading: true,
366
365
  active: true,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface FormState {
2
3
  amountSymbol: string;
3
4
  apis: {
@@ -73,6 +74,7 @@ export interface FormState {
73
74
  renderType?: "eventBooking";
74
75
  modalOpen?: boolean;
75
76
  isTerminal?: boolean;
77
+ isFranchisee?: boolean;
76
78
  eventOtherParams?: {
77
79
  relation_id: number;
78
80
  number: number;
@@ -88,7 +90,7 @@ export declare const walkInData: {
88
90
  id: number;
89
91
  nickname: string;
90
92
  };
91
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
93
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
92
94
  state: FormState;
93
95
  } & {
94
96
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: (props: any) => JSX.Element;
7
+ declare const Notes: (props: any) => any;
8
8
  export default Notes;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Payments: (props: any) => JSX.Element;
8
+ declare const Payments: (props: any) => any;
9
9
  export default Payments;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => JSX.Element;
2
+ declare const Schedules: (props: any) => any;
3
3
  export default Schedules;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,7 +69,7 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
72
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
72
73
  state: FormState;
73
74
  } & {
74
75
  dispatch: (params: {
@@ -13,5 +13,5 @@ export interface InfoProps {
13
13
  setGlobalState: any;
14
14
  }
15
15
  export declare const formatProducts: (values: any) => any;
16
- declare const Addons: (props: any) => JSX.Element;
16
+ declare const Addons: (props: any) => any;
17
17
  export default Addons;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -118,8 +118,8 @@ var CustomSelect = (props, ref) => {
118
118
  }, 100);
119
119
  }
120
120
  };
121
- const _onValueChange = (_val) => {
122
- onValueChange(_val);
121
+ const _onValueChange = async (_val) => {
122
+ await onValueChange(_val);
123
123
  };
124
124
  const handleSelectItem = (item) => {
125
125
  let _val = (0, import_utils.changeArray)(_value, item, rowKey);
@@ -162,8 +162,8 @@ var CustomSelect = (props, ref) => {
162
162
  const isMore = (0, import_react.useMemo)(() => {
163
163
  return _value.length > 0;
164
164
  }, [_value]);
165
- const handleApply = (_val) => {
166
- _onValueChange(_val || _value);
165
+ const handleApply = async (_val) => {
166
+ await _onValueChange(_val || _value);
167
167
  closeDrawer();
168
168
  };
169
169
  (0, import_react.useImperativeHandle)(ref, () => {
@@ -238,7 +238,7 @@ var Footer = (props) => {
238
238
  );
239
239
  }, [isEdit, checkoutLoading, isDisabled, state, source]);
240
240
  const handleMenuClick = async (e) => {
241
- var _a2;
241
+ var _a2, _b2;
242
242
  let id = state.bookingId;
243
243
  let customer = state.bookingDetail.customer;
244
244
  if (isEdit) {
@@ -253,7 +253,8 @@ var Footer = (props) => {
253
253
  id,
254
254
  is_deposit: state.bookingDetail.is_deposit || Number((_a2 = state.bookingDetail) == null ? void 0 : _a2.deposit_amount),
255
255
  deposit_payment_time: state.bookingDetail.deposit_payment_time,
256
- customer
256
+ customer,
257
+ contacts: (_b2 = state.bookingDetail) == null ? void 0 : _b2.contacts
257
258
  },
258
259
  callback: () => {
259
260
  }
@@ -124,17 +124,20 @@ var formatBookings = (data) => {
124
124
  });
125
125
  return bookings;
126
126
  };
127
- var formatHolder = (data, values) => {
127
+ var formatHolder = (state, values) => {
128
128
  var _a, _b, _c, _d, _e, _f, _g, _h;
129
- const form_id = ((_d = (_c = (_b = (_a = data == null ? void 0 : data.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
130
- const petValue = ((_e = data.pet.value) == null ? void 0 : _e[form_id]) || [];
129
+ const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
130
+ const petValue = ((_e = state.pet.value) == null ? void 0 : _e[form_id]) || [];
131
131
  let obj = {
132
132
  customer_id: values.customer_id,
133
133
  form_id,
134
134
  form_record: petValue.map((d) => d.form_record_id)
135
135
  };
136
- if (!petValue.length && ((_h = (_g = (_f = data.pet) == null ? void 0 : _f.originValue) == null ? void 0 : _g.form_record) == null ? void 0 : _h.length)) {
137
- obj.form_record = data.pet.originValue.form_record;
136
+ if (!petValue.length && ((_h = (_g = (_f = state.pet) == null ? void 0 : _f.originValue) == null ? void 0 : _g.form_record) == null ? void 0 : _h.length)) {
137
+ obj.form_record = state.pet.originValue.form_record;
138
+ }
139
+ if (state.isFranchisee) {
140
+ obj.is_source_shop = 1;
138
141
  }
139
142
  return obj;
140
143
  };
@@ -61,7 +61,8 @@ var Deposit = (props) => {
61
61
  id,
62
62
  is_deposit: 1,
63
63
  deposit_payment_time: bookingDetail.deposit_payment_time,
64
- customer: bookingDetail.customer
64
+ customer: bookingDetail.customer,
65
+ contacts: bookingDetail == null ? void 0 : bookingDetail.contacts
65
66
  },
66
67
  callback: () => {
67
68
  }
@@ -21,5 +21,5 @@ export interface InfoProps {
21
21
  * @Author: zhiwei.Wang
22
22
  * @Date: 2024-01-30 17:10
23
23
  */
24
- declare const Forms: (props: any) => JSX.Element;
24
+ declare const Forms: (props: any) => any;
25
25
  export default Forms;
@@ -5,5 +5,5 @@ export interface InfoProps {
5
5
  globalState: any;
6
6
  setGlobalState: any;
7
7
  }
8
- declare const Forms: (props: any) => JSX.Element;
8
+ declare const Forms: (props: any) => any;
9
9
  export default Forms;