@kmkf-fe-packages/basic-components 0.28.2-rc.9 → 0.28.3-beta.0

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.js CHANGED
@@ -7574,10 +7574,11 @@ function ApaasPosting(props) {
7574
7574
  });
7575
7575
  }
7576
7576
 
7577
- var _excluded$a = ["value", "onChange"];
7577
+ var _excluded$a = ["value", "onChange", "platformType"];
7578
7578
  function ApaasLogistics(props) {
7579
7579
  var value = props.value,
7580
7580
  onChange = props.onChange,
7581
+ platformType = props.platformType,
7581
7582
  other = _objectWithoutProperties(props, _excluded$a);
7582
7583
  var _useState = React.useState([]),
7583
7584
  _useState2 = _slicedToArray(_useState, 2),
@@ -7590,7 +7591,7 @@ function ApaasLogistics(props) {
7590
7591
  return _regeneratorRuntime().wrap(function _callee$(_context) {
7591
7592
  while (1) switch (_context.prev = _context.next) {
7592
7593
  case 0:
7593
- express = kmkfUtils.ExpressData.getInstance();
7594
+ express = kmkfUtils.ExpressData.getInstance(platformType);
7594
7595
  setOptions(express.expressData || []);
7595
7596
  case 2:
7596
7597
  case "end":
@@ -9709,9 +9710,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
9709
9710
  _props$disabled = props.disabled,
9710
9711
  disabled = _props$disabled === void 0 ? false : _props$disabled,
9711
9712
  _props$isEditing = props.isEditing,
9712
- isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
9713
- _props$showState = props.showState,
9714
- showState = _props$showState === void 0 ? false : _props$showState;
9713
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
9715
9714
  var _useState = React.useState(''),
9716
9715
  _useState2 = _slicedToArray(_useState, 2),
9717
9716
  initCompany = _useState2[0],
@@ -9846,8 +9845,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
9846
9845
  interceptReceiverMobile: undefined,
9847
9846
  interceptLogisticsStatus: undefined,
9848
9847
  interceptLogisticsStatusOther: undefined,
9849
- interceptLogisticsSnapshot: undefined,
9850
- qySelfInterceptStatus: undefined
9848
+ interceptLogisticsSnapshot: undefined
9851
9849
  });
9852
9850
  }
9853
9851
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -9992,24 +9990,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
9992
9990
  onChange: function onChange(e) {
9993
9991
  return changeHandle(e.target.value, 'interceptLogisticsStatusOther');
9994
9992
  }
9995
- })), /*#__PURE__*/React__default['default'].createElement(Item, {
9996
- label: '拦截状态',
9997
- key: 'qySelfInterceptStatus',
9998
- hidden: showState
9999
- }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
10000
- value: value === null || value === void 0 ? void 0 : value.qySelfInterceptStatus,
10001
- disabled: disabled || isEdit,
10002
- placeholder: "\u62E6\u622A\u72B6\u6001",
10003
- onChange: function onChange(val) {
10004
- return changeHandle(val, 'qySelfInterceptStatus');
10005
- },
10006
- options: [{
10007
- label: '拦截成功',
10008
- value: '拦截成功'
10009
- }, {
10010
- label: '拦截失败',
10011
- value: '拦截失败'
10012
- }]
10013
9993
  })));
10014
9994
  };
10015
9995
 
@@ -10434,7 +10414,7 @@ var typeInitValueMap = {
10434
10414
  }]
10435
10415
  };
10436
10416
  var jstGoods = function jstGoods(props) {
10437
- var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
10417
+ var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7, _value$changeIndex8;
10438
10418
  var _props$value = props.value,
10439
10419
  value = _props$value === void 0 ? [] : _props$value,
10440
10420
  onChange = props.onChange,
@@ -10442,11 +10422,14 @@ var jstGoods = function jstGoods(props) {
10442
10422
  _props$type = props.type,
10443
10423
  type = _props$type === void 0 ? 1 : _props$type,
10444
10424
  _props$showField = props.showField,
10445
- showField = _props$showField === void 0 ? '' : _props$showField;
10425
+ showField = _props$showField === void 0 ? '' : _props$showField,
10426
+ _props$platformType = props.platformType,
10427
+ platformType = _props$platformType === void 0 ? 'default' : _props$platformType;
10446
10428
  var _useState = React.useState(0),
10447
10429
  _useState2 = _slicedToArray(_useState, 2),
10448
10430
  changeIndex = _useState2[0],
10449
10431
  setChangeIndex = _useState2[1]; //选中的包裹
10432
+ var wdtSendOptions = kmkfUtils.WdtSendData.getInstance().wdtSendData || [];
10450
10433
  React.useEffect(function () {
10451
10434
  //没有值塞个默认值
10452
10435
  if (!(value === null || value === void 0 ? void 0 : value.length)) {
@@ -10473,6 +10456,18 @@ var jstGoods = function jstGoods(props) {
10473
10456
  }), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", null, t.title), /*#__PURE__*/React__default['default'].createElement("div", null, "\u7F16\u7801\uFF1A", t.skuId))));
10474
10457
  }));
10475
10458
  };
10459
+ var handleSelected = function handleSelected(val, type, option) {
10460
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
10461
+ changeOrderInfo[type] = val;
10462
+ changeOrderInfo['sendId'] = option.value;
10463
+ var newList = _toConsumableArray(value);
10464
+ newList[changeIndex] = changeOrderInfo;
10465
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
10466
+ };
10467
+ var filterOption = function filterOption(input, option) {
10468
+ var _option$label;
10469
+ return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').includes(input);
10470
+ };
10476
10471
  var changeInputHandle = function changeInputHandle(val, type) {
10477
10472
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
10478
10473
  changeOrderInfo[type] = val;
@@ -10511,10 +10506,12 @@ var jstGoods = function jstGoods(props) {
10511
10506
  filterOption: function filterOption(input, option) {
10512
10507
  return option.label.includes(input);
10513
10508
  },
10509
+ dropdownMatchSelectWidth: false,
10514
10510
  style: {
10515
10511
  minWidth: '100px',
10516
10512
  maxWidth: '180px'
10517
- }
10513
+ },
10514
+ platformType: platformType
10518
10515
  }) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10519
10516
  disabled: disabled,
10520
10517
  placeholder: "\u7269\u6D41\u5355\u53F7",
@@ -10543,20 +10540,34 @@ var jstGoods = function jstGoods(props) {
10543
10540
  return changeInputHandle(e.target.value, 'sendId');
10544
10541
  },
10545
10542
  value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
10546
- }), ['sendName', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10543
+ }), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
10544
+ style: {
10545
+ minWidth: '100px',
10546
+ maxWidth: '180px'
10547
+ },
10548
+ disabled: disabled,
10549
+ placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
10550
+ showSearch: true,
10551
+ options: wdtSendOptions,
10552
+ filterOption: filterOption,
10553
+ value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName,
10554
+ onChange: function onChange(value, option) {
10555
+ return handleSelected(value, 'sendName', option);
10556
+ }
10557
+ }) : /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10547
10558
  disabled: disabled,
10548
10559
  placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u540D\u79F0",
10549
10560
  onChange: function onChange(e) {
10550
10561
  return changeInputHandle(e.target.value, 'sendName');
10551
10562
  },
10552
- value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName
10553
- })) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10563
+ value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
10564
+ }))) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10554
10565
  disabled: disabled,
10555
10566
  placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
10556
10567
  onChange: function onChange(e) {
10557
10568
  return changeInputHandle(e.target.value, 'deliveryNo');
10558
10569
  },
10559
- value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
10570
+ value: (_value$changeIndex8 = value[changeIndex]) === null || _value$changeIndex8 === void 0 ? void 0 : _value$changeIndex8.sendName
10560
10571
  })) : null) : null);
10561
10572
  };
10562
10573
 
@@ -11123,6 +11134,12 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
11123
11134
  var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
11124
11135
 
11125
11136
  var RangePicker = antd.DatePicker.RangePicker;
11137
+ var getWdtListProduct = function getWdtListProduct(data) {
11138
+ return extendRequest('/qy/gdfw/product/wdtListProduct', {
11139
+ method: 'post',
11140
+ data: data
11141
+ });
11142
+ };
11126
11143
  var columns$1 = [{
11127
11144
  dataIndex: 'index',
11128
11145
  title: 'NO',
@@ -11197,226 +11214,174 @@ var expandedColumns = [{
11197
11214
  title: '会员价',
11198
11215
  width: 140
11199
11216
  }];
11200
- var dateFormat = 'YYYY-MM-DD HH:mm:ss';
11201
- var GoodsModal$3 = function GoodsModal(props, ref) {
11202
- var initStartTime = hooks().subtract(30, 'd');
11203
- var initEndTime = hooks();
11204
- React.useImperativeHandle(ref, function () {
11205
- return {
11206
- open: function open(shopCode) {
11207
- setVisible(true);
11208
- setPageNo(1);
11209
- setSelect([]);
11210
- setSelectIds([]);
11211
- form.setFieldsValue({
11212
- dateTimePicker: [initStartTime, initEndTime],
11213
- code: ''
11214
- });
11215
- // getShopList();
11216
- }
11217
- };
11218
- });
11219
-
11220
- var onSubmit = props.onSubmit,
11221
- shopId = props.shopId,
11222
- shopList = props.shopList,
11223
- width = props.width,
11224
- companyKey = props.companyKey;
11225
- var _useState = React.useState(false),
11217
+ var getInitTime = function getInitTime() {
11218
+ var initStartTime = hooks().subtract(30, 'd').hours(0).minutes(0).seconds(0);
11219
+ var initEndTime = hooks().hours(23).minutes(59).seconds(59);
11220
+ return [initStartTime, initEndTime];
11221
+ };
11222
+ var GoodList = function GoodList(props, ref) {
11223
+ var _useState = React.useState([]),
11226
11224
  _useState2 = _slicedToArray(_useState, 2),
11227
- visible = _useState2[0],
11228
- setVisible = _useState2[1];
11229
- var _useState3 = React.useState([]),
11225
+ selectList = _useState2[0],
11226
+ setSelect = _useState2[1];
11227
+ var _useState3 = React.useState(1),
11230
11228
  _useState4 = _slicedToArray(_useState3, 2),
11231
- selectList = _useState4[0],
11232
- setSelect = _useState4[1];
11233
- var _useState5 = React.useState([]),
11234
- _useState6 = _slicedToArray(_useState5, 2),
11235
- selectIds = _useState6[0],
11236
- setSelectIds = _useState6[1];
11237
- var _useState7 = React.useState(1),
11229
+ pageNo = _useState4[0],
11230
+ setPageNo = _useState4[1];
11231
+ var _useState5 = React.useState(10),
11232
+ _useState6 = _slicedToArray(_useState5, 1),
11233
+ pageSize = _useState6[0];
11234
+ var _useState7 = React.useState([]),
11238
11235
  _useState8 = _slicedToArray(_useState7, 2),
11239
- pageNo = _useState8[0],
11240
- setPageNo = _useState8[1];
11241
- var _useState9 = React.useState(20),
11242
- _useState10 = _slicedToArray(_useState9, 1),
11243
- pageSize = _useState10[0];
11244
- var _useState11 = React.useState([]),
11236
+ goodList = _useState8[0],
11237
+ setGoodList = _useState8[1];
11238
+ var _useState9 = React.useState(false),
11239
+ _useState10 = _slicedToArray(_useState9, 2),
11240
+ loading = _useState10[0],
11241
+ setLoading = _useState10[1];
11242
+ var _useState11 = React.useState(0),
11245
11243
  _useState12 = _slicedToArray(_useState11, 2),
11246
- goodList = _useState12[0],
11247
- setGoodList = _useState12[1];
11248
- var _useState13 = React.useState(false),
11244
+ total = _useState12[0],
11245
+ setTotal = _useState12[1];
11246
+ var _useState13 = React.useState(null),
11249
11247
  _useState14 = _slicedToArray(_useState13, 2),
11250
- loading = _useState14[0],
11251
- setLoading = _useState14[1];
11252
- var _useState15 = React.useState(0),
11253
- _useState16 = _slicedToArray(_useState15, 2),
11254
- total = _useState16[0],
11255
- setTotal = _useState16[1];
11248
+ dates = _useState14[0],
11249
+ setDates = _useState14[1];
11250
+ React.useImperativeHandle(ref, function () {
11251
+ return {
11252
+ getSelectGoodList: function getSelectGoodList() {
11253
+ return selectList;
11254
+ }
11255
+ };
11256
+ });
11256
11257
  var displaySelectList = React.useMemo(function () {
11257
11258
  return selectList.map(function (item, i) {
11258
11259
  item.index = i + 1;
11259
11260
  return item;
11260
11261
  });
11261
11262
  }, [selectList]);
11262
- React.useEffect(function () {
11263
- if (visible) {
11264
- queryItems();
11265
- }
11266
- }, [pageNo, visible]);
11267
11263
  var _Form$useForm = antd.Form.useForm(),
11268
11264
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
11269
11265
  form = _Form$useForm2[0];
11270
- //选择页码
11271
- var pageChange = function pageChange(page) {
11272
- setPageNo(page);
11273
- };
11274
11266
  /**
11275
11267
  * 查询商品
11276
11268
  */
11277
11269
  var queryItems = /*#__PURE__*/function () {
11278
11270
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11279
- var search,
11280
- _formData$dateTimePic,
11281
- _formData$dateTimePic2,
11282
- _formData$dateTimePic3,
11283
- _formData$dateTimePic4,
11284
- _formData$dateTimePic5,
11285
- _formData$dateTimePic6,
11286
- formData,
11287
- startTime,
11288
- endTime,
11289
- params,
11290
- res,
11291
- _res$data,
11292
- _res$data$productList,
11293
- productList,
11294
- _res$data$total,
11295
- _total,
11296
- errorMsg,
11297
- newProducts,
11298
- _args = arguments;
11271
+ var _formData$dateTimePic, _formData$dateTimePic2, _formData$dateTimePic3, _formData$dateTimePic4, _formData$dateTimePic5, _formData$dateTimePic6, formData, _getInitTime, _getInitTime2, start, end, startTime, endTime, newTime, earliest, params;
11299
11272
  return _regeneratorRuntime().wrap(function _callee$(_context) {
11300
11273
  while (1) switch (_context.prev = _context.next) {
11301
11274
  case 0:
11302
- search = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
11303
- _context.prev = 1;
11275
+ _context.prev = 0;
11304
11276
  setLoading(true);
11305
11277
  formData = form.getFieldsValue();
11306
- startTime = ((_formData$dateTimePic = formData.dateTimePicker) === null || _formData$dateTimePic === void 0 ? void 0 : (_formData$dateTimePic2 = _formData$dateTimePic[0]) === null || _formData$dateTimePic2 === void 0 ? void 0 : (_formData$dateTimePic3 = _formData$dateTimePic2.format) === null || _formData$dateTimePic3 === void 0 ? void 0 : _formData$dateTimePic3.call(_formData$dateTimePic2, dateFormat)) || hooks().subtract(30, 'd').format(dateFormat);
11307
- endTime = ((_formData$dateTimePic4 = formData.dateTimePicker) === null || _formData$dateTimePic4 === void 0 ? void 0 : (_formData$dateTimePic5 = _formData$dateTimePic4[1]) === null || _formData$dateTimePic5 === void 0 ? void 0 : (_formData$dateTimePic6 = _formData$dateTimePic5.format) === null || _formData$dateTimePic6 === void 0 ? void 0 : _formData$dateTimePic6.call(_formData$dateTimePic5, dateFormat)) || hooks().format(dateFormat);
11278
+ _getInitTime = getInitTime(), _getInitTime2 = _slicedToArray(_getInitTime, 2), start = _getInitTime2[0], end = _getInitTime2[1];
11279
+ startTime = ((_formData$dateTimePic = formData.dateTimePicker) === null || _formData$dateTimePic === void 0 ? void 0 : (_formData$dateTimePic2 = _formData$dateTimePic[0]) === null || _formData$dateTimePic2 === void 0 ? void 0 : (_formData$dateTimePic3 = _formData$dateTimePic2.format) === null || _formData$dateTimePic3 === void 0 ? void 0 : _formData$dateTimePic3.call(_formData$dateTimePic2, 'YYYY-MM-DD HH:mm:ss')) || start.format('YYYY-MM-DD HH:mm:ss');
11280
+ endTime = ((_formData$dateTimePic4 = formData.dateTimePicker) === null || _formData$dateTimePic4 === void 0 ? void 0 : (_formData$dateTimePic5 = _formData$dateTimePic4[1]) === null || _formData$dateTimePic5 === void 0 ? void 0 : (_formData$dateTimePic6 = _formData$dateTimePic5.format) === null || _formData$dateTimePic6 === void 0 ? void 0 : _formData$dateTimePic6.call(_formData$dateTimePic5, 'YYYY-MM-DD HH:mm:ss')) || end.format('YYYY-MM-DD HH:mm:ss');
11281
+ endTime = hooks(endTime).hours(23).minutes(59).seconds(59).format('YYYY-MM-DD HH:mm:ss');
11282
+ // PS: 故意推前3分钟,不然极端情况下,接口会报错
11283
+ newTime = hooks().subtract(3, 'm'); // 只能选比现在早的时间
11284
+ if (hooks(endTime).diff(newTime, 'seconds') > 0) {
11285
+ endTime = newTime.format('YYYY-MM-DD HH:mm:ss');
11286
+ }
11287
+ // 30天内
11288
+ earliest = hooks(endTime).subtract(30, 'd');
11289
+ if (earliest.diff(hooks(startTime), 'seconds') > 0) {
11290
+ startTime = earliest.format('YYYY-MM-DD HH:mm:ss');
11291
+ }
11308
11292
  params = {
11309
- // shopCode: shopCode,
11310
11293
  pageSize: pageSize,
11311
11294
  pageNo: pageNo - 1,
11312
- goodNo: search.code,
11295
+ goodNo: formData.goodNo || null,
11296
+ specNo: formData.specNo || null,
11313
11297
  startTime: startTime,
11314
11298
  endTime: endTime
11315
11299
  };
11316
- _context.next = 9;
11317
- return extendRequest('/qy/gdfw/product/wdtListProduct', {
11318
- method: 'post',
11319
- data: params
11320
- });
11321
- case 9:
11322
- res = _context.sent;
11323
- _res$data = res.data, _res$data$productList = _res$data.productList, productList = _res$data$productList === void 0 ? [] : _res$data$productList, _res$data$total = _res$data.total, _total = _res$data$total === void 0 ? 0 : _res$data$total, errorMsg = _res$data.errorMsg;
11324
- if (res.success) {
11325
- newProducts = productList.map(function (item, index) {
11326
- return _objectSpread2(_objectSpread2({}, item), {}, {
11327
- index: index + 1
11300
+ _context.next = 14;
11301
+ return getWdtListProduct(params).then(function (res) {
11302
+ if (res.success) {
11303
+ var _res$data = res.data,
11304
+ _res$data$productList = _res$data.productList,
11305
+ productList = _res$data$productList === void 0 ? [] : _res$data$productList,
11306
+ _res$data$total = _res$data.total,
11307
+ _total = _res$data$total === void 0 ? 0 : _res$data$total;
11308
+ var newProducts = productList.map(function (item, index) {
11309
+ return _objectSpread2(_objectSpread2({}, item), {}, {
11310
+ index: index + 1
11311
+ });
11328
11312
  });
11329
- });
11330
- setGoodList(_toConsumableArray(newProducts));
11331
- if (pageNo === 1) {
11332
- setTotal(_total);
11313
+ setGoodList(newProducts);
11314
+ if (pageNo === 1) {
11315
+ setTotal(_total);
11316
+ }
11317
+ } else {
11318
+ var _res$data2;
11319
+ setGoodList([]);
11320
+ setTotal(0);
11321
+ antd.message.error(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.errorMsg) || res.message);
11333
11322
  }
11334
- } else {
11335
- setGoodList([]);
11336
- setTotal(0);
11337
- antd.message.error(errorMsg || res.message);
11338
- }
11339
- case 12:
11340
- _context.prev = 12;
11323
+ }).catch(function (e) {
11324
+ console.log(e);
11325
+ });
11326
+ case 14:
11327
+ _context.prev = 14;
11341
11328
  setLoading(false);
11342
- return _context.finish(12);
11343
- case 15:
11329
+ return _context.finish(14);
11330
+ case 17:
11344
11331
  case "end":
11345
11332
  return _context.stop();
11346
11333
  }
11347
- }, _callee, null, [[1,, 12, 15]]);
11334
+ }, _callee, null, [[0,, 14, 17]]);
11348
11335
  }));
11349
11336
  return function queryItems() {
11350
11337
  return _ref.apply(this, arguments);
11351
11338
  };
11352
11339
  }();
11353
- var _onCancel = function onCancel() {
11354
- setVisible(false);
11355
- };
11356
- var onOk = function onOk() {
11357
- onSubmit(selectList);
11358
- _onCancel();
11359
- };
11360
- var onFinish = function onFinish(fieldsValue) {
11361
- var searchValue = {
11362
- code: fieldsValue.code
11363
- };
11364
- queryItems(searchValue);
11340
+ var disabledDate = function disabledDate(current) {
11341
+ var today = hooks(hooks().format('YYYY-MM-DD'));
11342
+ var currentDay = hooks(current.format('YYYY-MM-DD'));
11343
+ if (currentDay.diff(today, 'days') > 0) {
11344
+ return true;
11345
+ }
11346
+ if (!dates) {
11347
+ return false;
11348
+ }
11349
+ var tooLate = dates[0] && current.diff(dates[0], 'days') > 30;
11350
+ var tooEarly = dates[1] && dates[1].diff(current, 'days') > 30;
11351
+ return !!tooEarly || !!tooLate;
11352
+ };
11353
+ var onOpenChange = function onOpenChange(open) {
11354
+ if (open) {
11355
+ setDates([null, null]);
11356
+ } else {
11357
+ setDates(null);
11358
+ }
11365
11359
  };
11366
11360
  var onReset = function onReset() {
11367
- form.resetFields();
11368
11361
  form.setFieldsValue({
11369
- dateTimePicker: [hooks().subtract(30, 'd'), hooks()],
11370
- code: ''
11362
+ dateTimePicker: getInitTime(),
11363
+ goodNo: '',
11364
+ specNo: ''
11371
11365
  });
11372
11366
  setPageNo(function (prev) {
11373
- if (prev === 1 && visible) {
11367
+ if (prev === 1) {
11374
11368
  queryItems();
11375
11369
  }
11376
11370
  return 1;
11377
11371
  });
11378
11372
  };
11379
- // const getShopList = async () => {
11380
- // const { success, data } = await request('/qy/diamond/getConfigInfo', {
11381
- // method: 'get',
11382
- // params: {
11383
- // key: 'company-third-shop-info',
11384
- // },
11385
- // });
11386
- // const obj: any = JSON.parse(data || '{}');
11387
- // if (success) {
11388
- // const list = (obj?.[companyKey] || []).map((item: any) => {
11389
- // return {
11390
- // label: item.shopName,
11391
- // value: item.shopCode,
11392
- // };
11393
- // });
11394
- // setShopList(list);
11395
- // }
11396
- // };
11397
- var onValuesChange = function onValuesChange(changedValues) {
11398
- if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
11399
- queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
11400
- pubsub__default['default'].publish('changeShopCode', {
11401
- shopCode: changedValues.shopId
11402
- });
11403
- }
11404
- };
11405
- var handleDelete = function handleDelete(record, index) {
11373
+ var handleDelete = function handleDelete(record) {
11406
11374
  var newSelectList = selectList.filter(function (item) {
11407
11375
  return item.specId !== record.specId;
11408
11376
  });
11409
11377
  setSelect(_toConsumableArray(newSelectList));
11410
- setSelectIds(_toConsumableArray(newSelectList.map(function (item) {
11411
- return item.specId;
11412
- })));
11413
11378
  };
11414
11379
  var displaySelectedColumns = [{
11415
11380
  dataIndex: 'operation',
11416
11381
  title: '',
11417
11382
  ellipsis: true,
11418
11383
  width: 50,
11419
- render: function render(_, record, index) {
11384
+ render: function render(_, record) {
11420
11385
  return /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, {
11421
11386
  onClick: function onClick() {
11422
11387
  return handleDelete(record);
@@ -11447,8 +11412,10 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11447
11412
  }];
11448
11413
  var expandedRowSelection = {
11449
11414
  fixed: true,
11450
- selectedRowKeys: selectIds,
11451
- onSelect: function onSelect(record, selected, selectedRows, nativeEvent) {
11415
+ selectedRowKeys: selectList.map(function (item) {
11416
+ return item.specId;
11417
+ }),
11418
+ onSelect: function onSelect(record, selected) {
11452
11419
  var tempList = [];
11453
11420
  if (selected) {
11454
11421
  tempList = [].concat(_toConsumableArray(selectList), [record]);
@@ -11458,9 +11425,6 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11458
11425
  });
11459
11426
  }
11460
11427
  setSelect(_toConsumableArray(tempList));
11461
- setSelectIds(_toConsumableArray(tempList.map(function (item) {
11462
- return item.specId;
11463
- })));
11464
11428
  },
11465
11429
  onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
11466
11430
  var tempAllList = [];
@@ -11474,15 +11438,12 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11474
11438
  });
11475
11439
  }
11476
11440
  setSelect(_toConsumableArray(tempAllList));
11477
- setSelectIds(_toConsumableArray(tempAllList.map(function (item) {
11478
- return item.specId;
11479
- })));
11480
11441
  }
11481
11442
  };
11482
- var expandedRowRender = function expandedRowRender(record, index, indent, expanded) {
11443
+ var expandedRowRender = function expandedRowRender(record) {
11483
11444
  return /*#__PURE__*/React__default['default'].createElement(antd.Table, {
11484
- rowKey: 'specId',
11485
- size: 'small',
11445
+ rowKey: "specId",
11446
+ size: "small",
11486
11447
  columns: expandedColumns,
11487
11448
  dataSource: record.itemDetailList || [],
11488
11449
  pagination: false,
@@ -11492,43 +11453,61 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11492
11453
  }
11493
11454
  });
11494
11455
  };
11495
- return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
11496
- title: '选择商品',
11497
- okText: '确认',
11498
- cancelText: '取消',
11499
- visible: visible,
11500
- width: width || 850,
11501
- onCancel: function onCancel() {
11502
- _onCancel();
11503
- },
11504
- onOk: onOk,
11505
- wrapClassName: "goodModal"
11506
- }, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
11456
+ React__default['default'].useEffect(function () {
11457
+ queryItems();
11458
+ }, []);
11459
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
11507
11460
  layout: "inline",
11508
11461
  form: form,
11509
- onFinish: onFinish,
11510
- onValuesChange: onValuesChange,
11462
+ onFinish: queryItems,
11511
11463
  initialValues: {
11512
- code: ''
11464
+ goodNo: '',
11465
+ specNo: '',
11466
+ dateTimePicker: getInitTime()
11513
11467
  }
11514
11468
  }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
11515
- name: "dateTimePicker"
11469
+ name: "dateTimePicker",
11470
+ style: {
11471
+ marginBottom: '12px'
11472
+ }
11516
11473
  }, /*#__PURE__*/React__default['default'].createElement(RangePicker, {
11517
11474
  style: {
11518
- width: '350px'
11475
+ width: '240px'
11519
11476
  },
11520
11477
  placeholder: ['开始日期', '结束日期'],
11521
- showTime: true,
11522
- defaultValue: [hooks(initStartTime.format(dateFormat), dateFormat), hooks(initEndTime.format(dateFormat), dateFormat)]
11478
+ showTime: false,
11479
+ disabledDate: disabledDate,
11480
+ onCalendarChange: function onCalendarChange(val) {
11481
+ return setDates(val);
11482
+ },
11483
+ onOpenChange: onOpenChange
11523
11484
  })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
11524
- name: "code"
11485
+ name: "goodNo",
11486
+ style: {
11487
+ marginBottom: '12px'
11488
+ }
11525
11489
  }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11526
11490
  placeholder: "\u5546\u54C1SPU\u7F16\u7801",
11527
11491
  allowClear: true,
11528
11492
  style: {
11529
11493
  width: 150
11530
11494
  }
11531
- })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
11495
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
11496
+ name: "specNo",
11497
+ style: {
11498
+ marginBottom: '12px'
11499
+ }
11500
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11501
+ placeholder: "\u5546\u54C1SKU\u7F16\u7801",
11502
+ allowClear: true,
11503
+ style: {
11504
+ width: 150
11505
+ }
11506
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
11507
+ style: {
11508
+ marginBottom: '12px'
11509
+ }
11510
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
11532
11511
  type: "primary",
