kmkf-work-order-service-component 0.1.11 → 0.1.12-alpha.1
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/components/CustomizeFormModal/index.js +12 -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/RecordModal.js +1 -1
- package/dist/esm/WorkOrder/components/PayListOrderItem/index.js +43 -179
- 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/index.js +35 -72
- 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/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 +2 -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
@@ -34,7 +34,7 @@ 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 { get, find, some } from 'lodash';
|
37
|
+
import { get, find, some, set } from 'lodash';
|
38
38
|
import zhCN from 'antd/es/locale/zh_CN';
|
39
39
|
import moment from 'moment';
|
40
40
|
import 'moment/locale/zh-cn';
|
@@ -293,7 +293,7 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
|
|
293
293
|
|
294
294
|
var queryDetail = /*#__PURE__*/function () {
|
295
295
|
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;
|
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, antFormEl;
|
297
297
|
|
298
298
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
299
299
|
while (1) {
|
@@ -373,26 +373,27 @@ var CustomizeFormModal = function CustomizeFormModal(props, ref) {
|
|
373
373
|
});
|
374
374
|
}
|
375
375
|
|
376
|
-
document.getElementsByClassName('ant-form')
|
377
|
-
|
376
|
+
antFormEl = document.getElementsByClassName('ant-form');
|
377
|
+
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
378
|
+
_context2.next = 23;
|
378
379
|
break;
|
379
380
|
|
380
|
-
case
|
381
|
-
_context2.prev =
|
381
|
+
case 20:
|
382
|
+
_context2.prev = 20;
|
382
383
|
_context2.t0 = _context2["catch"](2);
|
383
384
|
console.error('获取模板信息错误', _context2.t0);
|
384
385
|
|
385
|
-
case
|
386
|
-
_context2.prev =
|
386
|
+
case 23:
|
387
|
+
_context2.prev = 23;
|
387
388
|
setLoading(false);
|
388
|
-
return _context2.finish(
|
389
|
+
return _context2.finish(23);
|
389
390
|
|
390
|
-
case
|
391
|
+
case 26:
|
391
392
|
case "end":
|
392
393
|
return _context2.stop();
|
393
394
|
}
|
394
395
|
}
|
395
|
-
}, _callee2, null, [[2,
|
396
|
+
}, _callee2, null, [[2, 20, 23, 26]]);
|
396
397
|
}));
|
397
398
|
|
398
399
|
return function queryDetail(_x3) {
|
@@ -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;
|
@@ -0,0 +1,107 @@
|
|
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 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); } }
|
6
|
+
|
7
|
+
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); }); }; }
|
8
|
+
|
9
|
+
/*
|
10
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
11
|
+
* @Date: 2022-11-03 16:01:49
|
12
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
13
|
+
* @LastEditTime: 2022-11-04 09:48:20
|
14
|
+
* @FilePath: /kmkf-work-order-service-component/src/WorkOrder/components/DeletePaymentWorkOrderModal/index.tsx
|
15
|
+
* @Description:
|
16
|
+
*
|
17
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
18
|
+
*/
|
19
|
+
import React, { useCallback } from 'react';
|
20
|
+
import { Modal, message } from 'antd';
|
21
|
+
import { useAppSelector, useAppDispatch } from "../../model/hooks";
|
22
|
+
import { selectDeletePaymentWorkOrderModalVisible, selectCurrentRecord, fetchQueryPaymentWorkOrderList } from "../../model/workOrder";
|
23
|
+
import { deletePaymentOrder } from "../../model/servers/api";
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
26
|
+
|
27
|
+
var DeletePaymentWorkOrderModal = function DeletePaymentWorkOrderModal() {
|
28
|
+
var dispatch = useAppDispatch();
|
29
|
+
var visible = useAppSelector(selectDeletePaymentWorkOrderModalVisible);
|
30
|
+
var record = useAppSelector(selectCurrentRecord);
|
31
|
+
|
32
|
+
var handleCancel = function handleCancel() {
|
33
|
+
dispatch({
|
34
|
+
type: 'workOrder/setCurrentCustomizeRecord',
|
35
|
+
payload: {}
|
36
|
+
});
|
37
|
+
dispatch({
|
38
|
+
type: 'workOrder/setDeletePaymentWorkOrder',
|
39
|
+
payload: false
|
40
|
+
});
|
41
|
+
};
|
42
|
+
|
43
|
+
var fetchDeletePaymentOrder = /*#__PURE__*/function () {
|
44
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
45
|
+
var _yield$deletePaymentO, success;
|
46
|
+
|
47
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
48
|
+
while (1) {
|
49
|
+
switch (_context.prev = _context.next) {
|
50
|
+
case 0:
|
51
|
+
_context.prev = 0;
|
52
|
+
_context.next = 3;
|
53
|
+
return deletePaymentOrder(params);
|
54
|
+
|
55
|
+
case 3:
|
56
|
+
_yield$deletePaymentO = _context.sent;
|
57
|
+
success = _yield$deletePaymentO.success;
|
58
|
+
|
59
|
+
if (success) {
|
60
|
+
message.success('删除成功');
|
61
|
+
dispatch(fetchQueryPaymentWorkOrderList());
|
62
|
+
handleCancel();
|
63
|
+
}
|
64
|
+
|
65
|
+
_context.next = 11;
|
66
|
+
break;
|
67
|
+
|
68
|
+
case 8:
|
69
|
+
_context.prev = 8;
|
70
|
+
_context.t0 = _context["catch"](0);
|
71
|
+
console.error('e', _context.t0);
|
72
|
+
|
73
|
+
case 11:
|
74
|
+
case "end":
|
75
|
+
return _context.stop();
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}, _callee, null, [[0, 8]]);
|
79
|
+
}));
|
80
|
+
|
81
|
+
return function fetchDeletePaymentOrder(_x) {
|
82
|
+
return _ref.apply(this, arguments);
|
83
|
+
};
|
84
|
+
}();
|
85
|
+
|
86
|
+
var handleOk = useCallback(function () {
|
87
|
+
fetchDeletePaymentOrder({
|
88
|
+
ids: [record.id]
|
89
|
+
});
|
90
|
+
}, [record]);
|
91
|
+
return /*#__PURE__*/_jsx(Modal, {
|
92
|
+
title: "\u5220\u9664\u6253\u6B3E\u5DE5\u5355",
|
93
|
+
open: visible,
|
94
|
+
okText: "\u786E\u5B9A",
|
95
|
+
cancelText: "\u53D6\u6D88",
|
96
|
+
onOk: handleOk,
|
97
|
+
onCancel: handleCancel,
|
98
|
+
children: /*#__PURE__*/_jsxs("div", {
|
99
|
+
children: [/*#__PURE__*/_jsx("span", {
|
100
|
+
className: "red",
|
101
|
+
children: "\u5220\u9664\u540E\u7684\u5DE5\u5355\u65E0\u6CD5\u6062\u590D"
|
102
|
+
}), "\uFF0C \u4F60\u8FD8\u8981\u7EE7\u7EED\u5417\uFF1F"]
|
103
|
+
})
|
104
|
+
});
|
105
|
+
};
|
106
|
+
|
107
|
+
export default DeletePaymentWorkOrderModal;
|
@@ -0,0 +1,108 @@
|
|
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 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); } }
|
6
|
+
|
7
|
+
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); }); }; }
|
8
|
+
|
9
|
+
/*
|
10
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
11
|
+
* @Date: 2022-11-03 16:01:49
|
12
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
13
|
+
* @LastEditTime: 2022-11-04 09:48:31
|
14
|
+
* @FilePath: /kmkf-work-order-service-component/src/WorkOrder/components/ExamineModal/index.tsx
|
15
|
+
* @Description:
|
16
|
+
*
|
17
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
18
|
+
*/
|
19
|
+
import React, { useCallback } from 'react';
|
20
|
+
import { Modal, message } from 'antd';
|
21
|
+
import { useAppSelector, useAppDispatch } from "../../model/hooks";
|
22
|
+
import { selectExamineModalVisible, selectCurrentRecord, fetchQueryPaymentWorkOrderList } from "../../model/workOrder";
|
23
|
+
import { examinePaymentOrder } from "../../model/servers/api";
|
24
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
25
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
26
|
+
|
27
|
+
var ExamineModal = function ExamineModal() {
|
28
|
+
var dispatch = useAppDispatch();
|
29
|
+
var deleteCustomizeWorkOrderModalVisible = useAppSelector(selectExamineModalVisible);
|
30
|
+
var record = useAppSelector(selectCurrentRecord);
|
31
|
+
|
32
|
+
var handleCancel = function handleCancel() {
|
33
|
+
dispatch({
|
34
|
+
type: 'workOrder/setCurrentCustomizeRecord',
|
35
|
+
payload: {}
|
36
|
+
});
|
37
|
+
dispatch({
|
38
|
+
type: 'workOrder/setExamineModalVisible',
|
39
|
+
payload: false
|
40
|
+
});
|
41
|
+
};
|
42
|
+
|
43
|
+
var examineRemitOrder = /*#__PURE__*/function () {
|
44
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
45
|
+
var _yield$examinePayment, success;
|
46
|
+
|
47
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
48
|
+
while (1) {
|
49
|
+
switch (_context.prev = _context.next) {
|
50
|
+
case 0:
|
51
|
+
_context.prev = 0;
|
52
|
+
_context.next = 3;
|
53
|
+
return examinePaymentOrder(params);
|
54
|
+
|
55
|
+
case 3:
|
56
|
+
_yield$examinePayment = _context.sent;
|
57
|
+
success = _yield$examinePayment.success;
|
58
|
+
|
59
|
+
if (success) {
|
60
|
+
message.success('操作成功');
|
61
|
+
dispatch(fetchQueryPaymentWorkOrderList());
|
62
|
+
handleCancel();
|
63
|
+
}
|
64
|
+
|
65
|
+
_context.next = 11;
|
66
|
+
break;
|
67
|
+
|
68
|
+
case 8:
|
69
|
+
_context.prev = 8;
|
70
|
+
_context.t0 = _context["catch"](0);
|
71
|
+
console.error('e', _context.t0);
|
72
|
+
|
73
|
+
case 11:
|
74
|
+
case "end":
|
75
|
+
return _context.stop();
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}, _callee, null, [[0, 8]]);
|
79
|
+
}));
|
80
|
+
|
81
|
+
return function examineRemitOrder(_x) {
|
82
|
+
return _ref.apply(this, arguments);
|
83
|
+
};
|
84
|
+
}();
|
85
|
+
|
86
|
+
var handleOk = useCallback(function () {
|
87
|
+
examineRemitOrder({
|
88
|
+
workPayStatus: 'EXAMINED',
|
89
|
+
ids: [record.id]
|
90
|
+
});
|
91
|
+
}, [record]);
|
92
|
+
return /*#__PURE__*/_jsx(Modal, {
|
93
|
+
title: "\u5BA1\u6838\u6253\u6B3E\u5DE5\u5355",
|
94
|
+
open: deleteCustomizeWorkOrderModalVisible,
|
95
|
+
okText: "\u786E\u5B9A",
|
96
|
+
cancelText: "\u53D6\u6D88",
|
97
|
+
onOk: handleOk,
|
98
|
+
onCancel: handleCancel,
|
99
|
+
children: /*#__PURE__*/_jsxs("div", {
|
100
|
+
children: [/*#__PURE__*/_jsx("span", {
|
101
|
+
className: "red",
|
102
|
+
children: "\u5BA1\u6838\u901A\u8FC7\u540E\u7684\u5DE5\u5355\u4E0D\u5141\u8BB8\u4FEE\u6539\u548C\u5220\u9664\u64CD\u4F5C"
|
103
|
+
}), "\uFF0C \u4F60\u8FD8\u8981\u7EE7\u7EED\u5417\uFF1F"]
|
104
|
+
})
|
105
|
+
});
|
106
|
+
};
|
107
|
+
|
108
|
+
export default ExamineModal;
|