@pisell/private-materials 3.0.60 → 3.0.61

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 (31) 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/components/customSelect/index.js +40 -7
  10. package/es/components/booking/components/footer/utils.js +12 -7
  11. package/es/components/booking/forms/index.js +136 -63
  12. package/es/components/booking/forms/single/index.js +1 -1
  13. package/es/components/booking/info/client/index.js +124 -31
  14. package/es/components/booking/info/client/serve.d.ts +2 -0
  15. package/es/components/booking/info/client/serve.js +51 -0
  16. package/es/components/booking/info/index.js +8 -5
  17. package/es/components/booking/info/pet/index.js +4 -2
  18. package/es/components/booking/info/service/addService/index.js +0 -1
  19. package/es/components/booking/model.d.ts +1 -0
  20. package/lib/components/booking/components/customSelect/index.js +4 -4
  21. package/lib/components/booking/components/footer/utils.js +8 -5
  22. package/lib/components/booking/forms/index.js +38 -3
  23. package/lib/components/booking/forms/single/index.js +1 -1
  24. package/lib/components/booking/info/client/index.js +40 -9
  25. package/lib/components/booking/info/client/serve.d.ts +2 -0
  26. package/lib/components/booking/info/client/serve.js +39 -0
  27. package/lib/components/booking/info/index.js +5 -2
  28. package/lib/components/booking/info/pet/index.js +2 -1
  29. package/lib/components/booking/info/service/addService/index.js +0 -1
  30. package/lib/components/booking/model.d.ts +1 -0
  31. package/package.json +1 -1
@@ -1,8 +1,12 @@
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); }
1
2
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
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 _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; }
8
+ 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); } }
9
+ 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
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
11
  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."); }
8
12
  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); }
@@ -165,9 +169,23 @@ var CustomSelect = function CustomSelect(props, ref) {
165
169
  * @Author: zhiwei.Wang
166
170
  * @Date: 2024-01-30 16:46
167
171
  */
168
- var _onValueChange = function _onValueChange(_val) {
169
- onValueChange(_val);
170
- };
172
+ var _onValueChange = /*#__PURE__*/function () {
173
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_val) {
174
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
175
+ while (1) switch (_context.prev = _context.next) {
176
+ case 0:
177
+ _context.next = 2;
178
+ return onValueChange(_val);
179
+ case 2:
180
+ case "end":
181
+ return _context.stop();
182
+ }
183
+ }, _callee);
184
+ }));
185
+ return function _onValueChange(_x2) {
186
+ return _ref.apply(this, arguments);
187
+ };
188
+ }();
171
189
 
172
190
  /**
173
191
  * @title: 选择
@@ -266,10 +284,25 @@ var CustomSelect = function CustomSelect(props, ref) {
266
284
  * @Author: zhiwei.Wang
267
285
  * @Date: 2024-01-30 16:47
268
286
  */
269
- var handleApply = function handleApply(_val) {
270
- _onValueChange(_val || _value);
271
- closeDrawer();
272
- };
287
+ var handleApply = /*#__PURE__*/function () {
288
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_val) {
289
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
290
+ while (1) switch (_context2.prev = _context2.next) {
291
+ case 0:
292
+ _context2.next = 2;
293
+ return _onValueChange(_val || _value);
294
+ case 2:
295
+ closeDrawer();
296
+ case 3:
297
+ case "end":
298
+ return _context2.stop();
299
+ }
300
+ }, _callee2);
301
+ }));
302
+ return function handleApply(_x3) {
303
+ return _ref2.apply(this, arguments);
304
+ };
305
+ }();
273
306
  useImperativeHandle(ref, function () {
274
307
  return {
275
308
  open: handleOpenModal,
@@ -135,16 +135,16 @@ var formatBookings = function formatBookings(data) {
135
135
  /**
136
136
  * @title: 预约主体信息
137
137
  * @description:
138
- * @param {any} data
138
+ * @param {any} state
139
139
  * @param {any} values
140
140
  * @return {*}
141
141
  * @Author: zhiwei.Wang
142
142
  * @Date: 2024-02-19 09:26
143
143
  */
144
- var formatHolder = function formatHolder(data, values) {
145
- var _data$bookingConfig, _data$bookingConfig$c, _data$bookingConfig$c2, _data$bookingConfig$c3, _data$pet$value, _data$pet, _data$pet$originValue, _data$pet$originValue2;
146
- var form_id = (data === null || data === void 0 ? void 0 : (_data$bookingConfig = data.bookingConfig) === null || _data$bookingConfig === void 0 ? void 0 : (_data$bookingConfig$c = _data$bookingConfig.config) === null || _data$bookingConfig$c === void 0 ? void 0 : (_data$bookingConfig$c2 = _data$bookingConfig$c.basic) === null || _data$bookingConfig$c2 === void 0 ? void 0 : (_data$bookingConfig$c3 = _data$bookingConfig$c2.appointment_subject) === null || _data$bookingConfig$c3 === void 0 ? void 0 : _data$bookingConfig$c3.form_id) || 0;
147
- var petValue = ((_data$pet$value = data.pet.value) === null || _data$pet$value === void 0 ? void 0 : _data$pet$value[form_id]) || [];
144
+ var formatHolder = function formatHolder(state, values) {
145
+ var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2, _state$bookingConfig$3, _state$pet$value, _state$pet, _state$pet$originValu, _state$pet$originValu2;
146
+ var form_id = (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.basic) === null || _state$bookingConfig$2 === void 0 ? void 0 : (_state$bookingConfig$3 = _state$bookingConfig$2.appointment_subject) === null || _state$bookingConfig$3 === void 0 ? void 0 : _state$bookingConfig$3.form_id) || 0;
147
+ var petValue = ((_state$pet$value = state.pet.value) === null || _state$pet$value === void 0 ? void 0 : _state$pet$value[form_id]) || [];
148
148
  var obj = {
149
149
  customer_id: values.customer_id,
150
150
  form_id: form_id,
@@ -154,8 +154,13 @@ var formatHolder = function formatHolder(data, values) {
154
154
  };
155
155
 
156
156
  // 如果 value 为 空 并且originValue有值, 说明接口还没返回 这时候直接用接口的值
157
- if (!petValue.length && (_data$pet = data.pet) !== null && _data$pet !== void 0 && (_data$pet$originValue = _data$pet.originValue) !== null && _data$pet$originValue !== void 0 && (_data$pet$originValue2 = _data$pet$originValue.form_record) !== null && _data$pet$originValue2 !== void 0 && _data$pet$originValue2.length) {
158
- obj.form_record = data.pet.originValue.form_record;
157
+ if (!petValue.length && (_state$pet = state.pet) !== null && _state$pet !== void 0 && (_state$pet$originValu = _state$pet.originValue) !== null && _state$pet$originValu !== void 0 && (_state$pet$originValu2 = _state$pet$originValu.form_record) !== null && _state$pet$originValu2 !== void 0 && _state$pet$originValu2.length) {
158
+ obj.form_record = state.pet.originValue.form_record;
159
+ }
160
+
161
+ // 连锁加盟子店铺 增加参数
162
+ if (state.isFranchisee) {
163
+ obj.is_source_shop = 1;
159
164
  }
160
165
  return obj;
161
166
  };
@@ -52,68 +52,136 @@ var Forms = Provider(function (props) {
52
52
  geForms();
53
53
  }
54
54
  }, [(_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : (_state$bookingDetail3 = _state$bookingDetail2.bookings) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.id, (_state$client = state.client) === null || _state$client === void 0 ? void 0 : (_state$client$value = _state$client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id]);
55
+ var getFranchiseeCompositeData = /*#__PURE__*/function () {
56
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
57
+ var request, params, arr, res;
58
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
59
+ while (1) switch (_context.prev = _context.next) {
60
+ case 0:
61
+ request = _ref2.request, params = _ref2.params;
62
+ arr = [];
63
+ arr.push(request(params));
64
+ if (state.isFranchisee) {
65
+ arr.push(request(_objectSpread(_objectSpread({}, params), {}, {
66
+ source_shop_customer: 1
67
+ })));
68
+ }
69
+ _context.next = 6;
70
+ return Promise.all(arr);
71
+ case 6:
72
+ res = _context.sent;
73
+ return _context.abrupt("return", res);
74
+ case 8:
75
+ case "end":
76
+ return _context.stop();
77
+ }
78
+ }, _callee);
79
+ }));
80
+ return function getFranchiseeCompositeData(_x2) {
81
+ return _ref3.apply(this, arguments);
82
+ };
83
+ }();
84
+ var getFranchiseeForms = /*#__PURE__*/function () {
85
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
86
+ var res, arr;
87
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
88
+ while (1) switch (_context2.prev = _context2.next) {
89
+ case 0:
90
+ _context2.next = 2;
91
+ return getFranchiseeCompositeData({
92
+ request: state.apis.getForms,
93
+ params: params
94
+ });
95
+ case 2:
96
+ res = _context2.sent;
97
+ if (!state.isFranchisee) {
98
+ _context2.next = 7;
99
+ break;
100
+ }
101
+ arr = [];
102
+ res.forEach(function (item, index) {
103
+ arr = arr.concat(item.map(function (d) {
104
+ return _objectSpread(_objectSpread({}, d), {}, {
105
+ is_franchisor: index === 1 ? 1 : 0
106
+ });
107
+ }));
108
+ });
109
+ return _context2.abrupt("return", arr);
110
+ case 7:
111
+ return _context2.abrupt("return", res[0]);
112
+ case 8:
113
+ case "end":
114
+ return _context2.stop();
115
+ }
116
+ }, _callee2);
117
+ }));
118
+ return function getFranchiseeForms(_x3) {
119
+ return _ref4.apply(this, arguments);
120
+ };
121
+ }();
55
122
  var getFormDataById = /*#__PURE__*/function () {
56
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(item) {
123
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(item) {
57
124
  var _state$client2, _state$client2$value;
58
125
  var _params, options, isCustomerForm, data;
59
- return _regeneratorRuntime().wrap(function _callee$(_context) {
60
- while (1) switch (_context.prev = _context.next) {
126
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
127
+ while (1) switch (_context3.prev = _context3.next) {
61
128
  case 0:
62
129
  _params = {
63
130
  form_id: item.form_id,
64
131
  skip: 1,
65
- num: 999
132
+ num: 999,
133
+ source_shop_customer: item.is_franchisor ? 1 : 0
66
134
  };
67
135
  options = []; // 客户数据 && 已经选择了客户
68
136
  isCustomerForm = item.data_range === "customer" && !isWalkIn((_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); // 只有 客户数据 && 已经选择了客户 或者不是客户表单的才请求接口
69
137
  if (!(item.data_range !== "customer" || isCustomerForm)) {
70
- _context.next = 9;
138
+ _context3.next = 9;
71
139
  break;
72
140
  }
73
141
  if (isCustomerForm) {
74
142
  _params.customer_id = state.client.value.id;
75
143
  }
76
- _context.next = 7;
144
+ _context3.next = 7;
77
145
  return state.apis.getPetsData(_params);
78
146
  case 7:
79
- data = _context.sent;
147
+ data = _context3.sent;
80
148
  options = (data === null || data === void 0 ? void 0 : data.list) || [];
81
149
  case 9:
82
- return _context.abrupt("return", _objectSpread(_objectSpread({}, item), {}, {
150
+ return _context3.abrupt("return", _objectSpread(_objectSpread({}, item), {}, {
83
151
  options: options
84
152
  }));
85
153
  case 10:
86
154
  case "end":
87
- return _context.stop();
155
+ return _context3.stop();
88
156
  }
89
- }, _callee);
157
+ }, _callee3);
90
158
  }));
91
- return function getFormDataById(_x2) {
92
- return _ref2.apply(this, arguments);
159
+ return function getFormDataById(_x4) {
160
+ return _ref5.apply(this, arguments);
93
161
  };
94
162
  }();
95
163
  var getFormData = /*#__PURE__*/function () {
96
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
164
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
97
165
  var formList,
98
166
  all,
99
- _args2 = arguments;
100
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
101
- while (1) switch (_context2.prev = _context2.next) {
167
+ _args4 = arguments;
168
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
169
+ while (1) switch (_context4.prev = _context4.next) {
102
170
  case 0:
103
- formList = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : [];
171
+ formList = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : [];
104
172
  all = [];
105
173
  all = formList.map(function (d) {
106
174
  return getFormDataById(d);
107
175
  });
108
- return _context2.abrupt("return", Promise.all(all));
176
+ return _context4.abrupt("return", Promise.all(all));
109
177
  case 4:
110
178
  case "end":
111
- return _context2.stop();
179
+ return _context4.stop();
112
180
  }
113
- }, _callee2);
181
+ }, _callee4);
114
182
  }));
