@kmkf-fe-packages/basic-components 0.26.0-alpha.0 → 0.26.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3,7 +3,7 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CaretUpOutlined } 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, toTree, request as request$1, ExpressData, uuid, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, toTree, request as request$1, ExpressData, uuid, LogisticsAddressData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
8
  import { cloneDeep, difference, differenceWith } from 'lodash';
9
9
  import { useDebounceEffect } from 'ahooks';
@@ -7379,6 +7379,7 @@ function ApaasRate(props) {
7379
7379
 
7380
7380
  var addressData = AddressData.getInstance();
7381
7381
  var bsAddressData = BsAddressData.getInstance();
7382
+ var wdtAddressData = WdtAddressData.getInstance();
7382
7383
  var Province = function Province(props) {
7383
7384
  var _props$type = props.type,
7384
7385
  type = _props$type === void 0 ? 'workOrder' : _props$type,
@@ -7397,7 +7398,11 @@ var Province = function Province(props) {
7397
7398
  while (1) switch (_context.prev = _context.next) {
7398
7399
  case 0:
7399
7400
  num++;
7400
- options = type !== 'bs' ? addressData.addressOptions || [] : bsAddressData.addressOptions || [];
7401
+ options = ({
7402
+ bs: bsAddressData,
7403
+ wdt: wdtAddressData,
7404
+ workOrder: addressData
7405
+ }[type] || addressData).addressOptions || [];
7401
7406
  if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
7402
7407
  time.current = setTimeout(function () {
7403
7408
  initPageSource();
@@ -7536,7 +7541,11 @@ var IdentifyAddress = function IdentifyAddress(props) {
7536
7541
  receiverMobile: val === null || val === void 0 ? void 0 : val.phone,
7537
7542
  address: []
7538
7543
  };
7539
- var addressData = type === 'bs' ? BsAddressData.getInstance() : AddressData.getInstance();
7544
+ var addressData = (type && {
7545
+ bs: BsAddressData,
7546
+ wdt: WdtAddressData,
7547
+ workOrder: AddressData
7548
+ }[type] || AddressData).getInstance();
7540
7549
  if ((val === null || val === void 0 ? void 0 : val.province) && addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province)) {
7541
7550
  params.address = [addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.city), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
7542
7551
  }
@@ -11080,6 +11089,461 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
11080
11089
  };
11081
11090
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11082
11091
 
11092
+ var RangePicker = DatePicker.RangePicker;
11093
+ var columns$1 = [{
11094
+ dataIndex: 'index',
11095
+ title: 'NO',
11096
+ render: function render(val, record, index) {
11097
+ return /*#__PURE__*/React.createElement("div", {
11098
+ style: {
11099
+ width: 25
11100
+ }
11101
+ }, index + 1);
11102
+ },
11103
+ width: 100
11104
+ }, {
11105
+ dataIndex: 'goodName',
11106
+ title: '商品名称',
11107
+ width: 250,
11108
+ ellipsis: true
11109
+ }, {
11110
+ dataIndex: 'goodNo',
11111
+ title: '商品SPU编码',
11112
+ width: 200,
11113
+ ellipsis: true
11114
+ }, {
11115
+ dataIndex: 'goodId',
11116
+ title: 'SPUID',
11117
+ width: 200,
11118
+ ellipsis: true
11119
+ }, {
11120
+ dataIndex: 'specCount',
11121
+ title: '规格数',
11122
+ width: 100,
11123
+ ellipsis: true
11124
+ }];
11125
+ var expandedColumns = [{
11126
+ dataIndex: 'specName',
11127
+ title: '商品SKU名称',
11128
+ width: 250,
11129
+ ellipsis: true
11130
+ }, {
11131
+ dataIndex: 'specNo',
11132
+ title: '商品SKU编码',
11133
+ width: 200,
11134
+ ellipsis: true
11135
+ }, {
11136
+ dataIndex: 'specId',
11137
+ title: 'SKUID',
11138
+ width: 200,
11139
+ ellipsis: true
11140
+ }, {
11141
+ dataIndex: 'imgUrl',
11142
+ title: '商品图片',
11143
+ width: 100,
11144
+ render: function render(picUrl) {
11145
+ return /*#__PURE__*/React.createElement("img", {
11146
+ style: {
11147
+ width: '40px',
11148
+ height: '40px',
11149
+ objectFit: 'contain'
11150
+ },
11151
+ src: picUrl
11152
+ });
11153
+ }
11154
+ }, {
11155
+ dataIndex: 'marketPrice',
11156
+ title: '市场价',
11157
+ width: 140
11158
+ }, {
11159
+ dataIndex: 'retailPrice',
11160
+ title: '零售价',
11161
+ width: 140
11162
+ }, {
11163
+ dataIndex: 'memberPrice',
11164
+ title: '会员价',
11165
+ width: 140
11166
+ }];
11167
+ var dateFormat = 'YYYY-MM-DD HH:mm:ss';
11168
+ var GoodsModal$3 = function GoodsModal(props, ref) {
11169
+ var initStartTime = hooks().subtract(30, 'd');
11170
+ var initEndTime = hooks();
11171
+ useImperativeHandle(ref, function () {
11172
+ return {
11173
+ open: function open(shopCode) {
11174
+ setVisible(true);
11175
+ setPageNo(1);
11176
+ setSelect([]);
11177
+ setSelectIds([]);
11178
+ form.setFieldsValue({
11179
+ dateTimePicker: [initStartTime, initEndTime],
11180
+ code: ''
11181
+ });
11182
+ // getShopList();
11183
+ }
11184
+ };
11185
+ });
11186
+
11187
+ var onSubmit = props.onSubmit,
11188
+ shopId = props.shopId,
11189
+ shopList = props.shopList,
11190
+ width = props.width,
11191
+ companyKey = props.companyKey;
11192
+ var _useState = useState(false),
11193
+ _useState2 = _slicedToArray(_useState, 2),
11194
+ visible = _useState2[0],
11195
+ setVisible = _useState2[1];
11196
+ var _useState3 = useState([]),
11197
+ _useState4 = _slicedToArray(_useState3, 2),
11198
+ selectList = _useState4[0],
11199
+ setSelect = _useState4[1];
11200
+ var _useState5 = useState([]),
11201
+ _useState6 = _slicedToArray(_useState5, 2),
11202
+ selectIds = _useState6[0],
11203
+ setSelectIds = _useState6[1];
11204
+ var _useState7 = useState(1),
11205
+ _useState8 = _slicedToArray(_useState7, 2),
11206
+ pageNo = _useState8[0],
11207
+ setPageNo = _useState8[1];
11208
+ var _useState9 = useState(20),
11209
+ _useState10 = _slicedToArray(_useState9, 1),
11210
+ pageSize = _useState10[0];
11211
+ var _useState11 = useState([]),
11212
+ _useState12 = _slicedToArray(_useState11, 2),
11213
+ goodList = _useState12[0],
11214
+ setGoodList = _useState12[1];
11215
+ var _useState13 = useState(false),
11216
+ _useState14 = _slicedToArray(_useState13, 2),
11217
+ loading = _useState14[0],
11218
+ setLoading = _useState14[1];
11219
+ var _useState15 = useState(0),
11220
+ _useState16 = _slicedToArray(_useState15, 2),
11221
+ total = _useState16[0],
11222
+ setTotal = _useState16[1];
11223
+ var displaySelectList = useMemo(function () {
11224
+ return selectList.map(function (item, i) {
11225
+ item.index = i + 1;
11226
+ return item;
11227
+ });
11228
+ }, [selectList]);
11229
+ useEffect(function () {
11230
+ if (visible) {
11231
+ queryItems();
11232
+ }
11233
+ }, [pageNo, visible]);
11234
+ var _Form$useForm = Form.useForm(),
11235
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
11236
+ form = _Form$useForm2[0];
11237
+ //选择页码
11238
+ var pageChange = function pageChange(page) {
11239
+ setPageNo(page);
11240
+ };
11241
+ /**
11242
+ * 查询商品
11243
+ */
11244
+ var queryItems = /*#__PURE__*/function () {
11245
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11246
+ var search,
11247
+ _formData$dateTimePic,
11248
+ _formData$dateTimePic2,
11249
+ _formData$dateTimePic3,
11250
+ _formData$dateTimePic4,
11251
+ _formData$dateTimePic5,
11252
+ _formData$dateTimePic6,
11253
+ formData,
11254
+ startTime,
11255
+ endTime,
11256
+ params,
11257
+ res,
11258
+ _res$data,
11259
+ _res$data$productList,
11260
+ productList,
11261
+ _res$data$total,
11262
+ _total,
11263
+ errorMsg,
11264
+ newProducts,
11265
+ _args = arguments;
11266
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11267
+ while (1) switch (_context.prev = _context.next) {
11268
+ case 0:
11269
+ search = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
11270
+ _context.prev = 1;
11271
+ setLoading(true);
11272
+ formData = form.getFieldsValue();
11273
+ 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);
11274
+ 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);
11275
+ params = {
11276
+ // shopCode: shopCode,
11277
+ pageSize: pageSize,
11278
+ pageNo: pageNo - 1,
11279
+ goodNo: search.code,
11280
+ startTime: startTime,
11281
+ endTime: endTime
11282
+ };
11283
+ _context.next = 9;
11284
+ return extendRequest('/qy/gdfw/product/wdtListProduct', {
11285
+ method: 'post',
11286
+ data: params
11287
+ });
11288
+ case 9:
11289
+ res = _context.sent;
11290
+ _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;
11291
+ if (res.success) {
11292
+ newProducts = productList.map(function (item, index) {
11293
+ return _objectSpread2(_objectSpread2({}, item), {}, {
11294
+ index: index + 1
11295
+ });
11296
+ });
11297
+ setGoodList(_toConsumableArray(newProducts));
11298
+ if (pageNo === 1) {
11299
+ setTotal(_total);
11300
+ }
11301
+ } else {
11302
+ setGoodList([]);
11303
+ setTotal(0);
11304
+ message.error(errorMsg || res.message);
11305
+ }
11306
+ case 12:
11307
+ _context.prev = 12;
11308
+ setLoading(false);
11309
+ return _context.finish(12);
11310
+ case 15:
11311
+ case "end":
11312
+ return _context.stop();
11313
+ }
11314
+ }, _callee, null, [[1,, 12, 15]]);
11315
+ }));
11316
+ return function queryItems() {
11317
+ return _ref.apply(this, arguments);
11318
+ };
11319
+ }();
11320
+ var _onCancel = function onCancel() {
11321
+ setVisible(false);
11322
+ };
11323
+ var onOk = function onOk() {
11324
+ onSubmit(selectList);
11325
+ _onCancel();
11326
+ };
11327
+ var onFinish = function onFinish(fieldsValue) {
11328
+ var searchValue = {
11329
+ code: fieldsValue.code
11330
+ };
11331
+ queryItems(searchValue);
11332
+ };
11333
+ var onReset = function onReset() {
11334
+ form.resetFields();
11335
+ form.setFieldsValue({
11336
+ dateTimePicker: [hooks().subtract(30, 'd'), hooks()],
11337
+ code: ''
11338
+ });
11339
+ setPageNo(function (prev) {
11340
+ if (prev === 1 && visible) {
11341
+ queryItems();
11342
+ }
11343
+ return 1;
11344
+ });
11345
+ };
11346
+ // const getShopList = async () => {
11347
+ // const { success, data } = await request('/qy/diamond/getConfigInfo', {
11348
+ // method: 'get',
11349
+ // params: {
11350
+ // key: 'company-third-shop-info',
11351
+ // },
11352
+ // });
11353
+ // const obj: any = JSON.parse(data || '{}');
11354
+ // if (success) {
11355
+ // const list = (obj?.[companyKey] || []).map((item: any) => {
11356
+ // return {
11357
+ // label: item.shopName,
11358
+ // value: item.shopCode,
11359
+ // };
11360
+ // });
11361
+ // setShopList(list);
11362
+ // }
11363
+ // };
11364
+ var onValuesChange = function onValuesChange(changedValues) {
11365
+ if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
11366
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
11367
+ pubsub.publish('changeShopCode', {
11368
+ shopCode: changedValues.shopId
11369
+ });
11370
+ }
11371
+ };
11372
+ var handleDelete = function handleDelete(record, index) {
11373
+ var newSelectList = selectList.filter(function (item) {
11374
+ return item.specId !== record.specId;
11375
+ });
11376
+ setSelect(_toConsumableArray(newSelectList));
11377
+ setSelectIds(_toConsumableArray(newSelectList.map(function (item) {
11378
+ return item.specId;
11379
+ })));
11380
+ };
11381
+ var displaySelectedColumns = [{
11382
+ dataIndex: 'operation',
11383
+ title: '',
11384
+ ellipsis: true,
11385
+ width: 50,
11386
+ render: function render(_, record, index) {
11387
+ return /*#__PURE__*/React.createElement(DeleteOutlined, {
11388
+ onClick: function onClick() {
11389
+ return handleDelete(record);
11390
+ }
11391
+ });
11392
+ }
11393
+ }, {
11394
+ dataIndex: 'index',
11395
+ title: 'NO',
11396
+ width: 100,
11397
+ render: function render(val, record, index) {
11398
+ return /*#__PURE__*/React.createElement("div", {
11399
+ style: {
11400
+ width: 25
11401
+ }
11402
+ }, index + 1);
11403
+ }
11404
+ }, {
11405
+ dataIndex: 'goodName',
11406
+ title: '商品名称',
11407
+ width: 250,
11408
+ ellipsis: true
11409
+ }, {
11410
+ dataIndex: 'goodNo',
11411
+ title: "\u5546\u54C1SPU\u7F16\u7801",
11412
+ ellipsis: true,
11413
+ width: 200
11414
+ }];
11415
+ var expandedRowSelection = {
11416
+ fixed: true,
11417
+ selectedRowKeys: selectIds,
11418
+ onSelect: function onSelect(record, selected, selectedRows, nativeEvent) {
11419
+ var tempList = [];
11420
+ if (selected) {
11421
+ tempList = [].concat(_toConsumableArray(selectList), [record]);
11422
+ } else {
11423
+ tempList = selectList.filter(function (item) {
11424
+ return item.specId !== record.specId;
11425
+ });
11426
+ }
11427
+ setSelect(_toConsumableArray(tempList));
11428
+ setSelectIds(_toConsumableArray(tempList.map(function (item) {
11429
+ return item.specId;
11430
+ })));
11431
+ },
11432
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
11433
+ var tempAllList = [];
11434
+ if (selected) {
11435
+ tempAllList = [].concat(_toConsumableArray(selectList), _toConsumableArray(selectedRows.filter(Boolean)));
11436
+ } else {
11437
+ tempAllList = selectList.filter(function (list) {
11438
+ return changeRows.filter(Boolean).every(function (item) {
11439
+ return list.specId !== item.specId;
11440
+ });
11441
+ });
11442
+ }
11443
+ setSelect(_toConsumableArray(tempAllList));
11444
+ setSelectIds(_toConsumableArray(tempAllList.map(function (item) {
11445
+ return item.specId;
11446
+ })));
11447
+ }
11448
+ };
11449
+ var expandedRowRender = function expandedRowRender(record, index, indent, expanded) {
11450
+ return /*#__PURE__*/React.createElement(Table, {
11451
+ rowKey: 'specId',
11452
+ size: 'small',
11453
+ columns: expandedColumns,
11454
+ dataSource: record.itemDetailList || [],
11455
+ pagination: false,
11456
+ rowSelection: expandedRowSelection,
11457
+ scroll: {
11458
+ x: '100%'
11459
+ }
11460
+ });
11461
+ };
11462
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
11463
+ title: '选择商品',
11464
+ okText: '确认',
11465
+ cancelText: '取消',
11466
+ visible: visible,
11467
+ width: width || 850,
11468
+ onCancel: function onCancel() {
11469
+ _onCancel();
11470
+ },
11471
+ onOk: onOk,
11472
+ wrapClassName: "goodModal"
11473
+ }, /*#__PURE__*/React.createElement(Form, {
11474
+ layout: "inline",
11475
+ form: form,
11476
+ onFinish: onFinish,
11477
+ onValuesChange: onValuesChange,
11478
+ initialValues: {
11479
+ code: ''
11480
+ }
11481
+ }, /*#__PURE__*/React.createElement(Form.Item, {
11482
+ name: "dateTimePicker"
11483
+ }, /*#__PURE__*/React.createElement(RangePicker, {
11484
+ placeholder: ['开始日期', '结束日期'],
11485
+ showTime: true,
11486
+ defaultValue: [hooks(initStartTime.format(dateFormat), dateFormat), hooks(initEndTime.format(dateFormat), dateFormat)]
11487
+ })), /*#__PURE__*/React.createElement(Form.Item, {
11488
+ name: "code"
11489
+ }, /*#__PURE__*/React.createElement(Input, {
11490
+ placeholder: "\u5546\u54C1SPU\u7F16\u7801",
11491
+ allowClear: true,
11492
+ style: {
11493
+ width: 150
11494
+ }
11495
+ })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
11496
+ type: "primary",
11497
+ htmlType: "submit",
11498
+ style: {
11499
+ marginRight: '8px'
11500
+ }
11501
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
11502
+ onClick: onReset
11503
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement("div", {
11504
+ style: {
11505
+ marginTop: '16px'
11506
+ }
11507
+ }, /*#__PURE__*/React.createElement(Table, {
11508
+ rowKey: 'goodNo',
11509
+ columns: columns$1,
11510
+ dataSource: goodList,
11511
+ loading: loading,
11512
+ scroll: {
11513
+ x: '100%',
11514
+ y: 250
11515
+ },
11516
+ expandable: {
11517
+ expandedRowRender: expandedRowRender
11518
+ },
11519
+ pagination: {
11520
+ size: 'small',
11521
+ total: total,
11522
+ current: pageNo,
11523
+ pageSize: pageSize,
11524
+ pageSizeOptions: [],
11525
+ onChange: pageChange
11526
+ }
11527
+ })), !!selectList.length && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, "\u5DF2\u7ECF\u9009\u62E9\u5546\u54C1\uFF08", selectList.length, "\uFF09"), /*#__PURE__*/React.createElement("div", {
11528
+ style: {
11529
+ marginTop: '16px'
11530
+ }
11531
+ }, /*#__PURE__*/React.createElement(Table, {
11532
+ rowKey: 'specId',
11533
+ columns: [].concat(displaySelectedColumns, expandedColumns),
11534
+ dataSource: displaySelectList,
11535
+ pagination: false,
11536
+ scroll: {
11537
+ x: '100%',
11538
+ y: 250
11539
+ },
11540
+ style: {
11541
+ width: '100%'
11542
+ }
11543
+ })))));
11544
+ };
11545
+ var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
11546
+
11083
11547
  // interface GoodsItem {
