@kmkf-fe-packages/basic-components 1.8.0-beta.1 → 1.8.0-beta.3
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 +189 -77
- package/dist/index.js +189 -77
- package/dist/src/common/Sku/index.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -7881,7 +7881,9 @@ var SubForm = function SubForm(props) {
|
|
|
7881
7881
|
data = res.data, success = res.success;
|
|
7882
7882
|
if (success) {
|
|
7883
7883
|
newList = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
|
|
7884
|
-
var params = {
|
|
7884
|
+
var params = {
|
|
7885
|
+
uuid: uuid()
|
|
7886
|
+
};
|
|
7885
7887
|
Object.keys(item.jsonMap).forEach(function (key) {
|
|
7886
7888
|
if (valueMap[key]) {
|
|
7887
7889
|
params[valueMap[key]] = item.jsonMap[key];
|
|
@@ -7932,19 +7934,23 @@ var SubForm = function SubForm(props) {
|
|
|
7932
7934
|
}
|
|
7933
7935
|
};
|
|
7934
7936
|
var selectValueHandle = function selectValueHandle(record) {
|
|
7935
|
-
|
|
7937
|
+
console.log('record', record);
|
|
7938
|
+
var numberKeys = newTableHeader.reduce(function (prv, t) {
|
|
7936
7939
|
if (t.isNumber) {
|
|
7937
|
-
|
|
7940
|
+
prv.push(t.key);
|
|
7938
7941
|
}
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
+
return prv;
|
|
7943
|
+
}, []);
|
|
7944
|
+
console.log('numberKeys', numberKeys);
|
|
7945
|
+
var newValue = record || {};
|
|
7946
|
+
if (numberKeys === null || numberKeys === void 0 ? void 0 : numberKeys.length) {
|
|
7942
7947
|
Object.keys(newValue).forEach(function (key) {
|
|
7943
7948
|
if (numberKeys.includes(key)) {
|
|
7944
7949
|
newValue[key] = hasNumber(newValue[key]) ? newValue[key] : '';
|
|
7945
7950
|
}
|
|
7946
7951
|
});
|
|
7947
7952
|
}
|
|
7953
|
+
console.log('newValue', newValue);
|
|
7948
7954
|
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), [_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
7949
7955
|
uuid: uuid()
|
|
7950
7956
|
})]));
|
|
@@ -7962,9 +7968,6 @@ var SubForm = function SubForm(props) {
|
|
|
7962
7968
|
value: selectKey,
|
|
7963
7969
|
onChange: setSelectKey
|
|
7964
7970
|
}), /*#__PURE__*/React.createElement(Popover, {
|
|
7965
|
-
overlayInnerStyle: {
|
|
7966
|
-
maxWidth: '90%'
|
|
7967
|
-
},
|
|
7968
7971
|
content: /*#__PURE__*/React.createElement("div", {
|
|
7969
7972
|
ref: ref,
|
|
7970
7973
|
onScrollCapture: onScrollCapture,
|
|
@@ -7976,7 +7979,7 @@ var SubForm = function SubForm(props) {
|
|
|
7976
7979
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
7977
7980
|
columns: columsSearch,
|
|
7978
7981
|
dataSource: list,
|
|
7979
|
-
rowKey: '
|
|
7982
|
+
rowKey: 'uuid',
|
|
7980
7983
|
size: "small",
|
|
7981
7984
|
pagination: false,
|
|
7982
7985
|
scroll: {
|
|
@@ -8839,15 +8842,21 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
8839
8842
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
8840
8843
|
numIids = _useState8[0],
|
|
8841
8844
|
setNumIids = _useState8[1];
|
|
8845
|
+
var _useState9 = useState(-1),
|
|
8846
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
8847
|
+
numIndex = _useState10[0],
|
|
8848
|
+
setNumIndex = _useState10[1];
|
|
8842
8849
|
useImperativeHandle(ref, function () {
|
|
8843
8850
|
return {
|
|
8844
8851
|
open: function open(_ref) {
|
|
8845
8852
|
var numIids = _ref.numIids,
|
|
8846
|
-
options = _ref.options
|
|
8853
|
+
options = _ref.options,
|
|
8854
|
+
index = _ref.index;
|
|
8847
8855
|
setVisible(true);
|
|
8848
8856
|
setSku('');
|
|
8849
8857
|
setNumIids(numIids);
|
|
8850
8858
|
setOptions(options);
|
|
8859
|
+
setNumIndex(typeof index === 'number' ? index : -1);
|
|
8851
8860
|
},
|
|
8852
8861
|
close: function close() {
|
|
8853
8862
|
setVisible(false);
|
|
@@ -8856,7 +8865,7 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
8856
8865
|
});
|
|
8857
8866
|
var handleSure = /*#__PURE__*/function () {
|
|
8858
8867
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8859
|
-
var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _yield$request, _yield$request$data, data;
|
|
8868
|
+
var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _yield$request, _yield$request$data, data;
|
|
8860
8869
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8861
8870
|
while (1) switch (_context.prev = _context.next) {
|
|
8862
8871
|
case 0:
|
|
@@ -8866,6 +8875,7 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
8866
8875
|
break;
|
|
8867
8876
|
}
|
|
8868
8877
|
props.handleOk({
|
|
8878
|
+
numIndex: -1,
|
|
8869
8879
|
enableItemId: '',
|
|
8870
8880
|
enableSupplierName: '',
|
|
8871
8881
|
propertiesName: ''
|
|
@@ -8881,20 +8891,24 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
8881
8891
|
break;
|
|
8882
8892
|
}
|
|
8883
8893
|
props.handleOk({
|
|
8894
|
+
numIndex: numIndex,
|
|
8895
|
+
code: ((_ref3 = SKU || {
|
|
8896
|
+
code: ''
|
|
8897
|
+
}) === null || _ref3 === void 0 ? void 0 : _ref3.code) || '',
|
|
8884
8898
|
enableItemId: '',
|
|
8885
8899
|
enableSupplierName: '',
|
|
8886
|
-
propertiesName: ((
|
|
8900
|
+
propertiesName: ((_ref4 = SKU || {
|
|
8887
8901
|
label: ''
|
|
8888
|
-
}) === null ||
|
|
8889
|
-
picUrl: (
|
|
8902
|
+
}) === null || _ref4 === void 0 ? void 0 : _ref4.label) || '',
|
|
8903
|
+
picUrl: (_ref5 = SKU || {
|
|
8890
8904
|
picUrl: ''
|
|
8891
|
-
}) === null ||
|
|
8892
|
-
outerSkuId: (
|
|
8905
|
+
}) === null || _ref5 === void 0 ? void 0 : _ref5.picUrl,
|
|
8906
|
+
outerSkuId: (_ref6 = SKU || {
|
|
8893
8907
|
outerSkuId: ''
|
|
8894
|
-
}) === null ||
|
|
8895
|
-
skuId: ((
|
|
8908
|
+
}) === null || _ref6 === void 0 ? void 0 : _ref6.outerSkuId,
|
|
8909
|
+
skuId: ((_ref7 = SKU || {
|
|
8896
8910
|
skuId: ''
|
|
8897
|
-
}) === null ||
|
|
8911
|
+
}) === null || _ref7 === void 0 ? void 0 : _ref7.skuId) || ''
|
|
8898
8912
|
});
|
|
8899
8913
|
_context.next = 16;
|
|
8900
8914
|
break;
|
|
@@ -8913,17 +8927,21 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
8913
8927
|
_yield$request$data = _yield$request.data;
|
|
8914
8928
|
data = _yield$request$data === void 0 ? [] : _yield$request$data;
|
|
8915
8929
|
props.handleOk({
|
|
8930
|
+
numIndex: numIndex,
|
|
8931
|
+
code: ((_ref8 = SKU || {
|
|
8932
|
+
code: ''
|
|
8933
|
+
}) === null || _ref8 === void 0 ? void 0 : _ref8.code) || '',
|
|
8916
8934
|
enableItemId: data.length > 0 ? data[0]['supplierItemOuterId'] : '',
|
|
8917
8935
|
enableSupplierName: data.length > 0 ? data[0]['supplierName'] : '',
|
|
8918
|
-
propertiesName: ((
|
|
8936
|
+
propertiesName: ((_ref9 = SKU || {
|
|
8919
8937
|
label: ''
|
|
8920
|
-
}) === null ||
|
|
8921
|
-
picUrl: (
|
|
8938
|
+
}) === null || _ref9 === void 0 ? void 0 : _ref9.label) || '',
|
|
8939
|
+
picUrl: (_ref10 = SKU || {
|
|
8922
8940
|
picUrl: ''
|
|
8923
|
-
}) === null ||
|
|
8924
|
-
skuId: ((
|
|
8941
|
+
}) === null || _ref10 === void 0 ? void 0 : _ref10.picUrl,
|
|
8942
|
+
skuId: ((_ref11 = SKU || {
|
|
8925
8943
|
skuId: ''
|
|
8926
|
-
}) === null ||
|
|
8944
|
+
}) === null || _ref11 === void 0 ? void 0 : _ref11.skuId) || ''
|
|
8927
8945
|
});
|
|
8928
8946
|
case 16:
|
|
8929
8947
|
setVisible(false);
|
|
@@ -9020,8 +9038,10 @@ var Goods = function Goods(props) {
|
|
|
9020
9038
|
while (1) switch (_context.prev = _context.next) {
|
|
9021
9039
|
case 0:
|
|
9022
9040
|
shopId = _ref.shopId, numIids = _ref.numIids;
|
|
9023
|
-
return _context.abrupt("return",
|
|
9041
|
+
return _context.abrupt("return", request$1({
|
|
9042
|
+
url: '/qy/gdfw/workOrder/queryItemSkus',
|
|
9024
9043
|
method: 'post',
|
|
9044
|
+
handleError: message.error,
|
|
9025
9045
|
data: {
|
|
9026
9046
|
shopId: shopId,
|
|
9027
9047
|
numIids: numIids
|
|
@@ -9053,23 +9073,29 @@ var Goods = function Goods(props) {
|
|
|
9053
9073
|
};
|
|
9054
9074
|
//选择sku
|
|
9055
9075
|
var handleSelectSku = function handleSelectSku(_ref3) {
|
|
9056
|
-
var
|
|
9076
|
+
var numIndex = _ref3.numIndex,
|
|
9077
|
+
code = _ref3.code,
|
|
9078
|
+
enableItemId = _ref3.enableItemId,
|
|
9057
9079
|
enableSupplierName = _ref3.enableSupplierName,
|
|
9058
9080
|
propertiesName = _ref3.propertiesName,
|
|
9059
9081
|
picUrl = _ref3.picUrl,
|
|
9060
9082
|
outerSkuId = _ref3.outerSkuId;
|
|
9083
|
+
if (numIndex < 0) return;
|
|
9061
9084
|
var newList = JSON.parse(JSON.stringify(imgList));
|
|
9062
9085
|
if (type === 4) {
|
|
9063
|
-
newList[
|
|
9064
|
-
newList[
|
|
9086
|
+
newList[numIndex].itemId = enableItemId;
|
|
9087
|
+
newList[numIndex].supplierName = enableSupplierName;
|
|
9065
9088
|
} else {
|
|
9066
|
-
newList[
|
|
9089
|
+
newList[numIndex].propertiesName = propertiesName;
|
|
9067
9090
|
}
|
|
9068
9091
|
if (type === 1 && outerSkuId) {
|
|
9069
|
-
newList[
|
|
9092
|
+
newList[numIndex].outerId = outerSkuId;
|
|
9093
|
+
}
|
|
9094
|
+
if (type === 1 && code) {
|
|
9095
|
+
newList[numIndex].outerId = code;
|
|
9070
9096
|
}
|
|
9071
9097
|
//替换成sku的图片
|
|
9072
|
-
picUrl && (newList[
|
|
9098
|
+
picUrl && (newList[numIndex].picUrl = picUrl);
|
|
9073
9099
|
var newValue = {
|
|
9074
9100
|
shopId: shopId,
|
|
9075
9101
|
imgList: newList
|
|
@@ -9079,7 +9105,8 @@ var Goods = function Goods(props) {
|
|
|
9079
9105
|
//选择回调
|
|
9080
9106
|
var onSubmit = /*#__PURE__*/function () {
|
|
9081
9107
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
|
|
9082
|
-
var
|
|
9108
|
+
var _list$;
|
|
9109
|
+
var newList, newImgList, newValue;
|
|
9083
9110
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9084
9111
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9085
9112
|
case 0:
|
|
@@ -9118,22 +9145,45 @@ var Goods = function Goods(props) {
|
|
|
9118
9145
|
setUploadImageCount(newImgList.length);
|
|
9119
9146
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
|
|
9120
9147
|
setVisible(false);
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9148
|
+
checkSkus(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.numIid, newImgList.length - 1);
|
|
9149
|
+
case 7:
|
|
9150
|
+
case "end":
|
|
9151
|
+
return _context2.stop();
|
|
9152
|
+
}
|
|
9153
|
+
}, _callee2);
|
|
9154
|
+
}));
|
|
9155
|
+
return function onSubmit(_x2) {
|
|
9156
|
+
return _ref4.apply(this, arguments);
|
|
9157
|
+
};
|
|
9158
|
+
}();
|
|
9159
|
+
var checkSkus = /*#__PURE__*/function () {
|
|
9160
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(numIid, index) {
|
|
9161
|
+
var res, data, _skuRef$current, options;
|
|
9162
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
9163
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9164
|
+
case 0:
|
|
9165
|
+
if (numIid) {
|
|
9166
|
+
_context3.next = 2;
|
|
9124
9167
|
break;
|
|
9125
9168
|
}
|
|
9126
|
-
|
|
9169
|
+
return _context3.abrupt("return");
|
|
9170
|
+
case 2:
|
|
9171
|
+
if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku)) {
|
|
9172
|
+
_context3.next = 8;
|
|
9173
|
+
break;
|
|
9174
|
+
}
|
|
9175
|
+
_context3.next = 5;
|
|
9127
9176
|
return querySkus({
|
|
9128
9177
|
shopId: shopId,
|
|
9129
|
-
numIids:
|
|
9130
|
-
});
|
|
9131
|
-
case
|
|
9132
|
-
|
|
9133
|
-
data =
|
|
9178
|
+
numIids: numIid
|
|
9179
|
+
}).catch(console.debug);
|
|
9180
|
+
case 5:
|
|
9181
|
+
res = _context3.sent;
|
|
9182
|
+
data = (res === null || res === void 0 ? void 0 : res.success) && (res === null || res === void 0 ? void 0 : res.data);
|
|
9134
9183
|
if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
|
|
9135
9184
|
options = data[0]['skus'].map(function (item) {
|
|
9136
9185
|
return {
|
|
9186
|
+
code: item.code,
|
|
9137
9187
|
label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
|
|
9138
9188
|
return i.split(':').slice(2);
|
|
9139
9189
|
}).join(';') : item.propertiesName,
|
|
@@ -9143,19 +9193,20 @@ var Goods = function Goods(props) {
|
|
|
9143
9193
|
};
|
|
9144
9194
|
});
|
|
9145
9195
|
(_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
|
|
9196
|
+
index: index,
|
|
9146
9197
|
shopId: shopId,
|
|
9147
|
-
numIids:
|
|
9198
|
+
numIids: numIid,
|
|
9148
9199
|
options: options
|
|
9149
9200
|
});
|
|
9150
9201
|
}
|
|
9151
|
-
case
|
|
9202
|
+
case 8:
|
|
9152
9203
|
case "end":
|
|
9153
|
-
return
|
|
9204
|
+
return _context3.stop();
|
|
9154
9205
|
}
|
|
9155
|
-
},
|
|
9206
|
+
}, _callee3);
|
|
9156
9207
|
}));
|
|
9157
|
-
return function
|
|
9158
|
-
return
|
|
9208
|
+
return function checkSkus(_x3, _x4) {
|
|
9209
|
+
return _ref5.apply(this, arguments);
|
|
9159
9210
|
};
|
|
9160
9211
|
}();
|
|
9161
9212
|
//修改参数
|
|
@@ -9182,7 +9233,8 @@ var Goods = function Goods(props) {
|
|
|
9182
9233
|
className: "goodsBox ".concat(goodsBoxClassName)
|
|
9183
9234
|
}, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
|
|
9184
9235
|
return /*#__PURE__*/React.createElement("div", {
|
|
9185
|
-
className: "goodBox-Img"
|
|
9236
|
+
className: "goodBox-Img",
|
|
9237
|
+
key: "".concat(img.numIid, "_").concat(index)
|
|
9186
9238
|
}, /*#__PURE__*/React.createElement("div", {
|
|
9187
9239
|
className: "goods-imgBox",
|
|
9188
9240
|
key: img.picUrl + '-goods'
|
|
@@ -9251,7 +9303,16 @@ var Goods = function Goods(props) {
|
|
|
9251
9303
|
disabled: disabled,
|
|
9252
9304
|
value: img.supplierName,
|
|
9253
9305
|
onChange: handleChangeValue('supplierName', index)
|
|
9254
|
-
})) : null
|
|
9306
|
+
})) : null, type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
|
|
9307
|
+
style: {
|
|
9308
|
+
marginTop: '4px'
|
|
9309
|
+
},
|
|
9310
|
+
size: "small",
|
|
9311
|
+
onClick: function onClick() {
|
|
9312
|
+
return checkSkus(img === null || img === void 0 ? void 0 : img.numIid, index);
|
|
9313
|
+
},
|
|
9314
|
+
type: "primary"
|
|
9315
|
+
}, "\u8C03\u6574sku") : null));
|
|
9255
9316
|
}), imgList.length < maxLength && !disabled ? /*#__PURE__*/React.createElement("div", {
|
|
9256
9317
|
className: "goods-imgBox",
|
|
9257
9318
|
onClick: function onClick() {
|
|
@@ -9351,8 +9412,10 @@ var GoodItem = function GoodItem(props) {
|
|
|
9351
9412
|
while (1) switch (_context.prev = _context.next) {
|
|
9352
9413
|
case 0:
|
|
9353
9414
|
shopId = _ref.shopId, numIids = _ref.numIids;
|
|
9354
|
-
return _context.abrupt("return",
|
|
9415
|
+
return _context.abrupt("return", request$1({
|
|
9416
|
+
url: '/qy/gdfw/workOrder/queryItemSkus',
|
|
9355
9417
|
method: 'post',
|
|
9418
|
+
handleError: message.error,
|
|
9356
9419
|
data: {
|
|
9357
9420
|
shopId: shopId,
|
|
9358
9421
|
numIids: numIids
|
|
@@ -9381,25 +9444,31 @@ var GoodItem = function GoodItem(props) {
|
|
|
9381
9444
|
};
|
|
9382
9445
|
//选择sku
|
|
9383
9446
|
var handleSelectSku = function handleSelectSku(_ref3) {
|
|
9384
|
-
var
|
|
9447
|
+
var numIndex = _ref3.numIndex,
|
|
9448
|
+
code = _ref3.code,
|
|
9449
|
+
enableItemId = _ref3.enableItemId,
|
|
9385
9450
|
enableSupplierName = _ref3.enableSupplierName,
|
|
9386
9451
|
propertiesName = _ref3.propertiesName,
|
|
9387
9452
|
picUrl = _ref3.picUrl,
|
|
9388
9453
|
outerSkuId = _ref3.outerSkuId,
|
|
9389
9454
|
skuId = _ref3.skuId;
|
|
9455
|
+
if (numIndex < 0) return;
|
|
9390
9456
|
var newList = JSON.parse(JSON.stringify(imgList));
|
|
9391
9457
|
if (type === 4) {
|
|
9392
|
-
newList[
|
|
9393
|
-
newList[
|
|
9458
|
+
newList[numIndex].itemId = enableItemId;
|
|
9459
|
+
newList[numIndex].supplierName = enableSupplierName;
|
|
9394
9460
|
} else {
|
|
9395
|
-
newList[
|
|
9461
|
+
newList[numIndex].propertiesName = propertiesName;
|
|
9396
9462
|
}
|
|
9397
9463
|
if (type === 1) {
|
|
9398
|
-
if (outerSkuId) newList[
|
|
9399
|
-
if (skuId) newList[
|
|
9464
|
+
if (outerSkuId) newList[numIndex].outerSkuId = outerSkuId;
|
|
9465
|
+
if (skuId) newList[numIndex].skuId = skuId;
|
|
9466
|
+
}
|
|
9467
|
+
if (type === 1 && code) {
|
|
9468
|
+
newList[numIndex].outerId = code;
|
|
9400
9469
|
}
|
|
9401
9470
|
//替换成sku的图片
|
|
9402
|
-
picUrl && (newList[
|
|
9471
|
+
picUrl && (newList[numIndex].picUrl = picUrl);
|
|
9403
9472
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
9404
9473
|
shopId: shopId,
|
|
9405
9474
|
imgList: newList
|
|
@@ -9408,7 +9477,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9408
9477
|
//选择回调
|
|
9409
9478
|
var onSubmit = /*#__PURE__*/function () {
|
|
9410
9479
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
|
|
9411
|
-
var
|
|
9480
|
+
var _list$;
|
|
9481
|
+
var newList, newImgList;
|
|
9412
9482
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9413
9483
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9414
9484
|
case 0:
|
|
@@ -9448,22 +9518,45 @@ var GoodItem = function GoodItem(props) {
|
|
|
9448
9518
|
imgList: newImgList
|
|
9449
9519
|
});
|
|
9450
9520
|
setVisible(false);
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9521
|
+
checkSkus(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.numIid, newImgList.length - 1);
|
|
9522
|
+
case 5:
|
|
9523
|
+
case "end":
|
|
9524
|
+
return _context2.stop();
|
|
9525
|
+
}
|
|
9526
|
+
}, _callee2);
|
|
9527
|
+
}));
|
|
9528
|
+
return function onSubmit(_x2) {
|
|
9529
|
+
return _ref4.apply(this, arguments);
|
|
9530
|
+
};
|
|
9531
|
+
}();
|
|
9532
|
+
var checkSkus = /*#__PURE__*/function () {
|
|
9533
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(numIid, index) {
|
|
9534
|
+
var res, data, _skuRef$current, options;
|
|
9535
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
9536
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9537
|
+
case 0:
|
|
9538
|
+
if (numIid) {
|
|
9539
|
+
_context3.next = 2;
|
|
9454
9540
|
break;
|
|
9455
9541
|
}
|
|
9456
|
-
|
|
9542
|
+
return _context3.abrupt("return");
|
|
9543
|
+
case 2:
|
|
9544
|
+
if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku)) {
|
|
9545
|
+
_context3.next = 8;
|
|
9546
|
+
break;
|
|
9547
|
+
}
|
|
9548
|
+
_context3.next = 5;
|
|
9457
9549
|
return querySkus({
|
|
9458
9550
|
shopId: shopId,
|
|
9459
|
-
numIids:
|
|
9460
|
-
});
|
|
9461
|
-
case
|
|
9462
|
-
|
|
9463
|
-
data =
|
|
9551
|
+
numIids: numIid
|
|
9552
|
+
}).catch(console.debug);
|
|
9553
|
+
case 5:
|
|
9554
|
+
res = _context3.sent;
|
|
9555
|
+
data = (res === null || res === void 0 ? void 0 : res.success) && (res === null || res === void 0 ? void 0 : res.data);
|
|
9464
9556
|
if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
|
|
9465
9557
|
options = data[0]['skus'].map(function (item) {
|
|
9466
9558
|
return {
|
|
9559
|
+
code: item.code,
|
|
9467
9560
|
label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
|
|
9468
9561
|
return i.split(':').slice(2);
|
|
9469
9562
|
}).join(';') : item.propertiesName,
|
|
@@ -9474,19 +9567,20 @@ var GoodItem = function GoodItem(props) {
|
|
|
9474
9567
|
};
|
|
9475
9568
|
});
|
|
9476
9569
|
(_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
|
|
9570
|
+
index: index,
|
|
9477
9571
|
shopId: shopId,
|
|
9478
|
-
numIids:
|
|
9572
|
+
numIids: numIid,
|
|
9479
9573
|
options: options
|
|
9480
9574
|
});
|
|
9481
9575
|
}
|
|
9482
|
-
case
|
|
9576
|
+
case 8:
|
|
9483
9577
|
case "end":
|
|
9484
|
-
return
|
|
9578
|
+
return _context3.stop();
|
|
9485
9579
|
}
|
|
9486
|
-
},
|
|
9580
|
+
}, _callee3);
|
|
9487
9581
|
}));
|
|
9488
|
-
return function
|
|
9489
|
-
return
|
|
9582
|
+
return function checkSkus(_x3, _x4) {
|
|
9583
|
+
return _ref5.apply(this, arguments);
|
|
9490
9584
|
};
|
|
9491
9585
|
}();
|
|
9492
9586
|
var headerList = showHeader || {
|
|
@@ -9571,7 +9665,16 @@ var GoodItem = function GoodItem(props) {
|
|
|
9571
9665
|
src: img.picUrl || defaultImg,
|
|
9572
9666
|
className: "img",
|
|
9573
9667
|
alt: ""
|
|
9574
|
-
}))
|
|
9668
|
+
})), type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
|
|
9669
|
+
style: {
|
|
9670
|
+
marginTop: '4px'
|
|
9671
|
+
},
|
|
9672
|
+
size: "small",
|
|
9673
|
+
onClick: function onClick() {
|
|
9674
|
+
return checkSkus(img === null || img === void 0 ? void 0 : img.numIid, index);
|
|
9675
|
+
},
|
|
9676
|
+
type: "primary"
|
|
9677
|
+
}, "\u8C03\u6574sku") : null), /*#__PURE__*/React.createElement("div", {
|
|
9575
9678
|
className: "good-attrs",
|
|
9576
9679
|
key: "".concat(img.picUrl, "-").concat(index, "-context")
|
|
9577
9680
|
}, goodItemAttrs.map(function (item) {
|
|
@@ -9586,7 +9689,16 @@ var GoodItem = function GoodItem(props) {
|
|
|
9586
9689
|
disabled: item.disabled || disabled,
|
|
9587
9690
|
onChange: handleChangeValue(item.key, index)
|
|
9588
9691
|
}));
|
|
9589
|
-
})
|
|
9692
|
+
}), !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React.createElement(Button, {
|
|
9693
|
+
style: {
|
|
9694
|
+
marginTop: '4px'
|
|
9695
|
+
},
|
|
9696
|
+
size: "small",
|
|
9697
|
+
onClick: function onClick() {
|
|
9698
|
+
return checkSkus(img === null || img === void 0 ? void 0 : img.numIid, index);
|
|
9699
|
+
},
|
|
9700
|
+
type: "primary"
|
|
9701
|
+
}, "\u8C03\u6574sku") : null));
|
|
9590
9702
|
}), imgList.length < maxLength && !disabled ? /*#__PURE__*/React.createElement("div", {
|
|
9591
9703
|
className: "goods-imgBox",
|
|
9592
9704
|
onClick: function onClick() {
|
package/dist/index.js
CHANGED
|
@@ -7893,7 +7893,9 @@ var SubForm = function SubForm(props) {
|
|
|
7893
7893
|
data = res.data, success = res.success;
|
|
7894
7894
|
if (success) {
|
|
7895
7895
|
newList = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
|
|
7896
|
-
var params = {
|
|
7896
|
+
var params = {
|
|
7897
|
+
uuid: kmkfUtils.uuid()
|
|
7898
|
+
};
|
|
7897
7899
|
Object.keys(item.jsonMap).forEach(function (key) {
|
|
7898
7900
|
if (valueMap[key]) {
|
|
7899
7901
|
params[valueMap[key]] = item.jsonMap[key];
|
|
@@ -7944,19 +7946,23 @@ var SubForm = function SubForm(props) {
|
|
|
7944
7946
|
}
|
|
7945
7947
|
};
|
|
7946
7948
|
var selectValueHandle = function selectValueHandle(record) {
|
|
7947
|
-
|
|
7949
|
+
console.log('record', record);
|
|
7950
|
+
var numberKeys = newTableHeader.reduce(function (prv, t) {
|
|
7948
7951
|
if (t.isNumber) {
|
|
7949
|
-
|
|
7952
|
+
prv.push(t.key);
|
|
7950
7953
|
}
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
+
return prv;
|
|
7955
|
+
}, []);
|
|
7956
|
+
console.log('numberKeys', numberKeys);
|
|
7957
|
+
var newValue = record || {};
|
|
7958
|
+
if (numberKeys === null || numberKeys === void 0 ? void 0 : numberKeys.length) {
|
|
7954
7959
|
Object.keys(newValue).forEach(function (key) {
|
|
7955
7960
|
if (numberKeys.includes(key)) {
|
|
7956
7961
|
newValue[key] = hasNumber(newValue[key]) ? newValue[key] : '';
|
|
7957
7962
|
}
|
|
7958
7963
|
});
|
|
7959
7964
|
}
|
|
7965
|
+
console.log('newValue', newValue);
|
|
7960
7966
|
onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), [_objectSpread2(_objectSpread2({}, newValue), {}, {
|
|
7961
7967
|
uuid: kmkfUtils.uuid()
|
|
7962
7968
|
})]));
|
|
@@ -7974,9 +7980,6 @@ var SubForm = function SubForm(props) {
|
|
|
7974
7980
|
value: selectKey,
|
|
7975
7981
|
onChange: setSelectKey
|
|
7976
7982
|
}), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
|
|
7977
|
-
overlayInnerStyle: {
|
|
7978
|
-
maxWidth: '90%'
|
|
7979
|
-
},
|
|
7980
7983
|
content: /*#__PURE__*/React__default['default'].createElement("div", {
|
|
7981
7984
|
ref: ref,
|
|
7982
7985
|
onScrollCapture: onScrollCapture,
|
|
@@ -7988,7 +7991,7 @@ var SubForm = function SubForm(props) {
|
|
|
7988
7991
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
7989
7992
|
columns: columsSearch,
|
|
7990
7993
|
dataSource: list,
|
|
7991
|
-
rowKey: '
|
|
7994
|
+
rowKey: 'uuid',
|
|
7992
7995
|
size: "small",
|
|
7993
7996
|
pagination: false,
|
|
7994
7997
|
scroll: {
|
|
@@ -8851,15 +8854,21 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8851
8854
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
8852
8855
|
numIids = _useState8[0],
|
|
8853
8856
|
setNumIids = _useState8[1];
|
|
8857
|
+
var _useState9 = React.useState(-1),
|
|
8858
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
8859
|
+
numIndex = _useState10[0],
|
|
8860
|
+
setNumIndex = _useState10[1];
|
|
8854
8861
|
React.useImperativeHandle(ref, function () {
|
|
8855
8862
|
return {
|
|
8856
8863
|
open: function open(_ref) {
|
|
8857
8864
|
var numIids = _ref.numIids,
|
|
8858
|
-
options = _ref.options
|
|
8865
|
+
options = _ref.options,
|
|
8866
|
+
index = _ref.index;
|
|
8859
8867
|
setVisible(true);
|
|
8860
8868
|
setSku('');
|
|
8861
8869
|
setNumIids(numIids);
|
|
8862
8870
|
setOptions(options);
|
|
8871
|
+
setNumIndex(typeof index === 'number' ? index : -1);
|
|
8863
8872
|
},
|
|
8864
8873
|
close: function close() {
|
|
8865
8874
|
setVisible(false);
|
|
@@ -8868,7 +8877,7 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8868
8877
|
});
|
|
8869
8878
|
var handleSure = /*#__PURE__*/function () {
|
|
8870
8879
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
8871
|
-
var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _yield$request, _yield$request$data, data;
|
|
8880
|
+
var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _ref10, _ref11, _yield$request, _yield$request$data, data;
|
|
8872
8881
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8873
8882
|
while (1) switch (_context.prev = _context.next) {
|
|
8874
8883
|
case 0:
|
|
@@ -8878,6 +8887,7 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8878
8887
|
break;
|
|
8879
8888
|
}
|
|
8880
8889
|
props.handleOk({
|
|
8890
|
+
numIndex: -1,
|
|
8881
8891
|
enableItemId: '',
|
|
8882
8892
|
enableSupplierName: '',
|
|
8883
8893
|
propertiesName: ''
|
|
@@ -8893,20 +8903,24 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8893
8903
|
break;
|
|
8894
8904
|
}
|
|
8895
8905
|
props.handleOk({
|
|
8906
|
+
numIndex: numIndex,
|
|
8907
|
+
code: ((_ref3 = SKU || {
|
|
8908
|
+
code: ''
|
|
8909
|
+
}) === null || _ref3 === void 0 ? void 0 : _ref3.code) || '',
|
|
8896
8910
|
enableItemId: '',
|
|
8897
8911
|
enableSupplierName: '',
|
|
8898
|
-
propertiesName: ((
|
|
8912
|
+
propertiesName: ((_ref4 = SKU || {
|
|
8899
8913
|
label: ''
|
|
8900
|
-
}) === null ||
|
|
8901
|
-
picUrl: (
|
|
8914
|
+
}) === null || _ref4 === void 0 ? void 0 : _ref4.label) || '',
|
|
8915
|
+
picUrl: (_ref5 = SKU || {
|
|
8902
8916
|
picUrl: ''
|
|
8903
|
-
}) === null ||
|
|
8904
|
-
outerSkuId: (
|
|
8917
|
+
}) === null || _ref5 === void 0 ? void 0 : _ref5.picUrl,
|
|
8918
|
+
outerSkuId: (_ref6 = SKU || {
|
|
8905
8919
|
outerSkuId: ''
|
|
8906
|
-
}) === null ||
|
|
8907
|
-
skuId: ((
|
|
8920
|
+
}) === null || _ref6 === void 0 ? void 0 : _ref6.outerSkuId,
|
|
8921
|
+
skuId: ((_ref7 = SKU || {
|
|
8908
8922
|
skuId: ''
|
|
8909
|
-
}) === null ||
|
|
8923
|
+
}) === null || _ref7 === void 0 ? void 0 : _ref7.skuId) || ''
|
|
8910
8924
|
});
|
|
8911
8925
|
_context.next = 16;
|
|
8912
8926
|
break;
|
|
@@ -8925,17 +8939,21 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
8925
8939
|
_yield$request$data = _yield$request.data;
|
|
8926
8940
|
data = _yield$request$data === void 0 ? [] : _yield$request$data;
|
|
8927
8941
|
props.handleOk({
|
|
8942
|
+
numIndex: numIndex,
|
|
8943
|
+
code: ((_ref8 = SKU || {
|
|
8944
|
+
code: ''
|
|
8945
|
+
}) === null || _ref8 === void 0 ? void 0 : _ref8.code) || '',
|
|
8928
8946
|
enableItemId: data.length > 0 ? data[0]['supplierItemOuterId'] : '',
|
|
8929
8947
|
enableSupplierName: data.length > 0 ? data[0]['supplierName'] : '',
|
|
8930
|
-
propertiesName: ((
|
|
8948
|
+
propertiesName: ((_ref9 = SKU || {
|
|
8931
8949
|
label: ''
|
|
8932
|
-
}) === null ||
|
|
8933
|
-
picUrl: (
|
|
8950
|
+
}) === null || _ref9 === void 0 ? void 0 : _ref9.label) || '',
|
|
8951
|
+
picUrl: (_ref10 = SKU || {
|
|
8934
8952
|
picUrl: ''
|
|
8935
|
-
}) === null ||
|
|
8936
|
-
skuId: ((
|
|
8953
|
+
}) === null || _ref10 === void 0 ? void 0 : _ref10.picUrl,
|
|
8954
|
+
skuId: ((_ref11 = SKU || {
|
|
8937
8955
|
skuId: ''
|
|
8938
|
-
}) === null ||
|
|
8956
|
+
}) === null || _ref11 === void 0 ? void 0 : _ref11.skuId) || ''
|
|
8939
8957
|
});
|
|
8940
8958
|
case 16:
|
|
8941
8959
|
setVisible(false);
|
|
@@ -9032,8 +9050,10 @@ var Goods = function Goods(props) {
|
|
|
9032
9050
|
while (1) switch (_context.prev = _context.next) {
|
|
9033
9051
|
case 0:
|
|
9034
9052
|
shopId = _ref.shopId, numIids = _ref.numIids;
|
|
9035
|
-
return _context.abrupt("return",
|
|
9053
|
+
return _context.abrupt("return", kmkfUtils.request({
|
|
9054
|
+
url: '/qy/gdfw/workOrder/queryItemSkus',
|
|
9036
9055
|
method: 'post',
|
|
9056
|
+
handleError: antd.message.error,
|
|
9037
9057
|
data: {
|
|
9038
9058
|
shopId: shopId,
|
|
9039
9059
|
numIids: numIids
|
|
@@ -9065,23 +9085,29 @@ var Goods = function Goods(props) {
|
|
|
9065
9085
|
};
|
|
9066
9086
|
//选择sku
|
|
9067
9087
|
var handleSelectSku = function handleSelectSku(_ref3) {
|
|
9068
|
-
var
|
|
9088
|
+
var numIndex = _ref3.numIndex,
|
|
9089
|
+
code = _ref3.code,
|
|
9090
|
+
enableItemId = _ref3.enableItemId,
|
|
9069
9091
|
enableSupplierName = _ref3.enableSupplierName,
|
|
9070
9092
|
propertiesName = _ref3.propertiesName,
|
|
9071
9093
|
picUrl = _ref3.picUrl,
|
|
9072
9094
|
outerSkuId = _ref3.outerSkuId;
|
|
9095
|
+
if (numIndex < 0) return;
|
|
9073
9096
|
var newList = JSON.parse(JSON.stringify(imgList));
|
|
9074
9097
|
if (type === 4) {
|
|
9075
|
-
newList[
|
|
9076
|
-
newList[
|
|
9098
|
+
newList[numIndex].itemId = enableItemId;
|
|
9099
|
+
newList[numIndex].supplierName = enableSupplierName;
|
|
9077
9100
|
} else {
|
|
9078
|
-
newList[
|
|
9101
|
+
newList[numIndex].propertiesName = propertiesName;
|
|
9079
9102
|
}
|
|
9080
9103
|
if (type === 1 && outerSkuId) {
|
|
9081
|
-
newList[
|
|
9104
|
+
newList[numIndex].outerId = outerSkuId;
|
|
9105
|
+
}
|
|
9106
|
+
if (type === 1 && code) {
|
|
9107
|
+
newList[numIndex].outerId = code;
|
|
9082
9108
|
}
|
|
9083
9109
|
//替换成sku的图片
|
|
9084
|
-
picUrl && (newList[
|
|
9110
|
+
picUrl && (newList[numIndex].picUrl = picUrl);
|
|
9085
9111
|
var newValue = {
|
|
9086
9112
|
shopId: shopId,
|
|
9087
9113
|
imgList: newList
|
|
@@ -9091,7 +9117,8 @@ var Goods = function Goods(props) {
|
|
|
9091
9117
|
//选择回调
|
|
9092
9118
|
var onSubmit = /*#__PURE__*/function () {
|
|
9093
9119
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
|
|
9094
|
-
var
|
|
9120
|
+
var _list$;
|
|
9121
|
+
var newList, newImgList, newValue;
|
|
9095
9122
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9096
9123
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9097
9124
|
case 0:
|
|
@@ -9130,22 +9157,45 @@ var Goods = function Goods(props) {
|
|
|
9130
9157
|
setUploadImageCount(newImgList.length);
|
|
9131
9158
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, newValue));
|
|
9132
9159
|
setVisible(false);
|
|
9133
|
-
|
|
9134
|
-
|
|
9135
|
-
|
|
9160
|
+
checkSkus(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.numIid, newImgList.length - 1);
|
|
9161
|
+
case 7:
|
|
9162
|
+
case "end":
|
|
9163
|
+
return _context2.stop();
|
|
9164
|
+
}
|
|
9165
|
+
}, _callee2);
|
|
9166
|
+
}));
|
|
9167
|
+
return function onSubmit(_x2) {
|
|
9168
|
+
return _ref4.apply(this, arguments);
|
|
9169
|
+
};
|
|
9170
|
+
}();
|
|
9171
|
+
var checkSkus = /*#__PURE__*/function () {
|
|
9172
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(numIid, index) {
|
|
9173
|
+
var res, data, _skuRef$current, options;
|
|
9174
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
9175
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9176
|
+
case 0:
|
|
9177
|
+
if (numIid) {
|
|
9178
|
+
_context3.next = 2;
|
|
9136
9179
|
break;
|
|
9137
9180
|
}
|
|
9138
|
-
|
|
9181
|
+
return _context3.abrupt("return");
|
|
9182
|
+
case 2:
|
|
9183
|
+
if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku)) {
|
|
9184
|
+
_context3.next = 8;
|
|
9185
|
+
break;
|
|
9186
|
+
}
|
|
9187
|
+
_context3.next = 5;
|
|
9139
9188
|
return querySkus({
|
|
9140
9189
|
shopId: shopId,
|
|
9141
|
-
numIids:
|
|
9142
|
-
});
|
|
9143
|
-
case
|
|
9144
|
-
|
|
9145
|
-
data =
|
|
9190
|
+
numIids: numIid
|
|
9191
|
+
}).catch(console.debug);
|
|
9192
|
+
case 5:
|
|
9193
|
+
res = _context3.sent;
|
|
9194
|
+
data = (res === null || res === void 0 ? void 0 : res.success) && (res === null || res === void 0 ? void 0 : res.data);
|
|
9146
9195
|
if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
|
|
9147
9196
|
options = data[0]['skus'].map(function (item) {
|
|
9148
9197
|
return {
|
|
9198
|
+
code: item.code,
|
|
9149
9199
|
label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
|
|
9150
9200
|
return i.split(':').slice(2);
|
|
9151
9201
|
}).join(';') : item.propertiesName,
|
|
@@ -9155,19 +9205,20 @@ var Goods = function Goods(props) {
|
|
|
9155
9205
|
};
|
|
9156
9206
|
});
|
|
9157
9207
|
(_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
|
|
9208
|
+
index: index,
|
|
9158
9209
|
shopId: shopId,
|
|
9159
|
-
numIids:
|
|
9210
|
+
numIids: numIid,
|
|
9160
9211
|
options: options
|
|
9161
9212
|
});
|
|
9162
9213
|
}
|
|
9163
|
-
case
|
|
9214
|
+
case 8:
|
|
9164
9215
|
case "end":
|
|
9165
|
-
return
|
|
9216
|
+
return _context3.stop();
|
|
9166
9217
|
}
|
|
9167
|
-
},
|
|
9218
|
+
}, _callee3);
|
|
9168
9219
|
}));
|
|
9169
|
-
return function
|
|
9170
|
-
return
|
|
9220
|
+
return function checkSkus(_x3, _x4) {
|
|
9221
|
+
return _ref5.apply(this, arguments);
|
|
9171
9222
|
};
|
|
9172
9223
|
}();
|
|
9173
9224
|
//修改参数
|
|
@@ -9194,7 +9245,8 @@ var Goods = function Goods(props) {
|
|
|
9194
9245
|
className: "goodsBox ".concat(goodsBoxClassName)
|
|
9195
9246
|
}, imgList === null || imgList === void 0 ? void 0 : imgList.map(function (img, index) {
|
|
9196
9247
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9197
|
-
className: "goodBox-Img"
|
|
9248
|
+
className: "goodBox-Img",
|
|
9249
|
+
key: "".concat(img.numIid, "_").concat(index)
|
|
9198
9250
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9199
9251
|
className: "goods-imgBox",
|
|
9200
9252
|
key: img.picUrl + '-goods'
|
|
@@ -9263,7 +9315,16 @@ var Goods = function Goods(props) {
|
|
|
9263
9315
|
disabled: disabled,
|
|
9264
9316
|
value: img.supplierName,
|
|
9265
9317
|
onChange: handleChangeValue('supplierName', index)
|
|
9266
|
-
})) : null
|
|
9318
|
+
})) : null, type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
9319
|
+
style: {
|
|
9320
|
+
marginTop: '4px'
|
|
9321
|
+
},
|
|
9322
|
+
size: "small",
|
|
9323
|
+
onClick: function onClick() {
|
|
9324
|
+
return checkSkus(img === null || img === void 0 ? void 0 : img.numIid, index);
|
|
9325
|
+
},
|
|
9326
|
+
type: "primary"
|
|
9327
|
+
}, "\u8C03\u6574sku") : null));
|
|
9267
9328
|
}), imgList.length < maxLength && !disabled ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9268
9329
|
className: "goods-imgBox",
|
|
9269
9330
|
onClick: function onClick() {
|
|
@@ -9363,8 +9424,10 @@ var GoodItem = function GoodItem(props) {
|
|
|
9363
9424
|
while (1) switch (_context.prev = _context.next) {
|
|
9364
9425
|
case 0:
|
|
9365
9426
|
shopId = _ref.shopId, numIids = _ref.numIids;
|
|
9366
|
-
return _context.abrupt("return",
|
|
9427
|
+
return _context.abrupt("return", kmkfUtils.request({
|
|
9428
|
+
url: '/qy/gdfw/workOrder/queryItemSkus',
|
|
9367
9429
|
method: 'post',
|
|
9430
|
+
handleError: antd.message.error,
|
|
9368
9431
|
data: {
|
|
9369
9432
|
shopId: shopId,
|
|
9370
9433
|
numIids: numIids
|
|
@@ -9393,25 +9456,31 @@ var GoodItem = function GoodItem(props) {
|
|
|
9393
9456
|
};
|
|
9394
9457
|
//选择sku
|
|
9395
9458
|
var handleSelectSku = function handleSelectSku(_ref3) {
|
|
9396
|
-
var
|
|
9459
|
+
var numIndex = _ref3.numIndex,
|
|
9460
|
+
code = _ref3.code,
|
|
9461
|
+
enableItemId = _ref3.enableItemId,
|
|
9397
9462
|
enableSupplierName = _ref3.enableSupplierName,
|
|
9398
9463
|
propertiesName = _ref3.propertiesName,
|
|
9399
9464
|
picUrl = _ref3.picUrl,
|
|
9400
9465
|
outerSkuId = _ref3.outerSkuId,
|
|
9401
9466
|
skuId = _ref3.skuId;
|
|
9467
|
+
if (numIndex < 0) return;
|
|
9402
9468
|
var newList = JSON.parse(JSON.stringify(imgList));
|
|
9403
9469
|
if (type === 4) {
|
|
9404
|
-
newList[
|
|
9405
|
-
newList[
|
|
9470
|
+
newList[numIndex].itemId = enableItemId;
|
|
9471
|
+
newList[numIndex].supplierName = enableSupplierName;
|
|
9406
9472
|
} else {
|
|
9407
|
-
newList[
|
|
9473
|
+
newList[numIndex].propertiesName = propertiesName;
|
|
9408
9474
|
}
|
|
9409
9475
|
if (type === 1) {
|
|
9410
|
-
if (outerSkuId) newList[
|
|
9411
|
-
if (skuId) newList[
|
|
9476
|
+
if (outerSkuId) newList[numIndex].outerSkuId = outerSkuId;
|
|
9477
|
+
if (skuId) newList[numIndex].skuId = skuId;
|
|
9478
|
+
}
|
|
9479
|
+
if (type === 1 && code) {
|
|
9480
|
+
newList[numIndex].outerId = code;
|
|
9412
9481
|
}
|
|
9413
9482
|
//替换成sku的图片
|
|
9414
|
-
picUrl && (newList[
|
|
9483
|
+
picUrl && (newList[numIndex].picUrl = picUrl);
|
|
9415
9484
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
9416
9485
|
shopId: shopId,
|
|
9417
9486
|
imgList: newList
|
|
@@ -9420,7 +9489,8 @@ var GoodItem = function GoodItem(props) {
|
|
|
9420
9489
|
//选择回调
|
|
9421
9490
|
var onSubmit = /*#__PURE__*/function () {
|
|
9422
9491
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
|
|
9423
|
-
var
|
|
9492
|
+
var _list$;
|
|
9493
|
+
var newList, newImgList;
|
|
9424
9494
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
9425
9495
|
while (1) switch (_context2.prev = _context2.next) {
|
|
9426
9496
|
case 0:
|
|
@@ -9460,22 +9530,45 @@ var GoodItem = function GoodItem(props) {
|
|
|
9460
9530
|
imgList: newImgList
|
|
9461
9531
|
});
|
|
9462
9532
|
setVisible(false);
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9533
|
+
checkSkus(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.numIid, newImgList.length - 1);
|
|
9534
|
+
case 5:
|
|
9535
|
+
case "end":
|
|
9536
|
+
return _context2.stop();
|
|
9537
|
+
}
|
|
9538
|
+
}, _callee2);
|
|
9539
|
+
}));
|
|
9540
|
+
return function onSubmit(_x2) {
|
|
9541
|
+
return _ref4.apply(this, arguments);
|
|
9542
|
+
};
|
|
9543
|
+
}();
|
|
9544
|
+
var checkSkus = /*#__PURE__*/function () {
|
|
9545
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(numIid, index) {
|
|
9546
|
+
var res, data, _skuRef$current, options;
|
|
9547
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
9548
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
9549
|
+
case 0:
|
|
9550
|
+
if (numIid) {
|
|
9551
|
+
_context3.next = 2;
|
|
9466
9552
|
break;
|
|
9467
9553
|
}
|
|
9468
|
-
|
|
9554
|
+
return _context3.abrupt("return");
|
|
9555
|
+
case 2:
|
|
9556
|
+
if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku)) {
|
|
9557
|
+
_context3.next = 8;
|
|
9558
|
+
break;
|
|
9559
|
+
}
|
|
9560
|
+
_context3.next = 5;
|
|
9469
9561
|
return querySkus({
|
|
9470
9562
|
shopId: shopId,
|
|
9471
|
-
numIids:
|
|
9472
|
-
});
|
|
9473
|
-
case
|
|
9474
|
-
|
|
9475
|
-
data =
|
|
9563
|
+
numIids: numIid
|
|
9564
|
+
}).catch(console.debug);
|
|
9565
|
+
case 5:
|
|
9566
|
+
res = _context3.sent;
|
|
9567
|
+
data = (res === null || res === void 0 ? void 0 : res.success) && (res === null || res === void 0 ? void 0 : res.data);
|
|
9476
9568
|
if (data && data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
|
|
9477
9569
|
options = data[0]['skus'].map(function (item) {
|
|
9478
9570
|
return {
|
|
9571
|
+
code: item.code,
|
|
9479
9572
|
label: isTaobaoPlat ? item.propertiesName.split(';').map(function (i) {
|
|
9480
9573
|
return i.split(':').slice(2);
|
|
9481
9574
|
}).join(';') : item.propertiesName,
|
|
@@ -9486,19 +9579,20 @@ var GoodItem = function GoodItem(props) {
|
|
|
9486
9579
|
};
|
|
9487
9580
|
});
|
|
9488
9581
|
(_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
|
|
9582
|
+
index: index,
|
|
9489
9583
|
shopId: shopId,
|
|
9490
|
-
numIids:
|
|
9584
|
+
numIids: numIid,
|
|
9491
9585
|
options: options
|
|
9492
9586
|
});
|
|
9493
9587
|
}
|
|
9494
|
-
case
|
|
9588
|
+
case 8:
|
|
9495
9589
|
case "end":
|
|
9496
|
-
return
|
|
9590
|
+
return _context3.stop();
|
|
9497
9591
|
}
|
|
9498
|
-
},
|
|
9592
|
+
}, _callee3);
|
|
9499
9593
|
}));
|
|
9500
|
-
return function
|
|
9501
|
-
return
|
|
9594
|
+
return function checkSkus(_x3, _x4) {
|
|
9595
|
+
return _ref5.apply(this, arguments);
|
|
9502
9596
|
};
|
|
9503
9597
|
}();
|
|
9504
9598
|
var headerList = showHeader || {
|
|
@@ -9583,7 +9677,16 @@ var GoodItem = function GoodItem(props) {
|
|
|
9583
9677
|
src: img.picUrl || defaultImg,
|
|
9584
9678
|
className: "img",
|
|
9585
9679
|
alt: ""
|
|
9586
|
-
}))
|
|
9680
|
+
})), type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
9681
|
+
style: {
|
|
9682
|
+
marginTop: '4px'
|
|
9683
|
+
},
|
|
9684
|
+
size: "small",
|
|
9685
|
+
onClick: function onClick() {
|
|
9686
|
+
return checkSkus(img === null || img === void 0 ? void 0 : img.numIid, index);
|
|
9687
|
+
},
|
|
9688
|
+
type: "primary"
|
|
9689
|
+
}, "\u8C03\u6574sku") : null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9587
9690
|
className: "good-attrs",
|
|
9588
9691
|
key: "".concat(img.picUrl, "-").concat(index, "-context")
|
|
9589
9692
|
}, goodItemAttrs.map(function (item) {
|
|
@@ -9598,7 +9701,16 @@ var GoodItem = function GoodItem(props) {
|
|
|
9598
9701
|
disabled: item.disabled || disabled,
|
|
9599
9702
|
onChange: handleChangeValue(item.key, index)
|
|
9600
9703
|
}));
|
|
9601
|
-
})
|
|
9704
|
+
}), !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
9705
|
+
style: {
|
|
9706
|
+
marginTop: '4px'
|
|
9707
|
+
},
|
|
9708
|
+
size: "small",
|
|
9709
|
+
onClick: function onClick() {
|
|
9710
|
+
return checkSkus(img === null || img === void 0 ? void 0 : img.numIid, index);
|
|
9711
|
+
},
|
|
9712
|
+
type: "primary"
|
|
9713
|
+
}, "\u8C03\u6574sku") : null));
|
|
9602
9714
|
}), imgList.length < maxLength && !disabled ? /*#__PURE__*/React__default['default'].createElement("div", {
|
|
9603
9715
|
className: "goods-imgBox",
|
|
9604
9716
|
onClick: function onClick() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "1.8.0-beta.
|
|
3
|
+
"version": "1.8.0-beta.3",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "9b8a08d2903221ffe9aacb2c18953dc165e30851"
|
|
69
69
|
}
|