115
183
  return function getFormData() {
116
- return _ref3.apply(this, arguments);
184
+ return _ref6.apply(this, arguments);
117
185
  };
118
186
  }();
119
187
  var getFormValues = function getFormValues(data) {
@@ -133,21 +201,21 @@ var Forms = Provider(function (props) {
133
201
  return _values;
134
202
  };
135
203
  var geForms = /*#__PURE__*/function () {
136
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
204
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
137
205
  var data, formData;
138
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
139
- while (1) switch (_context3.prev = _context3.next) {
206
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
207
+ while (1) switch (_context5.prev = _context5.next) {
140
208
  case 0:
141
209
  setLoading(true);
142
- _context3.prev = 1;
143
- _context3.next = 4;
144
- return state.apis.getForms({
210
+ _context5.prev = 1;
211
+ _context5.next = 4;
212
+ return getFranchiseeForms({
145
213
  relation_type: relation_type,
146
214
  relation_id: state.bookingDetail.bookings.id
147
215
  // _config: { useCache: true },
148
216
  });
149
217
  case 4:
150
- data = _context3.sent;
218
+ data = _context5.sent;
151
219
  data = data || [];
152
220
  if (params.type === "form") {
153
221
  // 去除预约主体
@@ -155,10 +223,11 @@ var Forms = Provider(function (props) {
155
223
  return d.form_id !== (params === null || params === void 0 ? void 0 : params.form_id);
156
224
  });
157
225
  }
158
- _context3.next = 9;
226
+ console.log("datadata", data);
227
+ _context5.next = 10;
159
228
  return getFormData(data);
160
- case 9:
161
- formData = _context3.sent;
229
+ case 10:
230
+ formData = _context5.sent;
162
231
  dispatch({
163
232
  type: "setForm",
164
233
  payload: {
@@ -167,21 +236,21 @@ var Forms = Provider(function (props) {
167
236
  }
168
237
  });
169
238
  setLoading(false);
170
- _context3.next = 18;
239
+ _context5.next = 19;
171
240
  break;
172
- case 14:
173
- _context3.prev = 14;
174
- _context3.t0 = _context3["catch"](1);
241
+ case 15:
242
+ _context5.prev = 15;
243
+ _context5.t0 = _context5["catch"](1);
175
244
  setLoading(false);
176
- console.log("form_error", _context3.t0);
177
- case 18:
245
+ console.log("form_error", _context5.t0);
246
+ case 19:
178
247
  case "end":
179
- return _context3.stop();
248
+ return _context5.stop();
180
249
  }
181
- }, _callee3, null, [[1, 14]]);
250
+ }, _callee5, null, [[1, 15]]);
182
251
  }));
183
252
  return function geForms() {
184
- return _ref4.apply(this, arguments);
253
+ return _ref7.apply(this, arguments);
185
254
  };
186
255
  }();