11533
11512
  htmlType: "submit",
11534
11513
  style: {
@@ -11538,10 +11517,10 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11538
11517
  onClick: onReset
11539
11518
  }, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement("div", {
11540
11519
  style: {
11541
- marginTop: '16px'
11520
+ marginTop: '4px'
11542
11521
  }
11543
11522
  }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
11544
- rowKey: 'goodNo',
11523
+ rowKey: "goodNo",
11545
11524
  columns: columns$1,
11546
11525
  dataSource: goodList,
11547
11526
  loading: loading,
@@ -11558,14 +11537,14 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11558
11537
  current: pageNo,
11559
11538
  pageSize: pageSize,
11560
11539
  pageSizeOptions: [],
11561
- onChange: pageChange
11540
+ onChange: setPageNo
11562
11541
  }
11563
11542
  })), !!selectList.length && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, "\u5DF2\u7ECF\u9009\u62E9\u5546\u54C1\uFF08", selectList.length, "\uFF09"), /*#__PURE__*/React__default['default'].createElement("div", {
11564
11543
  style: {
11565
11544
  marginTop: '16px'
11566
11545
  }
11567
11546
  }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
11568
- rowKey: 'specId',
11547
+ rowKey: "specId",
11569
11548
  columns: [].concat(displaySelectedColumns, expandedColumns),
11570
11549
  dataSource: displaySelectList,
11571
11550
  pagination: false,
@@ -11576,7 +11555,48 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
11576
11555
  style: {
11577
11556
  width: '100%'
11578
11557
  }
11579
- })))));
11558
+ }))));
11559
+ };
11560
+ var WdtGoodList = /*#__PURE__*/React.forwardRef(GoodList);
11561
+
11562
+ var GoodsModal$3 = function GoodsModal(props, ref) {
11563
+ React.useImperativeHandle(ref, function () {
11564
+ return {
11565
+ open: function open() {
11566
+ setVisible(true);
11567
+ }
11568
+ };
11569
+ });
11570
+ var onSubmit = props.onSubmit,
11571
+ width = props.width;
11572
+ var _useState = React.useState(false),
11573
+ _useState2 = _slicedToArray(_useState, 2),
11574
+ visible = _useState2[0],
11575
+ setVisible = _useState2[1];
11576
+ var wdtGoodListRef = React.useRef(null);
11577
+ var _onCancel = function onCancel() {
11578
+ setVisible(false);
11579
+ };
11580
+ var onOk = function onOk() {
11581
+ var _wdtGoodListRef$curre;
11582
+ var selectedList = ((_wdtGoodListRef$curre = wdtGoodListRef.current) === null || _wdtGoodListRef$curre === void 0 ? void 0 : _wdtGoodListRef$curre.getSelectGoodList()) || [];
11583
+ onSubmit(selectedList);
11584
+ _onCancel();
11585
+ };
11586
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
11587
+ title: '选择商品',
11588
+ okText: '确认',
11589
+ cancelText: '取消',
11590
+ visible: visible,
11591
+ width: width || 850,
11592
+ onCancel: function onCancel() {
11593
+ _onCancel();
11594
+ },
11595
+ onOk: onOk,
11596
+ wrapClassName: "goodModal"
11597
+ }, /*#__PURE__*/React__default['default'].createElement(WdtGoodList, {
11598
+ ref: wdtGoodListRef
11599
+ })));
11580
11600
  };
