@kmkf-fe-packages/kmkf-work-order-service-component 2.10.9-beta.86 → 2.10.9-beta.88
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/KmErpTradeList/api.d.ts +5 -1
- package/dist/esm/KmErpTradeList/api.js +20 -0
- package/dist/esm/KmErpTradeList/components/GoodsModifyDrawer.d.ts +14 -0
- package/dist/esm/KmErpTradeList/components/GoodsModifyDrawer.js +492 -0
- package/dist/esm/KmErpTradeList/components/SystemOrderCard.d.ts +1 -0
- package/dist/esm/KmErpTradeList/components/SystemOrderCard.filter.d.ts +1 -0
- package/dist/esm/KmErpTradeList/components/SystemOrderCard.filter.js +3 -0
- package/dist/esm/KmErpTradeList/components/SystemOrderCard.js +34 -6
- package/dist/esm/KmErpTradeList/components/TradeList.d.ts +1 -0
- package/dist/esm/KmErpTradeList/components/TradeList.js +3 -2
- package/dist/esm/KmErpTradeList/goodsModify.d.ts +19 -0
- package/dist/esm/KmErpTradeList/goodsModify.js +196 -0
- package/dist/esm/KmErpTradeList/index.d.ts +1 -5
- package/dist/esm/KmErpTradeList/index.js +26 -6
- package/dist/esm/KmErpTradeList/index.less +313 -72
- package/dist/esm/KmErpTradeList/interface.d.ts +105 -2
- package/dist/esm/KmErpTradeList/mock.d.ts +35 -0
- package/dist/esm/KmErpTradeList/mock.js +427 -0
- package/dist/esm/WorkOrder/index.js +2 -2
- package/dist/esm/common/utils/submitDataTransOldFormat.js +1 -1
- package/dist/esm/common/utils/transformWorkOrderData.js +3 -2
- package/dist/esm/model/paymentWorkOrder/selector.d.ts +9 -0
- package/dist/esm/model/singleShopWorkOrder/selector.d.ts +5 -0
- package/package.json +4 -4
- package/dist/esm/GlobalContext/hook/dist/useGetHasErpData.js +0 -52
- package/dist/esm/GlobalContext/orderQuery/dist/useGetErpAddressData.js +0 -180
- package/dist/esm/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +0 -186
- package/dist/esm/common/utils/dist/submitDataTransOldFormat.js +0 -899
- package/dist/esm/common/utils/dist/tools.js +0 -1326
- package/dist/esm/common/utils/dist/transformWorkOrderData.js +0 -965
- package/dist/esm/model/customizeWorkOrder/dist/api.js +0 -48
- package/dist/esm/model/customizeWorkOrder/dist/index.js +0 -370
- package/dist/esm/model/customizeWorkOrder/dist/selector.js +0 -63
- package/dist/esm/model/customizeWorkOrder/dist/types.js +0 -3
- package/dist/esm/model/dist/global.js +0 -44
- package/dist/esm/model/dist/hooks.js +0 -15
- package/dist/esm/model/dist/login.js +0 -245
- package/dist/esm/model/dist/store.js +0 -30
- package/dist/esm/model/dist/userData.js +0 -41
- package/dist/esm/model/dist/workOrder.js +0 -329
- package/dist/esm/model/flowTemplateDetail/dist/api.js +0 -192
- package/dist/esm/model/flowTemplateDetail/dist/types.js +0 -48
- package/dist/esm/model/logicFlow/dist/api.js +0 -14
- package/dist/esm/model/logicFlow/dist/index.js +0 -235
- package/dist/esm/model/logicFlow/dist/selector.js +0 -18
- package/dist/esm/model/logicFlow/dist/types.js +0 -3
- package/dist/esm/model/paymentWorkOrder/dist/index.js +0 -77
- package/dist/esm/model/paymentWorkOrder/dist/selector.js +0 -36
- package/dist/esm/model/paymentWorkOrder/dist/types.js +0 -3
- package/dist/esm/model/servers/dist/api.js +0 -545
- package/dist/esm/model/servers/dist/request.js +0 -63
- package/dist/esm/model/singleShopWorkOrder/dist/index.js +0 -216
- package/dist/esm/model/singleShopWorkOrder/dist/selector.js +0 -24
- package/dist/esm/model/singleShopWorkOrder/dist/types.js +0 -3
- package/dist/esm/model/types/dist/login.js +0 -3
- package/dist/esm/model/types/dist/singleWorkOrder.js +0 -3
- package/dist/esm/model/types/dist/workOrder.js +0 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serverProps } from '../model/servers/request';
|
|
2
|
-
import type { QyGdfwOrderKmErpOrderDetailRequest, KmErpOrderDetailData, QyGdfwKmErpErpQueryStockInfoRequest, QyGdfwKmErpErpQueryStockInfoResponse, QyGdfwKmErpErpOrderTraceListRequest, QyGdfwKmErpErpOrderTraceListResponse } from './interface';
|
|
2
|
+
import type { QyGdfwOrderKmErpOrderDetailRequest, KmErpOrderDetailData, QyGdfwKmErpErpQueryStockInfoRequest, QyGdfwKmErpErpQueryStockInfoResponse, QyGdfwKmErpErpOrderTraceListRequest, QyGdfwKmErpErpOrderTraceListResponse, QyGdfwKmErpItemModifyRequest, KmErpItemModifyData, QyGdfwKmErpSellerMemoUploadRequest, KmErpSellerMemoUploadData } from './interface';
|
|
3
3
|
/**
|
|
4
4
|
* 快麦 ERP 订单详情查询
|
|
5
5
|
*/
|
|
@@ -12,3 +12,7 @@ export declare const queryStockInfo: (data: QyGdfwKmErpErpQueryStockInfoRequest)
|
|
|
12
12
|
* 订单日志查询
|
|
13
13
|
*/
|
|
14
14
|
export declare const orderTraceList: (data: QyGdfwKmErpErpOrderTraceListRequest) => Promise<serverProps<QyGdfwKmErpErpOrderTraceListResponse['data']>>;
|
|
15
|
+
/** 修改快麦 ERP 订单商品。后端要求提交修改后的完整商品列表。 */
|
|
16
|
+
export declare const kmErpItemModify: (data: QyGdfwKmErpItemModifyRequest) => Promise<serverProps<KmErpItemModifyData>>;
|
|
17
|
+
/** 追加快麦 ERP 订单卖家备注,只提交本次新增的文本。 */
|
|
18
|
+
export declare const kmErpSellerMemoUpload: (data: QyGdfwKmErpSellerMemoUploadRequest) => Promise<serverProps<KmErpSellerMemoUploadData>>;
|
|
@@ -33,4 +33,24 @@ export var orderTraceList = function orderTraceList(data) {
|
|
|
33
33
|
data: data,
|
|
34
34
|
infoLevel: 'warning'
|
|
35
35
|
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** 修改快麦 ERP 订单商品。后端要求提交修改后的完整商品列表。 */
|
|
39
|
+
export var kmErpItemModify = function kmErpItemModify(data) {
|
|
40
|
+
return request({
|
|
41
|
+
url: '/qy/gdfw/kmErp/erp/modifyTradeItems',
|
|
42
|
+
method: 'post',
|
|
43
|
+
data: data,
|
|
44
|
+
infoLevel: 'warning'
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** 追加快麦 ERP 订单卖家备注,只提交本次新增的文本。 */
|
|
49
|
+
export var kmErpSellerMemoUpload = function kmErpSellerMemoUpload(data) {
|
|
50
|
+
return request({
|
|
51
|
+
url: '/qy/gdfw/kmErp/erp/uploadTradeSellerMemo',
|
|
52
|
+
method: 'post',
|
|
53
|
+
data: data,
|
|
54
|
+
infoLevel: 'warning'
|
|
55
|
+
});
|
|
36
56
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SubOrder } from '../interface';
|
|
3
|
+
import './index.less';
|
|
4
|
+
interface GoodsModifyDrawerProps {
|
|
5
|
+
visible: boolean;
|
|
6
|
+
sid?: string;
|
|
7
|
+
subOrders: SubOrder[];
|
|
8
|
+
sellerMemo?: string;
|
|
9
|
+
accountKey?: string;
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
onSuccess: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare const GoodsModifyDrawer: React.FC<GoodsModifyDrawerProps>;
|
|
14
|
+
export default GoodsModifyDrawer;
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
|
+
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); }
|
|
14
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
|
+
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."); }
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
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; } }
|
|
19
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
21
|
+
import { Button, Card, Checkbox, Drawer, Image, Input, InputNumber, Modal, Popover, Typography, message } from 'antd';
|
|
22
|
+
import { KmGoodsList as ErpGoodsList } from '@kmkf-fe-packages/basic-components';
|
|
23
|
+
import { kmErpItemModify, kmErpSellerMemoUpload } from "../api";
|
|
24
|
+
import { applySelectedGood, buildEditItems, buildOrderRemark, calculatePayment, getGoodsSku, getInvalidEditFieldKeys, loadRemarkFields, MAX_GOODS_REMARK_LENGTH, toModifyOrders, validateEditItems, saveRemarkFields } from "../goodsModify";
|
|
25
|
+
import { fallBackImage } from "../constant";
|
|
26
|
+
import "./index.less";
|
|
27
|
+
var REMARK_FIELD_OPTIONS = ['商品名称', '规格名', '主商家编码', '商家编码', '单价', '数量', '成交金额', '平台实付'];
|
|
28
|
+
var GoodsModifyDrawer = function GoodsModifyDrawer(_ref) {
|
|
29
|
+
var visible = _ref.visible,
|
|
30
|
+
sid = _ref.sid,
|
|
31
|
+
subOrders = _ref.subOrders,
|
|
32
|
+
sellerMemo = _ref.sellerMemo,
|
|
33
|
+
accountKey = _ref.accountKey,
|
|
34
|
+
onClose = _ref.onClose,
|
|
35
|
+
onSuccess = _ref.onSuccess;
|
|
36
|
+
var _useState = useState([]),
|
|
37
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
38
|
+
items = _useState2[0],
|
|
39
|
+
setItems = _useState2[1];
|
|
40
|
+
var _useState3 = useState([]),
|
|
41
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
42
|
+
initialItems = _useState4[0],
|
|
43
|
+
setInitialItems = _useState4[1];
|
|
44
|
+
var _useState5 = useState(false),
|
|
45
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
46
|
+
saving = _useState6[0],
|
|
47
|
+
setSaving = _useState6[1];
|
|
48
|
+
var _useState7 = useState(false),
|
|
49
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
50
|
+
goodsModalVisible = _useState8[0],
|
|
51
|
+
setGoodsModalVisible = _useState8[1];
|
|
52
|
+
var _useState9 = useState(null),
|
|
53
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
54
|
+
replaceIndex = _useState10[0],
|
|
55
|
+
setReplaceIndex = _useState10[1];
|
|
56
|
+
var _useState11 = useState(false),
|
|
57
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
58
|
+
remarkSyncEnabled = _useState12[0],
|
|
59
|
+
setRemarkSyncEnabled = _useState12[1];
|
|
60
|
+
var _useState13 = useState(function () {
|
|
61
|
+
return loadRemarkFields(accountKey);
|
|
62
|
+
}),
|
|
63
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
64
|
+
remarkFields = _useState14[0],
|
|
65
|
+
setRemarkFields = _useState14[1];
|
|
66
|
+
var _useState15 = useState([]),
|
|
67
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
68
|
+
invalidFields = _useState16[0],
|
|
69
|
+
setInvalidFields = _useState16[1];
|
|
70
|
+
var _useState17 = useState(''),
|
|
71
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
72
|
+
selectorGoodNo = _useState18[0],
|
|
73
|
+
setSelectorGoodNo = _useState18[1];
|
|
74
|
+
var goodsListRef = useRef(null);
|
|
75
|
+
useEffect(function () {
|
|
76
|
+
if (visible) {
|
|
77
|
+
var nextItems = buildEditItems(sid, subOrders);
|
|
78
|
+
setItems(nextItems);
|
|
79
|
+
setInitialItems(nextItems);
|
|
80
|
+
setGoodsModalVisible(false);
|
|
81
|
+
setReplaceIndex(null);
|
|
82
|
+
setRemarkSyncEnabled(false);
|
|
83
|
+
setRemarkFields(loadRemarkFields(accountKey));
|
|
84
|
+
setInvalidFields([]);
|
|
85
|
+
setSelectorGoodNo('');
|
|
86
|
+
}
|
|
87
|
+
}, [accountKey, sid, subOrders, visible]);
|
|
88
|
+
var selectedRows = useMemo(function () {
|
|
89
|
+
return items.map(function (item) {
|
|
90
|
+
return {
|
|
91
|
+
id: item.skuId || item.orderId || item.rowKey,
|
|
92
|
+
skuId: item.skuId || item.outerId,
|
|
93
|
+
specNo: item.outerId
|
|
94
|
+
};
|
|
95
|
+
});
|
|
96
|
+
}, [items]);
|
|
97
|
+
var hasChanges = JSON.stringify(items) !== JSON.stringify(initialItems);
|
|
98
|
+
var isFieldInvalid = function isFieldInvalid(item, field) {
|
|
99
|
+
return invalidFields.includes("".concat(item.rowKey, ":").concat(field));
|
|
100
|
+
};
|
|
101
|
+
var updateItem = function updateItem(index, patch) {
|
|
102
|
+
var currentItem = items[index];
|
|
103
|
+
var rowKey = currentItem === null || currentItem === void 0 ? void 0 : currentItem.rowKey;
|
|
104
|
+
var nextItem = currentItem ? _objectSpread(_objectSpread({}, currentItem), patch) : undefined;
|
|
105
|
+
var shouldRecalculatePayment = Object.prototype.hasOwnProperty.call(patch, 'price') || Object.prototype.hasOwnProperty.call(patch, 'num');
|
|
106
|
+
var nextPatch = shouldRecalculatePayment && nextItem ? _objectSpread(_objectSpread({}, patch), {}, {
|
|
107
|
+
payment: calculatePayment(nextItem.price, nextItem.num)
|
|
108
|
+
}) : patch;
|
|
109
|
+
setItems(function (current) {
|
|
110
|
+
return current.map(function (item, itemIndex) {
|
|
111
|
+
return itemIndex === index ? _objectSpread(_objectSpread({}, item), nextPatch) : item;
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
if (rowKey) {
|
|
115
|
+
var fieldNames = Object.keys(nextPatch);
|
|
116
|
+
setInvalidFields(function (current) {
|
|
117
|
+
return current.filter(function (key) {
|
|
118
|
+
return !fieldNames.some(function (field) {
|
|
119
|
+
return key === "".concat(rowKey, ":").concat(field);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
var removeItem = function removeItem(index) {
|
|
126
|
+
setItems(function (current) {
|
|
127
|
+
return current.filter(function (_, itemIndex) {
|
|
128
|
+
return itemIndex !== index;
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
setInvalidFields([]);
|
|
132
|
+
};
|
|
133
|
+
var openGoodsSelector = function openGoodsSelector(index) {
|
|
134
|
+
var _items$index;
|
|
135
|
+
setReplaceIndex(index === undefined ? null : index);
|
|
136
|
+
setSelectorGoodNo(index === undefined ? '' : ((_items$index = items[index]) === null || _items$index === void 0 ? void 0 : _items$index.productCode) || '');
|
|
137
|
+
setGoodsModalVisible(true);
|
|
138
|
+
};
|
|
139
|
+
var closeGoodsSelector = function closeGoodsSelector() {
|
|
140
|
+
setGoodsModalVisible(false);
|
|
141
|
+
setReplaceIndex(null);
|
|
142
|
+
setSelectorGoodNo('');
|
|
143
|
+
};
|
|
144
|
+
var handleGoodsSelected = function handleGoodsSelected() {
|
|
145
|
+
var _goodsListRef$current;
|
|
146
|
+
var selectedGoods = ((_goodsListRef$current = goodsListRef.current) === null || _goodsListRef$current === void 0 ? void 0 : _goodsListRef$current.getSelectGoodList()) || [];
|
|
147
|
+
if (!selectedGoods.length) {
|
|
148
|
+
message.warning('请选择商品');
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (replaceIndex !== null) {
|
|
152
|
+
if (selectedGoods.length > 1) {
|
|
153
|
+
message.warning('替换商品只能选择一个商品');
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
var selectedSku = getGoodsSku(selectedGoods[0]);
|
|
157
|
+
if (items.some(function (item, index) {
|
|
158
|
+
return index !== replaceIndex && item.outerId === selectedSku;
|
|
159
|
+
})) {
|
|
160
|
+
message.warning('不能重复选择同一个 ERP 商品');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
setItems(function (current) {
|
|
164
|
+
return current.map(function (item, index) {
|
|
165
|
+
return index === replaceIndex ? applySelectedGood(item, selectedGoods[0]) : item;
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
setInvalidFields([]);
|
|
169
|
+
} else {
|
|
170
|
+
var existingSkuSet = new Set(items.map(function (item) {
|
|
171
|
+
return item.outerId;
|
|
172
|
+
}));
|
|
173
|
+
var newItems = selectedGoods.filter(function (good) {
|
|
174
|
+
return !existingSkuSet.has(getGoodsSku(good));
|
|
175
|
+
}).map(function (good, index) {
|
|
176
|
+
return applySelectedGood({
|
|
177
|
+
rowKey: "".concat(sid || '-', "_new_").concat(Date.now(), "_").concat(index),
|
|
178
|
+
title: '',
|
|
179
|
+
picUrl: '',
|
|
180
|
+
skuPropertiesName: '',
|
|
181
|
+
skuId: '',
|
|
182
|
+
productCode: '',
|
|
183
|
+
skuCode: '',
|
|
184
|
+
outerId: '',
|
|
185
|
+
price: '',
|
|
186
|
+
payment: '',
|
|
187
|
+
divideOrderFee: '',
|
|
188
|
+
num: 1,
|
|
189
|
+
orderRemark: ''
|
|
190
|
+
}, good);
|
|
191
|
+
});
|
|
192
|
+
if (!newItems.length) {
|
|
193
|
+
message.warning('所选商品已在订单中');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
setItems(function (current) {
|
|
197
|
+
return [].concat(_toConsumableArray(current), _toConsumableArray(newItems));
|
|
198
|
+
});
|
|
199
|
+
setInvalidFields([]);
|
|
200
|
+
}
|
|
201
|
+
closeGoodsSelector();
|
|
202
|
+
};
|
|
203
|
+
var handleSave = /*#__PURE__*/function () {
|
|
204
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
205
|
+
var nextInvalidFields, hasInvalidQuantity, hasEmptyAmount, validationError, _response$data, response, _response$data2, generatedRemark, _remarkResponse$data, remarkResponse;
|
|
206
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
207
|
+
while (1) switch (_context.prev = _context.next) {
|
|
208
|
+
case 0:
|
|
209
|
+
if (sid) {
|
|
210
|
+
_context.next = 3;
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
message.error('系统订单号为空,无法保存');
|
|
214
|
+
return _context.abrupt("return");
|
|
215
|
+
case 3:
|
|
216
|
+
if (hasChanges) {
|
|
217
|
+
_context.next = 6;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
message.info('暂无修改内容');
|
|
221
|
+
return _context.abrupt("return");
|
|
222
|
+
case 6:
|
|
223
|
+
if (items.length) {
|
|
224
|
+
_context.next = 8;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
return _context.abrupt("return");
|
|
228
|
+
case 8:
|
|
229
|
+
nextInvalidFields = getInvalidEditFieldKeys(items);
|
|
230
|
+
setInvalidFields(nextInvalidFields);
|
|
231
|
+
hasInvalidQuantity = items.some(function (item) {
|
|
232
|
+
return typeof item.num !== 'number' || !Number.isInteger(item.num) || item.num < 1;
|
|
233
|
+
});
|
|
234
|
+
hasEmptyAmount = items.some(function (item) {
|
|
235
|
+
return !item.price.trim() || !item.payment.trim();
|
|
236
|
+
});
|
|
237
|
+
if (!hasInvalidQuantity) {
|
|
238
|
+
_context.next = 15;
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
message.error('数量必须填写大于等于1的数');
|
|
242
|
+
return _context.abrupt("return");
|
|
243
|
+
case 15:
|
|
244
|
+
if (!hasEmptyAmount) {
|
|
245
|
+
_context.next = 18;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
message.error('单价和成交金额不能为空');
|
|
249
|
+
return _context.abrupt("return");
|
|
250
|
+
case 18:
|
|
251
|
+
validationError = validateEditItems(items);
|
|
252
|
+
if (!validationError) {
|
|
253
|
+
_context.next = 22;
|
|
254
|
+
break;
|
|
255
|
+
}
|
|
256
|
+
message.error(validationError);
|
|
257
|
+
return _context.abrupt("return");
|
|
258
|
+
case 22:
|
|
259
|
+
setSaving(true);
|
|
260
|
+
_context.prev = 23;
|
|
261
|
+
_context.next = 26;
|
|
262
|
+
return kmErpItemModify({
|
|
263
|
+
sid: sid,
|
|
264
|
+
orders: toModifyOrders(items)
|
|
265
|
+
});
|
|
266
|
+
case 26:
|
|
267
|
+
response = _context.sent;
|
|
268
|
+
if (!(!response.success || ((_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.success) !== true)) {
|
|
269
|
+
_context.next = 29;
|
|
270
|
+
break;
|
|
271
|
+
}
|
|
272
|
+
throw new Error(response.message || ((_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.errorMsg) || '保存失败');
|
|
273
|
+
case 29:
|
|
274
|
+
if (!remarkSyncEnabled) {
|
|
275
|
+
_context.next = 39;
|
|
276
|
+
break;
|
|
277
|
+
}
|
|
278
|
+
generatedRemark = buildOrderRemark(items, remarkFields);
|
|
279
|
+
if (!generatedRemark) {
|
|
280
|
+
_context.next = 39;
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
_context.next = 34;
|
|
284
|
+
return kmErpSellerMemoUpload({
|
|
285
|
+
sid: sid,
|
|
286
|
+
appendMemo: sellerMemo ? "\n".concat(generatedRemark) : generatedRemark
|
|
287
|
+
});
|
|
288
|
+
case 34:
|
|
289
|
+
remarkResponse = _context.sent;
|
|
290
|
+
if (!(!remarkResponse.success || ((_remarkResponse$data = remarkResponse.data) === null || _remarkResponse$data === void 0 ? void 0 : _remarkResponse$data.success) !== true)) {
|
|
291
|
+
_context.next = 39;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
message.warning('商品修改成功,但新增订单备注失败');
|
|
295
|
+
onSuccess();
|
|
296
|
+
return _context.abrupt("return");
|
|
297
|
+
case 39:
|
|
298
|
+
message.success('商品修改成功');
|
|
299
|
+
onSuccess();
|
|
300
|
+
_context.next = 46;
|
|
301
|
+
break;
|
|
302
|
+
case 43:
|
|
303
|
+
_context.prev = 43;
|
|
304
|
+
_context.t0 = _context["catch"](23);
|
|
305
|
+
message.error((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '保存失败,请稍后重试');
|
|
306
|
+
case 46:
|
|
307
|
+
_context.prev = 46;
|
|
308
|
+
setSaving(false);
|
|
309
|
+
return _context.finish(46);
|
|
310
|
+
case 49:
|
|
311
|
+
case "end":
|
|
312
|
+
return _context.stop();
|
|
313
|
+
}
|
|
314
|
+
}, _callee, null, [[23, 43, 46, 49]]);
|
|
315
|
+
}));
|
|
316
|
+
return function handleSave() {
|
|
317
|
+
return _ref2.apply(this, arguments);
|
|
318
|
+
};
|
|
319
|
+
}();
|
|
320
|
+
var remarkSettingsContent = /*#__PURE__*/React.createElement("div", {
|
|
321
|
+
className: "km-erp-goods-remark-settings"
|
|
322
|
+
}, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
323
|
+
strong: true
|
|
324
|
+
}, "\u5546\u54C1\u5907\u6CE8\u5B57\u6BB5"), /*#__PURE__*/React.createElement(Checkbox.Group, {
|
|
325
|
+
options: REMARK_FIELD_OPTIONS,
|
|
326
|
+
value: remarkFields,
|
|
327
|
+
onChange: function onChange(values) {
|
|
328
|
+
var nextFields = values;
|
|
329
|
+
setRemarkFields(nextFields);
|
|
330
|
+
saveRemarkFields(accountKey, nextFields);
|
|
331
|
+
}
|
|
332
|
+
}));
|
|
333
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer, {
|
|
334
|
+
title: "\u4FEE\u6539\u5546\u54C1",
|
|
335
|
+
placement: "right",
|
|
336
|
+
width: "100%",
|
|
337
|
+
open: visible,
|
|
338
|
+
onClose: onClose,
|
|
339
|
+
destroyOnClose: true,
|
|
340
|
+
className: "km-erp-goods-modify-drawer",
|
|
341
|
+
footer: /*#__PURE__*/React.createElement("div", {
|
|
342
|
+
className: "km-erp-goods-modify-footer"
|
|
343
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
344
|
+
className: "km-erp-goods-remark-sync"
|
|
345
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
346
|
+
checked: remarkSyncEnabled,
|
|
347
|
+
onChange: function onChange(event) {
|
|
348
|
+
return setRemarkSyncEnabled(event.target.checked);
|
|
349
|
+
}
|
|
350
|
+
}, "\u65B0\u589E\u6216\u6362\u65B0\u540E\u5546\u54C1\u5907\u6CE8\u5230\u5FEB\u9EA6 ERP \u8BA2\u5355"), /*#__PURE__*/React.createElement(Popover, {
|
|
351
|
+
content: remarkSettingsContent,
|
|
352
|
+
trigger: "click",
|
|
353
|
+
placement: "topLeft"
|
|
354
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
355
|
+
type: "link"
|
|
356
|
+
}, "\u8BBE\u7F6E"))), /*#__PURE__*/React.createElement("div", {
|
|
357
|
+
className: "km-erp-goods-modify-footer-actions"
|
|
358
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
359
|
+
onClick: onClose
|
|
360
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
361
|
+
type: "primary",
|
|
362
|
+
disabled: !hasChanges || !items.length,
|
|
363
|
+
loading: saving,
|
|
364
|
+
onClick: handleSave
|
|
365
|
+
}, "\u786E\u5B9A")))
|
|
366
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
367
|
+
className: "km-erp-goods-modify-list"
|
|
368
|
+
}, items.map(function (item, index) {
|
|
369
|
+
return /*#__PURE__*/React.createElement(Card, {
|
|
370
|
+
key: item.rowKey,
|
|
371
|
+
size: "small",
|
|
372
|
+
className: "km-erp-goods-modify-card"
|
|
373
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
374
|
+
className: "km-erp-goods-modify-layout"
|
|
375
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
376
|
+
className: "km-erp-goods-modify-media"
|
|
377
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
378
|
+
src: item.picUrl,
|
|
379
|
+
fallback: fallBackImage
|
|
380
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
381
|
+
type: "link",
|
|
382
|
+
onClick: function onClick() {
|
|
383
|
+
return openGoodsSelector(index);
|
|
384
|
+
}
|
|
385
|
+
}, "\u6362\u5546\u54C1"), /*#__PURE__*/React.createElement(Button, {
|
|
386
|
+
type: "default",
|
|
387
|
+
danger: true,
|
|
388
|
+
onClick: function onClick() {
|
|
389
|
+
return removeItem(index);
|
|
390
|
+
}
|
|
391
|
+
}, "\u5220\u9664")), /*#__PURE__*/React.createElement("div", {
|
|
392
|
+
className: "km-erp-goods-modify-fields"
|
|
393
|
+
}, /*#__PURE__*/React.createElement(Typography.Text, {
|
|
394
|
+
strong: true,
|
|
395
|
+
className: "km-erp-goods-modify-title",
|
|
396
|
+
title: item.title
|
|
397
|
+
}, item.title || '未命名商品', item.skuPropertiesName ? "\uFF08\u89C4\u683C\uFF1A".concat(item.skuPropertiesName, "\uFF09") : ''), /*#__PURE__*/React.createElement("div", {
|
|
398
|
+
className: "km-erp-goods-modify-field-row"
|
|
399
|
+
}, /*#__PURE__*/React.createElement("label", null, "\u4E3B\u5546\u5BB6\u7F16\u7801", /*#__PURE__*/React.createElement(Input, {
|
|
400
|
+
value: item.productCode || item.outerId,
|
|
401
|
+
readOnly: true
|
|
402
|
+
})), /*#__PURE__*/React.createElement("label", null, "\u5546\u5BB6\u7F16\u7801", /*#__PURE__*/React.createElement(Input, {
|
|
403
|
+
value: item.skuCode || item.outerId,
|
|
404
|
+
readOnly: true
|
|
405
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
406
|
+
className: "km-erp-goods-modify-field-row"
|
|
407
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
408
|
+
className: "km-erp-goods-modify-label-text"
|
|
409
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
410
|
+
className: "required-mark"
|
|
411
|
+
}, "*"), "\u5355\u4EF7"), /*#__PURE__*/React.createElement(Input, {
|
|
412
|
+
status: isFieldInvalid(item, 'price') ? 'error' : undefined,
|
|
413
|
+
value: item.price,
|
|
414
|
+
onChange: function onChange(event) {
|
|
415
|
+
return updateItem(index, {
|
|
416
|
+
price: event.target.value
|
|
417
|
+
});
|
|
418
|
+
},
|
|
419
|
+
placeholder: "\u8BF7\u8F93\u5165\u5355\u4EF7"
|
|
420
|
+
})), /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
421
|
+
className: "km-erp-goods-modify-label-text"
|
|
422
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
423
|
+
className: "required-mark"
|
|
424
|
+
}, "*"), "\u6570\u91CF"), /*#__PURE__*/React.createElement(InputNumber, {
|
|
425
|
+
status: isFieldInvalid(item, 'num') ? 'error' : undefined,
|
|
426
|
+
min: 1,
|
|
427
|
+
precision: 0,
|
|
428
|
+
controls: false,
|
|
429
|
+
value: item.num,
|
|
430
|
+
onChange: function onChange(value) {
|
|
431
|
+
return updateItem(index, {
|
|
432
|
+
num: value
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
436
|
+
className: "km-erp-goods-modify-field-row"
|
|
437
|
+
}, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("span", {
|
|
438
|
+
className: "km-erp-goods-modify-label-text"
|
|
439
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
440
|
+
className: "required-mark"
|
|
441
|
+
}, "*"), "\u6210\u4EA4\u91D1\u989D"), /*#__PURE__*/React.createElement(Input, {
|
|
442
|
+
status: isFieldInvalid(item, 'payment') ? 'error' : undefined,
|
|
443
|
+
value: item.payment,
|
|
444
|
+
onChange: function onChange(event) {
|
|
445
|
+
return updateItem(index, {
|
|
446
|
+
payment: event.target.value
|
|
447
|
+
});
|
|
448
|
+
},
|
|
449
|
+
placeholder: "\u8BF7\u8F93\u5165\u6210\u4EA4\u91D1\u989D"
|
|
450
|
+
})), /*#__PURE__*/React.createElement("label", null, "\u5E73\u53F0\u5B9E\u4ED8", /*#__PURE__*/React.createElement(Input, {
|
|
451
|
+
value: item.divideOrderFee,
|
|
452
|
+
onChange: function onChange(event) {
|
|
453
|
+
return updateItem(index, {
|
|
454
|
+
divideOrderFee: event.target.value
|
|
455
|
+
});
|
|
456
|
+
},
|
|
457
|
+
placeholder: "\u8BF7\u8F93\u5165\u5E73\u53F0\u5B9E\u4ED8"
|
|
458
|
+
}))), /*#__PURE__*/React.createElement("label", {
|
|
459
|
+
className: "km-erp-goods-modify-remark"
|
|
460
|
+
}, "\u8BA2\u5355\u5546\u54C1\u5907\u6CE8", /*#__PURE__*/React.createElement(Input, {
|
|
461
|
+
value: item.orderRemark,
|
|
462
|
+
maxLength: MAX_GOODS_REMARK_LENGTH,
|
|
463
|
+
onChange: function onChange(event) {
|
|
464
|
+
return updateItem(index, {
|
|
465
|
+
orderRemark: event.target.value
|
|
466
|
+
});
|
|
467
|
+
},
|
|
468
|
+
placeholder: "\u8BF7\u8F93\u5165\u8BA2\u5355\u5546\u54C1\u5907\u6CE8"
|
|
469
|
+
})))));
|
|
470
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
471
|
+
className: "km-erp-goods-modify-add",
|
|
472
|
+
onClick: function onClick() {
|
|
473
|
+
return openGoodsSelector();
|
|
474
|
+
}
|
|
475
|
+
}, "\uFF0B \u65B0\u589E\u5546\u54C1"))), /*#__PURE__*/React.createElement(Modal, {
|
|
476
|
+
title: replaceIndex === null ? '新增商品' : '替换商品',
|
|
477
|
+
visible: goodsModalVisible,
|
|
478
|
+
width: "min(850px, calc(100vw - 16px))",
|
|
479
|
+
destroyOnClose: true,
|
|
480
|
+
className: "km-erp-goods-selector-modal",
|
|
481
|
+
onCancel: closeGoodsSelector,
|
|
482
|
+
onOk: handleGoodsSelected,
|
|
483
|
+
okText: "\u786E\u8BA4",
|
|
484
|
+
cancelText: "\u53D6\u6D88"
|
|
485
|
+
}, goodsModalVisible && /*#__PURE__*/React.createElement(ErpGoodsList, {
|
|
486
|
+
ref: goodsListRef,
|
|
487
|
+
selectedRows: selectedRows,
|
|
488
|
+
initialGoodNo: selectorGoodNo || undefined,
|
|
489
|
+
singleSelect: replaceIndex !== null
|
|
490
|
+
})));
|
|
491
|
+
};
|
|
492
|
+
export default GoodsModifyDrawer;
|
|
@@ -12,5 +12,6 @@ declare type SubOrderGroup<T extends SubOrderLike> = {
|
|
|
12
12
|
orders: T[];
|
|
13
13
|
};
|
|
14
14
|
export declare const filterFlowTemplates: (flowList: LogicFlow[], keyword: string) => LogicFlow[];
|
|
15
|
+
export declare const canModifyGoods: (sysStatus?: string, tid?: string) => boolean;
|
|
15
16
|
export declare const groupSubOrdersByTid: <T extends SubOrderLike>(subOrders: T[]) => SubOrderGroup<T>[];
|
|
16
17
|
export {};
|
|
@@ -8,6 +8,9 @@ export var filterFlowTemplates = function filterFlowTemplates(flowList, keyword)
|
|
|
8
8
|
return (_item$name = item.name) === null || _item$name === void 0 ? void 0 : _item$name.includes(normalizedKeyword);
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
export var canModifyGoods = function canModifyGoods(sysStatus, tid) {
|
|
12
|
+
return sysStatus === 'WAIT_AUDIT' && Boolean(tid && tid !== '-');
|
|
13
|
+
};
|
|
11
14
|
export var groupSubOrdersByTid = function groupSubOrdersByTid(subOrders) {
|
|
12
15
|
var groupMap = new Map();
|
|
13
16
|
subOrders.forEach(function (subOrder) {
|