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

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,464 @@ 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
+ style: {
11485
+ width: '350px'
11486
+ },
11487
+ placeholder: ['开始日期', '结束日期'],
11488
+ showTime: true,
11489
+ defaultValue: [hooks(initStartTime.format(dateFormat), dateFormat), hooks(initEndTime.format(dateFormat), dateFormat)]
11490
+ })), /*#__PURE__*/React.createElement(Form.Item, {
11491
+ name: "code"
11492
+ }, /*#__PURE__*/React.createElement(Input, {
11493
+ placeholder: "\u5546\u54C1SPU\u7F16\u7801",
11494
+ allowClear: true,
11495
+ style: {
11496
+ width: 150
11497
+ }
11498
+ })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
11499
+ type: "primary",
11500
+ htmlType: "submit",
11501
+ style: {
11502
+ marginRight: '8px'
11503
+ }
11504
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
11505
+ onClick: onReset
11506
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement("div", {
11507
+ style: {
11508
+ marginTop: '16px'
11509
+ }
11510
+ }, /*#__PURE__*/React.createElement(Table, {
11511
+ rowKey: 'goodNo',
11512
+ columns: columns$1,
11513
+ dataSource: goodList,
11514
+ loading: loading,
11515
+ scroll: {
11516
+ x: '100%',
11517
+ y: 250
11518
+ },
11519
+ expandable: {
11520
+ expandedRowRender: expandedRowRender
11521
+ },
11522
+ pagination: {
11523
+ size: 'small',
11524
+ total: total,
11525
+ current: pageNo,
11526
+ pageSize: pageSize,
11527
+ pageSizeOptions: [],
11528
+ onChange: pageChange
11529
+ }
11530
+ })), !!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", {
11531
+ style: {
11532
+ marginTop: '16px'
11533
+ }
11534
+ }, /*#__PURE__*/React.createElement(Table, {
11535
+ rowKey: 'specId',
11536
+ columns: [].concat(displaySelectedColumns, expandedColumns),
11537
+ dataSource: displaySelectList,
11538
+ pagination: false,
11539
+ scroll: {
11540
+ x: '100%',
11541
+ y: 250
11542
+ },
11543
+ style: {
11544
+ width: '100%'
11545
+ }
11546
+ })))));
11547
+ };
11548
+ var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
11549
+
11083
11550
  // interface GoodsItem {
11084
11551
  // title: string;
11085
11552
  // pic: string;
@@ -11090,6 +11557,7 @@ var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11090
11557
  var GoodItem$1 = function GoodItem(props) {
11091
11558
  var _props$value = props.value,
11092
11559
  value = _props$value === void 0 ? [] : _props$value,
11560
+ type = props.type,
11093
11561
  onChange = props.onChange,
11094
11562
  disabled = props.disabled,
11095
11563
  _props$showHeader = props.showHeader,
@@ -11137,105 +11605,214 @@ var GoodItem$1 = function GoodItem(props) {
11137
11605
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
11138
11606
  }
11139
11607
  };
