@bit-sun/business-component 1.1.23 → 1.1.26

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.
Files changed (33) hide show
  1. package/dist/components/Business/CommodityEntry/index.d.ts +2 -0
  2. package/dist/components/{SearchSelect/business → Business/SearchSelect}/BusinessUtils.d.ts +1 -0
  3. package/dist/components/Business/SearchSelect/common.d.ts +13 -0
  4. package/dist/components/Business/SearchSelect/index.d.ts +3 -0
  5. package/dist/components/Business/SearchSelect/utils.d.ts +4 -0
  6. package/dist/components/{DataValidation → Functional/DataValidation}/index.d.ts +0 -0
  7. package/dist/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.d.ts +0 -0
  8. package/dist/components/{SearchSelect → Functional/SearchSelect}/index.d.ts +0 -0
  9. package/dist/index.d.ts +5 -4
  10. package/dist/index.esm.js +948 -145
  11. package/dist/index.js +948 -144
  12. package/package.json +1 -1
  13. package/src/components/Business/CommodityEntry/index.md +69 -0
  14. package/src/components/Business/CommodityEntry/index.tsx +75 -0
  15. package/src/components/Business/SearchSelect/BusinessUtils.ts +888 -0
  16. package/src/components/Business/SearchSelect/common.ts +34 -0
  17. package/src/components/Business/SearchSelect/index.md +906 -0
  18. package/src/components/Business/SearchSelect/index.tsx +35 -0
  19. package/src/components/Business/SearchSelect/utils.ts +74 -0
  20. package/src/components/{DataValidation → Functional/DataValidation}/index.less +0 -0
  21. package/src/components/{DataValidation → Functional/DataValidation}/index.md +3 -3
  22. package/src/components/{DataValidation → Functional/DataValidation}/index.tsx +1 -1
  23. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.less +0 -0
  24. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.md +3 -3
  25. package/src/components/{QueryMutipleInput → Functional/QueryMutipleInput}/index.tsx +0 -0
  26. package/src/components/{SearchSelect → Functional/SearchSelect}/index.less +0 -0
  27. package/src/components/{SearchSelect → Functional/SearchSelect}/index.md +14 -11
  28. package/src/components/{SearchSelect → Functional/SearchSelect}/index.tsx +225 -105
  29. package/src/index.ts +5 -4
  30. package/dist/components/SearchSelect/business/BusinessSearchSelect.d.ts +0 -2
  31. package/src/components/SearchSelect/business/BusinessSearchSelect.tsx +0 -25
  32. package/src/components/SearchSelect/business/BusinessUtils.ts +0 -464
  33. package/src/components/SearchSelect/business/index.md +0 -181
package/dist/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import axios from 'axios';
2
- import React, { createContext, useContext, useEffect, forwardRef, createElement, useState } from 'react';
3
- import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect } from 'antd';
2
+ import React, { createContext, useContext, useEffect, forwardRef, createElement, useState, useMemo, useRef } from 'react';
3
+ import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag } from 'antd';
4
4
  import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
5
5
  import classNames from 'classnames';
6
6
  import _ from 'loadsh';
@@ -78,14 +78,14 @@ function _inherits(subClass, superClass) {
78
78
  throw new TypeError("Super expression must either be null or a function");
79
79
  }
80
80
 
81
- subClass.prototype = Object.create(superClass && superClass.prototype, {
82
- constructor: {
83
- value: subClass,
84
- writable: true,
85
- configurable: true
86
- }
87
- });
88
81
  Object.defineProperty(subClass, "prototype", {
82
+ value: Object.create(superClass && superClass.prototype, {
83
+ constructor: {
84
+ value: subClass,
85
+ writable: true,
86
+ configurable: true
87
+ }
88
+ }),
89
89
  writable: false
90
90
  });
91
91
  if (superClass) _setPrototypeOf(subClass, superClass);
@@ -1265,14 +1265,6 @@ function injectCSS(css) {
1265
1265
  return styleNode;
1266
1266
  }
1267
1267
  var containerCache = new Map();
1268
-
1269
- function findExistNode(key) {
1270
- var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1271
- var container = getContainer(option);
1272
- return Array.from(containerCache.get(container).children).find(function (node) {
1273
- return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1274
- });
1275
- }
1276
1268
  function updateCSS(css, key) {
1277
1269
  var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
1278
1270
  var container = getContainer(option); // Get real parent
@@ -1284,7 +1276,9 @@ function updateCSS(css, key) {
1284
1276
  parentNode.removeChild(placeholderStyle);
1285
1277
  }
1286
1278
 
1287
- var existNode = findExistNode(key, option);
1279
+ var existNode = Array.from(containerCache.get(container).children).find(function (node) {
1280
+ return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1281
+ });
1288
1282
 
1289
1283
  if (existNode) {
1290
1284
  var _option$csp3, _option$csp4;
@@ -1942,7 +1936,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1942
1936
  _this.getData = function () {
1943
1937
  console.time();
1944
1938
  var sheetData = luckysheet.getSheetData();
1945
- var data = sheetData.filter(function (item) {
1939
+ var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
1946
1940
  return item[0];
1947
1941
  }).map(function (item) {
1948
1942
  var obj = {};
@@ -2378,62 +2372,6 @@ function ToCDB(str) {
2378
2372
  return tmp;
2379
2373
  }
2380
2374
 
2381
- /*
2382
- * @Description:
2383
- * @Author: rodchen
2384
- * @Date: 2022-01-14 14:12:01
2385
- * @LastEditTime: 2022-01-14 17:17:26
2386
- * @LastEditors: rodchen
2387
- */
2388
- var index = (function (storageKeyString) {
2389
- var seconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
2390
- var tipsCallFunction = arguments.length > 2 ? arguments[2] : undefined;
2391
- if (typeof seconds !== 'number') throw new Error('seconds should be number');
2392
- var cacheValue = getStorageVale(storageKeyString);
2393
-
2394
- if (document.hidden !== undefined) {
2395
- document.addEventListener('visibilitychange', function () {
2396
- if (!document.hidden) {
2397
- var currentValue = getStorageVale(storageKeyString);
2398
-
2399
- if (currentValue !== cacheValue) {
2400
- if (tipsCallFunction && typeof tipsCallFunction === 'function') {
2401
- tipsCallFunction();
2402
- } else {
2403
- window.alert('检测新用户登录,当前页面会在2s之后刷新!');
2404
- }
2405
-
2406
- setTimeout(function () {
2407
- window.location.reload();
2408
- }, seconds * 1000);
2409
- }
2410
- }
2411
- });
2412
- }
2413
- });
2414
-
2415
- function getStorageVale(storageKeyString) {
2416
- var _storageKeyString$spl = storageKeyString.split('.'),
2417
- _storageKeyString$spl2 = _toArray(_storageKeyString$spl),
2418
- localstorage = _storageKeyString$spl2[0],
2419
- restKeyArrays = _storageKeyString$spl2.slice(1);
2420
-
2421
- var localStorageInfo = window.localStorage.getItem(localstorage);
2422
- if (!restKeyArrays.length) return localStorageInfo;
2423
- var returnVal = JSON.parse(localStorageInfo || '{}');
2424
-
2425
- for (var i = 0; i < restKeyArrays.length; i++) {
2426
- returnVal = returnVal[restKeyArrays[i]];
2427
- if (!returnVal) return '';
2428
-
2429
- if (typeof returnVal === 'string') {
2430
- return returnVal;
2431
- }
2432
- }
2433
-
2434
- return "";
2435
- }
2436
-
2437
2375
  var css_248z$2 = ".search_select_show {\n display: flex;\n}\n.search_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.search_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.search_select_wrapper {\n position: relative;\n display: flex;\n min-height: 60vh;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n}\n.search_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.search_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.search_select_wrapper_left {\n width: 28%;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-left: 20px;\n}\n.search_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.search_select_wrapper_right {\n width: 70%;\n margin-left: 1%;\n}\n.search_select_wrapper_right1 {\n width: 100%;\n margin-left: 20px;\n}\n.search_select_wrapper_right,\n.search_select_wrapper_right1 {\n overflow-x: auto;\n}\n.search_select_wrapper .select_list_columns {\n width: 100%;\n height: calc(60vh - 60px);\n overflow-y: auto;\n border: 1px solid #d8d8d8;\n}\n.search_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.search_select_wrapper .select_list_columns_formItems {\n padding: 0 20px;\n}\n.search_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px 0px;\n justify-content: flex-end;\n}\n.search_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.search_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 34px;\n line-height: 32px;\n background-color: #eee;\n margin-bottom: 10px;\n padding: 0 12px;\n}\n.search_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n";
2438
2376
  styleInject(css_248z$2);
2439
2377
 
@@ -2450,7 +2388,9 @@ var SearchSelect = function SearchSelect(props) {
2450
2388
  labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
2451
2389
  requestConfig = props.requestConfig,
2452
2390
  ctx = props.ctx,
2453
- sourceName = props.sourceName;
2391
+ sourceName = props.sourceName,
2392
+ _props$needModalTable = props.needModalTable,
2393
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable;
2454
2394
 
2455
2395
  var _ref = requestConfig || {},
2456
2396
  url = _ref.url,
@@ -2595,7 +2535,12 @@ var SearchSelect = function SearchSelect(props) {
2595
2535
  var _useState31 = useState({}),
2596
2536
  _useState32 = _slicedToArray(_useState31, 2),
2597
2537
  tableFormParams = _useState32[0],
2598
- setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
2538
+ setTableFormParams = _useState32[1];
2539
+
2540
+ var _useState33 = useState(false),
2541
+ _useState34 = _slicedToArray(_useState33, 2),
2542
+ tooltipVisible = _useState34[0],
2543
+ setTooltipVisible = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
2599
2544
 
2600
2545
 
2601
2546
  var getData = function getData() {
@@ -2614,6 +2559,101 @@ var SearchSelect = function SearchSelect(props) {
2614
2559
  fixedParam[item] = fixedParamVal;
2615
2560
  }
2616
2561
  });
2562
+ } // 数组对象处理,对带有特殊标记的name进行处理
2563
+
2564
+
2565
+ for (var key in params) {
2566
+ if (Object.prototype.hasOwnProperty.call(params, key)) {
2567
+ (function () {
2568
+ var element = params[key];
2569
+
2570
+ if (element && key.indexOf('*number*') >= 0) {
2571
+ var dataParams = key.split('*number*');
2572
+ dataParams.forEach(function (value, index) {
2573
+ params[value] = element[index];
2574
+ });
2575
+ delete params[key];
2576
+ } else if (element && key.indexOf('*address*') >= 0) {
2577
+ var _dataParams = key.split('*address*');
2578
+
2579
+ _dataParams.forEach(function (value, index) {
2580
+ params[value] = element.PCDCode[index];
2581
+ });
2582
+
2583
+ delete params[key];
2584
+ } else if (element && key.indexOf('*costType*') >= 0) {
2585
+ var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
2586
+
2587
+
2588
+ params[_dataParams2[0]] = element[1];
2589
+ delete params[key];
2590
+ } else if (element && key.indexOf('*fullDate*') >= 0) {
2591
+ var _dataParams3 = key.split('*fullDate*');
2592
+
2593
+ _dataParams3.forEach(function (value, index) {
2594
+ if (index === 0) {
2595
+ params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
2596
+ } else {
2597
+ params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
2598
+ }
2599
+ });
2600
+
2601
+ delete params[key];
2602
+ } else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
2603
+ var _dataParams4 = key.split('*checkBox*');
2604
+
2605
+ if (element) {
2606
+ params[_dataParams4[0]] = 0;
2607
+ }
2608
+
2609
+ delete params[key];
2610
+ } else if (element && key.indexOf('*cascader*') >= 0) {
2611
+ var _dataParams5 = key.split('*cascader*');
2612
+
2613
+ params[_dataParams5[0]] = element[element.length - 1];
2614
+ delete params[key];
2615
+ } else if (element && key.indexOf('*date*') >= 0) {
2616
+ var _dataParams6 = key.split('*date*');
2617
+
2618
+ _dataParams6.forEach(function (value, index) {
2619
+ if (index === 0) {
2620
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
2621
+ } else {
2622
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
2623
+ }
2624
+ });
2625
+
2626
+ delete params[key];
2627
+ } else if (element && key.indexOf('*') >= 0) {
2628
+ var _dataParams7 = key.split('*');
2629
+
2630
+ _dataParams7.forEach(function (value, index) {
2631
+ params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
2632
+ });
2633
+
2634
+ delete params[key];
2635
+ } else if (element && key.indexOf('_selectNumberRange') >= 0) {
2636
+ // key = xxxxx_selectNumberRange qp-xxxxx-gt
2637
+ var _dataParams8 = key.split('_selectNumberRange')[0];
2638
+
2639
+ if (params[key][0] === 'range') {
2640
+ if (params[key][1][0]) {
2641
+ params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
2642
+ }
2643
+
2644
+ if (params[key][1][1]) {
2645
+ params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
2646
+ }
2647
+ } else {
2648
+ params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
2649
+ }
2650
+
2651
+ delete params[key];
2652
+ } else if (Array.isArray(element)) {
2653
+ params[key] = element.join(',');
2654
+ }
2655
+ })();
2656
+ }
2617
2657
  }
2618
2658
 
2619
2659
  var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
@@ -3004,11 +3044,57 @@ var SearchSelect = function SearchSelect(props) {
3004
3044
  }
3005
3045
  };
3006
3046
 
3047
+ var TooltipContent = function TooltipContent() {
3048
+ if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
3049
+ var listSelected = JSON.parse(JSON.stringify(items)).filter(function (i) {
3050
+ return value.find(function (item) {
3051
+ return item === i.value;
3052
+ });
3053
+ }) || [];
3054
+
3055
+ var _onClose = function onClose(e, item) {
3056
+ e.preventDefault();
3057
+ var newValue = JSON.parse(JSON.stringify(value)).filter(function (i) {
3058
+ return i !== item.value;
3059
+ });
3060
+ onChange(newValue);
3061
+ };
3062
+
3063
+ return (listSelected === null || listSelected === void 0 ? void 0 : listSelected.length) && listSelected.map(function (i) {
3064
+ return /*#__PURE__*/React.createElement(Tag, {
3065
+ closable: true,
3066
+ onClose: function onClose(e) {
3067
+ return _onClose(e, i);
3068
+ },
3069
+ style: {
3070
+ marginRight: 3,
3071
+ background: '#f5f5f5',
3072
+ height: '24px',
3073
+ border: '1px solid #f0f0f0'
3074
+ }
3075
+ }, i.text);
3076
+ }) || '';
3077
+ } else {
3078
+ setTooltipVisible(false);
3079
+ }
3080
+
3081
+ return '';
3082
+ };
3083
+
3007
3084
  return /*#__PURE__*/React.createElement("div", {
3008
3085
  className: 'search_select'
3009
3086
  }, /*#__PURE__*/React.createElement("div", {
3010
3087
  className: "search_select_show",
3011
3088
  id: "search_select_div_".concat(uniqueValue)
3089
+ }, /*#__PURE__*/React.createElement(Tooltip, {
3090
+ title: TooltipContent,
3091
+ visible: tooltipVisible,
3092
+ trigger: 'hover',
3093
+ onVisibleChange: function onVisibleChange(visible) {
3094
+ if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
3095
+ setTooltipVisible(visible);
3096
+ }
3097
+ }
3012
3098
  }, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
3013
3099
  virtual: true,
3014
3100
  labelInValue: labelInValue,
@@ -3051,15 +3137,15 @@ var SearchSelect = function SearchSelect(props) {
3051
3137
  fontSize: '50px'
3052
3138
  }
3053
3139
  })), /*#__PURE__*/React.createElement("div", null, "\u65E0\u5339\u914D\u7ED3\u679C\uFF0C\u8BF7\u66F4\u6362\u5176\u4ED6\u5185\u5BB9\u518D\u8BD5")),
