@kmkf-fe-packages/basic-components 2.2.13-beta.32 → 2.2.13-beta.33
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/index.esm.js
CHANGED
|
@@ -17454,6 +17454,9 @@ var WorkorderList = function WorkorderList(props, ref) {
|
|
|
17454
17454
|
return selectedList.map(function (workOrderData) {
|
|
17455
17455
|
return goodsSourceFormat.workOrderDataToGoods(workOrderData, props.erp);
|
|
17456
17456
|
});
|
|
17457
|
+
},
|
|
17458
|
+
setTypeDefaultSearchValue: function setTypeDefaultSearchValue(value) {
|
|
17459
|
+
value && form.setFieldsValue(_objectSpread2({}, value));
|
|
17457
17460
|
}
|
|
17458
17461
|
};
|
|
17459
17462
|
});
|
|
@@ -17732,6 +17735,32 @@ var WorkorderList = function WorkorderList(props, ref) {
|
|
|
17732
17735
|
};
|
|
17733
17736
|
var WorkorderList$1 = /*#__PURE__*/forwardRef(WorkorderList);
|
|
17734
17737
|
|
|
17738
|
+
var relationComponentUniqueKeyMap = {
|
|
17739
|
+
PCE2Z5TXEVPL5D26I7KMBKMB: '6hldjQ9aMz',
|
|
17740
|
+
SZF4ZGWZSNW6PYXMCIFEWBXT: 'abVTwFX34E' //测马奔腾的补货类型自定义组件
|
|
17741
|
+
};
|
|
17742
|
+
|
|
17743
|
+
var typeSearchComponentUniqueKeyMap = {
|
|
17744
|
+
PCE2Z5TXEVPL5D26I7KMBKMB: 'C7M9rWJMjD_radio',
|
|
17745
|
+
SZF4ZGWZSNW6PYXMCIFEWBXT: 'ipOHnYquYB_radio' //测马奔腾的类型自定义组件
|
|
17746
|
+
};
|
|
17747
|
+
// 该方法只用于小白熊定制,当管易商品/管易补发/管易退换货组件的数据来源于关联工单数据,且其补发类型自定义组件选了值,根据该值填充到商品库弹框中类型筛选项
|
|
17748
|
+
var useTypeDefaultSearchValue = (function (props) {
|
|
17749
|
+
var _form$getFieldValue, _form$getFieldValue2;
|
|
17750
|
+
var form = props.form,
|
|
17751
|
+
_props$companyKey = props.companyKey,
|
|
17752
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
17753
|
+
source = props.source,
|
|
17754
|
+
erp = props.erp;
|
|
17755
|
+
if (source !== 'workOrder' || erp !== 'gy') {
|
|
17756
|
+
return '';
|
|
17757
|
+
}
|
|
17758
|
+
var relationComponentKey = relationComponentUniqueKeyMap === null || relationComponentUniqueKeyMap === void 0 ? void 0 : relationComponentUniqueKeyMap[companyKey];
|
|
17759
|
+
var typeSearchComponentKey = typeSearchComponentUniqueKeyMap === null || typeSearchComponentUniqueKeyMap === void 0 ? void 0 : typeSearchComponentUniqueKeyMap[companyKey];
|
|
17760
|
+
var relationComponentValue = relationComponentKey ? (form === null || form === void 0 ? void 0 : (_form$getFieldValue = form.getFieldValue(relationComponentKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.value) ? _defineProperty({}, typeSearchComponentKey, [form === null || form === void 0 ? void 0 : (_form$getFieldValue2 = form.getFieldValue(relationComponentKey)) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.value]) : '' : '';
|
|
17761
|
+
return relationComponentValue;
|
|
17762
|
+
});
|
|
17763
|
+
|
|
17735
17764
|
// interface GoodModelProps {
|
|
17736
17765
|
// shopId: number | string;
|
|
17737
17766
|
// maxLength: number;
|
|
@@ -17742,32 +17771,55 @@ var WorkorderList$1 = /*#__PURE__*/forwardRef(WorkorderList);
|
|
|
17742
17771
|
// onSubmit: (...args: any[]) => any;
|
|
17743
17772
|
// }
|
|
17744
17773
|
var GyGoodsModal$1 = function GyGoodsModal(props, ref) {
|
|
17745
|
-
var _props$goodsSource;
|
|
17774
|
+
var _props$goodsSource, _props$goodsSource3;
|
|
17746
17775
|
var _useState = useState(),
|
|
17747
17776
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17748
17777
|
seletedGooods = _useState2[0],
|
|
17749
17778
|
setSeletedGooods = _useState2[1];
|
|
17779
|
+
var onSubmit = props.onSubmit,
|
|
17780
|
+
width = props.width;
|
|
17781
|
+
var _useState3 = useState(false),
|
|
17782
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17783
|
+
visible = _useState4[0],
|
|
17784
|
+
setVisible = _useState4[1];
|
|
17785
|
+
var goodsListRef = useRef(null);
|
|
17786
|
+
var typeDefaultSearchValue = useTypeDefaultSearchValue({
|
|
17787
|
+
form: props === null || props === void 0 ? void 0 : props.form,
|
|
17788
|
+
companyKey: props === null || props === void 0 ? void 0 : props.companyKey,
|
|
17789
|
+
source: (_props$goodsSource = props.goodsSource) === null || _props$goodsSource === void 0 ? void 0 : _props$goodsSource.source,
|
|
17790
|
+
erp: 'gy'
|
|
17791
|
+
});
|
|
17750
17792
|
useImperativeHandle(ref, function () {
|
|
17751
17793
|
return {
|
|
17752
17794
|
open: function open(shopCode, options) {
|
|
17795
|
+
var _props$goodsSource2;
|
|
17753
17796
|
setSeletedGooods((options === null || options === void 0 ? void 0 : options.value) || []);
|
|
17797
|
+
var typeDefaultSearchValue = useTypeDefaultSearchValue({
|
|
17798
|
+
form: props === null || props === void 0 ? void 0 : props.form,
|
|
17799
|
+
companyKey: props === null || props === void 0 ? void 0 : props.companyKey,
|
|
17800
|
+
source: (_props$goodsSource2 = props.goodsSource) === null || _props$goodsSource2 === void 0 ? void 0 : _props$goodsSource2.source,
|
|
17801
|
+
erp: 'gy'
|
|
17802
|
+
});
|
|
17803
|
+
if (typeDefaultSearchValue) {
|
|
17804
|
+
var _goodsListRef$current, _goodsListRef$current2;
|
|
17805
|
+
(_goodsListRef$current = goodsListRef.current) === null || _goodsListRef$current === void 0 ? void 0 : (_goodsListRef$current2 = _goodsListRef$current.setTypeDefaultSearchValue) === null || _goodsListRef$current2 === void 0 ? void 0 : _goodsListRef$current2.call(_goodsListRef$current, typeDefaultSearchValue);
|
|
17806
|
+
}
|
|
17754
17807
|
setVisible(true);
|
|
17755
17808
|
}
|
|
17756
17809
|
};
|
|
17757
17810
|
});
|
|
17758
|
-
|
|
17759
|
-
|
|
17760
|
-
|
|
17761
|
-
|
|
17762
|
-
|
|
17763
|
-
|
|
17764
|
-
var goodsListRef = useRef(null);
|
|
17811
|
+
useEffect(function () {
|
|
17812
|
+
if (visible && typeDefaultSearchValue && goodsListRef.current) {
|
|
17813
|
+
var _goodsListRef$current3, _goodsListRef$current4;
|
|
17814
|
+
(_goodsListRef$current3 = goodsListRef.current) === null || _goodsListRef$current3 === void 0 ? void 0 : (_goodsListRef$current4 = _goodsListRef$current3.setTypeDefaultSearchValue) === null || _goodsListRef$current4 === void 0 ? void 0 : _goodsListRef$current4.call(_goodsListRef$current3, typeDefaultSearchValue);
|
|
17815
|
+
}
|
|
17816
|
+
}, [visible, typeDefaultSearchValue]);
|
|
17765
17817
|
var _onCancel = function onCancel() {
|
|
17766
17818
|
setVisible(false);
|
|
17767
17819
|
};
|
|
17768
17820
|
var onOk = function onOk() {
|
|
17769
|
-
var _goodsListRef$
|
|
17770
|
-
var selectedList = ((_goodsListRef$
|
|
17821
|
+
var _goodsListRef$current5;
|
|
17822
|
+
var selectedList = ((_goodsListRef$current5 = goodsListRef.current) === null || _goodsListRef$current5 === void 0 ? void 0 : _goodsListRef$current5.getSelectGoodList()) || [];
|
|
17771
17823
|
onSubmit(selectedList);
|
|
17772
17824
|
_onCancel();
|
|
17773
17825
|
};
|
|
@@ -17782,7 +17834,7 @@ var GyGoodsModal$1 = function GyGoodsModal(props, ref) {
|
|
|
17782
17834
|
},
|
|
17783
17835
|
onOk: onOk,
|
|
17784
17836
|
wrapClassName: "goodModal"
|
|
17785
|
-
}, ((_props$
|
|
17837
|
+
}, ((_props$goodsSource3 = props.goodsSource) === null || _props$goodsSource3 === void 0 ? void 0 : _props$goodsSource3.source) === 'workOrder' ? /*#__PURE__*/React.createElement(WorkorderList$1, {
|
|
17786
17838
|
erp: "gy",
|
|
17787
17839
|
goodsSource: props.goodsSource,
|
|
17788
17840
|
seletedGooods: seletedGooods,
|
|
@@ -21841,7 +21893,8 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
21841
21893
|
maxLength: maxLength,
|
|
21842
21894
|
companyKey: companyKey,
|
|
21843
21895
|
goodsSource: goodsSource,
|
|
21844
|
-
useGoodsSourceFormat: useGoodsSourceFormat
|
|
21896
|
+
useGoodsSourceFormat: useGoodsSourceFormat,
|
|
21897
|
+
form: form
|
|
21845
21898
|
}));
|
|
21846
21899
|
};
|
|
21847
21900
|
|
package/dist/index.js
CHANGED
|
@@ -17469,6 +17469,9 @@ var WorkorderList = function WorkorderList(props, ref) {
|
|
|
17469
17469
|
return selectedList.map(function (workOrderData) {
|
|
17470
17470
|
return goodsSourceFormat.workOrderDataToGoods(workOrderData, props.erp);
|
|
17471
17471
|
});
|
|
17472
|
+
},
|
|
17473
|
+
setTypeDefaultSearchValue: function setTypeDefaultSearchValue(value) {
|
|
17474
|
+
value && form.setFieldsValue(_objectSpread2({}, value));
|
|
17472
17475
|
}
|
|
17473
17476
|
};
|
|
17474
17477
|
});
|
|
@@ -17747,6 +17750,32 @@ var WorkorderList = function WorkorderList(props, ref) {
|
|
|
17747
17750
|
};
|
|
17748
17751
|
var WorkorderList$1 = /*#__PURE__*/React.forwardRef(WorkorderList);
|
|
17749
17752
|
|
|
17753
|
+
var relationComponentUniqueKeyMap = {
|
|
17754
|
+
PCE2Z5TXEVPL5D26I7KMBKMB: '6hldjQ9aMz',
|
|
17755
|
+
SZF4ZGWZSNW6PYXMCIFEWBXT: 'abVTwFX34E' //测马奔腾的补货类型自定义组件
|
|
17756
|
+
};
|
|
17757
|
+
|
|
17758
|
+
var typeSearchComponentUniqueKeyMap = {
|
|
17759
|
+
PCE2Z5TXEVPL5D26I7KMBKMB: 'C7M9rWJMjD_radio',
|
|
17760
|
+
SZF4ZGWZSNW6PYXMCIFEWBXT: 'ipOHnYquYB_radio' //测马奔腾的类型自定义组件
|
|
17761
|
+
};
|
|
17762
|
+
// 该方法只用于小白熊定制,当管易商品/管易补发/管易退换货组件的数据来源于关联工单数据,且其补发类型自定义组件选了值,根据该值填充到商品库弹框中类型筛选项
|
|
17763
|
+
var useTypeDefaultSearchValue = (function (props) {
|
|
17764
|
+
var _form$getFieldValue, _form$getFieldValue2;
|
|
17765
|
+
var form = props.form,
|
|
17766
|
+
_props$companyKey = props.companyKey,
|
|
17767
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
17768
|
+
source = props.source,
|
|
17769
|
+
erp = props.erp;
|
|
17770
|
+
if (source !== 'workOrder' || erp !== 'gy') {
|
|
17771
|
+
return '';
|
|
17772
|
+
}
|
|
17773
|
+
var relationComponentKey = relationComponentUniqueKeyMap === null || relationComponentUniqueKeyMap === void 0 ? void 0 : relationComponentUniqueKeyMap[companyKey];
|
|
17774
|
+
var typeSearchComponentKey = typeSearchComponentUniqueKeyMap === null || typeSearchComponentUniqueKeyMap === void 0 ? void 0 : typeSearchComponentUniqueKeyMap[companyKey];
|
|
17775
|
+
var relationComponentValue = relationComponentKey ? (form === null || form === void 0 ? void 0 : (_form$getFieldValue = form.getFieldValue(relationComponentKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.value) ? _defineProperty({}, typeSearchComponentKey, [form === null || form === void 0 ? void 0 : (_form$getFieldValue2 = form.getFieldValue(relationComponentKey)) === null || _form$getFieldValue2 === void 0 ? void 0 : _form$getFieldValue2.value]) : '' : '';
|
|
17776
|
+
return relationComponentValue;
|
|
17777
|
+
});
|
|
17778
|
+
|
|
17750
17779
|
// interface GoodModelProps {
|
|
17751
17780
|
// shopId: number | string;
|
|
17752
17781
|
// maxLength: number;
|
|
@@ -17757,32 +17786,55 @@ var WorkorderList$1 = /*#__PURE__*/React.forwardRef(WorkorderList);
|
|
|
17757
17786
|
// onSubmit: (...args: any[]) => any;
|
|
17758
17787
|
// }
|
|
17759
17788
|
var GyGoodsModal$1 = function GyGoodsModal(props, ref) {
|
|
17760
|
-
var _props$goodsSource;
|
|
17789
|
+
var _props$goodsSource, _props$goodsSource3;
|
|
17761
17790
|
var _useState = React.useState(),
|
|
17762
17791
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17763
17792
|
seletedGooods = _useState2[0],
|
|
17764
17793
|
setSeletedGooods = _useState2[1];
|
|
17794
|
+
var onSubmit = props.onSubmit,
|
|
17795
|
+
width = props.width;
|
|
17796
|
+
var _useState3 = React.useState(false),
|
|
17797
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17798
|
+
visible = _useState4[0],
|
|
17799
|
+
setVisible = _useState4[1];
|
|
17800
|
+
var goodsListRef = React.useRef(null);
|
|
17801
|
+
var typeDefaultSearchValue = useTypeDefaultSearchValue({
|
|
17802
|
+
form: props === null || props === void 0 ? void 0 : props.form,
|
|
17803
|
+
companyKey: props === null || props === void 0 ? void 0 : props.companyKey,
|
|
17804
|
+
source: (_props$goodsSource = props.goodsSource) === null || _props$goodsSource === void 0 ? void 0 : _props$goodsSource.source,
|
|
17805
|
+
erp: 'gy'
|
|
17806
|
+
});
|
|
17765
17807
|
React.useImperativeHandle(ref, function () {
|
|
17766
17808
|
return {
|
|
17767
17809
|
open: function open(shopCode, options) {
|
|
17810
|
+
var _props$goodsSource2;
|
|
17768
17811
|
setSeletedGooods((options === null || options === void 0 ? void 0 : options.value) || []);
|
|
17812
|
+
var typeDefaultSearchValue = useTypeDefaultSearchValue({
|
|
17813
|
+
form: props === null || props === void 0 ? void 0 : props.form,
|
|
17814
|
+
companyKey: props === null || props === void 0 ? void 0 : props.companyKey,
|
|
17815
|
+
source: (_props$goodsSource2 = props.goodsSource) === null || _props$goodsSource2 === void 0 ? void 0 : _props$goodsSource2.source,
|
|
17816
|
+
erp: 'gy'
|
|
17817
|
+
});
|
|
17818
|
+
if (typeDefaultSearchValue) {
|
|
17819
|
+
var _goodsListRef$current, _goodsListRef$current2;
|
|
17820
|
+
(_goodsListRef$current = goodsListRef.current) === null || _goodsListRef$current === void 0 ? void 0 : (_goodsListRef$current2 = _goodsListRef$current.setTypeDefaultSearchValue) === null || _goodsListRef$current2 === void 0 ? void 0 : _goodsListRef$current2.call(_goodsListRef$current, typeDefaultSearchValue);
|
|
17821
|
+
}
|
|
17769
17822
|
setVisible(true);
|
|
17770
17823
|
}
|
|
17771
17824
|
};
|
|
17772
17825
|
});
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
|
|
17779
|
-
var goodsListRef = React.useRef(null);
|
|
17826
|
+
React.useEffect(function () {
|
|
17827
|
+
if (visible && typeDefaultSearchValue && goodsListRef.current) {
|
|
17828
|
+
var _goodsListRef$current3, _goodsListRef$current4;
|
|
17829
|
+
(_goodsListRef$current3 = goodsListRef.current) === null || _goodsListRef$current3 === void 0 ? void 0 : (_goodsListRef$current4 = _goodsListRef$current3.setTypeDefaultSearchValue) === null || _goodsListRef$current4 === void 0 ? void 0 : _goodsListRef$current4.call(_goodsListRef$current3, typeDefaultSearchValue);
|
|
17830
|
+
}
|
|
17831
|
+
}, [visible, typeDefaultSearchValue]);
|
|
17780
17832
|
var _onCancel = function onCancel() {
|
|
17781
17833
|
setVisible(false);
|
|
17782
17834
|
};
|
|
17783
17835
|
var onOk = function onOk() {
|
|
17784
|
-
var _goodsListRef$
|
|
17785
|
-
var selectedList = ((_goodsListRef$
|
|
17836
|
+
var _goodsListRef$current5;
|
|
17837
|
+
var selectedList = ((_goodsListRef$current5 = goodsListRef.current) === null || _goodsListRef$current5 === void 0 ? void 0 : _goodsListRef$current5.getSelectGoodList()) || [];
|
|
17786
17838
|
onSubmit(selectedList);
|
|
17787
17839
|
_onCancel();
|
|
17788
17840
|
};
|
|
@@ -17797,7 +17849,7 @@ var GyGoodsModal$1 = function GyGoodsModal(props, ref) {
|
|
|
17797
17849
|
},
|
|
17798
17850
|
onOk: onOk,
|
|
17799
17851
|
wrapClassName: "goodModal"
|
|
17800
|
-
}, ((_props$
|
|
17852
|
+
}, ((_props$goodsSource3 = props.goodsSource) === null || _props$goodsSource3 === void 0 ? void 0 : _props$goodsSource3.source) === 'workOrder' ? /*#__PURE__*/React__default['default'].createElement(WorkorderList$1, {
|
|
17801
17853
|
erp: "gy",
|
|
17802
17854
|
goodsSource: props.goodsSource,
|
|
17803
17855
|
seletedGooods: seletedGooods,
|
|
@@ -21856,7 +21908,8 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
21856
21908
|
maxLength: maxLength,
|
|
21857
21909
|
companyKey: companyKey,
|
|
21858
21910
|
goodsSource: goodsSource,
|
|
21859
|
-
useGoodsSourceFormat: useGoodsSourceFormat
|
|
21911
|
+
useGoodsSourceFormat: useGoodsSourceFormat,
|
|
21912
|
+
form: form
|
|
21860
21913
|
}));
|
|
21861
21914
|
};
|
|
21862
21915
|
|
|
@@ -30,6 +30,7 @@ export declare namespace BsE3Goods {
|
|
|
30
30
|
}
|
|
31
31
|
interface SelectDrawerRefObject {
|
|
32
32
|
getSelectGoodList: () => BsE3Goods.GoodsInfo[];
|
|
33
|
+
setTypeDefaultSearchValue?: (value: Record<string, any>) => void;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<BsE3Goods.SelectDrawerRefObject>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FormInstance } from 'antd/es/form';
|
|
2
|
+
type PropsType = {
|
|
3
|
+
form: FormInstance;
|
|
4
|
+
companyKey: string;
|
|
5
|
+
source?: 'workOrder' | 'erp';
|
|
6
|
+
erp: string;
|
|
7
|
+
};
|
|
8
|
+
declare const _default: (props: PropsType) => "" | {
|
|
9
|
+
[x: string]: any[];
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { FormInstance } from 'antd/es/form';
|
|
2
3
|
export type GoodsSourceFormatType = {
|
|
3
4
|
filterItems?: any[];
|
|
4
5
|
flowNodeId: string;
|
|
@@ -47,6 +48,7 @@ export interface ErpGoodModelProps<T = any[]> {
|
|
|
47
48
|
width?: string | number;
|
|
48
49
|
shopCode?: string;
|
|
49
50
|
companyKey: string;
|
|
51
|
+
form?: FormInstance;
|
|
50
52
|
useGoodsSourceFormat: (goodsSource?: GoodsSourceType) => GoodsSourceFormatType;
|
|
51
53
|
goodsSource?: GoodsSourceType;
|
|
52
54
|
onSubmit: (goodsList: T) => any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "2.2.13-beta.
|
|
3
|
+
"version": "2.2.13-beta.33",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "11e07b2cb461eb4ba178202fe6c664d2482a32dd"
|
|
70
70
|
}
|