@kmkf-fe-packages/services-components 2.2.10 → 2.2.12

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,2 @@
1
+ export * from './useGoodsSourceFormat';
2
+ export * from './useColumnsConfig';
@@ -0,0 +1,2 @@
1
+ export * from "./useGoodsSourceFormat";
2
+ export * from "./useColumnsConfig";
@@ -0,0 +1,26 @@
1
+ import LogisticsInterception from "../components/LogisticsInterception";
2
+ import LogisticsMoreInterception from "../components/LogisticsMoreInterception";
3
+ export declare const newRenderColumnItem: (effects: any) => (item: any) => import("../components/BS/BsLogistics").default | import("../components/BS/BsSystemOrder").default | import("../components/TradeId").default | import("../components/Input").default | import("../components/TypeInput").default | import("../components/Address").default | import("../components/Cascader").default | import("../components/Checkbox").default | import("../components/DataTime").default | import("../components/Select").default | import("../components/SelectOption").default | import("../components/Radio").default | import("../components/TextArea").default | import("../components/Picture").default | import("../components/PicturePro").default | import("../components/MultSelect").default | import("../components/Grade").default | import("../components/Rate").default | import("../components/File").default | import("../components/PostIng").default | import("../components/SubForm").default | import("../components/CommonDataTime").default | import("../components/ShopName").default | import("../components/BuyerNick").default | import("../components/ReceiverName").default | import("../components/ReceiverMobile").default | import("../components/ReceiverAddress").default | import("../components/TradeDateTime").default | import("../components/Logistics").default | import("../components/ReturnLogistics").default | import("../components/ActualPayment").default | import("../components/Remark").default | import("../components/Alipay").default | import("../components/EItemSelect").default | import("../components/EItemId").default | import("../components/EItemEnCode").default | import("../components/SystemOrderNo").default | import("../components/Ordinary").default | import("../components/ThirdItemSelect").default | import("../components/Payment").default | import("../components/Reissue/Logistics").default | import("../components/JST/JstItemSelect").default | import("../components/JST/JstSendGood").default | import("../components/JST/JstSupply").default | import("../components/BS/BsGoods").default | import("../components/BsE3/BsGoods").default | import("../components/Public/Goods").default | import("../components/Public/ReissueGoods").default | import("../components/Public/Exchange").default | import("../components/BsE3/BsReissueE3").default | import("../components/BS/BsExchange").default | import("../components/BS/BsReissue").default | import("../components/BS/BsReturn").default | import("../components/FlowStatusSelect").default | import("../components/FlowMarkSelect").default | import("../components/FlowTag").default | import("../components/TemplateSelect").default | import("../components/WorkOrderId").default | LogisticsInterception | LogisticsMoreInterception | import("../components/LogisticsTrajectory").default | import("../components/LogisticsMoreTrajectory").default | import("../components/PlatForm").default | import("../components/ShopInput").default | import("../components/Submitter").default | import("../components/PrevSubmitter").default | import("../components/FlowCreator").default | import("../components/Handler").default | import("../components/CompletedUser").default | import("../components/FlowWorkOrderId").default | import("../components/StatusSelect").default | import("../components/Calculation").default | import("../components/CommonSystemOrder").default | import("../components/CommonMultiStatus").default | import("../components/NodeDeadLine").default | import("../components/HandlerDeadLine").default | import("../components/NodeStayDuration").default | import("../components/WLN/WlnGoods").default | import("../components/BS/BsPosting").default | import("../components/NodeInput").default | import("../components/FlowWorkOrderStatus").default | import("../components/MsgStatus").default | import("../components/WDT/WdtGoods").default | import("../components/WDT/WdtRessuie").default | import("../components/WDT/WdtReturn").default | import("../components/WDT/WdtExchange").default | import("../components/WDT/WdtShopSelect").default | import("../components/KM/KmVideo").default | import("../components/CommonInput").default | import("../components/PaymentVoucherCode").default | import("../components/Label").default | import("../components/MemberLevel").default | import("../components/AfterSalesOrderId").default | import("../components/GY/GyGoods").default | import("../components/GY/GyReissue").default | import("../components/GY/GyReturn").default | import("../components/Public/AsyncSelect").default | import("../components/SKX/SkxIdInputSelect").default | import("../components/SKX/SkxGoods").default | import("../components/OrderSubForm").default;
4
+ export declare const useColumnsConfig: ({ queryWorkOrderDetail, flatTemplateList, shopList, sortState, onChangeSort, handleReset, handleSubmit, handleChangeSingleWorkOrderMark, userList, tbAppKey, isShare, openSingleColumnsFilter, openSingleColumnsSort, }: {
5
+ queryWorkOrderDetail?: ((p: any) => void) | undefined;
6
+ flatTemplateList?: any;
7
+ shopList?: any[] | undefined;
8
+ userList?: any[] | undefined;
9
+ sortState?: {
10
+ id: string;
11
+ sort: string;
12
+ } | undefined;
13
+ onChangeSort?: ((p: {
14
+ id: string;
15
+ sort: string;
16
+ }) => void) | undefined;
17
+ handleReset?: ((id: string) => void) | undefined;
18
+ handleSubmit?: (() => void) | undefined;
19
+ handleChangeSingleWorkOrderMark?: ((p: any, v: any) => void) | undefined;
20
+ isShare?: boolean | undefined;
21
+ openSingleColumnsFilter?: boolean | undefined;
22
+ openSingleColumnsSort?: boolean | undefined;
23
+ tbAppKey?: string | undefined;
24
+ }) => {
25
+ tableColumnConfig: (cur: any, nxt: any) => any;
26
+ };
@@ -0,0 +1,243 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
+ 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); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ 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."); }
9
+ 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); }
10
+ 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; }
11
+ 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; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import React from "react";
14
+ import { Tooltip } from "antd";
15
+ import { useState, useCallback, useMemo } from "react";
16
+ import { factory } from "../factory";
17
+ import LogisticsInterception from "../components/LogisticsInterception";
18
+ import LogisticsMoreInterception from "../components/LogisticsMoreInterception";
19
+ import { TEMPLATE_TYPE, DATA_SPLIT_COMPONENT_FIELDS_MAP } from "@kmkf-fe-packages/kmkf-utils";
20
+
21
+ //工单列表左对齐
22
+ var workOrderListAlignLeft = ['KM_VIDEO'];
23
+ var cantFilterType = ["CREATED_DATETIME", "UPDATE_DATETIME", "COMPLETED_DATETIME", "JST_LOGISTICS", "JST_ITEM_SELECT_THIRD", "JST_SUPPLY", "JST_SEND_GOOD", "TEXTAREA", "BS_SEND_GOOD", "BS_LOGISTICS", "BS_DELIVERY_NO", "WLN_SEND_GOOD", "WLN_LOGISTICS", "WDT_SEND_GOOD", "WDT_LOGISTICS", "KM_LOGISTICS", "REISSUE_LOGISTICS", "KM_SEND_GOOD", "GY_SEND_GOOD", "GY_LOGISTICS"];
24
+ var cantShareFilterType = ["WORK_ORDER_ID_INPUT", "OPERATOR_INPUT", "HANDLER_INPUT", "COMPLETED_USER_INPUT"];
25
+ //需要拆行的组件
26
+ var SplitRowsType = Object.keys(DATA_SPLIT_COMPONENT_FIELDS_MAP);
27
+ var canFilterFn = function canFilterFn(type, isShare) {
28
+ if (isShare && cantShareFilterType !== null && cantShareFilterType !== void 0 && cantShareFilterType.includes(type)) {
29
+ return false;
30
+ }
31
+ if (cantFilterType !== null && cantFilterType !== void 0 && cantFilterType.includes(type)) {
32
+ return false;
33
+ }
34
+ return type !== TEMPLATE_TYPE;
35
+ };
36
+ var getChildrenColumnsHoc = function getChildrenColumnsHoc(_ref) {
37
+ var sort = _ref.sort,
38
+ handleReset = _ref.handleReset,
39
+ handleSubmit = _ref.handleSubmit,
40
+ onChangeSort = _ref.onChangeSort,
41
+ isShare = _ref.isShare,
42
+ openSingleColumnsFilter = _ref.openSingleColumnsFilter,
43
+ openSingleColumnsSort = _ref.openSingleColumnsSort;
44
+ return function (instance, nxt) {
45
+ var canFilter = canFilterFn(instance.type, isShare);
46
+ if (instance !== null && instance !== void 0 && instance.isCombinationComponent) {
47
+ var _instance$children;
48
+ var filterOptionList = instance === null || instance === void 0 ? void 0 : instance.filterConfig(nxt);
49
+ return instance === null || instance === void 0 ? void 0 : (_instance$children = instance.children) === null || _instance$children === void 0 ? void 0 : _instance$children.map(function (item) {
50
+ return {
51
+ name: item.name,
52
+ title: item.name,
53
+ dataIndex: item.id,
54
+ formField: item.formField,
55
+ id: item.id,
56
+ //todo 单元格合并
57
+ children: getChildrenColumnsHoc({
58
+ sort: sort,
59
+ handleReset: handleReset,
60
+ handleSubmit: handleSubmit,
61
+ onChangeSort: onChangeSort,
62
+ isShare: isShare,
63
+ openSingleColumnsFilter: openSingleColumnsFilter,
64
+ openSingleColumnsSort: openSingleColumnsSort
65
+ })(item, nxt),
66
+ render: function render(text, record) {
67
+ if (["MSG_STATUS"].includes(item === null || item === void 0 ? void 0 : item.type)) return item === null || item === void 0 ? void 0 : item.renderPc(text, record);
68
+ return /*#__PURE__*/React.createElement(Tooltip, {
69
+ title: item !== null && item !== void 0 && item.renderPcTooltip ? item === null || item === void 0 ? void 0 : item.renderPcTooltip(text, record) : item === null || item === void 0 ? void 0 : item.renderPc(text, record),
70
+ placement: "topLeft"
71
+ }, item === null || item === void 0 ? void 0 : item.renderPc(text, record));
72
+ },
73
+ width: item === null || item === void 0 ? void 0 : item.width,
74
+ renderExport: item === null || item === void 0 ? void 0 : item.renderExport,
75
+ align: workOrderListAlignLeft.includes(instance === null || instance === void 0 ? void 0 : instance.type) ? "left" : "center",
76
+ features: {
77
+ autoRowSpan: function autoRowSpan(prevValue, value, prevRow, row) {
78
+ var _prevRow$rowKey, _row$rowKey;
79
+ if (SplitRowsType.includes(item.type)) {
80
+ return false;
81
+ }
82
+ var _ref2 = (prevRow === null || prevRow === void 0 ? void 0 : (_prevRow$rowKey = prevRow.rowKey) === null || _prevRow$rowKey === void 0 ? void 0 : _prevRow$rowKey.split("-")) || [],
83
+ _ref3 = _slicedToArray(_ref2, 1),
84
+ lastKey = _ref3[0];
85
+ var _ref4 = (row === null || row === void 0 ? void 0 : (_row$rowKey = row.rowKey) === null || _row$rowKey === void 0 ? void 0 : _row$rowKey.split("-")) || [],
86
+ _ref5 = _slicedToArray(_ref4, 1),
87
+ currentKey = _ref5[0];
88
+ return lastKey === currentKey;
89
+ }
90
+ }
91
+ };
92
+ });
93
+ }
94
+ return [];
95
+ };
96
+ };
97
+ export var newRenderColumnItem = function newRenderColumnItem(effects) {
98
+ return function (item) {
99
+ var instance = factory(item.type, {
100
+ id: item.id,
101
+ name: item.name,
102
+ type: item.type,
103
+ componentConfig: _objectSpread(_objectSpread({}, item === null || item === void 0 ? void 0 : item.config), item === null || item === void 0 ? void 0 : item.templateConfig),
104
+ effects: effects,
105
+ renderExport: function renderExport() {
106
+ return null;
107
+ }
108
+ });
109
+ return instance;
110
+ };
111
+ };
112
+ export var useColumnsConfig = function useColumnsConfig(_ref6) {
113
+ var queryWorkOrderDetail = _ref6.queryWorkOrderDetail,
114
+ flatTemplateList = _ref6.flatTemplateList,
115
+ shopList = _ref6.shopList,
116
+ sortState = _ref6.sortState,
117
+ _ref6$onChangeSort = _ref6.onChangeSort,
118
+ onChangeSort = _ref6$onChangeSort === void 0 ? function () {} : _ref6$onChangeSort,
119
+ handleReset = _ref6.handleReset,
120
+ handleSubmit = _ref6.handleSubmit,
121
+ handleChangeSingleWorkOrderMark = _ref6.handleChangeSingleWorkOrderMark,
122
+ userList = _ref6.userList,
123
+ tbAppKey = _ref6.tbAppKey,
124
+ _ref6$isShare = _ref6.isShare,
125
+ isShare = _ref6$isShare === void 0 ? false : _ref6$isShare,
126
+ _ref6$openSingleColum = _ref6.openSingleColumnsFilter,
127
+ openSingleColumnsFilter = _ref6$openSingleColum === void 0 ? true : _ref6$openSingleColum,
128
+ _ref6$openSingleColum2 = _ref6.openSingleColumnsSort,
129
+ openSingleColumnsSort = _ref6$openSingleColum2 === void 0 ? true : _ref6$openSingleColum2;
130
+ var _useState = useState({
131
+ fixedColumns: [],
132
+ nonFixedColumns: []
133
+ }),
134
+ _useState2 = _slicedToArray(_useState, 2),
135
+ columnsConfig = _useState2[0],
136
+ setColumnsConfig = _useState2[1];
137
+ var getChildrenColumns = useMemo(function () {
138
+ return getChildrenColumnsHoc({
139
+ sort: sortState,
140
+ handleReset: handleReset,
141
+ handleSubmit: handleSubmit,
142
+ onChangeSort: onChangeSort,
143
+ isShare: isShare,
144
+ openSingleColumnsFilter: openSingleColumnsFilter,
145
+ openSingleColumnsSort: openSingleColumnsSort
146
+ });
147
+ }, [sortState, handleReset, handleSubmit, isShare, openSingleColumnsFilter, openSingleColumnsSort, onChangeSort]);
148
+ var Title = function Title(instance) {
149
+ if (instance instanceof LogisticsInterception || instance instanceof LogisticsMoreInterception) {
150
+ return instance === null || instance === void 0 ? void 0 : instance.columnHeader;
151
+ } else {
152
+ return instance === null || instance === void 0 ? void 0 : instance.name;
153
+ }
154
+ };
155
+ var tableColumnConfig = useCallback(function (fixed) {
156
+ return function (cur, nxt) {
157
+ var canFilter = canFilterFn(nxt.type, isShare);
158
+ var instance = newRenderColumnItem({
159
+ queryWorkOrderDetail: queryWorkOrderDetail,
160
+ templateList: flatTemplateList,
161
+ shopList: shopList,
162
+ handleChangeSingleWorkOrderMark: handleChangeSingleWorkOrderMark,
163
+ userList: userList,
164
+ tbAppKey: tbAppKey
165
+ })(nxt);
166
+ var params = _objectSpread(_objectSpread({}, instance), {}, {
167
+ title: Title(instance),
168
+ dataIndex: instance.id,
169
+ formField: instance.formField,
170
+ children: getChildrenColumns(instance, nxt),
171
+ width: nxt.width,
172
+ // onHeaderCell: c => {
173
+ // return {
174
+ // width: c.width,
175
+ // onResizeStop: width => {
176
+ // setComponentWidth(c.dataIndex, width);
177
+ // handleResizeStop(c.dataIndex)(width);
178
+ // },
179
+ // };
180
+ // },
181
+ render: function render(text, record) {
182
+ if (["MSG_STATUS"].includes(instance === null || instance === void 0 ? void 0 : instance.type)) return instance === null || instance === void 0 ? void 0 : instance.renderPc(text, record);
183
+ var getToolTipTitle = function getToolTipTitle() {
184
+ if ((instance === null || instance === void 0 ? void 0 : instance.type) === "TEXTAREA") {
185
+ return /*#__PURE__*/React.createElement("div", null, instance === null || instance === void 0 ? void 0 : instance.getComponentValue(record));
186
+ } else {
187
+ return instance !== null && instance !== void 0 && instance.renderPcTooltip ? instance === null || instance === void 0 ? void 0 : instance.renderPcTooltip(text, record) : instance === null || instance === void 0 ? void 0 : instance.renderPc(text, record);
188
+ }
189
+ };
190
+ return /*#__PURE__*/React.createElement(Tooltip, {
191
+ title: getToolTipTitle(),
192
+ placement: "topLeft"
193
+ }, instance === null || instance === void 0 ? void 0 : instance.renderPc(text, record));
194
+ },
195
+ //todo 合并单元格
196
+ onCell: function onCell(record, rowIndex) {
197
+ if (SplitRowsType.includes(instance.type)) {
198
+ return {
199
+ rowSpan: 1
200
+ };
201
+ } else {
202
+ if (rowIndex === record.startIndex) {
203
+ return {
204
+ rowSpan: record.rowSpan
205
+ };
206
+ } else {
207
+ return {
208
+ rowSpan: 0
209
+ };
210
+ }
211
+ }
212
+ },
213
+ features: {
214
+ autoRowSpan: function autoRowSpan(prevValue, value, prevRow, row) {
215
+ var _prevRow$rowKey2, _row$rowKey2;
216
+ if (SplitRowsType.includes(instance.type)) {
217
+ return false;
218
+ }
219
+ var _ref7 = (prevRow === null || prevRow === void 0 ? void 0 : (_prevRow$rowKey2 = prevRow.rowKey) === null || _prevRow$rowKey2 === void 0 ? void 0 : _prevRow$rowKey2.split("-")) || [],
220
+ _ref8 = _slicedToArray(_ref7, 1),
221
+ lastKey = _ref8[0];
222
+ var _ref9 = (row === null || row === void 0 ? void 0 : (_row$rowKey2 = row.rowKey) === null || _row$rowKey2 === void 0 ? void 0 : _row$rowKey2.split("-")) || [],
223
+ _ref10 = _slicedToArray(_ref9, 1),
224
+ currentKey = _ref10[0];
225
+ return lastKey === currentKey;
226
+ }
227
+ },
228
+ lock: fixed,
229
+ align: workOrderListAlignLeft.includes(instance === null || instance === void 0 ? void 0 : instance.type) ? "left" : "center"
230
+ });
231
+ if (fixed) {
232
+ // @ts-ignore
233
+ params.fixed = "left";
234
+ }
235
+ cur.push(params);
236
+ // console.log(cur);
237
+ return cur;
238
+ };
239
+ }, [flatTemplateList, getChildrenColumns, handleChangeSingleWorkOrderMark, handleReset, handleSubmit, isShare, onChangeSort, openSingleColumnsFilter, openSingleColumnsSort, queryWorkOrderDetail, shopList, sortState, tbAppKey, userList]);
240
+ return {
241
+ tableColumnConfig: tableColumnConfig(false)
242
+ };
243
+ };
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ import { ComponentInterface } from "../type";
3
+ export declare const useGoodsSourceFormat: (goodsSource?: NonNullable<ComponentInterface["componentConfig"]>["goodsSource"]) => {
4
+ flowTemplateKey: string | undefined;
5
+ flowNodeId: string | undefined;
6
+ templateKey: string | undefined;
7
+ filterItems: any[];
8
+ tableColumns: any[];
9
+ ShopList: ({ disabledList, shopList, valueMapping, onChange, setShopId, ...prop }: {
10
+ [prop: string]: any;
11
+ disabledList?: string[] | undefined;
12
+ shopList: {
13
+ auditStatus: number;
14
+ shopId: string;
15
+ shopName: string;
16
+ shopSource: string | number;
17
+ useStatus: number;
18
+ }[];
19
+ }) => import("react").JSX.Element;
20
+ workOrderDataToGoods: (data: any, erp: string) => Record<string, any>;
21
+ queryComponentsConfig: {
22
+ filterType: number;
23
+ preQueryComponents: {
24
+ key: string;
25
+ symbol: any;
26
+ value: any;
27
+ }[] | undefined;
28
+ };
29
+ };
@@ -0,0 +1,441 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
8
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ 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); }
17
+ import { DEFAULT_FIELD_TYPE_LIST, servers, TEMPLATE_ID } from "@kmkf-fe-packages/kmkf-utils";
18
+ import { useEffect, useState } from "react";
19
+ import ShopList from "../commonComponents/ShopList";
20
+ import { factory } from "../factory";
21
+ import { useColumnsConfig } from "./useColumnsConfig";
22
+ var toArray = function toArray(data) {
23
+ if (Array.isArray(data)) return data;
24
+ if (data && _typeof(data) === "object") return [data];
25
+ return [];
26
+ };
27
+ var stringToNumber = function stringToNumber(str) {
28
+ if (typeof str === 'number') return str;
29
+ // 检查输入是否为字符串类型
30
+ if (typeof str !== "string") return null;
31
+
32
+ // 去除首尾空白字符
33
+ str = str.trim();
34
+
35
+ // 检查是否为空字符串
36
+ if (str === "") {
37
+ return null;
38
+ }
39
+ var num = Number(str);
40
+ if (isNaN(num)) {
41
+ return null;
42
+ }
43
+ return num;
44
+ };
45
+ var getShopList = function getShopList() {
46
+ return servers.singletonWrap(function () {
47
+ return servers.queryShopList();
48
+ }, {
49
+ name: "getShopList",
50
+ key: "getShopList",
51
+ cacheTime: 1000 * 60 * 3
52
+ });
53
+ };
54
+ var queryCompanyUserSimpleInfoList = function queryCompanyUserSimpleInfoList() {
55
+ return servers.singletonWrap(function () {
56
+ return servers.queryCompanyUserSimpleInfoList();
57
+ }, {
58
+ name: "queryCompanyUserSimpleInfoList",
59
+ key: "queryCompanyUserSimpleInfoList",
60
+ cacheTime: 1000 * 60 * 3
61
+ });
62
+ };
63
+ var getPublishFlowDetail = function getPublishFlowDetail(flowTemplateKey) {
64
+ return servers.singletonWrap(function () {
65
+ return servers.getPublishFlowDetail(flowTemplateKey);
66
+ }, {
67
+ name: "getPublishFlowDetail",
68
+ key: flowTemplateKey,
69
+ cacheTime: 1000 * 10
70
+ });
71
+ };
72
+ var getGroupList = function getGroupList() {
73
+ return servers.singletonWrap(function () {
74
+ return servers.getGroupList();
75
+ }, {
76
+ name: "getGroupList",
77
+ key: "getGroupList",
78
+ cacheTime: 1000 * 60 * 3
79
+ });
80
+ };
81
+ var queryColumnsConfig = function queryColumnsConfig(params) {
82
+ return servers.singletonWrap(function () {
83
+ return servers.queryColumnsConfig(_objectSpread({
84
+ isGroupNode: false
85
+ }, params));
86
+ }, {
87
+ name: "queryColumnsConfig",
88
+ key: "".concat(params.flowTemplateKey, "_").concat(params.nodeId, "_").concat(params.templateId),
89
+ cacheTime: 1000 * 10
90
+ });
91
+ };
92
+ var sortArr = function sortArr(arr) {
93
+ return arr.sort(function (_ref, _ref2) {
94
+ var a = _ref.index;
95
+ var b = _ref2.index;
96
+ // 检查 a 和 b 是否为数字
97
+ var aIsNum = typeof a === "number" && !isNaN(a);
98
+ var bIsNum = typeof b === "number" && !isNaN(b);
99
+ if (aIsNum && bIsNum) {
100
+ // 都是数字,按数值大小排序
101
+ return a - b;
102
+ } else if (aIsNum) {
103
+ // a 是数字,b 不是,a 排在前面
104
+ return -1;
105
+ } else if (bIsNum) {
106
+ // b 是数字,a 不是,b 排在前面
107
+ return 1;
108
+ } else {
109
+ // 都不是数字,保持相对顺序(或都排最后)
110
+ return 0;
111
+ }
112
+ });
113
+ };
114
+ var findIndex = function findIndex(field, dataFilterConfig) {
115
+ var smallest = Number.MAX_VALUE;
116
+ if (dataFilterConfig) {
117
+ field.children.forEach(function (child) {
118
+ var _child$children, _dataFilterConfig;
119
+ var key = child.dataIndex || child.formField;
120
+ var index = (_child$children = child.children) !== null && _child$children !== void 0 && _child$children.length ? findIndex(child, dataFilterConfig) : (_dataFilterConfig = dataFilterConfig[key]) === null || _dataFilterConfig === void 0 ? void 0 : _dataFilterConfig.index;
121
+ if (typeof index === "number" && index < smallest) {
122
+ smallest = index;
123
+ }
124
+ });
125
+ }
126
+ return smallest < Number.MAX_VALUE ? smallest : void 0;
127
+ };
128
+ var filterTableColumn = function filterTableColumn(cols, dataFilterConfig) {
129
+ return cols.filter(function (col) {
130
+ var _col$children;
131
+ if ((_col$children = col.children) !== null && _col$children !== void 0 && _col$children.length) {
132
+ var _col$children2;
133
+ // 如果是复合组件
134
+ col.children = filterTableColumn(col.children, dataFilterConfig);
135
+ return (_col$children2 = col.children) === null || _col$children2 === void 0 ? void 0 : _col$children2.length;
136
+ } else {
137
+ var _dataFilterConfig2;
138
+ var _key = col.formField || col.dataIndex;
139
+ return dataFilterConfig === null || dataFilterConfig === void 0 ? void 0 : (_dataFilterConfig2 = dataFilterConfig[_key]) === null || _dataFilterConfig2 === void 0 ? void 0 : _dataFilterConfig2.isShow;
140
+ // return true;
141
+ }
142
+ });
143
+ };
144
+
145
+ export var useGoodsSourceFormat = function useGoodsSourceFormat(goodsSource) {
146
+ var _goodsSource$sourceSe, _goodsSource$sourceSe2, _goodsSource$sourceSe3;
147
+ var _useState = useState([]),
148
+ _useState2 = _slicedToArray(_useState, 2),
149
+ filterItems = _useState2[0],
150
+ setFilterItems = _useState2[1];
151
+ var _useState3 = useState([]),
152
+ _useState4 = _slicedToArray(_useState3, 2),
153
+ allTableColumns = _useState4[0],
154
+ setAllTableColumns = _useState4[1];
155
+ var _useState5 = useState(),
156
+ _useState6 = _slicedToArray(_useState5, 2),
157
+ flowTemplateKey = _useState6[0],
158
+ setFlowTemplateKey = _useState6[1];
159
+ var _useState7 = useState(),
160
+ _useState8 = _slicedToArray(_useState7, 2),
161
+ flowNodeId = _useState8[0],
162
+ setFlowNodeId = _useState8[1];
163
+ var _useState9 = useState(),
164
+ _useState10 = _slicedToArray(_useState9, 2),
165
+ templateKey = _useState10[0],
166
+ setTemplateKey = _useState10[1];
167
+ var _useState11 = useState(),
168
+ _useState12 = _slicedToArray(_useState11, 2),
169
+ shopList = _useState12[0],
170
+ setShopList = _useState12[1];
171
+ var _useState13 = useState(),
172
+ _useState14 = _slicedToArray(_useState13, 2),
173
+ userList = _useState14[0],
174
+ setUserList = _useState14[1];
175
+ var _useState15 = useState(),
176
+ _useState16 = _slicedToArray(_useState15, 2),
177
+ groupList = _useState16[0],
178
+ setGroupList = _useState16[1];
179
+ // 表格展示列头
180
+ var _useState17 = useState([]),
181
+ _useState18 = _slicedToArray(_useState17, 2),
182
+ tableColumns = _useState18[0],
183
+ setTableColumns = _useState18[1];
184
+ // console.log(`**** 数据源配置:`, { goodsSource, filterItems });
185
+
186
+ var queryComponentsConfig = {
187
+ filterType: {
188
+ every: 0,
189
+ some: 1
190
+ }[(goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe = goodsSource.sourceSettings) === null || _goodsSource$sourceSe === void 0 ? void 0 : _goodsSource$sourceSe.filterMode) || "every"],
191
+ preQueryComponents: goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe2 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe2 === void 0 ? void 0 : (_goodsSource$sourceSe3 = _goodsSource$sourceSe2.filterRules) === null || _goodsSource$sourceSe3 === void 0 ? void 0 : _goodsSource$sourceSe3.map(function (rule) {
192
+ var _rule$leftValue, _rule$leftValue$split;
193
+ var key = (_rule$leftValue = rule.leftValue) === null || _rule$leftValue === void 0 ? void 0 : (_rule$leftValue$split = _rule$leftValue.split(".")[2]) === null || _rule$leftValue$split === void 0 ? void 0 : _rule$leftValue$split.replace(/#$/, "");
194
+ if (key === 'flowCreator') {
195
+ var _rule$rightValue, _rule$rightValue2;
196
+ var value = new Set();
197
+ (((_rule$rightValue = rule.rightValue) === null || _rule$rightValue === void 0 ? void 0 : _rule$rightValue.staffIds) || []).map(function (userKey) {
198
+ var user = userList === null || userList === void 0 ? void 0 : userList.find(function (item) {
199
+ return item.value === userKey;
200
+ });
201
+ if (user !== null && user !== void 0 && user.label) {
202
+ value.add(user.label);
203
+ } else {
204
+ value.add(userKey);
205
+ }
206
+ });
207
+ (((_rule$rightValue2 = rule.rightValue) === null || _rule$rightValue2 === void 0 ? void 0 : _rule$rightValue2.groupIds) || []).forEach(function (groupId) {
208
+ var _group$relationUserLi;
209
+ var group = groupList === null || groupList === void 0 ? void 0 : groupList.find(function (item) {
210
+ return item.value === groupId;
211
+ });
212
+ group === null || group === void 0 ? void 0 : (_group$relationUserLi = group.relationUserList) === null || _group$relationUserLi === void 0 ? void 0 : _group$relationUserLi.map(function (item) {
213
+ value.add(item.userName);
214
+ });
215
+ });
216
+ return {
217
+ key: key,
218
+ symbol: rule.compareSymbol,
219
+ value: _toConsumableArray(value)
220
+ };
221
+ }
222
+ return {
223
+ key: key === 'shopName' ? 'shopNameList' : key,
224
+ symbol: rule.compareSymbol,
225
+ value: rule.rightValue
226
+ };
227
+ })
228
+ };
229
+ var _useColumnsConfig = useColumnsConfig({}),
230
+ tableColumnConfig = _useColumnsConfig.tableColumnConfig;
231
+ var workOrderDataToGoods = function workOrderDataToGoods(data, erp) {
232
+ var _goodsSource$sourceSe4;
233
+ // gy商品 接口返回,和选中的 都是这个
234
+ // brandName: "小白熊"
235
+ // brandNo: "BRD01"
236
+ // categoryName: "03母乳保存"
237
+ // categoryType: "18"
238
+ // companyKey: "SZF4ZGWZSNW6PYXMCIFEWBXT"
239
+ // costPrice: "13.1802"
240
+ // goodId: "535367779990"
241
+ // goodName: "母乳收集器(2只装)"
242
+ // goodNo: "XCP.01.03.20001"
243
+ // goodPicUrl: ""
244
+ // goodShortName: "08395"
245
+ // id: 162457
246
+ // isGift: false
247
+ // isSkuItem: true
248
+ // isVirtual: false
249
+ // platform: "GY_ERP"
250
+ // retailPrice: "59.0"
251
+ // specBarcode: "6951406983951"
252
+ // specId: "535367763578"
253
+ // specName: "2入装"
254
+ // specNo: "XCP.01.03.20001"
255
+
256
+ // 配置的值 keyMap
257
+ // amount: "adidBRdsfi"
258
+ // amountAfter: "qzBjJj8sfi"
259
+ // cancel: "qzBjJj8sfi"
260
+ // discountFee: "qzBjJj8sfi"
261
+ // goodName: "qzBjJj8sfi"
262
+ // goodNo: "Q8ZZHLWlki"
263
+ // goodShortName: "adidBRdsfi"
264
+ // isGift: "qzBjJj8sfi"
265
+ // originAmount: "qzBjJj8sfi"
266
+ // originPrice: "qzBjJj8sfi"
267
+ // price: "qzBjJj8sfi"
268
+ // qty: "qzBjJj8sfi"
269
+ // skuNote: "qzBjJj8sfi"
270
+ // specName: "qzBjJj8sfi"
271
+ // specNo: "qzBjJj8sfi"
272
+ // console.log("*** 商品 数据转换", {
273
+ // data,
274
+ // erp,
275
+ // keyMap: goodsSource?.sourceSettings.keyMap,
276
+ // });
277
+ var goods = {};
278
+ var keyMap = (goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe4 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe4 === void 0 ? void 0 : _goodsSource$sourceSe4.keyMap) || {};
279
+ var ids = _toConsumableArray(new Set(Object.values(keyMap)));
280
+ var fieldMap = new Map();
281
+ ids.forEach(function (id) {
282
+ var field = allTableColumns.find(function (column) {
283
+ return column.id === id;
284
+ });
285
+ if (field) {
286
+ fieldMap.set(id, field);
287
+ }
288
+ });
289
+ // console.log(`🚀 ~ 组件 ids:`, ids, allTableColumns, fieldMap);
290
+ Object.entries(keyMap).forEach(function (_ref3) {
291
+ var _ref4 = _slicedToArray(_ref3, 2),
292
+ key = _ref4[0],
293
+ id = _ref4[1];
294
+ var field = fieldMap.get(id);
295
+ if (!field) return;
296
+ // PS: 当前只有输入框/多行文本框/单选/下拉单选 所以不用考虑复合组件
297
+ var fillValue = field.formField ? data[field.formField] : void 0;
298
+ if (field.type === "RADIO" && data["".concat(field.id, "_radioOther")]) {
299
+ fillValue = data["".concat(field.id, "_radioOther")];
300
+ }
301
+ if (["isGift", "cancel"].includes(key)) {
302
+ fillValue = fillValue === "是" ? 1 : fillValue === "否" ? 0 : void 0;
303
+ }
304
+ goods[key] = ["qty", "price", "amount", "originPrice", "originAmount", "discountFee", "amountAfter"].includes(key) ? stringToNumber(fillValue) : fillValue;
305
+ });
306
+ goods.id = data.id;
307
+ // console.log("***** 转换之后的 values", goods);
308
+ return goods;
309
+ };
310
+ useEffect(function () {
311
+ getShopList().then(function (_ref5) {
312
+ var data = _ref5.data;
313
+ setShopList(data);
314
+ }).catch(console.warn);
315
+ queryCompanyUserSimpleInfoList().then(function (_ref6) {
316
+ var data = _ref6.data;
317
+ setUserList((data || []).map(function (_ref7) {
318
+ var account = _ref7.account,
319
+ userKey = _ref7.userKey;
320
+ return {
321
+ label: account,
322
+ value: userKey
323
+ };
324
+ }));
325
+ }).catch(console.warn);
326
+ getGroupList().then(function (_ref8) {
327
+ var data = _ref8.data;
328
+ setGroupList((data || []).map(function (_ref9) {
329
+ var groupUniqueKey = _ref9.groupUniqueKey,
330
+ groupName = _ref9.groupName,
331
+ relationUserList = _ref9.relationUserList;
332
+ return {
333
+ label: groupName,
334
+ value: groupUniqueKey,
335
+ relationUserList: relationUserList
336
+ };
337
+ }));
338
+ }).catch(console.warn);
339
+
340
+ // return () => {
341
+ // setShopList(void 0);
342
+ // setUserList(void 0);
343
+ // setGroupList(void 0);
344
+ // };
345
+ }, []);
346
+ useEffect(function () {
347
+ var _goodsSource$sourceSe5;
348
+ var _ref10 = (goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe5 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe5 === void 0 ? void 0 : _goodsSource$sourceSe5.workOrder) || {},
349
+ flowTemplateKey = _ref10.flowTemplateKey,
350
+ nodeId = _ref10.nodeId;
351
+ if ((goodsSource === null || goodsSource === void 0 ? void 0 : goodsSource.source) === "workOrder" && flowTemplateKey && nodeId && shopList && userList && groupList) {
352
+ setFilterItems([]);
353
+ setAllTableColumns([]);
354
+ setTemplateKey(undefined);
355
+ setTableColumns([]);
356
+ setFlowTemplateKey(flowTemplateKey);
357
+ setFlowNodeId(nodeId);
358
+ getPublishFlowDetail(flowTemplateKey).then(function (_ref11) {
359
+ var _data$flowConfig, _data$flowConfig$node, _currentNodeInfo$rela;
360
+ var data = _ref11.data;
361
+ var currentNodeInfo = data === null || data === void 0 ? void 0 : (_data$flowConfig = data.flowConfig) === null || _data$flowConfig === void 0 ? void 0 : (_data$flowConfig$node = _data$flowConfig.nodes) === null || _data$flowConfig$node === void 0 ? void 0 : _data$flowConfig$node.find(function (node) {
362
+ return node.id === nodeId;
363
+ });
364
+ var workOrderTemplateId = currentNodeInfo === null || currentNodeInfo === void 0 ? void 0 : (_currentNodeInfo$rela = currentNodeInfo.relationEvent) === null || _currentNodeInfo$rela === void 0 ? void 0 : _currentNodeInfo$rela.workOrderTemplateId;
365
+ // console.log("**** in 获取到流程数据", {
366
+ // data,
367
+ // currentNodeInfo,
368
+ // workOrderTemplateId,
369
+ // });
370
+ if (workOrderTemplateId) {
371
+ queryColumnsConfig({
372
+ flowTemplateKey: flowTemplateKey,
373
+ nodeId: nodeId,
374
+ templateId: workOrderTemplateId
375
+ }).then(function (_ref12) {
376
+ var _data$fixedColumns, _goodsSource$sourceSe13;
377
+ var data = _ref12.data;
378
+ var columnsList = data === null || data === void 0 ? void 0 : (_data$fixedColumns = data.fixedColumns) === null || _data$fixedColumns === void 0 ? void 0 : _data$fixedColumns.concat(data === null || data === void 0 ? void 0 : data.nonFixedColumns);
379
+ var newFilterItems = [];
380
+ columnsList === null || columnsList === void 0 ? void 0 : columnsList.forEach(function (l) {
381
+ var instance = factory(l.type, {
382
+ id: l.id,
383
+ name: l.name,
384
+ type: l.type,
385
+ componentConfig: _objectSpread(_objectSpread({}, l === null || l === void 0 ? void 0 : l.config), l === null || l === void 0 ? void 0 : l.templateConfig),
386
+ renderExport: function renderExport() {
387
+ return null;
388
+ },
389
+ effects: {
390
+ shopList: shopList,
391
+ userList: userList,
392
+ groupList: groupList
393
+ }
394
+ });
395
+ var filterConfigList = toArray(instance === null || instance === void 0 ? void 0 : instance.filterConfig(l)).filter(function (item) {
396
+ var _goodsSource$sourceSe6, _goodsSource$sourceSe7;
397
+ return ((_goodsSource$sourceSe6 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe6 === void 0 ? void 0 : (_goodsSource$sourceSe7 = _goodsSource$sourceSe6.dataFilterConfig[item.formField || item.id]) === null || _goodsSource$sourceSe7 === void 0 ? void 0 : _goodsSource$sourceSe7.isFilter) && !(DEFAULT_FIELD_TYPE_LIST.includes(item.type) || item.type === TEMPLATE_ID);
398
+ });
399
+ newFilterItems = newFilterItems.concat(filterConfigList.map(function (item) {
400
+ var _goodsSource$sourceSe8, _goodsSource$sourceSe9;
401
+ item.index = (_goodsSource$sourceSe8 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe8 === void 0 ? void 0 : (_goodsSource$sourceSe9 = _goodsSource$sourceSe8.dataFilterConfig[item.formField || item.id]) === null || _goodsSource$sourceSe9 === void 0 ? void 0 : _goodsSource$sourceSe9.index;
402
+ return item;
403
+ }));
404
+ });
405
+ var allTableColumns = sortArr(columnsList.reduce(tableColumnConfig, []).map(function (item) {
406
+ var _item$children, _goodsSource$sourceSe10, _goodsSource$sourceSe11, _goodsSource$sourceSe12;
407
+ var _index = (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length ? findIndex(item, (_goodsSource$sourceSe10 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe10 === void 0 ? void 0 : _goodsSource$sourceSe10.dataFilterConfig) : (_goodsSource$sourceSe11 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe11 === void 0 ? void 0 : (_goodsSource$sourceSe12 = _goodsSource$sourceSe11.dataFilterConfig[item.sortField]) === null || _goodsSource$sourceSe12 === void 0 ? void 0 : _goodsSource$sourceSe12.index;
408
+ item.index = _index;
409
+ return item;
410
+ }));
411
+ var newTableColumns = filterTableColumn(allTableColumns, (_goodsSource$sourceSe13 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe13 === void 0 ? void 0 : _goodsSource$sourceSe13.dataFilterConfig);
412
+ setTableColumns(newTableColumns);
413
+ setFilterItems(sortArr(newFilterItems));
414
+ setAllTableColumns(allTableColumns);
415
+ setTemplateKey(workOrderTemplateId);
416
+ // console.log("**** in 获取到表头信息", {
417
+ // newTableColumns,
418
+ // data,
419
+ // newFilterItems,
420
+ // allTableColumns,
421
+ // });
422
+ }).catch(function (error) {
423
+ console.log("**** 获取表头信息 error", error);
424
+ });
425
+ }
426
+ }).catch(function (error) {
427
+ console.log("**** in 获取流程数据 error", error);
428
+ });
429
+ }
430
+ }, [shopList, userList, groupList]);
431
+ return {
432
+ flowTemplateKey: flowTemplateKey,
433
+ flowNodeId: flowNodeId,
434
+ templateKey: templateKey,
435
+ filterItems: filterItems,
436
+ tableColumns: tableColumns,
437
+ ShopList: ShopList,
438
+ workOrderDataToGoods: workOrderDataToGoods,
439
+ queryComponentsConfig: queryComponentsConfig
440
+ };
441
+ };
@@ -25,6 +25,8 @@ declare class BsLogistics implements ComponentInterface {
25
25
  dataType: ComponentInterface["dataType"];
26
26
  expressCompany: ExpressCompany;
27
27
  expressCode: ExpressCode;
28
+ isChange: boolean;
29
+ effects: ComponentInterface["effects"];
28
30
  constructor(options: PickOption);
29
31
  renderClient: (record: any) => React.JSX.Element | null;
30
32
  getSortChildFields: (type: string, options: PickOption) => any;
@@ -133,6 +133,8 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
133
133
  _defineProperty(this, "dataType", void 0);
134
134
  _defineProperty(this, "expressCompany", void 0);
135
135
  _defineProperty(this, "expressCode", void 0);
136
+ _defineProperty(this, "isChange", void 0);
137
+ _defineProperty(this, "effects", void 0);
136
138
  _defineProperty(this, "renderClient", function (record) {
137
139
  var _typeMap$_this$type;
138
140
  var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
@@ -195,6 +197,23 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
195
197
  });
196
198
  _defineProperty(this, "editRender", function (p) {
197
199
  var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4, _this$expressDateInst2, _typeMap$_this$type6;
200
+ var onLogisticsCodeBlur = function onLogisticsCodeBlur(val) {
201
+ if (_this.isChange) {
202
+ var _this$effects, _this$effects$form, _p$onBlur;
203
+ (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : (_this$effects$form = _this$effects.form) === null || _this$effects$form === void 0 ? void 0 : _this$effects$form.setFieldsValue({
204
+ skx_return_billNo_blur_from: _this.id
205
+ });
206
+ _this.type === "SKX_RETURN_LOGISTICS" && (p === null || p === void 0 ? void 0 : (_p$onBlur = p.onBlur) === null || _p$onBlur === void 0 ? void 0 : _p$onBlur.call(p, val, "skxReturnTHLogisticsCode"));
207
+ _this.isChange = false;
208
+ }
209
+ };
210
+ var onLogisticsCodeChange = function onLogisticsCodeChange() {
211
+ _this.isChange = true;
212
+ for (var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++) {
213
+ e[_key] = arguments[_key];
214
+ }
215
+ p === null || p === void 0 ? void 0 : p.onChange.apply(p, e);
216
+ };
198
217
  return /*#__PURE__*/React.createElement(GetFormItem, {
199
218
  title: _this.name,
200
219
  name: _this.id,
@@ -207,7 +226,8 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
207
226
  type: 1,
208
227
  platformType: _this.platformType,
209
228
  options: ((_this$expressDateInst2 = _this.expressDateInstance) === null || _this$expressDateInst2 === void 0 ? void 0 : _this$expressDateInst2.getExpressData()) || [],
210
- onChange: p === null || p === void 0 ? void 0 : p.onChange,
229
+ onChange: onLogisticsCodeChange,
230
+ onBlur: onLogisticsCodeBlur,
211
231
  logisticsCompanyFormType: (_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.logisticsCompanyFormType
212
232
  }))
213
233
  });
@@ -229,6 +249,8 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
229
249
  this.componentConfig = _options.componentConfig;
230
250
  this.isCombinationComponent = true;
231
251
  this.canSort = false;
252
+ this.isChange = false;
253
+ this.effects = _options.effects;
232
254
  this.expressCompany = new ExpressCompany(_objectSpread(_objectSpread({}, _options), {}, {
233
255
  name: "物流公司",
234
256
  parentName: this.name,
@@ -1357,7 +1357,7 @@ var GoodHeaderMap = {
1357
1357
  headerMap: {
1358
1358
  skuEcode: {
1359
1359
  name: "[SKX]发货单明细-skuEcode",
1360
- width: 200
1360
+ width: 250
1361
1361
  },
1362
1362
  subOrderId: {
1363
1363
  name: "[SKX]发货单-子订单号",
@@ -1373,7 +1373,7 @@ var GoodHeaderMap = {
1373
1373
  headerMap: {
1374
1374
  returnSkuEcode: {
1375
1375
  name: "[SKX]退货单明细-returnSkuEcode",
1376
- width: 200
1376
+ width: 300
1377
1377
  },
1378
1378
  returnSubOrderId: {
1379
1379
  name: "[SKX]退货单-子订单号",
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import TradeId from '../TradeId';
1
+ import React from "react";
2
+ import TradeId from "../TradeId";
3
3
  declare class ErpTradeId extends TradeId {
4
4
  editRender: (p: any) => React.JSX.Element;
5
5
  }
@@ -13,7 +13,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
13
13
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
14
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
15
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
- import React from 'react';
16
+ import React from "react";
17
17
  import GetFormItem from "../GetFormItem";
18
18
  import TradeId from "../TradeId";
19
19
  import OrderNo from "./components/OrderNum";
@@ -30,8 +30,11 @@ var ErpTradeId = /*#__PURE__*/function (_TradeId) {
30
30
  _defineProperty(_assertThisInitialized(_this), "editRender", function (p) {
31
31
  var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4;
32
32
  var onTradeIdBlur = function onTradeIdBlur(value) {
33
- var _p$onBlur;
34
- p === null || p === void 0 ? void 0 : (_p$onBlur = p.onBlur) === null || _p$onBlur === void 0 ? void 0 : _p$onBlur.call(p, value, 'tradeId');
33
+ var _this$effects, _this$effects$form, _p$onBlur;
34
+ (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : (_this$effects$form = _this$effects.form) === null || _this$effects$form === void 0 ? void 0 : _this$effects$form.setFieldsValue({
35
+ skx_return_billNo_blur_from: _this.id
36
+ });
37
+ p === null || p === void 0 ? void 0 : (_p$onBlur = p.onBlur) === null || _p$onBlur === void 0 ? void 0 : _p$onBlur.call(p, value, "tradeId");
35
38
  };
36
39
  return /*#__PURE__*/React.createElement(GetFormItem, {
37
40
  title: _this.name,
@@ -40,7 +43,7 @@ var ErpTradeId = /*#__PURE__*/function (_TradeId) {
40
43
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
41
44
  display: p === null || p === void 0 ? void 0 : p.display,
42
45
  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,
43
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
46
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
44
47
  component: /*#__PURE__*/React.createElement(OrderNo, _extends({}, _this.componentConfig, {
45
48
  placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
46
49
  onTradeIdBlur: onTradeIdBlur
@@ -16,9 +16,11 @@ import GetFormItem from "../GetFormItem";
16
16
  import { SYMBOL } from "../../constant";
17
17
  import reject from "../Common/img/reject.png";
18
18
  import reminder from "../Common/img/reminder.png";
19
+ import ai from "../Common/img/ai.png";
19
20
  var TAG_MAP = {
20
21
  REMINDER: "催单",
21
- REJECT: "驳回"
22
+ REJECT: "驳回",
23
+ AI_BUILD: "AI自动建单"
22
24
  };
23
25
  var TAG_ICON_MAP = {
24
26
  REMINDER: /*#__PURE__*/React.createElement("img", {
@@ -32,6 +34,12 @@ var TAG_ICON_MAP = {
32
34
  style: {
33
35
  width: "16px"
34
36
  }
37
+ }),
38
+ AI_BUILD: /*#__PURE__*/React.createElement("img", {
39
+ src: ai,
40
+ style: {
41
+ width: "16px"
42
+ }
35
43
  })
36
44
  };
37
45
  var FlowTag = /*#__PURE__*/_createClass(function FlowTag(options) {
@@ -93,7 +101,7 @@ var FlowTag = /*#__PURE__*/_createClass(function FlowTag(options) {
93
101
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
94
102
  display: p === null || p === void 0 ? void 0 : p.display,
95
103
  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,
96
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
104
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
97
105
  component: /*#__PURE__*/React.createElement(ApaasSelect, _extends({}, _this.componentConfig, {
98
106
  placeholder: "\u8BF7\u9009\u62E9".concat(_this.name)
99
107
  }))
@@ -16,6 +16,7 @@ import ItemView from "../../../commonComponents/ItemView";
16
16
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
17
  import { CommonGoods as Goods } from "@kmkf-fe-packages/basic-components";
18
18
  import { SYMBOL } from "../../../constant";
19
+ import { useGoodsSourceFormat } from "../../../Hooks";
19
20
  var GyGoods = /*#__PURE__*/_createClass(function GyGoods(options) {
20
21
  var _this = this,
21
22
  _this$componentConfig6;
@@ -74,6 +75,7 @@ var GyGoods = /*#__PURE__*/_createClass(function GyGoods(options) {
74
75
  display: p === null || p === void 0 ? void 0 : p.display,
75
76
  tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
76
77
  component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
78
+ useGoodsSourceFormat: useGoodsSourceFormat,
77
79
  maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
78
80
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
79
81
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
@@ -17,6 +17,7 @@ import { SYMBOL } from "../../../constant";
17
17
  import { BsGoodsTable } from "../../Common/index";
18
18
  import { BsType, BsMemo, SystemOrderNo } from "../../BS/common/index";
19
19
  import CommonHeaderGoods from "../../CommonHeaderGood";
20
+ import { useGoodsSourceFormat } from "../../../Hooks";
20
21
  var typeMap = {
21
22
  GY_REISSUE_GOODS: {
22
23
  key: "gyReissueGoods",
@@ -105,6 +106,7 @@ var GyReissue = /*#__PURE__*/_createClass(function GyReissue(options) {
105
106
  tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
106
107
  isGyReissue: true,
107
108
  component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
109
+ useGoodsSourceFormat: useGoodsSourceFormat,
108
110
  maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
109
111
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
110
112
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
@@ -17,6 +17,7 @@ import { BsGoodsTable } from "../../Common";
17
17
  import CommonHeaderGoods from "../../CommonHeaderGood";
18
18
  import { GyReturn as Return, erpFormValidator } from "@kmkf-fe-packages/basic-components";
19
19
  import { BsType, SystemOrderNo } from "../../BS/common/index";
20
+ import { useGoodsSourceFormat } from "../../../Hooks";
20
21
  var typeMap = {
21
22
  GY_RETURN_GOODS: {
22
23
  key: "gyReturnGoods",
@@ -101,6 +102,7 @@ var GyReturn = /*#__PURE__*/_createClass(function GyReturn(options) {
101
102
  display: p === null || p === void 0 ? void 0 : p.display,
102
103
  tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
103
104
  component: /*#__PURE__*/React.createElement(Return, _extends({}, _this.componentConfig, {
105
+ useGoodsSourceFormat: useGoodsSourceFormat,
104
106
  maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
105
107
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
106
108
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
@@ -230,10 +230,12 @@ function OrderSubForm(options) {
230
230
  if (item.widget === "upload") {
231
231
  return new BsHeaderPic(_objectSpread(_objectSpread({}, options), {}, {
232
232
  name: item.title,
233
+ width: (item === null || item === void 0 ? void 0 : item.width) || 150,
233
234
  id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex)
234
235
  }));
235
236
  } else if (item.widget === "select") {
236
237
  return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
238
+ width: (item === null || item === void 0 ? void 0 : item.width) || 150,
237
239
  name: item.title,
238
240
  id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex),
239
241
  transformValue: function transformValue(val) {
@@ -245,6 +247,7 @@ function OrderSubForm(options) {
245
247
  }));
246
248
  } else if (item.widget === "datePicker") {
247
249
  return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
250
+ width: (item === null || item === void 0 ? void 0 : item.width) || 150,
248
251
  name: item.title,
249
252
  id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex),
250
253
  transformValue: function transformValue(val) {
@@ -256,6 +259,7 @@ function OrderSubForm(options) {
256
259
  }));
257
260
  } else {
258
261
  return new BsHeaderChild(_objectSpread(_objectSpread({}, options), {}, {
262
+ width: (item === null || item === void 0 ? void 0 : item.width) || 150,
259
263
  name: item.title,
260
264
  id: "".concat(options.id, "_subOrderList_").concat(item.dataIndex)
261
265
  }));
@@ -263,6 +267,5 @@ function OrderSubForm(options) {
263
267
  });
264
268
  this.dataType = "object";
265
269
  this.expressDateInstance = ExpressData.getInstance();
266
- console.log("componentConfig", this.componentConfig);
267
270
  });
268
271
  export default OrderSubForm;
@@ -1,5 +1,5 @@
1
- import { ComponentInterface, PickOption, Record, ColumnConfig } from '../../type';
2
- import React from 'react';
1
+ import { ComponentInterface, PickOption, Record, ColumnConfig } from "../../type";
2
+ import React from "react";
3
3
  declare class ETradeId implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
@@ -8,13 +8,13 @@ declare class ETradeId implements ComponentInterface {
8
8
  rules: any[];
9
9
  showContains: boolean;
10
10
  onlyContainsString: boolean;
11
- componentConfig: ComponentInterface['componentConfig'];
12
- effects: ComponentInterface['effects'];
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['dataType'];
17
+ dataType: ComponentInterface["dataType"];
18
18
  constructor(options: PickOption);
19
19
  renderClient: (record: any) => React.JSX.Element | null;
20
20
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
@@ -6,11 +6,11 @@ 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 'react';
10
- import { TradeId } from '@kmkf-fe-packages/basic-components';
9
+ import React from "react";
10
+ import { TradeId } from "@kmkf-fe-packages/basic-components";
11
11
  import GetFormItem from "../GetFormItem";
12
12
  import ItemView from "../../commonComponents/ItemView";
13
- import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
13
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
14
14
  import { SYMBOL, batchInput } from "../../constant";
15
15
  import CopyText from "../../commonComponents/CopyText";
16
16
  var ETradeId = /*#__PURE__*/_createClass(function ETradeId(options) {
@@ -50,7 +50,7 @@ var ETradeId = /*#__PURE__*/_createClass(function ETradeId(options) {
50
50
  }, /*#__PURE__*/React.createElement(CopyText, {
51
51
  text: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_tradeId")],
52
52
  style: {
53
- color: ((record === null || record === void 0 ? void 0 : record.repeatValueKeys) || []).includes("".concat(_this.id, "_tradeId")) ? 'red' : 'inherit'
53
+ color: ((record === null || record === void 0 ? void 0 : record.repeatValueKeys) || []).includes("".concat(_this.id, "_tradeId")) ? "red" : "inherit"
54
54
  }
55
55
  }));
56
56
  });
@@ -63,13 +63,16 @@ var ETradeId = /*#__PURE__*/_createClass(function ETradeId(options) {
63
63
  });
64
64
  _defineProperty(this, "renderExport", function (value, record) {
65
65
  var _record;
66
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_tradeId")]) !== null && _record !== void 0 ? _record : '--';
66
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_tradeId")]) !== null && _record !== void 0 ? _record : "--";
67
67
  });
68
68
  _defineProperty(this, "editRender", function (p) {
69
- var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4, _this$effects, _this$effects2;
69
+ var _this$componentConfig, _this$componentConfig2, _this$componentConfig3, _this$componentConfig4, _this$effects2, _this$effects3;
70
70
  var onTradeIdBlur = function onTradeIdBlur(e) {
71
- var _p$onBlur;
72
- p === null || p === void 0 ? void 0 : (_p$onBlur = p.onBlur) === null || _p$onBlur === void 0 ? void 0 : _p$onBlur.call(p, e.target.value, 'tradeId');
71
+ var _this$effects, _this$effects$form, _p$onBlur;
72
+ (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : (_this$effects$form = _this$effects.form) === null || _this$effects$form === void 0 ? void 0 : _this$effects$form.setFieldsValue({
73
+ skx_return_billNo_blur_from: _this.id
74
+ });
75
+ p === null || p === void 0 ? void 0 : (_p$onBlur = p.onBlur) === null || _p$onBlur === void 0 ? void 0 : _p$onBlur.call(p, e.target.value, "tradeId");
73
76
  };
74
77
  return /*#__PURE__*/React.createElement(GetFormItem, {
75
78
  title: _this.name,
@@ -78,10 +81,10 @@ var ETradeId = /*#__PURE__*/_createClass(function ETradeId(options) {
78
81
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
79
82
  display: p === null || p === void 0 ? void 0 : p.display,
80
83
  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,
81
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
84
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
82
85
  component: /*#__PURE__*/React.createElement(TradeId, _extends({}, _this.componentConfig, {
83
- shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
84
- shopList: (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList,
86
+ shopId: (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopId,
87
+ shopList: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.shopList,
85
88
  placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
86
89
  onBlur: onTradeIdBlur
87
90
  }))
@@ -95,10 +98,10 @@ var ETradeId = /*#__PURE__*/_createClass(function ETradeId(options) {
95
98
  // 过滤组件id
96
99
  name: item.name,
97
100
  // 过滤组件名称
98
- filterComponentType: 'TradeInput',
101
+ filterComponentType: "TradeInput",
99
102
  filterFn: function filterFn(value) {
100
103
  return function (i) {
101
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'tradeId'), value);
104
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "tradeId"), value);
102
105
  };
103
106
  },
104
107
  formatFilterValue: function formatFilterValue(value) {
@@ -119,6 +122,6 @@ var ETradeId = /*#__PURE__*/_createClass(function ETradeId(options) {
119
122
  this.isCombinationComponent = false;
120
123
  this.canSort = true;
121
124
  this.children = [];
122
- this.dataType = 'string';
125
+ this.dataType = "string";
123
126
  });
124
127
  export default ETradeId;
@@ -113,3 +113,4 @@ export { default as Global } from "./commonComponents/GlobalContext";
113
113
  export * as ErpScenes from "./commonComponents/ErpContext";
114
114
  export * as servers from "./service/api";
115
115
  export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
116
+ export * from "./Hooks";
package/dist/esm/index.js CHANGED
@@ -115,4 +115,5 @@ import * as _ErpScenes from "./commonComponents/ErpContext";
115
115
  export { _ErpScenes as ErpScenes };
116
116
  import * as _servers from "./service/api";
117
117
  export { _servers as servers };
118
- export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
118
+ export { default as QueryLogisticsTrack } from "./commonComponents/QueryLogisticsTrack";
119
+ export * from "./Hooks";
@@ -77,6 +77,34 @@ export interface ComponentInterface {
77
77
  */
78
78
  formItemIndex?: number;
79
79
  componentConfig?: {
80
+ /**
81
+ * @description 商品类组件选择商品来源配置
82
+ */
83
+ goodsSource?: {
84
+ source?: "workOrder" | "erp";
85
+ sourceSettings?: {
86
+ filterMode?: "some" | "every";
87
+ filterRules?: {
88
+ leftValue: string;
89
+ compareSymbol: any;
90
+ rightValue?: any;
91
+ }[];
92
+ dataFilterConfig: {
93
+ [cpId: string]: {
94
+ isFilter?: boolean;
95
+ isShow?: boolean;
96
+ index?: number;
97
+ };
98
+ };
99
+ keyMap: {
100
+ [key: string]: string;
101
+ };
102
+ workOrder: {
103
+ flowTemplateKey: string;
104
+ nodeId: string;
105
+ };
106
+ };
107
+ };
80
108
  /**
81
109
  * @description 特殊自定义组件有的值
82
110
  */
@@ -303,3 +331,12 @@ export declare type ColumnConfig = {
303
331
  config?: ComponentInterface["componentConfig"];
304
332
  templateConfig?: ComponentInterface["componentConfig"];
305
333
  };
334
+ export interface ColumnsConfigI {
335
+ show: boolean;
336
+ delete: boolean;
337
+ width: number;
338
+ name: string;
339
+ id: string;
340
+ type: string;
341
+ config?: any;
342
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.2.10",
3
+ "version": "2.2.12",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "2.2.10",
25
- "@kmkf-fe-packages/kmkf-utils": "2.2.10",
24
+ "@kmkf-fe-packages/basic-components": "2.2.12",
25
+ "@kmkf-fe-packages/kmkf-utils": "2.2.11",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "83e9ea0698aeb5557e811db03dce4299dc67981a",
44
+ "gitHead": "5cd274e95ebaeba0c49da41667f1df8222873017",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }