@kmkf-fe-packages/services-components 1.24.0 → 1.25.0

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.
@@ -0,0 +1,1525 @@
1
+ "use strict";
2
+
3
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) {
5
+ return value instanceof P ? value : new P(function (resolve) {
6
+ resolve(value);
7
+ });
8
+ }
9
+ return new (P || (P = Promise))(function (resolve, reject) {
10
+ function fulfilled(value) {
11
+ try {
12
+ step(generator.next(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ }
17
+ function rejected(value) {
18
+ try {
19
+ step(generator["throw"](value));
20
+ } catch (e) {
21
+ reject(e);
22
+ }
23
+ }
24
+ function step(result) {
25
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
26
+ }
27
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
28
+ });
29
+ };
30
+ var __generator = this && this.__generator || function (thisArg, body) {
31
+ var _ = {
32
+ label: 0,
33
+ sent: function sent() {
34
+ if (t[0] & 1) throw t[1];
35
+ return t[1];
36
+ },
37
+ trys: [],
38
+ ops: []
39
+ },
40
+ f,
41
+ y,
42
+ t,
43
+ g;
44
+ return g = {
45
+ next: verb(0),
46
+ "throw": verb(1),
47
+ "return": verb(2)
48
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
49
+ return this;
50
+ }), g;
51
+ function verb(n) {
52
+ return function (v) {
53
+ return step([n, v]);
54
+ };
55
+ }
56
+ function step(op) {
57
+ if (f) throw new TypeError("Generator is already executing.");
58
+ while (_) try {
59
+ 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;
60
+ if (y = 0, t) op = [op[0] & 2, t.value];
61
+ switch (op[0]) {
62
+ case 0:
63
+ case 1:
64
+ t = op;
65
+ break;
66
+ case 4:
67
+ _.label++;
68
+ return {
69
+ value: op[1],
70
+ done: false
71
+ };
72
+ case 5:
73
+ _.label++;
74
+ y = op[1];
75
+ op = [0];
76
+ continue;
77
+ case 7:
78
+ op = _.ops.pop();
79
+ _.trys.pop();
80
+ continue;
81
+ default:
82
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
83
+ _ = 0;
84
+ continue;
85
+ }
86
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
87
+ _.label = op[1];
88
+ break;
89
+ }
90
+ if (op[0] === 6 && _.label < t[1]) {
91
+ _.label = t[1];
92
+ t = op;
93
+ break;
94
+ }
95
+ if (t && _.label < t[2]) {
96
+ _.label = t[2];
97
+ _.ops.push(op);
98
+ break;
99
+ }
100
+ if (t[2]) _.ops.pop();
101
+ _.trys.pop();
102
+ continue;
103
+ }
104
+ op = body.call(thisArg, _);
105
+ } catch (e) {
106
+ op = [6, e];
107
+ y = 0;
108
+ } finally {
109
+ f = t = 0;
110
+ }
111
+ if (op[0] & 5) throw op[1];
112
+ return {
113
+ value: op[0] ? op[1] : void 0,
114
+ done: true
115
+ };
116
+ }
117
+ };
118
+ var __spreadArrays = this && this.__spreadArrays || function () {
119
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
120
+ 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];
121
+ return r;
122
+ };
123
+ exports.__esModule = true;
124
+ exports.AlipayBill = exports.MsgContent = exports.BsSystemOrderTable = exports.FileRender = exports.BsGoodsTable = exports.BsGoodPic = exports.BsExchangeList = exports.BsGoodImage = exports.CommonOrderContent = exports.BsExpressRender = exports.JstGoodImage = exports.GoodImage = exports.ShowTotalImage = exports.showImage = exports.getFormItem = void 0;
125
+ var antd_1 = require("antd");
126
+ var react_1 = require("react");
127
+ var kmkf_utils_1 = require("@kmkf-fe-packages/kmkf-utils");
128
+ var api_1 = require("../../service/api");
129
+ var react_copy_to_clipboard_1 = require("react-copy-to-clipboard");
130
+ var index_module_less_1 = require("./index.module.less");
131
+ var default_img_png_1 = require("./img/default-img.png");
132
+ var CopyText_1 = require("../../commonComponents/CopyText");
133
+ var kmkf_utils_2 = require("@kmkf-fe-packages/kmkf-utils");
134
+ var Paragraph = antd_1.Typography.Paragraph;
135
+ exports.getFormItem = function (_a) {
136
+ var name = _a.name,
137
+ title = _a.title,
138
+ _b = _a.rules,
139
+ rules = _b === void 0 ? [] : _b,
140
+ required = _a.required,
141
+ component = _a.component;
142
+ var newRules = rules;
143
+ if (required) {
144
+ newRules = rules.concat({
145
+ required: true,
146
+ message: "\u8BF7\u8F93\u5165" + title
147
+ });
148
+ }
149
+ return react_1["default"].createElement("div", {
150
+ className: "form-item--wrap",
151
+ style: {
152
+ position: "relative"
153
+ }
154
+ }, react_1["default"].createElement(antd_1.Form.Item, {
155
+ name: name,
156
+ label: title,
157
+ rules: newRules,
158
+ className: "form-item-label--index"
159
+ }, component));
160
+ };
161
+ //图片展示
162
+ exports.showImage = function (_a) {
163
+ var item = _a.item,
164
+ type = _a.type,
165
+ index = _a.index,
166
+ showHeader = _a.showHeader;
167
+ var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== "tabao" ? item.picUrl : item.picUrl + "_40x40.jpg" : default_img_png_1["default"];
168
+ return react_1["default"].createElement("div", {
169
+ className: index_module_less_1["default"].goodImgBox,
170
+ key: index
171
+ }, type === "itemCode" && !showHeader.includes("picUrl") ? null : (item === null || item === void 0 ? void 0 : item.platform) === "taobao" ? react_1["default"].createElement("a", {
172
+ target: "_blank",
173
+ href: item.numIid ? "https://item.taobao.com/item.htm?id=" + item.numIid : "javascript:void(0);"
174
+ }, react_1["default"].createElement("img", {
175
+ style: {
176
+ width: "40px",
177
+ height: "40px",
178
+ objectFit: "contain"
179
+ },
180
+ src: picUrl
181
+ })) : react_1["default"].createElement("img", {
182
+ style: {
183
+ width: "40px",
184
+ height: "40px",
185
+ objectFit: "contain"
186
+ },
187
+ src: picUrl
188
+ }), react_1["default"].createElement("div", {
189
+ className: index_module_less_1["default"].options
190
+ }, type === "itemId" && react_1["default"].createElement(TextTool, {
191
+ title: "商品id",
192
+ text: item.numIid
193
+ }), type === "itemCode" && react_1["default"].createElement(react_1["default"].Fragment, null, showHeader.includes("title") && react_1["default"].createElement(TextTool, {
194
+ title: "商品名称",
195
+ text: item.title
196
+ }), showHeader.includes("outerId") && react_1["default"].createElement(TextTool, {
197
+ title: "商品编码",
198
+ text: item.outerId
199
+ }), showHeader.includes("numIid") && react_1["default"].createElement(TextTool, {
200
+ title: "商品id",
201
+ text: item.numIid
202
+ }), showHeader.includes("skuId") && react_1["default"].createElement(TextTool, {
203
+ title: "SKU ID",
204
+ text: item.skuId
205
+ }), showHeader.includes("outerSkuId") && react_1["default"].createElement(TextTool, {
206
+ title: "SKU 编码",
207
+ text: item.outerSkuId
208
+ }), showHeader.includes("propertiesName") && react_1["default"].createElement(TextTool, {
209
+ title: "SKU 信息",
210
+ text: item.propertiesName
211
+ })), (type === "itemThird" || type === "jstItemThird") && (item.itemId || item.supplierItemOuterId) && react_1["default"].createElement(TextTool, {
212
+ title: "供应商编码",
213
+ text: item.itemId || item.supplierItemOuterId
214
+ }), (type === "itemThird" || type === "jstItemThird") && item.supplierName && react_1["default"].createElement(TextTool, {
215
+ title: "供应商名称",
216
+ text: item.supplierName
217
+ }), type !== "itemCode" && item.propertiesName && react_1["default"].createElement(TextTool, {
218
+ title: "规格",
219
+ text: item.propertiesName
220
+ })));
221
+ };
222
+ //文字提示
223
+ var TextTool = function TextTool(_a) {
224
+ var title = _a.title,
225
+ text = _a.text;
226
+ return react_1["default"].createElement(antd_1.Tooltip, {
227
+ placement: "topLeft",
228
+ title: text
229
+ }, react_1["default"].createElement("div", {
230
+ style: {
231
+ overflow: "hidden",
232
+ whiteSpace: "nowrap",
233
+ textOverflow: "ellipsis"
234
+ }
235
+ }, title, ":", text));
236
+ };
237
+ //查看更多图片
238
+ exports.ShowTotalImage = function (_a) {
239
+ var total = _a.total,
240
+ _b = _a.allImage,
241
+ allImage = _b === void 0 ? [] : _b,
242
+ type = _a.type,
243
+ _c = _a.showHeader,
244
+ showHeader = _c === void 0 ? [] : _c;
245
+ var _d = react_1.useState(false),
246
+ visible = _d[0],
247
+ setVisible = _d[1];
248
+ return react_1["default"].createElement(react_1["default"].Fragment, null, react_1["default"].createElement(antd_1.Button, {
249
+ type: "link",
250
+ onClick: function onClick() {
251
+ return setVisible(true);
252
+ }
253
+ }, "\u67E5\u770B\u5168\u90E8(" + total + ")"), react_1["default"].createElement(antd_1.Modal, {
254
+ visible: visible,
255
+ footer: null,
256
+ onCancel: function onCancel() {
257
+ return setVisible(false);
258
+ },
259
+ title: "\u6240\u6709\u9009\u62E9\u5B9D\u8D1D"
260
+ }, react_1["default"].createElement("div", {
261
+ style: {
262
+ display: "flex",
263
+ flexWrap: "wrap"
264
+ }
265
+ }, allImage.map(function (i, index) {
266
+ return react_1["default"].createElement("div", {
267
+ style: {
268
+ width: "50%"
269
+ },
270
+ key: index
271
+ }, type === "itemCode" && !showHeader.includes("picUrl") ? null : react_1["default"].createElement("a", {
272
+ href: i.link || ((i === null || i === void 0 ? void 0 : i.platform) === "taobao" && i.numIid ? "https://item.taobao.com/item.htm?id=" + i.numIid : "javascript:void(0);"),
273
+ target: "__blank",
274
+ style: {
275
+ marginRight: "12px",
276
+ marginTop: "8px",
277
+ padding: "2px",
278
+ border: "1px dashed #ccc",
279
+ display: "inline-block"
280
+ }
281
+ }, react_1["default"].createElement("img", {
282
+ alt: "",
283
+ src: i.picUrl || default_img_png_1["default"],
284
+ style: {
285
+ width: "72px",
286
+ height: "72px",
287
+ objectFit: "contain"
288
+ }
289
+ })), react_1["default"].createElement("div", null, type === "itemId" && react_1["default"].createElement(TextTool, {
290
+ title: "商品id",
291
+ text: i.numIid
292
+ }), type === "itemCode" && react_1["default"].createElement(react_1["default"].Fragment, null, showHeader.includes("title") && react_1["default"].createElement(TextTool, {
293
+ title: "商品名称",
294
+ text: i.title
295
+ }), showHeader.includes("outerId") && react_1["default"].createElement(TextTool, {
296
+ title: "商品编码",
297
+ text: i.outerId
298
+ }), showHeader.includes("numIid") && react_1["default"].createElement(TextTool, {
299
+ title: "商品id",
300
+ text: i.numIid
301
+ }), showHeader.includes("skuId") && react_1["default"].createElement(TextTool, {
302
+ title: "SKU ID",
303
+ text: i.skuId
304
+ }), showHeader.includes("outerSkuId") && react_1["default"].createElement(TextTool, {
305
+ title: "SKU 编码",
306
+ text: i.outerSkuId
307
+ }), showHeader.includes("propertiesName") && react_1["default"].createElement(TextTool, {
308
+ title: "SKU 信息",
309
+ text: i.propertiesName
310
+ })), (type === "itemThird" || type === "jstItemThird") && (i.itemId || i.supplierItemOuterId) && react_1["default"].createElement(TextTool, {
311
+ title: "供应商编码",
312
+ text: i.itemId || i.supplierItemOuterId
313
+ }), (type === "itemThird" || type === "jstItemThird") && i.supplierName && react_1["default"].createElement(TextTool, {
314
+ title: "供应商名称",
315
+ text: i.supplierName
316
+ }), type !== "itemCode" && i.propertiesName && react_1["default"].createElement(TextTool, {
317
+ title: "规格",
318
+ text: i.propertiesName
319
+ })));
320
+ }))));
321
+ };
322
+ //商品列表展示
323
+ exports.GoodImage = function (_a) {
324
+ var _b;
325
+ var list = _a.list,
326
+ _c = _a.type,
327
+ type = _c === void 0 ? "" : _c,
328
+ _d = _a.showHeader,
329
+ showHeader = _d === void 0 ? [] : _d;
330
+ var total = (list === null || list === void 0 ? void 0 : list.length) || 0;
331
+ var initShowTotal = 3;
332
+ return (list === null || list === void 0 ? void 0 : list.length) > 0 ? react_1["default"].createElement("div", {
333
+ style: {
334
+ display: type === "itemSelect" ? "flex" : "block"
335
+ }
336
+ }, (_b = list === null || list === void 0 ? void 0 : list.slice(0, initShowTotal)) === null || _b === void 0 ? void 0 : _b.map(function (item, index) {
337
+ return exports.showImage({
338
+ item: item,
339
+ type: type,
340
+ index: index,
341
+ showHeader: showHeader
342
+ });
343
+ }), total > initShowTotal && react_1["default"].createElement(exports.ShowTotalImage, {
344
+ total: total,
345
+ allImage: list,
346
+ showHeader: showHeader,
347
+ type: type
348
+ })) : null;
349
+ };
350
+ var content = function content(item, index) {
351
+ return react_1["default"].createElement("div", {
352
+ style: {
353
+ maxHeight: "300px",
354
+ overflowY: "auto"
355
+ }
356
+ }, react_1["default"].createElement("div", {
357
+ style: {
358
+ textAlign: "center"
359
+ }
360
+ }, "\u5305\u88F9" + (index + 1) + "\u5546\u54C1\u4FE1\u606F", item.sid && react_1["default"].createElement("span", null, "(\u7CFB\u7EDF\u5355\u53F7:", item.sid, ")")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
361
+ return react_1["default"].createElement("div", {
362
+ key: index
363
+ }, react_1["default"].createElement(antd_1.Space, null, react_1["default"].createElement(antd_1.Image, {
364
+ width: 70,
365
+ src: t.picUrl,
366
+ preview: false
367
+ }), react_1["default"].createElement("div", null, react_1["default"].createElement("div", null, t.title), react_1["default"].createElement("div", null, "\u7F16\u7801\uFF1A", t.skuId))));
368
+ }));
369
+ };
370
+ exports.JstGoodImage = function (_a) {
371
+ var _b = _a.list,
372
+ list = _b === void 0 ? [] : _b,
373
+ type = _a.type,
374
+ _c = _a.platformType,
375
+ platformType = _c === void 0 ? "default" : _c;
376
+ var getSendName = function getSendName(item) {
377
+ return kmkf_utils_1.SendDataCenter.getInstance(platformType).getSendNameByCode(item.sendName);
378
+ };
379
+ return (list === null || list === void 0 ? void 0 : list.length) ? (list || []).map(function (item, index) {
380
+ var logisticsCompany = item.logisticsCompany;
381
+ var company = kmkf_utils_1.ExpressData.getInstance(platformType).getExpressNameByCode(logisticsCompany);
382
+ return react_1["default"].createElement("div", null, react_1["default"].createElement(antd_1.Space, null, react_1["default"].createElement(antd_1.Popover, {
383
+ content: content(item, index),
384
+ overlayStyle: {
385
+ zIndex: 1080
386
+ }
387
+ }, react_1["default"].createElement("span", {
388
+ key: index,
389
+ style: {
390
+ color: "#1890ff",
391
+ cursor: "pointer"
392
+ }
393
+ }, "\u5305\u88F9" + (index + 1), ":")), type === 1 ? react_1["default"].createElement("span", null, company && item.logisticsCode ? react_1["default"].createElement(react_1["default"].Fragment, null, company, "/", react_1["default"].createElement(CopyText_1["default"], {
394
+ text: item.logisticsCode
395
+ })) : company ? company : item.logisticsCode ? react_1["default"].createElement(CopyText_1["default"], {
396
+ text: item.logisticsCode
397
+ }) : null) : null, type === 2 ? react_1["default"].createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join("/") : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? react_1["default"].createElement("span", null, item.sendName && item.sendId ? [item.sendId, getSendName(item)].join("/") : item.sendId ? item.sendId : getSendName(item)) : null, type === 4 ? react_1["default"].createElement("span", null, (item === null || item === void 0 ? void 0 : item.deliveryNo) || "") : null));
398
+ }) : null;
399
+ };
400
+ exports.BsExpressRender = function (_a) {
401
+ var _b = _a.list,
402
+ list = _b === void 0 ? [] : _b,
403
+ _c = _a.showField,
404
+ showField = _c === void 0 ? "" : _c,
405
+ _d = _a.platformType,
406
+ platformType = _d === void 0 ? "default" : _d;
407
+ return (list === null || list === void 0 ? void 0 : list.length) ? (list || []).map(function (item, index) {
408
+ var logisticsCompany = item.logisticsCompany;
409
+ var company = kmkf_utils_1.ExpressData.getInstance(platformType).getExpressNameByCode(logisticsCompany);
410
+ return react_1["default"].createElement("div", null, react_1["default"].createElement(antd_1.Space, null, react_1["default"].createElement(antd_1.Popover, {
411
+ content: content(item, index),
412
+ overlayStyle: {
413
+ zIndex: 1080
414
+ }
415
+ }, react_1["default"].createElement("span", {
416
+ key: index,
417
+ style: {
418
+ color: "#1890ff",
419
+ cursor: "pointer"
420
+ }
421
+ }, "\u5305\u88F9", ":")), showField === "company" ? react_1["default"].createElement("span", null, company ? company : null) : null, showField === "code" ? react_1["default"].createElement("span", null, item.logisticsCode ? react_1["default"].createElement(CopyText_1["default"], {
422
+ text: item.logisticsCode
423
+ }) : null) : null));
424
+ }) : null;
425
+ };
426
+ exports.CommonOrderContent = function (_a) {
427
+ var _b = _a.list,
428
+ list = _b === void 0 ? [] : _b,
429
+ valueKey = _a.valueKey,
430
+ failValue = _a.failValue,
431
+ _c = _a.options,
432
+ options = _c === void 0 ? [] : _c,
433
+ _d = _a.isShowPopover,
434
+ isShowPopover = _d === void 0 ? true : _d;
435
+ var orderContent = function orderContent(item, index) {
436
+ return react_1["default"].createElement("div", null, react_1["default"].createElement("div", {
437
+ style: {
438
+ textAlign: "center"
439
+ }
440
+ }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7", index + 1, "\uFF1A", item.systemOrderId));
441
+ };
442
+ return (list === null || list === void 0 ? void 0 : list.length) ? (list || []).map(function (item, index) {
443
+ var _a;
444
+ var color = ((_a = options.find(function (it) {
445
+ return item[valueKey] === it.value;
446
+ })) === null || _a === void 0 ? void 0 : _a.color) || "#000";
447
+ var currentOption = options.find(function (option) {
448
+ return item[valueKey] === option.value;
449
+ });
450
+ return react_1["default"].createElement("div", null, react_1["default"].createElement(antd_1.Space, null, isShowPopover ? react_1["default"].createElement(antd_1.Popover, {
451
+ content: orderContent(item, index),
452
+ overlayStyle: {
453
+ zIndex: 1080
454
+ }
455
+ }, react_1["default"].createElement("span", {
456
+ key: index,
457
+ style: {
458
+ color: "#1890ff",
459
+ cursor: "pointer"
460
+ }
461
+ }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7" + (index + 1), ":")) : null, react_1["default"].createElement("span", {
462
+ style: {
463
+ color: color
464
+ }
465
+ }, currentOption ? currentOption.label : (item === null || item === void 0 ? void 0 : item[valueKey]) || "")), item.reason && (item === null || item === void 0 ? void 0 : item[valueKey]) !== "成功" && react_1["default"].createElement("div", {
466
+ className: "c-red"
467
+ }, item.reason));
468
+ }) : null;
469
+ };
470
+ //bs商品展示 todo
471
+ exports.BsGoodImage = function (_a) {
472
+ var item = _a.item,
473
+ index = _a.index;
474
+ var picUrl = item.picUrl || default_img_png_1["default"];
475
+ var keyMap = {
476
+ name: "bs名称",
477
+ code: "bs编码",
478
+ skuId: "bssku编码",
479
+ money: "bs实付金额",
480
+ number: "bs数量",
481
+ share: "bs分摊价",
482
+ type: "bs赠品类型"
483
+ };
484
+ return react_1["default"].createElement("div", {
485
+ className: index_module_less_1["default"].goodImgBox,
486
+ key: index
487
+ }, react_1["default"].createElement("img", {
488
+ style: {
489
+ width: "40px",
490
+ height: "40px",
491
+ objectFit: "contain"
492
+ },
493
+ src: picUrl
494
+ }), react_1["default"].createElement("div", {
495
+ className: index_module_less_1["default"].options
496
+ }, Object.keys(keyMap).map(function (key) {
497
+ return item[key] ? react_1["default"].createElement(TextTool, {
498
+ title: keyMap[key],
499
+ text: item[key]
500
+ }) : null;
501
+ })));
502
+ };
503
+ //bs换货 todo
504
+ exports.BsExchangeList = function (_a) {
505
+ var list = _a.list,
506
+ showHeader = _a.showHeader;
507
+ return react_1["default"].createElement("div", {
508
+ className: index_module_less_1["default"].bsImgBox
509
+ }, list.map(function (item) {
510
+ return react_1["default"].createElement(react_1["default"].Fragment, null, exports.BsGoodsTable({
511
+ list: (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || [],
512
+ showHeader: showHeader,
513
+ text: "退回"
514
+ }), exports.BsGoodsTable({
515
+ list: item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods,
516
+ showHeader: showHeader,
517
+ text: "换出"
518
+ }));
519
+ }));
520
+ };
521
+ //bs图片展示
522
+ exports.BsGoodPic = function (list) {
523
+ return list.map(function (t) {
524
+ return react_1["default"].createElement(antd_1.Image, {
525
+ width: 60,
526
+ src: t
527
+ });
528
+ });
529
+ };
530
+ exports.BsGoodsTable = function (_a) {
531
+ var list = _a.list,
532
+ showHeader = _a.showHeader,
533
+ _b = _a.text,
534
+ text = _b === void 0 ? "" : _b,
535
+ type = _a.type;
536
+ //商品信息
537
+ var COLUMNS_MAP = function COLUMNS_MAP(text) {
538
+ if (text === void 0) {
539
+ text = "";
540
+ }
541
+ return function (type) {
542
+ var columns = [];
543
+ switch (type) {
544
+ case "ITEM_ENCODE":
545
+ columns = [{
546
+ dataIndex: "title",
547
+ title: "商品名称",
548
+ align: "center",
549
+ ellipsis: true,
550
+ width: 200
551
+ }, {
552
+ dataIndex: "outerId",
553
+ title: "商品编码",
554
+ align: "center",
555
+ ellipsis: true,
556
+ width: 140
557
+ }, {
558
+ dataIndex: "picUrl",
559
+ title: "图片",
560
+ align: "center",
561
+ ellipsis: true,
562
+ width: 100,
563
+ render: function render(val) {
564
+ return react_1["default"].createElement(antd_1.Image, {
565
+ width: 60,
566
+ src: val
567
+ });
568
+ }
569
+ }, {
570
+ dataIndex: "numIid",
571
+ title: "商品id",
572
+ align: "center",
573
+ ellipsis: true,
574
+ width: 200
575
+ }, {
576
+ dataIndex: "skuId",
577
+ title: "SKU ID",
578
+ align: "center",
579
+ ellipsis: true,
580
+ width: 200
581
+ }, {
582
+ dataIndex: "outerSkuId",
583
+ title: "SKU 编码",
584
+ align: "center",
585
+ ellipsis: true,
586
+ width: 100
587
+ }, {
588
+ dataIndex: "propertiesName",
589
+ title: "SKU 信息",
590
+ align: "center",
591
+ ellipsis: true,
592
+ width: 200
593
+ }];
594
+ break;
595
+ case "WDT_REISSUE_GOODS":
596
+ case "WDT_GOODS":
597
+ columns = [{
598
+ dataIndex: "goodId",
599
+ title: "\u5546\u54C1ID",
600
+ align: "center",
601
+ ellipsis: true,
602
+ width: 70
603
+ }, {
604
+ dataIndex: "goodNo",
605
+ title: "\u5546\u54C1\u7F16\u7801",
606
+ align: "center",
607
+ ellipsis: true,
608
+ width: 180
609
+ }, {
610
+ dataIndex: "goodName",
611
+ title: text + "\u5546\u54C1\u540D\u79F0",
612
+ align: "center",
613
+ ellipsis: true,
614
+ width: 250
615
+ }, {
616
+ dataIndex: "specId",
617
+ title: text + "SKUID",
618
+ align: "center",
619
+ ellipsis: true,
620
+ width: 100
621
+ }, {
622
+ dataIndex: "specNo",
623
+ title: text + "\u5546\u54C1SKU\u7F16\u7801",
624
+ align: "center",
625
+ ellipsis: true,
626
+ width: 180
627
+ }, {
628
+ dataIndex: "specName",
629
+ title: text + "\u5546\u54C1SKU\u540D\u79F0",
630
+ align: "center",
631
+ ellipsis: true,
632
+ width: 250
633
+ }, {
634
+ dataIndex: "imgUrl",
635
+ title: "\u56FE\u7247",
636
+ align: "center",
637
+ ellipsis: true,
638
+ width: 100,
639
+ render: function render(val) {
640
+ return react_1["default"].createElement(antd_1.Image, {
641
+ width: 60,
642
+ src: val
643
+ });
644
+ }
645
+ }, {
646
+ dataIndex: "orderPrice",
647
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
648
+ align: "center",
649
+ ellipsis: true,
650
+ width: 100
651
+ }, {
652
+ dataIndex: "num",
653
+ title: text + "\u6570\u91CF",
654
+ align: "center",
655
+ ellipsis: true,
656
+ width: 100
657
+ },
658
+ // {
659
+ // dataIndex: 'actualNum',
660
+ // title: `${text}实发数量`,
661
+ // align: 'center',
662
+ // ellipsis: true,
663
+ // width: 100,
664
+ // },
665
+ {
666
+ dataIndex: "sharePrice",
667
+ title: "\u5206\u644A\u4EF7",
668
+ align: "center",
669
+ ellipsis: true,
670
+ width: 70
671
+ }, {
672
+ dataIndex: "giftType",
673
+ title: "\u8D60\u54C1\u65B9\u5F0F",
674
+ align: "center",
675
+ ellipsis: true,
676
+ width: 100,
677
+ render: function render(val) {
678
+ var giftTypeMap = {
679
+ 0: "非赠品",
680
+ 1: "自动赠送",
681
+ 2: "手工赠送",
682
+ 3: "回购自动送赠品",
683
+ 4: "前N有礼送赠品",
684
+ 6: "天猫优仓赠品",
685
+ 7: "淘宝CRM会员送赠"
686
+ };
687
+ return react_1["default"].createElement("span", null, giftTypeMap[val]);
688
+ }
689
+ }];
690
+ break;
691
+ case "WDT_RETURN_GOODS":
692
+ {
693
+ columns = [{
694
+ dataIndex: "goodId",
695
+ title: "\u5546\u54C1ID",
696
+ align: "center",
697
+ ellipsis: true,
698
+ width: 70
699
+ }, {
700
+ dataIndex: "goodNo",
701
+ title: "\u5546\u54C1\u7F16\u7801",
702
+ align: "center",
703
+ ellipsis: true,
704
+ width: 180
705
+ }, {
706
+ dataIndex: "goodName",
707
+ title: text + "\u5546\u54C1\u540D\u79F0",
708
+ align: "center",
709
+ ellipsis: true,
710
+ width: 250
711
+ }, {
712
+ dataIndex: "specId",
713
+ title: text + "SKUID",
714
+ align: "center",
715
+ ellipsis: true,
716
+ width: 100
717
+ }, {
718
+ dataIndex: "specNo",
719
+ title: text + "\u5546\u54C1SKU\u7F16\u7801",
720
+ align: "center",
721
+ ellipsis: true,
722
+ width: 180
723
+ }, {
724
+ dataIndex: "specName",
725
+ title: text + "\u5546\u54C1SKU\u540D\u79F0",
726
+ align: "center",
727
+ ellipsis: true,
728
+ width: 250
729
+ }, {
730
+ dataIndex: "num",
731
+ title: text + "\u9000\u8D27\u6570\u91CF",
732
+ align: "center",
733
+ ellipsis: true,
734
+ width: 100
735
+ }, {
736
+ dataIndex: "sharePrice",
737
+ title: "\u5206\u644A\u4EF7",
738
+ align: "center",
739
+ ellipsis: true,
740
+ width: 80
741
+ }, {
742
+ dataIndex: "returnPrice",
743
+ title: text + "\u9000\u8D27\u91D1\u989D",
744
+ align: "center",
745
+ ellipsis: true,
746
+ width: 100
747
+ }, {
748
+ dataIndex: "giftType",
749
+ title: "\u8D60\u54C1\u65B9\u5F0F",
750
+ align: "center",
751
+ ellipsis: true,
752
+ width: 100,
753
+ render: function render(val) {
754
+ var giftTypeMap = {
755
+ 0: "非赠品",
756
+ 1: "自动赠送",
757
+ 2: "手工赠送",
758
+ 3: "回购自动送赠品",
759
+ 4: "前N有礼送赠品",
760
+ 6: "天猫优仓赠品",
761
+ 7: "淘宝CRM会员送赠"
762
+ };
763
+ return react_1["default"].createElement("span", null, giftTypeMap[val]);
764
+ }
765
+ }, {
766
+ dataIndex: "type",
767
+ title: text + "\u5546\u54C1\u7C7B\u578B",
768
+ align: "center",
769
+ ellipsis: true,
770
+ width: 100,
771
+ render: function render(val) {
772
+ var typeMap = {
773
+ "1": "单品",
774
+ "2": "组合装"
775
+ };
776
+ return react_1["default"].createElement("span", null, typeMap[val]);
777
+ }
778
+ }];
779
+ }
780
+ break;
781
+ case "WDT_EXCHANGE_GOODS":
782
+ {
783
+ columns = [{
784
+ dataIndex: "goodId",
785
+ title: "\u5546\u54C1ID",
786
+ align: "center",
787
+ ellipsis: true,
788
+ width: 70
789
+ }, {
790
+ dataIndex: "goodNo",
791
+ title: "\u5546\u54C1\u7F16\u7801",
792
+ align: "center",
793
+ ellipsis: true,
794
+ width: 180
795
+ }, {
796
+ dataIndex: "goodName",
797
+ title: text + "\u5546\u54C1\u540D\u79F0",
798
+ align: "center",
799
+ ellipsis: true,
800
+ width: 250
801
+ }, {
802
+ dataIndex: "specId",
803
+ title: text + "SKUID",
804
+ align: "center",
805
+ ellipsis: true,
806
+ width: 100
807
+ }, {
808
+ dataIndex: "specNo",
809
+ title: text + "\u5546\u54C1SKU\u7F16\u7801",
810
+ align: "center",
811
+ ellipsis: true,
812
+ width: 180
813
+ }, {
814
+ dataIndex: "specName",
815
+ title: text + "\u5546\u54C1SKU\u540D\u79F0",
816
+ align: "center",
817
+ ellipsis: true,
818
+ width: 250
819
+ }, {
820
+ dataIndex: "num",
821
+ title: text + "\u6362\u51FA\u6570\u91CF",
822
+ align: "center",
823
+ ellipsis: true,
824
+ width: 100
825
+ }, {
826
+ dataIndex: "price",
827
+ title: text + "\u5546\u54C1\u5355\u4EF7",
828
+ align: "center",
829
+ ellipsis: true,
830
+ width: 100
831
+ }, {
832
+ dataIndex: "exchangePrice",
833
+ title: text + "\u6362\u51FA\u91D1\u989D",
834
+ align: "center",
835
+ ellipsis: true,
836
+ width: 100
837
+ }, {
838
+ dataIndex: "giftType",
839
+ title: "\u8D60\u54C1\u65B9\u5F0F",
840
+ align: "center",
841
+ ellipsis: true,
842
+ width: 100,
843
+ render: function render(val) {
844
+ var giftTypeMap = {
845
+ 0: "非赠品",
846
+ 1: "自动赠送",
847
+ 2: "手工赠送",
848
+ 3: "回购自动送赠品",
849
+ 4: "前N有礼送赠品",
850
+ 6: "天猫优仓赠品",
851
+ 7: "淘宝CRM会员送赠"
852
+ };
853
+ return react_1["default"].createElement("span", null, giftTypeMap[val]);
854
+ }
855
+ }, {
856
+ dataIndex: "type",
857
+ title: text + "\u5546\u54C1\u7C7B\u578B",
858
+ align: "center",
859
+ ellipsis: true,
860
+ width: 100,
861
+ render: function render(val) {
862
+ var typeMap = {
863
+ "1": "单品",
864
+ "2": "组合装"
865
+ };
866
+ return react_1["default"].createElement("span", null, typeMap[val]);
867
+ }
868
+ }];
869
+ }
870
+ break;
871
+ case "BS_E3_REISSUE_GOODS":
872
+ case "BS_E3_GOODS":
873
+ {
874
+ columns = [{
875
+ dataIndex: "sku",
876
+ title: "SKU",
877
+ align: "center",
878
+ ellipsis: true,
879
+ width: 150
880
+ }, {
881
+ dataIndex: "skuId",
882
+ title: "SKU ID",
883
+ align: "center",
884
+ ellipsis: true,
885
+ width: 150
886
+ }, {
887
+ dataIndex: "goodsName",
888
+ title: "\u5546\u54C1\u540D\u79F0",
889
+ align: "center",
890
+ ellipsis: true,
891
+ width: 150
892
+ }, {
893
+ dataIndex: "goodsShortName",
894
+ title: "\u5546\u54C1\u7B80\u79F0",
895
+ align: "center",
896
+ ellipsis: true,
897
+ width: 100
898
+ }, {
899
+ dataIndex: "picPath",
900
+ title: "\u5546\u54C1\u56FE\u7247",
901
+ align: "center",
902
+ ellipsis: true,
903
+ width: 100,
904
+ render: function render(val) {
905
+ return react_1["default"].createElement(antd_1.Image, {
906
+ width: 60,
907
+ src: val
908
+ });
909
+ }
910
+ }, {
911
+ dataIndex: "goodsSn",
912
+ title: "\u8D27\u53F7",
913
+ align: "center",
914
+ ellipsis: true,
915
+ width: 150
916
+ }, {
917
+ dataIndex: "goodsId",
918
+ title: "\u8D27\u53F7ID",
919
+ align: "center",
920
+ ellipsis: true,
921
+ width: 150
922
+ }, {
923
+ dataIndex: "colorName",
924
+ title: "\u989C\u8272\u540D\u79F0",
925
+ align: "center",
926
+ ellipsis: true,
927
+ width: 100
928
+ }, {
929
+ dataIndex: "colorCode",
930
+ title: "\u989C\u8272\u4EE3\u7801",
931
+ align: "center",
932
+ ellipsis: true,
933
+ width: 150
934
+ }, {
935
+ dataIndex: "sizeName",
936
+ title: "\u5C3A\u7801\u540D\u79F0",
937
+ align: "center",
938
+ ellipsis: true,
939
+ width: 100
940
+ }, {
941
+ dataIndex: "sizeCode",
942
+ title: "\u5C3A\u7801\u4EE3\u7801",
943
+ align: "center",
944
+ ellipsis: true,
945
+ width: 100
946
+ }, {
947
+ dataIndex: "brandName",
948
+ title: "\u54C1\u724C\u540D\u79F0",
949
+ align: "center",
950
+ ellipsis: true,
951
+ width: 150
952
+ }, {
953
+ dataIndex: "goodsNumber",
954
+ title: "\u5546\u54C1\u6570\u91CF",
955
+ align: "center",
956
+ ellipsis: true,
957
+ width: 100
958
+ }, {
959
+ dataIndex: "goodsPrice",
960
+ title: "\u5546\u54C1\u5355\u4EF7",
961
+ align: "center",
962
+ ellipsis: true,
963
+ width: 120
964
+ }, {
965
+ dataIndex: "shopPrice",
966
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
967
+ align: "center",
968
+ ellipsis: true,
969
+ width: 120
970
+ }, {
971
+ dataIndex: "sharePrice",
972
+ title: "\u5206\u644A\u4EF7",
973
+ align: "center",
974
+ ellipsis: true,
975
+ width: 120
976
+ }, {
977
+ dataIndex: "sharePayment",
978
+ title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
979
+ align: "center",
980
+ ellipsis: true,
981
+ width: 120
982
+ }, {
983
+ dataIndex: "payment",
984
+ title: "\u5B9E\u4ED8\u91D1\u989D",
985
+ align: "center",
986
+ ellipsis: true,
987
+ width: 120
988
+ }, {
989
+ dataIndex: "tcSku",
990
+ title: "\u5957\u9910SKU",
991
+ align: "center",
992
+ ellipsis: true,
993
+ width: 150
994
+ }, {
995
+ dataIndex: "tcGoodsNumber",
996
+ title: "\u5957\u9910\u5957\u6570",
997
+ align: "center",
998
+ ellipsis: true,
999
+ width: 100
1000
+ }, {
1001
+ dataIndex: "taoCanSingleSl",
1002
+ title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
1003
+ align: "center",
1004
+ ellipsis: true,
1005
+ width: 100
1006
+ }, {
1007
+ dataIndex: "isGift",
1008
+ title: "\u662F\u5426\u8D60\u54C1",
1009
+ align: "center",
1010
+ ellipsis: true,
1011
+ width: 100,
1012
+ render: function render(val) {
1013
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1014
+ }
1015
+ }];
1016
+ }
1017
+ break;
1018
+ default:
1019
+ columns = [{
1020
+ dataIndex: "mark",
1021
+ title: "\u5546\u54C1\u6807\u8BB0",
1022
+ align: "center",
1023
+ ellipsis: true,
1024
+ width: 100
1025
+ }, {
1026
+ dataIndex: "skuName",
1027
+ title: text + "sku\u540D\u79F0",
1028
+ align: "center",
1029
+ ellipsis: true,
1030
+ width: 200
1031
+ }, {
1032
+ dataIndex: "sku",
1033
+ title: text + "sku\u7F16\u7801",
1034
+ align: "center",
1035
+ ellipsis: true,
1036
+ width: 100
1037
+ }, {
1038
+ dataIndex: "name",
1039
+ title: text + "\u540D\u79F0",
1040
+ align: "center",
1041
+ ellipsis: true,
1042
+ width: 200
1043
+ }, {
1044
+ dataIndex: "pic",
1045
+ title: "\u56FE\u7247",
1046
+ align: "center",
1047
+ ellipsis: true,
1048
+ width: 100,
1049
+ render: function render(val) {
1050
+ return react_1["default"].createElement(antd_1.Image, {
1051
+ width: 60,
1052
+ src: val
1053
+ });
1054
+ }
1055
+ }, {
1056
+ dataIndex: "code",
1057
+ title: text + "\u7F16\u7801",
1058
+ align: "center",
1059
+ ellipsis: true,
1060
+ width: 100
1061
+ }, {
1062
+ dataIndex: "money",
1063
+ title: "\u5B9E\u4ED8\u91D1\u989D",
1064
+ align: "center",
1065
+ ellipsis: true,
1066
+ width: 100
1067
+ }, {
1068
+ dataIndex: "number",
1069
+ title: text + "\u6570\u91CF",
1070
+ align: "center",
1071
+ ellipsis: true,
1072
+ width: 100
1073
+ }, {
1074
+ dataIndex: "share",
1075
+ title: "\u5206\u644A\u4EF7",
1076
+ align: "center",
1077
+ ellipsis: true,
1078
+ width: 70
1079
+ }, {
1080
+ dataIndex: "type",
1081
+ title: "\u8D60\u54C1\u7C7B\u578B",
1082
+ align: "center",
1083
+ ellipsis: true,
1084
+ width: 100
1085
+ }];
1086
+ }
1087
+ return columns;
1088
+ };
1089
+ };
1090
+ //商品信息
1091
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS(text) {
1092
+ if (text === void 0) {
1093
+ text = "";
1094
+ }
1095
+ var COLUMNS_INFO = COLUMNS_MAP(text);
1096
+ return COLUMNS_INFO(type);
1097
+ };
1098
+ // const GOODS_INFO_COLUMNS = (text = '') => {
1099
+ // return
1100
+ // }
1101
+ var newColumns = react_1.useMemo(function () {
1102
+ var columnList = __spreadArrays([{
1103
+ dataIndex: "",
1104
+ title: "序号",
1105
+ align: "center",
1106
+ ellipsis: true,
1107
+ width: 50,
1108
+ render: function render(val, record, index) {
1109
+ return react_1["default"].createElement("span", null, index + 1);
1110
+ }
1111
+ }], GOODS_INFO_COLUMNS(text).filter(function (t) {
1112
+ return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
1113
+ }));
1114
+ return columnList;
1115
+ }, [showHeader, list]);
1116
+ return react_1["default"].createElement(antd_1.Table, {
1117
+ columns: newColumns,
1118
+ dataSource: list,
1119
+ rowKey: "uuid",
1120
+ size: "small",
1121
+ pagination: false,
1122
+ scroll: {
1123
+ x: "100%"
1124
+ },
1125
+ locale: {
1126
+ emptyText: "暂无数据"
1127
+ }
1128
+ });
1129
+ };
1130
+ exports.FileRender = function (_a) {
1131
+ var _b = _a.fileList,
1132
+ fileList = _b === void 0 ? [] : _b,
1133
+ _c = _a.canDownload,
1134
+ canDownload = _c === void 0 ? false : _c;
1135
+ var _d = react_1.useState(false),
1136
+ visible = _d[0],
1137
+ setVisible = _d[1];
1138
+ var _e = react_1.useState(""),
1139
+ fileUrl = _e[0],
1140
+ setFileUrl = _e[1];
1141
+ var _f = react_1.useState(""),
1142
+ fileType = _f[0],
1143
+ setFileType = _f[1];
1144
+ var _g = react_1.useState(""),
1145
+ fileName = _g[0],
1146
+ setFileName = _g[1];
1147
+ var _h = react_1.useState(false),
1148
+ downloading = _h[0],
1149
+ setDownloading = _h[1];
1150
+ var handleCancel = function handleCancel() {
1151
+ setFileUrl("");
1152
+ setFileName("");
1153
+ setVisible(false);
1154
+ setDownloading(false);
1155
+ };
1156
+ var onPreview = function onPreview(file) {
1157
+ var _a;
1158
+ var fileArr = (_a = file === null || file === void 0 ? void 0 : file.url) === null || _a === void 0 ? void 0 : _a.split(".");
1159
+ var fileType = fileArr[fileArr.length - 1];
1160
+ if (["png", "jpg", "jpeg", "gif", "bmp", "svg"].includes(fileType.toLowerCase())) {
1161
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
1162
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
1163
+ setFileType("pic");
1164
+ setVisible(true);
1165
+ } else if (["mp4", "avi", "mpeg", "asf", "mov", "3gp", "wmv", "rmvb"].includes(fileType.toLowerCase())) {
1166
+ setFileUrl(file === null || file === void 0 ? void 0 : file.url);
1167
+ setFileName(file === null || file === void 0 ? void 0 : file.name);
1168
+ setFileType("video");
1169
+ setVisible(true);
1170
+ } else {
1171
+ window.open(file === null || file === void 0 ? void 0 : file.url);
1172
+ }
1173
+ };
1174
+ var download = function download(url, name) {
1175
+ setDownloading(true);
1176
+ fetch(url).then(function (res) {
1177
+ return res.blob();
1178
+ }).then(function (blob) {
1179
+ var a = document.createElement("a");
1180
+ document.body.appendChild(a);
1181
+ a.style.display = "none";
1182
+ var url = window.URL.createObjectURL(blob);
1183
+ a.href = url;
1184
+ a.download = name;
1185
+ a.click();
1186
+ document.body.removeChild(a);
1187
+ window.URL.revokeObjectURL(url);
1188
+ })["finally"](function () {
1189
+ setDownloading(false);
1190
+ });
1191
+ };
1192
+ return react_1["default"].createElement(react_1["default"].Fragment, null, fileList.map(function (item) {
1193
+ return react_1["default"].createElement("a", {
1194
+ style: {
1195
+ color: "#1890ff",
1196
+ cursor: "pointer",
1197
+ display: "block"
1198
+ },
1199
+ onClick: function onClick(e) {
1200
+ e.preventDefault();
1201
+ onPreview(item);
1202
+ },
1203
+ href: item === null || item === void 0 ? void 0 : item.url
1204
+ }, item.name);
1205
+ }), react_1["default"].createElement(antd_1.Modal, {
1206
+ visible: visible,
1207
+ title: fileName,
1208
+ footer: null,
1209
+ onCancel: handleCancel
1210
+ }, canDownload ? react_1["default"].createElement(antd_1.Button, {
1211
+ type: "link",
1212
+ onClick: function onClick() {
1213
+ return download(fileUrl, fileName);
1214
+ },
1215
+ loading: downloading
1216
+ }, "\u4E0B\u8F7D") : react_1["default"].createElement(react_copy_to_clipboard_1.CopyToClipboard, {
1217
+ text: fileUrl,
1218
+ onCopy: function onCopy() {
1219
+ antd_1.message.success("复制成功");
1220
+ }
1221
+ }, react_1["default"].createElement(antd_1.Button, {
1222
+ type: "link"
1223
+ }, "\u4E0B\u8F7D\u5730\u5740")), fileType === "pic" ? react_1["default"].createElement("img", {
1224
+ alt: "example",
1225
+ style: {
1226
+ width: "100%"
1227
+ },
1228
+ src: fileUrl
1229
+ }) : react_1["default"].createElement("video", {
1230
+ style: {
1231
+ width: "100%",
1232
+ height: "100%"
1233
+ },
1234
+ autoPlay: true,
1235
+ controls: true,
1236
+ src: fileUrl
1237
+ })));
1238
+ };
1239
+ exports.BsSystemOrderTable = function (_a) {
1240
+ var value = _a.value,
1241
+ type = _a.type;
1242
+ var columnMap = {
1243
+ BS_SYSTEM_ORDER: [{
1244
+ dataIndex: "billType",
1245
+ title: "订单类型"
1246
+ }, {
1247
+ dataIndex: "billNo",
1248
+ title: "系统订单号"
1249
+ }, {
1250
+ dataIndex: "billTag",
1251
+ title: "标签"
1252
+ }, {
1253
+ title: "主播名称",
1254
+ dataIndex: "authorName"
1255
+ }, {
1256
+ title: "主播ID",
1257
+ dataIndex: "authorId"
1258
+ }],
1259
+ KM_SYSTEM_ORDER: kmkf_utils_2.KM_SYSTEM_ORDER_CONFIG.columns,
1260
+ WLN_SYSTEM_ORDER: [{
1261
+ dataIndex: "billType",
1262
+ title: "单据类型"
1263
+ }, {
1264
+ dataIndex: "billNo",
1265
+ title: "系统订单号"
1266
+ }, {
1267
+ dataIndex: "billTag",
1268
+ title: "标签"
1269
+ }],
1270
+ WDT_SYSTEM_ORDER: [{
1271
+ dataIndex: "billType",
1272
+ title: "订单类型"
1273
+ }, {
1274
+ dataIndex: "billNo",
1275
+ title: "系统订单号"
1276
+ }, {
1277
+ dataIndex: "billTag",
1278
+ title: "订单标签"
1279
+ }],
1280
+ BS_E3_SYSTEM_ORDER: [{
1281
+ title: "系统订单号",
1282
+ dataIndex: "orderSn",
1283
+ width: 150,
1284
+ ellipsis: true
1285
+ }, {
1286
+ title: "订单状态",
1287
+ dataIndex: "orderStatus",
1288
+ width: 100,
1289
+ ellipsis: true,
1290
+ render: function render(val) {
1291
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_ORDER_STATUS_MAP[val] || val);
1292
+ }
1293
+ }, {
1294
+ title: "是否被拆分",
1295
+ dataIndex: "isSplit",
1296
+ width: 100,
1297
+ ellipsis: true,
1298
+ render: function render(val) {
1299
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1300
+ }
1301
+ }, {
1302
+ title: "是否拆分子单",
1303
+ dataIndex: "isSplitNew",
1304
+ width: 100,
1305
+ ellipsis: true,
1306
+ render: function render(val) {
1307
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1308
+ }
1309
+ }, {
1310
+ title: "是否被合并",
1311
+ dataIndex: "isCombine",
1312
+ width: 100,
1313
+ ellipsis: true,
1314
+ render: function render(val) {
1315
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1316
+ }
1317
+ }, {
1318
+ title: "是否合并新单",
1319
+ dataIndex: "isCombineNew",
1320
+ width: 100,
1321
+ ellipsis: true,
1322
+ render: function render(val) {
1323
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1324
+ }
1325
+ }, {
1326
+ title: "是否复制单",
1327
+ dataIndex: "isCopy",
1328
+ width: 100,
1329
+ ellipsis: true,
1330
+ render: function render(val) {
1331
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1332
+ }
1333
+ }, {
1334
+ title: "是否换货单",
1335
+ dataIndex: "isExchangeOrder",
1336
+ width: 100,
1337
+ ellipsis: true,
1338
+ render: function render(val) {
1339
+ return react_1["default"].createElement("span", null, kmkf_utils_1.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
1340
+ }
1341
+ }, {
1342
+ title: "订单备注",
1343
+ dataIndex: "orderMsg",
1344
+ width: 100,
1345
+ ellipsis: true
1346
+ }]
1347
+ };
1348
+ var rowKeyMap = {
1349
+ BS_SYSTEM_ORDER: "billNo",
1350
+ KM_SYSTEM_ORDER: "billNo",
1351
+ WLN_SYSTEM_ORDER: "billNo",
1352
+ WDT_SYSTEM_ORDER: "billNo",
1353
+ BS_E3_SYSTEM_ORDER: "orderSn"
1354
+ };
1355
+ var rowSelection = {
1356
+ selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || ((value === null || value === void 0 ? void 0 : value.showOrderInfo) || []).reduce(function (prv, next) {
1357
+ if (next.select) {
1358
+ prv.push(next[rowKeyMap[type]] || "billNo");
1359
+ }
1360
+ return prv;
1361
+ }, []),
1362
+ getCheckboxProps: function getCheckboxProps(record) {
1363
+ return {
1364
+ disabled: true,
1365
+ name: record.name
1366
+ };
1367
+ }
1368
+ };
1369
+ return react_1["default"].createElement(antd_1.Table, {
1370
+ dataSource: (value === null || value === void 0 ? void 0 : value.showOrderInfo) || [],
1371
+ columns: columnMap[type] || [],
1372
+ rowSelection: rowSelection,
1373
+ rowKey: rowKeyMap[type] || "billNo",
1374
+ size: "small",
1375
+ pagination: false,
1376
+ scroll: {
1377
+ x: "100%"
1378
+ },
1379
+ locale: {
1380
+ emptyText: "暂无数据"
1381
+ }
1382
+ });
1383
+ };
1384
+ // interface MsgItemType {
1385
+ // msgRuleId: string
1386
+ // msgType: string
1387
+ // ruleName: string
1388
+ // status: string
1389
+ // }
1390
+ exports.MsgContent = function (_a) {
1391
+ var _b = _a.horizontal,
1392
+ horizontal = _b === void 0 ? true : _b,
1393
+ _c = _a.list,
1394
+ list = _c === void 0 ? [] : _c,
1395
+ valueKey = _a.valueKey,
1396
+ failValue = _a.failValue,
1397
+ _d = _a.options,
1398
+ options = _d === void 0 ? [] : _d;
1399
+ var msgTypeCh = {
1400
+ ding: "钉钉",
1401
+ wechat: "微信",
1402
+ qq: "QQ",
1403
+ qywx: "企业微信",
1404
+ YZDKH: "邮政拦截",
1405
+ YT: "圆通拦截",
1406
+ feishu: "飞书"
1407
+ };
1408
+ var getColorByStatus = function getColorByStatus(value) {
1409
+ var _a;
1410
+ return ((_a = options.find(function (innerItem) {
1411
+ return value === innerItem.label || value === innerItem.oldValue;
1412
+ })) === null || _a === void 0 ? void 0 : _a.color) || "#000";
1413
+ };
1414
+ var detailContent = function detailContent(item) {
1415
+ var _a;
1416
+ return react_1["default"].createElement("div", null, react_1["default"].createElement("div", {
1417
+ style: {
1418
+ textAlign: "left"
1419
+ }
1420
+ }, ((_a = item.msgReceivers) === null || _a === void 0 ? void 0 : _a.length) ? item.msgReceivers.map(function (msgItem, index) {
1421
+ return react_1["default"].createElement("div", {
1422
+ key: index,
1423
+ style: {
1424
+ color: getColorByStatus(msgItem.status)
1425
+ }
1426
+ }, msgItem.failReason ? msgItem.name + "\uFF0C" + msgItem.status + "\uFF0C\u5931\u8D25\u539F\u56E0\uFF1A" + msgItem.failReason : msgItem.name + "\uFF0C" + msgItem.status + ";");
1427
+ }) : item.failReason && react_1["default"].createElement("div", {
1428
+ style: {
1429
+ color: getColorByStatus(item.status)
1430
+ }
1431
+ }, "\u5931\u8D25\u539F\u56E0\uFF1A", item.failReason)));
1432
+ };
1433
+ return react_1["default"].createElement(antd_1.Space, {
1434
+ direction: !horizontal ? "vertical" : "horizontal"
1435
+ }, Array.isArray(list) ? (list || []).map(function (item, index) {
1436
+ var _a;
1437
+ var color = getColorByStatus(item[valueKey]);
1438
+ var currentOption = options.find(function (option) {
1439
+ return item[valueKey] === option.value;
1440
+ });
1441
+ var key = item.msgType || "ding";
1442
+ var formatMsgContent = react_1["default"].createElement("span", {
1443
+ key: index
1444
+ }, msgTypeCh[key], "-", item.ruleName, "-", currentOption ? currentOption.label : (item === null || item === void 0 ? void 0 : item[valueKey]) || "");
1445
+ return react_1["default"].createElement("div", {
1446
+ key: "wrap_" + index,
1447
+ style: {
1448
+ color: color,
1449
+ cursor: "pointer"
1450
+ }
1451
+ }, ((_a = item.msgReceivers) === null || _a === void 0 ? void 0 : _a.some(function (msgItem) {
1452
+ return Array.isArray(failValue) ? failValue.includes(msgItem === null || msgItem === void 0 ? void 0 : msgItem.status) : (msgItem === null || msgItem === void 0 ? void 0 : msgItem.status) === failValue;
1453
+ })) || item.failReason ? react_1["default"].createElement(antd_1.Popover, {
1454
+ content: detailContent(item),
1455
+ overlayStyle: {
1456
+ zIndex: 9999
1457
+ }
1458
+ }, formatMsgContent) : formatMsgContent);
1459
+ }) : null);
1460
+ };
1461
+ //获取付款凭证
1462
+ exports.AlipayBill = function (props) {
1463
+ var value = props.value,
1464
+ platform = props.platform;
1465
+ var _a = react_1.useState(false),
1466
+ visible = _a[0],
1467
+ setVisible = _a[1];
1468
+ var _b = react_1.useState(""),
1469
+ msg = _b[0],
1470
+ setMsg = _b[1];
1471
+ var _c = react_1.useState(false),
1472
+ hasUrl = _c[0],
1473
+ setHasUrl = _c[1];
1474
+ var voucherHandle = function voucherHandle(e) {
1475
+ return __awaiter(void 0, void 0, void 0, function () {
1476
+ var params, res, data, msg;
1477
+ return __generator(this, function (_a) {
1478
+ switch (_a.label) {
1479
+ case 0:
1480
+ e.stopPropagation();
1481
+ params = {
1482
+ alipayBillReceiptDetailId: value
1483
+ };
1484
+ return [4 /*yield*/, api_1.getAlipayBillReceipt(params)];
1485
+ case 1:
1486
+ res = _a.sent();
1487
+ data = res.data, msg = res.message;
1488
+ if (data) {
1489
+ setHasUrl(true);
1490
+ if (["fxg"].includes(platform)) {
1491
+ setMsg(data);
1492
+ setVisible(true);
1493
+ } else {
1494
+ window.open(data);
1495
+ }
1496
+ } else {
1497
+ setHasUrl(false);
1498
+ setMsg(msg);
1499
+ setVisible(true);
1500
+ }
1501
+ return [2 /*return*/];
1502
+ }
1503
+ });
1504
+ });
1505
+ };
1506
+
1507
+ var closeHandle = function closeHandle(e) {
1508
+ e.stopPropagation();
1509
+ setVisible(false);
1510
+ };
1511
+ return react_1["default"].createElement(react_1["default"].Fragment, null, react_1["default"].createElement("span", {
1512
+ style: {
1513
+ color: "#1890ff",
1514
+ cursor: "pointer"
1515
+ },
1516
+ onClick: voucherHandle
1517
+ }, value), react_1["default"].createElement(antd_1.Modal, {
1518
+ title: "\u4ED8\u6B3E\u51ED\u8BC1",
1519
+ visible: visible,
1520
+ footer: false,
1521
+ onCancel: closeHandle
1522
+ }, ["fxg"].includes(platform) && hasUrl ? react_1["default"].createElement("div", null, "\u8BF7\u590D\u5236\u94FE\u63A5\u5728\u6D4F\u89C8\u5668\u4E0A\u6253\u5F00\uFF0C\u94FE\u63A5\uFF1A", react_1["default"].createElement(Paragraph, {
1523
+ copyable: true
1524
+ }, msg)) : msg));
1525
+ };