@kmkf-fe-packages/kmkf-work-order-service-component 2.10.21 → 2.10.23
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.
|
@@ -42,7 +42,9 @@ var CustomerServiceToDoList = function CustomerServiceToDoList(props) {
|
|
|
42
42
|
onlyCount: false,
|
|
43
43
|
onlyStartNode: true,
|
|
44
44
|
flowTags: ['AI_BUILD'],
|
|
45
|
-
shopUniqueKeyList: [shopUniqueKey]
|
|
45
|
+
shopUniqueKeyList: [shopUniqueKey],
|
|
46
|
+
startCreatedTime: moment().subtract(3, 'month').format('YYYY-MM-DD 00:00:00'),
|
|
47
|
+
endCreatedTime: moment().format('YYYY-MM-DD 23:59:59')
|
|
46
48
|
});
|
|
47
49
|
}, {
|
|
48
50
|
target: containerRef,
|
|
@@ -14,7 +14,11 @@ import { useEffect, useState } from 'react';
|
|
|
14
14
|
import { useAppDispatch, useAppSelector } from "../../../model/hooks";
|
|
15
15
|
import notificationIcon from "../../../common/imgs/notification.png";
|
|
16
16
|
import { nodeWorkOrderPending } from "../../../model/servers/api";
|
|
17
|
+
import moment from 'moment';
|
|
17
18
|
import styles from "./index.module.less";
|
|
19
|
+
var CACHE_KEY = 'customer_service_todo_count_cache';
|
|
20
|
+
var CACHE_DURATION = 10 * 60 * 1000; // 10分钟
|
|
21
|
+
|
|
18
22
|
var CustomerServiceToDoCard = function CustomerServiceToDoCard(props) {
|
|
19
23
|
var shopUniqueKey = props.shopUniqueKey;
|
|
20
24
|
var dispatch = useAppDispatch();
|
|
@@ -28,25 +32,56 @@ var CustomerServiceToDoCard = function CustomerServiceToDoCard(props) {
|
|
|
28
32
|
});
|
|
29
33
|
var initHandle = /*#__PURE__*/function () {
|
|
30
34
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
31
|
-
var _yield$nodeWorkOrderP, data;
|
|
35
|
+
var cached, _JSON$parse, value, timestamp, _yield$nodeWorkOrderP, data, total;
|
|
32
36
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
33
37
|
while (1) switch (_context.prev = _context.next) {
|
|
34
38
|
case 0:
|
|
35
|
-
|
|
39
|
+
// 尝试读取浏览器缓存
|
|
40
|
+
cached = localStorage.getItem(CACHE_KEY);
|
|
41
|
+
if (!cached) {
|
|
42
|
+
_context.next = 11;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
_context.prev = 2;
|
|
46
|
+
_JSON$parse = JSON.parse(cached), value = _JSON$parse.value, timestamp = _JSON$parse.timestamp;
|
|
47
|
+
if (!(Date.now() - timestamp < CACHE_DURATION)) {
|
|
48
|
+
_context.next = 7;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
// 缓存未过期,直接使用
|
|
52
|
+
setNumber(value || 0);
|
|
53
|
+
return _context.abrupt("return");
|
|
54
|
+
case 7:
|
|
55
|
+
_context.next = 11;
|
|
56
|
+
break;
|
|
57
|
+
case 9:
|
|
58
|
+
_context.prev = 9;
|
|
59
|
+
_context.t0 = _context["catch"](2);
|
|
60
|
+
case 11:
|
|
61
|
+
_context.next = 13;
|
|
36
62
|
return nodeWorkOrderPending({
|
|
37
63
|
flowTags: ['AI_BUILD'],
|
|
38
64
|
onlyCount: true,
|
|
39
|
-
shopUniqueKeyList: [shopUniqueKey]
|
|
65
|
+
shopUniqueKeyList: [shopUniqueKey],
|
|
66
|
+
startCreatedTime: moment().subtract(3, 'month').format('YYYY-MM-DD 00:00:00'),
|
|
67
|
+
endCreatedTime: moment().format('YYYY-MM-DD 23:59:59')
|
|
40
68
|
});
|
|
41
|
-
case
|
|
69
|
+
case 13:
|
|
42
70
|
_yield$nodeWorkOrderP = _context.sent;
|
|
43
71
|
data = _yield$nodeWorkOrderP.data;
|
|
44
|
-
|
|
45
|
-
|
|
72
|
+
total = (data === null || data === void 0 ? void 0 : data.total) || 0;
|
|
73
|
+
setNumber(total);
|
|
74
|
+
|
|
75
|
+
// 写入浏览器缓存(数量为0时也缓存)
|
|
76
|
+
localStorage.setItem(CACHE_KEY, JSON.stringify({
|
|
77
|
+
value: total,
|
|
78
|
+
timestamp: Date.now()
|
|
79
|
+
}));
|
|
80
|
+
case 18:
|
|
46
81
|
case "end":
|
|
47
82
|
return _context.stop();
|
|
48
83
|
}
|
|
49
|
-
}, _callee);
|
|
84
|
+
}, _callee, null, [[2, 9]]);
|
|
50
85
|
}));
|
|
51
86
|
return function initHandle() {
|
|
52
87
|
return _ref.apply(this, arguments);
|
|
@@ -2,17 +2,17 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
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
|
+
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; }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
10
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
11
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
12
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
13
|
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; }
|
|
9
14
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
16
|
import React, { useEffect, useCallback, useState, useRef, useMemo } from 'react';
|
|
17
17
|
import { Form, Row, Col, DatePicker, Input, Select, Cascader, Checkbox, message, Button, Drawer, Spin, Tabs, Empty } from 'antd';
|
|
18
18
|
import { LeftOutlined } from '@ant-design/icons';
|
|
@@ -32,6 +32,23 @@ import { queryAllWorkOrderList, queryTemplateDetail, queryNodesByFlowTemplateKey
|
|
|
32
32
|
import FlowTemplateDetail from "../../../FlowTemplateDetailV2";
|
|
33
33
|
import "./index.less";
|
|
34
34
|
var RangePicker = DatePicker.RangePicker;
|
|
35
|
+
var MAX_TIME_RANGE_MONTHS = 3;
|
|
36
|
+
var isTimeRangeOverLimit = function isTimeRangeOverLimit(time) {
|
|
37
|
+
if (!(time !== null && time !== void 0 && time[0]) || !(time !== null && time !== void 0 && time[1])) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
var _ref = time[0].isBefore(time[1]) ? time : [time[1], time[0]],
|
|
41
|
+
_ref2 = _slicedToArray(_ref, 2),
|
|
42
|
+
start = _ref2[0],
|
|
43
|
+
end = _ref2[1];
|
|
44
|
+
return end.isAfter(start.clone().add(MAX_TIME_RANGE_MONTHS, 'months'), 'day');
|
|
45
|
+
};
|
|
46
|
+
var isDateOutsideRangeLimit = function isDateOutsideRangeLimit(current, anchor) {
|
|
47
|
+
var months = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MAX_TIME_RANGE_MONTHS;
|
|
48
|
+
var minDate = anchor.clone().subtract(months, 'months').startOf('day');
|
|
49
|
+
var maxDate = anchor.clone().add(months, 'months').endOf('day');
|
|
50
|
+
return current.isBefore(minDate, 'day') || current.isAfter(maxDate, 'day');
|
|
51
|
+
};
|
|
35
52
|
var workOrderStatus = [{
|
|
36
53
|
label: '处理中',
|
|
37
54
|
value: 'PROCESSING'
|
|
@@ -51,16 +68,16 @@ var workOrderStatus = [{
|
|
|
51
68
|
label: '回退中',
|
|
52
69
|
value: 'RETURNING'
|
|
53
70
|
}];
|
|
54
|
-
var getTableData = function getTableData(
|
|
55
|
-
var checkedBuyerId =
|
|
56
|
-
buyerId =
|
|
57
|
-
shopList =
|
|
58
|
-
shopId =
|
|
59
|
-
return function (
|
|
60
|
-
var
|
|
61
|
-
var pageNo =
|
|
62
|
-
pageSize =
|
|
63
|
-
onlyWaitForMe =
|
|
71
|
+
var getTableData = function getTableData(_ref3) {
|
|
72
|
+
var checkedBuyerId = _ref3.checkedBuyerId,
|
|
73
|
+
buyerId = _ref3.buyerId,
|
|
74
|
+
shopList = _ref3.shopList,
|
|
75
|
+
shopId = _ref3.shopId;
|
|
76
|
+
return function (_ref4, formData) {
|
|
77
|
+
var _ref5, _ref5$find, _formData$flowTemplat;
|
|
78
|
+
var pageNo = _ref4.pageNo,
|
|
79
|
+
pageSize = _ref4.pageSize,
|
|
80
|
+
onlyWaitForMe = _ref4.onlyWaitForMe;
|
|
64
81
|
//判断店铺列表是否存在 端上必须要有店铺 需要过滤
|
|
65
82
|
if (!shopList || !shopList.length) {
|
|
66
83
|
return Promise.resolve();
|
|
@@ -75,9 +92,9 @@ var getTableData = function getTableData(_ref) {
|
|
|
75
92
|
params.buyerOpenUid = buyerId;
|
|
76
93
|
}
|
|
77
94
|
delete params.time; // time是moment类型的,监控上报的时侯,格式化报错了
|
|
78
|
-
var shopUniqueKey = (
|
|
95
|
+
var shopUniqueKey = (_ref5 = shopList || []) === null || _ref5 === void 0 ? void 0 : (_ref5$find = _ref5.find(function (item) {
|
|
79
96
|
return item.shopId === shopId;
|
|
80
|
-
})) === null ||
|
|
97
|
+
})) === null || _ref5$find === void 0 ? void 0 : _ref5$find.uniqueKey;
|
|
81
98
|
if (shopUniqueKey) {
|
|
82
99
|
params.shopUniqueKey = shopUniqueKey;
|
|
83
100
|
}
|
|
@@ -132,11 +149,11 @@ var FlowOrderList = function FlowOrderList(props) {
|
|
|
132
149
|
}, "\u6CA1\u6709\u66F4\u591A\u6570\u636E\u4E86") : null));
|
|
133
150
|
};
|
|
134
151
|
//工单列表
|
|
135
|
-
var CustomizeWorkOrderList = function CustomizeWorkOrderList(
|
|
152
|
+
var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref6) {
|
|
136
153
|
var _nodesData$data, _nodesData$data$workO;
|
|
137
|
-
var tabActive =
|
|
138
|
-
onOpenWangWang =
|
|
139
|
-
otherInfo =
|
|
154
|
+
var tabActive = _ref6.tabActive,
|
|
155
|
+
onOpenWangWang = _ref6.onOpenWangWang,
|
|
156
|
+
otherInfo = _ref6.otherInfo;
|
|
140
157
|
var dispatch = useAppDispatch();
|
|
141
158
|
var _useState = useState(false),
|
|
142
159
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -166,6 +183,13 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
166
183
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
167
184
|
searchHeight = _useState14[0],
|
|
168
185
|
setSearchHeight = _useState14[1];
|
|
186
|
+
var defaultTimeRange = useMemo(function () {
|
|
187
|
+
return [moment().subtract(30, 'day'), moment()];
|
|
188
|
+
}, []);
|
|
189
|
+
var _useState15 = useState(null),
|
|
190
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
191
|
+
selectedTimeRange = _useState16[0],
|
|
192
|
+
setSelectedTimeRange = _useState16[1];
|
|
169
193
|
var allLogicFlowList = useSelector(selectFlowList);
|
|
170
194
|
var flowTemplateGroupWorkOrderTemplateList = useSelector(selectFlowTemplateGroupWorkOrderTemplateList);
|
|
171
195
|
var shopList = useAppSelector(function (state) {
|
|
@@ -372,7 +396,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
372
396
|
};
|
|
373
397
|
}, []);
|
|
374
398
|
var initHandle = /*#__PURE__*/function () {
|
|
375
|
-
var
|
|
399
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(otherInfo, buyerId, orderNo) {
|
|
376
400
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
377
401
|
while (1) switch (_context.prev = _context.next) {
|
|
378
402
|
case 0:
|
|
@@ -401,13 +425,20 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
401
425
|
}, _callee);
|
|
402
426
|
}));
|
|
403
427
|
return function initHandle(_x2, _x3, _x4) {
|
|
404
|
-
return
|
|
428
|
+
return _ref7.apply(this, arguments);
|
|
405
429
|
};
|
|
406
430
|
}();
|
|
407
431
|
useEffect(function () {
|
|
408
432
|
initHandle(otherInfo, buyerId, orderNo);
|
|
409
433
|
}, [otherInfo, buyerId, orderNo]);
|
|
410
434
|
var searchHandle = function searchHandle() {
|
|
435
|
+
var time = form.getFieldValue('time');
|
|
436
|
+
if (!(time !== null && time !== void 0 && time[0]) || !(time !== null && time !== void 0 && time[1])) {
|
|
437
|
+
return message.warning('请选择时间');
|
|
438
|
+
}
|
|
439
|
+
if (isTimeRangeOverLimit(time)) {
|
|
440
|
+
return message.warning('时间范围不能超过3个月');
|
|
441
|
+
}
|
|
411
442
|
var templateList = form.getFieldValue('templateIdList');
|
|
412
443
|
if (templateList && templateList.length) {
|
|
413
444
|
var tempId = templateList[templateList.length - 1];
|
|
@@ -428,6 +459,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
428
459
|
};
|
|
429
460
|
var resetHandle = function resetHandle() {
|
|
430
461
|
form.resetFields();
|
|
462
|
+
setSelectedTimeRange(null);
|
|
431
463
|
searchList();
|
|
432
464
|
run('');
|
|
433
465
|
};
|
|
@@ -440,7 +472,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
440
472
|
className: "custom_box_search_buyer",
|
|
441
473
|
checked: currentBuyerChecked,
|
|
442
474
|
onChange: /*#__PURE__*/function () {
|
|
443
|
-
var
|
|
475
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
444
476
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
445
477
|
while (1) switch (_context2.prev = _context2.next) {
|
|
446
478
|
case 0:
|
|
@@ -461,7 +493,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
461
493
|
}, _callee2);
|
|
462
494
|
}));
|
|
463
495
|
return function (_x5) {
|
|
464
|
-
return
|
|
496
|
+
return _ref8.apply(this, arguments);
|
|
465
497
|
};
|
|
466
498
|
}()
|
|
467
499
|
}, "\u5F53\u524D\u4E70\u5BB6")), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement("span", {
|
|
@@ -479,7 +511,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
479
511
|
className: "customizeSearch ".concat(open ? 'open' : 'close'),
|
|
480
512
|
initialValues: {
|
|
481
513
|
type: 'ALL',
|
|
482
|
-
time:
|
|
514
|
+
time: defaultTimeRange
|
|
483
515
|
}
|
|
484
516
|
}, /*#__PURE__*/React.createElement(Row, {
|
|
485
517
|
gutter: 24
|
|
@@ -491,7 +523,32 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
491
523
|
style: {
|
|
492
524
|
width: '100%'
|
|
493
525
|
},
|
|
494
|
-
placeholder: ['开始日期', '结束日期']
|
|
526
|
+
placeholder: ['开始日期', '结束日期'],
|
|
527
|
+
onOpenChange: function onOpenChange(open) {
|
|
528
|
+
if (open) {
|
|
529
|
+
form.setFieldsValue({
|
|
530
|
+
time: undefined
|
|
531
|
+
});
|
|
532
|
+
setSelectedTimeRange(null);
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
disabledDate: function disabledDate(current) {
|
|
536
|
+
if (!current) {
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
var _ref9 = selectedTimeRange || [],
|
|
540
|
+
_ref10 = _slicedToArray(_ref9, 2),
|
|
541
|
+
start = _ref10[0],
|
|
542
|
+
end = _ref10[1];
|
|
543
|
+
var anchor = start || end;
|
|
544
|
+
if (!anchor) {
|
|
545
|
+
return false;
|
|
546
|
+
}
|
|
547
|
+
return isDateOutsideRangeLimit(current, anchor);
|
|
548
|
+
},
|
|
549
|
+
onCalendarChange: function onCalendarChange(values) {
|
|
550
|
+
setSelectedTimeRange(values);
|
|
551
|
+
}
|
|
495
552
|
}))), /*#__PURE__*/React.createElement(Col, {
|
|
496
553
|
span: 12
|
|
497
554
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -578,13 +635,13 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref4) {
|
|
|
578
635
|
dispatch(setFormModalVisible(false));
|
|
579
636
|
queryPanelInfoHandle(record);
|
|
580
637
|
};
|
|
581
|
-
var handleCreateWorkOrderByFlowId = function handleCreateWorkOrderByFlowId(
|
|
638
|
+
var handleCreateWorkOrderByFlowId = function handleCreateWorkOrderByFlowId(_ref11) {
|
|
582
639
|
var _allLogicFlowList$fin;
|
|
583
|
-
var logicFlowId =
|
|
584
|
-
name =
|
|
585
|
-
var
|
|
586
|
-
generalSingle =
|
|
587
|
-
generalMulti =
|
|
640
|
+
var logicFlowId = _ref11.id,
|
|
641
|
+
name = _ref11.name;
|
|
642
|
+
var _ref12 = featureConfig || {},
|
|
643
|
+
generalSingle = _ref12.generalSingle,
|
|
644
|
+
generalMulti = _ref12.generalMulti;
|
|
588
645
|
var templateType = ((_allLogicFlowList$fin = allLogicFlowList.find(function (item) {
|
|
589
646
|
return item.key === logicFlowId;
|
|
590
647
|
})) === null || _allLogicFlowList$fin === void 0 ? void 0 : _allLogicFlowList$fin.type) || '';
|
|
@@ -12,7 +12,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
12
12
|
* @LastEditTime: 2025-09-03 16:43:05
|
|
13
13
|
*/
|
|
14
14
|
import request from "./request";
|
|
15
|
-
import { tradeStatusMap } from '@kmkf-fe-packages/kmkf-utils';
|
|
15
|
+
import { tradeStatusMap, warehouseTypeMap } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
16
|
|
|
17
17
|
//获取灰度白名
|
|
18
18
|
export var grayWhiteList = function grayWhiteList() {
|
|
@@ -433,9 +433,10 @@ export var wdtOrderDetail = function wdtOrderDetail(data) {
|
|
|
433
433
|
var _res$data, _res$data$trades;
|
|
434
434
|
if (res !== null && res !== void 0 && (_res$data = res.data) !== null && _res$data !== void 0 && (_res$data$trades = _res$data.trades) !== null && _res$data$trades !== void 0 && _res$data$trades.length) {
|
|
435
435
|
res.data.trades = res.data.trades.map(function (item) {
|
|
436
|
-
var _tradeStatusMap$res$d;
|
|
436
|
+
var _tradeStatusMap$res$d, _warehouseTypeMap$res;
|
|
437
437
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
438
|
-
tradeStatusValue: tradeStatusMap === null || tradeStatusMap === void 0 ? void 0 : (_tradeStatusMap$res$d = tradeStatusMap[res.data.version]) === null || _tradeStatusMap$res$d === void 0 ? void 0 : _tradeStatusMap$res$d[item.tradeStatus]
|
|
438
|
+
tradeStatusValue: tradeStatusMap === null || tradeStatusMap === void 0 ? void 0 : (_tradeStatusMap$res$d = tradeStatusMap[res.data.version]) === null || _tradeStatusMap$res$d === void 0 ? void 0 : _tradeStatusMap$res$d[item.tradeStatus],
|
|
439
|
+
warehouseType: warehouseTypeMap === null || warehouseTypeMap === void 0 ? void 0 : (_warehouseTypeMap$res = warehouseTypeMap[res.data.version]) === null || _warehouseTypeMap$res === void 0 ? void 0 : _warehouseTypeMap$res[item.warehouseType]
|
|
439
440
|
});
|
|
440
441
|
});
|
|
441
442
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-work-order-service-component",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.23",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/icons": "^4.7.0",
|
|
35
|
-
"@kmkf-fe-packages/basic-components": "2.10.
|
|
36
|
-
"@kmkf-fe-packages/kmkf-utils": "2.10.
|
|
37
|
-
"@kmkf-fe-packages/services-components": "2.10.
|
|
35
|
+
"@kmkf-fe-packages/basic-components": "2.10.23",
|
|
36
|
+
"@kmkf-fe-packages/kmkf-utils": "2.10.23",
|
|
37
|
+
"@kmkf-fe-packages/services-components": "2.10.23",
|
|
38
38
|
"@reduxjs/toolkit": "^1.8.5",
|
|
39
39
|
"ahooks": "^3.7.4",
|
|
40
40
|
"copy-to-clipboard": "^3.3.3",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"publishConfig": {
|
|
76
76
|
"access": "public"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "bd441601bb0f5b93d8b1500c0a066c3d7e797c45",
|
|
79
79
|
"gitHooks": {
|
|
80
80
|
"pre-commit": "lint-staged"
|
|
81
81
|
}
|