11084
11548
  // title: string;
11085
11549
  // pic: string;
@@ -11090,6 +11554,7 @@ var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11090
11554
  var GoodItem$1 = function GoodItem(props) {
11091
11555
  var _props$value = props.value,
11092
11556
  value = _props$value === void 0 ? [] : _props$value,
11557
+ type = props.type,
11093
11558
  onChange = props.onChange,
11094
11559
  disabled = props.disabled,
11095
11560
  _props$showHeader = props.showHeader,
@@ -11137,105 +11602,214 @@ var GoodItem$1 = function GoodItem(props) {
11137
11602
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
11138
11603
  }
11139
11604
  };
11140
- //商品信息
11141
- var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
11605
+ var COLUMNS_MAP = function COLUMNS_MAP() {
11142
11606
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11143
- return [{
11144
- dataIndex: 'mark',
11145
- title: "\u5546\u54C1\u6807\u8BB0",
11146
- align: 'center',
11147
- ellipsis: true,
11148
- width: 70,
11149
- render: function render(val, record, index) {
11150
- return /*#__PURE__*/React.createElement(Select, {
11151
- options: [{
11152
- label: '是',
11153
- value: '是'
11154
- }, {
11155
- label: '否',
11156
- value: '否'
11157
- }],
11158
- disabled: disabled,
11159
- value: val,
11160
- onChange: function onChange(val) {
11161
- return updateHandle(val, index, 'mark');
11162
- }
11163
- });
11164
- }
11165
- }, {
11166
- dataIndex: 'skuName',
11167
- title: "".concat(text, "sku\u540D\u79F0"),
11168
- align: 'center',
11169
- ellipsis: true,
11170
- width: 250
11171
- }, {
11172
- dataIndex: 'sku',
11173
- title: "".concat(text, "sku\u7F16\u7801"),
11174
- align: 'center',
11175
- ellipsis: true,
11176
- width: 100
11177
- }, {
11178
- dataIndex: 'name',
11179
- title: "".concat(text, "\u540D\u79F0"),
11180
- align: 'center',
11181
- ellipsis: true,
11182
- width: 250
11183
- }, {
11184
- dataIndex: 'pic',
11185
- title: "\u56FE\u7247",
11186
- align: 'center',
11187
- ellipsis: true,
11188
- width: 100,
11189
- render: function render(val) {
11190
- return /*#__PURE__*/React.createElement(Image, {
11191
- width: 60,
11192
- src: val
11193
- });
11194
- }
11195
- }, {
11196
- dataIndex: 'code',
11197
- title: "".concat(text, "\u7F16\u7801"),
11198
- align: 'center',
11199
- ellipsis: true,
11200
- width: 100
11201
- }, {
11202
- dataIndex: 'money',
11203
- title: "\u5B9E\u4ED8\u91D1\u989D",
11204
- align: 'center',
11205
- ellipsis: true,
11206
- width: 100
11207
- }, {
11208
- dataIndex: 'number',
11209
- title: "".concat(text, "\u6570\u91CF"),
11210
- align: 'center',
11211
- ellipsis: true,
11212
- width: 100,
11213
- render: function render(val, record, index) {
11214
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11215
- style: {
11607
+ return function (type) {
11608
+ var columns = [];
11609
+ switch (type) {
11610
+ case 'WDT_REISSUE_GOODS':
11611
+ case 'WDT_GOODS':
11612
+ columns = [{
11613
+ dataIndex: 'goodId',
11614
+ title: "SPUID",
11615
+ align: 'center',
11616
+ ellipsis: true,
11216
11617
  width: 70
11618
+ }, {
11619
+ dataIndex: 'goodNo',
11620
+ title: "\u5546\u54C1SPU\u7F16\u7801",
11621
+ align: 'center',
11622
+ ellipsis: true,
11623
+ width: 180
11624
+ }, {
11625
+ dataIndex: 'goodName',
11626
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11627
+ align: 'center',
11628
+ ellipsis: true,
11629
+ width: 250
11630
+ }, {
11631
+ dataIndex: 'specId',
11632
+ title: "".concat(text, "SKUID"),
11633
+ align: 'center',
11634
+ ellipsis: true,
11635
+ width: 100
11636
+ }, {
11637
+ dataIndex: 'specNo',
11638
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11639
+ align: 'center',
11640
+ ellipsis: true,
11641
+ width: 180
11642
+ }, {
11643
+ dataIndex: 'specName',
11644
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11645
+ align: 'center',
11646
+ ellipsis: true,
11647
+ width: 250
11648
+ }, {
11649
+ dataIndex: 'orderPrice',
11650
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
11651
+ align: 'center',
11652
+ ellipsis: true,
11653
+ width: 100
11654
+ }, {
11655
+ dataIndex: 'num',
11656
+ title: "".concat(text, "\u6570\u91CF"),
11657
+ align: 'center',
11658
+ ellipsis: true,
11659
+ width: 100,
11660
+ render: function render(val, record, index) {
11661
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11662
+ style: {
11663
+ width: 70
11664
+ },
11665
+ value: val,
11666
+ min: 0,
11667
+ precision: 0,
11668
+ onChange: function onChange(num) {
11669
+ return updateHandle(num, index, 'num');
11670
+ }
11671
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11672
+ }
11217
11673
  },
11218
- value: val,
11219
- min: 0,
11220
- precision: 0,
11221
- onChange: function onChange(num) {
11222
- return updateHandle(num, index, 'number');
11223
- }
11224
- }) : /*#__PURE__*/React.createElement("span", null, val);
11674
+ // {
11675
+ // dataIndex: 'actualNum',
11676
+ // title: `${text}实发数量`,
11677
+ // align: 'center',
11678
+ // ellipsis: true,
11679
+ // width: 100,
11680
+ // },
11681
+ {
11682
+ dataIndex: 'sharePrice',
11683
+ title: "\u5206\u644A\u4EF7",
11684
+ align: 'center',
11685
+ ellipsis: true,
11686
+ width: 70
11687
+ }, {
11688
+ dataIndex: 'giftType',
11689
+ title: "\u8D60\u54C1\u65B9\u5F0F",
11690
+ align: 'center',
11691
+ ellipsis: true,
11692
+ width: 100,
11693
+ render: function render(val) {
11694
+ var giftTypeMap = {
11695
+ 0: '非赠品',
11696
+ 1: '自动赠送',
11697
+ 2: '手工赠送',
11698
+ 3: '回购自动送赠品',
11699
+ 4: '前N有礼送赠品',
11700
+ 6: '天猫优仓赠品',
11701
+ 7: '淘宝CRM会员送赠'
11702
+ };
11703
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
11704
+ }
11705
+ }];
11706
+ break;
11707
+ default:
11708
+ columns = [{
11709
+ dataIndex: 'mark',
11710
+ title: "\u5546\u54C1\u6807\u8BB0",
11711
+ align: 'center',
11712
+ ellipsis: true,
11713
+ width: 70,
11714
+ render: function render(val, record, index) {
11715
+ return /*#__PURE__*/React.createElement(Select, {
11716
+ options: [{
11717
+ label: '是',
11718
+ value: '是'
11719
+ }, {
11720
+ label: '否',
11721
+ value: '否'
11722
+ }],
11723
+ disabled: disabled,
11724
+ value: val,
11725
+ onChange: function onChange(val) {
11726
+ return updateHandle(val, index, 'mark');
11727
+ }
11728
+ });
11729
+ }
11730
+ }, {
11731
+ dataIndex: 'skuName',
11732
+ title: "".concat(text, "sku\u540D\u79F0"),
11733
+ align: 'center',
11734
+ ellipsis: true,
11735
+ width: 250
11736
+ }, {
11737
+ dataIndex: 'sku',
11738
+ title: "".concat(text, "sku\u7F16\u7801"),
11739
+ align: 'center',
11740
+ ellipsis: true,
11741
+ width: 100
11742
+ }, {
11743
+ dataIndex: 'name',
11744
+ title: "".concat(text, "\u540D\u79F0"),
11745
+ align: 'center',
11746
+ ellipsis: true,
11747
+ width: 250
11748
+ }, {
11749
+ dataIndex: 'pic',
11750
+ title: "\u56FE\u7247",
11751
+ align: 'center',
11752
+ ellipsis: true,
11753
+ width: 100,
11754
+ render: function render(val) {
11755
+ return /*#__PURE__*/React.createElement(Image, {
11756
+ width: 60,
11757
+ src: val
11758
+ });
11759
+ }
11760
+ }, {
11761
+ dataIndex: 'code',
11762
+ title: "".concat(text, "\u7F16\u7801"),
11763
+ align: 'center',
11764
+ ellipsis: true,
11765
+ width: 100
11766
+ }, {
11767
+ dataIndex: 'money',
11768
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11769
+ align: 'center',
11770
+ ellipsis: true,
11771
+ width: 100
11772
+ }, {
11773
+ dataIndex: 'number',
11774
+ title: "".concat(text, "\u6570\u91CF"),
11775
+ align: 'center',
11776
+ ellipsis: true,
11777
+ width: 100,
11778
+ render: function render(val, record, index) {
11779
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11780
+ style: {
11781
+ width: 70
11782
+ },
11783
+ value: val,
11784
+ min: 0,
11785
+ precision: 0,
11786
+ onChange: function onChange(num) {
11787
+ return updateHandle(num, index, 'number');
11788
+ }
11789
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11790
+ }
11791
+ }, {
11792
+ dataIndex: 'share',
11793
+ title: "\u5206\u644A\u4EF7",
11794
+ align: 'center',
11795
+ ellipsis: true,
11796
+ width: 70
11797
+ }, {
11798
+ dataIndex: 'type',
11799
+ title: "\u8D60\u54C1\u7C7B\u578B",
11800
+ align: 'center',
11801
+ ellipsis: true,
11802
+ width: 100
11803
+ }];
11225
11804
  }
11226
- }, {
11227
- dataIndex: 'share',
11228
- title: "\u5206\u644A\u4EF7",
11229
- align: 'center',
11230
- ellipsis: true,
11231
- width: 70
11232
- }, {
11233
- dataIndex: 'type',
11234
- title: "\u8D60\u54C1\u7C7B\u578B",
11235
- align: 'center',
11236
- ellipsis: true,
11237
- width: 100
11238
- }];
11805
+ return columns;
11806
+ };
11807
+ };
11808
+ //商品信息
11809
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
11810
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11811
+ var COLUMNS_INFO = COLUMNS_MAP(text);
11812
+ return COLUMNS_INFO(type);
11239
11813
  };
