@kmkf-fe-packages/services-components 0.27.0 → 0.27.1-test.11
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/commonComponents/CopyText/index.d.ts +7 -0
- package/dist/esm/commonComponents/CopyText/index.js +14 -0
- package/dist/esm/commonComponents/ErpContext/index.d.ts +16 -0
- package/dist/esm/commonComponents/ErpContext/index.js +68 -0
- package/dist/esm/commonComponents/GlobalContext/index.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/index.js +8 -5
- package/dist/esm/commonComponents/PlatBuyer/index.d.ts +1 -1
- package/dist/esm/commonComponents/PlatBuyer/index.js +4 -17
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.d.ts +1 -1
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +21 -15
- package/dist/esm/components/BS/BsLogistics/index.js +6 -3
- package/dist/esm/components/BS/BsReissue/index.js +7 -7
- package/dist/esm/components/BS/common/SystemOrderNo.d.ts +26 -0
- package/dist/esm/components/BS/common/SystemOrderNo.js +94 -0
- package/dist/esm/components/BS/common/expressCompany.js +3 -2
- package/dist/esm/components/BS/common/index.d.ts +1 -0
- package/dist/esm/components/BS/common/index.js +2 -1
- package/dist/esm/components/BuyerNick/index.d.ts +3 -3
- package/dist/esm/components/BuyerNick/index.js +9 -19
- package/dist/esm/components/Common/index.d.ts +3 -2
- package/dist/esm/components/Common/index.js +261 -171
- package/dist/esm/components/CommonInput/index.d.ts +34 -0
- package/dist/esm/components/CommonInput/index.js +105 -0
- package/dist/esm/components/CommonTradeId/index.d.ts +5 -6
- package/dist/esm/components/CommonTradeId/index.js +15 -26
- package/dist/esm/components/ErpTradeId/components/OrderNum/communication.d.ts +2 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/communication.js +23 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/index.d.ts +4 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/index.js +169 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/index.less +30 -0
- package/dist/esm/components/ErpTradeId/components/OrderNum/noImage.png +0 -0
- package/dist/esm/components/ErpTradeId/index.MD +1 -0
- package/dist/esm/components/ErpTradeId/index.d.ts +2 -29
- package/dist/esm/components/ErpTradeId/index.js +41 -104
- package/dist/esm/components/ExpressCode/index.d.ts +2 -2
- package/dist/esm/components/ExpressCode/index.js +9 -5
- package/dist/esm/components/FlowWorkOrderId/index.d.ts +2 -3
- package/dist/esm/components/FlowWorkOrderId/index.js +4 -18
- package/dist/esm/components/JST/JstSendGood/index.js +8 -5
- package/dist/esm/components/LogisticsMoreInterception/index.d.ts +13 -13
- package/dist/esm/components/LogisticsMoreInterception/index.js +17 -14
- package/dist/esm/components/LogisticsMoreInterception/{interceptItem.d.ts → interceptCode.d.ts} +2 -2
- package/dist/esm/components/LogisticsMoreInterception/{interceptItem.js → interceptCode.js} +7 -4
- package/dist/esm/components/LogisticsMoreTrajectory/index.d.ts +9 -0
- package/dist/esm/components/LogisticsMoreTrajectory/index.js +57 -4
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryLastLogisticsInfo.d.ts +30 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryLastLogisticsInfo.js +80 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryLastUpdateTime.d.ts +29 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryLastUpdateTime.js +77 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryStatus.d.ts +32 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryStatus.js +96 -0
- package/dist/esm/components/LogisticsTrajectory/index.d.ts +9 -0
- package/dist/esm/components/LogisticsTrajectory/index.js +26 -4
- package/dist/esm/components/LogisticsTrajectory/trajectoryLastLogisticsInfo.d.ts +27 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryLastLogisticsInfo.js +71 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryLastUpdateTime.d.ts +27 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryLastUpdateTime.js +71 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryStatus.d.ts +32 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryStatus.js +93 -0
- package/dist/esm/components/Payment/PaymentStatus.d.ts +4 -4
- package/dist/esm/components/Payment/PaymentStatus.js +30 -30
- package/dist/esm/components/Payment/PaymentTid.d.ts +2 -2
- package/dist/esm/components/Payment/PaymentTid.js +14 -3
- package/dist/esm/components/PaymentVoucherCode/index.d.ts +33 -0
- package/dist/esm/components/PaymentVoucherCode/index.js +108 -0
- package/dist/esm/components/Select/index.d.ts +5 -5
- package/dist/esm/components/Select/index.js +22 -14
- package/dist/esm/components/TradeId/index.d.ts +0 -1
- package/dist/esm/components/TradeId/index.js +7 -19
- package/dist/esm/components/WDT/WdtRessuie/index.d.ts +58 -0
- package/dist/esm/components/WDT/WdtRessuie/index.js +185 -0
- package/dist/esm/components/WorkOrderId/index.d.ts +2 -3
- package/dist/esm/components/WorkOrderId/index.js +4 -18
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +9 -3
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.js +8 -1
- package/dist/esm/service/api.d.ts +3 -0
- package/dist/esm/service/api.js +36 -16
- package/package.json +4 -4
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, Record, ColumnConfig } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class CommonInput implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
rules: any[];
|
|
9
|
+
showContains: boolean;
|
|
10
|
+
onlyContainsString: boolean;
|
|
11
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
12
|
+
effects: ComponentInterface["effects"];
|
|
13
|
+
isCombinationComponent: boolean;
|
|
14
|
+
formField: string;
|
|
15
|
+
canSort: boolean;
|
|
16
|
+
children: ComponentInterface[];
|
|
17
|
+
dataType: ComponentInterface["dataType"];
|
|
18
|
+
options: ComponentInterface["options"];
|
|
19
|
+
constructor(options: PickOption);
|
|
20
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
21
|
+
renderPc: (value: unknown, record: Record) => any;
|
|
22
|
+
renderLog: (r: Record) => any;
|
|
23
|
+
getComponentValue: (r: Record) => any;
|
|
24
|
+
renderExport: (value: unknown, record: Record) => any;
|
|
25
|
+
editRender: (p: any) => React.JSX.Element;
|
|
26
|
+
filterConfig: (item: ColumnConfig) => {
|
|
27
|
+
searchDefaultConditions: "like";
|
|
28
|
+
type: string;
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
filterComponentType: "Input";
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export default CommonInput;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Input } from "antd";
|
|
11
|
+
import GetFormItem from "../GetFormItem";
|
|
12
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
13
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
|
+
import { SYMBOL } from "../../constant";
|
|
15
|
+
var INPUT_MAP = {
|
|
16
|
+
BUSINESS_ORDER_NO: {
|
|
17
|
+
key: "businessOrderNo",
|
|
18
|
+
disabled: true,
|
|
19
|
+
placeholder: "自动获取无需填写"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var CommonInput = /*#__PURE__*/_createClass(function CommonInput(options) {
|
|
23
|
+
var _this = this;
|
|
24
|
+
_classCallCheck(this, CommonInput);
|
|
25
|
+
_defineProperty(this, "name", void 0);
|
|
26
|
+
_defineProperty(this, "id", void 0);
|
|
27
|
+
_defineProperty(this, "sortField", void 0);
|
|
28
|
+
_defineProperty(this, "type", void 0);
|
|
29
|
+
_defineProperty(this, "rules", void 0);
|
|
30
|
+
_defineProperty(this, "showContains", void 0);
|
|
31
|
+
_defineProperty(this, "onlyContainsString", void 0);
|
|
32
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
33
|
+
_defineProperty(this, "effects", void 0);
|
|
34
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
35
|
+
_defineProperty(this, "formField", void 0);
|
|
36
|
+
_defineProperty(this, "canSort", void 0);
|
|
37
|
+
_defineProperty(this, "children", void 0);
|
|
38
|
+
_defineProperty(this, "dataType", void 0);
|
|
39
|
+
_defineProperty(this, "options", void 0);
|
|
40
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
41
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
42
|
+
id: _this.id,
|
|
43
|
+
label: _this.name,
|
|
44
|
+
value: record === null || record === void 0 ? void 0 : record[_this.id]
|
|
45
|
+
}) : null;
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
48
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(INPUT_MAP[_this.type].key)]) === undefined) {
|
|
49
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, "--");
|
|
50
|
+
}
|
|
51
|
+
return record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(INPUT_MAP[_this.type].key)];
|
|
52
|
+
});
|
|
53
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
54
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(INPUT_MAP[_this.type].key)])) return null;
|
|
55
|
+
return _this.renderPc(undefined, r);
|
|
56
|
+
});
|
|
57
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
58
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(INPUT_MAP[_this.type].key)];
|
|
59
|
+
});
|
|
60
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
61
|
+
var _record;
|
|
62
|
+
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(INPUT_MAP[_this.type].key)]) !== null && _record !== void 0 ? _record : "--";
|
|
63
|
+
});
|
|
64
|
+
_defineProperty(this, "editRender", function (p) {
|
|
65
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
66
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
67
|
+
title: _this.name,
|
|
68
|
+
name: _this.id,
|
|
69
|
+
rules: _this.rules,
|
|
70
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
71
|
+
display: p === null || p === void 0 ? void 0 : p.display,
|
|
72
|
+
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
73
|
+
component: /*#__PURE__*/React.createElement(Input, _extends({}, _this.componentConfig, {
|
|
74
|
+
placeholder: INPUT_MAP[_this.type].placeholder || "\u8BF7\u8F93\u5165".concat(_this.name),
|
|
75
|
+
disabled: INPUT_MAP[_this.type].disabled
|
|
76
|
+
}))
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
80
|
+
return {
|
|
81
|
+
searchDefaultConditions: SYMBOL.like,
|
|
82
|
+
type: item.type,
|
|
83
|
+
id: "".concat(item.id, "_").concat(INPUT_MAP[_this.type].key),
|
|
84
|
+
// 过滤组件id
|
|
85
|
+
name: item.name,
|
|
86
|
+
// 过滤组件名称
|
|
87
|
+
filterComponentType: "Input"
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
this.name = options.name;
|
|
91
|
+
this.id = options.id;
|
|
92
|
+
this.sortField = "".concat(options.id, "_").concat(INPUT_MAP[options.type].key);
|
|
93
|
+
this.formField = "".concat(options.id, "_").concat(INPUT_MAP[options.type].key);
|
|
94
|
+
this.type = options.type;
|
|
95
|
+
this.showContains = false;
|
|
96
|
+
this.onlyContainsString = true;
|
|
97
|
+
this.componentConfig = options.componentConfig;
|
|
98
|
+
this.effects = options.effects;
|
|
99
|
+
this.rules = [];
|
|
100
|
+
this.isCombinationComponent = false;
|
|
101
|
+
this.canSort = !!INPUT_MAP[options.type].canSort;
|
|
102
|
+
this.children = [];
|
|
103
|
+
this.dataType = "string";
|
|
104
|
+
});
|
|
105
|
+
export default CommonInput;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, Record, ColumnConfig } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, Record, ColumnConfig } from '../../type';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare class CommonTradeId implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
@@ -8,16 +8,15 @@ declare class CommonTradeId implements ComponentInterface {
|
|
|
8
8
|
rules: any[];
|
|
9
9
|
showContains: boolean;
|
|
10
10
|
onlyContainsString: boolean;
|
|
11
|
-
componentConfig: ComponentInterface[
|
|
12
|
-
effects: ComponentInterface[
|
|
11
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
12
|
+
effects: ComponentInterface['effects'];
|
|
13
13
|
isCombinationComponent: boolean;
|
|
14
14
|
formField: string;
|
|
15
15
|
canSort: boolean;
|
|
16
16
|
children: ComponentInterface[];
|
|
17
|
-
dataType: ComponentInterface[
|
|
17
|
+
dataType: ComponentInterface['dataType'];
|
|
18
18
|
constructor(options: PickOption);
|
|
19
19
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
20
|
-
copyHandle: (text: string) => void;
|
|
21
20
|
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
22
21
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
23
22
|
getComponentValue: (r: Record) => any;
|
|
@@ -6,20 +6,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
6
6
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
7
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
8
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
|
-
import React from
|
|
10
|
-
import {
|
|
11
|
-
import { CopyOutlined } from "@ant-design/icons";
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { Input } from 'antd';
|
|
12
11
|
import GetFormItem from "../GetFormItem";
|
|
13
12
|
import ItemView from "../../commonComponents/ItemView";
|
|
14
|
-
import { isNull, filterFn as _filterFn } from
|
|
15
|
-
import copy from "copy-to-clipboard";
|
|
13
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
14
|
import { SYMBOL } from "../../constant";
|
|
15
|
+
import CopyText from "../../commonComponents/CopyText";
|
|
17
16
|
var TRADE_ID_MAP = {
|
|
18
17
|
REISSUE_TRADE_ID: {
|
|
19
|
-
key:
|
|
18
|
+
key: 'reissueTradeId'
|
|
20
19
|
},
|
|
21
20
|
EXCHANGE_TRADE_ID: {
|
|
22
|
-
key:
|
|
21
|
+
key: 'exchangeTradeId'
|
|
23
22
|
}
|
|
24
23
|
};
|
|
25
24
|
var CommonTradeId = /*#__PURE__*/_createClass(function CommonTradeId(options) {
|
|
@@ -43,13 +42,11 @@ var CommonTradeId = /*#__PURE__*/_createClass(function CommonTradeId(options) {
|
|
|
43
42
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
44
43
|
id: _this.id,
|
|
45
44
|
label: _this.name,
|
|
46
|
-
value:
|
|
45
|
+
value: /*#__PURE__*/React.createElement(CopyText, {
|
|
46
|
+
text: record === null || record === void 0 ? void 0 : record[_this.id]
|
|
47
|
+
})
|
|
47
48
|
}) : null;
|
|
48
49
|
});
|
|
49
|
-
_defineProperty(this, "copyHandle", function (text) {
|
|
50
|
-
copy(text);
|
|
51
|
-
message.success("复制成功");
|
|
52
|
-
});
|
|
53
50
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
54
51
|
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(TRADE_ID_MAP[_this.type].key)]) === undefined) {
|
|
55
52
|
return /*#__PURE__*/React.createElement(React.Fragment, null, "--");
|
|
@@ -58,17 +55,9 @@ var CommonTradeId = /*#__PURE__*/_createClass(function CommonTradeId(options) {
|
|
|
58
55
|
onClick: function onClick(e) {
|
|
59
56
|
return e.stopPropagation();
|
|
60
57
|
}
|
|
61
|
-
}, /*#__PURE__*/React.createElement(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
e.stopPropagation();
|
|
65
|
-
}
|
|
66
|
-
}, /*#__PURE__*/React.createElement("span", {
|
|
67
|
-
style: {
|
|
68
|
-
paddingLeft: "4px",
|
|
69
|
-
cursor: "pointer"
|
|
70
|
-
}
|
|
71
|
-
}, /*#__PURE__*/React.createElement(CopyOutlined, null)))));
|
|
58
|
+
}, /*#__PURE__*/React.createElement(CopyText, {
|
|
59
|
+
text: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(TRADE_ID_MAP[_this.type].key)]
|
|
60
|
+
}));
|
|
72
61
|
});
|
|
73
62
|
_defineProperty(this, "renderLog", function (r) {
|
|
74
63
|
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(TRADE_ID_MAP[_this.type].key)])) return null;
|
|
@@ -79,7 +68,7 @@ var CommonTradeId = /*#__PURE__*/_createClass(function CommonTradeId(options) {
|
|
|
79
68
|
});
|
|
80
69
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
81
70
|
var _record;
|
|
82
|
-
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(TRADE_ID_MAP[_this.type].key)]) !== null && _record !== void 0 ? _record :
|
|
71
|
+
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(TRADE_ID_MAP[_this.type].key)]) !== null && _record !== void 0 ? _record : '--';
|
|
83
72
|
});
|
|
84
73
|
_defineProperty(this, "editRender", function (p) {
|
|
85
74
|
var _this$componentConfig, _this$componentConfig2;
|
|
@@ -104,7 +93,7 @@ var CommonTradeId = /*#__PURE__*/_createClass(function CommonTradeId(options) {
|
|
|
104
93
|
// 过滤组件id
|
|
105
94
|
name: item.name,
|
|
106
95
|
// 过滤组件名称
|
|
107
|
-
filterComponentType:
|
|
96
|
+
filterComponentType: 'Input',
|
|
108
97
|
filterFn: function filterFn(value) {
|
|
109
98
|
return function (i) {
|
|
110
99
|
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "".concat(TRADE_ID_MAP[_this.type].key)), value);
|
|
@@ -128,6 +117,6 @@ var CommonTradeId = /*#__PURE__*/_createClass(function CommonTradeId(options) {
|
|
|
128
117
|
this.isCombinationComponent = false;
|
|
129
118
|
this.canSort = true;
|
|
130
119
|
this.children = [];
|
|
131
|
-
this.dataType =
|
|
120
|
+
this.dataType = 'string';
|
|
132
121
|
});
|
|
133
122
|
export default CommonTradeId;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// 查询订单详情
|
|
2
|
+
export var queryOrderDetail = function queryOrderDetail(tid) {
|
|
3
|
+
var _window, _window$parent;
|
|
4
|
+
console.log('请求ERP订单详情', tid);
|
|
5
|
+
(_window = window) === null || _window === void 0 ? void 0 : (_window$parent = _window.parent) === null || _window$parent === void 0 ? void 0 : _window$parent.postMessage({
|
|
6
|
+
method: 'queryOrder',
|
|
7
|
+
data: {
|
|
8
|
+
tid: tid
|
|
9
|
+
}
|
|
10
|
+
}, '*');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// 查询抖店openId
|
|
14
|
+
export var queryDouDianOpenId = function queryDouDianOpenId(originTid) {
|
|
15
|
+
var _window2, _window2$parent;
|
|
16
|
+
console.log('查询抖音店铺买家id', originTid);
|
|
17
|
+
(_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$parent = _window2.parent) === null || _window2$parent === void 0 ? void 0 : _window2$parent.postMessage({
|
|
18
|
+
method: 'queryDouDianOpenId',
|
|
19
|
+
data: {
|
|
20
|
+
originTid: originTid
|
|
21
|
+
}
|
|
22
|
+
}, '*');
|
|
23
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["value", "onChange", "onTradeIdBlur"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
14
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
/*
|
|
18
|
+
* @Author: wangzhenggui jianjia.wzg@raycloud.com
|
|
19
|
+
* @Date: 2022-11-15 15:39:26
|
|
20
|
+
* @LastEditors: wangzhenggui jianjia.wzg@raycloud.com
|
|
21
|
+
* @LastEditTime: 2022-12-07 19:47:07
|
|
22
|
+
* @FilePath: /kefu/packages/enterprise/src/app/pages/ErpWorkOrder/components/OrderNum/index.tsx
|
|
23
|
+
* @Description:
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) 2022 by wangzhenggui jianjia.wzg@raycloud.com, All Rights Reserved.
|
|
26
|
+
*/
|
|
27
|
+
import React, { useEffect, useState, useContext } from 'react';
|
|
28
|
+
import { Button, Input, Popover, Radio, Image } from 'antd';
|
|
29
|
+
import get from 'lodash/get';
|
|
30
|
+
import { ErpScenes } from "../../../../index";
|
|
31
|
+
import { queryOrderDetail, queryDouDianOpenId } from "./communication";
|
|
32
|
+
import noImage from "./noImage.png";
|
|
33
|
+
import "./index.less";
|
|
34
|
+
var Card = function Card(_ref) {
|
|
35
|
+
var tid = _ref.tid,
|
|
36
|
+
sid = _ref.sid,
|
|
37
|
+
itemList = _ref.itemList,
|
|
38
|
+
sysStatusName = _ref.sysStatusName;
|
|
39
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
+
className: "erp-suborder-card"
|
|
41
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
42
|
+
style: {
|
|
43
|
+
display: 'flex',
|
|
44
|
+
alignItems: 'center'
|
|
45
|
+
}
|
|
46
|
+
}, sysStatusName && /*#__PURE__*/React.createElement("span", {
|
|
47
|
+
className: "tag"
|
|
48
|
+
}, sysStatusName), /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
style: {
|
|
50
|
+
marginLeft: '8px',
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
display: 'flex'
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u7CFB\u7EDF\u5355\u53F7: ", /*#__PURE__*/React.createElement("b", null, sid)), /*#__PURE__*/React.createElement("span", null, "\u5E73\u53F0\u5355\u53F7: ", /*#__PURE__*/React.createElement("b", null, tid)))), itemList.map(function (item) {
|
|
55
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
56
|
+
className: "good"
|
|
57
|
+
}, item.picUrl ? /*#__PURE__*/React.createElement(Image, {
|
|
58
|
+
width: 56,
|
|
59
|
+
src: item.picUrl
|
|
60
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
61
|
+
src: noImage,
|
|
62
|
+
alt: "\u65E0\u5546\u54C1\u56FE\u7247",
|
|
63
|
+
style: {
|
|
64
|
+
width: '56px',
|
|
65
|
+
height: '56px'
|
|
66
|
+
}
|
|
67
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
68
|
+
className: "content"
|
|
69
|
+
}, /*#__PURE__*/React.createElement("span", null, item.title), /*#__PURE__*/React.createElement("span", null, item.productCode)), /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: "price"
|
|
71
|
+
}, item.price && /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("b", {
|
|
72
|
+
style: {
|
|
73
|
+
color: '#ff7a45',
|
|
74
|
+
fontSize: '16px'
|
|
75
|
+
}
|
|
76
|
+
}, item.price), ' ', "* 1")));
|
|
77
|
+
}));
|
|
78
|
+
};
|
|
79
|
+
var SubOrderList = function SubOrderList(_ref2) {
|
|
80
|
+
var subList = _ref2.subList;
|
|
81
|
+
var _useContext = useContext(ErpScenes.ErpContext),
|
|
82
|
+
orderList = _useContext.orderList,
|
|
83
|
+
setGlobalLoading = _useContext.setGlobalLoading,
|
|
84
|
+
setBuyerId = _useContext.setBuyerId,
|
|
85
|
+
setCurrentOrderDetail = _useContext.setCurrentOrderDetail;
|
|
86
|
+
var _useState = useState(),
|
|
87
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
88
|
+
value = _useState2[0],
|
|
89
|
+
setValue = _useState2[1];
|
|
90
|
+
var handleChange = function handleChange(e) {
|
|
91
|
+
setValue(e.target.value);
|
|
92
|
+
var selectOrder = get(orderList, "orderList.".concat(e.target.value), {});
|
|
93
|
+
// 如果是抖音的订单,需要根据这个订单号去获取买家id
|
|
94
|
+
if (selectOrder.shopSource === 'fxg') {
|
|
95
|
+
setGlobalLoading(true);
|
|
96
|
+
queryDouDianOpenId(selectOrder.originTid);
|
|
97
|
+
} else {
|
|
98
|
+
setBuyerId('');
|
|
99
|
+
}
|
|
100
|
+
setCurrentOrderDetail(_objectSpread({}, selectOrder));
|
|
101
|
+
};
|
|
102
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
style: {
|
|
104
|
+
height: '300px',
|
|
105
|
+
overflowY: 'auto'
|
|
106
|
+
},
|
|
107
|
+
className: "erp-suborder-itemWrap",
|
|
108
|
+
onClick: function onClick(e) {
|
|
109
|
+
return e.stopPropagation();
|
|
110
|
+
}
|
|
111
|
+
}, /*#__PURE__*/React.createElement(Radio.Group, {
|
|
112
|
+
value: value,
|
|
113
|
+
onChange: handleChange
|
|
114
|
+
}, subList.map(function (subOrder, index) {
|
|
115
|
+
return /*#__PURE__*/React.createElement(Radio, {
|
|
116
|
+
value: index
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Card, subOrder));
|
|
118
|
+
})));
|
|
119
|
+
};
|
|
120
|
+
var OrderNum = function OrderNum(_ref3) {
|
|
121
|
+
var value = _ref3.value,
|
|
122
|
+
onChange = _ref3.onChange,
|
|
123
|
+
onTradeIdBlur = _ref3.onTradeIdBlur,
|
|
124
|
+
otherProp = _objectWithoutProperties(_ref3, _excluded);
|
|
125
|
+
var _useContext2 = useContext(ErpScenes.ErpContext),
|
|
126
|
+
visible = _useContext2.subOrderListVisible,
|
|
127
|
+
orderList = _useContext2.orderList,
|
|
128
|
+
setGlobalLoading = _useContext2.setGlobalLoading,
|
|
129
|
+
setSubOrderListVisible = _useContext2.setSubOrderListVisible;
|
|
130
|
+
var subList = orderList.orderList;
|
|
131
|
+
var handleQueryOrderDetail = function handleQueryOrderDetail() {
|
|
132
|
+
if (!value) return;
|
|
133
|
+
setGlobalLoading(true);
|
|
134
|
+
queryOrderDetail(value);
|
|
135
|
+
typeof onTradeIdBlur === 'function' && onTradeIdBlur(value);
|
|
136
|
+
};
|
|
137
|
+
useEffect(function () {
|
|
138
|
+
document.body.addEventListener('click', function () {
|
|
139
|
+
setSubOrderListVisible(false);
|
|
140
|
+
});
|
|
141
|
+
return document.body.removeEventListener('click', function () {
|
|
142
|
+
setSubOrderListVisible(false);
|
|
143
|
+
});
|
|
144
|
+
}, []);
|
|
145
|
+
return /*#__PURE__*/React.createElement(Popover, {
|
|
146
|
+
visible: visible,
|
|
147
|
+
placement: "bottom",
|
|
148
|
+
content: /*#__PURE__*/React.createElement(SubOrderList, {
|
|
149
|
+
subList: subList
|
|
150
|
+
}),
|
|
151
|
+
trigger: "manually"
|
|
152
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
153
|
+
style: {
|
|
154
|
+
display: 'inline-flex',
|
|
155
|
+
width: '100%',
|
|
156
|
+
alignItems: 'center'
|
|
157
|
+
},
|
|
158
|
+
onClick: function onClick(e) {
|
|
159
|
+
return e.stopPropagation();
|
|
160
|
+
}
|
|
161
|
+
}, /*#__PURE__*/React.createElement(Input, _extends({
|
|
162
|
+
value: value,
|
|
163
|
+
onChange: onChange
|
|
164
|
+
}, otherProp)), /*#__PURE__*/React.createElement(Button, {
|
|
165
|
+
type: "primary",
|
|
166
|
+
onClick: handleQueryOrderDetail
|
|
167
|
+
}, "\u67E5\u8BE2\u8BA2\u5355")));
|
|
168
|
+
};
|
|
169
|
+
export default OrderNum;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.erp-suborder-itemWrap {
|
|
2
|
+
width: 420px;
|
|
3
|
+
}
|
|
4
|
+
.erp-suborder-card {
|
|
5
|
+
margin-bottom: 16px;
|
|
6
|
+
.tag {
|
|
7
|
+
padding: 2px;
|
|
8
|
+
background: #bae7ff;
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
height: 24px;
|
|
11
|
+
line-height: 21px;
|
|
12
|
+
}
|
|
13
|
+
.good {
|
|
14
|
+
margin-top: 8px;
|
|
15
|
+
width: 380px;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
.content {
|
|
19
|
+
flex: 1;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
margin-left: 8px;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
}
|
|
25
|
+
.price {
|
|
26
|
+
flex: 0 0 100px;
|
|
27
|
+
align-self: flex-end;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
### 该组件只能在ERP录入工单场景下使用,并且需要配合 ErpContext 这个上下文一起使用
|
|
@@ -1,33 +1,6 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
|
|
2
1
|
import React from 'react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
id: string;
|
|
6
|
-
sortField: string;
|
|
7
|
-
type: string;
|
|
8
|
-
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface["componentConfig"];
|
|
10
|
-
isCombinationComponent: boolean;
|
|
11
|
-
formField: string;
|
|
12
|
-
canSort: boolean;
|
|
13
|
-
children: ComponentInterface[];
|
|
14
|
-
dataType: ComponentInterface['dataType'];
|
|
15
|
-
constructor(options: PickOption);
|
|
16
|
-
renderClient: (record: any) => React.JSX.Element | null;
|
|
17
|
-
copyHandle: (text: string) => void;
|
|
18
|
-
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
19
|
-
renderLog: (r: Record) => React.JSX.Element | null;
|
|
20
|
-
getComponentValue: (r: Record) => any;
|
|
21
|
-
renderExport: (value: any, record: Record) => any;
|
|
2
|
+
import TradeId from '../TradeId';
|
|
3
|
+
declare class ErpTradeId extends TradeId {
|
|
22
4
|
editRender: (p: any) => React.JSX.Element;
|
|
23
|
-
filterConfig: (item: ColumnConfig) => {
|
|
24
|
-
searchDefaultConditions: "in";
|
|
25
|
-
type: string;
|
|
26
|
-
id: string;
|
|
27
|
-
name: string;
|
|
28
|
-
filterComponentType: "Input";
|
|
29
|
-
filterFn: (value: string) => (i: Record) => boolean;
|
|
30
|
-
formatFilterValue: (input: string) => string[];
|
|
31
|
-
};
|
|
32
5
|
}
|
|
33
6
|
export default ErpTradeId;
|