11140
- //商品信息
11141
- var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
11608
+ var COLUMNS_MAP = function COLUMNS_MAP() {
11142
11609
  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: {
11610
+ return function (type) {
11611
+ var columns = [];
11612
+ switch (type) {
11613
+ case 'WDT_REISSUE_GOODS':
11614
+ case 'WDT_GOODS':
11615
+ columns = [{
11616
+ dataIndex: 'goodId',
11617
+ title: "SPUID",
11618
+ align: 'center',
11619
+ ellipsis: true,
11216
11620
  width: 70
11621
+ }, {
11622
+ dataIndex: 'goodNo',
11623
+ title: "\u5546\u54C1SPU\u7F16\u7801",
11624
+ align: 'center',
11625
+ ellipsis: true,
11626
+ width: 180
11627
+ }, {
11628
+ dataIndex: 'goodName',
11629
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11630
+ align: 'center',
11631
+ ellipsis: true,
11632
+ width: 250
11633
+ }, {
11634
+ dataIndex: 'specId',
11635
+ title: "".concat(text, "SKUID"),
11636
+ align: 'center',
11637
+ ellipsis: true,
11638
+ width: 100
11639
+ }, {
11640
+ dataIndex: 'specNo',
11641
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
11642
+ align: 'center',
11643
+ ellipsis: true,
11644
+ width: 180
11645
+ }, {
11646
+ dataIndex: 'specName',
11647
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
11648
+ align: 'center',
11649
+ ellipsis: true,
11650
+ width: 250
11651
+ }, {
11652
+ dataIndex: 'orderPrice',
11653
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
11654
+ align: 'center',
11655
+ ellipsis: true,
11656
+ width: 100
11657
+ }, {
11658
+ dataIndex: 'num',
11659
+ title: "".concat(text, "\u6570\u91CF"),
11660
+ align: 'center',
11661
+ ellipsis: true,
11662
+ width: 100,
11663
+ render: function render(val, record, index) {
11664
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11665
+ style: {
11666
+ width: 70
11667
+ },
11668
+ value: val,
11669
+ min: 0,
11670
+ precision: 0,
11671
+ onChange: function onChange(num) {
11672
+ return updateHandle(num, index, 'num');
11673
+ }
11674
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11675
+ }
11217
11676
  },
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);
11677
+ // {
11678
+ // dataIndex: 'actualNum',
11679
+ // title: `${text}实发数量`,
11680
+ // align: 'center',
11681
+ // ellipsis: true,
11682
+ // width: 100,
11683
+ // },
11684
+ {
11685
+ dataIndex: 'sharePrice',
11686
+ title: "\u5206\u644A\u4EF7",
11687
+ align: 'center',
11688
+ ellipsis: true,
11689
+ width: 70
11690
+ }, {
11691
+ dataIndex: 'giftType',
11692
+ title: "\u8D60\u54C1\u65B9\u5F0F",
11693
+ align: 'center',
11694
+ ellipsis: true,
11695
+ width: 100,
11696
+ render: function render(val) {
11697
+ var giftTypeMap = {
11698
+ 0: '非赠品',
11699
+ 1: '自动赠送',
11700
+ 2: '手工赠送',
11701
+ 3: '回购自动送赠品',
11702
+ 4: '前N有礼送赠品',
11703
+ 6: '天猫优仓赠品',
11704
+ 7: '淘宝CRM会员送赠'
11705
+ };
11706
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
11707
+ }
11708
+ }];
11709
+ break;
11710
+ default:
11711
+ columns = [{
11712
+ dataIndex: 'mark',
11713
+ title: "\u5546\u54C1\u6807\u8BB0",
11714
+ align: 'center',
11715
+ ellipsis: true,
11716
+ width: 70,
11717
+ render: function render(val, record, index) {
11718
+ return /*#__PURE__*/React.createElement(Select, {
11719
+ options: [{
11720
+ label: '是',
11721
+ value: '是'
11722
+ }, {
11723
+ label: '否',
11724
+ value: '否'
11725
+ }],
11726
+ disabled: disabled,
11727
+ value: val,
11728
+ onChange: function onChange(val) {
11729
+ return updateHandle(val, index, 'mark');
11730
+ }
11731
+ });
11732
+ }
11733
+ }, {
11734
+ dataIndex: 'skuName',
11735
+ title: "".concat(text, "sku\u540D\u79F0"),
11736
+ align: 'center',
11737
+ ellipsis: true,
11738
+ width: 250
11739
+ }, {
11740
+ dataIndex: 'sku',
11741
+ title: "".concat(text, "sku\u7F16\u7801"),
11742
+ align: 'center',
11743
+ ellipsis: true,
11744
+ width: 100
11745
+ }, {
11746
+ dataIndex: 'name',
11747
+ title: "".concat(text, "\u540D\u79F0"),
11748
+ align: 'center',
11749
+ ellipsis: true,
11750
+ width: 250
11751
+ }, {
11752
+ dataIndex: 'pic',
11753
+ title: "\u56FE\u7247",
11754
+ align: 'center',
11755
+ ellipsis: true,
11756
+ width: 100,
11757
+ render: function render(val) {
11758
+ return /*#__PURE__*/React.createElement(Image, {
11759
+ width: 60,
11760
+ src: val
11761
+ });
11762
+ }
11763
+ }, {
11764
+ dataIndex: 'code',
11765
+ title: "".concat(text, "\u7F16\u7801"),
11766
+ align: 'center',
11767
+ ellipsis: true,
11768
+ width: 100
11769
+ }, {
11770
+ dataIndex: 'money',
11771
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11772
+ align: 'center',
11773
+ ellipsis: true,
11774
+ width: 100
11775
+ }, {
11776
+ dataIndex: 'number',
11777
+ title: "".concat(text, "\u6570\u91CF"),
11778
+ align: 'center',
11779
+ ellipsis: true,
11780
+ width: 100,
11781
+ render: function render(val, record, index) {
11782
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11783
+ style: {
11784
+ width: 70
11785
+ },
11786
+ value: val,
11787
+ min: 0,
11788
+ precision: 0,
11789
+ onChange: function onChange(num) {
11790
+ return updateHandle(num, index, 'number');
11791
+ }
11792
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11793
+ }
11794
+ }, {
11795
+ dataIndex: 'share',
11796
+ title: "\u5206\u644A\u4EF7",
11797
+ align: 'center',
11798
+ ellipsis: true,
11799
+ width: 70
11800
+ }, {
11801
+ dataIndex: 'type',
11802
+ title: "\u8D60\u54C1\u7C7B\u578B",
11803
+ align: 'center',
11804
+ ellipsis: true,
11805
+ width: 100
11806
+ }];
11225
11807
  }
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
- }];
11808
+ return columns;
11809
+ };
11810
+ };
11811
+ //商品信息
11812
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
11813
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11814
+ var COLUMNS_INFO = COLUMNS_MAP(text);
11815
+ return COLUMNS_INFO(type);
11239
11816
  };