187
256
  useEffect(function () {
@@ -196,9 +265,13 @@ var Forms = Provider(function (props) {
196
265
  });
197
266
  }, []);
198
267
  useEffect(function () {
268
+ var _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2, _context$appHelper2$u3;
269
+ var isFranchisee = 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.businessUtils) === null || _context$appHelper2$u2 === void 0 ? void 0 : (_context$appHelper2$u3 = _context$appHelper2$u2.getAppByModal) === null || _context$appHelper2$u3 === void 0 ? void 0 : _context$appHelper2$u3.call(_context$appHelper2$u2, "franchisee");
199
270
  dispatch({
200
271
  type: "setState",
201
- payload: _objectSpread({}, globalState)
272
+ payload: _objectSpread(_objectSpread({}, globalState), {}, {
273
+ isFranchisee: isFranchisee
274
+ })
202
275
  });
203
276
  }, [globalState]);
204
277
 
@@ -206,34 +279,34 @@ var Forms = Provider(function (props) {
206
279
  // type: single table multiple form
207
280
 
208
281
  var saveBookingFormData = /*#__PURE__*/function () {
209
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
282
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
210
283
  var data;
211
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
212
- while (1) switch (_context4.prev = _context4.next) {
284
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
285
+ while (1) switch (_context6.prev = _context6.next) {
213
286
  case 0:
214
- _context4.prev = 0;
215
- _context4.next = 3;
287
+ _context6.prev = 0;
288
+ _context6.next = 3;
216
289
  return state.apis.saveBookingFormData(params);
217
290
  case 3:
218
- data = _context4.sent;
291
+ data = _context6.sent;
219
292
  message.success(locales.getText("pisell2.text.forms") + locales.getText("pisell2.text.updated"));
220
293
  state === null || state === void 0 ? void 0 : state.callback({
221
294
  order_id: state.bookingId,
222
295
  afterCloseUpdate: true
223
296
  });
224
- _context4.next = 10;
297
+ _context6.next = 10;
225
298
  break;
226
299
  case 8:
227
- _context4.prev = 8;
228
- _context4.t0 = _context4["catch"](0);
300
+ _context6.prev = 8;
301
+ _context6.t0 = _context6["catch"](0);
229
302
  case 10:
230
303
  case "end":
231
- return _context4.stop();
304
+ return _context6.stop();
232
305
  }
233
- }, _callee4, null, [[0, 8]]);
306
+ }, _callee6, null, [[0, 8]]);
234
307
  }));