11581
11601
  var WdtGoodsModal = /*#__PURE__*/React.forwardRef(GoodsModal$3);
11582
11602
 
@@ -12363,20 +12383,6 @@ var typeMap = {
12363
12383
  money: 'money',
12364
12384
  share: 'share'
12365
12385
  }
12366
- },
12367
- WDT_REISSUE_GOODS: {
12368
- key: 'wdtReissueGoods',
12369
- name: '旺店通',
12370
- typeName: 'wdtReissueType',
12371
- reissueSelectList: 'wdtReissueSelectList',
12372
- reissueSelectListReturn: 'wdtReissueSelectListReturn',
12373
- reissueDeleteGood: 'wdtReissueDeleteGood',
12374
- changeShopCode: 'wdtChangeShopCode',
12375
- reissueType: 'wdtReissueType',
12376
- formatDefaultField: {
12377
- money: 'orderPrice',
12378
- share: 'sharePrice'
12379
- }
12380
12386
  }
12381
12387
  };
12382
12388
  var BsReissue = function BsReissue(props) {
@@ -12630,7 +12636,7 @@ var index$1 = (function (props) {
12630
12636
  getWdtOrderList(value.orderNo);
12631
12637
  }
12632
12638
  }
12633
- }, [value, type]);
12639
+ }, [value === null || value === void 0 ? void 0 : value.orderNo, type]);
12634
12640
  var columns = React.useMemo(function () {
12635
12641
  var _columnsNameMap$type, _columnsNameMap$type2;
12636
12642
  return [{
@@ -12979,6 +12985,245 @@ var CommonGoods = function CommonGoods(props) {
12979
12985
  }));
12980
12986
  };
12981
12987
 
12988
+ var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
12989
+ var typeMap$1 = {
12990
+ WDT_REISSUE_GOODS: {
12991
+ key: 'wdtReissueGoods',
12992
+ name: '旺店通',
12993
+ typeName: 'wdtReissueType',
12994
+ wdtSystemOrder: 'wdtSystemOrder',
12995
+ wdtSystemOrderNo: 'wdtSystemOrderNo',
12996
+ reissueSelectList: 'wdtReissueSelectList',
12997
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12998
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12999
+ changeShopCode: 'wdtChangeShopCode',
13000
+ reissueType: 'wdtReissueType',
13001
+ formatDefaultField: {
13002
+ money: 'orderPrice',
13003
+ share: 'sharePrice'
13004
+ }
13005
+ }
13006
+ };
13007
+ var wdtReissue = function wdtReissue(props) {
13008
+ var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type11, _typeMap$type25, _typeMap$type26, _value$typeMap$type$w2, _typeMap$type27, _typeMap$type28, _typeMap$type29;
13009
+ var value = props.value,
13010
+ onChange = props.onChange,
13011
+ _props$reasonList = props.reasonList,
13012
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
13013
+ disabled = props.disabled,
13014
+ type = props.type,
13015
+ other = _objectWithoutProperties(props, _excluded$g);
13016
+ var valueRef = React.useRef({});
13017
+ React.useEffect(function () {
13018
+ var _typeMap$type, _typeMap$type4;
13019
+ valueRef.current = value;
13020
+ pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
13021
+ if (disabled) return;
13022
+ if (value) {
13023
+ var _typeMap$type2, _typeMap$type3;
13024
+ var newValue = _objectSpread2({}, value);
13025
+ newValue["".concat((_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.key)].filter(function (item) {
13026
+ return item.sku !== data;
13027
+ });
13028
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13029
+ }
13030
+ });
13031
+ pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
13032
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13033
+ shopCode: data.shopCode
13034
+ }));
13035
+ });
13036
+ }, [value, disabled]);
13037
+ React.useEffect(function () {
13038
+ var _value$orders, _value$showOrderInfo;
13039
+ 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)) {
13040
+ if (type === 'WDT_SYSTEM_ORDER') {
13041
+ getWdtOrderList(value.orderNo);
13042
+ }
13043
+ }
13044
+ return;
13045
+ }, [value]);
13046
+ React.useEffect(function () {
13047
+ var _typeMap$type5;
13048
+ var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.wdtSystemOrderNo];
13049
+ if (wdtSystemOrderNo) {
13050
+ var _value$typeMap$type$t, _typeMap$type6;
13051
+ if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
13052
+ getGoodItems(wdtSystemOrderNo);
13053
+ }
13054
+ }
13055
+ return;
13056
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
13057
+ React.useEffect(function () {
13058
+ var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
13059
+ var typeName = value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0];
13060
+ var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.wdtSystemOrderNo];
13061
+ if (['1'].includes(typeName)) {
13062
+ wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
13063
+ } else if (['2'].includes(typeName)) {
13064
+ var _typeMap$type10;
13065
+ var newValue = _objectSpread2({}, value);
13066
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = [];
13067
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13068
+ }
13069
+ return;
13070
+ }, [value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]]);
13071
+ var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
13072
+ var _value$typeMap$type$w, _typeMap$type12, _ref;
13073
+ var orders = value === null || value === void 0 ? void 0 : (_value$typeMap$type$w = value[(_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.wdtSystemOrder]) === null || _value$typeMap$type$w === void 0 ? void 0 : _value$typeMap$type$w.orders;
13074
+ var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
13075
+ return orderItem.billNo === wdtSystemOrderNo;
13076
+ });
13077
+ if (order) {
13078
+ var _typeMap$type13, _order$goodDetails;
13079
+ var newValue = _objectSpread2({}, value);
13080
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
13081
+ var _typeMap$type14, _typeMap$type15;
13082
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.money)] = 0;
13083
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.formatDefaultField.share)] = 0;
13084
+ item.canUpdateNumber = true;
13085
+ return item;
13086
+ });
13087
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13088
+ }
13089
+ };
13090
+ var getWdtOrderList = /*#__PURE__*/function () {
13091
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
13092
+ var _yield$request, success, data, _typeMap$type16, _typeMap$type17, orders, showOrderInfo;
13093
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13094
+ while (1) switch (_context.prev = _context.next) {
13095
+ case 0:
13096
+ _context.next = 2;
13097
+ return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13098
+ method: 'post',
13099
+ data: {
13100
+ billNo: orderNo
13101
+ }
13102
+ });
13103
+ case 2:
13104
+ _yield$request = _context.sent;
13105
+ success = _yield$request.success;
13106
+ data = _yield$request.data;
13107
+ if (success) {
13108
+ orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
13109
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13110
+ billNo: item.tradeNo,
13111
+ billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13112
+ billTag: item.tagName
13113
+ });
13114
+ });
13115
+ showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
13116
+ return {
13117
+ billNo: item.tradeNo,
13118
+ billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13119
+ billTag: item.tagName
13120
+ };
13121
+ });
13122
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.wdtSystemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.wdtSystemOrder]), {}, {
13123
+ showOrderInfo: showOrderInfo,
13124
+ orders: orders
13125
+ }))));
13126
+ }
13127
+ case 6:
13128
+ case "end":
13129
+ return _context.stop();
13130
+ }
13131
+ }, _callee);
13132
+ }));
13133
+ return function getWdtOrderList(_x) {
13134
+ return _ref2.apply(this, arguments);
13135
+ };
13136
+ }();
13137
+ var changeTypeHandle = function changeTypeHandle(val) {
13138
+ var _typeMap$type18, _typeMap$type19;
13139
+ var newValue = _objectSpread2({}, value);
13140
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName)] = val;
13141
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = [];
13142
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13143
+ valueRef.current = newValue;
13144
+ // if (['2'].includes(val[0])) {
13145
+ // onChange?.(newValue);
13146
+ // valueRef.current = newValue;
13147
+ // }
13148
+ // pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
13149
+ // val: val[0],
13150
+ // goodValue: newValue,
13151
+ // });
13152
+ };
13153
+
13154
+ var changeGoodHandle = function changeGoodHandle(val) {
13155
+ var _typeMap$type20;
13156
+ var newValue = _objectSpread2({}, value);
13157
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = (val || []).map(function (item) {
13158
+ var _typeMap$type21, _typeMap$type22;
13159
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.formatDefaultField.money)] = 0;
13160
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.formatDefaultField.share)] = 0;
13161
+ return item;
13162
+ });
13163
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13164
+ };
13165
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
13166
+ var _typeMap$type23;
13167
+ var newValue = _objectSpread2({}, value);
13168
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.wdtSystemOrderNo)] = val;
13169
+ console.log('changeSystemOrderHandle', val, newValue);
13170
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13171
+ };
13172
+ //显示选择商品按钮 原单换不显示选择商品
13173
+ var showChangeBtn = React.useMemo(function () {
13174
+ var _typeMap$type24;
13175
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.wdtSystemOrderNo]);
13176
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]]);
13177
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
13178
+ gutter: 8
13179
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
13180
+ className: "gutter-row",
13181
+ span: 6
13182
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
13183
+ style: {
13184
+ marginBottom: '8px'
13185
+ },
13186
+ disabled: disabled,
13187
+ allowClear: false,
13188
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo)],
13189
+ onChange: function onChange(val) {
13190
+ return changeSystemOrderHandle(val);
13191
+ }
13192
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$w2 = value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.wdtSystemOrder]) === null || _value$typeMap$type$w2 === void 0 ? void 0 : _value$typeMap$type$w2.showOrderInfo) || []).map(function (item) {
13193
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
13194
+ key: item.billNo,
13195
+ value: item.billNo,
13196
+ label: item.billNo
13197
+ }, item.billNo);
13198
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
13199
+ className: "gutter-row",
13200
+ span: 6
13201
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
13202
+ style: {
13203
+ marginBottom: '8px'
13204
+ },
13205
+ disabled: disabled,
13206
+ allowClear: false,
13207
+ options: reasonList,
13208
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName)],
13209
+ onChange: function onChange(val) {
13210
+ return changeTypeHandle(val);
13211
+ }
13212
+ }))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13213
+ key: 'reissueGoods'
13214
+ }, other), {}, {
13215
+ type: type,
13216
+ disabled: disabled,
13217
+ canUpdateNumber: showChangeBtn,
13218
+ showChangeBtn: showChangeBtn,
13219
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13220
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)],
13221
+ onChange: function onChange(val) {
13222
+ return changeGoodHandle(val);
13223
+ }
13224
+ })));
13225
+ };
13226
+
12982
13227
  var css_248z$a = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