11240
11814
  var newColumns = useMemo(function () {
11241
11815
  var columnList = [{
@@ -11270,30 +11844,43 @@ var GoodItem$1 = function GoodItem(props) {
11270
11844
  return columnList;
11271
11845
  }, [showHeader, value, disabled]);
11272
11846
  var onSubmit = function onSubmit(list) {
11273
- var newList = list.map(function (item) {
11274
- var goodsId = item.goodsId,
11275
- name = item.name,
11276
- code = item.code,
11277
- skuCode = item.skuCode,
11278
- marketPrice = item.marketPrice,
11279
- skuName = item.skuName;
11280
- return {
11281
- id: goodsId,
11282
- mark: '是',
11283
- pic: '',
11284
- skuName: skuName,
11285
- name: name,
11286
- code: code,
11287
- sku: skuCode,
11288
- money: marketPrice || 0,
11289
- share: marketPrice || 0,
11290
- number: 1,
11291
- type: '',
11292
- uuid: uuid(),
11293
- canDelete: true,
11294
- canUpdateNumber: canUpdateNumber
11295
- };
11296
- });
11847
+ var newList = [];
11848
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
11849
+ newList = list.map(function (item) {
11850
+ item.uuid = uuid();
11851
+ item.canDelete = true;
11852
+ item.num = 1;
11853
+ item.orderPrice = 0;
11854
+ item.sharePrice = 0;
11855
+ item.canUpdateNumber = canUpdateNumber;
11856
+ return item;
11857
+ });
11858
+ } else {
11859
+ newList = list.map(function (item) {
11860
+ var goodsId = item.goodsId,
11861
+ name = item.name,
11862
+ code = item.code,
11863
+ skuCode = item.skuCode,
11864
+ marketPrice = item.marketPrice,
11865
+ skuName = item.skuName;
11866
+ return {
11867
+ id: goodsId,
11868
+ mark: '是',
11869
+ pic: '',
11870
+ skuName: skuName,
11871
+ name: name,
11872
+ code: code,
11873
+ sku: skuCode,
11874
+ money: marketPrice || 0,
11875
+ share: marketPrice || 0,
11876
+ number: 1,
11877
+ type: '',
11878
+ uuid: uuid(),
11879
+ canDelete: true,
11880
+ canUpdateNumber: canUpdateNumber
11881
+ };
11882
+ });
11883
+ }
11297
11884
  onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
11298
11885
  };
11299
11886
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
@@ -11336,7 +11923,15 @@ var GoodItem$1 = function GoodItem(props) {
11336
11923
  locale: {
11337
11924
  emptyText: '暂无数据'
11338
11925
  }
11339
- })), /*#__PURE__*/React.createElement(GoodsModal$2, {
11926
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11927
+ ref: refModal,
11928
+ onSubmit: onSubmit,
11929
+ width: width,
11930
+ shopList: shopList,
11931
+ shopId: shopId,
11932
+ maxLength: maxLength,
11933
+ companyKey: companyKey
11934
+ }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
11340
11935
  ref: refModal,
11341
11936
  onSubmit: onSubmit,
11342
11937
  width: width,
@@ -11717,25 +12312,60 @@ var BsExchange = function BsExchange(props) {
11717
12312
  }))) : null);
11718
12313
  };
11719
12314
 
11720
- var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
12315
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled", "type"];
12316
+ var typeMap = {
12317
+ BS_REISSUE_GOODS: {
12318
+ key: 'bsReissueGoods',
12319
+ name: 'bs',
12320
+ typeName: 'bsReissueType',
12321
+ reissueSelectList: 'reissueSelectList',
12322
+ reissueSelectListReturn: 'reissueSelectListReturn',
12323
+ reissueDeleteGood: 'reissueDeleteGood',
12324
+ changeShopCode: 'changeShopCode',
12325
+ reissueType: 'reissueType',
12326
+ formatDefaultField: {
12327
+ money: 'money',
12328
+ share: 'share'
12329
+ }
12330
+ },
12331
+ WDT_REISSUE_GOODS: {
12332
+ key: 'wdtReissueGoods',
12333
+ name: '旺店通',
12334
+ typeName: 'wdtReissueType',
12335
+ reissueSelectList: 'wdtReissueSelectList',
12336
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12337
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12338
+ changeShopCode: 'wdtChangeShopCode',
12339
+ reissueType: 'wdtReissueType',
12340
+ formatDefaultField: {
12341
+ money: 'orderPrice',
12342
+ share: 'sharePrice'
12343
+ }
12344
+ }
12345
+ };
11721
12346
  var BsReissue = function BsReissue(props) {
12347
+ var _typeMap$type20, _typeMap$type21, _typeMap$type22;
11722
12348
  var value = props.value,
11723
12349
  onChange = props.onChange,
11724
12350
  _props$reasonList = props.reasonList,
11725
12351
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
11726
12352
  disabled = props.disabled,
12353
+ type = props.type,
11727
12354
  other = _objectWithoutProperties(props, _excluded$e);
11728
12355
  var valueRef = useRef({});
11729
12356
  useEffect(function () {
11730
- pubsub.subscribe('reissueSelectList', function (_, data) {
12357
+ var _typeMap$type;
12358
+ pubsub.subscribe("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type = typeMap[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueSelectList), function (_, data) {
12359
+ var _typeMap$type2;
11731
12360
  // console.log('reissueSelectList', data);
11732
12361
  if (disabled) return;
11733
12362
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11734
12363
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11735
12364
  });
11736
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11737
- item.money = 0;
11738
- item.share = 0;
12365
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type2 = typeMap[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
12366
+ var _typeMap$type3, _typeMap$type4;
12367
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type3 = typeMap[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.formatDefaultField.money)] = 0;
12368
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type4 = typeMap[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.formatDefaultField.share)] = 0;
11739
12369
  item.canUpdateNumber = true;
11740
12370
  return item;
11741
12371
  });
@@ -11743,15 +12373,18 @@ var BsReissue = function BsReissue(props) {
11743
12373
  });