235
- return function saveBookingFormData(_x3) {
236
- return _ref5.apply(this, arguments);
308
+ return function saveBookingFormData(_x5) {
309
+ return _ref8.apply(this, arguments);
237
310
  };
238
311
  }();
239
312
  var onValueChange = function onValueChange(data) {
@@ -256,16 +329,16 @@ var Forms = Provider(function (props) {
256
329
  });
257
330
  };
258
331
  var addCallback = /*#__PURE__*/function () {
259
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(form) {
332
+ var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(form) {
260
333
  var _data, data;
261
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
262
- while (1) switch (_context5.prev = _context5.next) {
334
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
335
+ while (1) switch (_context7.prev = _context7.next) {
263
336
  case 0:
264
337
  _data = _toConsumableArray(state.form.forms);
265
- _context5.next = 3;
338
+ _context7.next = 3;
266
339
  return getFormDataById(form);
267
340
  case 3:
268
- data = _context5.sent;
341
+ data = _context7.sent;
269
342
  _data = _data.map(function (d) {
270
343
  return d.form_id === form.form_id ? data : d;
271
344
  });
@@ -277,12 +350,12 @@ var Forms = Provider(function (props) {
277
350
  });
278
351
  case 6:
279
352
  case "end":
280
- return _context5.stop();
353
+ return _context7.stop();
281
354
  }
282
- }, _callee5);
355
+ }, _callee7);
283
356
  }));
284
- return function addCallback(_x4) {
285
- return _ref6.apply(this, arguments);
357
+ return function addCallback(_x6) {
358
+ return _ref9.apply(this, arguments);
286
359
  };
287
360
  }();
288
361
  return /*#__PURE__*/React.createElement(React.Fragment, null, !!state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, {
@@ -146,7 +146,7 @@ var Single = function Single(_ref) {
146
146
  style: {
147
147
  flex: 1
148
148
  }
149
- }, item["main_field"] || "-");
149
+ }, item["main_field"] || item[form.option_key] || "-");
150
150
  };
151
151
 
152
152
  /**