@kmkf-fe-packages/kmkf-work-order-service-component 2.2.33 → 2.2.36
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/GlobalContext/hook/dist/useGetHasErpData.js +52 -0
- package/dist/esm/GlobalContext/orderQuery/dist/useGetErpAddressData.js +180 -0
- package/dist/esm/GlobalContext/orderQuery/dist/useGetErpLogisticsCompany.js +186 -0
- package/dist/esm/common/utils/dist/submitDataTransOldFormat.js +899 -0
- package/dist/esm/common/utils/dist/tools.js +1326 -0
- package/dist/esm/common/utils/dist/transformWorkOrderData.js +965 -0
- package/dist/esm/model/customizeWorkOrder/dist/api.js +48 -0
- package/dist/esm/model/customizeWorkOrder/dist/index.js +370 -0
- package/dist/esm/model/customizeWorkOrder/dist/selector.js +63 -0
- package/dist/esm/model/customizeWorkOrder/dist/types.js +3 -0
- package/dist/esm/model/dist/global.js +44 -0
- package/dist/esm/model/dist/hooks.js +15 -0
- package/dist/esm/model/dist/login.js +245 -0
- package/dist/esm/model/dist/store.js +30 -0
- package/dist/esm/model/dist/userData.js +41 -0
- package/dist/esm/model/dist/workOrder.js +329 -0
- package/dist/esm/model/flowTemplateDetail/dist/api.js +192 -0
- package/dist/esm/model/flowTemplateDetail/dist/types.js +48 -0
- package/dist/esm/model/logicFlow/dist/api.js +14 -0
- package/dist/esm/model/logicFlow/dist/index.js +235 -0
- package/dist/esm/model/logicFlow/dist/selector.js +18 -0
- package/dist/esm/model/logicFlow/dist/types.js +3 -0
- package/dist/esm/model/logicFlow/selector.d.ts +0 -3
- package/dist/esm/model/paymentWorkOrder/dist/index.js +77 -0
- package/dist/esm/model/paymentWorkOrder/dist/selector.js +36 -0
- package/dist/esm/model/paymentWorkOrder/dist/types.js +3 -0
- package/dist/esm/model/paymentWorkOrder/selector.d.ts +0 -9
- package/dist/esm/model/servers/dist/api.js +545 -0
- package/dist/esm/model/servers/dist/request.js +63 -0
- package/dist/esm/model/singleShopWorkOrder/dist/index.js +216 -0
- package/dist/esm/model/singleShopWorkOrder/dist/selector.js +24 -0
- package/dist/esm/model/singleShopWorkOrder/dist/types.js +3 -0
- package/dist/esm/model/singleShopWorkOrder/selector.d.ts +0 -5
- package/dist/esm/model/types/dist/login.js +3 -0
- package/dist/esm/model/types/dist/singleWorkOrder.js +3 -0
- package/dist/esm/model/types/dist/workOrder.js +3 -0
- package/package.json +5 -5
|
@@ -0,0 +1,1326 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var __assign = this && this.__assign || function () {
|
|
4
|
+
__assign = Object.assign || function (t) {
|
|
5
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
+
s = arguments[i];
|
|
7
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) {
|
|
15
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
16
|
+
resolve(value);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function rejected(value) {
|
|
28
|
+
try {
|
|
29
|
+
step(generator["throw"](value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
function step(result) {
|
|
35
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
36
|
+
}
|
|
37
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var __generator = this && this.__generator || function (thisArg, body) {
|
|
41
|
+
var _ = {
|
|
42
|
+
label: 0,
|
|
43
|
+
sent: function sent() {
|
|
44
|
+
if (t[0] & 1) throw t[1];
|
|
45
|
+
return t[1];
|
|
46
|
+
},
|
|
47
|
+
trys: [],
|
|
48
|
+
ops: []
|
|
49
|
+
},
|
|
50
|
+
f,
|
|
51
|
+
y,
|
|
52
|
+
t,
|
|
53
|
+
g;
|
|
54
|
+
return g = {
|
|
55
|
+
next: verb(0),
|
|
56
|
+
"throw": verb(1),
|
|
57
|
+
"return": verb(2)
|
|
58
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
|
59
|
+
return this;
|
|
60
|
+
}), g;
|
|
61
|
+
function verb(n) {
|
|
62
|
+
return function (v) {
|
|
63
|
+
return step([n, v]);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
function step(op) {
|
|
67
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
68
|
+
while (_) try {
|
|
69
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
70
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
71
|
+
switch (op[0]) {
|
|
72
|
+
case 0:
|
|
73
|
+
case 1:
|
|
74
|
+
t = op;
|
|
75
|
+
break;
|
|
76
|
+
case 4:
|
|
77
|
+
_.label++;
|
|
78
|
+
return {
|
|
79
|
+
value: op[1],
|
|
80
|
+
done: false
|
|
81
|
+
};
|
|
82
|
+
case 5:
|
|
83
|
+
_.label++;
|
|
84
|
+
y = op[1];
|
|
85
|
+
op = [0];
|
|
86
|
+
continue;
|
|
87
|
+
case 7:
|
|
88
|
+
op = _.ops.pop();
|
|
89
|
+
_.trys.pop();
|
|
90
|
+
continue;
|
|
91
|
+
default:
|
|
92
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
93
|
+
_ = 0;
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
97
|
+
_.label = op[1];
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
101
|
+
_.label = t[1];
|
|
102
|
+
t = op;
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
if (t && _.label < t[2]) {
|
|
106
|
+
_.label = t[2];
|
|
107
|
+
_.ops.push(op);
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (t[2]) _.ops.pop();
|
|
111
|
+
_.trys.pop();
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
op = body.call(thisArg, _);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
op = [6, e];
|
|
117
|
+
y = 0;
|
|
118
|
+
} finally {
|
|
119
|
+
f = t = 0;
|
|
120
|
+
}
|
|
121
|
+
if (op[0] & 5) throw op[1];
|
|
122
|
+
return {
|
|
123
|
+
value: op[0] ? op[1] : void 0,
|
|
124
|
+
done: true
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
var __spreadArrays = this && this.__spreadArrays || function () {
|
|
129
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
130
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
131
|
+
return r;
|
|
132
|
+
};
|
|
133
|
+
exports.__esModule = true;
|
|
134
|
+
exports.setLogisticsInfo = exports.transformWorkOrderDetail = exports.getMappingTargetValue = exports.getMappingConfigByTemplateDetail = exports.gySystemOrderBackValues = exports.wdtSystemOrderBackValues = exports.kmSystemOrderBackValues = exports.wlnSystemOrderBackValues = exports.bsE3SystemOrderBackValues = exports.bsSystemOrderBackValues = exports.deleteCacheOrder = exports.reversalFormValues = exports.verifyHandle = exports.submitParams = exports.platformMap = exports.HasErpItemSelectHandle = exports.HasFilterHandle = exports.getReplaceWarnValues = exports.INNER_REPLACE_COMPONENT = exports.EXCLUDE_REPLACE_TOP_COMPONENT = exports.COMPONENT_MAP_NAME = exports.COMPONENT_MAP = exports.imgResize = exports.orderBack = exports.calcWorkOrderList = exports.transTextToNumber = exports.formatPictures = exports.jsonParseSecurity = exports.radioTextHandle = exports.filterComponent = exports.findValueByField = exports.findComponentUniqueKeyByType = void 0;
|
|
135
|
+
var antd_1 = require("antd");
|
|
136
|
+
var lodash_1 = require("lodash");
|
|
137
|
+
var api_1 = require("../../model/servers/api");
|
|
138
|
+
var moment_1 = require("moment");
|
|
139
|
+
var kmkf_utils_1 = require("@kmkf-fe-packages/kmkf-utils");
|
|
140
|
+
var kmkf_monitor_1 = require("kmkf-monitor");
|
|
141
|
+
var types_1 = require("../../model/flowTemplateDetail/types");
|
|
142
|
+
var transformWorkOrderData_1 = require("./transformWorkOrderData");
|
|
143
|
+
var submitDataTransOldFormat_1 = require("./submitDataTransOldFormat");
|
|
144
|
+
var tools_constants_1 = require("./tools_constants");
|
|
145
|
+
var ONLY_SHOW_COMPONENT_TYPE = ['RADIO', 'INPUT', 'TEXTAREA', 'CHECKBOX', 'SELECT', 'DATETIME', 'PICTURE', 'MULT_SELECT', 'ORDINARY_INVOICE'];
|
|
146
|
+
//表单提交单一字段映射
|
|
147
|
+
var workTypeKeys = {
|
|
148
|
+
SHOP_NAME_INPUT: 'shopName',
|
|
149
|
+
RECEIVER_NAME_INPUT: 'receiveName',
|
|
150
|
+
RECEIVER_MOBILE_INPUT: 'receiveMobile',
|
|
151
|
+
TRADE_CREATE_DATETIME: 'tradeCreateDateTime',
|
|
152
|
+
TRADE_PAYMENT_DATETIME: 'tradePaymentDateTime',
|
|
153
|
+
TRADE_DELIVERY_DATETIME: 'tradeDeliveryDateTime',
|
|
154
|
+
TRADE_CLOSING_DATETIME: 'tradeClosingDateTime',
|
|
155
|
+
INPUT: 'input',
|
|
156
|
+
DATETIME: 'dateTime',
|
|
157
|
+
TEXTAREA: 'textarea',
|
|
158
|
+
SELECT: 'select',
|
|
159
|
+
SYSTEM_ORDER_NO: 'systemOrderNo',
|
|
160
|
+
NEW_PAYMENT_STATUS: 'newPaymentStatus',
|
|
161
|
+
BUSINESS_ORDER_NO: 'businessOrderNo',
|
|
162
|
+
PAYMENT_VOUCHER_CODE: 'paymentVoucherCode'
|
|
163
|
+
};
|
|
164
|
+
// 根据组件类型获取组件的UniqueKey
|
|
165
|
+
exports.findComponentUniqueKeyByType = function (componentDtoList, workOrderComponentType) {
|
|
166
|
+
var _a;
|
|
167
|
+
return (_a = componentDtoList.find(function (item) {
|
|
168
|
+
return item.workOrderComponentType === workOrderComponentType;
|
|
169
|
+
})) === null || _a === void 0 ? void 0 : _a.uniqueKey;
|
|
170
|
+
};
|
|
171
|
+
var findNodeById = function findNodeById(tree, actived) {
|
|
172
|
+
if (actived === void 0) {
|
|
173
|
+
actived = '';
|
|
174
|
+
}
|
|
175
|
+
for (var i = 0; i < tree.length; i++) {
|
|
176
|
+
if (tree[i].actived == actived) {
|
|
177
|
+
return tree[i];
|
|
178
|
+
}
|
|
179
|
+
if (tree[i].children) {
|
|
180
|
+
var result = findNodeById(tree[i].children, actived);
|
|
181
|
+
if (result) {
|
|
182
|
+
return result;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
exports.findValueByField = function (componentDtoList) {
|
|
188
|
+
return function (data, type) {
|
|
189
|
+
var uniqueKey = exports.findComponentUniqueKeyByType(componentDtoList, type);
|
|
190
|
+
return lodash_1.get(data, uniqueKey, '');
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
exports.filterComponent = function (originDataSource) {
|
|
194
|
+
if (originDataSource === void 0) {
|
|
195
|
+
originDataSource = [];
|
|
196
|
+
}
|
|
197
|
+
return originDataSource.filter(function (data) {
|
|
198
|
+
return ONLY_SHOW_COMPONENT_TYPE.includes(data === null || data === void 0 ? void 0 : data.workOrderComponentType);
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
exports.radioTextHandle = function (radioValue, radioOtherValue) {
|
|
202
|
+
return radioValue === '其他' ? radioOtherValue ? radioValue + "(" + radioOtherValue + ")" : radioValue : radioValue;
|
|
203
|
+
};
|
|
204
|
+
exports.jsonParseSecurity = function (value, securityValue) {
|
|
205
|
+
try {
|
|
206
|
+
return JSON.parse(value);
|
|
207
|
+
} catch (e) {
|
|
208
|
+
// console.error('JSON解析异常', value, typeof value);
|
|
209
|
+
return securityValue;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
exports.formatPictures = function (pictures) {
|
|
213
|
+
pictures = pictures.replace(/[\[\]]/g, '');
|
|
214
|
+
pictures = pictures.replace(/\s/g, '');
|
|
215
|
+
pictures = pictures ? pictures.split(',') : [];
|
|
216
|
+
return pictures;
|
|
217
|
+
};
|
|
218
|
+
exports.transTextToNumber = function (value) {
|
|
219
|
+
return value ? +value : value;
|
|
220
|
+
};
|
|
221
|
+
var systemOrderMap = {
|
|
222
|
+
BS_SYSTEM_ORDER: {
|
|
223
|
+
no: 'bsSystemOrderNo',
|
|
224
|
+
ids: 'bsSystemSelectIds',
|
|
225
|
+
order: 'bsSystemShowOrder'
|
|
226
|
+
},
|
|
227
|
+
KM_SYSTEM_ORDER: {
|
|
228
|
+
no: 'kmSystemOrderNo',
|
|
229
|
+
ids: 'kmSystemSelectIds',
|
|
230
|
+
order: 'kmSystemShowOrder'
|
|
231
|
+
},
|
|
232
|
+
WLN_SYSTEM_ORDER: {
|
|
233
|
+
no: 'wlnSystemOrderNo',
|
|
234
|
+
ids: 'wlnSystemSelectIds',
|
|
235
|
+
order: 'wlnSystemShowOrder'
|
|
236
|
+
},
|
|
237
|
+
WDT_SYSTEM_ORDER: {
|
|
238
|
+
no: 'wdtSystemOrderNo',
|
|
239
|
+
ids: 'wdtSystemSelectIds',
|
|
240
|
+
order: 'wdtSystemShowOrder'
|
|
241
|
+
},
|
|
242
|
+
BS_E3_SYSTEM_ORDER: {
|
|
243
|
+
no: 'bsE3SystemOrderNo',
|
|
244
|
+
ids: 'bsE3SystemSelectIds',
|
|
245
|
+
order: 'bsE3SystemShowOrder'
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
exports.calcWorkOrderList = function (source, templateColumns, type) {
|
|
249
|
+
var transDataSourceItem = transformWorkOrderData_1["default"](templateColumns, type);
|
|
250
|
+
var finalSource = source === null || source === void 0 ? void 0 : source.map(function (item) {
|
|
251
|
+
var value = transDataSourceItem(item);
|
|
252
|
+
return __assign(__assign(__assign({}, item.jsonMap), value), {
|
|
253
|
+
shopId: item.shopId,
|
|
254
|
+
shopName: item.shopName,
|
|
255
|
+
id: item.id,
|
|
256
|
+
repeatValueList: item.repeatValueList
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
return finalSource;
|
|
260
|
+
};
|
|
261
|
+
//订单返填
|
|
262
|
+
exports.orderBack = function (_a) {
|
|
263
|
+
var order_no = _a.order_no,
|
|
264
|
+
form = _a.form,
|
|
265
|
+
shopId = _a.shopId,
|
|
266
|
+
shopList = _a.shopList,
|
|
267
|
+
templateDetail = _a.templateDetail,
|
|
268
|
+
_b = _a.type,
|
|
269
|
+
type = _b === void 0 ? 'add' : _b,
|
|
270
|
+
callback = _a.callback,
|
|
271
|
+
fromQNCreateWorkOrderByOrderNo = _a.fromQNCreateWorkOrderByOrderNo,
|
|
272
|
+
_c = _a.plat,
|
|
273
|
+
plat = _c === void 0 ? {} : _c;
|
|
274
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
275
|
+
var JOIN_SHOP, hasFlagMap, _d, shopSourceStr, _e, thirdUserNick, promise_1, _f, data, jstOrder, bsOrder, wlnOrder, wdtOrder, bsE3Order, kmOrder, gyOrder, orderInfo, jstInfo, bsOrders, wlnOrders, wdtOrders, bsE3Orders, kmOrders, gyOrders, bsInfo, wlnInfo, bsE3Info, wdtInfo, kmInfo, gyInfo, formValue, detail, hasSelectItem, erpPromiseList_1, list, promises, e_1, values, paymentUniqueKey, cacheOrderInfo, cacheOrderInfo, e_2;
|
|
276
|
+
var _g, _h, _j, _k;
|
|
277
|
+
var _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
|
|
278
|
+
return __generator(this, function (_4) {
|
|
279
|
+
switch (_4.label) {
|
|
280
|
+
case 0:
|
|
281
|
+
JOIN_SHOP = shopList.find(function (item) {
|
|
282
|
+
return !item.notJoin && item.shopId == shopId;
|
|
283
|
+
});
|
|
284
|
+
hasFlagMap = tools_constants_1.orderBackMap({
|
|
285
|
+
templateDetail: templateDetail,
|
|
286
|
+
order_no: order_no
|
|
287
|
+
});
|
|
288
|
+
//如果不是对接店铺且三方erp组件也没
|
|
289
|
+
if (!JOIN_SHOP && Object.values(hasFlagMap).filter(function (item) {
|
|
290
|
+
return !item.andJsonShop;
|
|
291
|
+
}).map(function (item) {
|
|
292
|
+
return item.flag;
|
|
293
|
+
}).every(function (item) {
|
|
294
|
+
return item === false;
|
|
295
|
+
})) return [2 /*return*/];
|
|
296
|
+
_d = shopList.find(function (item) {
|
|
297
|
+
return item.shopId == shopId;
|
|
298
|
+
}) || {}, shopSourceStr = _d.shopSourceStr, _e = _d.thirdUserNick, thirdUserNick = _e === void 0 ? '' : _e;
|
|
299
|
+
_4.label = 1;
|
|
300
|
+
case 1:
|
|
301
|
+
_4.trys.push([1, 7,, 8]);
|
|
302
|
+
promise_1 = [];
|
|
303
|
+
if (!JOIN_SHOP) {
|
|
304
|
+
promise_1.push(Promise.resolve([]));
|
|
305
|
+
} else {
|
|
306
|
+
promise_1.push(api_1.orderDetail({
|
|
307
|
+
shopId: shopId,
|
|
308
|
+
orderNo: order_no,
|
|
309
|
+
templateId: templateDetail.uniqueKey
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
Object.keys(hasFlagMap).forEach(function (key) {
|
|
313
|
+
var _a = hasFlagMap[key],
|
|
314
|
+
flag = _a.flag,
|
|
315
|
+
andJsonShop = _a.andJsonShop,
|
|
316
|
+
promiseRequest = _a.promiseRequest;
|
|
317
|
+
if (flag) {
|
|
318
|
+
if (andJsonShop && !JOIN_SHOP) {
|
|
319
|
+
promise_1.push(Promise.resolve([]));
|
|
320
|
+
} else {
|
|
321
|
+
promise_1.push(promiseRequest());
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
promise_1.push(Promise.resolve([]));
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
return [4 /*yield*/, Promise.allSettled(promise_1)];
|
|
328
|
+
case 2:
|
|
329
|
+
_f = _4.sent(), data = _f[0], jstOrder = _f[1], bsOrder = _f[2], wlnOrder = _f[3], wdtOrder = _f[4], bsE3Order = _f[5], kmOrder = _f[6], gyOrder = _f[7];
|
|
330
|
+
// TODO: 针对订单支付方式是微信还是支付宝,后端接口返回一个message用来提示使用
|
|
331
|
+
console.log('--订单反填数据--', {
|
|
332
|
+
data: data,
|
|
333
|
+
jstOrder: jstOrder,
|
|
334
|
+
bsOrder: bsOrder,
|
|
335
|
+
wlnOrder: wlnOrder,
|
|
336
|
+
wdtOrder: wdtOrder,
|
|
337
|
+
bsE3Order: bsE3Order,
|
|
338
|
+
kmOrder: kmOrder,
|
|
339
|
+
gyOrder: gyOrder
|
|
340
|
+
});
|
|
341
|
+
if ((_l = data === null || data === void 0 ? void 0 : data.value) === null || _l === void 0 ? void 0 : _l.message) {
|
|
342
|
+
antd_1.message.warning((_m = data === null || data === void 0 ? void 0 : data.value) === null || _m === void 0 ? void 0 : _m.message);
|
|
343
|
+
}
|
|
344
|
+
orderInfo = ((_o = data === null || data === void 0 ? void 0 : data.value) === null || _o === void 0 ? void 0 : _o.data) || {};
|
|
345
|
+
jstInfo = ((_q = (_p = jstOrder === null || jstOrder === void 0 ? void 0 : jstOrder.value) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q.orders) || [];
|
|
346
|
+
bsOrders = ((_r = bsOrder === null || bsOrder === void 0 ? void 0 : bsOrder.value) === null || _r === void 0 ? void 0 : _r.data) || {};
|
|
347
|
+
wlnOrders = ((_s = wlnOrder === null || wlnOrder === void 0 ? void 0 : wlnOrder.value) === null || _s === void 0 ? void 0 : _s.data) || {};
|
|
348
|
+
wdtOrders = ((_t = wdtOrder === null || wdtOrder === void 0 ? void 0 : wdtOrder.value) === null || _t === void 0 ? void 0 : _t.data) || {};
|
|
349
|
+
bsE3Orders = ((_u = bsE3Order === null || bsE3Order === void 0 ? void 0 : bsE3Order.value) === null || _u === void 0 ? void 0 : _u.data) || {};
|
|
350
|
+
kmOrders = ((_v = kmOrder === null || kmOrder === void 0 ? void 0 : kmOrder.value) === null || _v === void 0 ? void 0 : _v.data) || {};
|
|
351
|
+
gyOrders = ((_w = gyOrder === null || gyOrder === void 0 ? void 0 : gyOrder.value) === null || _w === void 0 ? void 0 : _w.data) || [];
|
|
352
|
+
bsE3Orders.orderList = kmkf_utils_1.filterBsE3Orders(bsE3Orders, order_no);
|
|
353
|
+
wdtOrders.trades = kmkf_utils_1.filterWdtOrders(wdtOrders, order_no);
|
|
354
|
+
kmOrders.orderDetailDtoList = kmkf_utils_1.filterKmOrders(kmOrders, order_no);
|
|
355
|
+
gyOrders.trades = kmkf_utils_1.filterGyOrders(gyOrders, order_no);
|
|
356
|
+
kmkf_monitor_1["default"].automaticReport({
|
|
357
|
+
message: "orderBack:\u8BA2\u5355\u53F7:" + order_no + ",\u5E97\u94FAid:" + shopId + ", \u8BA2\u5355\u4FE1\u606F\uFF1A" + JSON.stringify(orderInfo) + ",jst\u4FE1\u606F:" + JSON.stringify(jstInfo) + ",bs\u4FE1\u606F:" + JSON.stringify(bsOrders) + ",wln\u4FE1\u606F:" + JSON.stringify(wlnOrders) + ",wdt\u4FE1\u606F:" + JSON.stringify(wdtOrders) + ",\n bsE3\u4FE1\u606F:" + JSON.stringify(bsE3Orders) + ", km\u4FE1\u606F:" + JSON.stringify(kmOrders) + ",\u7BA1\u6613\u4FE1\u606F:" + JSON.stringify(gyOrders)
|
|
358
|
+
});
|
|
359
|
+
if (plat === null || plat === void 0 ? void 0 : plat.subOrderNo) {
|
|
360
|
+
bsOrders.orders = bsOrders.orders.filter(function (item) {
|
|
361
|
+
return item.billNo === plat.subOrderNo;
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
bsInfo = kmkf_utils_1.bsOrderTransform(bsOrders || {});
|
|
365
|
+
wlnInfo = kmkf_utils_1.wlnOrderTransform(wlnOrders || {});
|
|
366
|
+
bsE3Info = kmkf_utils_1.bsE3OrderTransform(__assign(__assign({}, bsE3Orders), {
|
|
367
|
+
componentList: templateDetail.componentDtoList,
|
|
368
|
+
orderNo: order_no
|
|
369
|
+
}), form);
|
|
370
|
+
wdtInfo = kmkf_utils_1.wdtOrderTransform(__assign(__assign({}, wdtOrders), {
|
|
371
|
+
componentList: templateDetail.componentDtoList,
|
|
372
|
+
orderNo: order_no
|
|
373
|
+
}), form);
|
|
374
|
+
kmInfo = kmkf_utils_1.kmOrderTransform(__assign(__assign({}, kmOrders), {
|
|
375
|
+
order_no: order_no,
|
|
376
|
+
componentList: templateDetail.componentDtoList
|
|
377
|
+
}), form);
|
|
378
|
+
gyInfo = kmkf_utils_1.gyOrderTransform(__assign(__assign({}, gyOrders), {
|
|
379
|
+
componentList: templateDetail.componentDtoList,
|
|
380
|
+
orderNo: order_no
|
|
381
|
+
}), form);
|
|
382
|
+
if (((_x = bsOrders === null || bsOrders === void 0 ? void 0 : bsOrders.orders) === null || _x === void 0 ? void 0 : _x.length) > 1) {
|
|
383
|
+
bsInfo.bsGoods = __assign(__assign({}, bsInfo.bsGoods), {
|
|
384
|
+
bsGoods: []
|
|
385
|
+
});
|
|
386
|
+
bsInfo.bsLogistics = [{
|
|
387
|
+
logisticsCompany: null,
|
|
388
|
+
logisticsCode: ''
|
|
389
|
+
}];
|
|
390
|
+
bsInfo.bsSendGood = [{
|
|
391
|
+
sendId: '',
|
|
392
|
+
sendName: ''
|
|
393
|
+
}];
|
|
394
|
+
bsInfo.bsDeliveryNo = [{
|
|
395
|
+
deliveryNo: ''
|
|
396
|
+
}];
|
|
397
|
+
}
|
|
398
|
+
if (((_y = bsE3Orders === null || bsE3Orders === void 0 ? void 0 : bsE3Orders.orderList) === null || _y === void 0 ? void 0 : _y.length) > 1) {
|
|
399
|
+
bsE3Info.bsE3Goods = __assign(__assign({}, bsE3Info.bsE3Goods), {
|
|
400
|
+
bsE3Goods: []
|
|
401
|
+
});
|
|
402
|
+
// bsInfo.bsLogistics = [{ logisticsCompany: null, logisticsCode: '' }];
|
|
403
|
+
// bsInfo.bsSendGood = [{ sendId: '', sendName: '' }];
|
|
404
|
+
// bsInfo.bsDeliveryNo = [{ deliveryNo: '' }];
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
if (((_z = wlnOrders === null || wlnOrders === void 0 ? void 0 : wlnOrders.orders) === null || _z === void 0 ? void 0 : _z.length) > 1) {
|
|
408
|
+
wlnInfo.wlnGoods = __assign(__assign({}, wlnInfo.wlnGoods), {
|
|
409
|
+
wlnGoods: []
|
|
410
|
+
});
|
|
411
|
+
wlnInfo.wlnLogistics = [{
|
|
412
|
+
logisticsCompany: null,
|
|
413
|
+
logisticsCode: ''
|
|
414
|
+
}];
|
|
415
|
+
wlnInfo.wlnSendGood = [{
|
|
416
|
+
sendId: '',
|
|
417
|
+
sendName: ''
|
|
418
|
+
}];
|
|
419
|
+
}
|
|
420
|
+
if (((_0 = wdtOrders === null || wdtOrders === void 0 ? void 0 : wdtOrders.trades) === null || _0 === void 0 ? void 0 : _0.length) > 1) {
|
|
421
|
+
wdtInfo.wdtGoods = __assign(__assign({}, wdtInfo.wdtGoods), {
|
|
422
|
+
wdtGoods: [],
|
|
423
|
+
orders: []
|
|
424
|
+
});
|
|
425
|
+
wdtInfo.wdtLogistics = [{
|
|
426
|
+
logisticsCompany: null,
|
|
427
|
+
logisticsCode: ''
|
|
428
|
+
}];
|
|
429
|
+
wdtInfo.wdtSendGood = [{
|
|
430
|
+
sendId: '',
|
|
431
|
+
sendName: ''
|
|
432
|
+
}];
|
|
433
|
+
// wdtInfo.wdtDeliveryNo = [{ deliveryNo: '' }];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
if (((_1 = gyOrders === null || gyOrders === void 0 ? void 0 : gyOrders.trades) === null || _1 === void 0 ? void 0 : _1.length) > 1) {
|
|
437
|
+
console.log('触发---orders--2');
|
|
438
|
+
gyInfo.gyGoods = __assign(__assign({}, gyInfo.gyGoods), {
|
|
439
|
+
gyGoods: [],
|
|
440
|
+
orders: []
|
|
441
|
+
});
|
|
442
|
+
// gyInfo.gyLogistics = [{ logisticsCompany: null, logisticsCode: '' }];
|
|
443
|
+
gyInfo.gySendGood = [{
|
|
444
|
+
sendId: '',
|
|
445
|
+
sendName: ''
|
|
446
|
+
}];
|
|
447
|
+
}
|
|
448
|
+
if (((_2 = kmOrders === null || kmOrders === void 0 ? void 0 : kmOrders.orderDetailDtoList) === null || _2 === void 0 ? void 0 : _2.length) > 1) {
|
|
449
|
+
kmInfo.kmSendGood = [{
|
|
450
|
+
sendId: '',
|
|
451
|
+
sendName: ''
|
|
452
|
+
}];
|
|
453
|
+
}
|
|
454
|
+
formValue = form.getFieldsValue();
|
|
455
|
+
detail = __assign(__assign({}, orderInfo), {
|
|
456
|
+
jstItemList: jstInfo,
|
|
457
|
+
bsOrder: bsInfo,
|
|
458
|
+
wlnOrder: wlnInfo,
|
|
459
|
+
wdtOrder: wdtInfo,
|
|
460
|
+
bsE3Order: bsE3Info,
|
|
461
|
+
kmOrder: kmInfo,
|
|
462
|
+
gyOrder: gyInfo
|
|
463
|
+
});
|
|
464
|
+
//抖音数据特殊处理
|
|
465
|
+
if (shopSourceStr === 'FXG') {
|
|
466
|
+
detail = updateDYDetails(detail);
|
|
467
|
+
} else if (shopSourceStr === 'SPH' || shopSourceStr === 'WXXD') {
|
|
468
|
+
detail = updateSPHDetails(detail);
|
|
469
|
+
}
|
|
470
|
+
hasSelectItem = exports.HasErpItemSelectHandle(templateDetail);
|
|
471
|
+
erpPromiseList_1 = [];
|
|
472
|
+
if (!(shopSourceStr === 'TAOBAO' && hasSelectItem)) return [3 /*break*/, 6];
|
|
473
|
+
list = detail['itemList'];
|
|
474
|
+
promises = list === null || list === void 0 ? void 0 : list.map(function (item) {
|
|
475
|
+
var _a, _b;
|
|
476
|
+
return ((_a = item === null || item === void 0 ? void 0 : item.skuInfoDTO) === null || _a === void 0 ? void 0 : _a.skuId) ? kmkf_utils_1.request({
|
|
477
|
+
url: '/qy/gdfw/erp/getSupplierInfo',
|
|
478
|
+
method: 'get',
|
|
479
|
+
data: {
|
|
480
|
+
itemId: item.numIid,
|
|
481
|
+
skuId: (_b = item === null || item === void 0 ? void 0 : item.skuInfoDTO) === null || _b === void 0 ? void 0 : _b.skuId,
|
|
482
|
+
userNick: thirdUserNick
|
|
483
|
+
}
|
|
484
|
+
}) : new Promise(function (resolve) {
|
|
485
|
+
resolve({});
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
_4.label = 3;
|
|
489
|
+
case 3:
|
|
490
|
+
_4.trys.push([3, 5,, 6]);
|
|
491
|
+
return [4 /*yield*/, Promise.all(promises)];
|
|
492
|
+
case 4:
|
|
493
|
+
erpPromiseList_1 = _4.sent();
|
|
494
|
+
detail['itemList'] = (_3 = detail['itemList']) === null || _3 === void 0 ? void 0 : _3.map(function (item, index) {
|
|
495
|
+
return __assign(__assign({}, item), {
|
|
496
|
+
skuInfoDTO: __assign(__assign({}, item.skuInfoDTO), {
|
|
497
|
+
itemId: lodash_1.get(erpPromiseList_1, index + ".data.0.supplierItemOuterId", ''),
|
|
498
|
+
supplierName: lodash_1.get(erpPromiseList_1, index + ".data.0.supplierName", '')
|
|
499
|
+
})
|
|
500
|
+
});
|
|
501
|
+
});
|
|
502
|
+
return [3 /*break*/, 6];
|
|
503
|
+
case 5:
|
|
504
|
+
e_1 = _4.sent();
|
|
505
|
+
console.error('调用erp获取宝贝编码错误', e_1);
|
|
506
|
+
return [3 /*break*/, 6];
|
|
507
|
+
case 6:
|
|
508
|
+
values = kmkf_utils_1.orderBackFormValues({
|
|
509
|
+
detail: detail,
|
|
510
|
+
order_no: order_no,
|
|
511
|
+
formValue: formValue,
|
|
512
|
+
templateDetail: templateDetail,
|
|
513
|
+
type: type,
|
|
514
|
+
fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo
|
|
515
|
+
});
|
|
516
|
+
console.log('formValue', formValue);
|
|
517
|
+
console.log('values', values);
|
|
518
|
+
//新建的情况下订单返填不能清空打款信息
|
|
519
|
+
if (type !== 'edit') {
|
|
520
|
+
paymentUniqueKey = exports.findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, 'ENTERPRISE_PAYMENT');
|
|
521
|
+
if (paymentUniqueKey && orderInfo) {
|
|
522
|
+
values[paymentUniqueKey] = __assign(__assign(__assign({}, formValue[paymentUniqueKey]), values[paymentUniqueKey]), {
|
|
523
|
+
enterprisePaymentTid: order_no
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
//缓存订单返填的信息,用来解决用户保存显隐返填组件,二次编辑订单信息丢失
|
|
527
|
+
if (plat === null || plat === void 0 ? void 0 : plat.subOrderNo) {
|
|
528
|
+
cacheOrderInfo = JSON.parse(sessionStorage.getItem('cacheOmsOrderInfo') || '{}');
|
|
529
|
+
sessionStorage.setItem('cacheOmsOrderInfo', JSON.stringify(__assign(__assign({}, cacheOrderInfo), (_g = {}, _g[templateDetail.flowTemplateConfig.flowTemplateId + "-" + plat.buyerId] = (_h = {}, _h[plat === null || plat === void 0 ? void 0 : plat.subOrderNo] = __assign(__assign({}, formValue), values), _h), _g))));
|
|
530
|
+
} else {
|
|
531
|
+
cacheOrderInfo = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
|
|
532
|
+
sessionStorage.setItem('cacheOrderInfo', JSON.stringify(__assign(__assign({}, cacheOrderInfo), (_j = {}, _j[order_no] = values, _j[templateDetail.flowTemplateConfig.flowTemplateId + "-" + plat.buyerId] = (_k = {}, _k[order_no] = __assign(__assign({}, formValue), values), _k), _j))));
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
// console.log('orderback', values);
|
|
536
|
+
form.setFieldsValue(__assign(__assign({}, formValue), values));
|
|
537
|
+
callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
|
|
538
|
+
return [3 /*break*/, 8];
|
|
539
|
+
case 7:
|
|
540
|
+
e_2 = _4.sent();
|
|
541
|
+
console.error(e_2);
|
|
542
|
+
return [3 /*break*/, 8];
|
|
543
|
+
case 8:
|
|
544
|
+
return [2 /*return*/];
|
|
545
|
+
}
|
|
546
|
+
});
|
|
547
|
+
});
|
|
548
|
+
};
|
|
549
|
+
//抖音平台数据处理
|
|
550
|
+
var updateDYDetails = function updateDYDetails(value) {
|
|
551
|
+
var details = __assign({}, value);
|
|
552
|
+
//处理地址
|
|
553
|
+
if (details['provinceCode']) {
|
|
554
|
+
//直辖市区特殊处理
|
|
555
|
+
var addList = ['110000', '120000', '310000', '500000'];
|
|
556
|
+
if (addList.includes(details.provinceCode)) {
|
|
557
|
+
var cityCode = details['cityCode'];
|
|
558
|
+
var newCity = cityCode.split('');
|
|
559
|
+
newCity[3] = '1';
|
|
560
|
+
details['cityCode'] = newCity.join('');
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
//处理时间
|
|
564
|
+
var times = ['orderClosingDateTime', 'orderCreateDateTime', 'orderDeliveryDateTime', 'orderPaymentDateTime'];
|
|
565
|
+
times.forEach(function (item) {
|
|
566
|
+
if (details[item]) {
|
|
567
|
+
details[item] = moment_1["default"](details[item]).format('YYYY-MM-DD HH:mm:ss');
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
// //快递处理
|
|
571
|
+
// const expressList = ['expressLogisticsCompany', 'returnLogisticsCompany'];
|
|
572
|
+
// const QYallFormatExpressData: any = ExpressData.getInstance().getExpressData();
|
|
573
|
+
// expressList.forEach((item) => {
|
|
574
|
+
// if (details[item]) {
|
|
575
|
+
// const form = QYallFormatExpressData.find((t: any) => {
|
|
576
|
+
// return t.label === details[item];
|
|
577
|
+
// });
|
|
578
|
+
// form ? (details[item] = form?.value) : (details[item] = '');
|
|
579
|
+
// }
|
|
580
|
+
// });
|
|
581
|
+
return details;
|
|
582
|
+
};
|
|
583
|
+
//视屏号
|
|
584
|
+
var updateSPHDetails = function updateSPHDetails(value) {
|
|
585
|
+
var details = __assign({}, value);
|
|
586
|
+
details['province'] = kmkf_utils_1.AddressData.getInstance().getProCodeByName(details.province);
|
|
587
|
+
details['city'] = kmkf_utils_1.AddressData.getInstance().getProCodeByName(details.city);
|
|
588
|
+
details['district'] = kmkf_utils_1.AddressData.getInstance().getProCodeByName(details.town);
|
|
589
|
+
return details;
|
|
590
|
+
};
|
|
591
|
+
//图片压缩
|
|
592
|
+
exports.imgResize = function (url, w, h) {
|
|
593
|
+
if (w === void 0) {
|
|
594
|
+
w = 60;
|
|
595
|
+
}
|
|
596
|
+
if (h === void 0) {
|
|
597
|
+
h = 60;
|
|
598
|
+
}
|
|
599
|
+
var modifyUrl = url.startsWith('/') ? url : "/" + url;
|
|
600
|
+
if (w === 0 || h === 0) {
|
|
601
|
+
return "https://kefu.kuaimai.com" + modifyUrl;
|
|
602
|
+
}
|
|
603
|
+
return "https://kefu.kuaimai.com" + modifyUrl + "?x-oss-process=image/resize,h_" + h + ",w_" + w;
|
|
604
|
+
};
|
|
605
|
+
//重复校验数据映射字段
|
|
606
|
+
exports.COMPONENT_MAP = {
|
|
607
|
+
tradeId: 'TRADE_ID_INPUT',
|
|
608
|
+
buyerNick: 'BUYER_NICK_INPUT',
|
|
609
|
+
receiveMobile: 'RECEIVER_MOBILE_INPUT',
|
|
610
|
+
alipayAccount: 'ALI_PAY_INPUT',
|
|
611
|
+
expressLogisticsCode: 'EXPRESS_LOGISTICS_SELECT',
|
|
612
|
+
enterprisePaymentTid: 'ENTERPRISE_PAYMENT',
|
|
613
|
+
enterprisePaymentAlipayNo: 'ENTERPRISE_PAYMENT'
|
|
614
|
+
};
|
|
615
|
+
exports.COMPONENT_MAP_NAME = {
|
|
616
|
+
tradeId: '订单号',
|
|
617
|
+
buyerNick: '买家昵称',
|
|
618
|
+
receiveMobile: '收件人手机号',
|
|
619
|
+
alipayAccount: '支付宝账号',
|
|
620
|
+
enterprisePaymentAlipayNo: '支付宝账号',
|
|
621
|
+
expressLogisticsCode: '快递物流单号',
|
|
622
|
+
enterprisePaymentTid: '打款订单号'
|
|
623
|
+
};
|
|
624
|
+
exports.EXCLUDE_REPLACE_TOP_COMPONENT = ['enterprisePaymentAlipayNo', 'enterprisePaymentTid'];
|
|
625
|
+
exports.INNER_REPLACE_COMPONENT = ['enterprisePaymentAlipayNo', 'enterprisePaymentTid'];
|
|
626
|
+
//数据唯一性校验提交数据组装
|
|
627
|
+
exports.getReplaceWarnValues = function (templateDetail, keyValues) {
|
|
628
|
+
return templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList.reduce(function (prv, next) {
|
|
629
|
+
Object.keys(keyValues).forEach(function (key) {
|
|
630
|
+
if (exports.COMPONENT_MAP[key] === next.workOrderComponentType) {
|
|
631
|
+
var componentConfig = next.componentConfig;
|
|
632
|
+
if ((componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.replaceWarn) && keyValues[key]) {
|
|
633
|
+
if (keyValues[key].indexOf('*') < 0) {
|
|
634
|
+
prv.push({
|
|
635
|
+
componentKey: next.uniqueKey + "_" + key,
|
|
636
|
+
componentValue: keyValues[key]
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
});
|
|
642
|
+
return prv;
|
|
643
|
+
}, []);
|
|
644
|
+
};
|
|
645
|
+
//聚水潭订单返填
|
|
646
|
+
exports.HasFilterHandle = function (templateDetail, filterList) {
|
|
647
|
+
if (templateDetail === void 0) {
|
|
648
|
+
templateDetail = {
|
|
649
|
+
componentDtoList: []
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
return templateDetail.componentDtoList.some(function (item) {
|
|
653
|
+
return filterList.includes(item.workOrderComponentType);
|
|
654
|
+
});
|
|
655
|
+
};
|
|
656
|
+
// 商品编码组件
|
|
657
|
+
exports.HasErpItemSelectHandle = function (templateDetail) {
|
|
658
|
+
if (templateDetail === void 0) {
|
|
659
|
+
templateDetail = {
|
|
660
|
+
componentDtoList: []
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
return templateDetail.componentDtoList.some(function (item) {
|
|
664
|
+
return ['ITEM_SELECT_THIRD'].includes(item.workOrderComponentType);
|
|
665
|
+
});
|
|
666
|
+
};
|
|
667
|
+
exports.platformMap = {
|
|
668
|
+
tb: '淘宝',
|
|
669
|
+
fxg: '抖音',
|
|
670
|
+
ks: '快手',
|
|
671
|
+
pdd: '拼多多',
|
|
672
|
+
jd: '京东',
|
|
673
|
+
xiaozhi: '小智',
|
|
674
|
+
pc: '客服工作台'
|
|
675
|
+
};
|
|
676
|
+
exports.submitParams = function (_a) {
|
|
677
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1;
|
|
678
|
+
var update = _a.update,
|
|
679
|
+
formData = _a.formData,
|
|
680
|
+
currentNodeDetail = _a.currentNodeDetail,
|
|
681
|
+
plat = _a.plat,
|
|
682
|
+
operateParams = _a.operateParams,
|
|
683
|
+
shopUniqueKey = _a.shopUniqueKey;
|
|
684
|
+
var newTemplateDetail = lodash_1.cloneDeep(currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) || {};
|
|
685
|
+
var params = {
|
|
686
|
+
isAdd: !update,
|
|
687
|
+
operateParams: __assign({
|
|
688
|
+
nodeId: (_b = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.nodeInfo) === null || _b === void 0 ? void 0 : _b.id
|
|
689
|
+
}, operateParams)
|
|
690
|
+
};
|
|
691
|
+
if (update) {
|
|
692
|
+
params.updateInfo = {
|
|
693
|
+
templateId: (_c = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _c === void 0 ? void 0 : _c.templateId,
|
|
694
|
+
workOrderId: (_d = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _d === void 0 ? void 0 : _d.id,
|
|
695
|
+
updateTime: (_e = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _e === void 0 ? void 0 : _e.update
|
|
696
|
+
};
|
|
697
|
+
params.workOrderUpdateKeyVos = {
|
|
698
|
+
// 这个参数在submitDataTransOldFormat中使用到
|
|
699
|
+
workOrderId: (_f = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _f === void 0 ? void 0 : _f.id,
|
|
700
|
+
workOrderUpdateKeySupVos: []
|
|
701
|
+
};
|
|
702
|
+
var submitData = submitDataTransOldFormat_1["default"](formData, newTemplateDetail, !!((_g = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _g === void 0 ? void 0 : _g.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params, plat.accountName);
|
|
703
|
+
var updateList = submitData === null || submitData === void 0 ? void 0 : submitData.reduce(function (cur, nxt) {
|
|
704
|
+
var _a;
|
|
705
|
+
(_a = nxt === null || nxt === void 0 ? void 0 : nxt.contentList) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
|
706
|
+
var newOldContent = lodash_1.cloneDeep(item.oldContent);
|
|
707
|
+
if (kmkf_utils_1.unTransField(item.uniqueKey)) {
|
|
708
|
+
try {
|
|
709
|
+
newOldContent = JSON.parse(newOldContent);
|
|
710
|
+
} catch (e) {
|
|
711
|
+
console.error('error');
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
if (kmkf_utils_1.isNull(newOldContent) && kmkf_utils_1.isNull(item.content)) return;
|
|
715
|
+
if (newOldContent == item.content) return;
|
|
716
|
+
if (!lodash_1.isEqual(newOldContent, item.content)) {
|
|
717
|
+
cur.push({
|
|
718
|
+
dataKey: item.uniqueKey,
|
|
719
|
+
name: item.name,
|
|
720
|
+
oldValue: item.oldContent,
|
|
721
|
+
dataValue: item.content
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
return cur;
|
|
726
|
+
}, []);
|
|
727
|
+
// 数据第一次更新
|
|
728
|
+
if (update && ((_h = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _h === void 0 ? void 0 : _h.preCreateAndNotModified)) {
|
|
729
|
+
updateList.push({
|
|
730
|
+
dataKey: 'preCreateAndNotModified',
|
|
731
|
+
oldValue: true,
|
|
732
|
+
dataValue: false
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
params.updateInfo.updateList = updateList;
|
|
736
|
+
params.updateInfo.needTransForm = params.needTransForm;
|
|
737
|
+
delete params.workOrderUpdateKeyVos;
|
|
738
|
+
delete params.needTransForm;
|
|
739
|
+
} else {
|
|
740
|
+
// TODO: 新保存工单
|
|
741
|
+
// 获取当前表单中非空字段
|
|
742
|
+
var finalComponentList_1 = (_j = Object.keys(formData)) === null || _j === void 0 ? void 0 : _j.filter(function (i) {
|
|
743
|
+
return !kmkf_utils_1.isNull(formData[i]);
|
|
744
|
+
});
|
|
745
|
+
// 获取非空字段对应的组件
|
|
746
|
+
var finalDtoList = (_l = (_k = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) === null || _k === void 0 ? void 0 : _k.componentDtoList) === null || _l === void 0 ? void 0 : _l.filter(function (item) {
|
|
747
|
+
return finalComponentList_1.includes(item.uniqueKey) || item.workOrderComponentType === 'BUYER_MESSAGE_NOTICE';
|
|
748
|
+
});
|
|
749
|
+
lodash_1.set(newTemplateDetail, 'componentDtoList', finalDtoList);
|
|
750
|
+
params.workOrder = {
|
|
751
|
+
templateId: (_m = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) === null || _m === void 0 ? void 0 : _m.uniqueKey,
|
|
752
|
+
handleWorkOrderId: (_o = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _o === void 0 ? void 0 : _o.id,
|
|
753
|
+
buyerNick: plat === null || plat === void 0 ? void 0 : plat.buyerNick,
|
|
754
|
+
buyerOpenUid: plat === null || plat === void 0 ? void 0 : plat.buyerId,
|
|
755
|
+
shopUniqueKey: shopUniqueKey,
|
|
756
|
+
tid: plat === null || plat === void 0 ? void 0 : plat.orderNo,
|
|
757
|
+
workOrderComponents: [],
|
|
758
|
+
source: lodash_1.get(exports.platformMap, "" + (plat === null || plat === void 0 ? void 0 : plat.platform), '工单通')
|
|
759
|
+
};
|
|
760
|
+
// 判断是否有订单号组建,订单号数据需要特殊处理
|
|
761
|
+
var tradeIdUniqueKey = (_r = (_q = (_p = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) === null || _p === void 0 ? void 0 : _p.componentDtoList) === null || _q === void 0 ? void 0 : _q.find(function (item) {
|
|
762
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
763
|
+
})) === null || _r === void 0 ? void 0 : _r.uniqueKey;
|
|
764
|
+
// 判断是否有订单号组建,订单号数据需要特殊处理
|
|
765
|
+
var paymentTradeIdUniqueKey = (_u = (_t = (_s = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) === null || _s === void 0 ? void 0 : _s.componentDtoList) === null || _t === void 0 ? void 0 : _t.find(function (item) {
|
|
766
|
+
return item.workOrderComponentType === 'ENTERPRISE_PAYMENT';
|
|
767
|
+
})) === null || _u === void 0 ? void 0 : _u.uniqueKey;
|
|
768
|
+
// 判断是否有买家昵称或者
|
|
769
|
+
var buyerNickUniqueKey = (_x = (_w = (_v = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo) === null || _v === void 0 ? void 0 : _v.componentDtoList) === null || _w === void 0 ? void 0 : _w.find(function (item) {
|
|
770
|
+
return item.workOrderComponentType === 'BUYER_NICK_INPUT';
|
|
771
|
+
})) === null || _x === void 0 ? void 0 : _x.uniqueKey;
|
|
772
|
+
if (paymentTradeIdUniqueKey) {
|
|
773
|
+
params.workOrder.tid = (_y = formData === null || formData === void 0 ? void 0 : formData["" + paymentTradeIdUniqueKey]) === null || _y === void 0 ? void 0 : _y.enterprisePaymentTid;
|
|
774
|
+
params.workOrder.buyerOpenUid = (_z = formData === null || formData === void 0 ? void 0 : formData["" + paymentTradeIdUniqueKey]) === null || _z === void 0 ? void 0 : _z.enterprisePaymentBuyerOpenUid;
|
|
775
|
+
}
|
|
776
|
+
if (tradeIdUniqueKey) {
|
|
777
|
+
params.workOrder.tid = formData === null || formData === void 0 ? void 0 : formData[tradeIdUniqueKey];
|
|
778
|
+
}
|
|
779
|
+
if (buyerNickUniqueKey) {
|
|
780
|
+
params.workOrder.buyerOpenUid = (_0 = formData === null || formData === void 0 ? void 0 : formData[buyerNickUniqueKey]) === null || _0 === void 0 ? void 0 : _0.buyerOpenUid;
|
|
781
|
+
}
|
|
782
|
+
params.workOrder.workOrderComponents = submitDataTransOldFormat_1["default"](formData, newTemplateDetail, !!((_1 = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder) === null || _1 === void 0 ? void 0 : _1.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params.workOrder, (plat === null || plat === void 0 ? void 0 : plat.accountName) || '');
|
|
783
|
+
//端上有买家id 就返填当前买家 即使不是当前买家的订单
|
|
784
|
+
if (plat.platform !== types_1.PlatForm.PC && (plat === null || plat === void 0 ? void 0 : plat.buyerId)) {
|
|
785
|
+
params.workOrder.buyerOpenUid = plat === null || plat === void 0 ? void 0 : plat.buyerId;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
return params;
|
|
789
|
+
};
|
|
790
|
+
//表单提交校验
|
|
791
|
+
exports.verifyHandle = function (data, componentDtoList) {
|
|
792
|
+
var _a, _b, _c, _d;
|
|
793
|
+
var res = {
|
|
794
|
+
success: true,
|
|
795
|
+
message: ''
|
|
796
|
+
};
|
|
797
|
+
var tradeIdUniqueKey = (_a = componentDtoList.find(function (item) {
|
|
798
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
799
|
+
})) === null || _a === void 0 ? void 0 : _a.uniqueKey;
|
|
800
|
+
var paymentUniqueKey = (_b = componentDtoList.find(function (item) {
|
|
801
|
+
return item.workOrderComponentType === 'ENTERPRISE_PAYMENT';
|
|
802
|
+
})) === null || _b === void 0 ? void 0 : _b.uniqueKey;
|
|
803
|
+
if (tradeIdUniqueKey && paymentUniqueKey && data[tradeIdUniqueKey] && ((_c = data[paymentUniqueKey]) === null || _c === void 0 ? void 0 : _c.enterprisePaymentTid) && data[tradeIdUniqueKey] != ((_d = data[paymentUniqueKey]) === null || _d === void 0 ? void 0 : _d.enterprisePaymentTid)) {
|
|
804
|
+
res.success = false;
|
|
805
|
+
res.message = '订单组件和打款组件的订单号必须一致';
|
|
806
|
+
}
|
|
807
|
+
return res;
|
|
808
|
+
};
|
|
809
|
+
//将表单字段转回提交字段的格式
|
|
810
|
+
exports.reversalFormValues = function (templateList, values) {
|
|
811
|
+
if (templateList === void 0) {
|
|
812
|
+
templateList = [];
|
|
813
|
+
}
|
|
814
|
+
return templateList.reduce(function (prv, next) {
|
|
815
|
+
var _a, _b, _c, _d, _e, _f;
|
|
816
|
+
if (!(values === null || values === void 0 ? void 0 : values[next.uniqueKey])) {
|
|
817
|
+
return prv;
|
|
818
|
+
}
|
|
819
|
+
switch (next.workOrderComponentType) {
|
|
820
|
+
case 'BS_SIGNING_TIME':
|
|
821
|
+
prv[next.uniqueKey + "_bsSigningTime"] = values[next.uniqueKey];
|
|
822
|
+
break;
|
|
823
|
+
case 'BS_SEND_TIME':
|
|
824
|
+
prv[next.uniqueKey + "_bsSendTime"] = values[next.uniqueKey];
|
|
825
|
+
break;
|
|
826
|
+
case 'BS_TRADE_PAYMENT_TIME':
|
|
827
|
+
prv[next.uniqueKey + "_bsTradePaymentTime"] = values[next.uniqueKey];
|
|
828
|
+
break;
|
|
829
|
+
case 'BS_NET_RECEIPTS':
|
|
830
|
+
prv[next.uniqueKey + "_bsNetReceipts"] = values[next.uniqueKey];
|
|
831
|
+
break;
|
|
832
|
+
case 'BS_PACKAGE_WEIGHT':
|
|
833
|
+
prv[next.uniqueKey + "_bsPackageWeight"] = values[next.uniqueKey];
|
|
834
|
+
break;
|
|
835
|
+
case 'BS_DEPOSIT':
|
|
836
|
+
prv[next.uniqueKey + "_bsDeposit"] = values[next.uniqueKey];
|
|
837
|
+
break;
|
|
838
|
+
case 'BS_LOGISTICS':
|
|
839
|
+
prv[next.uniqueKey + "_bsLogisticsList"] = JSON.stringify(values[next.uniqueKey] || []);
|
|
840
|
+
break;
|
|
841
|
+
case 'BS_SEND_GOOD':
|
|
842
|
+
prv[next.uniqueKey + "_bsSendGood"] = JSON.stringify(values[next.uniqueKey] || []);
|
|
843
|
+
break;
|
|
844
|
+
case 'BS_POSTING':
|
|
845
|
+
prv[next.uniqueKey + "_bsPostingProvince"] = (_b = (_a = values[next.uniqueKey]) === null || _a === void 0 ? void 0 : _a['postingAddress']) === null || _b === void 0 ? void 0 : _b[0];
|
|
846
|
+
prv[next.uniqueKey + "_bsPostingCity"] = (_d = (_c = values[next.uniqueKey]) === null || _c === void 0 ? void 0 : _c['postingAddress']) === null || _d === void 0 ? void 0 : _d[1];
|
|
847
|
+
prv[next.uniqueKey + "_bsPostingDistrict"] = (_f = (_e = values[next.uniqueKey]) === null || _e === void 0 ? void 0 : _e['postingAddress']) === null || _f === void 0 ? void 0 : _f[2];
|
|
848
|
+
prv[next.uniqueKey + "_bsPostingDetail"] = values[next.uniqueKey]['postingDetail'];
|
|
849
|
+
prv[next.uniqueKey + "_bsPostingReceiverName"] = values[next.uniqueKey]['postingReceiverName'];
|
|
850
|
+
prv[next.uniqueKey + "_bsPostingReceiverMobile"] = values[next.uniqueKey]['postingReceiverMobile'];
|
|
851
|
+
break;
|
|
852
|
+
case 'BS_GOODS':
|
|
853
|
+
prv[next.uniqueKey + "_bsGoods"] = JSON.stringify(values[next.uniqueKey]['bsGoods']);
|
|
854
|
+
prv[next.uniqueKey + "_shopCode"] = values[next.uniqueKey]['shopCode'];
|
|
855
|
+
break;
|
|
856
|
+
case 'BS_REISSUE_GOODS':
|
|
857
|
+
case 'BS_EXCHANGE_GOODS':
|
|
858
|
+
case 'BS_RETURN_GOODS':
|
|
859
|
+
case 'WDT_REISSUE_GOODS':
|
|
860
|
+
case 'WDT_RETURN_GOODS':
|
|
861
|
+
case 'WDT_EXCHANGE_GOODS':
|
|
862
|
+
case 'GY_REISSUE_GOODS':
|
|
863
|
+
prv[next.uniqueKey + "_shopCode"] = values[next.uniqueKey]['shopCode'];
|
|
864
|
+
break;
|
|
865
|
+
case 'BS_DELIVERY_NO':
|
|
866
|
+
prv[next.uniqueKey + "_deliveryNoList"] = JSON.stringify(values[next.uniqueKey] || []);
|
|
867
|
+
break;
|
|
868
|
+
case 'RETURN_GOODS_TRADE_ID':
|
|
869
|
+
prv[next.uniqueKey + "_returnGoodsTradeItemList"] = JSON.stringify(values[next.uniqueKey] || []);
|
|
870
|
+
break;
|
|
871
|
+
case 'REISSUE_TRADE_ID':
|
|
872
|
+
prv[next.uniqueKey + "_tradeItemList"] = JSON.stringify(values[next.uniqueKey] || []);
|
|
873
|
+
break;
|
|
874
|
+
case 'EXCHANGE_TRADE_ID':
|
|
875
|
+
prv[next.uniqueKey + "_tradeItemList"] = JSON.stringify(values[next.uniqueKey] || []);
|
|
876
|
+
break;
|
|
877
|
+
case 'WDT_GOODS':
|
|
878
|
+
prv[next.uniqueKey + "_wdtGoods"] = JSON.stringify(values[next.uniqueKey]['wdtGoods']);
|
|
879
|
+
prv[next.uniqueKey + "_shopCode"] = values[next.uniqueKey]['shopCode'];
|
|
880
|
+
break;
|
|
881
|
+
case 'BS_E3_GOODS':
|
|
882
|
+
prv[next.uniqueKey + "_bsE3Goods"] = JSON.stringify(values[next.uniqueKey]['_bsE3Goods']);
|
|
883
|
+
prv[next.uniqueKey + "_shopCode"] = values[next.uniqueKey]['shopCode'];
|
|
884
|
+
break;
|
|
885
|
+
case 'GY_GOODS':
|
|
886
|
+
prv[next.uniqueKey + "_gyGoods"] = JSON.stringify(values[next.uniqueKey]['_gyGoods']);
|
|
887
|
+
prv[next.uniqueKey + "_shopCode"] = values[next.uniqueKey]['shopCode'];
|
|
888
|
+
break;
|
|
889
|
+
}
|
|
890
|
+
return prv;
|
|
891
|
+
}, {});
|
|
892
|
+
};
|
|
893
|
+
//删除缓存数据
|
|
894
|
+
exports.deleteCacheOrder = function (_a) {
|
|
895
|
+
var _b;
|
|
896
|
+
var _c = _a.templateList,
|
|
897
|
+
templateList = _c === void 0 ? [] : _c,
|
|
898
|
+
values = _a.values,
|
|
899
|
+
nodeId = _a.nodeId,
|
|
900
|
+
flowTemplateId = _a.flowTemplateId,
|
|
901
|
+
plat = _a.plat,
|
|
902
|
+
unDeleteOrderInfo = _a.unDeleteOrderInfo;
|
|
903
|
+
if (plat === null || plat === void 0 ? void 0 : plat.subOrderNo) {
|
|
904
|
+
var getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOmsOrderInfo') || '{}');
|
|
905
|
+
// !unDeleteOrderInfo && delete getCacheInfo[plat?.subOrderNo];
|
|
906
|
+
delete getCacheInfo[flowTemplateId + "-" + (plat === null || plat === void 0 ? void 0 : plat.buyerId)];
|
|
907
|
+
sessionStorage.setItem('cacheOmsOrderInfo', JSON.stringify(getCacheInfo));
|
|
908
|
+
} else {
|
|
909
|
+
var tradeIdUniqueKey = (_b = templateList.find(function (item) {
|
|
910
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
911
|
+
})) === null || _b === void 0 ? void 0 : _b.uniqueKey;
|
|
912
|
+
if (tradeIdUniqueKey) {
|
|
913
|
+
var tradeId = values[tradeIdUniqueKey];
|
|
914
|
+
var getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
|
|
915
|
+
!unDeleteOrderInfo && delete getCacheInfo[tradeId];
|
|
916
|
+
delete getCacheInfo[flowTemplateId + "-" + (plat === null || plat === void 0 ? void 0 : plat.buyerId)];
|
|
917
|
+
sessionStorage.setItem('cacheOrderInfo', JSON.stringify(getCacheInfo));
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
//bs商品信息返填
|
|
922
|
+
exports.bsSystemOrderBackValues = function (_a) {
|
|
923
|
+
var _b;
|
|
924
|
+
var templateList = _a.templateList,
|
|
925
|
+
value = _a.value,
|
|
926
|
+
form = _a.form;
|
|
927
|
+
//如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
|
|
928
|
+
if (!(value === null || value === void 0 ? void 0 : value.selectedRows)) return;
|
|
929
|
+
var bsGoodsComponent = (_b = templateList.componentDtoList) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
930
|
+
return ['BS_GOODS', 'BS_DELIVERY_NO', 'BS_SEND_GOOD', 'BS_LOGISTICS', 'LOGISTICS_TRAJECTORY_MORE', 'LOGISTICS_INTERCEPTION_MORE'].includes(item.workOrderComponentType);
|
|
931
|
+
});
|
|
932
|
+
if (!(bsGoodsComponent === null || bsGoodsComponent === void 0 ? void 0 : bsGoodsComponent.length)) return;
|
|
933
|
+
var bsGoodsValue = form.getFieldValue(bsGoodsComponent[0].uniqueKey);
|
|
934
|
+
var orderInfo = kmkf_utils_1.bsOrderTransform({
|
|
935
|
+
orders: value.selectedRows,
|
|
936
|
+
shopCode: bsGoodsValue.shopCode
|
|
937
|
+
});
|
|
938
|
+
var values = kmkf_utils_1.bsOrderBackFormValues(orderInfo, {
|
|
939
|
+
componentDtoList: bsGoodsComponent
|
|
940
|
+
});
|
|
941
|
+
form.setFieldsValue(values);
|
|
942
|
+
};
|
|
943
|
+
// bs e3商品信息返填
|
|
944
|
+
exports.bsE3SystemOrderBackValues = function (_a) {
|
|
945
|
+
var _b, _c;
|
|
946
|
+
var templateList = _a.templateList,
|
|
947
|
+
value = _a.value,
|
|
948
|
+
form = _a.form;
|
|
949
|
+
//如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
|
|
950
|
+
if (!(value === null || value === void 0 ? void 0 : value.selectedRows)) return;
|
|
951
|
+
var bsE3GoodsComponent = (_b = templateList.componentDtoList) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
952
|
+
return ['BS_E3_GOODS', 'BS_E3_SEND_GOOD', 'BS_E3_LOGISTICS'].includes(item.workOrderComponentType) && !item.notOrderBack;
|
|
953
|
+
});
|
|
954
|
+
if (!(bsE3GoodsComponent === null || bsE3GoodsComponent === void 0 ? void 0 : bsE3GoodsComponent.length)) return;
|
|
955
|
+
var tIdCom = (_c = templateList.componentDtoList) === null || _c === void 0 ? void 0 : _c.find(function (item) {
|
|
956
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
957
|
+
});
|
|
958
|
+
var orderNo = (tIdCom === null || tIdCom === void 0 ? void 0 : tIdCom.uniqueKey) ? form.getFieldValue(tIdCom.uniqueKey) : null;
|
|
959
|
+
var orderInfo = kmkf_utils_1.bsE3OrderTransform({
|
|
960
|
+
orderList: value.selectedRows,
|
|
961
|
+
componentList: templateList.componentDtoList,
|
|
962
|
+
orderNo: orderNo
|
|
963
|
+
}, form);
|
|
964
|
+
var values = kmkf_utils_1.bsE3OrderBackFormValues(orderInfo, {
|
|
965
|
+
componentDtoList: bsE3GoodsComponent
|
|
966
|
+
});
|
|
967
|
+
console.log('values', values);
|
|
968
|
+
form.setFieldsValue(values);
|
|
969
|
+
};
|
|
970
|
+
//wln商品信息返填
|
|
971
|
+
exports.wlnSystemOrderBackValues = function (_a) {
|
|
972
|
+
var _b;
|
|
973
|
+
var templateList = _a.templateList,
|
|
974
|
+
value = _a.value,
|
|
975
|
+
form = _a.form;
|
|
976
|
+
//如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
|
|
977
|
+
if (!(value === null || value === void 0 ? void 0 : value.selectedRows)) return;
|
|
978
|
+
var bsGoodsComponent = (_b = templateList.componentDtoList) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
979
|
+
return ['WLN_GOODS', 'WLN_SEND_GOOD', 'WLN_LOGISTICS'].includes(item.workOrderComponentType);
|
|
980
|
+
});
|
|
981
|
+
if (!(bsGoodsComponent === null || bsGoodsComponent === void 0 ? void 0 : bsGoodsComponent.length)) return;
|
|
982
|
+
var wlnGoodsValue = form.getFieldValue(bsGoodsComponent[0].uniqueKey);
|
|
983
|
+
var orderInfo = kmkf_utils_1.wlnOrderTransform({
|
|
984
|
+
orders: value.selectedRows,
|
|
985
|
+
shopCode: wlnGoodsValue.shopCode
|
|
986
|
+
});
|
|
987
|
+
var values = kmkf_utils_1.wlnOrderBackFormValues(orderInfo, {
|
|
988
|
+
componentDtoList: bsGoodsComponent
|
|
989
|
+
});
|
|
990
|
+
form.setFieldsValue(values);
|
|
991
|
+
};
|
|
992
|
+
// km 商品信息返填
|
|
993
|
+
exports.kmSystemOrderBackValues = function (_a) {
|
|
994
|
+
var _b, _c;
|
|
995
|
+
var templateList = _a.templateList,
|
|
996
|
+
value = _a.value,
|
|
997
|
+
form = _a.form;
|
|
998
|
+
//如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
|
|
999
|
+
if (!(value === null || value === void 0 ? void 0 : value.selectedRows)) return;
|
|
1000
|
+
var kmGoodsComponent = (_b = templateList.componentDtoList) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
1001
|
+
return ['KM_SEND_GOOD'].includes(item.workOrderComponentType) && !item.notOrderBack;
|
|
1002
|
+
});
|
|
1003
|
+
if (!(kmGoodsComponent === null || kmGoodsComponent === void 0 ? void 0 : kmGoodsComponent.length)) return;
|
|
1004
|
+
var tIdCom = (_c = templateList.componentDtoList) === null || _c === void 0 ? void 0 : _c.find(function (item) {
|
|
1005
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
1006
|
+
});
|
|
1007
|
+
var orderNo = (tIdCom === null || tIdCom === void 0 ? void 0 : tIdCom.uniqueKey) ? form.getFieldValue(tIdCom.uniqueKey) : null;
|
|
1008
|
+
var orderInfo = kmkf_utils_1.kmOrderTransform({
|
|
1009
|
+
trades: value.selectedRows,
|
|
1010
|
+
componentList: templateList.componentDtoList,
|
|
1011
|
+
orderNo: orderNo
|
|
1012
|
+
}, form);
|
|
1013
|
+
var values = kmkf_utils_1.kmOrderBackFormValues(orderInfo, {
|
|
1014
|
+
componentDtoList: kmGoodsComponent
|
|
1015
|
+
});
|
|
1016
|
+
form.setFieldsValue(values);
|
|
1017
|
+
};
|
|
1018
|
+
// wdt商品信息返填
|
|
1019
|
+
exports.wdtSystemOrderBackValues = function (_a) {
|
|
1020
|
+
var _b, _c;
|
|
1021
|
+
var templateList = _a.templateList,
|
|
1022
|
+
value = _a.value,
|
|
1023
|
+
form = _a.form;
|
|
1024
|
+
//如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
|
|
1025
|
+
if (!(value === null || value === void 0 ? void 0 : value.selectedRows)) return;
|
|
1026
|
+
var wdtGoodsComponent = (_b = templateList.componentDtoList) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
1027
|
+
return ['WDT_GOODS', 'WDT_DELIVERY_NO', 'WDT_SEND_GOOD', 'WDT_LOGISTICS'].includes(item.workOrderComponentType) && !item.notOrderBack;
|
|
1028
|
+
});
|
|
1029
|
+
if (!(wdtGoodsComponent === null || wdtGoodsComponent === void 0 ? void 0 : wdtGoodsComponent.length)) return;
|
|
1030
|
+
var tIdCom = (_c = templateList.componentDtoList) === null || _c === void 0 ? void 0 : _c.find(function (item) {
|
|
1031
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
1032
|
+
});
|
|
1033
|
+
var orderNo = (tIdCom === null || tIdCom === void 0 ? void 0 : tIdCom.uniqueKey) ? form.getFieldValue(tIdCom.uniqueKey) : null;
|
|
1034
|
+
// ??? 此处找到的第一个组件,value不一定包含shopCode,
|
|
1035
|
+
// 后面使用的时候要注意,不清楚为什么这么写
|
|
1036
|
+
var wdtGoodsValue = form.getFieldValue(wdtGoodsComponent[0].uniqueKey);
|
|
1037
|
+
var orderInfo = kmkf_utils_1.wdtOrderTransform({
|
|
1038
|
+
trades: value.selectedRows,
|
|
1039
|
+
shopCode: wdtGoodsValue.shopCode,
|
|
1040
|
+
componentList: templateList.componentDtoList,
|
|
1041
|
+
orderNo: orderNo
|
|
1042
|
+
}, form);
|
|
1043
|
+
var values = kmkf_utils_1.wdtOrderBackFormValues(orderInfo, {
|
|
1044
|
+
componentDtoList: wdtGoodsComponent
|
|
1045
|
+
});
|
|
1046
|
+
form.setFieldsValue(values);
|
|
1047
|
+
};
|
|
1048
|
+
//gy商品信息返填
|
|
1049
|
+
exports.gySystemOrderBackValues = function (_a) {
|
|
1050
|
+
var _b, _c;
|
|
1051
|
+
var templateList = _a.templateList,
|
|
1052
|
+
value = _a.value,
|
|
1053
|
+
form = _a.form;
|
|
1054
|
+
//如果没有选择的值不返填,会有两种情况 1.有值为空 2.没有值 为空的时候需要返填
|
|
1055
|
+
if (!(value === null || value === void 0 ? void 0 : value.selectedRows)) return;
|
|
1056
|
+
var gyGoodsComponent = (_b = templateList.componentDtoList) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
|
|
1057
|
+
return ['GY_GOODS', 'GY_SEND_GOOD'].includes(item.workOrderComponentType) && !item.notOrderBack;
|
|
1058
|
+
});
|
|
1059
|
+
if (!(gyGoodsComponent === null || gyGoodsComponent === void 0 ? void 0 : gyGoodsComponent.length)) return;
|
|
1060
|
+
var tIdCom = (_c = templateList.componentDtoList) === null || _c === void 0 ? void 0 : _c.find(function (item) {
|
|
1061
|
+
return item.workOrderComponentType === 'TRADE_ID_INPUT';
|
|
1062
|
+
});
|
|
1063
|
+
var orderNo = (tIdCom === null || tIdCom === void 0 ? void 0 : tIdCom.uniqueKey) ? form.getFieldValue(tIdCom.uniqueKey) : null;
|
|
1064
|
+
var orderInfo = kmkf_utils_1.gyOrderTransform({
|
|
1065
|
+
trades: value.selectedRows,
|
|
1066
|
+
componentList: templateList.componentDtoList,
|
|
1067
|
+
orderNo: orderNo
|
|
1068
|
+
}, form);
|
|
1069
|
+
var values = kmkf_utils_1.gyOrderBackFormValues(orderInfo, {
|
|
1070
|
+
componentDtoList: gyGoodsComponent
|
|
1071
|
+
});
|
|
1072
|
+
console.log('values', values);
|
|
1073
|
+
form.setFieldsValue(values);
|
|
1074
|
+
};
|
|
1075
|
+
//获取多级下拉最后的值
|
|
1076
|
+
var getChildValue = function getChildValue(options, keys, disabled) {
|
|
1077
|
+
if (options === void 0) {
|
|
1078
|
+
options = [];
|
|
1079
|
+
}
|
|
1080
|
+
if (keys === void 0) {
|
|
1081
|
+
keys = [];
|
|
1082
|
+
}
|
|
1083
|
+
if (disabled === void 0) {
|
|
1084
|
+
disabled = false;
|
|
1085
|
+
}
|
|
1086
|
+
var childs = [];
|
|
1087
|
+
var newKeys = keys.map(function (t) {
|
|
1088
|
+
return String(t);
|
|
1089
|
+
});
|
|
1090
|
+
function loop(list, key, disabled, childs) {
|
|
1091
|
+
var _a, _b;
|
|
1092
|
+
if (disabled === void 0) {
|
|
1093
|
+
disabled = false;
|
|
1094
|
+
}
|
|
1095
|
+
var len = list === null || list === void 0 ? void 0 : list.length;
|
|
1096
|
+
for (var i = 0; i < len; i++) {
|
|
1097
|
+
var item = lodash_1.cloneDeep(list[i]);
|
|
1098
|
+
var newDisabled = disabled;
|
|
1099
|
+
if (key.includes(String(item === null || item === void 0 ? void 0 : item.actived))) {
|
|
1100
|
+
newDisabled = true;
|
|
1101
|
+
}
|
|
1102
|
+
if (!((_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.length) && newDisabled) {
|
|
1103
|
+
childs.push(item.actived);
|
|
1104
|
+
}
|
|
1105
|
+
if ((_b = item === null || item === void 0 ? void 0 : item.children) === null || _b === void 0 ? void 0 : _b.length) {
|
|
1106
|
+
item.children = loop(item.children, key, newDisabled, childs);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
return childs;
|
|
1110
|
+
}
|
|
1111
|
+
return loop(options, newKeys, disabled, childs);
|
|
1112
|
+
};
|
|
1113
|
+
// 获取映射关系
|
|
1114
|
+
exports.getMappingConfigByTemplateDetail = function (templateDetail) {
|
|
1115
|
+
var readonlyComponents = {};
|
|
1116
|
+
var hideComponents = [];
|
|
1117
|
+
var config = {};
|
|
1118
|
+
var componentTemplateConfigVos = templateDetail.componentTemplateConfigVos;
|
|
1119
|
+
var preList = (templateDetail.preNodeComponentDtoList || []).map(function (item) {
|
|
1120
|
+
var _a, _b, _c, _d;
|
|
1121
|
+
var nodeId = item.uniqueKey.split('-')[0];
|
|
1122
|
+
var newItem = lodash_1.cloneDeep(item);
|
|
1123
|
+
newItem.componentConfig = __assign(__assign({}, newItem.componentConfig), ((_a = componentTemplateConfigVos.find(function (i) {
|
|
1124
|
+
return i.componentUniqueKey === item.uniqueKey;
|
|
1125
|
+
})) === null || _a === void 0 ? void 0 : _a.config) || {});
|
|
1126
|
+
if (((_b = newItem.componentConfig.mapping) === null || _b === void 0 ? void 0 : _b.triggerComponentKey) && newItem.componentConfig.mapping.triggerComponentKey !== 'SHOP_SELECT_MAPPING' && ((_d = (_c = newItem.componentConfig.mapping) === null || _c === void 0 ? void 0 : _c.rules) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
1127
|
+
// PS: 直接修改triggerComponentKey会报错
|
|
1128
|
+
// Cannot assign to read only property 'triggerComponentKey' of object '#<Object>'
|
|
1129
|
+
// 所以修改整个mapping
|
|
1130
|
+
// newItem.componentConfig.mapping.triggerComponentKey = `${nodeId}-${newItem.componentConfig.mapping.triggerComponentKey}`
|
|
1131
|
+
newItem.componentConfig.mapping = __assign(__assign({}, newItem.componentConfig.mapping), {
|
|
1132
|
+
triggerComponentKey: nodeId + "-" + newItem.componentConfig.mapping.triggerComponentKey
|
|
1133
|
+
});
|
|
1134
|
+
}
|
|
1135
|
+
newItem._isPreItem = true;
|
|
1136
|
+
return newItem;
|
|
1137
|
+
});
|
|
1138
|
+
__spreadArrays(templateDetail.componentDtoList, preList).forEach(function (componentDto) {
|
|
1139
|
+
var _a, _b;
|
|
1140
|
+
var mapping = componentDto.componentConfig.mapping || {};
|
|
1141
|
+
var triggerComponent = templateDetail.componentDtoList.find(function (t) {
|
|
1142
|
+
return t.uniqueKey === mapping.triggerComponentKey;
|
|
1143
|
+
});
|
|
1144
|
+
// 多级下拉处理rules数据
|
|
1145
|
+
if ((triggerComponent === null || triggerComponent === void 0 ? void 0 : triggerComponent.workOrderComponentType) === 'MULT_SELECT') {
|
|
1146
|
+
var options_1 = kmkf_utils_1.transMultSelectOptions(triggerComponent.componentConfig.options || []);
|
|
1147
|
+
if ((_a = mapping.rules) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1148
|
+
var rules = lodash_1.cloneDeep(mapping.rules).reduce(function (prv, next) {
|
|
1149
|
+
var lastTriggerValue = next.triggerValue.map(function (t) {
|
|
1150
|
+
return lodash_1.last(t);
|
|
1151
|
+
});
|
|
1152
|
+
var childValues = getChildValue(options_1, lastTriggerValue, false);
|
|
1153
|
+
prv.push.apply(prv, childValues.map(function (t) {
|
|
1154
|
+
return {
|
|
1155
|
+
currentValue: next.currentValue,
|
|
1156
|
+
triggerValue: t
|
|
1157
|
+
};
|
|
1158
|
+
}));
|
|
1159
|
+
return prv;
|
|
1160
|
+
}, []);
|
|
1161
|
+
mapping = __assign(__assign({}, componentDto.componentConfig.mapping), {
|
|
1162
|
+
rules: rules
|
|
1163
|
+
});
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
if (((_b = mapping.rules) === null || _b === void 0 ? void 0 : _b.length) && mapping.triggerComponentKey) {
|
|
1167
|
+
readonlyComponents[componentDto.uniqueKey] = {
|
|
1168
|
+
auth: mapping.auth
|
|
1169
|
+
};
|
|
1170
|
+
if (mapping.auth === 'single') {
|
|
1171
|
+
hideComponents.push(componentDto.uniqueKey);
|
|
1172
|
+
}
|
|
1173
|
+
if (componentDto._isPreItem) {
|
|
1174
|
+
return;
|
|
1175
|
+
}
|
|
1176
|
+
var rules_1 = {};
|
|
1177
|
+
mapping.rules.forEach(function (rule) {
|
|
1178
|
+
if (!rules_1[rule.triggerValue]) {
|
|
1179
|
+
rules_1[rule.triggerValue] = {};
|
|
1180
|
+
}
|
|
1181
|
+
rules_1[rule.triggerValue][componentDto.uniqueKey] = componentDto.workOrderComponentType === 'RADIO' ? {
|
|
1182
|
+
value: rule.currentValue,
|
|
1183
|
+
other: ''
|
|
1184
|
+
} : rule.currentValue;
|
|
1185
|
+
});
|
|
1186
|
+
config[mapping.triggerComponentKey] = rules_1;
|
|
1187
|
+
}
|
|
1188
|
+
});
|
|
1189
|
+
return {
|
|
1190
|
+
config: config,
|
|
1191
|
+
readonlyComponents: readonlyComponents,
|
|
1192
|
+
hideComponents: hideComponents
|
|
1193
|
+
};
|
|
1194
|
+
};
|
|
1195
|
+
// 获取映射值
|
|
1196
|
+
exports.getMappingTargetValue = function (value, type) {
|
|
1197
|
+
if (type === 'RADIO') {
|
|
1198
|
+
return value === null || value === void 0 ? void 0 : value.value;
|
|
1199
|
+
} else if (type === 'MULT_SELECT') {
|
|
1200
|
+
return lodash_1.last(value);
|
|
1201
|
+
}
|
|
1202
|
+
return value;
|
|
1203
|
+
};
|
|
1204
|
+
//转换表单信息基本数据
|
|
1205
|
+
exports.transformWorkOrderDetail = function (detail) {
|
|
1206
|
+
return Object.keys(detail).reduce(function (prv, key) {
|
|
1207
|
+
if (kmkf_utils_1.unTransField(key)) {
|
|
1208
|
+
try {
|
|
1209
|
+
prv[key] = JSON.parse(detail[key]);
|
|
1210
|
+
} catch (e) {
|
|
1211
|
+
prv[key] = detail[key];
|
|
1212
|
+
}
|
|
1213
|
+
} else {
|
|
1214
|
+
prv[key] = detail[key];
|
|
1215
|
+
}
|
|
1216
|
+
return prv;
|
|
1217
|
+
}, {});
|
|
1218
|
+
};
|
|
1219
|
+
// 返填物流轨迹信息
|
|
1220
|
+
exports.setLogisticsInfo = function (_a) {
|
|
1221
|
+
var logisticsMappingConfig = _a.logisticsMappingConfig,
|
|
1222
|
+
uniqueKey = _a.uniqueKey,
|
|
1223
|
+
workOrderComponentType = _a.workOrderComponentType,
|
|
1224
|
+
value = _a.value,
|
|
1225
|
+
form = _a.form;
|
|
1226
|
+
var values = logisticsMappingConfig.reduce(function (prv, next) {
|
|
1227
|
+
var logisticsValues = form.getFieldValue(next.uniqueKey);
|
|
1228
|
+
var componentConfig = next.componentConfig;
|
|
1229
|
+
var _a = componentConfig.logisticsMapping,
|
|
1230
|
+
companyUniqueKey = _a.companyUniqueKey,
|
|
1231
|
+
companyType = _a.companyType,
|
|
1232
|
+
codeUniqueKey = _a.codeUniqueKey,
|
|
1233
|
+
codeType = _a.codeType;
|
|
1234
|
+
if (companyUniqueKey === uniqueKey && workOrderComponentType === companyType) {
|
|
1235
|
+
if (next.workOrderComponentType === 'LOGISTICS_TRAJECTORY_MORE') {
|
|
1236
|
+
if (companyType === 'INPUT') {
|
|
1237
|
+
prv[next.uniqueKey] = [__assign(__assign({}, logisticsValues === null || logisticsValues === void 0 ? void 0 : logisticsValues[0]), {
|
|
1238
|
+
trajectoryCompany: kmkf_utils_1.ExpressData.getInstance().getExpressCodeByName(value, true)
|
|
1239
|
+
})];
|
|
1240
|
+
} else if (companyType === 'EXPRESS_LOGISTICS_SELECT') {
|
|
1241
|
+
prv[next.uniqueKey] = [__assign(__assign({}, logisticsValues === null || logisticsValues === void 0 ? void 0 : logisticsValues[0]), {
|
|
1242
|
+
trajectoryCompany: value.company,
|
|
1243
|
+
trajectoryCode: value.order
|
|
1244
|
+
})];
|
|
1245
|
+
} else if (companyType === 'BS_LOGISTICS') {
|
|
1246
|
+
prv[next.uniqueKey] = value.map(function (item) {
|
|
1247
|
+
return {
|
|
1248
|
+
trajectoryCompany: item.logisticsCompany,
|
|
1249
|
+
trajectoryCode: item.logisticsCode,
|
|
1250
|
+
trajectorySnapshot: '',
|
|
1251
|
+
trajectoryPhone: ''
|
|
1252
|
+
};
|
|
1253
|
+
});
|
|
1254
|
+
}
|
|
1255
|
+
} else if (next.workOrderComponentType === 'LOGISTICS_INTERCEPTION_MORE') {
|
|
1256
|
+
var expressInterceptData_1 = kmkf_utils_1.ExpressInterceptData.getInstance().getExpressData();
|
|
1257
|
+
if (companyType === 'INPUT') {
|
|
1258
|
+
var interceptCompany = expressInterceptData_1.find(function (item) {
|
|
1259
|
+
return item.value === value;
|
|
1260
|
+
});
|
|
1261
|
+
var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
|
|
1262
|
+
var _a;
|
|
1263
|
+
return (_a = item === null || item === void 0 ? void 0 : item.config) === null || _a === void 0 ? void 0 : _a.isDefault;
|
|
1264
|
+
});
|
|
1265
|
+
prv[next.uniqueKey] = [__assign(__assign({}, logisticsValues === null || logisticsValues === void 0 ? void 0 : logisticsValues[0]), {
|
|
1266
|
+
interceptCompany: kmkf_utils_1.ExpressData.getInstance().getExpressCodeByName(value, false),
|
|
1267
|
+
interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value
|
|
1268
|
+
})];
|
|
1269
|
+
} else if (companyType === 'EXPRESS_LOGISTICS_SELECT') {
|
|
1270
|
+
var interceptCompany = expressInterceptData_1.find(function (item) {
|
|
1271
|
+
return item.value === value;
|
|
1272
|
+
});
|
|
1273
|
+
var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
|
|
1274
|
+
var _a;
|
|
1275
|
+
return (_a = item === null || item === void 0 ? void 0 : item.config) === null || _a === void 0 ? void 0 : _a.isDefault;
|
|
1276
|
+
});
|
|
1277
|
+
prv[next.uniqueKey] = [__assign(__assign({}, logisticsValues === null || logisticsValues === void 0 ? void 0 : logisticsValues[0]), {
|
|
1278
|
+
interceptCompany: value.company,
|
|
1279
|
+
interceptCode: value.order,
|
|
1280
|
+
interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value
|
|
1281
|
+
})];
|
|
1282
|
+
} else if (companyType === 'BS_LOGISTICS') {
|
|
1283
|
+
prv[next.uniqueKey] = value.map(function (item) {
|
|
1284
|
+
var interceptCompany = expressInterceptData_1.find(function (t) {
|
|
1285
|
+
return item.logisticsCompany === t.value;
|
|
1286
|
+
});
|
|
1287
|
+
var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (t) {
|
|
1288
|
+
var _a;
|
|
1289
|
+
return (_a = t === null || t === void 0 ? void 0 : t.config) === null || _a === void 0 ? void 0 : _a.isDefault;
|
|
1290
|
+
});
|
|
1291
|
+
return {
|
|
1292
|
+
interceptCompany: item.logisticsCompany,
|
|
1293
|
+
interceptCode: item.logisticsCode,
|
|
1294
|
+
interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value,
|
|
1295
|
+
interceptSenderMobile: undefined,
|
|
1296
|
+
interceptAddress: [],
|
|
1297
|
+
interceptDetail: undefined,
|
|
1298
|
+
interceptReceiverName: undefined,
|
|
1299
|
+
interceptReceiverMobile: undefined,
|
|
1300
|
+
interceptStatus: undefined,
|
|
1301
|
+
interceptOther: undefined,
|
|
1302
|
+
interceptLogisticsSnapshot: undefined
|
|
1303
|
+
};
|
|
1304
|
+
});
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
if (codeUniqueKey === uniqueKey && workOrderComponentType === codeType) {
|
|
1309
|
+
if (next.workOrderComponentType === 'LOGISTICS_TRAJECTORY_MORE') {
|
|
1310
|
+
if (companyType === 'INPUT') {
|
|
1311
|
+
prv[next.uniqueKey] = [__assign(__assign({}, logisticsValues === null || logisticsValues === void 0 ? void 0 : logisticsValues[0]), {
|
|
1312
|
+
trajectoryCode: value
|
|
1313
|
+
})];
|
|
1314
|
+
}
|
|
1315
|
+
} else if (next.workOrderComponentType === 'LOGISTICS_INTERCEPTION_MORE') {
|
|
1316
|
+
if (companyType === 'INPUT') {
|
|
1317
|
+
prv[next.uniqueKey] = [__assign(__assign({}, logisticsValues === null || logisticsValues === void 0 ? void 0 : logisticsValues[0]), {
|
|
1318
|
+
interceptCode: value
|
|
1319
|
+
})];
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
return prv;
|
|
1324
|
+
}, {});
|
|
1325
|
+
form.setFieldsValue(values);
|
|
1326
|
+
};
|