11744
12374
  }, []);
11745
12375
  useEffect(function () {
11746
- pubsub.subscribe('reissueSelectListReturn', function (_, data) {
12376
+ var _typeMap$type5;
12377
+ pubsub.subscribe("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type5 = typeMap[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.reissueSelectListReturn), function (_, data) {
12378
+ var _typeMap$type6;
11747
12379
  // console.log('reissueSelectListReturn', data);
11748
12380
  if (disabled) return;
11749
12381
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11750
12382
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11751
12383
  });
11752
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11753
- item.money = 0;
11754
- item.share = 0;
12384
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type6 = typeMap[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.key)] = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
12385
+ var _typeMap$type7, _typeMap$type8;
12386
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type7 = typeMap[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.formatDefaultField.money)] = 0;
12387
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type8 = typeMap[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.formatDefaultField.share)] = 0;
11755
12388
  item.canUpdateNumber = true;
11756
12389
  return item;
11757
12390
  });
@@ -11759,50 +12392,55 @@ var BsReissue = function BsReissue(props) {
11759
12392
  });
11760
12393
  }, []);
11761
12394
  useEffect(function () {
12395
+ var _typeMap$type9, _typeMap$type12;
11762
12396
  valueRef.current = value;
11763
- pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
12397
+ pubsub.subscribeOnce("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type9 = typeMap[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.reissueDeleteGood), function (_, data) {
11764
12398
  if (disabled) return;
11765
12399
  if (value) {
12400
+ var _typeMap$type10, _typeMap$type11;
11766
12401
  var newValue = _objectSpread2({}, value);
11767
- newValue.bsReissueGoods = newValue.bsReissueGoods.filter(function (item) {
12402
+ newValue["".concat((_typeMap$type10 = typeMap[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type11 = typeMap[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.key)].filter(function (item) {
11768
12403
  return item.sku !== data;
11769
12404
  });
11770
12405
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11771
12406
  }
11772
12407
  });
11773
- pubsub.subscribeOnce('changeShopCode', function (type, data) {
12408
+ pubsub.subscribeOnce("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type12 = typeMap[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.changeShopCode), function (type, data) {
11774
12409
  onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11775
12410
  shopCode: data.shopCode
11776
12411
  }));
11777
12412
  });
11778
12413
  }, [value, disabled]);
11779
12414
  var changeTypeHandle = function changeTypeHandle(val) {
12415
+ var _typeMap$type13, _typeMap$type14, _typeMap$type15;
11780
12416
  var newValue = _objectSpread2({}, value);
11781
- newValue['bsReissueType'] = val;
11782
- newValue.bsReissueGoods = [];
12417
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type13 = typeMap[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.typeName)] = val;
12418
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type14 = typeMap[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key)] = [];
11783
12419
  if (['2', '4'].includes(val[0])) {
11784
12420
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11785
12421
  valueRef.current = newValue;
11786
12422
  }
11787
- pubsub.publish('reissueType', {
12423
+ pubsub.publish("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type15 = typeMap[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.reissueType), {
11788
12424
  val: val[0],
11789
12425
  goodValue: newValue
11790
12426
  });
11791
12427
  };
11792
12428
  var changeGoodHandle = function changeGoodHandle(val) {
12429
+ var _typeMap$type16;
11793
12430
  var newValue = _objectSpread2({}, value);
11794
- newValue['bsReissueGoods'] = (val || []).map(function (item) {
11795
- item.money = 0;
11796
- item.share = 0;
12431
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type16 = typeMap[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.key)] = (val || []).map(function (item) {
12432
+ var _typeMap$type17, _typeMap$type18;
12433
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type17 = typeMap[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.money)] = 0;
12434
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type18 = typeMap[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.formatDefaultField.share)] = 0;
11797
12435
  return item;
11798
12436
  });
11799
12437
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11800
12438
  };