11240
11817
  var newColumns = useMemo(function () {
11241
11818
  var columnList = [{
@@ -11270,30 +11847,43 @@ var GoodItem$1 = function GoodItem(props) {
11270
11847
  return columnList;
11271
11848
  }, [showHeader, value, disabled]);
11272
11849
  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
- });
11850
+ var newList = [];
11851
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
11852
+ newList = list.map(function (item) {
11853
+ item.uuid = uuid();
11854
+ item.canDelete = true;
11855
+ item.num = 1;
11856
+ item.orderPrice = 0;
11857
+ item.sharePrice = 0;
11858
+ item.canUpdateNumber = canUpdateNumber;
11859
+ return item;
11860
+ });
11861
+ } else {
11862
+ newList = list.map(function (item) {
11863
+ var goodsId = item.goodsId,
11864
+ name = item.name,
11865
+ code = item.code,
11866
+ skuCode = item.skuCode,
11867
+ marketPrice = item.marketPrice,
11868
+ skuName = item.skuName;
11869
+ return {
11870
+ id: goodsId,
11871
+ mark: '是',
11872
+ pic: '',
11873
+ skuName: skuName,
11874
+ name: name,
11875
+ code: code,
11876
+ sku: skuCode,
11877
+ money: marketPrice || 0,
11878
+ share: marketPrice || 0,
11879
+ number: 1,
11880
+ type: '',
11881
+ uuid: uuid(),
11882
+ canDelete: true,
11883
+ canUpdateNumber: canUpdateNumber
11884
+ };
11885
+ });
11886
+ }
11297
11887
  onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
11298
11888
  };
11299
11889
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
@@ -11336,7 +11926,15 @@ var GoodItem$1 = function GoodItem(props) {
11336
11926
  locale: {
11337
11927
  emptyText: '暂无数据'
11338
11928
  }
11339
- })), /*#__PURE__*/React.createElement(GoodsModal$2, {
11929
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11930
+ ref: refModal,
11931
+ onSubmit: onSubmit,
11932
+ width: width,
11933
+ shopList: shopList,
11934
+ shopId: shopId,
11935
+ maxLength: maxLength,
11936
+ companyKey: companyKey
11937
+ }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
11340
11938
  ref: refModal,
11341
11939
  onSubmit: onSubmit,
11342
11940
  width: width,
@@ -11717,25 +12315,60 @@ var BsExchange = function BsExchange(props) {
11717
12315
  }))) : null);