12983
13228
  styleInject(css_248z$a);
12984
13229
 
@@ -13455,12 +13700,12 @@ var Goods$1 = function Goods(props, ref) {
13455
13700
  };
13456
13701
  var index$2 = /*#__PURE__*/React.forwardRef(Goods$1);
13457
13702
 
13458
- var _excluded$g = ["onChange", "value", "failValue"];
13703
+ var _excluded$h = ["onChange", "value", "failValue"];
13459
13704
  function CommonStatus(props) {
13460
13705
  var onChange = props.onChange,
13461
13706
  value = props.value,
13462
13707
  failValue = props.failValue,
13463
- other = _objectWithoutProperties(props, _excluded$g);
13708
+ other = _objectWithoutProperties(props, _excluded$h);
13464
13709
  var changeHandle = function changeHandle(val) {
13465
13710
  onChange === null || onChange === void 0 ? void 0 : onChange({
13466
13711
  status: val,
@@ -13579,7 +13824,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
13579
13824
  })) : null) : null);
13580
13825
  };
13581
13826
 
13582
- var _excluded$h = ["value", "onChange", "disabled", "failValue", "type"];
13827
+ var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
13583
13828
  var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13584
13829
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
13585
13830
  var _props$value = props.value,
@@ -13589,7 +13834,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13589
13834
  failValue = props.failValue,
