@kmkf-fe-packages/basic-components 0.11.0-alpha.0 → 0.11.0-alpha.10

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
@@ -11164,26 +11164,44 @@ var BsReturnGoods = function BsReturnGoods(props) {
11164
11164
  })));
11165
11165
  };
11166
11166
 
11167
- var columns$1 = [{
11168
- dataIndex: 'billType',
11169
- title: '单据类型'
11170
- }, {
11171
- dataIndex: 'billNo',
11172
- title: '系统订单号'
11173
- }, {
11174
- dataIndex: 'billTag',
11175
- title: '标签'
11176
- }];
11167
+ var columnsNameMap = {
11168
+ BS_SYSTEM_ORDER: {
11169
+ typeName: '单据类型',
11170
+ tagName: '标签'
11171
+ },
11172
+ WLN_SYSTEM_ORDER: {
11173
+ typeName: '订单类型',
11174
+ tagName: '标记'
11175
+ }
11176
+ };
11177
11177
  var index = (function (props) {
11178
11178
  var value = props.value,
11179
11179
  _onChange = props.onChange,
11180
- disabled = props.disabled;
11180
+ disabled = props.disabled,
11181
+ type = props.type;
11181
11182
  useEffect(function () {
11182
11183
  var _value$orders, _value$showOrderInfo;
11183
11184
  if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
11184
- getOrderList(value.orderNo);
11185
+ if (type === 'BS_SYSTEM_ORDER') {
11186
+ getOrderList(value.orderNo);
11187
+ } else if (type === 'WLN_SYSTEM_ORDER') {
11188
+ getWlnOrderList(value.orderNo);
11189
+ }
11185
11190
  }
11186
- }, [value]);
11191
+ }, [value, type]);
11192
+ var columns = useMemo(function () {
11193
+ var _columnsNameMap$type, _columnsNameMap$type2;
11194
+ return [{
11195
+ dataIndex: 'billType',
11196
+ title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type = columnsNameMap[type]) === null || _columnsNameMap$type === void 0 ? void 0 : _columnsNameMap$type.typeName
11197
+ }, {
11198
+ dataIndex: 'billNo',
11199
+ title: '系统订单号'
11200
+ }, {
11201
+ dataIndex: 'billTag',
11202
+ title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type2 = columnsNameMap[type]) === null || _columnsNameMap$type2 === void 0 ? void 0 : _columnsNameMap$type2.tagName
11203
+ }];
11204
+ }, [type]);
11187
11205
  var getOrderList = /*#__PURE__*/function () {
11188
11206
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
11189
11207
  var _yield$request, success, data;
@@ -11223,6 +11241,51 @@ var index = (function (props) {
11223
11241
  return _ref.apply(this, arguments);
11224
11242
  };
11225
11243
  }();
11244
+ var getWlnOrderList = /*#__PURE__*/function () {
11245
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderNo) {
11246
+ var _yield$request2, success, data;
11247
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11248
+ while (1) switch (_context2.prev = _context2.next) {
11249
+ case 0:
11250
+ _context2.next = 2;
11251
+ return extendRequest('/qy/gdfw/order/wlnOrderList', {
11252
+ method: 'post',
11253
+ data: {
11254
+ billCode: orderNo
11255
+ }
11256
+ });
11257
+ case 2:
11258
+ _yield$request2 = _context2.sent;
11259
+ success = _yield$request2.success;
11260
+ data = _yield$request2.data;
11261
+ if (success) {
11262
+ _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11263
+ orders: data === null || data === void 0 ? void 0 : data.orders.map(function (item) {
11264
+ return _objectSpread2(_objectSpread2({}, item), {}, {
11265
+ billNo: item.tradeNo,
11266
+ billType: item.tradeType,
11267
+ billTag: item.mark
11268
+ });
11269
+ }),
11270
+ showOrderInfo: data === null || data === void 0 ? void 0 : data.orders.map(function (item) {
11271
+ return {
11272
+ billNo: item.tradeNo,
11273
+ billType: item.tradeType,
11274
+ billTag: item.mark
11275
+ };
11276
+ })
11277
+ }));
11278
+ }
11279
+ case 6:
11280
+ case "end":
11281
+ return _context2.stop();
11282
+ }
11283
+ }, _callee2);
11284
+ }));
11285
+ return function getWlnOrderList(_x2) {
11286
+ return _ref2.apply(this, arguments);
11287
+ };
11288
+ }();
11226
11289
  var rowSelection = {
11227
11290
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
11228
11291
  fixed: true,
@@ -11241,7 +11304,7 @@ var index = (function (props) {
11241
11304
  };
11242
11305
  return /*#__PURE__*/React.createElement(Table, {
11243
11306
  dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
11244
- columns: columns$1,
11307
+ columns: columns,
11245
11308
  rowSelection: rowSelection,
11246
11309
  rowKey: 'billNo',
11247
11310
  size: "small",
@@ -11259,13 +11322,21 @@ var WlnGoods = function WlnGoods(props) {
11259
11322
  var value = props.value,
11260
11323
  disabled = props.disabled,
11261
11324
  onChange = props.onChange;
11325
+ var changeHandle = function changeHandle(list) {
11326
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11327
+ wlnGoods: list
11328
+ }));
11329
+ };
11262
11330
  return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11263
11331
  key: 'wlnGoods'
11264
11332
  }, props), {}, {
11265
11333
  disabled: disabled,
11266
- value: value,
11334
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11335
+ value: value === null || value === void 0 ? void 0 : value.wlnGoods,
11267
11336
  showChangeBtn: false,
11268
- onChange: onChange
11337
+ onChange: function onChange(val) {
11338
+ return changeHandle(val);
11339
+ }
11269
11340
  }));