11718
12316
  };
11719
12317
 
11720
- var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
12318
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled", "type"];
12319
+ var typeMap = {
12320
+ BS_REISSUE_GOODS: {
12321
+ key: 'bsReissueGoods',
12322
+ name: 'bs',
12323
+ typeName: 'bsReissueType',
12324
+ reissueSelectList: 'reissueSelectList',
12325
+ reissueSelectListReturn: 'reissueSelectListReturn',
12326
+ reissueDeleteGood: 'reissueDeleteGood',
12327
+ changeShopCode: 'changeShopCode',
12328
+ reissueType: 'reissueType',
12329
+ formatDefaultField: {
12330
+ money: 'money',
12331
+ share: 'share'
12332
+ }
12333
+ },
12334
+ WDT_REISSUE_GOODS: {
12335
+ key: 'wdtReissueGoods',
12336
+ name: '旺店通',
12337
+ typeName: 'wdtReissueType',
12338
+ reissueSelectList: 'wdtReissueSelectList',
12339
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12340
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12341
+ changeShopCode: 'wdtChangeShopCode',
12342
+ reissueType: 'wdtReissueType',
12343
+ formatDefaultField: {
12344
+ money: 'orderPrice',
12345
+ share: 'sharePrice'
12346
+ }
12347
+ }
12348
+ };
11721
12349
  var BsReissue = function BsReissue(props) {
12350
+ var _typeMap$type20, _typeMap$type21, _typeMap$type22;
11722
12351
  var value = props.value,
11723
12352
  onChange = props.onChange,
11724
12353
  _props$reasonList = props.reasonList,
11725
12354
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
11726
12355
  disabled = props.disabled,
12356
+ type = props.type,
11727
12357
  other = _objectWithoutProperties(props, _excluded$e);
11728
12358
  var valueRef = useRef({});
11729
12359
  useEffect(function () {
11730
- pubsub.subscribe('reissueSelectList', function (_, data) {
12360
+ var _typeMap$type;
12361
+ 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) {
12362
+ var _typeMap$type2;
11731
12363
  // console.log('reissueSelectList', data);
11732
12364
  if (disabled) return;
11733
12365
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11734
12366
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11735
12367
  });
11736
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11737
- item.money = 0;
11738
- item.share = 0;
12368
+ 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) {
12369
+ var _typeMap$type3, _typeMap$type4;
12370
+ 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;
12371
+ 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
12372
  item.canUpdateNumber = true;
11740
12373
  return item;
11741
12374
  });
@@ -11743,15 +12376,18 @@ var BsReissue = function BsReissue(props) {
11743
12376
  });
11744
12377
  }, []);
11745
12378
  useEffect(function () {
11746
- pubsub.subscribe('reissueSelectListReturn', function (_, data) {
12379
+ var _typeMap$type5;
12380
+ 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) {
12381
+ var _typeMap$type6;
11747
12382
  // console.log('reissueSelectListReturn', data);
11748
12383
  if (disabled) return;
11749
12384
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11750
12385
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11751
12386
  });
11752
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11753
- item.money = 0;
11754
- item.share = 0;
12387
+ 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) {
12388
+ var _typeMap$type7, _typeMap$type8;
12389
+ 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;
12390
+ 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
12391
  item.canUpdateNumber = true;
11756
12392
  return item;
11757
12393
  });
@@ -11759,50 +12395,55 @@ var BsReissue = function BsReissue(props) {
11759
12395
  });
11760
12396
  }, []);
11761
12397
  useEffect(function () {
12398
+ var _typeMap$type9, _typeMap$type12;
11762
12399
  valueRef.current = value;
11763
- pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
12400
+ 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
12401
  if (disabled) return;
11765
12402
  if (value) {
12403
+ var _typeMap$type10, _typeMap$type11;
11766
12404
  var newValue = _objectSpread2({}, value);
11767
- newValue.bsReissueGoods = newValue.bsReissueGoods.filter(function (item) {
12405
+ 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
12406
  return item.sku !== data;
11769
12407
  });
11770
12408
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11771
12409
  }
11772
12410
  });
11773
- pubsub.subscribeOnce('changeShopCode', function (type, data) {
12411
+ 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
12412
  onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11775
12413
  shopCode: data.shopCode
11776
12414
  }));
11777
12415
  });
11778
12416
  }, [value, disabled]);
11779
12417
  var changeTypeHandle = function changeTypeHandle(val) {
12418
+ var _typeMap$type13, _typeMap$type14, _typeMap$type15;
11780
12419
  var newValue = _objectSpread2({}, value);
11781
- newValue['bsReissueType'] = val;
11782
- newValue.bsReissueGoods = [];
12420
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type13 = typeMap[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.typeName)] = val;
12421
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type14 = typeMap[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key)] = [];
11783
12422
  if (['2', '4'].includes(val[0])) {
11784
12423
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11785
12424
  valueRef.current = newValue;
11786
12425
  }
11787
- pubsub.publish('reissueType', {
12426
+ 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
12427
  val: val[0],
11789
12428
  goodValue: newValue
11790
12429
  });
11791
12430
  };
11792
12431
  var changeGoodHandle = function changeGoodHandle(val) {
12432
+ var _typeMap$type16;
11793
12433
  var newValue = _objectSpread2({}, value);
11794
- newValue['bsReissueGoods'] = (val || []).map(function (item) {
11795
- item.money = 0;
11796
- item.share = 0;
12434
+ 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) {
12435
+ var _typeMap$type17, _typeMap$type18;
12436
+ 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;
12437
+ 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
12438
  return item;
11798
12439
  });
11799
12440
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11800
12441
  };
11801
12442
  //显示选择商品按钮 原单换不显示选择商品
11802
12443
  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]);
12444
+ var _value, _typeMap$type19;
12445
+ 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]);
12446
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.typeName]]);
11806
12447
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
11807
12448
  style: {
11808
12449
  marginBottom: '8px'
@@ -11810,18 +12451,19 @@ var BsReissue = function BsReissue(props) {
11810
12451
  disabled: disabled,
11811
12452
  allowClear: false,
11812
12453
  options: reasonList,
11813
- value: value === null || value === void 0 ? void 0 : value.bsReissueType,
12454
+ 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
12455
  onChange: function onChange(val) {
11815
12456
  return changeTypeHandle(val);
11816
12457
  }
11817
12458
  }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11818
12459
  key: 'reissueGoods'
11819
12460
  }, other), {}, {
12461
+ type: type,
11820
12462
  disabled: disabled,
11821
12463
  canUpdateNumber: showChangeBtn,
11822
12464
  showChangeBtn: showChangeBtn,
11823
12465
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11824
- value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
12466
+ 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
12467
  onChange: function onChange(val) {
11826
12468
  return changeGoodHandle(val);
11827
12469
  }
@@ -11933,6 +12575,10 @@ var columnsNameMap = {
11933
12575
  WLN_SYSTEM_ORDER: {
11934
12576
  typeName: '订单类型',
11935
12577
  tagName: '标记'
12578
+ },
12579
+ WDT_SYSTEM_ORDER: {
12580
+ typeName: '订单类型',
12581
+ tagName: '订单标签'
11936
12582
  }
11937
12583
  };
11938
12584
  var index$1 = (function (props) {
@@ -11947,6 +12593,8 @@ var index$1 = (function (props) {
11947
12593
  getOrderList(value.orderNo);
11948
12594
  } else if (type === 'WLN_SYSTEM_ORDER') {
11949
12595
  getWlnOrderList(value.orderNo);
12596
+ } else if (type === 'WDT_SYSTEM_ORDER') {
12597
+ getWdtOrderList(value.orderNo);
11950
12598
  }
11951
12599
  }
11952
12600
  }, [value, type]);
@@ -12047,6 +12695,51 @@ var index$1 = (function (props) {
12047
12695
  return _ref2.apply(this, arguments);
12048
12696
  };
12049
12697
  }();
12698
+ var getWdtOrderList = /*#__PURE__*/function () {
12699
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
12700
+ var _yield$request3, success, data;
12701
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12702
+ while (1) switch (_context3.prev = _context3.next) {
12703
+ case 0:
12704
+ _context3.next = 2;
12705
+ return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
12706
+ method: 'post',
12707
+ data: {
12708
+ billNo: orderNo
12709
+ }
12710
+ });
12711
+ case 2:
12712
+ _yield$request3 = _context3.sent;
12713
+ success = _yield$request3.success;
12714
+ data = _yield$request3.data;
12715
+ if (success) {
12716
+ _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
12717
+ orders: ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
12718
+ return _objectSpread2(_objectSpread2({}, item), {}, {
12719
+ billNo: item.tradeNo,
12720
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
12721
+ billTag: item.tagName
12722
+ });
12723
+ }),
12724
+ showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
12725
+ return {
12726
+ billNo: item.tradeNo,
12727
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
12728
+ billTag: item.tagName
12729
+ };
12730
+ })
12731
+ }));
12732
+ }
12733
+ case 6:
12734
+ case "end":
12735
+ return _context3.stop();
12736
+ }
12737
+ }, _callee3);
12738
+ }));
12739
+ return function getWdtOrderList(_x3) {
12740
+ return _ref3.apply(this, arguments);
12741
+ };
12742
+ }();
12050
12743
  var rowSelection = {
12051
12744
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
12052
12745
  fixed: true,
@@ -12101,13 +12794,165 @@ var WlnGoods = function WlnGoods(props) {
12101
12794
  }));
12102
12795
  };
12103
12796
 
12797
+ var componentMap$1 = {
12798
+ 'WDT_GOODS': {
12799
+ type: 'wdt',
12800
+ key: 'wdtGoods',
12801
+ name: '旺店通',
12802
+ eventNameMap: {
12803
+ type: 'wdtType',
12804
+ selectListReturn: 'wdtSelectListReturn',
12805
+ selectList: 'wdtSelectList',
12806
+ reissueSelectList: 'wdtReissueSelectList',
12807
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12808
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12809
+ changeShopCode: 'wdtChangeShopCode',
12810
+ reissueType: 'wdtReissueType',
12811
+ returnType: 'wdtReturnType',
12812
+ returnSelectListReturn: 'wdtReturnSelectListReturn',
12813
+ deleteGood: 'wdtDeleteGood',
12814
+ returnDeleteGood: 'wdtReturnDeleteGood'
12815
+ }
12816
+ }
12817
+ };
12818
+ var CommonGoods = function CommonGoods(props) {
12819
+ var _withInfo$current3, _withInfo$current4;
12820
+ var value = props.value,
12821
+ disabled = props.disabled,
12822
+ onChange = props.onChange,
12823
+ compType = props.type;
12824
+ var _useState = useState(false),
12825
+ _useState2 = _slicedToArray(_useState, 2),
12826
+ tableSelect = _useState2[0],
12827
+ setTableSelect = _useState2[1];
12828
+ var withInfo = useRef(null);
12829
+ var valueRef = useRef(null);
12830
+ useEffect(function () {
12831
+ valueRef.current = value;
12832
+ }, [value]);
12833
+ useEffect(function () {
12834
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
12835
+ if (disabled) return;
12836
+ // console.log(type, data);
12837
+ withInfo.current = {
12838
+ type: type,
12839
+ val: data.val,
12840
+ goodValue: data.goodValue
12841
+ };
12842
+ setTableSelect(['2', '4'].includes(data.val));
12843
+ if (['1', '3'].includes(data.val)) {
12844
+ var _valueRef$current, _valueRef$current2;
12845
+ pubsub.publish(componentMap$1[compType].eventNameMap.selectListReturn, {
12846
+ 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]) || []),
12847
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
12848
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12849
+ });
12850
+ }
12851
+ });
12852
+ //补发
12853
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
12854
+ if (disabled) return;
12855
+ withInfo.current = {
12856
+ type: type,
12857
+ val: data.val,
12858
+ goodValue: data.goodValue
12859
+ };
12860
+ setTableSelect(['2', '4'].includes(data.val));
12861
+ if (['1', '3'].includes(data.val)) {
12862
+ var _valueRef$current3, _valueRef$current4;
12863
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueSelectListReturn, {
12864
+ 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]) || []),
12865
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
12866
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12867
+ });
12868
+ }
12869
+ });
12870
+ //退货
12871
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
12872
+ if (disabled) return;
12873
+ withInfo.current = {
12874
+ type: type,
12875
+ val: data.val,
12876
+ goodValue: data.goodValue
12877
+ };
12878
+ setTableSelect(['2', '4'].includes(data.val));
12879
+ if (['1', '3'].includes(data.val)) {
12880
+ var _valueRef$current5, _valueRef$current6;
12881
+ pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
12882
+ 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]) || []),
12883
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
12884
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12885
+ });
12886
+ }
12887
+ });
12888
+ pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
12889
+ // console.log(data);
12890
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
12891
+ shopCode: data.shopCode
12892
+ }));
12893
+ });
12894
+ return function () {
12895
+ pubsub.clearAllSubscriptions();
12896
+ };
12897
+ }, [disabled]);
12898
+ var _onSelect = function onSelect(list) {
12899
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
12900
+ if (disabled) return;
12901
+ var newList = cloneDeep(list);
12902
+ var typeMap = _defineProperty({
12903
+ // type: componentMap[compType].eventNameMap.selectList,
12904
+ // returnType: componentMap[compType].eventNameMap.returnSelectList,
12905
+ // reissueType: componentMap[compType].eventNameMap.reissueSelectList,
12906
+ type: componentMap$1[compType].eventNameMap.selectList
12907
+ }, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
12908
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
12909
+ // console.log('onSelect', type, withInfo.current, newList);
12910
+ pubsub.publish(type, {
12911
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
12912
+ list: newList.map(function (item) {
12913
+ item.canDelete = true;
12914
+ return item;
12915
+ }),
12916
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
12917
+ goodValue: withInfo.current.goodValue
12918
+ });
12919
+ };
12920
+ var _onDelete = function onDelete(item) {
12921
+ var deleteId = item === null || item === void 0 ? void 0 : item.specId;
12922
+ pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
12923
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
12924
+ pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
12925
+ };
12926
+ var changeHandle = function changeHandle(list) {
12927
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
12928
+ };
12929
+ return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
12930
+ key: componentMap$1[compType].key
12931
+ }, props), {}, {
12932
+ disabled: disabled,
12933
+ value: value === null || value === void 0 ? void 0 : value[componentMap$1[compType].key],
12934
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
12935
+ 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),
12936
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
12937
+ onSelect: function onSelect(list) {
12938
+ return _onSelect(list);
12939
+ },
12940
+ onDelete: function onDelete(item) {
12941
+ return _onDelete(item);
12942
+ },
12943
+ onChange: function onChange(val) {
12944
+ return changeHandle(val);
12945
+ }
12946
+ }));
12947
+ };
12948
+
12104
12949
  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