13590
13835
  _props$type = props.type,
13591
13836
  type = _props$type === void 0 ? 1 : _props$type,
13592
- other = _objectWithoutProperties(props, _excluded$h);
13837
+ other = _objectWithoutProperties(props, _excluded$i);
13593
13838
  var _useState = React.useState(0),
13594
13839
  _useState2 = _slicedToArray(_useState, 2),
13595
13840
  changeIndex = _useState2[0],
@@ -13655,7 +13900,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13655
13900
  }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
13656
13901
  };
13657
13902
 
13658
- var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
13903
+ var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
13659
13904
  var msgTypeCh = {
13660
13905
  ding: '钉钉',
13661
13906
  wechat: '微信',
@@ -13671,7 +13916,7 @@ var MsgStatus = function MsgStatus(props) {
13671
13916
  failValue = props.failValue,
13672
13917
  _props$type = props.type,
13673
13918
  type = _props$type === void 0 ? 1 : _props$type,
13674
- other = _objectWithoutProperties(props, _excluded$i);
13919
+ other = _objectWithoutProperties(props, _excluded$j);
13675
13920
  var _useState = React.useState(0),
13676
13921
  _useState2 = _slicedToArray(_useState, 2),
13677
13922
  changeIndex = _useState2[0],
@@ -13794,4 +14039,6 @@ exports.Supplier = Supplier;
13794
14039
  exports.TBGoodId = TBGoodId;
13795
14040
  exports.TBGoodSerial = TBGoodSerial;
13796
14041
  exports.TradeId = TradeId;
14042
+ exports.WdtGoodList = WdtGoodList;
14043
+ exports.WdtReissue = wdtReissue;
13797
14044
  exports.WlnGoods = WlnGoods;