11801
12439
  //显示选择商品按钮 原单换不显示选择商品
11802
12440
  var showChangeBtn = useMemo(function () {
11803
- var _value$bsReissueType;
11804
- return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsReissueType = value.bsReissueType) === null || _value$bsReissueType === void 0 ? void 0 : _value$bsReissueType[0]);
11805
- }, [value === null || value === void 0 ? void 0 : value.bsReissueType]);
12441
+ var _value, _typeMap$type19;
12442
+ return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value = value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type19 = typeMap[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.typeName)]) === null || _value === void 0 ? void 0 : _value[0]);
12443
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.typeName]]);
11806
12444
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
11807
12445
  style: {
11808
12446
  marginBottom: '8px'
@@ -11810,18 +12448,19 @@ var BsReissue = function BsReissue(props) {
11810
12448
  disabled: disabled,
11811
12449
  allowClear: false,
11812
12450
  options: reasonList,
11813
- value: value === null || value === void 0 ? void 0 : value.bsReissueType,
12451
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type21 = typeMap[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.typeName)],
11814
12452
  onChange: function onChange(val) {
11815
12453
  return changeTypeHandle(val);
11816
12454
  }
11817
12455
  }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11818
12456
  key: 'reissueGoods'
11819
12457
  }, other), {}, {
12458
+ type: type,
11820
12459
  disabled: disabled,
11821
12460
  canUpdateNumber: showChangeBtn,
11822
12461
  showChangeBtn: showChangeBtn,
11823
12462
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11824
- value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
12463
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type22 = typeMap[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)],
11825
12464
  onChange: function onChange(val) {
11826
12465
  return changeGoodHandle(val);
11827
12466
  }
@@ -11933,6 +12572,10 @@ var columnsNameMap = {
11933
12572
  WLN_SYSTEM_ORDER: {
11934
12573
  typeName: '订单类型',
11935
12574
  tagName: '标记'
12575
+ },
12576
+ WDT_SYSTEM_ORDER: {
12577
+ typeName: '订单类型',
12578
+ tagName: '订单标签'
11936
12579
  }
11937
12580
  };
11938
12581
  var index$1 = (function (props) {
@@ -11947,6 +12590,8 @@ var index$1 = (function (props) {
11947
12590
  getOrderList(value.orderNo);
11948
12591
  } else if (type === 'WLN_SYSTEM_ORDER') {
11949
12592
  getWlnOrderList(value.orderNo);
12593
+ } else if (type === 'WDT_SYSTEM_ORDER') {
12594
+ getWdtOrderList(value.orderNo);
11950
12595
  }
11951
12596
  }
11952
12597
  }, [value, type]);
@@ -12047,6 +12692,51 @@ var index$1 = (function (props) {
12047
12692
  return _ref2.apply(this, arguments);
12048
12693
  };
12049
12694
  }();
12695
+ var getWdtOrderList = /*#__PURE__*/function () {
12696
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
12697
+ var _yield$request3, success, data;
12698
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12699
+ while (1) switch (_context3.prev = _context3.next) {
12700
+ case 0:
12701
+ _context3.next = 2;
12702
+ return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
12703
+ method: 'post',
12704
+ data: {
12705
+ billNo: orderNo
12706
+ }
12707
+ });
12708
+ case 2:
12709
+ _yield$request3 = _context3.sent;
12710
+ success = _yield$request3.success;
12711
+ data = _yield$request3.data;
12712
+ if (success) {
12713
+ _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
12714
+ orders: ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
12715
+ return _objectSpread2(_objectSpread2({}, item), {}, {
12716
+ billNo: item.tradeNo,
12717
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
12718
+ billTag: item.tagName
12719
+ });
12720
+ }),
12721
+ showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
12722
+ return {
12723
+ billNo: item.tradeNo,
12724
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
12725
+ billTag: item.tagName
12726
+ };
12727
+ })
12728
+ }));
12729
+ }
12730
+ case 6:
12731
+ case "end":
12732
+ return _context3.stop();
12733
+ }
12734
+ }, _callee3);
12735
+ }));
12736
+ return function getWdtOrderList(_x3) {
12737
+ return _ref3.apply(this, arguments);
12738
+ };
12739
+ }();
12050
12740
  var rowSelection = {
12051
12741
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
12052
12742
  fixed: true,
@@ -12101,13 +12791,165 @@ var WlnGoods = function WlnGoods(props) {
12101
12791
  }));
12102
12792
  };
12103
12793
 
