@kmkf-fe-packages/basic-components 0.21.4 → 0.22.0-alpha.1

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
@@ -1,9 +1,9 @@
1
1
  import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
2
- import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Popover, Table } from 'antd';
2
+ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Table, Popover } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, request as request$1, ExpressData, LogisticsAddressData, uuid } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
8
  import pubsub from 'pubsub-js';
9
9
  import { cloneDeep } from 'lodash';
@@ -8435,7 +8435,7 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
8435
8435
  });
8436
8436
  var handleSure = /*#__PURE__*/function () {
8437
8437
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8438
- var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _yield$request, _yield$request$data, data;
8438
+ var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _yield$request, _yield$request$data, data;
8439
8439
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8440
8440
  while (1) switch (_context.prev = _context.next) {
8441
8441
  case 0:
@@ -8470,7 +8470,10 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
8470
8470
  }) === null || _ref4 === void 0 ? void 0 : _ref4.picUrl,
8471
8471
  outerSkuId: (_ref5 = SKU || {
8472
8472
  outerSkuId: ''
8473
- }) === null || _ref5 === void 0 ? void 0 : _ref5.outerSkuId
8473
+ }) === null || _ref5 === void 0 ? void 0 : _ref5.outerSkuId,
8474
+ skuId: ((_ref6 = SKU || {
8475
+ skuId: ''
8476
+ }) === null || _ref6 === void 0 ? void 0 : _ref6.skuId) || ''
8474
8477
  });
8475
8478
  _context.next = 16;
8476
8479
  break;
@@ -8491,12 +8494,15 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
8491
8494
  props.handleOk({
8492
8495
  enableItemId: data.length > 0 ? data[0]['supplierItemOuterId'] : '',
8493
8496
  enableSupplierName: data.length > 0 ? data[0]['supplierName'] : '',
8494
- propertiesName: ((_ref6 = SKU || {
8497
+ propertiesName: ((_ref7 = SKU || {
8495
8498
  label: ''
8496
- }) === null || _ref6 === void 0 ? void 0 : _ref6.label) || '',
8497
- picUrl: (_ref7 = SKU || {
8499
+ }) === null || _ref7 === void 0 ? void 0 : _ref7.label) || '',
8500
+ picUrl: (_ref8 = SKU || {
8498
8501
  picUrl: ''
8499
- }) === null || _ref7 === void 0 ? void 0 : _ref7.picUrl
8502
+ }) === null || _ref8 === void 0 ? void 0 : _ref8.picUrl,
8503
+ skuId: ((_ref9 = SKU || {
8504
+ skuId: ''
8505
+ }) === null || _ref9 === void 0 ? void 0 : _ref9.skuId) || ''
8500
8506
  });
8501
8507
  case 16:
8502
8508
  setVisible(false);
@@ -8874,8 +8880,331 @@ var ChooseBaby = function ChooseBaby(props) {
8874
8880
  }));
8875
8881
  };
8876
8882
 