11270
11341
  };
11271
11342
 
package/dist/index.js CHANGED
@@ -11175,26 +11175,44 @@ var BsReturnGoods = function BsReturnGoods(props) {
11175
11175
  })));
11176
11176
  };
11177
11177
 
11178
- var columns$1 = [{
11179
- dataIndex: 'billType',
11180
- title: '单据类型'
11181
- }, {
11182
- dataIndex: 'billNo',
11183
- title: '系统订单号'
11184
- }, {
11185
- dataIndex: 'billTag',
11186
- title: '标签'
11187
- }];
11178
+ var columnsNameMap = {
11179
+ BS_SYSTEM_ORDER: {
11180
+ typeName: '单据类型',
11181
+ tagName: '标签'
11182
+ },
11183
+ WLN_SYSTEM_ORDER: {
11184
+ typeName: '订单类型',
11185
+ tagName: '标记'
11186
+ }
11187
+ };
11188
11188
  var index = (function (props) {
11189
11189
  var value = props.value,
11190
11190
  _onChange = props.onChange,
11191
- disabled = props.disabled;
11191
+ disabled = props.disabled,
11192
+ type = props.type;
11192
11193
  React.useEffect(function () {
11193
11194
  var _value$orders, _value$showOrderInfo;
11194
11195
  if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
11195
- getOrderList(value.orderNo);
11196
+ if (type === 'BS_SYSTEM_ORDER') {
11197
+ getOrderList(value.orderNo);
11198
+ } else if (type === 'WLN_SYSTEM_ORDER') {
11199
+ getWlnOrderList(value.orderNo);
11200
+ }
11196
11201
  }
11197
- }, [value]);
11202
+ }, [value, type]);
11203
+ var columns = React.useMemo(function () {
11204
+ var _columnsNameMap$type, _columnsNameMap$type2;
11205
+ return [{
11206
+ dataIndex: 'billType',
11207
+ title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type = columnsNameMap[type]) === null || _columnsNameMap$type === void 0 ? void 0 : _columnsNameMap$type.typeName
11208
+ }, {
11209
+ dataIndex: 'billNo',
11210
+ title: '系统订单号'
11211
+ }, {
11212
+ dataIndex: 'billTag',
11213
+ title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type2 = columnsNameMap[type]) === null || _columnsNameMap$type2 === void 0 ? void 0 : _columnsNameMap$type2.tagName
11214
+ }];
11215
+ }, [type]);
11198
11216
  var getOrderList = /*#__PURE__*/function () {
11199
11217
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
11200
11218
  var _yield$request, success, data;
@@ -11234,6 +11252,51 @@ var index = (function (props) {
11234
11252
  return _ref.apply(this, arguments);
11235
11253
  };
11236
11254
  }();
11255
+ var getWlnOrderList = /*#__PURE__*/function () {
11256
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderNo) {
11257
+ var _yield$request2, success, data;
11258
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11259
+ while (1) switch (_context2.prev = _context2.next) {
11260
+ case 0:
11261
+ _context2.next = 2;
11262
+ return extendRequest('/qy/gdfw/order/wlnOrderList', {
11263
+ method: 'post',
11264
+ data: {
11265
+ billCode: orderNo
11266
+ }
11267
+ });
11268
+ case 2:
11269
+ _yield$request2 = _context2.sent;
11270
+ success = _yield$request2.success;
11271
+ data = _yield$request2.data;
11272
+ if (success) {
11273
+ _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11274
+ orders: data === null || data === void 0 ? void 0 : data.orders.map(function (item) {
11275
+ return _objectSpread2(_objectSpread2({}, item), {}, {
11276
+ billNo: item.tradeNo,
11277
+ billType: item.tradeType,
11278
+ billTag: item.mark
11279
+ });
11280
+ }),
11281
+ showOrderInfo: data === null || data === void 0 ? void 0 : data.orders.map(function (item) {
11282
+ return {
11283
+ billNo: item.tradeNo,
11284
+ billType: item.tradeType,
11285
+ billTag: item.mark
11286
+ };
11287
+ })
11288
+ }));
11289
+ }
11290
+ case 6:
11291
+ case "end":
11292
+ return _context2.stop();
11293
+ }
11294
+ }, _callee2);
11295
+ }));
11296
+ return function getWlnOrderList(_x2) {
11297
+ return _ref2.apply(this, arguments);
11298
+ };
11299
+ }();
11237
11300
  var rowSelection = {
11238
11301
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
11239
11302
  fixed: true,
@@ -11252,7 +11315,7 @@ var index = (function (props) {
11252
11315
  };
11253
11316
  return /*#__PURE__*/React__default['default'].createElement(antd.Table, {
11254
11317
  dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
11255
- columns: columns$1,
11318
+ columns: columns,
11256
11319
  rowSelection: rowSelection,
11257
11320
  rowKey: 'billNo',
11258
11321
  size: "small",
@@ -11270,13 +11333,21 @@ var WlnGoods = function WlnGoods(props) {
11270
11333
  var value = props.value,
11271
11334
  disabled = props.disabled,
11272
11335
  onChange = props.onChange;
11336
+ var changeHandle = function changeHandle(list) {
11337
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11338
+ wlnGoods: list
11339
+ }));
11340
+ };
11273
11341
  return /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
11274
11342
  key: 'wlnGoods'
11275
11343
  }, props), {}, {
11276
11344
  disabled: disabled,
11277
- value: value,
11345
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11346
+ value: value === null || value === void 0 ? void 0 : value.wlnGoods,
11278
11347
  showChangeBtn: false,
11279
- onChange: onChange
11348
+ onChange: function onChange(val) {
11349
+ return changeHandle(val);
11350
+ }
11280
11351
  }));
11281
11352
  };
11282
11353
 
@@ -6,6 +6,7 @@ interface BsSystemOrderProps {
6
6
  selectIds: string[];
7
7
  showOrderInfo: any[];
8
8
  };
9
+ type: string;
9
10
  disabled: boolean;
10
11
  onChange: (val: any) => void;
11
12
  onChangeOrder?: (val: any) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.11.0-alpha.0",
3
+ "version": "0.11.0-alpha.10",
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.11.0-alpha.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.11.0-alpha.8",
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": "aeaa0dda1d182b6b2cfaf5b475f2cf77c65b4c5b"
64
+ "gitHead": "61b21be50cb56ff7de6cce7249c0e1543ba9f75c"
65
65
  }