12794
+ var componentMap$1 = {
12795
+ 'WDT_GOODS': {
12796
+ type: 'wdt',
12797
+ key: 'wdtGoods',
12798
+ name: '旺店通',
12799
+ eventNameMap: {
12800
+ type: 'wdtType',
12801
+ selectListReturn: 'wdtSelectListReturn',
12802
+ selectList: 'wdtSelectList',
12803
+ reissueSelectList: 'wdtReissueSelectList',
12804
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12805
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12806
+ changeShopCode: 'wdtChangeShopCode',
12807
+ reissueType: 'wdtReissueType',
12808
+ returnType: 'wdtReturnType',
12809
+ returnSelectListReturn: 'wdtReturnSelectListReturn',
12810
+ deleteGood: 'wdtDeleteGood',
12811
+ returnDeleteGood: 'wdtReturnDeleteGood'
12812
+ }
12813
+ }
12814
+ };
12815
+ var CommonGoods = function CommonGoods(props) {
12816
+ var _withInfo$current3, _withInfo$current4;
12817
+ var value = props.value,
12818
+ disabled = props.disabled,
12819
+ onChange = props.onChange,
12820
+ compType = props.type;
12821
+ var _useState = useState(false),
12822
+ _useState2 = _slicedToArray(_useState, 2),
12823
+ tableSelect = _useState2[0],
12824
+ setTableSelect = _useState2[1];
12825
+ var withInfo = useRef(null);
12826
+ var valueRef = useRef(null);
12827
+ useEffect(function () {
12828
+ valueRef.current = value;
12829
+ }, [value]);
12830
+ useEffect(function () {
12831
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
12832
+ if (disabled) return;
12833
+ // console.log(type, data);
12834
+ withInfo.current = {
12835
+ type: type,
12836
+ val: data.val,
12837
+ goodValue: data.goodValue
12838
+ };
12839
+ setTableSelect(['2', '4'].includes(data.val));
12840
+ if (['1', '3'].includes(data.val)) {
12841
+ var _valueRef$current, _valueRef$current2;
12842
+ pubsub.publish(componentMap$1[compType].eventNameMap.selectListReturn, {
12843
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current[componentMap$1[compType].key]) || []),
12844
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
12845
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12846
+ });
12847
+ }
12848
+ });
12849
+ //补发
12850
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
12851
+ if (disabled) return;
12852
+ withInfo.current = {
12853
+ type: type,
12854
+ val: data.val,
12855
+ goodValue: data.goodValue
12856
+ };
12857
+ setTableSelect(['2', '4'].includes(data.val));
12858
+ if (['1', '3'].includes(data.val)) {
12859
+ var _valueRef$current3, _valueRef$current4;
12860
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueSelectListReturn, {
12861
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3[componentMap$1[compType].key]) || []),
12862
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
12863
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12864
+ });
12865
+ }
12866
+ });
12867
+ //退货
12868
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
12869
+ if (disabled) return;
12870
+ withInfo.current = {
12871
+ type: type,
12872
+ val: data.val,
12873
+ goodValue: data.goodValue
12874
+ };
12875
+ setTableSelect(['2', '4'].includes(data.val));
12876
+ if (['1', '3'].includes(data.val)) {
12877
+ var _valueRef$current5, _valueRef$current6;
12878
+ pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
12879
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5[componentMap$1[compType].key]) || []),
12880
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
12881
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12882
+ });
12883
+ }
12884
+ });
12885
+ pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
12886
+ // console.log(data);
12887
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
12888
+ shopCode: data.shopCode
12889
+ }));
12890
+ });
12891
+ return function () {
12892
+ pubsub.clearAllSubscriptions();
12893
+ };
12894
+ }, [disabled]);
12895
+ var _onSelect = function onSelect(list) {
12896
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
12897
+ if (disabled) return;
12898
+ var newList = cloneDeep(list);
12899
+ var typeMap = _defineProperty({
12900
+ // type: componentMap[compType].eventNameMap.selectList,
12901
+ // returnType: componentMap[compType].eventNameMap.returnSelectList,
12902
+ // reissueType: componentMap[compType].eventNameMap.reissueSelectList,
12903
+ type: componentMap$1[compType].eventNameMap.selectList
12904
+ }, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
12905
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
12906
+ // console.log('onSelect', type, withInfo.current, newList);
12907
+ pubsub.publish(type, {
12908
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
12909
+ list: newList.map(function (item) {
12910
+ item.canDelete = true;
12911
+ return item;
12912
+ }),
12913
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
12914
+ goodValue: withInfo.current.goodValue
12915
+ });
12916
+ };
12917
+ var _onDelete = function onDelete(item) {
12918
+ var deleteId = item === null || item === void 0 ? void 0 : item.specId;
12919
+ pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
12920
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
12921
+ pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
12922
+ };
12923
+ var changeHandle = function changeHandle(list) {
12924
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
12925
+ };
12926
+ return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
12927
+ key: componentMap$1[compType].key
12928
+ }, props), {}, {
12929
+ disabled: disabled,
12930
+ value: value === null || value === void 0 ? void 0 : value[componentMap$1[compType].key],
12931
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
12932
+ tableSelect: ['2', '4'].includes(withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current3 = withInfo.current) === null || _withInfo$current3 === void 0 ? void 0 : _withInfo$current3.val),
12933
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
12934
+ onSelect: function onSelect(list) {
12935
+ return _onSelect(list);
12936
+ },
12937
+ onDelete: function onDelete(item) {
12938
+ return _onDelete(item);
12939
+ },
12940
+ onChange: function onChange(val) {
12941
+ return changeHandle(val);
12942
+ }
12943
+ }));
12944
+ };
12945
+
12104
12946
  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";
12105
12947
  styleInject(css_248z$a);
12106
12948
 
12107
12949
  var TabPane$1 = Tabs.TabPane;
12108
12950
  var Option$2 = Select.Option;
12109
12951
  var Search$1 = Input.Search;
12110
- var GoodsModal$3 = function GoodsModal(props) {
12952
+ var GoodsModal$4 = function GoodsModal(props) {
12111
12953
  var onSubmit = props.onSubmit,
12112
12954
  _onCancel = props.onCancel,
12113
12955
  visible = props.visible,
@@ -12558,7 +13400,7 @@ var Goods$1 = function Goods(props, ref) {
12558
13400
  };
12559
13401
  return /*#__PURE__*/React.createElement("div", {
12560
13402
  className: "goodsBox"
12561
- }, /*#__PURE__*/React.createElement(GoodsModal$3, {
13403
+ }, /*#__PURE__*/React.createElement(GoodsModal$4, {
12562
13404
  visible: visible,
12563
13405
  onSubmit: onSubmit,
12564
13406
  type: type,
@@ -12863,4 +13705,4 @@ var CalculationInput = function CalculationInput(props) {
12863
13705
  }, config === null || config === void 0 ? void 0 : config.unit));
12864
13706
  };
12865
13707
 
12866
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
13708
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };