kmkf-work-order-service-component 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/WorkOrder/common/utils/tools.d.ts +1 -1
- package/dist/esm/WorkOrder/common/utils/tools.js +92 -27
- package/dist/esm/WorkOrder/components/CustomizeFormModal/index.js +15 -11
- package/dist/esm/WorkOrder/components/DealWorkOrderModal/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/DealWorkOrderModal/index.js +110 -0
- package/dist/esm/WorkOrder/components/DeleteCustomizeOrderModal/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/DeleteCustomizeOrderModal/index.js +109 -0
- package/dist/esm/WorkOrder/components/DeletePaymentWorkOrderModal/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/DeletePaymentWorkOrderModal/index.js +107 -0
- package/dist/esm/WorkOrder/components/ExamineModal/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/ExamineModal/index.js +108 -0
- package/dist/esm/WorkOrder/components/FlagPayModal/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/FlagPayModal/index.js +110 -0
- package/dist/esm/WorkOrder/components/ListOrderItem/index.js +23 -69
- package/dist/esm/WorkOrder/components/PayListOrderItem/ModifyModal.js +10 -2
- package/dist/esm/WorkOrder/components/PayListOrderItem/RecordModal.js +4 -2
- package/dist/esm/WorkOrder/components/PayListOrderItem/index.js +43 -179
- package/dist/esm/WorkOrder/components/RecordLog/index.js +3 -1
- package/dist/esm/WorkOrder/components/TransferOrderModal/index.js +1 -1
- package/dist/esm/WorkOrder/components/UnExamineModal/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/UnExamineModal/index.js +108 -0
- package/dist/esm/WorkOrder/components/Widget/electricity/ETradeId/index.d.ts +0 -4
- package/dist/esm/WorkOrder/components/Widget/electricity/ETradeId/index.js +7 -24
- package/dist/esm/WorkOrder/components/Widget/third/Payment/index.d.ts +2 -4
- package/dist/esm/WorkOrder/components/Widget/third/Payment/index.js +60 -18
- package/dist/esm/WorkOrder/index.d.ts +1 -0
- package/dist/esm/WorkOrder/index.js +52 -74
- package/dist/esm/WorkOrder/index.less +9 -7
- package/dist/esm/WorkOrder/model/global.d.ts +7 -0
- package/dist/esm/WorkOrder/model/global.js +10 -3
- package/dist/esm/WorkOrder/model/servers/api.d.ts +1 -0
- package/dist/esm/WorkOrder/model/servers/api.js +14 -3
- package/dist/esm/WorkOrder/model/servers/request.js +8 -25
- package/dist/esm/WorkOrder/model/workOrder.d.ts +49 -0
- package/dist/esm/WorkOrder/model/workOrder.js +59 -3
- package/package.json +3 -2
- package/dist/esm/WorkOrder/components/Reminder/index.d.ts +0 -5
- package/dist/esm/WorkOrder/components/Reminder/index.js +0 -52
- package/dist/esm/WorkOrder/components/Reminder/index.module.less +0 -25
@@ -60,5 +60,5 @@ export interface WorkOrderDetail {
|
|
60
60
|
}
|
61
61
|
export declare const formatPictures: (pictures: any) => any;
|
62
62
|
export declare const calcWorkOrderList: (source: Partial<WorkOrderDetail>[], templateColumns: TemplateColumnConfig[], type?: string) => any[];
|
63
|
-
export declare const orderBack: ({ order_no, form, shopId, shopList, templateDetail }: any) => Promise<void>;
|
63
|
+
export declare const orderBack: ({ order_no, form, shopId, shopList, templateDetail, type, }: any) => Promise<void>;
|
64
64
|
export declare const imgResize: (url: string, w?: number, h?: number) => string;
|
@@ -1,5 +1,17 @@
|
|
1
1
|
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, $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 generator._invoke = function (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); } }; }(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; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), 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 (object) { var 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
2
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
|
+
|
5
|
+
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."); }
|
6
|
+
|
7
|
+
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); }
|
8
|
+
|
9
|
+
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; }
|
10
|
+
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
12
|
+
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
|
+
|
3
15
|
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
16
|
|
5
17
|
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); }); }; }
|
@@ -14,7 +26,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
14
26
|
|
15
27
|
import { get, isEmpty, find, keys, every } from 'lodash';
|
16
28
|
import V from 'voca';
|
17
|
-
import { orderDetail } from "../../model/servers/api";
|
29
|
+
import { orderDetail, getThirdOpenUidByOrderNo } from "../../model/servers/api";
|
18
30
|
import moment from 'moment';
|
19
31
|
import express from "./express";
|
20
32
|
import cache from "../cache";
|
@@ -619,39 +631,47 @@ export var orderBack = /*#__PURE__*/function () {
|
|
619
631
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
620
632
|
var _shopList$find;
|
621
633
|
|
622
|
-
var order_no, form, shopId, shopList, templateDetail, shopSourceStr, _yield$
|
634
|
+
var order_no, form, shopId, shopList, templateDetail, _ref$type, type, shopSourceStr, _shopList$find2, _data$value, _buyer$value, taobaoId, promise, _yield$Promise$allSet, _yield$Promise$allSet2, data, buyer, orderInfo, buyerInfo, _ref3, orderNo, provinceCode, cityCode, townCode, orderCreateDateTime, orderPaymentDateTime, orderDeliveryDateTime, orderClosingDateTime, itemList, transField, finalResponse, formValue, detail, componentsParams, detailsValue, _templateDetail$compo, paymentUniqueKey;
|
623
635
|
|
624
636
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
625
637
|
while (1) {
|
626
638
|
switch (_context.prev = _context.next) {
|
627
639
|
case 0:
|
628
|
-
order_no = _ref.order_no, form = _ref.form, shopId = _ref.shopId, shopList = _ref.shopList, templateDetail = _ref.templateDetail;
|
629
|
-
console.log(order_no, form, shopId, shopList, templateDetail);
|
640
|
+
order_no = _ref.order_no, form = _ref.form, shopId = _ref.shopId, shopList = _ref.shopList, templateDetail = _ref.templateDetail, _ref$type = _ref.type, type = _ref$type === void 0 ? 'add' : _ref$type;
|
630
641
|
shopSourceStr = (_shopList$find = shopList.find(function (item) {
|
631
642
|
return item.shopId == shopId;
|
632
643
|
})) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSourceStr;
|
633
|
-
_context.
|
634
|
-
|
644
|
+
_context.prev = 2;
|
645
|
+
taobaoId = (_shopList$find2 = shopList.find(function (item) {
|
646
|
+
return item.shopSourceStr === 'TAOBAO' && item.shopId == shopId;
|
647
|
+
})) === null || _shopList$find2 === void 0 ? void 0 : _shopList$find2.taobaoId;
|
648
|
+
promise = [orderDetail({
|
635
649
|
shopId: shopId,
|
636
650
|
//店铺id
|
637
651
|
orderNo: order_no //订单id
|
638
652
|
|
639
|
-
});
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
653
|
+
})];
|
654
|
+
taobaoId ? promise.push(getThirdOpenUidByOrderNo({
|
655
|
+
orderNo: order_no,
|
656
|
+
toAppKey: '21819818',
|
657
|
+
platform: 'tb',
|
658
|
+
taobaoId: taobaoId
|
659
|
+
})) : promise.push(new Promise(function (resolve) {
|
660
|
+
resolve({});
|
661
|
+
}));
|
662
|
+
_context.next = 8;
|
663
|
+
return Promise.allSettled(promise);
|
664
|
+
|
665
|
+
case 8:
|
666
|
+
_yield$Promise$allSet = _context.sent;
|
667
|
+
_yield$Promise$allSet2 = _slicedToArray(_yield$Promise$allSet, 2);
|
668
|
+
data = _yield$Promise$allSet2[0];
|
669
|
+
buyer = _yield$Promise$allSet2[1];
|
670
|
+
// console.log(data, buyer);
|
671
|
+
orderInfo = data === null || data === void 0 ? void 0 : (_data$value = data.value) === null || _data$value === void 0 ? void 0 : _data$value.data;
|
672
|
+
buyerInfo = buyer === null || buyer === void 0 ? void 0 : (_buyer$value = buyer.value) === null || _buyer$value === void 0 ? void 0 : _buyer$value.data;
|
673
|
+
_ref3 = orderInfo || {}, orderNo = _ref3.orderNo, provinceCode = _ref3.provinceCode, cityCode = _ref3.cityCode, townCode = _ref3.townCode, orderCreateDateTime = _ref3.orderCreateDateTime, orderPaymentDateTime = _ref3.orderPaymentDateTime, orderDeliveryDateTime = _ref3.orderDeliveryDateTime, orderClosingDateTime = _ref3.orderClosingDateTime, itemList = _ref3.itemList;
|
674
|
+
transField = orderInfo ? {
|
655
675
|
tradeId: orderNo,
|
656
676
|
province: provinceCode,
|
657
677
|
city: cityCode,
|
@@ -662,8 +682,20 @@ export var orderBack = /*#__PURE__*/function () {
|
|
662
682
|
tradeClosingDateTime: orderClosingDateTime,
|
663
683
|
goodId: itemList,
|
664
684
|
goodSerial: itemList
|
665
|
-
};
|
666
|
-
finalResponse =
|
685
|
+
} : {};
|
686
|
+
finalResponse = {};
|
687
|
+
|
688
|
+
if (orderInfo) {
|
689
|
+
finalResponse = _objectSpread(_objectSpread({}, orderInfo || {}), transField);
|
690
|
+
}
|
691
|
+
|
692
|
+
if (buyerInfo) {
|
693
|
+
finalResponse = _objectSpread(_objectSpread({}, finalResponse), {}, {
|
694
|
+
buyer: buyerInfo || {},
|
695
|
+
payBuyer: buyerInfo || {}
|
696
|
+
});
|
697
|
+
} //获取当前表单字段
|
698
|
+
|
667
699
|
|
668
700
|
formValue = form.getFieldsValue();
|
669
701
|
detail = finalResponse || {}; //抖音数据
|
@@ -675,6 +707,8 @@ export var orderBack = /*#__PURE__*/function () {
|
|
675
707
|
componentsParams = getComponentsValue((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []); //获取详情映射表单字段
|
676
708
|
|
677
709
|
detailsValue = Object.keys(componentsParams).reduce(function (prv, next) {
|
710
|
+
var _detail$buyer, _detail$buyer2;
|
711
|
+
|
678
712
|
var key = componentsParams[next].key;
|
679
713
|
var uniqueKey = componentsParams[next].uniqueKey;
|
680
714
|
|
@@ -721,6 +755,18 @@ export var orderBack = /*#__PURE__*/function () {
|
|
721
755
|
prv[uniqueKey] = detail['itemList'];
|
722
756
|
break;
|
723
757
|
|
758
|
+
case 'payBuyer':
|
759
|
+
if (type === 'edit') break;
|
760
|
+
prv[uniqueKey] = {
|
761
|
+
enterprisePaymentTid: '',
|
762
|
+
enterprisePaymentRefundFee: '',
|
763
|
+
enterprisePaymentBuyerNick: (_detail$buyer = detail['buyer']) === null || _detail$buyer === void 0 ? void 0 : _detail$buyer.buyerNick,
|
764
|
+
enterprisePaymentBuyerOpenUid: (_detail$buyer2 = detail['buyer']) === null || _detail$buyer2 === void 0 ? void 0 : _detail$buyer2.buyerOpenUid,
|
765
|
+
enterprisePaymentAlipayNick: '',
|
766
|
+
enterprisePaymentAlipayNo: ''
|
767
|
+
};
|
768
|
+
break;
|
769
|
+
|
724
770
|
default:
|
725
771
|
prv["".concat(uniqueKey)] = detail[key];
|
726
772
|
break;
|
@@ -728,16 +774,35 @@ export var orderBack = /*#__PURE__*/function () {
|
|
728
774
|
}
|
729
775
|
|
730
776
|
return prv;
|
731
|
-
}, {});
|
777
|
+
}, {}); //打款组件
|
778
|
+
|
779
|
+
if (type !== 'edit') {
|
780
|
+
paymentUniqueKey = templateDetail === null || templateDetail === void 0 ? void 0 : (_templateDetail$compo = templateDetail.componentDtoList.find(function (item) {
|
781
|
+
return item.workOrderComponentType === 'ENTERPRISE_PAYMENT';
|
782
|
+
})) === null || _templateDetail$compo === void 0 ? void 0 : _templateDetail$compo.uniqueKey;
|
783
|
+
|
784
|
+
if (paymentUniqueKey && orderInfo) {
|
785
|
+
detailsValue[paymentUniqueKey] = _objectSpread(_objectSpread(_objectSpread({}, formValue[paymentUniqueKey]), detailsValue[paymentUniqueKey]), {}, {
|
786
|
+
enterprisePaymentTid: order_no
|
787
|
+
});
|
788
|
+
}
|
789
|
+
}
|
732
790
|
|
791
|
+
console.log('detailsValue++', formValue, detailsValue);
|
733
792
|
form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), detailsValue));
|
793
|
+
_context.next = 31;
|
794
|
+
break;
|
795
|
+
|
796
|
+
case 29:
|
797
|
+
_context.prev = 29;
|
798
|
+
_context.t0 = _context["catch"](2);
|
734
799
|
|
735
|
-
case
|
800
|
+
case 31:
|
736
801
|
case "end":
|
737
802
|
return _context.stop();
|
738
803
|
}
|
739
804
|
}
|
740
|
-
}, _callee);
|
805
|
+
}, _callee, null, [[2, 29]]);
|
741
806
|
}));
|
742
807
|
|
743
808
|
return function orderBack(_x) {
|
@@ -34,7 +34,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
34
34
|
|
35
35
|
import React, { useState, useImperativeHandle, forwardRef, useMemo, useCallback } from 'react';
|
36
36
|
import { Drawer, Form, Spin, ConfigProvider, Button, message, Space } from 'antd';
|
37
|
-
import {
|
37
|
+
import { LeftOutlined } from '@ant-design/icons';
|
38
|
+
import { get, find, some, set } from 'lodash';
|
38
39
|
import zhCN from 'antd/es/locale/zh_CN';
|
39
40
|
import moment from 'moment';
|
40
41
|
import 'moment/locale/zh-cn';
|
@@ -293,7 +294,7 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
|
|
293
294
|
|
294
295
|
var queryDetail = /*#__PURE__*/function () {
|
295
296
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
296
|
-
var templateId, workOrderId, shopId, shopList, record, orderNo, buyerId, buyerNick, _workOrderDetail2, _workOrderDetail2$dat, _workOrderDetail2$dat2, _workOrderDetail, _templateDetail, _workOrderDetail3, _templateDetail$data, transData, _templateDetail$data2, _templateDetail$data3, jsonMap, _transData;
|
297
|
+
var templateId, workOrderId, shopId, shopList, record, orderNo, buyerId, buyerNick, _workOrderDetail2, _workOrderDetail2$dat, _workOrderDetail2$dat2, _workOrderDetail, _templateDetail, _workOrderDetail3, _templateDetail$data, transData, _templateDetail$data2, _templateDetail$data3, jsonMap, _transData, antFormEl;
|
297
298
|
|
298
299
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
299
300
|
while (1) {
|
@@ -350,6 +351,7 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
|
|
350
351
|
}
|
351
352
|
|
352
353
|
if (next.workOrderComponentType === 'ENTERPRISE_PAYMENT') {
|
354
|
+
prv["".concat(next.uniqueKey, "_enterprisePaymentTid")] = orderNo || '';
|
353
355
|
prv["".concat(next.uniqueKey, "_enterprisePaymentBuyerOpenUid")] = buyerId;
|
354
356
|
prv["".concat(next.uniqueKey, "_enterprisePaymentBuyerNick")] = buyerNick;
|
355
357
|
}
|
@@ -373,26 +375,27 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
|
|
373
375
|
});
|
374
376
|
}
|
375
377
|
|
376
|
-
document.getElementsByClassName('ant-form')
|
377
|
-
|
378
|
+
antFormEl = document.getElementsByClassName('ant-form');
|
379
|
+
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
380
|
+
_context2.next = 23;
|
378
381
|
break;
|
379
382
|
|
380
|
-
case
|
381
|
-
_context2.prev =
|
383
|
+
case 20:
|
384
|
+
_context2.prev = 20;
|
382
385
|
_context2.t0 = _context2["catch"](2);
|
383
386
|
console.error('获取模板信息错误', _context2.t0);
|
384
387
|
|
385
|
-
case
|
386
|
-
_context2.prev =
|
388
|
+
case 23:
|
389
|
+
_context2.prev = 23;
|
387
390
|
setLoading(false);
|
388
|
-
return _context2.finish(
|
391
|
+
return _context2.finish(23);
|
389
392
|
|
390
|
-
case
|
393
|
+
case 26:
|
391
394
|
case "end":
|
392
395
|
return _context2.stop();
|
393
396
|
}
|
394
397
|
}
|
395
|
-
}, _callee2, null, [[2,
|
398
|
+
}, _callee2, null, [[2, 20, 23, 26]]);
|
396
399
|
}));
|
397
400
|
|
398
401
|
return function queryDetail(_x3) {
|
@@ -471,6 +474,7 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
|
|
471
474
|
};
|
472
475
|
|
473
476
|
return /*#__PURE__*/_jsx(Drawer, {
|
477
|
+
closeIcon: /*#__PURE__*/_jsx(LeftOutlined, {}),
|
474
478
|
title: (templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.name) || '工单录入',
|
475
479
|
width: width,
|
476
480
|
open: visible,
|
@@ -0,0 +1,110 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
|
3
|
+
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."); }
|
4
|
+
|
5
|
+
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); }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
10
|
+
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
+
|
13
|
+
/*
|
14
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
15
|
+
* @Date: 2022-11-03 16:01:49
|
16
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
17
|
+
* @LastEditTime: 2022-11-03 23:53:26
|
18
|
+
* @FilePath: /kmkf-work-order-service-component/src/WorkOrder/components/DealWorkOrderModal/index.tsx
|
19
|
+
* @Description:
|
20
|
+
*
|
21
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
22
|
+
*/
|
23
|
+
import React, { useCallback } from 'react';
|
24
|
+
import { Modal } from 'antd';
|
25
|
+
import { useAppSelector, useAppDispatch } from "../../model/hooks";
|
26
|
+
import { selectCurrentStatusText, selectDealCustomizeWorkOrderModalVisible, selectCurrentRecord, fetchQueryWorkOrder } from "../../model/workOrder";
|
27
|
+
import { dealWorkOrder } from "../../model/servers/api";
|
28
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
30
|
+
|
31
|
+
var DealWorkOrderModal = function DealWorkOrderModal() {
|
32
|
+
var dispatch = useAppDispatch();
|
33
|
+
var status = useAppSelector(selectCurrentStatusText);
|
34
|
+
var deleteCustomizeWorkOrderModalVisible = useAppSelector(selectDealCustomizeWorkOrderModalVisible);
|
35
|
+
var record = useAppSelector(selectCurrentRecord);
|
36
|
+
|
37
|
+
var handleCancel = function handleCancel() {
|
38
|
+
dispatch({
|
39
|
+
type: 'workOrder/setCurrentCustomizeRecord',
|
40
|
+
payload: {}
|
41
|
+
});
|
42
|
+
dispatch({
|
43
|
+
type: 'workOrder/setDealCustomizeWorkOrderModalVisible',
|
44
|
+
payload: false
|
45
|
+
});
|
46
|
+
dispatch({
|
47
|
+
type: 'workOrder/setCurrentStatusText',
|
48
|
+
payload: ''
|
49
|
+
});
|
50
|
+
};
|
51
|
+
|
52
|
+
var handleOk = useCallback(function () {
|
53
|
+
var jsonMap = record.jsonMap,
|
54
|
+
templateDetailDto = record.templateDetailDto;
|
55
|
+
var params = {
|
56
|
+
uniqueKey: templateDetailDto.uniqueKey,
|
57
|
+
workOrderUpdateKeyVos: {
|
58
|
+
workOrderId: record.id,
|
59
|
+
workOrderUpdateKeySupVos: []
|
60
|
+
}
|
61
|
+
};
|
62
|
+
|
63
|
+
for (var key in jsonMap) {
|
64
|
+
if (jsonMap.hasOwnProperty(key)) {
|
65
|
+
var _key$split = key.split('_'),
|
66
|
+
_key$split2 = _slicedToArray(_key$split, 2),
|
67
|
+
uniqueKey = _key$split2[0],
|
68
|
+
fieldName = _key$split2[1];
|
69
|
+
|
70
|
+
var oldContent = '';
|
71
|
+
|
72
|
+
if (fieldName && fieldName === 'customerService') {
|
73
|
+
oldContent = jsonMap[key];
|
74
|
+
}
|
75
|
+
|
76
|
+
if (fieldName && fieldName === 'status') {
|
77
|
+
params.workOrderUpdateKeyVos.workOrderUpdateKeySupVos.push({
|
78
|
+
uniqueKey: key,
|
79
|
+
content: '1',
|
80
|
+
oldContent: '0'
|
81
|
+
});
|
82
|
+
params.workOrderUpdateKeyVos.workOrderUpdateKeySupVos.push({
|
83
|
+
uniqueKey: "".concat(uniqueKey, "_customerService"),
|
84
|
+
content: ''
|
85
|
+
});
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
dealWorkOrder(params).then(function (res) {
|
91
|
+
if (res.success) {
|
92
|
+
dispatch(fetchQueryWorkOrder());
|
93
|
+
handleCancel();
|
94
|
+
}
|
95
|
+
});
|
96
|
+
}, [record]);
|
97
|
+
return /*#__PURE__*/_jsx(Modal, {
|
98
|
+
title: "\u5904\u7406\u5DE5\u5355",
|
99
|
+
open: deleteCustomizeWorkOrderModalVisible,
|
100
|
+
okText: "\u786E\u5B9A",
|
101
|
+
cancelText: "\u53D6\u6D88",
|
102
|
+
onOk: handleOk,
|
103
|
+
onCancel: handleCancel,
|
104
|
+
children: /*#__PURE__*/_jsxs("div", {
|
105
|
+
children: ["\u786E\u8BA4\u5C06\u8BE5\u6761\u5DE5\u5355\u7684\u72B6\u6001\u66F4\u6539\u4E3A\u3010\u5DF2", status, "\u3011\u72B6\u6001\u5417\uFF1F"]
|
106
|
+
})
|
107
|
+
});
|
108
|
+
};
|
109
|
+
|
110
|
+
export default DealWorkOrderModal;
|
@@ -0,0 +1,109 @@
|
|
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
|
+
|
3
|
+
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, $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 generator._invoke = function (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); } }; }(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; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), 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 (object) { var 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; }
|
4
|
+
|
5
|
+
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; }
|
6
|
+
|
7
|
+
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
|
+
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
10
|
+
|
11
|
+
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); } }
|
12
|
+
|
13
|
+
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); }); }; }
|
14
|
+
|
15
|
+
/*
|
16
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
17
|
+
* @Date: 2022-11-03 16:01:49
|
18
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
19
|
+
* @LastEditTime: 2022-11-04 09:48:00
|
20
|
+
* @FilePath: /kmkf-work-order-service-component/src/WorkOrder/components/DeleteCustomizeOrderModal/index.tsx
|
21
|
+
* @Description:
|
22
|
+
*
|
23
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
24
|
+
*/
|
25
|
+
import React, { useCallback } from 'react';
|
26
|
+
import { Modal } from 'antd';
|
27
|
+
import { useAppSelector, useAppDispatch } from "../../model/hooks";
|
28
|
+
import { selectDeleteCustomizeWorkOrderModalVisible, selectCurrentRecord, fetchDeleteWorkOrder } from "../../model/workOrder";
|
29
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
30
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
31
|
+
|
32
|
+
var DeleteCustomizeOrderModal = function DeleteCustomizeOrderModal() {
|
33
|
+
var dispatch = useAppDispatch();
|
34
|
+
var customSearch = useAppSelector(function (state) {
|
35
|
+
return state.workOrder.customSearch;
|
36
|
+
});
|
37
|
+
var deleteCustomizeWorkOrderModalVisible = useAppSelector(selectDeleteCustomizeWorkOrderModalVisible);
|
38
|
+
var record = useAppSelector(selectCurrentRecord);
|
39
|
+
|
40
|
+
var handleCancel = function handleCancel() {
|
41
|
+
dispatch({
|
42
|
+
type: 'workOrder/setDeleteCustomizeWorkOrderModalVisible',
|
43
|
+
payload: false
|
44
|
+
});
|
45
|
+
dispatch({
|
46
|
+
type: 'workOrder/setCurrentCustomizeRecord',
|
47
|
+
payload: {}
|
48
|
+
});
|
49
|
+
};
|
50
|
+
|
51
|
+
var onDelete = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
52
|
+
var _record$templateDetai;
|
53
|
+
|
54
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
55
|
+
while (1) {
|
56
|
+
switch (_context.prev = _context.next) {
|
57
|
+
case 0:
|
58
|
+
_context.prev = 0;
|
59
|
+
_context.next = 3;
|
60
|
+
return dispatch(fetchDeleteWorkOrder({
|
61
|
+
uniqueKey: record === null || record === void 0 ? void 0 : (_record$templateDetai = record.templateDetailDto) === null || _record$templateDetai === void 0 ? void 0 : _record$templateDetai.uniqueKey,
|
62
|
+
workOrderId: record === null || record === void 0 ? void 0 : record.id
|
63
|
+
})).unwrap();
|
64
|
+
|
65
|
+
case 3:
|
66
|
+
_context.next = 5;
|
67
|
+
return dispatch({
|
68
|
+
type: 'workOrder/setState',
|
69
|
+
payload: {
|
70
|
+
customSearch: _objectSpread(_objectSpread({}, customSearch), {}, {
|
71
|
+
pageNo: 1
|
72
|
+
})
|
73
|
+
}
|
74
|
+
});
|
75
|
+
|
76
|
+
case 5:
|
77
|
+
handleCancel();
|
78
|
+
_context.next = 11;
|
79
|
+
break;
|
80
|
+
|
81
|
+
case 8:
|
82
|
+
_context.prev = 8;
|
83
|
+
_context.t0 = _context["catch"](0);
|
84
|
+
console.log('e', _context.t0);
|
85
|
+
|
86
|
+
case 11:
|
87
|
+
case "end":
|
88
|
+
return _context.stop();
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}, _callee, null, [[0, 8]]);
|
92
|
+
})), [record]);
|
93
|
+
return /*#__PURE__*/_jsx(Modal, {
|
94
|
+
title: "\u5220\u9664\u5DE5\u5355",
|
95
|
+
open: deleteCustomizeWorkOrderModalVisible,
|
96
|
+
okText: "\u786E\u5B9A",
|
97
|
+
cancelText: "\u53D6\u6D88",
|
98
|
+
onOk: onDelete,
|
99
|
+
onCancel: handleCancel,
|
100
|
+
children: /*#__PURE__*/_jsxs("div", {
|
101
|
+
children: [/*#__PURE__*/_jsx("span", {
|
102
|
+
className: "red",
|
103
|
+
children: "\u5220\u9664\u540E\u7684\u5DE5\u5355\u65E0\u6CD5\u6062\u590D"
|
104
|
+
}), "\uFF0C \u786E\u8BA4\u8981\u5220\u9664\u8BE5\u6761\u6570\u636E\u5417\uFF1F"]
|
105
|
+
})
|
106
|
+
});
|
107
|
+
};
|
108
|
+
|
109
|
+
export default DeleteCustomizeOrderModal;
|