12950
  styleInject(css_248z$a);
12106
12951
 
12107
12952
  var TabPane$1 = Tabs.TabPane;
12108
12953
  var Option$2 = Select.Option;
12109
12954
  var Search$1 = Input.Search;
12110
- var GoodsModal$3 = function GoodsModal(props) {
12955
+ var GoodsModal$4 = function GoodsModal(props) {
12111
12956
  var onSubmit = props.onSubmit,
12112
12957
  _onCancel = props.onCancel,
12113
12958
  visible = props.visible,
@@ -12558,7 +13403,7 @@ var Goods$1 = function Goods(props, ref) {
12558
13403
  };
12559
13404
  return /*#__PURE__*/React.createElement("div", {
12560
13405
  className: "goodsBox"
12561
- }, /*#__PURE__*/React.createElement(GoodsModal$3, {
13406
+ }, /*#__PURE__*/React.createElement(GoodsModal$4, {
12562
13407
  visible: visible,
12563
13408
  onSubmit: onSubmit,
12564
13409
  type: type,
@@ -12863,4 +13708,4 @@ var CalculationInput = function CalculationInput(props) {
12863
13708
  }, config === null || config === void 0 ? void 0 : config.unit));
12864
13709
  };
12865
13710
 
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 };
13711
+ 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 };