@bit-sun/business-component 1.1.22 → 1.1.25

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 (31) 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/{SearchSelect/business/BusinessSearchSelect.d.ts → Business/SearchSelect/index.d.ts} +0 -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 +949 -136
  11. package/dist/index.js +947 -133
  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/{SearchSelect/business/BusinessSearchSelect.tsx → Business/SearchSelect/index.tsx} +3 -2
  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/src/components/SearchSelect/business/BusinessUtils.ts +0 -464
  31. 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, 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';
@@ -484,7 +484,7 @@ function boundAlpha(a) {
484
484
  */
485
485
  function convertToPercentage(n) {
486
486
  if (n <= 1) {
487
- return Number(n) * 100 + "%";
487
+ return "".concat(Number(n) * 100, "%");
488
488
  }
489
489
  return n;
490
490
  }
@@ -866,12 +866,12 @@ var CSS_INTEGER = '[-\\+]?\\d+%?';
866
866
  // <http://www.w3.org/TR/css3-values/#number-value>
867
867
  var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
868
868
  // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
869
- var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
869
+ var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
870
870
  // Actual matching.
871
871
  // Parentheses and commas are optional, but not required.
872
872
  // Whitespace can take the place of commas or opening paren
873
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
874
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
873
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
874
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
875
875
  var matchers = {
876
876
  CSS_UNIT: new RegExp(CSS_UNIT),
877
877
  rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
@@ -1222,6 +1222,17 @@ function canUseDom() {
1222
1222
 
1223
1223
  var MARK_KEY = "rc-util-key";
1224
1224
 
1225
+ function getMark() {
1226
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1227
+ mark = _ref.mark;
1228
+
1229
+ if (mark) {
1230
+ return mark.startsWith('data-') ? mark : "data-".concat(mark);
1231
+ }
1232
+
1233
+ return MARK_KEY;
1234
+ }
1235
+
1225
1236
  function getContainer(option) {
1226
1237
  if (option.attachTo) {
1227
1238
  return option.attachTo;
@@ -1270,7 +1281,7 @@ function findExistNode(key) {
1270
1281
  var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1271
1282
  var container = getContainer(option);
1272
1283
  return Array.from(containerCache.get(container).children).find(function (node) {
1273
- return node.tagName === 'STYLE' && node[MARK_KEY] === key;
1284
+ return node.tagName === 'STYLE' && node.getAttribute(getMark(option)) === key;
1274
1285
  });
1275
1286
  }
1276
1287
  function updateCSS(css, key) {
@@ -1303,7 +1314,7 @@ function updateCSS(css, key) {
1303
1314
  }
1304
1315
 
1305
1316
  var newNode = injectCSS(css, option);
1306
- newNode[MARK_KEY] = key;
1317
+ newNode.setAttribute(getMark(option), key);
1307
1318
  return newNode;
1308
1319
  }
1309
1320
 
@@ -1942,7 +1953,7 @@ var DataValidation = /*#__PURE__*/function (_React$Component) {
1942
1953
  _this.getData = function () {
1943
1954
  console.time();
1944
1955
  var sheetData = luckysheet.getSheetData();
1945
- var data = sheetData.filter(function (item) {
1956
+ var data = JSON.parse(JSON.stringify(sheetData)).filter(function (item) {
1946
1957
  return item[0];
1947
1958
  }).map(function (item) {
1948
1959
  var obj = {};
@@ -2378,62 +2389,6 @@ function ToCDB(str) {
2378
2389
  return tmp;
2379
2390
  }
2380
2391
 
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
2392
  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
2393
  styleInject(css_248z$2);
2439
2394
 
@@ -2450,7 +2405,9 @@ var SearchSelect = function SearchSelect(props) {
2450
2405
  labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
2451
2406
  requestConfig = props.requestConfig,
2452
2407
  ctx = props.ctx,
2453
- sourceName = props.sourceName;
2408
+ sourceName = props.sourceName,
2409
+ _props$needModalTable = props.needModalTable,
2410
+ needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable;
2454
2411
 
2455
2412
  var _ref = requestConfig || {},
2456
2413
  url = _ref.url,
@@ -2595,7 +2552,12 @@ var SearchSelect = function SearchSelect(props) {
2595
2552
  var _useState31 = useState({}),
2596
2553
  _useState32 = _slicedToArray(_useState31, 2),
2597
2554
  tableFormParams = _useState32[0],
2598
- setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
2555
+ setTableFormParams = _useState32[1];
2556
+
2557
+ var _useState33 = useState(false),
2558
+ _useState34 = _slicedToArray(_useState33, 2),
2559
+ tooltipVisible = _useState34[0],
2560
+ setTooltipVisible = _useState34[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
2599
2561
 
2600
2562
 
2601
2563
  var getData = function getData() {
@@ -2614,6 +2576,101 @@ var SearchSelect = function SearchSelect(props) {
2614
2576
  fixedParam[item] = fixedParamVal;
2615
2577
  }
2616
2578
  });
2579
+ } // 数组对象处理,对带有特殊标记的name进行处理
2580
+
2581
+
2582
+ for (var key in params) {
2583
+ if (Object.prototype.hasOwnProperty.call(params, key)) {
2584
+ (function () {
2585
+ var element = params[key];
2586
+
2587
+ if (element && key.indexOf('*number*') >= 0) {
2588
+ var dataParams = key.split('*number*');
2589
+ dataParams.forEach(function (value, index) {
2590
+ params[value] = element[index];
2591
+ });
2592
+ delete params[key];
2593
+ } else if (element && key.indexOf('*address*') >= 0) {
2594
+ var _dataParams = key.split('*address*');
2595
+
2596
+ _dataParams.forEach(function (value, index) {
2597
+ params[value] = element.PCDCode[index];
2598
+ });
2599
+
2600
+ delete params[key];
2601
+ } else if (element && key.indexOf('*costType*') >= 0) {
2602
+ var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
2603
+
2604
+
2605
+ params[_dataParams2[0]] = element[1];
2606
+ delete params[key];
2607
+ } else if (element && key.indexOf('*fullDate*') >= 0) {
2608
+ var _dataParams3 = key.split('*fullDate*');
2609
+
2610
+ _dataParams3.forEach(function (value, index) {
2611
+ if (index === 0) {
2612
+ params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
2613
+ } else {
2614
+ params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
2615
+ }
2616
+ });
2617
+
2618
+ delete params[key];
2619
+ } else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
2620
+ var _dataParams4 = key.split('*checkBox*');
2621
+
2622
+ if (element) {
2623
+ params[_dataParams4[0]] = 0;
2624
+ }
2625
+
2626
+ delete params[key];
2627
+ } else if (element && key.indexOf('*cascader*') >= 0) {
2628
+ var _dataParams5 = key.split('*cascader*');
2629
+
2630
+ params[_dataParams5[0]] = element[element.length - 1];
2631
+ delete params[key];
2632
+ } else if (element && key.indexOf('*date*') >= 0) {
2633
+ var _dataParams6 = key.split('*date*');
2634
+
2635
+ _dataParams6.forEach(function (value, index) {
2636
+ if (index === 0) {
2637
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
2638
+ } else {
2639
+ params[value] = moment(element[index]).format('YYYY-MM-DD');
2640
+ }
2641
+ });
2642
+
2643
+ delete params[key];
2644
+ } else if (element && key.indexOf('*') >= 0) {
2645
+ var _dataParams7 = key.split('*');
2646
+
2647
+ _dataParams7.forEach(function (value, index) {
2648
+ params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
2649
+ });
2650
+
2651
+ delete params[key];
2652
+ } else if (element && key.indexOf('_selectNumberRange') >= 0) {
2653
+ // key = xxxxx_selectNumberRange qp-xxxxx-gt
2654
+ var _dataParams8 = key.split('_selectNumberRange')[0];
2655
+
2656
+ if (params[key][0] === 'range') {
2657
+ if (params[key][1][0]) {
2658
+ params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
2659
+ }
2660
+
2661
+ if (params[key][1][1]) {
2662
+ params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
2663
+ }
2664
+ } else {
2665
+ params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
2666
+ }
2667
+
2668
+ delete params[key];
2669
+ } else if (Array.isArray(element)) {
2670
+ params[key] = element.join(',');
2671
+ }
2672
+ })();
2673
+ }
2617
2674
  }
2618
2675
 
2619
2676
  var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
@@ -3004,11 +3061,57 @@ var SearchSelect = function SearchSelect(props) {
3004
3061
  }
3005
3062
  };
3006
3063
 
3064
+ var TooltipContent = function TooltipContent() {
3065
+ if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
3066
+ var listSelected = JSON.parse(JSON.stringify(items)).filter(function (i) {
3067
+ return value.find(function (item) {
3068
+ return item === i.value;
3069
+ });
3070
+ }) || [];
3071
+
3072
+ var _onClose = function onClose(e, item) {
3073
+ e.preventDefault();
3074
+ var newValue = JSON.parse(JSON.stringify(value)).filter(function (i) {
3075
+ return i !== item.value;
3076
+ });
3077
+ onChange(newValue);
3078
+ };
3079
+
3080
+ return (listSelected === null || listSelected === void 0 ? void 0 : listSelected.length) && listSelected.map(function (i) {
3081
+ return /*#__PURE__*/React.createElement(Tag, {
3082
+ closable: true,
3083
+ onClose: function onClose(e) {
3084
+ return _onClose(e, i);
3085
+ },
3086
+ style: {
3087
+ marginRight: 3,
3088
+ background: '#f5f5f5',
3089
+ height: '24px',
3090
+ border: '1px solid #f0f0f0'
3091
+ }
3092
+ }, i.text);
3093
+ }) || '';
3094
+ } else {
3095
+ setTooltipVisible(false);
3096
+ }
3097
+
3098
+ return '';
3099
+ };
3100
+
3007
3101
  return /*#__PURE__*/React.createElement("div", {
3008
3102
  className: 'search_select'
3009
3103
  }, /*#__PURE__*/React.createElement("div", {
3010
3104
  className: "search_select_show",
3011
3105
  id: "search_select_div_".concat(uniqueValue)
3106
+ }, /*#__PURE__*/React.createElement(Tooltip, {
3107
+ title: TooltipContent,
3108
+ visible: tooltipVisible,
3109
+ trigger: 'hover',
3110
+ onVisibleChange: function onVisibleChange(visible) {
3111
+ if (selectMode && value && (value === null || value === void 0 ? void 0 : value.length)) {
3112
+ setTooltipVisible(visible);
3113
+ }
3114
+ }
3012
3115
  }, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
3013
3116
  virtual: true,
3014
3117
  labelInValue: labelInValue,
@@ -3051,15 +3154,15 @@ var SearchSelect = function SearchSelect(props) {
3051
3154
  fontSize: '50px'
3052
3155
  }
3053
3156
  })), /*#__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
- },
3157
+ onPopupScroll: SelectScroll,
3059
3158
  style: {
3060
- width: 'calc(100% - 30px)'
3159
+ width: needModalTable ? 'calc(100% - 30px)' : 'calc(100%)'
3061
3160
  },
3062
3161
  placeholder: "\u8BF7\u9009\u62E9"
3162
+ }, currentSelectProps), {}, {
3163
+ getPopupContainer: function getPopupContainer() {
3164
+ return document.getElementById("search_select_div_".concat(uniqueValue));
3165
+ }
3063
3166
  }), items.map(function (item) {
3064
3167
  return /*#__PURE__*/React.createElement(Option, {
3065
3168
  key: item.value,
@@ -3068,7 +3171,7 @@ var SearchSelect = function SearchSelect(props) {
3068
3171
  text: "".concat(item.textShowKey, " ").concat(item.text),
3069
3172
  filterTxt: searchValue
3070
3173
  }));
3071
- })), /*#__PURE__*/React.createElement(Button, {
3174
+ }))), needModalTable && /*#__PURE__*/React.createElement(Button, {
3072
3175
  style: {
3073
3176
  width: '30px',
3074
3177
  padding: '2px',
@@ -3076,7 +3179,7 @@ var SearchSelect = function SearchSelect(props) {
3076
3179
  },
3077
3180
  onClick: showModal,
3078
3181
  type: "primary"
3079
- }, /*#__PURE__*/React.createElement(SearchOutlined$2, null))), /*#__PURE__*/React.createElement(Modal, {
3182
+ }, /*#__PURE__*/React.createElement(SearchOutlined$2, null))), needModalTable && isModalVisible && /*#__PURE__*/React.createElement(Modal, {
3080
3183
  width: '80%',
3081
3184
  title: modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle,
3082
3185
  visible: isModalVisible,
@@ -3166,13 +3269,36 @@ var SearchSelect = function SearchSelect(props) {
3166
3269
  }), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
3167
3270
  };
3168
3271
 
3272
+ var shopFileType = [{
3273
+ text: "线上",
3274
+ value: 'online'
3275
+ }, {
3276
+ text: "线下",
3277
+ value: 'offline'
3278
+ }];
3279
+ var arrivalPaySupportList = [{
3280
+ text: "支持",
3281
+ value: 1
3282
+ }, {
3283
+ text: "不支持",
3284
+ value: 0
3285
+ }];
3286
+ var sharingType = [{
3287
+ text: "共享",
3288
+ value: '10'
3289
+ }, {
3290
+ text: "私有",
3291
+ value: '20'
3292
+ }];
3293
+
3169
3294
  var getDicData = function getDicData(dicCode) {
3170
3295
  var dicData = {};
3171
3296
 
3172
3297
  {
3173
3298
  var storageDic = localStorage.getItem('dicData') ? JSON.parse(localStorage.getItem('dicData') || '{}') : {};
3174
3299
  dicData = storageDic[dicCode];
3175
- }
3300
+ } // @ts-ignore
3301
+
3176
3302
 
3177
3303
  if (!dicData || !dicData.length) ;
3178
3304
 
@@ -3185,6 +3311,7 @@ var getDictionarySource = function getDictionarySource(dicCode) {
3185
3311
 
3186
3312
  try {
3187
3313
  if (needConvertInterger) {
3314
+ // @ts-ignore
3188
3315
  dicData = dicData.map(function (item) {
3189
3316
  return _objectSpread2(_objectSpread2({}, item), {}, {
3190
3317
  value: parseFloat(item.value)
@@ -3198,7 +3325,8 @@ var getDictionarySource = function getDictionarySource(dicCode) {
3198
3325
 
3199
3326
  var getDictionaryTextByValue = function getDictionaryTextByValue(dicCode, value) {
3200
3327
  var dicData = getDicData(dicCode);
3201
- if (value === undefined) return '';
3328
+ if (value === undefined) return ''; // @ts-ignore
3329
+
3202
3330
  var dicItemArray = dicData === null || dicData === void 0 ? void 0 : dicData.filter(function (item) {
3203
3331
  return item.value === value.toString();
3204
3332
  });
@@ -3228,11 +3356,14 @@ var loadSelectSource = function loadSelectSource(url, params) {
3228
3356
  });
3229
3357
  };
3230
3358
 
3359
+ var _getDictionarySource;
3360
+ var hasDictSharingType = (_getDictionarySource = getDictionarySource('UC000013')) === null || _getDictionarySource === void 0 ? void 0 : _getDictionarySource.length;
3361
+ var sharingTypeDataList = hasDictSharingType && getDictionarySource('UC000013') || sharingType;
3231
3362
  function commonFun(type, prefixUrl) {
3232
3363
  // 默认type === 'supplier' 供应商选择器
3233
3364
  var requestConfig = {
3234
3365
  url: "".concat(prefixUrl.selectPrefix, "/supplier"),
3235
- filter: 'qp-nameAndCode-like',
3366
+ filter: 'qp-name,code-orGroup,like',
3236
3367
  otherParams: {
3237
3368
  sorter: 'desc-id'
3238
3369
  } // 默认参数
@@ -3269,7 +3400,7 @@ function commonFun(type, prefixUrl) {
3269
3400
  var haveChildren = Array.isArray(treeDataItem.children) && treeDataItem.children.length > 0;
3270
3401
  return {
3271
3402
  title: treeDataItem[resKeyValue[1]],
3272
- key: treeDataItem[resKeyValue[0]],
3403
+ value: treeDataItem[resKeyValue[0]],
3273
3404
  parentId: treeDataItem.parent,
3274
3405
  data: _objectSpread2({}, treeDataItem),
3275
3406
  isLeaf: !haveChildren,
@@ -3291,15 +3422,15 @@ function commonFun(type, prefixUrl) {
3291
3422
  changeSearchForm[changePosition].field.props.treeData = formatData;
3292
3423
  };
3293
3424
 
3294
- var tableSearchForm = [];
3425
+ var tableSearchForm = []; // 供应商选择器
3295
3426
 
3296
3427
  if (type === 'supplier') {
3297
3428
  tableSearchForm = [{
3298
3429
  name: 'qp-name-like',
3299
- label: '客户名称'
3430
+ label: '供应商名称'
3300
3431
  }, {
3301
3432
  name: 'qp-code-like',
3302
- label: '客户编码'
3433
+ label: '供应商编码'
3303
3434
  }, {
3304
3435
  name: 'qp-conglomerateCode-in',
3305
3436
  type: 'select',
@@ -3361,7 +3492,7 @@ function commonFun(type, prefixUrl) {
3361
3492
  name: 'qp-sharingType-eq',
3362
3493
  type: 'select',
3363
3494
  label: '共享类型',
3364
- initialSource: getDictionarySource('UC000013')
3495
+ initialSource: sharingTypeDataList
3365
3496
  }];
3366
3497
  Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3367
3498
  pageSize: 5000,
@@ -3385,10 +3516,10 @@ function commonFun(type, prefixUrl) {
3385
3516
  modalTableTitle: '选择供应商',
3386
3517
  tableSearchForm: tableSearchForm,
3387
3518
  tableColumns: [{
3388
- title: '客户编码',
3519
+ title: '供应商编码',
3389
3520
  dataIndex: 'code'
3390
3521
  }, {
3391
- title: '客户名称',
3522
+ title: '供应商名称',
3392
3523
  dataIndex: 'name'
3393
3524
  }, {
3394
3525
  title: '归属集团',
@@ -3403,15 +3534,20 @@ function commonFun(type, prefixUrl) {
3403
3534
  title: '共享类型',
3404
3535
  dataIndex: 'sharingType',
3405
3536
  render: function render(text) {
3406
- return getDictionaryTextByValue('UC000013', text);
3537
+ var _sharingType$find;
3538
+
3539
+ return hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : (_sharingType$find = sharingType.find(function (i) {
3540
+ return i.value === text;
3541
+ })) === null || _sharingType$find === void 0 ? void 0 : _sharingType$find.text;
3407
3542
  }
3408
3543
  }]
3409
- }; // 商品选择器
3544
+ };
3545
+ var needModalTable = true; // 商品选择器
3410
3546
 
3411
3547
  if (type === 'skuCommodity') {
3412
3548
  requestConfig = {
3413
3549
  url: "".concat(prefixUrl.selectPrefix, "/sku"),
3414
- filter: 'qp-nameAndCode-like',
3550
+ filter: 'qp-name,skuCode-orGroup,like',
3415
3551
  mappingTextField: 'name',
3416
3552
  mappingValueField: 'skuCode',
3417
3553
  otherParams: {
@@ -3543,17 +3679,18 @@ function commonFun(type, prefixUrl) {
3543
3679
  dataIndex: 'barCode'
3544
3680
  }]
3545
3681
  };
3546
- } // 仓库选择器
3682
+ } // 仓库选择器(物理、逻辑仓)
3547
3683
 
3548
3684
 
3549
3685
  if (type === 'physicalWarehouse') {
3550
3686
  requestConfig = {
3551
3687
  url: "".concat(prefixUrl.selectPrefix, "/physicalWarehouse"),
3552
- filter: 'qp-nameAndCode-like',
3688
+ filter: 'qp-physicalWarehouseName,physicalWarehouseCode-orGroup,like',
3553
3689
  mappingTextField: 'physicalWarehouseName',
3554
3690
  mappingTextShowKeyField: 'physicalWarehouseCode',
3555
3691
  mappingValueField: 'id',
3556
3692
  otherParams: {
3693
+ 'qp-isEnable-eq': 1,
3557
3694
  sorter: 'desc-id'
3558
3695
  },
3559
3696
  sourceName: 'warehouseIds'
@@ -3588,11 +3725,6 @@ function commonFun(type, prefixUrl) {
3588
3725
  }
3589
3726
  }
3590
3727
  }
3591
- }, {
3592
- name: 'qp-isEnable-eq',
3593
- type: 'select',
3594
- label: '物理仓状态',
3595
- initialSource: getDictionarySource('SC00001')
3596
3728
  }];
3597
3729
  Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3598
3730
  pageSize: 5000,
@@ -3616,12 +3748,6 @@ function commonFun(type, prefixUrl) {
3616
3748
  render: function render(text) {
3617
3749
  return getDictionaryTextByValue('SC00002', text);
3618
3750
  }
3619
- }, {
3620
- title: '物理仓状态',
3621
- dataIndex: 'isEnable',
3622
- render: function render(text) {
3623
- return getDictionaryTextByValue('SC00001', text);
3624
- }
3625
3751
  }, {
3626
3752
  title: '所属公司',
3627
3753
  dataIndex: 'companyName'
@@ -3632,11 +3758,12 @@ function commonFun(type, prefixUrl) {
3632
3758
  if (type === 'realWarehouse') {
3633
3759
  requestConfig = {
3634
3760
  url: "".concat(prefixUrl.selectPrefix, "/realWarehouse"),
3635
- filter: 'qp-nameAndCode-like',
3761
+ filter: 'qp-realWarehouseName,realWarehouseCode-orGroup,like',
3636
3762
  mappingTextField: 'realWarehouseName',
3637
3763
  mappingTextShowKeyField: 'realWarehouseCode',
3638
3764
  mappingValueField: 'id',
3639
3765
  otherParams: {
3766
+ 'qp-isEnable-eq': 1,
3640
3767
  sorter: 'desc-id'
3641
3768
  },
3642
3769
  sourceName: 'warehouseIds'
@@ -3652,11 +3779,6 @@ function commonFun(type, prefixUrl) {
3652
3779
  type: 'select',
3653
3780
  label: '逻辑仓类型',
3654
3781
  initialSource: getDictionarySource('SC00004')
3655
- }, {
3656
- name: 'qp-isEnable-eq',
3657
- type: 'select',
3658
- label: '逻辑仓状态',
3659
- initialSource: getDictionarySource('SC00001')
3660
3782
  }];
3661
3783
  modalTableProps = {
3662
3784
  modalTableTitle: '选择逻辑仓',
@@ -3673,41 +3795,732 @@ function commonFun(type, prefixUrl) {
3673
3795
  render: function render(text) {
3674
3796
  return getDictionaryTextByValue('SC00004', text);
3675
3797
  }
3676
- }, {
3677
- title: '逻辑仓状态',
3678
- dataIndex: 'isEnable',
3679
- render: function render(text) {
3680
- return getDictionaryTextByValue('SC00001', text);
3681
- }
3682
3798
  }]
3683
3799
  };
3684
- }
3800
+ } // 仓库选择器(虚拟、渠道仓)(无弹窗)
3685
3801
 
3686
- return {
3687
- modalTableProps: modalTableProps,
3688
- requestConfig: requestConfig
3689
- };
3690
- }
3691
3802
 
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
- };
3803
+ if (type === 'virtualWarehouse') {
3804
+ requestConfig = {
3805
+ url: "".concat(prefixUrl.selectPrefix, "/virtualWarehouse"),
3806
+ filter: 'qp-virtualWarehouseName,virtualWarehouseCode-orGroup,like',
3807
+ mappingTextField: 'virtualWarehouseName',
3808
+ mappingTextShowKeyField: 'virtualWarehouseCode',
3809
+ mappingValueField: 'id',
3810
+ otherParams: {
3811
+ 'qp-isEnable-eq': 1,
3812
+ sorter: 'desc-id'
3813
+ },
3814
+ sourceName: 'warehouseIds'
3815
+ };
3816
+ needModalTable = false;
3817
+ }
3698
3818
 
3699
- var _commonFun = commonFun(businessType, prefixUrl),
3700
- requestConfig = _commonFun.requestConfig,
3701
- modalTableProps = _commonFun.modalTableProps;
3819
+ if (type === 'channelWarehouse') {
3820
+ requestConfig = {
3821
+ url: "".concat(prefixUrl.selectPrefix, "/channelWarehouse"),
3822
+ filter: 'qp-channelWarehouseName,channelWarehouseCode-orGroup,like',
3823
+ mappingTextField: 'channelWarehouseName',
3824
+ mappingTextShowKeyField: 'channelWarehouseCode',
3825
+ mappingValueField: 'id',
3826
+ otherParams: {
3827
+ 'qp-isEnable-eq': 1,
3828
+ sorter: 'desc-id'
3829
+ },
3830
+ sourceName: 'warehouseIds'
3831
+ };
3832
+ needModalTable = false;
3833
+ } // 客户选择器
3702
3834
 
3703
- var currentProps = _objectSpread2(_objectSpread2({
3704
- requestConfig: requestConfig
3705
- }, props), {}, {
3706
- modalTableProps: modalTableProps
3707
- });
3708
3835
 
3709
- return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchSelect, _objectSpread2({}, currentProps)));
3710
- };
3836
+ if (type === 'customer') {
3837
+ requestConfig = {
3838
+ url: "".concat(prefixUrl.selectPrefix, "/uc/customer/v2"),
3839
+ filter: 'qp-name,code-orGroup,like',
3840
+ mappingTextField: 'name',
3841
+ mappingValueField: 'code',
3842
+ otherParams: {
3843
+ sorter: 'desc-id'
3844
+ },
3845
+ sourceName: 'customCode'
3846
+ };
3847
+ tableSearchForm = [{
3848
+ name: 'qp-name-like',
3849
+ label: '客户名称'
3850
+ }, {
3851
+ name: 'qp-code-like',
3852
+ label: '客户编码'
3853
+ }, {
3854
+ name: 'qp-conglomerateCode-in',
3855
+ type: 'select',
3856
+ label: '归属集团',
3857
+ field: {
3858
+ type: 'select',
3859
+ props: {
3860
+ mode: 'multiple',
3861
+ notFoundContent: '暂无数据',
3862
+ allowClear: true,
3863
+ showSearch: true,
3864
+ showArrow: true,
3865
+ maxTagCount: 1,
3866
+ optionFilterProp: 'children',
3867
+ filterOption: function filterOption(input, option) {
3868
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3869
+ }
3870
+ }
3871
+ }
3872
+ }, {
3873
+ name: 'qp-accountingCode-in',
3874
+ type: 'select',
3875
+ label: '归属核算主体',
3876
+ field: {
3877
+ type: 'select',
3878
+ props: {
3879
+ mode: 'multiple',
3880
+ notFoundContent: '暂无数据',
3881
+ allowClear: true,
3882
+ showSearch: true,
3883
+ showArrow: true,
3884
+ maxTagCount: 1,
3885
+ optionFilterProp: 'children',
3886
+ filterOption: function filterOption(input, option) {
3887
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3888
+ }
3889
+ }
3890
+ }
3891
+ }, {
3892
+ name: 'qp-companyCode-in',
3893
+ type: 'select',
3894
+ label: '归属法人公司',
3895
+ field: {
3896
+ type: 'select',
3897
+ props: {
3898
+ mode: 'multiple',
3899
+ notFoundContent: '暂无数据',
3900
+ allowClear: true,
3901
+ showSearch: true,
3902
+ showArrow: true,
3903
+ maxTagCount: 1,
3904
+ optionFilterProp: 'children',
3905
+ filterOption: function filterOption(input, option) {
3906
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3907
+ }
3908
+ }
3909
+ }
3910
+ }, {
3911
+ name: 'qp-sharingType-eq',
3912
+ type: 'select',
3913
+ label: '共享类型',
3914
+ initialSource: sharingTypeDataList
3915
+ }];
3916
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3917
+ pageSize: 5000,
3918
+ currentPage: 1,
3919
+ 'qp-companyType-eq': '30'
3920
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
3921
+ pageSize: 5000,
3922
+ currentPage: 1
3923
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
3924
+ pageSize: 5000,
3925
+ currentPage: 1,
3926
+ 'qp-companyType-eq': '20'
3927
+ })]).then(function (x) {
3928
+ formatSource(x, 0, 2, tableSearchForm);
3929
+ formatSource(x, 1, 3, tableSearchForm);
3930
+ formatSource(x, 2, 4, tableSearchForm);
3931
+ });
3932
+ modalTableProps = {
3933
+ modalTableTitle: '选择客户',
3934
+ tableSearchForm: tableSearchForm,
3935
+ tableColumns: [{
3936
+ title: '客户编码',
3937
+ dataIndex: 'code'
3938
+ }, {
3939
+ title: '客户名称',
3940
+ dataIndex: 'name'
3941
+ }, {
3942
+ title: '归属集团',
3943
+ dataIndex: 'conglomerateName'
3944
+ }, {
3945
+ title: '归属法人公司',
3946
+ dataIndex: 'legalCompanyName'
3947
+ }, {
3948
+ title: '归属核算主体',
3949
+ dataIndex: 'accountingName'
3950
+ }, {
3951
+ title: '共享类型',
3952
+ dataIndex: 'sharingType',
3953
+ render: function render(text) {
3954
+ var _sharingType$find2;
3955
+
3956
+ return hasDictSharingType ? getDictionaryTextByValue('UC000013', text) : (_sharingType$find2 = sharingType.find(function (i) {
3957
+ return i.value === text;
3958
+ })) === null || _sharingType$find2 === void 0 ? void 0 : _sharingType$find2.text;
3959
+ }
3960
+ }]
3961
+ };
3962
+ } // 店铺选择器
3963
+
3964
+
3965
+ if (type === 'shopFile') {
3966
+ requestConfig = {
3967
+ url: "".concat(prefixUrl.selectPrefix, "/store"),
3968
+ filter: 'qp-name,code-orGroup,like',
3969
+ mappingTextField: 'name',
3970
+ mappingValueField: 'code',
3971
+ otherParams: {
3972
+ sorter: 'desc-id'
3973
+ },
3974
+ sourceName: 'code'
3975
+ };
3976
+ tableSearchForm = [{
3977
+ name: 'qp-name-like',
3978
+ label: '店铺名称'
3979
+ }, {
3980
+ name: 'qp-code-like',
3981
+ label: '店铺编码'
3982
+ }, {
3983
+ name: 'qp-conglomerateCode-in',
3984
+ type: 'select',
3985
+ label: '归属集团',
3986
+ field: {
3987
+ type: 'select',
3988
+ props: {
3989
+ mode: 'multiple',
3990
+ notFoundContent: '暂无数据',
3991
+ allowClear: true,
3992
+ showSearch: true,
3993
+ showArrow: true,
3994
+ maxTagCount: 1,
3995
+ optionFilterProp: 'children',
3996
+ filterOption: function filterOption(input, option) {
3997
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
3998
+ }
3999
+ }
4000
+ }
4001
+ }, {
4002
+ name: 'qp-companyCode-in',
4003
+ type: 'select',
4004
+ label: '归属法人公司',
4005
+ field: {
4006
+ type: 'select',
4007
+ props: {
4008
+ mode: 'multiple',
4009
+ notFoundContent: '暂无数据',
4010
+ allowClear: true,
4011
+ showSearch: true,
4012
+ showArrow: true,
4013
+ maxTagCount: 1,
4014
+ optionFilterProp: 'children',
4015
+ filterOption: function filterOption(input, option) {
4016
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4017
+ }
4018
+ }
4019
+ }
4020
+ }, {
4021
+ name: 'qp-type-in',
4022
+ type: 'select',
4023
+ label: '店铺类型',
4024
+ initialSource: shopFileType
4025
+ }, {
4026
+ name: 'qp-plateformCode-in',
4027
+ type: 'select',
4028
+ label: '店铺来源',
4029
+ field: {
4030
+ type: 'select',
4031
+ props: {
4032
+ mode: 'multiple',
4033
+ notFoundContent: '暂无数据',
4034
+ allowClear: true,
4035
+ showSearch: true,
4036
+ showArrow: true,
4037
+ maxTagCount: 1,
4038
+ optionFilterProp: 'children',
4039
+ filterOption: function filterOption(input, option) {
4040
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4041
+ }
4042
+ }
4043
+ }
4044
+ }, {
4045
+ name: 'qp-accountingCode-in',
4046
+ type: 'select',
4047
+ label: '归属核算主体',
4048
+ field: {
4049
+ type: 'select',
4050
+ props: {
4051
+ mode: 'multiple',
4052
+ notFoundContent: '暂无数据',
4053
+ allowClear: true,
4054
+ showSearch: true,
4055
+ showArrow: true,
4056
+ maxTagCount: 1,
4057
+ optionFilterProp: 'children',
4058
+ filterOption: function filterOption(input, option) {
4059
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4060
+ }
4061
+ }
4062
+ }
4063
+ }];
4064
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
4065
+ pageSize: 5000,
4066
+ currentPage: 1,
4067
+ 'qp-companyType-eq': '30'
4068
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
4069
+ pageSize: 5000,
4070
+ currentPage: 1,
4071
+ 'qp-companyType-eq': '20'
4072
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/platformRecord/getPlatformRecordList"), {
4073
+ // pageSize: 5000,
4074
+ // currentPage: 1,
4075
+ 'qp-status-eq': '1'
4076
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/accountingSubject"), {
4077
+ pageSize: 5000,
4078
+ currentPage: 1
4079
+ })]).then(function (x) {
4080
+ formatSource(x, 0, 2, tableSearchForm);
4081
+ formatSource(x, 1, 3, tableSearchForm);
4082
+ formatSource(x, 2, 5, tableSearchForm);
4083
+ formatSource(x, 3, 6, tableSearchForm);
4084
+ });
4085
+ modalTableProps = {
4086
+ modalTableTitle: '选择店铺',
4087
+ tableSearchForm: tableSearchForm,
4088
+ tableColumns: [{
4089
+ title: '店铺编码',
4090
+ dataIndex: 'code'
4091
+ }, {
4092
+ title: '店铺名称',
4093
+ dataIndex: 'name'
4094
+ }, {
4095
+ title: '归属集团',
4096
+ dataIndex: 'conglomerateName'
4097
+ }, {
4098
+ title: '归属法人公司',
4099
+ dataIndex: 'companyName'
4100
+ }, {
4101
+ title: '店铺类型',
4102
+ dataIndex: 'type',
4103
+ render: function render(text) {
4104
+ var _shopFileType$find;
4105
+
4106
+ return (_shopFileType$find = shopFileType.find(function (i) {
4107
+ return i.value === text;
4108
+ })) === null || _shopFileType$find === void 0 ? void 0 : _shopFileType$find.text;
4109
+ }
4110
+ }, {
4111
+ title: '店铺来源',
4112
+ dataIndex: 'platformName'
4113
+ }, {
4114
+ title: '归属核算主体',
4115
+ dataIndex: 'accountingName'
4116
+ }]
4117
+ };
4118
+ } // 核算主体选择器(无弹窗)
4119
+
4120
+
4121
+ if (type === 'accountingSubject') {
4122
+ requestConfig = {
4123
+ url: "".concat(prefixUrl.selectPrefix, "/accountingSubject"),
4124
+ filter: 'qp-name,code-orGroup,like',
4125
+ mappingTextField: 'name',
4126
+ mappingTextShowKeyField: 'code',
4127
+ mappingValueField: 'id',
4128
+ otherParams: {
4129
+ sorter: 'desc-id'
4130
+ },
4131
+ sourceName: 'accountingSubjectCode'
4132
+ };
4133
+ needModalTable = false;
4134
+ } // 库存组织选择器(无弹窗)
4135
+
4136
+
4137
+ if (type === 'inventoryOrg') {
4138
+ requestConfig = {
4139
+ url: "".concat(prefixUrl.selectPrefix, "/inventoryOrg"),
4140
+ filter: 'qp-name,code-orGroup,like',
4141
+ mappingTextField: 'name',
4142
+ mappingTextShowKeyField: 'code',
4143
+ mappingValueField: 'id',
4144
+ otherParams: {
4145
+ sorter: 'desc-id'
4146
+ },
4147
+ sourceName: 'inventoryOrgCode'
4148
+ };
4149
+ needModalTable = false;
4150
+ } // 法人公司选择器(无弹窗)
4151
+
4152
+
4153
+ if (type === 'corporationCompany') {
4154
+ requestConfig = {
4155
+ url: "".concat(prefixUrl.selectPrefix, "/company"),
4156
+ filter: 'qp-name,code-orGroup,like',
4157
+ mappingTextField: 'name',
4158
+ mappingTextShowKeyField: 'code',
4159
+ mappingValueField: 'id',
4160
+ otherParams: {
4161
+ sorter: 'desc-id'
4162
+ },
4163
+ sourceName: 'corporationCompany'
4164
+ };
4165
+ needModalTable = false;
4166
+ } // 员工选择器
4167
+
4168
+
4169
+ if (type === 'employee') {
4170
+ requestConfig = {
4171
+ url: "".concat(prefixUrl.selectPrefix, "/employee/v2"),
4172
+ filter: 'qp-name,employeeNumber-orGroup,like',
4173
+ mappingTextField: 'name',
4174
+ mappingTextShowKeyField: 'employeeNumber',
4175
+ mappingValueField: 'employeeNumber',
4176
+ otherParams: {
4177
+ 'qp-enable-eq': 10,
4178
+ sorter: 'desc-id'
4179
+ },
4180
+ sourceName: 'employeeNumber'
4181
+ };
4182
+ tableSearchForm = [{
4183
+ name: 'qp-name-like',
4184
+ label: '员工名称'
4185
+ }, {
4186
+ name: 'qp-employeeNumber-like',
4187
+ label: '员工编码'
4188
+ }, {
4189
+ name: 'qp-companyCode-in',
4190
+ type: 'select',
4191
+ label: '所属公司',
4192
+ field: {
4193
+ type: 'select',
4194
+ props: {
4195
+ mode: 'multiple',
4196
+ notFoundContent: '暂无数据',
4197
+ allowClear: true,
4198
+ showSearch: true,
4199
+ showArrow: true,
4200
+ maxTagCount: 1,
4201
+ optionFilterProp: 'children',
4202
+ filterOption: function filterOption(input, option) {
4203
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4204
+ }
4205
+ }
4206
+ }
4207
+ }, {
4208
+ name: 'qp-email-like',
4209
+ label: '邮箱'
4210
+ }, {
4211
+ name: 'qp-officeTelephone-like',
4212
+ label: '手机号'
4213
+ }];
4214
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/company"), {
4215
+ pageSize: 5000,
4216
+ currentPage: 1,
4217
+ 'qp-companyType-eq': 20
4218
+ })]).then(function (x) {
4219
+ formatSource(x, 0, 2, tableSearchForm);
4220
+ });
4221
+ modalTableProps = {
4222
+ modalTableTitle: '选择员工',
4223
+ tableSearchForm: tableSearchForm,
4224
+ tableColumns: [{
4225
+ title: '员工编码',
4226
+ dataIndex: 'employeeNumber'
4227
+ }, {
4228
+ title: '员工名称',
4229
+ dataIndex: 'name'
4230
+ }, {
4231
+ title: '所属公司',
4232
+ dataIndex: 'companyName'
4233
+ }, {
4234
+ title: '邮箱',
4235
+ dataIndex: 'email'
4236
+ }, {
4237
+ title: '手机号',
4238
+ dataIndex: 'officeTelephone'
4239
+ }]
4240
+ };
4241
+ } // 配送方式选择器
4242
+
4243
+
4244
+ if (type === 'deliveryMode') {
4245
+ requestConfig = {
4246
+ url: "".concat(prefixUrl.selectPrefix, "/deliveryMode"),
4247
+ filter: 'qp-name,code-orGroup,like',
4248
+ mappingTextField: 'name',
4249
+ mappingTextShowKeyField: 'code',
4250
+ mappingValueField: 'code',
4251
+ otherParams: {
4252
+ sorter: 'desc-id'
4253
+ },
4254
+ sourceName: 'deliveryModeCode'
4255
+ };
4256
+ tableSearchForm = [{
4257
+ name: 'qp-name-like',
4258
+ label: '配送方式名称'
4259
+ }, {
4260
+ name: 'qp-code-like',
4261
+ label: '配送方式编码'
4262
+ }, {
4263
+ name: 'qp-logisCompanyCode-in',
4264
+ type: 'select',
4265
+ label: '所属物流商',
4266
+ field: {
4267
+ type: 'select',
4268
+ props: {
4269
+ mode: 'multiple',
4270
+ notFoundContent: '暂无数据',
4271
+ allowClear: true,
4272
+ showSearch: true,
4273
+ showArrow: true,
4274
+ maxTagCount: 1,
4275
+ optionFilterProp: 'children',
4276
+ filterOption: function filterOption(input, option) {
4277
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4278
+ }
4279
+ }
4280
+ }
4281
+ }, {
4282
+ name: 'qp-recordChannnelCode-in',
4283
+ type: 'select',
4284
+ label: '单号获取通道',
4285
+ initialSource: getDictionarySource('BSC00004')
4286
+ }, {
4287
+ name: 'qp-arrivalPaySupport-in',
4288
+ type: 'select',
4289
+ label: '是否支持到付',
4290
+ initialSource: arrivalPaySupportList
4291
+ }, {
4292
+ name: 'qp-sheetTemplateCode-in',
4293
+ type: 'select',
4294
+ label: '面单模板',
4295
+ field: {
4296
+ type: 'select',
4297
+ props: {
4298
+ mode: 'multiple',
4299
+ notFoundContent: '暂无数据',
4300
+ allowClear: true,
4301
+ showSearch: true,
4302
+ showArrow: true,
4303
+ maxTagCount: 1,
4304
+ optionFilterProp: 'children',
4305
+ filterOption: function filterOption(input, option) {
4306
+ return option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0;
4307
+ }
4308
+ }
4309
+ }
4310
+ }, {
4311
+ name: 'qp-remark-like',
4312
+ label: '备注'
4313
+ }];
4314
+ Promise.all([loadSelectSource("".concat(prefixUrl.formSelectFix, "/logisCompany"), {
4315
+ pageSize: 5000,
4316
+ currentPage: 1
4317
+ }), loadSelectSource("".concat(prefixUrl.formSelectFix, "/printTemplate"), {
4318
+ pageSize: 5000,
4319
+ currentPage: 1
4320
+ })]).then(function (x) {
4321
+ formatSource(x, 0, 2, tableSearchForm);
4322
+ formatSource(x, 1, 5, tableSearchForm);
4323
+ });
4324
+ modalTableProps = {
4325
+ modalTableTitle: '选择配送方式',
4326
+ tableSearchForm: tableSearchForm,
4327
+ tableColumns: [{
4328
+ title: '配送方式编码',
4329
+ dataIndex: 'code'
4330
+ }, {
4331
+ title: '配送方式名称',
4332
+ dataIndex: 'name'
4333
+ }, {
4334
+ title: '所属物流商',
4335
+ dataIndex: 'logisCompanyName'
4336
+ }, {
4337
+ dataIndex: 'recordChannnelCode',
4338
+ title: '单号获取通道',
4339
+ render: function render(text) {
4340
+ return getDictionaryTextByValue('BSC00004', text);
4341
+ }
4342
+ }, {
4343
+ dataIndex: 'arrivalPaySupport',
4344
+ title: '是否支持到付',
4345
+ render: function render(text) {
4346
+ var _arrivalPaySupportLis;
4347
+
4348
+ return (_arrivalPaySupportLis = arrivalPaySupportList.find(function (i) {
4349
+ return i.value === text;
4350
+ })) === null || _arrivalPaySupportLis === void 0 ? void 0 : _arrivalPaySupportLis.text;
4351
+ }
4352
+ }, {
4353
+ dataIndex: 'sheetTemplateName',
4354
+ title: '面单模板'
4355
+ }, {
4356
+ dataIndex: 'remark',
4357
+ title: '备注'
4358
+ }]
4359
+ };
4360
+ }
4361
+
4362
+ return {
4363
+ modalTableProps: modalTableProps,
4364
+ requestConfig: requestConfig,
4365
+ needModalTable: needModalTable
4366
+ };
4367
+ }
4368
+
4369
+ var BusinessSearchSelect = function BusinessSearchSelect(props) {
4370
+ var businessType = (props === null || props === void 0 ? void 0 : props.selectBusinessType) || 'supplier';
4371
+ var prefixUrl = (props === null || props === void 0 ? void 0 : props.prefixUrl) || {
4372
+ selectPrefix: '/bop/api',
4373
+ formSelectFix: '/bop/api'
4374
+ };
4375
+
4376
+ var _commonFun = commonFun(businessType, prefixUrl),
4377
+ requestConfig = _commonFun.requestConfig,
4378
+ modalTableProps = _commonFun.modalTableProps,
4379
+ needModalTable = _commonFun.needModalTable;
4380
+
4381
+ var currentProps = _objectSpread2(_objectSpread2({
4382
+ requestConfig: requestConfig
4383
+ }, props), {}, {
4384
+ needModalTable: needModalTable,
4385
+ modalTableProps: modalTableProps
4386
+ });
4387
+
4388
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(SearchSelect, _objectSpread2({}, currentProps)));
4389
+ };
4390
+
4391
+ var CommodityEntry = function CommodityEntry(props) {
4392
+ var dataValidationRef = useRef();
4393
+ var _props$buttonName = props.buttonName,
4394
+ buttonName = _props$buttonName === void 0 ? ' + 录入商品' : _props$buttonName,
4395
+ _props$modalTitle = props.modalTitle,
4396
+ modalTitle = _props$modalTitle === void 0 ? '录入商品' : _props$modalTitle,
4397
+ callbackHideModal = props.callbackHideModal,
4398
+ callbackHandleOk = props.callbackHandleOk,
4399
+ _props$columns = props.columns,
4400
+ columns = _props$columns === void 0 ? ["skuCode", "quantity", "price"] : _props$columns,
4401
+ _props$validDataUrl = props.validDataUrl,
4402
+ validDataUrl = _props$validDataUrl === void 0 ? "/bop/api/recordDetailImport/check" : _props$validDataUrl;
4403
+
4404
+ var _useState = useState({
4405
+ maskClosable: false,
4406
+ width: 800,
4407
+ visible: false,
4408
+ title: modalTitle,
4409
+ okText: '确定',
4410
+ cancelText: '取消',
4411
+ hideModal: function hideModal() {
4412
+ setModalProps(function () {
4413
+ return _objectSpread2(_objectSpread2({}, modalProps), {}, {
4414
+ visible: false
4415
+ });
4416
+ });
4417
+ callbackHideModal && callbackHideModal();
4418
+ }
4419
+ }),
4420
+ _useState2 = _slicedToArray(_useState, 2),
4421
+ modalProps = _useState2[0],
4422
+ setModalProps = _useState2[1];
4423
+
4424
+ var handleOk = function handleOk() {
4425
+ // 方法获取当前组件内部的数据,然后进行自身的业务操作
4426
+ var resultData = dataValidationRef.getValidateData();
4427
+
4428
+ if (!resultData.successData.length) {
4429
+ message.error("无校验通过数据,请校验数据");
4430
+ return;
4431
+ }
4432
+
4433
+ if (resultData.failData.length) {
4434
+ message.error("\u6709".concat(resultData.failData.length, "\u6761\u6821\u9A8C\u5931\u8D25\u6570\u636E"));
4435
+ return;
4436
+ }
4437
+
4438
+ callbackHandleOk(resultData, function () {
4439
+ modalProps.hideModal();
4440
+ });
4441
+ };
4442
+
4443
+ var handleShowModal = function handleShowModal() {
4444
+ setModalProps(_objectSpread2(_objectSpread2({}, modalProps), {}, {
4445
+ visible: true
4446
+ }));
4447
+ };
4448
+
4449
+ var handleCancel = function handleCancel() {
4450
+ modalProps.hideModal();
4451
+ };
4452
+
4453
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Button, {
4454
+ onClick: handleShowModal
4455
+ }, buttonName), modalProps.visible && /*#__PURE__*/React.createElement(Modal, _objectSpread2(_objectSpread2({}, modalProps), {}, {
4456
+ onOk: handleOk,
4457
+ onCancel: handleCancel,
4458
+ destroyOnClose: true,
4459
+ zIndex: 15
4460
+ }), /*#__PURE__*/React.createElement(DataValidation, {
4461
+ onRef: function onRef(ref) {
4462
+ dataValidationRef = ref;
4463
+ },
4464
+ columns: columns,
4465
+ validDataUrl: validDataUrl
4466
+ })) || '');
4467
+ };
4468
+
4469
+ /*
4470
+ * @Description:
4471
+ * @Author: rodchen
4472
+ * @Date: 2022-01-14 14:12:01
4473
+ * @LastEditTime: 2022-01-14 17:17:26
4474
+ * @LastEditors: rodchen
4475
+ */
4476
+ var index = (function (storageKeyString) {
4477
+ var seconds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
4478
+ var tipsCallFunction = arguments.length > 2 ? arguments[2] : undefined;
4479
+ if (typeof seconds !== 'number') throw new Error('seconds should be number');
4480
+ var cacheValue = getStorageVale(storageKeyString);
4481
+
4482
+ if (document.hidden !== undefined) {
4483
+ document.addEventListener('visibilitychange', function () {
4484
+ if (!document.hidden) {
4485
+ var currentValue = getStorageVale(storageKeyString);
4486
+
4487
+ if (currentValue !== cacheValue) {
4488
+ if (tipsCallFunction && typeof tipsCallFunction === 'function') {
4489
+ tipsCallFunction();
4490
+ } else {
4491
+ window.alert('检测新用户登录,当前页面会在2s之后刷新!');
4492
+ }
4493
+
4494
+ setTimeout(function () {
4495
+ window.location.reload();
4496
+ }, seconds * 1000);
4497
+ }
4498
+ }
4499
+ });
4500
+ }
4501
+ });
4502
+
4503
+ function getStorageVale(storageKeyString) {
4504
+ var _storageKeyString$spl = storageKeyString.split('.'),
4505
+ _storageKeyString$spl2 = _toArray(_storageKeyString$spl),
4506
+ localstorage = _storageKeyString$spl2[0],
4507
+ restKeyArrays = _storageKeyString$spl2.slice(1);
4508
+
4509
+ var localStorageInfo = window.localStorage.getItem(localstorage);
4510
+ if (!restKeyArrays.length) return localStorageInfo;
4511
+ var returnVal = JSON.parse(localStorageInfo || '{}');
4512
+
4513
+ for (var i = 0; i < restKeyArrays.length; i++) {
4514
+ returnVal = returnVal[restKeyArrays[i]];
4515
+ if (!returnVal) return '';
4516
+
4517
+ if (typeof returnVal === 'string') {
4518
+ return returnVal;
4519
+ }
4520
+ }
4521
+
4522
+ return "";
4523
+ }
3711
4524
 
3712
4525
  /*
3713
4526
  * @Description:
@@ -3720,4 +4533,4 @@ var BusinessSearchSelect = function BusinessSearchSelect(props) {
3720
4533
  var resposne = JSON.parse(localStorage.getItem('userInfo') || '{}');
3721
4534
  axios.defaults.headers.common['sso-sessionid'] = (resposne === null || resposne === void 0 ? void 0 : resposne.sessionId) || '';
3722
4535
 
3723
- export { BusinessSearchSelect, index as CheckOneUser, DataValidation, QueryMutipleInput, SearchSelect };
4536
+ export { BusinessSearchSelect, index as CheckOneUser, CommodityEntry, DataValidation, QueryMutipleInput, SearchSelect };