8883
+ var GoodItem = function GoodItem(props) {
8884
+ var _props$value = props.value,
8885
+ value = _props$value === void 0 ? {
8886
+ shopId: '',
8887
+ imgList: []
8888
+ } : _props$value,
8889
+ _props$maxLength = props.maxLength,
8890
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
8891
+ onChange = props.onChange,
8892
+ _props$type = props.type,
8893
+ type = _props$type === void 0 ? 2 : _props$type,
8894
+ _props$shopList = props.shopList,
8895
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
8896
+ showHeader = props.showHeader,
8897
+ _props$showChangeBtn = props.showChangeBtn,
8898
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
8899
+ otherOperations = props.otherOperations,
8900
+ canUpdateNumber = props.canUpdateNumber,
8901
+ enableItemId = props.enableItemId,
8902
+ enableSupplierName = props.enableSupplierName,
8903
+ userNick = props.userNick,
8904
+ disabled = props.disabled,
8905
+ changeSku = props.changeSku,
8906
+ width = props.width;
8907
+ console.log('value', value);
8908
+ var shopId = value.shopId,
8909
+ imgList = value.imgList;
8910
+ var _useState = useState(false),
8911
+ _useState2 = _slicedToArray(_useState, 2),
8912
+ visible = _useState2[0],
8913
+ setVisible = _useState2[1];
8914
+ var skuRef = useRef();
8915
+ //是否是淘宝店铺
8916
+ var isTaobaoPlat = useMemo(function () {
8917
+ console.log('shopId', shopId);
8918
+ return shopList.some(function (item) {
8919
+ return item.shopId === shopId && item.shopSourceStr === 'TAOBAO';
8920
+ });
8921
+ }, [shopId]);
8922
+ // 查询SKU
8923
+ var querySkus = /*#__PURE__*/function () {
8924
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
8925
+ var shopId, numIids;
8926
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8927
+ while (1) switch (_context.prev = _context.next) {
8928
+ case 0:
8929
+ shopId = _ref.shopId, numIids = _ref.numIids;
8930
+ return _context.abrupt("return", extendRequest('/qy/gdfw/workOrder/queryItemSkus', {
8931
+ method: 'post',
8932
+ data: {
8933
+ shopId: shopId,
8934
+ numIids: numIids
8935
+ }
8936
+ }));
8937
+ case 2:
8938
+ case "end":
8939
+ return _context.stop();
8940
+ }
8941
+ }, _callee);
8942
+ }));
8943
+ return function querySkus(_x) {
8944
+ return _ref2.apply(this, arguments);
8945
+ };
8946
+ }();
8947
+ //删除行
8948
+ var handleDelete = function handleDelete(record, index) {
8949
+ var newSelect = imgList.filter(function (_, i) {
8950
+ return index !== i;
8951
+ });
8952
+ onChange === null || onChange === void 0 ? void 0 : onChange({
8953
+ shopId: shopId,
8954
+ imgList: _toConsumableArray(newSelect)
8955
+ });
8956
+ };
8957
+ //选择sku
8958
+ var handleSelectSku = function handleSelectSku(_ref3) {
8959
+ var enableItemId = _ref3.enableItemId,
8960
+ enableSupplierName = _ref3.enableSupplierName,
8961
+ propertiesName = _ref3.propertiesName,
8962
+ picUrl = _ref3.picUrl,
8963
+ outerSkuId = _ref3.outerSkuId,
8964
+ skuId = _ref3.skuId;
8965
+ var newList = JSON.parse(JSON.stringify(imgList));
8966
+ if (type === 4) {
8967
+ newList[newList.length - 1].itemId = enableItemId;
8968
+ newList[newList.length - 1].supplierName = enableSupplierName;
8969
+ } else {
8970
+ newList[newList.length - 1].propertiesName = propertiesName;
8971
+ }
8972
+ if (type === 1) {
8973
+ if (outerSkuId) newList[newList.length - 1].outerSkuId = outerSkuId;
8974
+ if (skuId) newList[newList.length - 1].skuId = skuId;
8975
+ }
8976
+ //替换成sku的图片
8977
+ picUrl && (newList[newList.length - 1].picUrl = picUrl);
8978
+ onChange === null || onChange === void 0 ? void 0 : onChange({
8979
+ shopId: shopId,
8980
+ imgList: newList
8981
+ });
8982
+ };
8983
+ //选择回调
8984
+ var onSubmit = /*#__PURE__*/function () {
8985
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
8986
+ var newList, newImgList, _yield$querySkus, data, _skuRef$current, options;
8987
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8988
+ while (1) switch (_context2.prev = _context2.next) {
8989
+ case 0:
8990
+ console.log('🚀 ~ file: table.tsx:160 ~ onSubmit ~ list:', list);
8991
+ newList = list.map(function (item) {
8992
+ //过滤属性 只保存需要的字段
8993
+ var params = {
8994
+ uuid: uuid(),
8995
+ platform: item.platform,
8996
+ price: item.price,
8997
+ canDelete: true,
8998
+ title: item.title,
8999
+ outerId: item.outerId,
9000
+ picUrl: item.picUrl,
9001
+ numIid: item.numIid,
9002
+ skuId: item.skuId,
9003
+ outerSkuId: item.outerSkuId
9004
+ };
9005
+ // if (type === 1) {
9006
+ // params.outerId = item.outerId; //编码
9007
+ // }
9008
+ if (changeSku) {
9009
+ params.propertiesName = '';
9010
+ }
9011
+ // if (type === 4) {
9012
+ // if (enableItemId) {
9013
+ // params.itemId = '';
9014
+ // }
9015
+ // if (enableSupplierName) {
9016
+ // params.supplierName = '';
9017
+ // }
9018
+ // }
9019
+ return params;
9020
+ });
9021
+ newImgList = changeSku || type === 4 ? [].concat(_toConsumableArray(imgList), _toConsumableArray(newList)) : _toConsumableArray(newList);
9022
+ onChange === null || onChange === void 0 ? void 0 : onChange({
9023
+ shopId: shopId,
9024
+ imgList: newImgList
9025
+ });
9026
+ setVisible(false);
9027
+ //供应上编码组件 || 商品组件且可以选择sku
9028
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
9029
+ _context2.next = 11;
9030
+ break;
9031
+ }
9032
+ _context2.next = 8;
9033
+ return querySkus({
9034
+ shopId: shopId,
9035
+ numIids: list[0].numIid
9036
+ });
9037
+ case 8:
9038
+ _yield$querySkus = _context2.sent;
9039
+ data = _yield$querySkus.data;
9040
+ if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9041
+ options = data[0]['skus'].map(function (item) {
9042
+ return {
9043
+ label: item.propertiesName.split(';').map(function (i) {
9044
+ return i.split(':').slice(2);
9045
+ }).join(';'),
9046
+ value: item.skuId,
9047
+ picUrl: item.picUrl,
9048
+ outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId,
9049
+ skuId: item.skuId
9050
+ };
9051
+ });
9052
+ (_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
9053
+ shopId: shopId,
9054
+ numIids: list[0].numIid,
9055
+ options: options
9056
+ });
9057
+ }
9058
+ case 11:
9059
+ case "end":
9060
+ return _context2.stop();
9061
+ }
9062
+ }, _callee2);
9063
+ }));
9064
+ return function onSubmit(_x2) {
9065
+ return _ref4.apply(this, arguments);
9066
+ };
9067
+ }();
9068
+ //商品信息
9069
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
9070
+ return [{
9071
+ dataIndex: 'title',
9072
+ title: "\u5546\u54C1\u540D\u79F0",
9073
+ align: 'center',
9074
+ ellipsis: true,
9075
+ width: 250
9076
+ }, {
9077
+ dataIndex: 'outerId',
9078
+ title: "\u5546\u54C1\u7F16\u7801",
9079
+ align: 'center',
9080
+ ellipsis: true,
9081
+ width: 250
9082
+ }, {
9083
+ dataIndex: 'picUrl',
9084
+ title: "\u56FE\u7247",
9085
+ align: 'center',
9086
+ ellipsis: true,
9087
+ width: 100,
9088
+ render: function render(val) {
9089
+ return /*#__PURE__*/React.createElement(Image, {
9090
+ width: 60,
9091
+ src: val
9092
+ });
9093
+ }
9094
+ }, {
9095
+ dataIndex: 'numIid',
9096
+ title: "\u5546\u54C1id",
9097
+ align: 'center',
9098
+ ellipsis: true,
9099
+ width: 250
9100
+ }, {
9101
+ dataIndex: 'skuId',
9102
+ title: "SKU ID",
9103
+ align: 'center',
9104
+ ellipsis: true,
9105
+ width: 250
9106
+ }, {
9107
+ dataIndex: 'outerSkuId',
9108
+ title: "SKU \u7F16\u7801",
9109
+ align: 'center',
9110
+ ellipsis: true,
9111
+ width: 250
9112
+ }, {
9113
+ dataIndex: 'propertiesName',
9114
+ title: "SKU \u4FE1\u606F",
9115
+ align: 'center',
9116
+ ellipsis: true,
9117
+ width: 250
9118
+ }];
9119
+ };
9120
+ var headerList = showHeader || {
9121
+ 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku信息
9122
+ ]
9123
+ }[type] || [];
9124
+ var newColumns = useMemo(function () {
9125
+ var columnList = [{
9126
+ dataIndex: '',
9127
+ title: '序号',
9128
+ align: 'center',
9129
+ ellipsis: true,
9130
+ width: 50,
9131
+ render: function render(val, record, index) {
9132
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
9133
+ }
9134
+ }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
9135
+ return headerList.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
9136
+ })));
9137
+ if (!disabled) {
9138
+ columnList.push({
9139
+ dataIndex: '',
9140
+ title: "\u64CD\u4F5C",
9141
+ align: 'center',
9142
+ ellipsis: true,
9143
+ width: 100,
9144
+ render: function render(val, record, index) {
9145
+ return record.canDelete ? /*#__PURE__*/React.createElement(Button, {
9146
+ type: "link",
9147
+ onClick: function onClick() {
9148
+ return handleDelete(record, index);
9149
+ }
9150
+ }, "\u5220\u9664") : null;
9151
+ }
9152
+ });
9153
+ }
9154
+ return columnList;
9155
+ }, [headerList, value, disabled]);
9156
+ var handleChangeGoods = function handleChangeGoods() {
9157
+ var _props$value2;
9158
+ console.log('shopId', shopId, props.value);
9159
+ if (!((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.shopId)) {
9160
+ message.error('请选择店铺');
9161
+ return;
9162
+ }
9163
+ setVisible(true);
9164
+ };
9165
+ window.handleChangeGoods = handleChangeGoods;
9166
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && showChangeBtn && /*#__PURE__*/React.createElement("div", {
9167
+ style: {
9168
+ float: 'right'
9169
+ }
9170
+ }, /*#__PURE__*/React.createElement(Button, {
9171
+ type: "link",
9172
+ onClick: handleChangeGoods
9173
+ }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React.createElement(Table, {
9174
+ columns: newColumns,
9175
+ dataSource: value.imgList,
9176
+ rowKey: 'uuid',
9177
+ size: "small",
9178
+ pagination: false,
9179
+ scroll: {
9180
+ x: '100%'
9181
+ },
9182
+ locale: {
9183
+ emptyText: '暂无数据'
9184
+ }
9185
+ }), visible ? /*#__PURE__*/React.createElement(GoodsModal, {
9186
+ visible: visible,
9187
+ onSubmit: onSubmit,
9188
+ width: width,
9189
+ type: type,
9190
+ imgList: imgList,
9191
+ shopList: shopList,
9192
+ shopId: shopId,
9193
+ maxLength: maxLength,
9194
+ changeSku: changeSku,
9195
+ onCancel: function onCancel() {
9196
+ setVisible(false);
9197
+ }
9198
+ }) : null, /*#__PURE__*/React.createElement(Sku, {
9199
+ handleOk: handleSelectSku,
9200
+ ref: skuRef,
9201
+ userNick: userNick,
9202
+ type: type
9203
+ }));
9204
+ };
9205
+
8877
9206
  var TBGoodSerial = function TBGoodSerial(props) {
8878
- return /*#__PURE__*/React.createElement(Goods, _objectSpread2(_objectSpread2({}, props), {}, {
9207
+ return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({}, props), {}, {
8879
9208
  type: 1
8880
9209
  }));
8881
9210
  };
@@ -9229,7 +9558,9 @@ var Payment = function Payment(props) {
9229
9558
  shopList = props.shopList,
9230
9559
  onChange = props.onChange,
9231
9560
  onSearch = props.onSearch,
9232
- _onBlur = props.onBlur;
9561
+ _onBlur = props.onBlur,
9562
+ _props$replaceValueCh = props.replaceValueCh,
9563
+ replaceValueCh = _props$replaceValueCh === void 0 ? {} : _props$replaceValueCh;
9233
9564
  useEffect(function () {
9234
9565
  var platformList = ['TAOBAO', 'FXG'];
9235
9566
  var showBuyerId = (shopList || []).some(function (item) {
@@ -9306,7 +9637,11 @@ var Payment = function Payment(props) {
9306
9637
  onBlur: function onBlur(e) {
9307
9638
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
9308
9639
  }
9309
- }));
9640
+ }), (replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]) && /*#__PURE__*/React.createElement("p", {
9641
+ style: {
9642
+ color: '#e99d42'
9643
+ }
9644
+ }, replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]));
9310
9645
  }));
9311
9646
  };
9312
9647
 
@@ -10330,7 +10665,7 @@ var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
10330
10665
  // skuId: string;
10331
10666
  // styleId: string;
10332
10667
  // }
10333
- var GoodItem = function GoodItem(props) {
10668
+ var GoodItem$1 = function GoodItem(props) {
10334
10669
  var _props$value = props.value,
10335
10670
  value = _props$value === void 0 ? [] : _props$value,
10336
10671
  onChange = props.onChange,
@@ -10705,7 +11040,7 @@ var BsGoods = function BsGoods(props) {
10705
11040
  bsGoods: list
10706
11041
  }));
10707
11042
  };
10708
- return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11043
+ return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10709
11044
  key: 'bsGoods'
10710
11045
  }, props), {}, {
10711
11046
  disabled: disabled,
@@ -10903,12 +11238,12 @@ var BsExchange = function BsExchange(props) {
10903
11238
  onChange: function onChange(val) {
10904
11239
  return changeTypeHandle(val);
10905
11240
  }
10906
- }), !(value === null || value === void 0 ? void 0 : (_value$bsExchangeType4 = value.bsExchangeType) === null || _value$bsExchangeType4 === void 0 ? void 0 : _value$bsExchangeType4.length) ? /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11241
+ }), !(value === null || value === void 0 ? void 0 : (_value$bsExchangeType4 = value.bsExchangeType) === null || _value$bsExchangeType4 === void 0 ? void 0 : _value$bsExchangeType4.length) ? /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10907
11242
  key: 'bsExchangeGoods'
10908
11243
  }, other), {}, {
10909
11244
  disabled: disabled,
10910
11245
  showChangeBtn: false
10911
- })) : null, ['1', '3'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType5 = value.bsExchangeType) === null || _value$bsExchangeType5 === void 0 ? void 0 : _value$bsExchangeType5[0]) ? /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11246
+ })) : null, ['1', '3'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType5 = value.bsExchangeType) === null || _value$bsExchangeType5 === void 0 ? void 0 : _value$bsExchangeType5[0]) ? /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10912
11247
  key: 'bsExchangeGoods'
10913
11248
  }, other), {}, {
10914
11249
  disabled: disabled,
@@ -10924,7 +11259,7 @@ var BsExchange = function BsExchange(props) {
10924
11259
  border: '1px dashed',
10925
11260
  marginBottom: '8px'
10926
11261
  }
10927
- }, /*#__PURE__*/React.createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11262
+ }, /*#__PURE__*/React.createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10928
11263
  key: 'bsReturnGoods'
10929
11264
  }, other), {}, {
10930
11265
  disabled: disabled,
@@ -10934,7 +11269,7 @@ var BsExchange = function BsExchange(props) {
10934
11269
  onChange: function onChange(val) {
10935
11270
  return changeReturnHandle(val, index, 'bsExchangeReturnGoods');
10936
11271
  }
10937
- })), /*#__PURE__*/React.createElement("div", null, "\u6362\u51FA\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11272
+ })), /*#__PURE__*/React.createElement("div", null, "\u6362\u51FA\u5546\u54C1"), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10938
11273
  key: 'bsOutGoods'
10939
11274
  }, other), {}, {
10940
11275
  disabled: disabled,
@@ -10946,7 +11281,7 @@ var BsExchange = function BsExchange(props) {
10946
11281
  return changeReturnHandle(val, index, 'bsExchangeSwapOutGoods');
10947
11282
  }
10948
11283
  })));
10949
- })), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType6 = value.bsExchangeType) === null || _value$bsExchangeType6 === void 0 ? void 0 : _value$bsExchangeType6[0]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11284
+ })), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType6 = value.bsExchangeType) === null || _value$bsExchangeType6 === void 0 ? void 0 : _value$bsExchangeType6[0]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10950
11285
  headerText: "\u8D60\u54C1",
10951
11286
  key: 'bsGiftGoods',
10952
11287
  disabled: disabled,
@@ -11057,7 +11392,7 @@ var BsReissue = function BsReissue(props) {
11057
11392
  onChange: function onChange(val) {
11058
11393
  return changeTypeHandle(val);
11059
11394
  }
11060
- }), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11395
+ }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11061
11396
  key: 'reissueGoods'
11062
11397
  }, other), {}, {
11063
11398
  disabled: disabled,
@@ -11154,7 +11489,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
11154
11489
  onChange: function onChange(val) {
11155
11490
  return changeTypeHandle(val);
11156
11491
  }
11157
- }), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11492
+ }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11158
11493
  key: 'returnGoods'
11159
11494
  }, other), {}, {
11160
11495
  disabled: disabled,
@@ -11331,7 +11666,7 @@ var WlnGoods = function WlnGoods(props) {
11331
11666
  wlnGoods: list
11332
11667
  }));
11333
11668
  };
11334
- return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11669
+ return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11335
11670
  key: 'wlnGoods'
11336
11671
  }, props), {}, {
11337
11672
  disabled: disabled,
package/dist/index.js CHANGED
@@ -8446,7 +8446,7 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
8446
8446
  });
8447
8447
  var handleSure = /*#__PURE__*/function () {
8448
8448
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8449
- var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _yield$request, _yield$request$data, data;
8449
+ var type, SKU, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _yield$request, _yield$request$data, data;
8450
8450
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8451
8451
  while (1) switch (_context.prev = _context.next) {
8452
8452
  case 0:
@@ -8481,7 +8481,10 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
8481
8481
  }) === null || _ref4 === void 0 ? void 0 : _ref4.picUrl,
8482
8482
  outerSkuId: (_ref5 = SKU || {
8483
8483
  outerSkuId: ''
8484
- }) === null || _ref5 === void 0 ? void 0 : _ref5.outerSkuId
8484
+ }) === null || _ref5 === void 0 ? void 0 : _ref5.outerSkuId,
8485
+ skuId: ((_ref6 = SKU || {
8486
+ skuId: ''
8487
+ }) === null || _ref6 === void 0 ? void 0 : _ref6.skuId) || ''
8485
8488
  });
8486
8489
  _context.next = 16;
8487
8490
  break;
@@ -8502,12 +8505,15 @@ var Sku = /*#__PURE__*/React.forwardRef(function (props, ref) {
8502
8505
  props.handleOk({
8503
8506
  enableItemId: data.length > 0 ? data[0]['supplierItemOuterId'] : '',
8504
8507
  enableSupplierName: data.length > 0 ? data[0]['supplierName'] : '',
8505
- propertiesName: ((_ref6 = SKU || {
8508
+ propertiesName: ((_ref7 = SKU || {
8506
8509
  label: ''
8507
- }) === null || _ref6 === void 0 ? void 0 : _ref6.label) || '',
8508
- picUrl: (_ref7 = SKU || {
8510
+ }) === null || _ref7 === void 0 ? void 0 : _ref7.label) || '',
8511
+ picUrl: (_ref8 = SKU || {
8509
8512
  picUrl: ''
8510
- }) === null || _ref7 === void 0 ? void 0 : _ref7.picUrl
8513
+ }) === null || _ref8 === void 0 ? void 0 : _ref8.picUrl,
8514
+ skuId: ((_ref9 = SKU || {
8515
+ skuId: ''
8516
+ }) === null || _ref9 === void 0 ? void 0 : _ref9.skuId) || ''
8511
8517
  });
8512
8518
  case 16:
8513
8519
  setVisible(false);
@@ -8885,8 +8891,331 @@ var ChooseBaby = function ChooseBaby(props) {
8885
8891
  }));
8886
8892
  };
8887
8893
 
8894
+ var GoodItem = function GoodItem(props) {
8895
+ var _props$value = props.value,
8896
+ value = _props$value === void 0 ? {
8897
+ shopId: '',
8898
+ imgList: []
8899
+ } : _props$value,
8900
+ _props$maxLength = props.maxLength,
8901
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
8902
+ onChange = props.onChange,
8903
+ _props$type = props.type,
8904
+ type = _props$type === void 0 ? 2 : _props$type,
8905
+ _props$shopList = props.shopList,
8906
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
8907
+ showHeader = props.showHeader,
8908
+ _props$showChangeBtn = props.showChangeBtn,
8909
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
8910
+ otherOperations = props.otherOperations,
8911
+ canUpdateNumber = props.canUpdateNumber,
8912
+ enableItemId = props.enableItemId,
8913
+ enableSupplierName = props.enableSupplierName,
8914
+ userNick = props.userNick,
8915
+ disabled = props.disabled,
8916
+ changeSku = props.changeSku,
8917
+ width = props.width;
8918
+ console.log('value', value);
8919
+ var shopId = value.shopId,
8920
+ imgList = value.imgList;
8921
+ var _useState = React.useState(false),
8922
+ _useState2 = _slicedToArray(_useState, 2),
8923
+ visible = _useState2[0],
8924
+ setVisible = _useState2[1];
8925
+ var skuRef = React.useRef();
8926
+ //是否是淘宝店铺
8927
+ var isTaobaoPlat = React.useMemo(function () {
8928
+ console.log('shopId', shopId);
8929
+ return shopList.some(function (item) {
8930
+ return item.shopId === shopId && item.shopSourceStr === 'TAOBAO';
8931
+ });
8932
+ }, [shopId]);
8933
+ // 查询SKU
8934
+ var querySkus = /*#__PURE__*/function () {
8935
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
8936
+ var shopId, numIids;
8937
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8938
+ while (1) switch (_context.prev = _context.next) {
8939
+ case 0:
8940
+ shopId = _ref.shopId, numIids = _ref.numIids;
8941
+ return _context.abrupt("return", extendRequest('/qy/gdfw/workOrder/queryItemSkus', {
8942
+ method: 'post',
8943
+ data: {
8944
+ shopId: shopId,
8945
+ numIids: numIids
8946
+ }
8947
+ }));
8948
+ case 2:
8949
+ case "end":
8950
+ return _context.stop();
8951
+ }
8952
+ }, _callee);
8953
+ }));
8954
+ return function querySkus(_x) {
8955
+ return _ref2.apply(this, arguments);
8956
+ };
8957
+ }();
8958
+ //删除行
8959
+ var handleDelete = function handleDelete(record, index) {
8960
+ var newSelect = imgList.filter(function (_, i) {
8961
+ return index !== i;
8962
+ });
8963
+ onChange === null || onChange === void 0 ? void 0 : onChange({
8964
+ shopId: shopId,
8965
+ imgList: _toConsumableArray(newSelect)
8966
+ });
8967
+ };
8968
+ //选择sku
8969
+ var handleSelectSku = function handleSelectSku(_ref3) {
8970
+ var enableItemId = _ref3.enableItemId,
8971
+ enableSupplierName = _ref3.enableSupplierName,
8972
+ propertiesName = _ref3.propertiesName,
8973
+ picUrl = _ref3.picUrl,
8974
+ outerSkuId = _ref3.outerSkuId,
8975
+ skuId = _ref3.skuId;
8976
+ var newList = JSON.parse(JSON.stringify(imgList));
8977
+ if (type === 4) {
8978
+ newList[newList.length - 1].itemId = enableItemId;
8979
+ newList[newList.length - 1].supplierName = enableSupplierName;
8980
+ } else {
8981
+ newList[newList.length - 1].propertiesName = propertiesName;
8982
+ }
8983
+ if (type === 1) {
8984
+ if (outerSkuId) newList[newList.length - 1].outerSkuId = outerSkuId;
8985
+ if (skuId) newList[newList.length - 1].skuId = skuId;
8986
+ }
8987
+ //替换成sku的图片
8988
+ picUrl && (newList[newList.length - 1].picUrl = picUrl);
8989
+ onChange === null || onChange === void 0 ? void 0 : onChange({
8990
+ shopId: shopId,
8991
+ imgList: newList
8992
+ });
8993
+ };
8994
+ //选择回调
8995
+ var onSubmit = /*#__PURE__*/function () {
8996
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
8997
+ var newList, newImgList, _yield$querySkus, data, _skuRef$current, options;
8998
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8999
+ while (1) switch (_context2.prev = _context2.next) {
9000
+ case 0:
9001
+ console.log('🚀 ~ file: table.tsx:160 ~ onSubmit ~ list:', list);
9002
+ newList = list.map(function (item) {
9003
+ //过滤属性 只保存需要的字段
9004
+ var params = {
9005
+ uuid: kmkfUtils.uuid(),
9006
+ platform: item.platform,
9007
+ price: item.price,
9008
+ canDelete: true,
9009
+ title: item.title,
9010
+ outerId: item.outerId,
9011
+ picUrl: item.picUrl,
9012
+ numIid: item.numIid,
9013
+ skuId: item.skuId,
9014
+ outerSkuId: item.outerSkuId
9015
+ };
9016
+ // if (type === 1) {
9017
+ // params.outerId = item.outerId; //编码
9018
+ // }
9019
+ if (changeSku) {
9020
+ params.propertiesName = '';
9021
+ }
9022
+ // if (type === 4) {
9023
+ // if (enableItemId) {
9024
+ // params.itemId = '';
9025
+ // }
9026
+ // if (enableSupplierName) {
9027
+ // params.supplierName = '';
9028
+ // }
9029
+ // }
9030
+ return params;
9031
+ });
9032
+ newImgList = changeSku || type === 4 ? [].concat(_toConsumableArray(imgList), _toConsumableArray(newList)) : _toConsumableArray(newList);
9033
+ onChange === null || onChange === void 0 ? void 0 : onChange({
9034
+ shopId: shopId,
9035
+ imgList: newImgList
9036
+ });
9037
+ setVisible(false);
9038
+ //供应上编码组件 || 商品组件且可以选择sku
9039
+ if (!(type === 4 && (enableItemId || enableSupplierName) || type !== 4 && changeSku && isTaobaoPlat && list.length > 0)) {
9040
+ _context2.next = 11;
9041
+ break;
9042
+ }
9043
+ _context2.next = 8;
9044
+ return querySkus({
9045
+ shopId: shopId,
9046
+ numIids: list[0].numIid
9047
+ });
9048
+ case 8:
9049
+ _yield$querySkus = _context2.sent;
9050
+ data = _yield$querySkus.data;
9051
+ if (data.length > 0 && data[0]['skus'] && data[0]['skus']['length'] > 0) {
9052
+ options = data[0]['skus'].map(function (item) {
9053
+ return {
9054
+ label: item.propertiesName.split(';').map(function (i) {
9055
+ return i.split(':').slice(2);
9056
+ }).join(';'),
9057
+ value: item.skuId,
9058
+ picUrl: item.picUrl,
9059
+ outerSkuId: item === null || item === void 0 ? void 0 : item.outerSkuId,
9060
+ skuId: item.skuId
9061
+ };
9062
+ });
9063
+ (_skuRef$current = skuRef.current) === null || _skuRef$current === void 0 ? void 0 : _skuRef$current.open({
9064
+ shopId: shopId,
9065
+ numIids: list[0].numIid,
9066
+ options: options
9067
+ });
9068
+ }
9069
+ case 11:
9070
+ case "end":
9071
+ return _context2.stop();
9072
+ }
9073
+ }, _callee2);
9074
+ }));
9075
+ return function onSubmit(_x2) {
9076
+ return _ref4.apply(this, arguments);
9077
+ };
9078
+ }();
9079
+ //商品信息
9080
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
9081
+ return [{
9082
+ dataIndex: 'title',
9083
+ title: "\u5546\u54C1\u540D\u79F0",
9084
+ align: 'center',
9085
+ ellipsis: true,
9086
+ width: 250
9087
+ }, {
9088
+ dataIndex: 'outerId',
9089
+ title: "\u5546\u54C1\u7F16\u7801",
9090
+ align: 'center',
9091
+ ellipsis: true,
9092
+ width: 250
9093
+ }, {
9094
+ dataIndex: 'picUrl',
9095
+ title: "\u56FE\u7247",
9096
+ align: 'center',
9097
+ ellipsis: true,
9098
+ width: 100,
9099
+ render: function render(val) {
9100
+ return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
9101
+ width: 60,
9102
+ src: val
9103
+ });
9104
+ }
9105
+ }, {
9106
+ dataIndex: 'numIid',
9107
+ title: "\u5546\u54C1id",
9108
+ align: 'center',
9109
+ ellipsis: true,
9110
+ width: 250
9111
+ }, {
9112
+ dataIndex: 'skuId',
9113
+ title: "SKU ID",
9114
+ align: 'center',
9115
+ ellipsis: true,
9116
+ width: 250
9117
+ }, {
9118
+ dataIndex: 'outerSkuId',
9119
+ title: "SKU \u7F16\u7801",
9120
+ align: 'center',
9121
+ ellipsis: true,
9122
+ width: 250
9123
+ }, {
9124
+ dataIndex: 'propertiesName',
9125
+ title: "SKU \u4FE1\u606F",
9126
+ align: 'center',
9127
+ ellipsis: true,
9128
+ width: 250
9129
+ }];
9130
+ };
9131
+ var headerList = showHeader || {
9132
+ 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku信息
9133
+ ]
9134
+ }[type] || [];
9135
+ var newColumns = React.useMemo(function () {
9136
+ var columnList = [{
9137
+ dataIndex: '',
9138
+ title: '序号',
9139
+ align: 'center',
9140
+ ellipsis: true,
9141
+ width: 50,
9142
+ render: function render(val, record, index) {
9143
+ return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
9144
+ }
9145
+ }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
9146
+ return headerList.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
9147
+ })));
9148
+ if (!disabled) {
9149
+ columnList.push({
9150
+ dataIndex: '',
9151
+ title: "\u64CD\u4F5C",
9152
+ align: 'center',
9153
+ ellipsis: true,
9154
+ width: 100,
9155
+ render: function render(val, record, index) {
9156
+ return record.canDelete ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9157
+ type: "link",
9158
+ onClick: function onClick() {
9159
+ return handleDelete(record, index);
9160
+ }
9161
+ }, "\u5220\u9664") : null;
9162
+ }
9163
+ });
9164
+ }
9165
+ return columnList;
9166
+ }, [headerList, value, disabled]);
9167
+ var handleChangeGoods = function handleChangeGoods() {
9168
+ var _props$value2;
9169
+ console.log('shopId', shopId, props.value);
9170
+ if (!((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.shopId)) {
9171
+ antd.message.error('请选择店铺');
9172
+ return;
9173
+ }
9174
+ setVisible(true);
9175
+ };
9176
+ window.handleChangeGoods = handleChangeGoods;
9177
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && showChangeBtn && /*#__PURE__*/React__default['default'].createElement("div", {
9178
+ style: {
9179
+ float: 'right'
9180
+ }
9181
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9182
+ type: "link",
9183
+ onClick: handleChangeGoods
9184
+ }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
9185
+ columns: newColumns,
9186
+ dataSource: value.imgList,
9187
+ rowKey: 'uuid',
9188
+ size: "small",
9189
+ pagination: false,
9190
+ scroll: {
9191
+ x: '100%'
9192
+ },
9193
+ locale: {
9194
+ emptyText: '暂无数据'
9195
+ }
9196
+ }), visible ? /*#__PURE__*/React__default['default'].createElement(GoodsModal, {
9197
+ visible: visible,
9198
+ onSubmit: onSubmit,
9199
+ width: width,
9200
+ type: type,
9201
+ imgList: imgList,
9202
+ shopList: shopList,
9203
+ shopId: shopId,
9204
+ maxLength: maxLength,
9205
+ changeSku: changeSku,
9206
+ onCancel: function onCancel() {
9207
+ setVisible(false);
9208
+ }
9209
+ }) : null, /*#__PURE__*/React__default['default'].createElement(Sku, {
9210
+ handleOk: handleSelectSku,
9211
+ ref: skuRef,
9212
+ userNick: userNick,
9213
+ type: type
9214
+ }));
9215
+ };
9216
+
8888
9217
  var TBGoodSerial = function TBGoodSerial(props) {
8889
- return /*#__PURE__*/React__default['default'].createElement(Goods, _objectSpread2(_objectSpread2({}, props), {}, {
9218
+ return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({}, props), {}, {
8890
9219
  type: 1
8891
9220
  }));
8892
9221
  };
@@ -9240,7 +9569,9 @@ var Payment = function Payment(props) {
9240
9569
  shopList = props.shopList,
9241
9570
  onChange = props.onChange,
9242
9571
  onSearch = props.onSearch,
9243
- _onBlur = props.onBlur;
9572
+ _onBlur = props.onBlur,
9573
+ _props$replaceValueCh = props.replaceValueCh,
9574
+ replaceValueCh = _props$replaceValueCh === void 0 ? {} : _props$replaceValueCh;
9244
9575
  React.useEffect(function () {
9245
9576
  var platformList = ['TAOBAO', 'FXG'];
9246
9577
  var showBuyerId = (shopList || []).some(function (item) {
@@ -9317,7 +9648,11 @@ var Payment = function Payment(props) {
9317
9648
  onBlur: function onBlur(e) {
9318
9649
  return _onBlur === null || _onBlur === void 0 ? void 0 : _onBlur(e.target.value, item.name);
9319
9650
  }
9320
- }));
9651
+ }), (replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]) && /*#__PURE__*/React__default['default'].createElement("p", {
9652
+ style: {
9653
+ color: '#e99d42'
9654
+ }
9655
+ }, replaceValueCh === null || replaceValueCh === void 0 ? void 0 : replaceValueCh[item.name]));
9321
9656
  }));
9322
9657
  };
9323
9658
 
@@ -10341,7 +10676,7 @@ var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
10341
10676
  // skuId: string;
10342
10677
  // styleId: string;
10343
10678
  // }
10344
- var GoodItem = function GoodItem(props) {
10679
+ var GoodItem$1 = function GoodItem(props) {
10345
10680
  var _props$value = props.value,
10346
10681
  value = _props$value === void 0 ? [] : _props$value,
10347
10682
  onChange = props.onChange,
@@ -10716,7 +11051,7 @@ var BsGoods = function BsGoods(props) {
10716
11051
  bsGoods: list
10717
11052
  }));
10718
11053
  };
10719
- return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11054
+ return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10720
11055
  key: 'bsGoods'
10721
11056
  }, props), {}, {
10722
11057
  disabled: disabled,
@@ -10914,12 +11249,12 @@ var BsExchange = function BsExchange(props) {
10914
11249
  onChange: function onChange(val) {
10915
11250
  return changeTypeHandle(val);
10916
11251
  }
10917
- }), !(value === null || value === void 0 ? void 0 : (_value$bsExchangeType4 = value.bsExchangeType) === null || _value$bsExchangeType4 === void 0 ? void 0 : _value$bsExchangeType4.length) ? /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11252
+ }), !(value === null || value === void 0 ? void 0 : (_value$bsExchangeType4 = value.bsExchangeType) === null || _value$bsExchangeType4 === void 0 ? void 0 : _value$bsExchangeType4.length) ? /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10918
11253
  key: 'bsExchangeGoods'
10919
11254
  }, other), {}, {
10920
11255
  disabled: disabled,
10921
11256
  showChangeBtn: false
10922
- })) : null, ['1', '3'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType5 = value.bsExchangeType) === null || _value$bsExchangeType5 === void 0 ? void 0 : _value$bsExchangeType5[0]) ? /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11257
+ })) : null, ['1', '3'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType5 = value.bsExchangeType) === null || _value$bsExchangeType5 === void 0 ? void 0 : _value$bsExchangeType5[0]) ? /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10923
11258
  key: 'bsExchangeGoods'
10924
11259
  }, other), {}, {
10925
11260
  disabled: disabled,
@@ -10935,7 +11270,7 @@ var BsExchange = function BsExchange(props) {
10935
11270
  border: '1px dashed',
10936
11271
  marginBottom: '8px'
10937
11272
  }
10938
- }, /*#__PURE__*/React__default['default'].createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11273
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, "\u9000\u56DE\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10939
11274
  key: 'bsReturnGoods'
10940
11275
  }, other), {}, {
10941
11276
  disabled: disabled,
@@ -10945,7 +11280,7 @@ var BsExchange = function BsExchange(props) {
10945
11280
  onChange: function onChange(val) {
10946
11281
  return changeReturnHandle(val, index, 'bsExchangeReturnGoods');
10947
11282
  }
10948
- })), /*#__PURE__*/React__default['default'].createElement("div", null, "\u6362\u51FA\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11283
+ })), /*#__PURE__*/React__default['default'].createElement("div", null, "\u6362\u51FA\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10949
11284
  key: 'bsOutGoods'
10950
11285
  }, other), {}, {
10951
11286
  disabled: disabled,
@@ -10957,7 +11292,7 @@ var BsExchange = function BsExchange(props) {
10957
11292
  return changeReturnHandle(val, index, 'bsExchangeSwapOutGoods');
10958
11293
  }
10959
11294
  })));
10960
- })), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType6 = value.bsExchangeType) === null || _value$bsExchangeType6 === void 0 ? void 0 : _value$bsExchangeType6[0]) ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11295
+ })), ['3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType6 = value.bsExchangeType) === null || _value$bsExchangeType6 === void 0 ? void 0 : _value$bsExchangeType6[0]) ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", null, "\u8D60\u54C1\u4FE1\u606F"), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
10961
11296
  headerText: "\u8D60\u54C1",
10962
11297
  key: 'bsGiftGoods',
10963
11298
  disabled: disabled,
@@ -11068,7 +11403,7 @@ var BsReissue = function BsReissue(props) {
11068
11403
  onChange: function onChange(val) {
11069
11404
  return changeTypeHandle(val);
11070
11405
  }
11071
- }), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11406
+ }), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11072
11407
  key: 'reissueGoods'
11073
11408
  }, other), {}, {
11074
11409
  disabled: disabled,
@@ -11165,7 +11500,7 @@ var BsReturnGoods = function BsReturnGoods(props) {
11165
11500
  onChange: function onChange(val) {
11166
11501
  return changeTypeHandle(val);
11167
11502
  }
11168
- }), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11503
+ }), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11169
11504
  key: 'returnGoods'
11170
11505
  }, other), {}, {
11171
11506
  disabled: disabled,
@@ -11342,7 +11677,7 @@ var WlnGoods = function WlnGoods(props) {
11342
11677
  wlnGoods: list
11343
11678
  }));
11344
11679
  };
11345
- return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11680
+ return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11346
11681
  key: 'wlnGoods'
11347
11682
  }, props), {}, {
11348
11683
  disabled: disabled,
@@ -10,6 +10,9 @@ export interface PaymentProps {
10
10
  onChange: (value: any) => void;
11
11
  onSearch: (value: any) => void;
12
12
  onBlur: (value: any, type: string) => void;
13
+ replaceValueCh?: {
14
+ [key: string]: string;
15
+ };
13
16
  }
14
17
  declare const Payment: (props: Partial<PaymentProps>) => React.JSX.Element;
15
18
  export default Payment;
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { GoodsProps } from '../../common/Goods';
3
- declare const TBGoodSerial: (props: Partial<GoodsProps>) => React.JSX.Element;
2
+ import { GoodsTableProps } from '../../common/Goods/Table';
3
+ declare const TBGoodSerial: (props: Partial<GoodsTableProps>) => React.JSX.Element;
4
4
  export default TBGoodSerial;
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ export interface GoodsTableProps {
3
+ value?: {
4
+ shopId: string;
5
+ imgList: any[];
6
+ };
7
+ showChangeBtn?: boolean;
8
+ type?: number;
9
+ enableItemId?: boolean;
10
+ enableSupplierName?: boolean;
11
+ userNick?: string;
12
+ maxLength: number;
13
+ canUpdateNumber?: boolean;
14
+ onChange?: (value: any) => void;
15
+ shopList: any[];
16
+ otherOperations?: React.JSX.Element;
17
+ showHeader?: string[];
18
+ shopId?: string;
19
+ disabled?: boolean;
20
+ changeSku?: boolean;
21
+ width?: string | number;
22
+ }
23
+ declare const GoodItem: (props: Partial<GoodsTableProps>) => React.JSX.Element;
24
+ export default GoodItem;
@@ -6,6 +6,7 @@ declare type SkuProps = {
6
6
  propertiesName: string;
7
7
  picUrl?: string;
8
8
  outerSkuId?: string;
9
+ skuId?: string;
9
10
  }) => void;
10
11
  userNick: string | undefined;
11
12
  type?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.21.4",
3
+ "version": "0.22.0-alpha.1",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "^0.21.4",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.21.4-alpha.3",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "react-copy-to-clipboard": "^5.1.0",
@@ -61,5 +61,5 @@
61
61
  "publishConfig": {
62
62
  "access": "public"
63
63
  },
64
- "gitHead": "510c76d8426f214eb5653d9e75a59fa44e318939"
64
+ "gitHead": "7825b8695c7bb147a322a02b6c7fed629677612c"
65
65
  }