3054
- onPopupScroll: SelectScroll
3055
- }, currentSelectProps), {}, {
3056
- getPopupContainer: function getPopupContainer() {
3057
- return document.getElementById("search_select_div_".concat(uniqueValue));
3058
- },
3140
+ onPopupScroll: SelectScroll,
3059
3141
  style: {
3060
- width: 'calc(100% - 30px)'
3142
+ width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)'
3061
3143
  },
3062
3144
  placeholder: "\u8BF7\u9009\u62E9"
3145
+ }, currentSelectProps), {}, {
3146
+ getPopupContainer: function getPopupContainer() {
3147
+ return document.getElementById("search_select_div_".concat(uniqueValue));
3148
+ }
3063
3149
  }), items.map(function (item) {
3064
3150
  return /*#__PURE__*/React.createElement(Option, {
3065
3151
  key: item.value,
@@ -3068,7 +3154,7 @@ var SearchSelect = function SearchSelect(props) {
3068
3154
  text: "".concat(item.textShowKey, " ").concat(item.text),
3069
3155
  filterTxt: searchValue
3070
3156
  }));
3071
- })), /*#__PURE__*/React.createElement(Button, {
3157
+ }))), needModalTable && /*#__PURE__*/React.createElement(Button, {
3072
3158
  style: {
3073
3159
  width: '30px',
3074
3160
  padding: '2px',
@@ -3076,7 +3162,7 @@ var SearchSelect = function SearchSelect(props) {
3076
3162
  },
3077
3163
  onClick: showModal,
3078
3164
  type: "primary"
3079
- }, /*#__PURE__*/React.createElement(SearchOutlined$2, null))), /*#__PURE__*/React.createElement(Modal, {
3165
+ }, /*#__PURE__*/React.createElement(SearchOutlined$2, null))), needModalTable && isModalVisible && /*#__PURE__*/React.createElement(Modal, {
3080
3166
  width: '80%',
3081
3167
  title: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle,
3082
3168
  visible: isModalVisible,
@@ -3166,13 +3252,36 @@ var SearchSelect = function SearchSelect(props) {
3166
3252
  }), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
3167
3253
  };
3168
3254
 
3255
+ var shopFileType = [{
3256
+ text: "线上",
3257
+ value: 'online'
3258
+ }, {
3259
+ text: "线下",
3260
+ value: 'offline'
3261
+ }];
3262
+ var arrivalPaySupportList = [{
3263
+ text: "支持",
3264
+ value: 1
3265
+ }, {
3266
+ text: "不支持",
3267
+ value: 0
3268
+ }];
3269
+ var sharingType = [{
3270
+ text: "共享",
3271
+ value: '10'
3272
+ }, {
3273
+ text: "私有",
3274
+ value: '20'
3275
+ }];
3276
+
3169
3277
  var getDicData = function getDicData(dicCode) {
3170
3278
  var dicData = {};
3171
3279
 
3172
3280
  {
3173
3281
  var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
3174
3282
  dicData = storageDic[dicCode];
3175
- }
3283
+ } // @ts-ignore
3284
+
3176
3285
 
3177
3286
  if (!dicData || !dicData.length) ;
3178
3287
 
@@ -3185,6 +3294,7 @@ var getDictionarySource = function getDictionarySource(dicCode) {
3185
3294
 
3186
3295
  try {
3187
3296
  if (needConvertInterger) {
3297
+ // @ts-ignore
3188
3298
  dicData = dicData.map(function (item) {
3189
3299
  return _objectSpread2(_objectSpread2({}, item), {}, {
3190
3300
  value: parseFloat(item.value)
@@ -3198,7 +3308,8 @@ var getDictionarySource = function getDictionarySource(dicCode) {
3198
3308
 
3199
3309
  var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
3200
3310
  var dicData = getDicData(dicCode);
3201
- if (value === undefined) return '';
3311
+ if (value === undefined) return ''; // @ts-ignore
3312
+
3202
3313
  var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
3203
3314
  return item.value === value.toString();
3204
3315
  });
@@ -3228,11 +3339,14 @@ var loadSelectSource = function loadSelectSource(url, params) {
3228
3339
  });
3229
3340
  };
3230
3341
 
3342
+ var _getDictionarySource;
3343
+ var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
3344
+ var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
3231
3345
  function commonFun(type, prefixUrl) {
3232
3346
  // 默认type === 'supplier' 供应商选择器
3233
3347
  var requestConfig = {
3234
3348
  url: "".concat(prefixUrl.selectPrefix, "/supplier"),
3235
- filter: 'qp-nameAndCode-like',
3349
+ filter: 'qp-name,code-orGroup,like',
3236
3350
  otherParams: {
3237
3351
  sorter: 'desc-id'
3238
3352
  } // 默认参数
@@ -3291,15 +3405,15 @@ function commonFun(type, prefixUrl) {
3291
3405
  changeSearchForm[changePosition].field.props.treeData = formatData;
3292
3406
  };
3293
3407
 
3294
- var tableSearchForm = [];
3408
+ var tableSearchForm = []; // 供应商选择器
3295
3409
 
3296
3410
  if (type === 'supplier') {
3297
3411
  tableSearchForm = [{
3298
3412
  name: 'qp-name-like',
3299
- label: '客户名称'
3413
+ label: '供应商名称'
3300
3414
  }, {
3301
3415
  name: 'qp-code-like',
3302
- label: '客户编码'
3416
+ label: '供应商编码'
3303
3417
  }, {
3304
3418
  name: 'qp-conglomerateCode-in',
3305
3419
  type: 'select',
@@ -3361,7 +3475,7 @@ function commonFun(type, prefixUrl) {
3361
3475
  name: 'qp-sharingType-eq',
3362
3476
  type: 'select',
3363
3477
  label: '共享类型',
3364
- initialSource: getDictionarySource('UC000013')
3478
+ initialSource: sharingTypeDataList
3365
3479
  }];
3366
3480
  Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3367
3481
  pageSize: 5000,
@@ -3385,10 +3499,10 @@ function commonFun(type, prefixUrl) {
3385
3499
  modalTableTitle: '选择供应商',
3386
3500
  tableSearchForm: tableSearchForm,
3387
3501
  tableColumns: [{
3388
- title: '客户编码',
3502
+ title: '供应商编码',
3389
3503
  dataIndex: 'code'
3390
3504
  }, {
3391
- title: '客户名称',
3505
+ title: '供应商名称',
3392
3506
  dataIndex: 'name'
3393
3507
  }, {
3394
3508
  title: '归属集团',
@@ -3403,15 +3517,20 @@ function commonFun(type, prefixUrl) {
3403
3517
  title: '共享类型',
3404
3518
  dataIndex: 'sharingType',
3405
3519
  render: function render(text) {
3406
- return getDictionaryTextByValue('UC000013', text);
3520
+ var _sharingType$find;
3521
+
3522
+ return hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : (_sharingType$find = sharingType.find(function (i) {
3523
+ return i.value === text;
3524
+ })) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
3407
3525
  }
3408
3526
  }]
3409
- }; // 商品选择器
3527
+ };
3528
+ var needModalTable = true; // 商品选择器
3410
3529
 
3411
3530
  if (type === 'skuCommodity') {
3412
3531
  requestConfig = {
3413
3532
  url: "".concat(prefixUrl.selectPrefix, "/sku"),
3414
- filter: 'qp-nameAndCode-like',
3533
+ filter: 'qp-name,skuCode-orGroup,like',
3415
3534
  mappingTextField: 'name',
3416
3535
  mappingValueField: 'skuCode',
3417
3536
  otherParams: {
@@ -3543,17 +3662,18 @@ function commonFun(type, prefixUrl) {
3543
3662
  dataIndex: 'barCode'
3544
3663
  }]
3545
3664
  };
3546
- } // 仓库选择器
3665
+ } // 仓库选择器(物理、逻辑仓)
3547
3666
 
3548
3667
 
3549
3668
  if (type === 'physicalWarehouse') {
3550
3669
  requestConfig = {
3551
3670
  url: "".concat(prefixUrl.selectPrefix, "/physicalWarehouse"),
3552
- filter: 'qp-nameAndCode-like',
3671
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
3553
3672
  mappingTextField: 'physicalWarehouseName',
3554
3673
  mappingTextShowKeyField: 'physicalWarehouseCode',
3555
3674
  mappingValueField: 'id',
3556
3675
  otherParams: {
3676
+ 'qp-isEnable-eq': 1,
3557
3677
  sorter: 'desc-id'
3558
3678
  },
3559
3679
  sourceName: 'warehouseIds'
@@ -3588,11 +3708,6 @@ function commonFun(type, prefixUrl) {
3588
3708
  }
3589
3709
  }
3590
3710
  }
3591
- }, {
3592
- name: 'qp-isEnable-eq',
3593
- type: 'select',
3594
- label: '物理仓状态',
3595
- initialSource: getDictionarySource('SC00001')
3596
3711
  }];
3597
3712
  Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3598
3713
  pageSize: 5000,
@@ -3616,12 +3731,6 @@ function commonFun(type, prefixUrl) {
3616
3731
  render: function render(text) {
3617
3732
  return getDictionaryTextByValue('SC00002', text);
3618
3733
  }
3619
- }, {
3620
- title: '物理仓状态',
3621
- dataIndex: 'isEnable',
3622
- render: function render(text) {
3623
- return getDictionaryTextByValue('SC00001', text);
3624
- }
3625
3734
  }, {
3626
3735
  title: '所属公司',
3627
3736
  dataIndex: 'companyName'
@@ -3632,11 +3741,12 @@ function commonFun(type, prefixUrl) {
3632
3741
  if (type === 'realWarehouse') {
3633
3742
  requestConfig = {
3634
3743
  url: "".concat(prefixUrl.selectPrefix, "/realWarehouse"),
3635
- filter: 'qp-nameAndCode-like',
3744
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
3636
3745
  mappingTextField: 'realWarehouseName',
3637
3746
  mappingTextShowKeyField: 'realWarehouseCode',
3638
3747
  mappingValueField: 'id',
3639
3748
  otherParams: {
3749
+ 'qp-isEnable-eq': 1,
3640
3750
  sorter: 'desc-id'
3641
3751
  },
3642
3752
  sourceName: 'warehouseIds'
@@ -3652,11 +3762,6 @@ function commonFun(type, prefixUrl) {
3652
3762
  type: 'select',
3653
3763
  label: '逻辑仓类型',
3654
3764
  initialSource: getDictionarySource('SC00004')
3655
- }, {
3656
- name: 'qp-isEnable-eq',
3657
- type: 'select',
3658
- label: '逻辑仓状态',
3659
- initialSource: getDictionarySource('SC00001')
3660
3765
  }];
3661
3766
  modalTableProps = {
3662
3767
  modalTableTitle: '选择逻辑仓',
@@ -3673,41 +3778,739 @@ function commonFun(type, prefixUrl) {
3673
3778
  render: function render(text) {
3674
3779
  return getDictionaryTextByValue('SC00004', text);
3675
3780
  }
3676
- }, {
3677
- title: '逻辑仓状态',
3678
- dataIndex: 'isEnable',
3679
- render: function render(text) {
3680
- return getDictionaryTextByValue('SC00001', text);
3681
- }
3682
3781
  }]
3683
3782
  };
3684
- }
3783
+ } // 仓库选择器(虚拟、渠道仓)(无弹窗)
3685
3784
 
3686
- return {
3687
- modalTableProps: modalTableProps,
3688
- requestConfig: requestConfig
3689
- };
3690
- }
3691
3785
 
3692
- var BusinessSearchSelect = function BusinessSearchSelect(props) {
3693
- var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
3694
- var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
3695
- selectPrefix: '/bop/api',
3696
- formSelectFix: '/bop/api'
3697
- };
3786
+ if (type === 'virtualWarehouse') {
3787
+ requestConfig = {
3788
+ url: "".concat(prefixUrl.selectPrefix, "/virtualWarehouse"),
3789
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
3790
+ mappingTextField: 'virtualWarehouseName',
3791
+ mappingTextShowKeyField: 'virtualWarehouseCode',
3792
+ mappingValueField: 'id',
3793
+ otherParams: {
3794
+ 'qp-isEnable-eq': 1,
3795
+ sorter: 'desc-id'
3796
+ },
3797
+ sourceName: 'warehouseIds'
3798
+ };
3799
+ needModalTable = false;
3800
+ }
3698
3801
 
3699
- var _commonFun = commonFun(businessType, prefixUrl),
3700
- requestConfig = _commonFun.requestConfig,
3701
- modalTableProps = _commonFun.modalTableProps;
3802
+ if (type === 'channelWarehouse') {
3803
+ requestConfig = {
3804
+ url: "".concat(prefixUrl.selectPrefix, "/channelWarehouse"),
3805
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
3806
+ mappingTextField: 'channelWarehouseName',
3807
+ mappingTextShowKeyField: 'channelWarehouseCode',
3808
+ mappingValueField: 'id',
3809
+ otherParams: {
3810
+ 'qp-isEnable-eq': 1,
3811
+ sorter: 'desc-id'
3812
+ },
3813
+ sourceName: 'warehouseIds'
3814
+ };
3815
+ needModalTable = false;
3816
+ } // 客户选择器
3702
3817
 
3703
- var currentProps = _objectSpread2(_objectSpread2({
3704
- requestConfig: requestConfig
3705
- }, props), {}, {
3706
- modalTableProps: modalTableProps
3707
- });
3708
3818
 
3709
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchSelect, _objectSpread2({}, currentProps)));
3710
- };
3819
+ if (type === 'customer') {
3820
+ requestConfig = {
3821
+ url: "".concat(prefixUrl.selectPrefix, "/uc/customer/v2"),
3822
+ filter: 'qp-name,code-orGroup,like',
3823
+ mappingTextField: 'name',
3824
+ mappingValueField: 'code',
3825
+ otherParams: {
3826
+ sorter: 'desc-id'
3827
+ },
3828
+ sourceName: 'customCode'
3829
+ };
3830
+ tableSearchForm = [{
3831
+ name: 'qp-name-like',
3832
+ label: '客户名称'
3833
+ }, {
3834
+ name: 'qp-code-like',
3835
+ label: '客户编码'
3836
+ }, {
3837
+ name: 'qp-conglomerateCode-in',
3838
+ type: 'select',
3839
+ label: '归属集团',
3840
+ field: {
3841
+ type: 'select',
3842
+ props: {
3843
+ mode: 'multiple',
3844
+ notFoundContent: '暂无数据',
3845
+ allowClear: true,
3846
+ showSearch: true,
3847
+ showArrow: true,
3848
+ maxTagCount: 1,
3849
+ optionFilterProp: 'children',
3850
+ filterOption: function filterOption(input, option) {
3851
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3852
+ }
3853
+ }
3854
+ }
3855
+ }, {
3856
+ name: 'qp-accountingCode-in',
3857
+ type: 'select',
3858
+ label: '归属核算主体',
3859
+ field: {
3860
+ type: 'select',
3861
+ props: {
3862
+ mode: 'multiple',
3863
+ notFoundContent: '暂无数据',
3864
+ allowClear: true,
3865
+ showSearch: true,
3866
+ showArrow: true,
3867
+ maxTagCount: 1,
3868
+ optionFilterProp: 'children',
3869
+ filterOption: function filterOption(input, option) {
3870
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3871
+ }
3872
+ }
3873
+ }
3874
+ }, {
3875
+ name: 'qp-companyCode-in',
3876
+ type: 'select',
3877
+ label: '归属法人公司',
3878
+ field: {
3879
+ type: 'select',
3880
+ props: {
3881
+ mode: 'multiple',
3882
+ notFoundContent: '暂无数据',
3883
+ allowClear: true,
3884
+ showSearch: true,
3885
+ showArrow: true,
3886
+ maxTagCount: 1,
3887
+ optionFilterProp: 'children',
3888
+ filterOption: function filterOption(input, option) {
3889
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3890
+ }
3891
+ }
3892
+ }
3893
+ }, {
3894
+ name: 'qp-sharingType-eq',
3895
+ type: 'select',
3896
+ label: '共享类型',
3897
+ initialSource: sharingTypeDataList
3898
+ }];
3899
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3900
+ pageSize: 5000,
3901
+ currentPage: 1,
3902
+ 'qp-companyType-eq': '30'
3903
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
3904
+ pageSize: 5000,
3905
+ currentPage: 1
3906
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3907
+ pageSize: 5000,
3908
+ currentPage: 1,
3909
+ 'qp-companyType-eq': '20'
3910
+ })]).then(function (x) {
3911
+ formatSource(x, 0, 2, tableSearchForm);
3912
+ formatSource(x, 1, 3, tableSearchForm);
3913
+ formatSource(x, 2, 4, tableSearchForm);
3914
+ });
3915
+ modalTableProps = {
3916
+ modalTableTitle: '选择客户',
3917
+ tableSearchForm: tableSearchForm,
3918
+ tableColumns: [{
3919
+ title: '客户编码',
3920
+ dataIndex: 'code'
3921
+ }, {
3922
+ title: '客户名称',
3923
+ dataIndex: 'name'
3924
+ }, {
3925
+ title: '归属集团',
3926
+ dataIndex: 'conglomerateName'
3927
+ }, {
3928
+ title: '归属法人公司',
3929
+ dataIndex: 'legalCompanyName'
3930
+ }, {
3931
+ title: '归属核算主体',
3932
+ dataIndex: 'accountingName'
3933
+ }, {
3934
+ title: '共享类型',
3935
+ dataIndex: 'sharingType',
3936
+ render: function render(text) {
3937
+ var _sharingType$find2;
3938
+
3939
+ return hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : (_sharingType$find2 = sharingType.find(function (i) {
3940
+ return i.value === text;
3941
+ })) === null || _sharingType$find2 === void 0 ? void 0 : _sharingType$find2.text;
3942
+ }
3943
+ }]
3944
+ };
3945
+ } // 店铺选择器
3946
+
3947
+
3948
+ if (type === 'shopFile') {
3949
+ requestConfig = {
3950
+ url: "".concat(prefixUrl.selectPrefix, "/store"),
3951
+ filter: 'qp-name,code-orGroup,like',
3952
+ mappingTextField: 'name',
3953
+ mappingValueField: 'code',
3954
+ otherParams: {
3955
+ sorter: 'desc-id'
3956
+ },
3957
+ sourceName: 'code'
3958
+ };
3959
+ tableSearchForm = [{
3960
+ name: 'qp-name-like',
3961
+ label: '店铺名称'
3962
+ }, {
3963
+ name: 'qp-code-like',
3964
+ label: '店铺编码'
3965
+ }, {
3966
+ name: 'qp-conglomerateCode-in',
3967
+ type: 'select',
3968
+ label: '归属集团',
3969
+ field: {
3970
+ type: 'select',
3971
+ props: {
3972
+ mode: 'multiple',
3973
+ notFoundContent: '暂无数据',
3974
+ allowClear: true,
3975
+ showSearch: true,
3976
+ showArrow: true,
3977
+ maxTagCount: 1,
3978
+ optionFilterProp: 'children',
3979
+ filterOption: function filterOption(input, option) {
3980
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3981
+ }
3982
+ }
3983
+ }
3984
+ }, {
3985
+ name: 'qp-companyCode-in',
3986
+ type: 'select',
3987
+ label: '归属法人公司',
3988
+ field: {
3989
+ type: 'select',
3990
+ props: {
3991
+ mode: 'multiple',
3992
+ notFoundContent: '暂无数据',
3993
+ allowClear: true,
3994
+ showSearch: true,
3995
+ showArrow: true,
3996
+ maxTagCount: 1,
3997
+ optionFilterProp: 'children',
3998
+ filterOption: function filterOption(input, option) {
3999
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4000
+ }
4001
+ }
4002
+ }
4003
+ }, {
4004
+ name: 'qp-type-in',
4005
+ type: 'select',
4006
+ label: '店铺类型',
4007
+ initialSource: shopFileType
4008
+ }, {
4009
+ name: 'qp-plateformCode-in',
4010
+ type: 'select',
4011
+ label: '店铺来源',
4012
+ field: {
4013
+ type: 'select',
4014
+ props: {
4015
+ mode: 'multiple',
4016
+ notFoundContent: '暂无数据',
4017
+ allowClear: true,
4018
+ showSearch: true,
4019
+ showArrow: true,
4020
+ maxTagCount: 1,
4021
+ optionFilterProp: 'children',
4022
+ filterOption: function filterOption(input, option) {
4023
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4024
+ }
4025
+ }
4026
+ }
4027
+ }, {
4028
+ name: 'qp-accountingCode-in',
4029
+ type: 'select',
4030
+ label: '归属核算主体',
4031
+ field: {
4032
+ type: 'select',
4033
+ props: {
4034
+ mode: 'multiple',
4035
+ notFoundContent: '暂无数据',
4036
+ allowClear: true,
4037
+ showSearch: true,
4038
+ showArrow: true,
4039
+ maxTagCount: 1,
4040
+ optionFilterProp: 'children',
4041
+ filterOption: function filterOption(input, option) {
4042
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4043
+ }
4044
+ }
4045
+ }
4046
+ }];
4047
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
4048
+ pageSize: 5000,
4049
+ currentPage: 1,
4050
+ 'qp-companyType-eq': '30'
4051
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
4052
+ pageSize: 5000,
4053
+ currentPage: 1,
4054
+ 'qp-companyType-eq': '20'
4055
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
4056
+ // pageSize: 5000,
4057
+ // currentPage: 1,
4058
+ 'qp-status-eq': '1'
4059
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
4060
+ pageSize: 5000,
4061
+ currentPage: 1
4062
+ })]).then(function (x) {
4063
+ formatSource(x, 0, 2, tableSearchForm);
4064
+ formatSource(x, 1, 3, tableSearchForm);
4065
+ formatSource(x, 2, 5, tableSearchForm);
4066
+ formatSource(x, 3, 6, tableSearchForm);
4067
+ });
4068
+ modalTableProps = {
4069
+ modalTableTitle: '选择店铺',
4070
+ tableSearchForm: tableSearchForm,
4071
+ tableColumns: [{
4072
+ title: '店铺编码',
4073
+ dataIndex: 'code'
4074
+ }, {
4075
+ title: '店铺名称',
4076
+ dataIndex: 'name'
4077
+ }, {
4078
+ title: '归属集团',
4079
+ dataIndex: 'conglomerateName'
4080
+ }, {
4081
+ title: '归属法人公司',
4082
+ dataIndex: 'companyName'
4083
+ }, {
4084
+ title: '店铺类型',
4085
+ dataIndex: 'type',
4086
+ render: function render(text) {
4087
+ var _shopFileType$find;
4088
+
4089
+ return (_shopFileType$find = shopFileType.find(function (i) {
4090
+ return i.value === text;
4091
+ })) === null || _shopFileType$find === void 0 ? void 0 : _shopFileType$find.text;
4092
+ }
4093
+ }, {
4094
+ title: '店铺来源',
4095
+ dataIndex: 'platformName'
4096
+ }, {
4097
+ title: '归属核算主体',
4098
+ dataIndex: 'accountingName'
4099
+ }]
4100
+ };
4101
+ } // 核算主体选择器(无弹窗)
4102
+
4103
+
4104
+ if (type === 'accountingSubject') {
4105
+ requestConfig = {
4106
+ url: "".concat(prefixUrl.selectPrefix, "/accountingSubject"),
4107
+ filter: 'qp-name,code-orGroup,like',
4108
+ mappingTextField: 'name',
4109
+ mappingTextShowKeyField: 'code',
4110
+ mappingValueField: 'id',
4111
+ otherParams: {
4112
+ sorter: 'desc-id'
4113
+ },
4114
+ sourceName: 'accountingSubjectCode'
4115
+ };
4116
+ needModalTable = false;
4117
+ } // 库存组织选择器(无弹窗)
4118
+
4119
+
4120
+ if (type === 'inventoryOrg') {
4121
+ requestConfig = {
4122
+ url: "".concat(prefixUrl.selectPrefix, "/inventoryOrg"),
4123
+ filter: 'qp-name,code-orGroup,like',
4124
+ mappingTextField: 'name',
4125
+ mappingTextShowKeyField: 'code',
4126
+ mappingValueField: 'id',
4127
+ otherParams: {
4128
+ sorter: 'desc-id'
4129
+ },
4130
+ sourceName: 'inventoryOrgCode'
4131
+ };
4132
+ needModalTable = false;
4133
+ } // 法人公司选择器(无弹窗)
4134
+
4135
+
4136
+ if (type === 'corporationCompany') {
4137
+ requestConfig = {
4138
+ url: "".concat(prefixUrl.selectPrefix, "/company"),
4139
+ filter: 'qp-name,code-orGroup,like',
4140
+ mappingTextField: 'name',
4141
+ mappingTextShowKeyField: 'code',
4142
+ mappingValueField: 'id',
4143
+ otherParams: {
4144
+ sorter: 'desc-id'
4145
+ },
4146
+ sourceName: 'corporationCompany'
4147
+ };
4148
+ needModalTable = false;
4149
+ } // 员工选择器
4150
+
4151
+
4152
+ if (type === 'employee') {
4153
+ requestConfig = {
4154
+ url: "".concat(prefixUrl.selectPrefix, "/employee/v2"),
4155
+ filter: 'qp-name,employeeNumber-orGroup,like',
4156
+ mappingTextField: 'name',
4157
+ mappingTextShowKeyField: 'employeeNumber',
4158
+ mappingValueField: 'employeeNumber',
4159
+ otherParams: {
4160
+ 'qp-enable-eq': 10,
4161
+ sorter: 'desc-id'
4162
+ },
4163
+ sourceName: 'employeeNumber'
4164
+ };
4165
+ tableSearchForm = [{
4166
+ name: 'qp-name-like',
4167
+ label: '员工名称'
4168
+ }, {
4169
+ name: 'qp-employeeNumber-like',
4170
+ label: '员工编码'
4171
+ }, {
4172
+ name: 'qp-companyCode-in',
4173
+ type: 'select',
4174
+ label: '所属公司',
4175
+ field: {
4176
+ type: 'select',
4177
+ props: {
4178
+ mode: 'multiple',
4179
+ notFoundContent: '暂无数据',
4180
+ allowClear: true,
4181
+ showSearch: true,
4182
+ showArrow: true,
4183
+ maxTagCount: 1,
4184
+ optionFilterProp: 'children',
4185
+ filterOption: function filterOption(input, option) {
4186
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4187
+ }
4188
+ }
4189
+ }
4190
+ }, {
4191
+ name: 'qp-email-like',
4192
+ label: '邮箱'
4193
+ }, {
4194
+ name: 'qp-officeTelephone-like',
4195
+ label: '手机号'
4196
+ }];
4197
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
4198
+ pageSize: 5000,
4199
+ currentPage: 1,
4200
+ 'qp-companyType-eq': 20
4201
+ })]).then(function (x) {
4202
+ formatSource(x, 0, 2, tableSearchForm);
4203
+ });
4204
+ modalTableProps = {
4205
+ modalTableTitle: '选择员工',
4206
+ tableSearchForm: tableSearchForm,
4207
+ tableColumns: [{
4208
+ title: '员工编码',
4209
+ dataIndex: 'employeeNumber'
4210
+ }, {
4211
+ title: '员工名称',
4212
+ dataIndex: 'name'
4213
+ }, {
4214
+ title: '所属公司',
4215
+ dataIndex: 'companyName'
4216
+ }, {
4217
+ title: '邮箱',
4218
+ dataIndex: 'email'
4219
+ }, {
4220
+ title: '手机号',
4221
+ dataIndex: 'officeTelephone'
4222
+ }]
4223
+ };
4224
+ } // 配送方式选择器
4225
+
4226
+
4227
+ if (type === 'deliveryMode') {
4228
+ requestConfig = {
4229
+ url: "".concat(prefixUrl.selectPrefix, "/deliveryMode"),
4230
+ filter: 'qp-name,code-orGroup,like',
4231
+ mappingTextField: 'name',
4232
+ mappingTextShowKeyField: 'code',
4233
+ mappingValueField: 'code',
4234
+ otherParams: {
4235
+ sorter: 'desc-id'
4236
+ },
4237
+ sourceName: 'deliveryModeCode'
4238
+ };
4239
+ tableSearchForm = [{
4240
+ name: 'qp-name-like',
4241
+ label: '配送方式名称'
4242
+ }, {
4243
+ name: 'qp-code-like',
4244
+ label: '配送方式编码'
4245
+ }, {
4246
+ name: 'qp-logisCompanyCode-in',
4247
+ type: 'select',
4248
+ label: '所属物流商',
4249
+ field: {
4250
+ type: 'select',
4251
+ props: {
4252
+ mode: 'multiple',
4253
+ notFoundContent: '暂无数据',
4254
+ allowClear: true,
4255
+ showSearch: true,
4256
+ showArrow: true,
4257
+ maxTagCount: 1,
4258
+ optionFilterProp: 'children',
4259
+ filterOption: function filterOption(input, option) {
4260
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4261
+ }
4262
+ }
4263
+ }
4264
+ }, {
4265
+ name: 'qp-recordChannnelCode-in',
4266
+ type: 'select',
4267
+ label: '单号获取通道',
4268
+ initialSource: getDictionarySource('BSC00004')
4269
+ }, {
4270
+ name: 'qp-arrivalPaySupport-in',
4271
+ type: 'select',
4272
+ label: '是否支持到付',
4273
+ initialSource: arrivalPaySupportList
4274
+ }, {
4275
+ name: 'qp-sheetTemplateCode-in',
4276
+ type: 'select',
4277
+ label: '面单模板',
4278
+ field: {
4279
+ type: 'select',
4280
+ props: {
4281
+ mode: 'multiple',
4282
+ notFoundContent: '暂无数据',
4283
+ allowClear: true,
4284
+ showSearch: true,
4285
+ showArrow: true,
4286
+ maxTagCount: 1,
4287
+ optionFilterProp: 'children',
4288
+ filterOption: function filterOption(input, option) {
4289
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4290
+ }
4291
+ }
4292
+ }
4293
+ }, {
4294
+ name: 'qp-remark-like',
4295
+ label: '备注'
4296
+ }];
4297
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
4298
+ pageSize: 5000,
4299
+ currentPage: 1
4300
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
4301
+ pageSize: 5000,
4302
+ currentPage: 1
4303
+ })]).then(function (x) {
4304
+ formatSource(x, 0, 2, tableSearchForm);
4305
+ formatSource(x, 1, 5, tableSearchForm);
4306
+ });
4307
+ modalTableProps = {
4308
+ modalTableTitle: '选择配送方式',
4309
+ tableSearchForm: tableSearchForm,
4310
+ tableColumns: [{
4311
+ title: '配送方式编码',
4312
+ dataIndex: 'code'
4313
+ }, {
4314
+ title: '配送方式名称',
4315
+ dataIndex: 'name'
4316
+ }, {
4317
+ title: '所属物流商',
4318
+ dataIndex: 'logisCompanyName'
4319
+ }, {
4320
+ dataIndex: 'recordChannnelCode',
4321
+ title: '单号获取通道',
4322
+ render: function render(text) {
4323
+ return getDictionaryTextByValue('BSC00004', text);
4324
+ }
4325
+ }, {
4326
+ dataIndex: 'arrivalPaySupport',
4327
+ title: '是否支持到付',
4328
+ render: function render(text) {
4329
+ var _arrivalPaySupportLis;
4330
+
4331
+ return (_arrivalPaySupportLis = arrivalPaySupportList.find(function (i) {
4332
+ return i.value === text;
4333
+ })) === null || _arrivalPaySupportLis === void 0 ? void 0 : _arrivalPaySupportLis.text;
4334
+ }
4335
+ }, {
4336
+ dataIndex: 'sheetTemplateName',
4337
+ title: '面单模板'
4338
+ }, {
4339
+ dataIndex: 'remark',
4340
+ title: '备注'
4341
+ }]
4342
+ };
4343
+ }
4344
+
4345
+ return {
4346
+ modalTableProps: modalTableProps,
4347
+ requestConfig: requestConfig,
4348
+ needModalTable: needModalTable
4349
+ };
4350
+ }
4351
+
4352
+ var MemoSearchSelect = /*#__PURE__*/React.memo(SearchSelect);
4353
+
4354
+ var BusinessSearchSelect = function BusinessSearchSelect(props) {
4355
+ var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
4356
+ var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
4357
+ selectPrefix: '/bop/api',
4358
+ formSelectFix: '/bop/api'
4359
+ };
4360
+
4361
+ var _commonFun = commonFun(businessType, prefixUrl),
4362
+ requestConfig = _commonFun.requestConfig,
4363
+ modalTableProps = _commonFun.modalTableProps,
4364
+ needModalTable = _commonFun.needModalTable;
4365
+
4366
+ var currentProps = useMemo(function () {
4367
+ return _objectSpread2(_objectSpread2({
4368
+ requestConfig: requestConfig
4369
+ }, props), {}, {
4370
+ needModalTable: needModalTable,
4371
+ modalTableProps: modalTableProps
4372
+ });
4373
+ }, []);
4374
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MemoSearchSelect, _objectSpread2({}, currentProps)));
4375
+ };
4376
+
4377
+ var index = /*#__PURE__*/React.memo(BusinessSearchSelect, function () {
4378
+ return true;
4379
+ });
4380
+
4381
+ var CommodityEntry = function CommodityEntry(props) {
4382
+ var dataValidationRef = useRef();
4383
+ var _props$buttonName = props.buttonName,
4384
+ buttonName = _props$buttonName === void 0 ? ' + 录入商品' : _props$buttonName,
4385
+ _props$modalTitle = props.modalTitle,
4386
+ modalTitle = _props$modalTitle === void 0 ? '录入商品' : _props$modalTitle,
4387
+ callbackHideModal = props.callbackHideModal,
4388
+ callbackHandleOk = props.callbackHandleOk,
4389
+ _props$columns = props.columns,
4390
+ columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
4391
+ _props$validDataUrl = props.validDataUrl,
4392
+ validDataUrl = _props$validDataUrl === void 0 ? "/bop/api/recordDetailImport/check" : _props$validDataUrl;
4393
+
4394
+ var _useState = useState({
4395
+ maskClosable: false,
4396
+ width: 800,
4397
+ visible: false,
4398
+ title: modalTitle,
4399
+ okText: '确定',
4400
+ cancelText: '取消',
4401
+ hideModal: function hideModal() {
4402
+ setModalProps(function () {
4403
+ return _objectSpread2(_objectSpread2({}, modalProps), {}, {
4404
+ visible: false
4405
+ });
4406
+ });
4407
+ callbackHideModal && callbackHideModal();
4408
+ }
4409
+ }),
4410
+ _useState2 = _slicedToArray(_useState, 2),
4411
+ modalProps = _useState2[0],
4412
+ setModalProps = _useState2[1];
4413
+
4414
+ var handleOk = function handleOk() {
4415
+ // 方法获取当前组件内部的数据,然后进行自身的业务操作
4416
+ var resultData = dataValidationRef.getValidateData();
4417
+
4418
+ if (!resultData.successData.length) {
4419
+ message.error("无校验通过数据,请校验数据");
4420
+ return;
4421
+ }
4422
+
4423
+ if (resultData.failData.length) {
4424
+ message.error("\u6709".concat(resultData.failData.length, "\u6761\u6821\u9A8C\u5931\u8D25\u6570\u636E"));
4425
+ return;
4426
+ }
4427
+
4428
+ callbackHandleOk(resultData, function () {
4429
+ modalProps.hideModal();
4430
+ });
4431
+ };
4432
+
4433
+ var handleShowModal = function handleShowModal() {
4434
+ setModalProps(_objectSpread2(_objectSpread2({}, modalProps), {}, {
4435
+ visible: true
4436
+ }));
4437
+ };
4438
+
4439
+ var handleCancel = function handleCancel() {
4440
+ modalProps.hideModal();
4441
+ };
4442
+
4443
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
4444
+ onClick: handleShowModal
4445
+ }, buttonName), modalProps.visible && /*#__PURE__*/React.createElement(Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
4446
+ onOk: handleOk,
4447
+ onCancel: handleCancel,
4448
+ destroyOnClose: true,
4449
+ zIndex: 15
4450
+ }), /*#__PURE__*/React.createElement(DataValidation, {
4451
+ onRef: function onRef(ref) {
4452
+ dataValidationRef = ref;
4453
+ },
4454
+ columns: columns,
4455
+ validDataUrl: validDataUrl
4456
+ })) || '');
4457
+ };
4458
+
4459
+ /*
4460
+ * @Description:
4461
+ * @Author: rodchen
4462
+ * @Date: 2022-01-14 14:12:01
4463
+ * @LastEditTime: 2022-01-14 17:17:26
4464
+ * @LastEditors: rodchen
4465
+ */
4466
+ var index$1 = (function (storageKeyString) {
4467
+ var seconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
4468
+ var tipsCallFunction = arguments.length > 2 ? arguments[2] : undefined;
4469
+ if (typeof seconds !== 'number') throw new Error('seconds should be number');
4470
+ var cacheValue = getStorageVale(storageKeyString);
4471
+
4472
+ if (document.hidden !== undefined) {
4473
+ document.addEventListener('visibilitychange', function () {
4474
+ if (!document.hidden) {
4475
+ var currentValue = getStorageVale(storageKeyString);
4476
+
4477
+ if (currentValue !== cacheValue) {
4478
+ if (tipsCallFunction && typeof tipsCallFunction === 'function') {
4479
+ tipsCallFunction();
4480
+ } else {
4481
+ window.alert('检测新用户登录,当前页面会在2s之后刷新!');
4482
+ }
4483
+
4484
+ setTimeout(function () {
4485
+ window.location.reload();
4486
+ }, seconds * 1000);
4487
+ }
4488
+ }
4489
+ });
4490
+ }
4491
+ });
4492
+
4493
+ function getStorageVale(storageKeyString) {
4494
+ var _storageKeyString$spl = storageKeyString.split('.'),
4495
+ _storageKeyString$spl2 = _toArray(_storageKeyString$spl),
4496
+ localstorage = _storageKeyString$spl2[0],
4497
+ restKeyArrays = _storageKeyString$spl2.slice(1);
4498
+
4499
+ var localStorageInfo = window.localStorage.getItem(localstorage);
4500
+ if (!restKeyArrays.length) return localStorageInfo;
4501
+ var returnVal = JSON.parse(localStorageInfo || '{}');
4502
+
4503
+ for (var i = 0; i < restKeyArrays.length; i++) {
4504
+ returnVal = returnVal[restKeyArrays[i]];
4505
+ if (!returnVal) return '';
4506
+
4507
+ if (typeof returnVal === 'string') {
4508
+ return returnVal;
4509
+ }
4510
+ }
4511
+
4512
+ return "";
4513
+ }
3711
4514
 
3712
4515
  /*
3713
4516
  * @Description:
@@ -3720,4 +4523,4 @@ var BusinessSearchSelect = function BusinessSearchSelect(props) {
3720
4523
  var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
3721
4524
  axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
3722
4525
 
3723
- export { BusinessSearchSelect, index as CheckOneUser, DataValidation, QueryMutipleInput, SearchSelect };
4526
+ export { index as BusinessSearchSelect, index$1 as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };