tplus-components-touch 3.28.1 → 3.28.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/locales/zh/tplus-components-touch.json +1 -1
- package/locales/zh-CN/tplus-components-touch.json +1 -1
- package/mocks/memberInfo.json +79 -79
- package/package.json +1 -1
- package/tsconfig.json +26 -26
- package/dist/components/acCitySelect/CitySelect.js +0 -541
- package/dist/components/acCitySelect/CitySelect.js.map +0 -1
- package/dist/components/acCitySelect/CitySelect.less +0 -10
- package/dist/components/acCitySelect/citys.js +0 -1270
- package/dist/components/acCitySelect/citys.js.map +0 -1
- package/dist/components/acCitySelect/index.js +0 -18
- package/dist/components/acCitySelect/index.js.map +0 -1
- package/dist/components/acCitySelect/provinceData.js +0 -40
- package/dist/components/acCitySelect/provinceData.js.map +0 -1
- package/dist/components/addLog/AddLogProcessor.js +0 -49
- package/dist/components/addLog/AddLogProcessor.js.map +0 -1
- package/dist/components/addLog/OperationLogApi.js +0 -125
- package/dist/components/addLog/OperationLogApi.js.map +0 -1
- package/dist/components/autoComplete/index.js +0 -245
- package/dist/components/autoComplete/index.js.map +0 -1
- package/dist/components/autoComplete/index.less +0 -89
- package/dist/components/autoComplete/option.js +0 -75
- package/dist/components/autoComplete/option.js.map +0 -1
- package/dist/components/autoCompleteWithKeyboard/index.js +0 -231
- package/dist/components/autoCompleteWithKeyboard/index.js.map +0 -1
- package/dist/components/autoCompleteWithKeyboard/index.less +0 -8
- package/dist/components/billSearch/api.js +0 -465
- package/dist/components/billSearch/api.js.map +0 -1
- package/dist/components/billSearch/index.js +0 -2201
- package/dist/components/billSearch/index.js.map +0 -1
- package/dist/components/billSearch/index.less +0 -376
- package/dist/components/cloudPrint/BTPrintFormatUtil.js +0 -568
- package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +0 -1
- package/dist/components/cloudPrint/api.js +0 -391
- package/dist/components/cloudPrint/api.js.map +0 -1
- package/dist/components/cloudPrint/index.js +0 -674
- package/dist/components/cloudPrint/index.js.map +0 -1
- package/dist/components/cloudPrint/printDispatch.js +0 -324
- package/dist/components/cloudPrint/printDispatch.js.map +0 -1
- package/dist/components/commonForm/addressPicker/index.js +0 -232
- package/dist/components/commonForm/addressPicker/index.js.map +0 -1
- package/dist/components/commonForm/addressPicker/style.less +0 -11
- package/dist/components/commonForm/autoComplete/index.js +0 -241
- package/dist/components/commonForm/autoComplete/index.js.map +0 -1
- package/dist/components/commonForm/autoComplete/style.less +0 -3
- package/dist/components/commonForm/datePicker/index.js +0 -89
- package/dist/components/commonForm/datePicker/index.js.map +0 -1
- package/dist/components/commonForm/datePicker/style.less +0 -5
- package/dist/components/commonForm/formControl/index.js +0 -143
- package/dist/components/commonForm/formControl/index.js.map +0 -1
- package/dist/components/commonForm/formControl/style.less +0 -0
- package/dist/components/commonForm/index.js +0 -225
- package/dist/components/commonForm/index.js.map +0 -1
- package/dist/components/commonForm/inputNumber/index.js +0 -272
- package/dist/components/commonForm/inputNumber/index.js.map +0 -1
- package/dist/components/commonForm/inputNumber/style.less +0 -11
- package/dist/components/commonForm/radio/index.js +0 -132
- package/dist/components/commonForm/radio/index.js.map +0 -1
- package/dist/components/commonForm/radio/style.less +0 -0
- package/dist/components/commonForm/style.less +0 -2
- package/dist/components/deliverySearch/api.js +0 -355
- package/dist/components/deliverySearch/api.js.map +0 -1
- package/dist/components/deliverySearch/index.js +0 -1214
- package/dist/components/deliverySearch/index.js.map +0 -1
- package/dist/components/deliverySearch/index.less +0 -554
- package/dist/components/form/index.js +0 -310
- package/dist/components/form/index.js.map +0 -1
- package/dist/components/hardwareAPI/index.js +0 -181
- package/dist/components/hardwareAPI/index.js.map +0 -1
- package/dist/components/hotKey/config.js +0 -306
- package/dist/components/hotKey/config.js.map +0 -1
- package/dist/components/hotKey/hotKeyModal.js +0 -479
- package/dist/components/hotKey/hotKeyModal.js.map +0 -1
- package/dist/components/hotKey/index.js +0 -785
- package/dist/components/hotKey/index.js.map +0 -1
- package/dist/components/hotKey/localConfig.js +0 -1021
- package/dist/components/hotKey/localConfig.js.map +0 -1
- package/dist/components/hotKey/style.less +0 -96
- package/dist/components/hotKey/utils.js +0 -135
- package/dist/components/hotKey/utils.js.map +0 -1
- package/dist/components/input/index.js +0 -251
- package/dist/components/input/index.js.map +0 -1
- package/dist/components/input/style.less +0 -99
- package/dist/components/input/tplusInput/index.js +0 -81
- package/dist/components/input/tplusInput/index.js.map +0 -1
- package/dist/components/input/tplusInput/inputContent.js +0 -128
- package/dist/components/input/tplusInput/inputContent.js.map +0 -1
- package/dist/components/input/tplusInput/inputs.js +0 -151
- package/dist/components/input/tplusInput/inputs.js.map +0 -1
- package/dist/components/input/tplusInput/style.less +0 -132
- package/dist/components/input/utils/index.js +0 -26
- package/dist/components/input/utils/index.js.map +0 -1
- package/dist/components/inventorySearch/api.js +0 -214
- package/dist/components/inventorySearch/api.js.map +0 -1
- package/dist/components/inventorySearch/index.js +0 -303
- package/dist/components/inventorySearch/index.js.map +0 -1
- package/dist/components/inventorySearch/index.less +0 -120
- package/dist/components/inventorySearch/store.js +0 -344
- package/dist/components/inventorySearch/store.js.map +0 -1
- package/dist/components/inventorySearch/tab.js +0 -275
- package/dist/components/inventorySearch/tab.js.map +0 -1
- package/dist/components/keyboard/index.js +0 -255
- package/dist/components/keyboard/index.js.map +0 -1
- package/dist/components/keyboard/index.less +0 -470
- package/dist/components/keyboard/letterKeyboard.js +0 -210
- package/dist/components/keyboard/letterKeyboard.js.map +0 -1
- package/dist/components/keyboard/numKeyboard.js +0 -459
- package/dist/components/keyboard/numKeyboard.js.map +0 -1
- package/dist/components/keyboard/numKeyboardScan.js +0 -195
- package/dist/components/keyboard/numKeyboardScan.js.map +0 -1
- package/dist/components/keyboard/numberButton_input.js +0 -303
- package/dist/components/keyboard/numberButton_input.js.map +0 -1
- package/dist/components/keyboard/numkeyboardPassword.js +0 -460
- package/dist/components/keyboard/numkeyboardPassword.js.map +0 -1
- package/dist/components/keyboard/onlyKeyboard.js +0 -90
- package/dist/components/keyboard/onlyKeyboard.js.map +0 -1
- package/dist/components/keyboard/onlyLetterButton.js +0 -187
- package/dist/components/keyboard/onlyLetterButton.js.map +0 -1
- package/dist/components/keyboard/onlyLetterButton2.js +0 -235
- package/dist/components/keyboard/onlyLetterButton2.js.map +0 -1
- package/dist/components/keyboard/onlyLetterButton2.less +0 -162
- package/dist/components/keyboard/onlyNumberButton.js +0 -128
- package/dist/components/keyboard/onlyNumberButton.js.map +0 -1
- package/dist/components/keyboard/onlyNumberButton2.js +0 -115
- package/dist/components/keyboard/onlyNumberButton2.js.map +0 -1
- package/dist/components/keyboard/textKeyboard.js +0 -50
- package/dist/components/keyboard/textKeyboard.js.map +0 -1
- package/dist/components/layout/hamburger.js +0 -29
- package/dist/components/layout/hamburger.js.map +0 -1
- package/dist/components/layout/index.js +0 -31
- package/dist/components/layout/index.js.map +0 -1
- package/dist/components/layout/layout.js +0 -182
- package/dist/components/layout/layout.js.map +0 -1
- package/dist/components/layout/sider.js +0 -165
- package/dist/components/layout/sider.js.map +0 -1
- package/dist/components/layout/style.less +0 -82
- package/dist/components/loading/index.js +0 -198
- package/dist/components/loading/index.js.map +0 -1
- package/dist/components/loading/loadingContent.js +0 -176
- package/dist/components/loading/loadingContent.js.map +0 -1
- package/dist/components/loading/style.less +0 -61
- package/dist/components/loading/utils.js +0 -29
- package/dist/components/loading/utils.js.map +0 -1
- package/dist/components/message/index.js +0 -308
- package/dist/components/message/index.js.map +0 -1
- package/dist/components/message/index.less +0 -101
- package/dist/components/modal/index.js +0 -93
- package/dist/components/modal/index.js.map +0 -1
- package/dist/components/modal/index.less +0 -19
- package/dist/components/modalVertical/index.js +0 -325
- package/dist/components/modalVertical/index.js.map +0 -1
- package/dist/components/modalVertical/style.less +0 -60
- package/dist/components/modalWraper/index.js +0 -470
- package/dist/components/modalWraper/index.js.map +0 -1
- package/dist/components/modalWraper/style.less +0 -257
- package/dist/components/modalWraper/utils.js +0 -48
- package/dist/components/modalWraper/utils.js.map +0 -1
- package/dist/components/notification/index.js +0 -119
- package/dist/components/notification/index.js.map +0 -1
- package/dist/components/notification/index.less +0 -52
- package/dist/components/overflowTip/index.js +0 -269
- package/dist/components/overflowTip/index.js.map +0 -1
- package/dist/components/overflowTip/style.less +0 -66
- package/dist/components/page/index.js +0 -49
- package/dist/components/page/index.js.map +0 -1
- package/dist/components/page/index.less +0 -22
- package/dist/components/product/detail.js +0 -148
- package/dist/components/product/detail.js.map +0 -1
- package/dist/components/product/getCard.js +0 -145
- package/dist/components/product/getCard.js.map +0 -1
- package/dist/components/product/index.less +0 -128
- package/dist/components/progressState/EmptyAndErrorView.js +0 -143
- package/dist/components/progressState/EmptyAndErrorView.js.map +0 -1
- package/dist/components/progressState/ProgressState.js +0 -157
- package/dist/components/progressState/ProgressState.js.map +0 -1
- package/dist/components/progressState/index.js +0 -14
- package/dist/components/progressState/index.js.map +0 -1
- package/dist/components/progressState/style.less +0 -65
- package/dist/components/scan/index.js +0 -219
- package/dist/components/scan/index.js.map +0 -1
- package/dist/components/scan/index.less +0 -34
- package/dist/components/select/index.js +0 -28
- package/dist/components/select/index.js.map +0 -1
- package/dist/components/select/index.less +0 -12
- package/dist/components/settlement/asyncModal.js +0 -204
- package/dist/components/settlement/asyncModal.js.map +0 -1
- package/dist/components/settlement/index.js +0 -16
- package/dist/components/settlement/index.js.map +0 -1
- package/dist/components/settlement/prototypeTable/index.js +0 -349
- package/dist/components/settlement/prototypeTable/index.js.map +0 -1
- package/dist/components/settlement/prototypeTable/style.less +0 -59
- package/dist/components/settlement/prototypeTable/utils.js +0 -14
- package/dist/components/settlement/prototypeTable/utils.js.map +0 -1
- package/dist/components/settlement/settlement.js +0 -5477
- package/dist/components/settlement/settlement.js.map +0 -1
- package/dist/components/settlement/settlement.less +0 -1595
- package/dist/components/settlement/settlementStore.js +0 -2121
- package/dist/components/settlement/settlementStore.js.map +0 -1
- package/dist/components/settlement/utils.js +0 -249
- package/dist/components/settlement/utils.js.map +0 -1
- package/dist/components/socket/index.js +0 -220
- package/dist/components/socket/index.js.map +0 -1
- package/dist/components/spin/index.js +0 -95
- package/dist/components/spin/index.js.map +0 -1
- package/dist/components/spin/spin-style.less +0 -436
- package/dist/components/test/index.js +0 -330
- package/dist/components/test/index.js.map +0 -1
- package/dist/components/ticon/iconfont/demo.css +0 -539
- package/dist/components/ticon/iconfont/demo_index.html +0 -5202
- package/dist/components/ticon/iconfont/iconfont.css +0 -887
- package/dist/components/ticon/iconfont/iconfont.eot +0 -0
- package/dist/components/ticon/iconfont/iconfont.js +0 -35
- package/dist/components/ticon/iconfont/iconfont.js.map +0 -1
- package/dist/components/ticon/iconfont/iconfont.json +0 -1535
- package/dist/components/ticon/iconfont/iconfont.svg +0 -593
- package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
- package/dist/components/ticon/index.js +0 -60
- package/dist/components/ticon/index.js.map +0 -1
- package/dist/components/touchScroll/index.js +0 -182
- package/dist/components/touchScroll/index.js.map +0 -1
- package/dist/components/touchTable/AuthProcess.js +0 -42
- package/dist/components/touchTable/AuthProcess.js.map +0 -1
- package/dist/components/touchTable/generateWater.js +0 -59
- package/dist/components/touchTable/generateWater.js.map +0 -1
- package/dist/components/touchTable/index.js +0 -1110
- package/dist/components/touchTable/index.js.map +0 -1
- package/dist/components/touchTable/index.less +0 -370
- package/dist/components/touchTable/utils.js +0 -14
- package/dist/components/touchTable/utils.js.map +0 -1
- package/dist/demo/PopOverDemo.js +0 -126
- package/dist/demo/PopOverDemo.js.map +0 -1
- package/dist/index.js +0 -261
- package/dist/index.js.map +0 -1
- package/dist/util/tools.js +0 -202
- package/dist/util/tools.js.map +0 -1
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = undefined;
|
|
7
|
-
|
|
8
|
-
var _defineProperty = require('babel-runtime/core-js/object/define-property');
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(_defineProperty);
|
|
11
|
-
|
|
12
|
-
var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor');
|
|
13
|
-
|
|
14
|
-
var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);
|
|
15
|
-
|
|
16
|
-
var _extends2 = require('babel-runtime/helpers/extends');
|
|
17
|
-
|
|
18
|
-
var _extends3 = _interopRequireDefault(_extends2);
|
|
19
|
-
|
|
20
|
-
var _regenerator = require('babel-runtime/regenerator');
|
|
21
|
-
|
|
22
|
-
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
23
|
-
|
|
24
|
-
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
|
|
25
|
-
|
|
26
|
-
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
|
27
|
-
|
|
28
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
29
|
-
|
|
30
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
31
|
-
|
|
32
|
-
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
33
|
-
|
|
34
|
-
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
35
|
-
|
|
36
|
-
var _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
|
|
37
|
-
|
|
38
|
-
var _mobx = require('mobx');
|
|
39
|
-
|
|
40
|
-
var _api = require('./api');
|
|
41
|
-
|
|
42
|
-
var _api2 = _interopRequireDefault(_api);
|
|
43
|
-
|
|
44
|
-
var _message = require('../message');
|
|
45
|
-
|
|
46
|
-
var _message2 = _interopRequireDefault(_message);
|
|
47
|
-
|
|
48
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
|
-
|
|
50
|
-
function _initDefineProp(target, property, descriptor, context) {
|
|
51
|
-
if (!descriptor) return;
|
|
52
|
-
(0, _defineProperty2.default)(target, property, {
|
|
53
|
-
enumerable: descriptor.enumerable,
|
|
54
|
-
configurable: descriptor.configurable,
|
|
55
|
-
writable: descriptor.writable,
|
|
56
|
-
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function _initializerWarningHelper(descriptor, context) {
|
|
61
|
-
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
|
65
|
-
var desc = {};
|
|
66
|
-
Object['ke' + 'ys'](descriptor).forEach(function (key) {
|
|
67
|
-
desc[key] = descriptor[key];
|
|
68
|
-
});
|
|
69
|
-
desc.enumerable = !!desc.enumerable;
|
|
70
|
-
desc.configurable = !!desc.configurable;
|
|
71
|
-
|
|
72
|
-
if ('value' in desc || desc.initializer) {
|
|
73
|
-
desc.writable = true;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
|
77
|
-
return decorator(target, property, desc) || desc;
|
|
78
|
-
}, desc);
|
|
79
|
-
|
|
80
|
-
if (context && desc.initializer !== void 0) {
|
|
81
|
-
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
|
82
|
-
desc.initializer = undefined;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (desc.initializer === void 0) {
|
|
86
|
-
Object['define' + 'Property'](target, property, desc);
|
|
87
|
-
desc = null;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return desc;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
var InventoryStore = (_class = function () {
|
|
94
|
-
function InventoryStore() {
|
|
95
|
-
(0, _classCallCheck3.default)(this, InventoryStore);
|
|
96
|
-
|
|
97
|
-
_initDefineProp(this, 'list1', _descriptor, this);
|
|
98
|
-
|
|
99
|
-
_initDefineProp(this, 'list2', _descriptor2, this);
|
|
100
|
-
|
|
101
|
-
_initDefineProp(this, 'TotalPage1', _descriptor3, this);
|
|
102
|
-
|
|
103
|
-
_initDefineProp(this, 'TotalPage2', _descriptor4, this);
|
|
104
|
-
|
|
105
|
-
_initDefineProp(this, 'loading', _descriptor5, this);
|
|
106
|
-
|
|
107
|
-
_initDefineProp(this, 'searchDesigns', _descriptor6, this);
|
|
108
|
-
|
|
109
|
-
this.params = {
|
|
110
|
-
Key: '',
|
|
111
|
-
IsQueryAround: false,
|
|
112
|
-
IsInCludeZero: false,
|
|
113
|
-
CurrentPage: 1,
|
|
114
|
-
PageSize: 15,
|
|
115
|
-
IdStore: ''
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
(0, _createClass3.default)(InventoryStore, [{
|
|
120
|
-
key: 'init',
|
|
121
|
-
value: function init(_ref) {
|
|
122
|
-
var IdStore = _ref.IdStore;
|
|
123
|
-
|
|
124
|
-
this.getSearchDesigns();
|
|
125
|
-
// this.getList1(this.params);
|
|
126
|
-
// this.getList2({...this.params, IsQueryAround: true});
|
|
127
|
-
this.params.IdStore = IdStore;
|
|
128
|
-
} // 自家门店 的库存
|
|
129
|
-
// 周边门店 的库存
|
|
130
|
-
|
|
131
|
-
}, {
|
|
132
|
-
key: 'getSearchDesigns',
|
|
133
|
-
value: function () {
|
|
134
|
-
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
|
135
|
-
var _this = this;
|
|
136
|
-
|
|
137
|
-
var _ref3, list;
|
|
138
|
-
|
|
139
|
-
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
140
|
-
while (1) {
|
|
141
|
-
switch (_context.prev = _context.next) {
|
|
142
|
-
case 0:
|
|
143
|
-
_context.next = 2;
|
|
144
|
-
return _api2.default.getPOSSearchDesigns('Inventory');
|
|
145
|
-
|
|
146
|
-
case 2:
|
|
147
|
-
_ref3 = _context.sent;
|
|
148
|
-
list = _ref3.list;
|
|
149
|
-
|
|
150
|
-
(0, _mobx.runInAction)(function () {
|
|
151
|
-
_this.searchDesigns = list.sort(function (a, b) {
|
|
152
|
-
return a.ShowIndex - b.ShowIndex;
|
|
153
|
-
});;
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
case 5:
|
|
157
|
-
case 'end':
|
|
158
|
-
return _context.stop();
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}, _callee, this);
|
|
162
|
-
}));
|
|
163
|
-
|
|
164
|
-
function getSearchDesigns() {
|
|
165
|
-
return _ref2.apply(this, arguments);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return getSearchDesigns;
|
|
169
|
-
}()
|
|
170
|
-
}, {
|
|
171
|
-
key: 'search1',
|
|
172
|
-
value: function search1(key, IsInCludeZero) {
|
|
173
|
-
// if (tabNumber == 1) {
|
|
174
|
-
this.params.IsInCludeZero = IsInCludeZero;
|
|
175
|
-
this.getList1((0, _extends3.default)({}, this.params, { Key: key, IsInCludeZero: IsInCludeZero }));
|
|
176
|
-
// } else if (tabNumber == 2) {
|
|
177
|
-
// }
|
|
178
|
-
}
|
|
179
|
-
}, {
|
|
180
|
-
key: 'search2',
|
|
181
|
-
value: function search2(key, IsInCludeZero) {
|
|
182
|
-
this.params.IsInCludeZero = IsInCludeZero;
|
|
183
|
-
this.getList2((0, _extends3.default)({}, this.params, { Key: key, IsQueryAround: true, IsInCludeZero: IsInCludeZero }));
|
|
184
|
-
}
|
|
185
|
-
}, {
|
|
186
|
-
key: 'searchMore',
|
|
187
|
-
value: function searchMore(key, pageNo) {
|
|
188
|
-
var pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 15;
|
|
189
|
-
var type = arguments[3];
|
|
190
|
-
|
|
191
|
-
if (type == 1) {
|
|
192
|
-
this.getList1((0, _extends3.default)({}, this.params, { Key: key, CurrentPage: pageNo, PageSize: pageSize }));
|
|
193
|
-
} else if (type == 2) {
|
|
194
|
-
this.getList2((0, _extends3.default)({}, this.params, { Key: key, IsQueryAround: true, CurrentPage: pageNo, PageSize: pageSize }));
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}, {
|
|
198
|
-
key: 'getList1',
|
|
199
|
-
value: function () {
|
|
200
|
-
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(params) {
|
|
201
|
-
var _this2 = this;
|
|
202
|
-
|
|
203
|
-
var _ref5, TotalPage, Data, TotalCount;
|
|
204
|
-
|
|
205
|
-
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
206
|
-
while (1) {
|
|
207
|
-
switch (_context2.prev = _context2.next) {
|
|
208
|
-
case 0:
|
|
209
|
-
this.loading = true;
|
|
210
|
-
_context2.next = 3;
|
|
211
|
-
return _api2.default.searchInventoryAvailableQuantity(params);
|
|
212
|
-
|
|
213
|
-
case 3:
|
|
214
|
-
_ref5 = _context2.sent;
|
|
215
|
-
TotalPage = _ref5.TotalPage;
|
|
216
|
-
Data = _ref5.Data;
|
|
217
|
-
TotalCount = _ref5.TotalCount;
|
|
218
|
-
|
|
219
|
-
if (!TotalCount || TotalCount == 0) {
|
|
220
|
-
_message2.default.error('无库存信息');
|
|
221
|
-
}
|
|
222
|
-
(0, _mobx.runInAction)(function () {
|
|
223
|
-
_this2.list1 = Data;
|
|
224
|
-
_this2.TotalPage1 = TotalPage;
|
|
225
|
-
_this2.loading = false;
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
case 9:
|
|
229
|
-
case 'end':
|
|
230
|
-
return _context2.stop();
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}, _callee2, this);
|
|
234
|
-
}));
|
|
235
|
-
|
|
236
|
-
function getList1(_x2) {
|
|
237
|
-
return _ref4.apply(this, arguments);
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return getList1;
|
|
241
|
-
}()
|
|
242
|
-
}, {
|
|
243
|
-
key: 'getList2',
|
|
244
|
-
value: function () {
|
|
245
|
-
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(params) {
|
|
246
|
-
var _this3 = this;
|
|
247
|
-
|
|
248
|
-
var _ref7, TotalPage, Data, TotalCount;
|
|
249
|
-
|
|
250
|
-
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
251
|
-
while (1) {
|
|
252
|
-
switch (_context3.prev = _context3.next) {
|
|
253
|
-
case 0:
|
|
254
|
-
this.loading = true;
|
|
255
|
-
_context3.next = 3;
|
|
256
|
-
return _api2.default.searchInventoryAvailableQuantity(params);
|
|
257
|
-
|
|
258
|
-
case 3:
|
|
259
|
-
_ref7 = _context3.sent;
|
|
260
|
-
TotalPage = _ref7.TotalPage;
|
|
261
|
-
Data = _ref7.Data;
|
|
262
|
-
TotalCount = _ref7.TotalCount;
|
|
263
|
-
|
|
264
|
-
if (!TotalCount || TotalCount == 0) {
|
|
265
|
-
_message2.default.error('无库存信息');
|
|
266
|
-
}
|
|
267
|
-
(0, _mobx.runInAction)(function () {
|
|
268
|
-
_this3.list2 = Data && Data.map(function (item, i) {
|
|
269
|
-
item.key = i;
|
|
270
|
-
item.WarehouseName = item.StoreName;
|
|
271
|
-
return item;
|
|
272
|
-
});
|
|
273
|
-
_this3.TotalPage2 = TotalPage;
|
|
274
|
-
_this3.loading = false;
|
|
275
|
-
});
|
|
276
|
-
|
|
277
|
-
case 9:
|
|
278
|
-
case 'end':
|
|
279
|
-
return _context3.stop();
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}, _callee3, this);
|
|
283
|
-
}));
|
|
284
|
-
|
|
285
|
-
function getList2(_x3) {
|
|
286
|
-
return _ref6.apply(this, arguments);
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
return getList2;
|
|
290
|
-
}()
|
|
291
|
-
}, {
|
|
292
|
-
key: 'toJSList1',
|
|
293
|
-
get: function get() {
|
|
294
|
-
return (0, _mobx.toJS)(this.list1).map(function (item, i) {
|
|
295
|
-
item.key = i;
|
|
296
|
-
return item;
|
|
297
|
-
});
|
|
298
|
-
// return [];
|
|
299
|
-
}
|
|
300
|
-
}, {
|
|
301
|
-
key: 'toJSList2',
|
|
302
|
-
get: function get() {
|
|
303
|
-
return (0, _mobx.toJS)(this.list2);
|
|
304
|
-
}
|
|
305
|
-
}, {
|
|
306
|
-
key: 'toJSSearchDesigns',
|
|
307
|
-
get: function get() {
|
|
308
|
-
return (0, _mobx.toJS)(this.searchDesigns);
|
|
309
|
-
}
|
|
310
|
-
}]);
|
|
311
|
-
return InventoryStore;
|
|
312
|
-
}(), (_applyDecoratedDescriptor(_class.prototype, 'init', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'init'), _class.prototype), _descriptor = _applyDecoratedDescriptor(_class.prototype, 'list1', [_mobx.observable], {
|
|
313
|
-
enumerable: true,
|
|
314
|
-
initializer: function initializer() {
|
|
315
|
-
return [];
|
|
316
|
-
}
|
|
317
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'list2', [_mobx.observable], {
|
|
318
|
-
enumerable: true,
|
|
319
|
-
initializer: function initializer() {
|
|
320
|
-
return [];
|
|
321
|
-
}
|
|
322
|
-
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'TotalPage1', [_mobx.observable], {
|
|
323
|
-
enumerable: true,
|
|
324
|
-
initializer: function initializer() {
|
|
325
|
-
return 0;
|
|
326
|
-
}
|
|
327
|
-
}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'TotalPage2', [_mobx.observable], {
|
|
328
|
-
enumerable: true,
|
|
329
|
-
initializer: function initializer() {
|
|
330
|
-
return 0;
|
|
331
|
-
}
|
|
332
|
-
}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, 'loading', [_mobx.observable], {
|
|
333
|
-
enumerable: true,
|
|
334
|
-
initializer: function initializer() {
|
|
335
|
-
return false;
|
|
336
|
-
}
|
|
337
|
-
}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, 'searchDesigns', [_mobx.observable], {
|
|
338
|
-
enumerable: true,
|
|
339
|
-
initializer: function initializer() {
|
|
340
|
-
return [];
|
|
341
|
-
}
|
|
342
|
-
}), _applyDecoratedDescriptor(_class.prototype, 'getSearchDesigns', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getSearchDesigns'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getList1', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getList1'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'getList2', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'getList2'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'toJSList1', [_mobx.computed], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'toJSList1'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'toJSList2', [_mobx.computed], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'toJSList2'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'toJSSearchDesigns', [_mobx.computed], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'toJSSearchDesigns'), _class.prototype)), _class);
|
|
343
|
-
exports.default = InventoryStore;
|
|
344
|
-
//# sourceMappingURL=store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/inventorySearch/store.js"],"names":["InventoryStore","params","Key","IsQueryAround","IsInCludeZero","CurrentPage","PageSize","IdStore","getSearchDesigns","InventorySearchApi","getPOSSearchDesigns","list","searchDesigns","sort","a","b","ShowIndex","key","getList1","getList2","pageNo","pageSize","type","loading","searchInventoryAvailableQuantity","TotalPage","Data","TotalCount","Message","error","list1","TotalPage1","list2","map","item","i","WarehouseName","StoreName","TotalPage2","action","observable","computed"],"mappings":";;;;;;;;;;;;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CAArB;AAKA,yBAAKI,UAAL,GAAkBb,SAAlB;AACA,yBAAKF,OAAL,GAAe,KAAf;AACD,iBARD;;;;;;;;;;;;;;;;;;wBAWwB;AACxB,aAAO,gBAAK,KAAKO,KAAV,EAAiBG,GAAjB,CAAqB,UAACC,IAAD,EAAOC,CAAP,EAAa;AACvCD,aAAKjB,GAAL,GAAWkB,CAAX;AACA,eAAOD,IAAP;AACD,OAHM,CAAP;AAIA;AACD;;;wBAEyB;AACxB,aAAO,gBAAK,KAAKF,KAAV,CAAP;AACD;;;wBAEiC;AAChC,aAAO,gBAAK,KAAKpB,aAAV,CAAP;AACD;;;2DAhGA2B,Y,6JAOAC,gB;;;WAAmB,E;;yEACnBA,gB;;;WAAmB,E;;8EACnBA,gB;;;WAAwB,C;;8EACxBA,gB;;;WAAwB,C;;2EACxBA,gB;;;WAAqB,K;;iFACrBA,gB;;;WAA2B,E;;qEAW3BD,Y,8JA6BAA,Y,sJAaAA,Y,uJAiBAE,c,wJAQAA,c,gKAIAA,c;kBAlGkBzC,c","file":"store.js","sourcesContent":["import { observable, transaction, map, computed, when, reaction, runInAction, action, toJS, autorun } from 'mobx';\r\nimport InventorySearchApi from './api';\r\nimport Message from '../message';\r\n\r\nexport default class InventoryStore {\r\n\r\n constructor() {\r\n }\r\n @action init({ IdStore }) {\r\n this.getSearchDesigns();\r\n // this.getList1(this.params);\r\n // this.getList2({...this.params, IsQueryAround: true});\r\n this.params.IdStore = IdStore;\r\n }\r\n\r\n @observable list1 = []; // 自家门店 的库存\r\n @observable list2 = []; // 周边门店 的库存\r\n @observable TotalPage1 = 0;\r\n @observable TotalPage2 = 0;\r\n @observable loading = false;\r\n @observable searchDesigns = [];\r\n\r\n params = {\r\n Key: '',\r\n IsQueryAround: false,\r\n IsInCludeZero: false,\r\n CurrentPage: 1,\r\n PageSize: 15,\r\n IdStore: ''\r\n }\r\n\r\n @action async getSearchDesigns() {\r\n let {list} = await InventorySearchApi.getPOSSearchDesigns('Inventory');\r\n runInAction(() => {\r\n this.searchDesigns = list.sort((a, b) => a.ShowIndex - b.ShowIndex);;\r\n })\r\n }\r\n\r\n search1(key, IsInCludeZero) {\r\n // if (tabNumber == 1) {\r\n this.params.IsInCludeZero = IsInCludeZero;\r\n this.getList1({ ...this.params, Key: key, IsInCludeZero: IsInCludeZero });\r\n // } else if (tabNumber == 2) {\r\n // }\r\n }\r\n\r\n search2(key, IsInCludeZero) {\r\n this.params.IsInCludeZero = IsInCludeZero;\r\n this.getList2({ ...this.params, Key: key, IsQueryAround: true, IsInCludeZero: IsInCludeZero });\r\n }\r\n\r\n\r\n searchMore(key, pageNo, pageSize = 15, type) {\r\n if (type == 1) {\r\n this.getList1({ ...this.params, Key: key, CurrentPage: pageNo, PageSize: pageSize });\r\n } else if (type == 2) {\r\n this.getList2({ ...this.params, Key: key, IsQueryAround: true, CurrentPage: pageNo, PageSize: pageSize });\r\n }\r\n }\r\n\r\n @action async getList1(params) {\r\n this.loading = true;\r\n let { TotalPage, Data, TotalCount } = await InventorySearchApi.searchInventoryAvailableQuantity(params);\r\n if (!TotalCount || TotalCount == 0) {\r\n Message.error('无库存信息')\r\n }\r\n runInAction(() => {\r\n this.list1 = Data;\r\n this.TotalPage1 = TotalPage;\r\n this.loading = false;\r\n })\r\n }\r\n\r\n @action async getList2(params) {\r\n this.loading = true;\r\n let { TotalPage, Data, TotalCount } = await InventorySearchApi.searchInventoryAvailableQuantity(params);\r\n if (!TotalCount || TotalCount == 0) {\r\n Message.error('无库存信息')\r\n }\r\n runInAction(() => {\r\n this.list2 = Data && Data.map((item, i) => {\r\n item.key = i;\r\n item.WarehouseName = item.StoreName;\r\n return item;\r\n })\r\n this.TotalPage2 = TotalPage;\r\n this.loading = false;\r\n })\r\n }\r\n\r\n @computed get toJSList1() {\r\n return toJS(this.list1).map((item, i) => {\r\n item.key = i;\r\n return item;\r\n });\r\n // return [];\r\n }\r\n\r\n @computed get toJSList2() {\r\n return toJS(this.list2);\r\n }\r\n\r\n @computed get toJSSearchDesigns() {\r\n return toJS(this.searchDesigns);\r\n }\r\n}"]}
|
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = undefined;
|
|
7
|
-
|
|
8
|
-
var _table = require('antd/es/table');
|
|
9
|
-
|
|
10
|
-
var _table2 = _interopRequireDefault(_table);
|
|
11
|
-
|
|
12
|
-
var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
|
|
13
|
-
|
|
14
|
-
var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
|
|
15
|
-
|
|
16
|
-
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
17
|
-
|
|
18
|
-
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
19
|
-
|
|
20
|
-
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
21
|
-
|
|
22
|
-
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
23
|
-
|
|
24
|
-
var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
|
|
25
|
-
|
|
26
|
-
var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
|
|
27
|
-
|
|
28
|
-
var _inherits2 = require('babel-runtime/helpers/inherits');
|
|
29
|
-
|
|
30
|
-
var _inherits3 = _interopRequireDefault(_inherits2);
|
|
31
|
-
|
|
32
|
-
var _class;
|
|
33
|
-
|
|
34
|
-
require('antd/es/table/style');
|
|
35
|
-
|
|
36
|
-
var _react = require('react');
|
|
37
|
-
|
|
38
|
-
var _react2 = _interopRequireDefault(_react);
|
|
39
|
-
|
|
40
|
-
var _mutantsMicrofx = require('mutants-microfx');
|
|
41
|
-
|
|
42
|
-
var _index = require('../../index');
|
|
43
|
-
|
|
44
|
-
var _api = require('./api');
|
|
45
|
-
|
|
46
|
-
var _api2 = _interopRequireDefault(_api);
|
|
47
|
-
|
|
48
|
-
var _tools = require('../../util/tools');
|
|
49
|
-
|
|
50
|
-
var _tools2 = _interopRequireDefault(_tools);
|
|
51
|
-
|
|
52
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
53
|
-
|
|
54
|
-
var loadingIcon = 'https://newretail.static.chanjet.com/loading.gif';
|
|
55
|
-
|
|
56
|
-
var Tab = (0, _mutantsMicrofx.observer)(_class = function (_React$Component) {
|
|
57
|
-
(0, _inherits3.default)(Tab, _React$Component);
|
|
58
|
-
|
|
59
|
-
function Tab(props) {
|
|
60
|
-
(0, _classCallCheck3.default)(this, Tab);
|
|
61
|
-
|
|
62
|
-
var _this2 = (0, _possibleConstructorReturn3.default)(this, (Tab.__proto__ || (0, _getPrototypeOf2.default)(Tab)).call(this, props));
|
|
63
|
-
|
|
64
|
-
_this2.onRowClick = function (record, index) {
|
|
65
|
-
_this2.props.onRowClick && _this2.props.onRowClick(record, _this2.props.type);
|
|
66
|
-
_this2.setState({ selectedRowIndex: index });
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
_this2.resetPageNo = function () {
|
|
70
|
-
_this2.setState({
|
|
71
|
-
activePage: 1
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
_this2.previous = function () {
|
|
76
|
-
_this2.setState({
|
|
77
|
-
activePage: _this2.state.activePage - 1
|
|
78
|
-
}, function () {
|
|
79
|
-
_this2.props.store.searchMore(_this2.props.searchValue, _this2.state.activePage, 15, _this2.props.type);
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
_this2.next = function () {
|
|
84
|
-
_this2.setState({
|
|
85
|
-
activePage: _this2.state.activePage + 1
|
|
86
|
-
}, function () {
|
|
87
|
-
_this2.props.store.searchMore(_this2.props.searchValue, _this2.state.activePage, 15, _this2.props.type);
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
_this2.getRowClassName = function (record, index) {
|
|
92
|
-
var selectedRowIndex = _this2.state.selectedRowIndex;
|
|
93
|
-
|
|
94
|
-
if (selectedRowIndex == index) {
|
|
95
|
-
return 'row-selected';
|
|
96
|
-
} else {
|
|
97
|
-
return '';
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
_this2.getNewColumnsList = function (type, searchDesigns) {
|
|
102
|
-
var columns = [];
|
|
103
|
-
//周边门店要显示门店名称
|
|
104
|
-
if (type == '2') {
|
|
105
|
-
columns.push({
|
|
106
|
-
title: '门店名称',
|
|
107
|
-
width: 120,
|
|
108
|
-
dataIndex: 'WarehouseName',
|
|
109
|
-
key: 'WarehouseName',
|
|
110
|
-
fixed: 'left',
|
|
111
|
-
render: function render(text, record, index) {
|
|
112
|
-
return _react2.default.createElement(
|
|
113
|
-
'div',
|
|
114
|
-
{ className: 'text-2line-overflow' },
|
|
115
|
-
text
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
searchDesigns.map(function (item) {
|
|
121
|
-
var _ref = item || {},
|
|
122
|
-
OriginalTitle = _ref.OriginalTitle,
|
|
123
|
-
FieldName = _ref.FieldName,
|
|
124
|
-
Precision = _ref.Precision,
|
|
125
|
-
IsFormat = _ref.IsFormat;
|
|
126
|
-
|
|
127
|
-
var newItem = {
|
|
128
|
-
title: OriginalTitle,
|
|
129
|
-
width: 100,
|
|
130
|
-
dataIndex: FieldName,
|
|
131
|
-
key: FieldName,
|
|
132
|
-
Precision: Precision,
|
|
133
|
-
IsFormat: IsFormat,
|
|
134
|
-
ellipsis: true
|
|
135
|
-
};
|
|
136
|
-
switch (FieldName) {
|
|
137
|
-
case 'InventoryName':
|
|
138
|
-
newItem.width = 160;
|
|
139
|
-
newItem.render = function (text, record, index) {
|
|
140
|
-
return _react2.default.createElement(
|
|
141
|
-
'div',
|
|
142
|
-
{ className: 'text-2line-overflow' },
|
|
143
|
-
text
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
break;
|
|
147
|
-
case 'InventoryCode':
|
|
148
|
-
newItem.width = 160;break;
|
|
149
|
-
case 'ExistingBaseQuantity':
|
|
150
|
-
newItem.width = 80;break;
|
|
151
|
-
}
|
|
152
|
-
if ((Precision || Precision == 0) && IsFormat) {
|
|
153
|
-
newItem.render = function (text, record, index) {
|
|
154
|
-
var renderText = _api2.default.formatNumber(text, Precision);
|
|
155
|
-
return _react2.default.createElement(
|
|
156
|
-
'span',
|
|
157
|
-
null,
|
|
158
|
-
renderText
|
|
159
|
-
);
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {
|
|
163
|
-
newItem.render = function (text, record, index) {
|
|
164
|
-
var renderText = _tools2.default.dateFormat(text);
|
|
165
|
-
return _react2.default.createElement(
|
|
166
|
-
'span',
|
|
167
|
-
null,
|
|
168
|
-
renderText
|
|
169
|
-
);
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
columns.push(newItem);
|
|
173
|
-
});
|
|
174
|
-
return columns;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
_this2.getLoadingIcon = function () {
|
|
178
|
-
return _react2.default.createElement('img', { src: loadingIcon, style: { width: '200px', height: '189px' } });
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
_this2.state = {
|
|
182
|
-
activePage: 1,
|
|
183
|
-
emptyHeight: 200,
|
|
184
|
-
selectedRowIndex: -1
|
|
185
|
-
};
|
|
186
|
-
return _this2;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
(0, _createClass3.default)(Tab, [{
|
|
190
|
-
key: 'componentDidMount',
|
|
191
|
-
value: function componentDidMount() {
|
|
192
|
-
this.setTableHeight();
|
|
193
|
-
this.windowEvent = this.setTableHeight.bind(this);
|
|
194
|
-
window.addEventListener('resize', this.windowEvent);
|
|
195
|
-
}
|
|
196
|
-
}, {
|
|
197
|
-
key: 'componentWillUnmount',
|
|
198
|
-
value: function componentWillUnmount() {
|
|
199
|
-
window.removeEventListener('resize', this.windowEvent);
|
|
200
|
-
}
|
|
201
|
-
}, {
|
|
202
|
-
key: 'setTableHeight',
|
|
203
|
-
value: function setTableHeight() {
|
|
204
|
-
var _this = this;
|
|
205
|
-
setTimeout(function () {
|
|
206
|
-
var height = Number(_this.tabDom.clientHeight - 200);
|
|
207
|
-
_this.setState({ tableHeight: height });
|
|
208
|
-
}, 0);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// 获取列字段集合
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
// loading图标
|
|
215
|
-
|
|
216
|
-
}, {
|
|
217
|
-
key: 'render',
|
|
218
|
-
value: function render() {
|
|
219
|
-
var _this3 = this;
|
|
220
|
-
|
|
221
|
-
var activePage = this.state.activePage;
|
|
222
|
-
var _props = this.props,
|
|
223
|
-
dataSource = _props.dataSource,
|
|
224
|
-
TotalPage = _props.TotalPage,
|
|
225
|
-
loading = _props.loading,
|
|
226
|
-
type = _props.type,
|
|
227
|
-
searchDesigns = _props.searchDesigns;
|
|
228
|
-
|
|
229
|
-
var columns = this.getNewColumnsList(type, searchDesigns);
|
|
230
|
-
return _react2.default.createElement(
|
|
231
|
-
'div',
|
|
232
|
-
{ ref: function ref(dom) {
|
|
233
|
-
_this3.tabDom = dom;
|
|
234
|
-
},
|
|
235
|
-
className: (dataSource && dataSource.length > 0 ? 'inventoryTable' : '') + ' inventory-tab ' + (type == '2' ? 'table2' : 'table1') },
|
|
236
|
-
dataSource && dataSource.length > 0 ? _react2.default.createElement(_table2.default, {
|
|
237
|
-
columns: columns,
|
|
238
|
-
dataSource: dataSource,
|
|
239
|
-
scroll: { y: "calc(~'100% - 43px')" },
|
|
240
|
-
loading: {
|
|
241
|
-
spinning: loading,
|
|
242
|
-
indicator: this.getLoadingIcon()
|
|
243
|
-
},
|
|
244
|
-
pagination: false,
|
|
245
|
-
rowClassName: this.getRowClassName,
|
|
246
|
-
onRow: function onRow(record, index) {
|
|
247
|
-
return {
|
|
248
|
-
onClick: function onClick() {
|
|
249
|
-
return _this3.onRowClick(record, index);
|
|
250
|
-
}
|
|
251
|
-
};
|
|
252
|
-
} }) : _react2.default.createElement(_index.ProgressState, {
|
|
253
|
-
state: loading ? 'load' : "empty",
|
|
254
|
-
stateCommonStyle: { height: "100%" },
|
|
255
|
-
empty: { info: '暂无数据~~', buttonVisible: false } }),
|
|
256
|
-
!(TotalPage == 0 || !TotalPage) && _react2.default.createElement(
|
|
257
|
-
'div',
|
|
258
|
-
{ className: 'primary-color', style: { fontSize: '13px' } },
|
|
259
|
-
'\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u4E2D\u8BE5\u884C\u5546\u54C1\u53EF\u76F4\u63A5\u5E26\u5165\u81F3\u5F00\u5355\u9875'
|
|
260
|
-
),
|
|
261
|
-
_react2.default.createElement(_index.Page, {
|
|
262
|
-
total: TotalPage,
|
|
263
|
-
currentIndex: activePage,
|
|
264
|
-
previous: this.previous,
|
|
265
|
-
next: this.next,
|
|
266
|
-
className: 'inventory-page'
|
|
267
|
-
})
|
|
268
|
-
);
|
|
269
|
-
}
|
|
270
|
-
}]);
|
|
271
|
-
return Tab;
|
|
272
|
-
}(_react2.default.Component)) || _class;
|
|
273
|
-
|
|
274
|
-
exports.default = Tab;
|
|
275
|
-
//# sourceMappingURL=tab.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/inventorySearch/tab.js"],"names":["loadingIcon","Tab","observer","props","onRowClick","record","index","type","setState","selectedRowIndex","resetPageNo","activePage","previous","state","store","searchMore","searchValue","next","getRowClassName","getNewColumnsList","searchDesigns","columns","push","title","width","dataIndex","key","fixed","render","text","map","item","OriginalTitle","FieldName","Precision","IsFormat","newItem","ellipsis","renderText","InventorySearchApi","formatNumber","tools","dateFormat","getLoadingIcon","height","emptyHeight","setTableHeight","windowEvent","bind","window","addEventListener","removeEventListener","_this","setTimeout","Number","tabDom","clientHeight","tableHeight","dataSource","TotalPage","loading","dom","length","y","spinning","indicator","onClick","info","buttonVisible","fontSize","React","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;AAEA;;AACA;;AACA;;;;AACA;;;;;;AAEA,IAAMA,cAAc,kDAApB;;IAGqBC,G,OADpBC,wB;;;AAEC,eAAYC,KAAZ,EAAmB;AAAA;;AAAA,iIACXA,KADW;;AAAA,WA0BnBC,UA1BmB,GA0BN,UAACC,MAAD,EAASC,KAAT,EAAmB;AAC9B,aAAKH,KAAL,CAAWC,UAAX,IAAyB,OAAKD,KAAL,CAAWC,UAAX,CAAsBC,MAAtB,EAA8B,OAAKF,KAAL,CAAWI,IAAzC,CAAzB;AACA,aAAKC,QAAL,CAAc,EAAEC,kBAAkBH,KAApB,EAAd;AACD,KA7BkB;;AAAA,WA+BnBI,WA/BmB,GA+BL,YAAM;AAClB,aAAKF,QAAL,CAAc;AACZG,oBAAY;AADA,OAAd;AAGD,KAnCkB;;AAAA,WAqCnBC,QArCmB,GAqCR,YAAM;AACf,aAAKJ,QAAL,CAAc;AACZG,oBAAY,OAAKE,KAAL,CAAWF,UAAX,GAAwB;AADxB,OAAd,EAEG,YAAM;AACP,eAAKR,KAAL,CAAWW,KAAX,CAAiBC,UAAjB,CAA4B,OAAKZ,KAAL,CAAWa,WAAvC,EAAoD,OAAKH,KAAL,CAAWF,UAA/D,EAA2E,EAA3E,EAA+E,OAAKR,KAAL,CAAWI,IAA1F;AACD,OAJD;AAKD,KA3CkB;;AAAA,WA6CnBU,IA7CmB,GA6CZ,YAAM;AACX,aAAKT,QAAL,CAAc;AACZG,oBAAY,OAAKE,KAAL,CAAWF,UAAX,GAAwB;AADxB,OAAd,EAEG,YAAM;AACP,eAAKR,KAAL,CAAWW,KAAX,CAAiBC,UAAjB,CAA4B,OAAKZ,KAAL,CAAWa,WAAvC,EAAoD,OAAKH,KAAL,CAAWF,UAA/D,EAA2E,EAA3E,EAA+E,OAA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BC,MAAhB,EAAwBC,KAAxB,CAAN;AAAA;AADJ,aAAP;AAGD,WAdH,GADF,GAiBE,8BAAC,oBAAD;AACE,iBAAOsD,UAAS,MAAT,GAAiB,OAD1B;AAEE,4BAAkB,EAAEhB,QAAQ,MAAV,EAFpB;AAGE,iBAAO,EAAEuB,MAAM,QAAR,EAAkBC,eAAe,KAAjC,EAHT,GApBN;AAyBG,UAAET,aAAa,CAAb,IAAkB,CAACA,SAArB,KAAmC;AAAA;AAAA,YAAK,WAAU,eAAf,EAA+B,OAAO,EAAEU,UAAU,MAAZ,EAAtC;AAAA;AAAA,SAzBtC;AA0BE,sCAAC,WAAD;AACE,iBAAOV,SADT;AAEE,wBAAchD,UAFhB;AAGE,oBAAU,KAAKC,QAHjB;AAIE,gBAAM,KAAKK,IAJb;AAKE,qBAAU;AALZ;AA1BF,OADF;AAoCD;;;EAjK8BqD,gBAAMC,S;;kBAAlBtE,G","file":"tab.js","sourcesContent":["import React from 'react';\r\nimport { Table } from 'antd';\r\nimport { observer } from 'mutants-microfx';\r\nimport { Page, ProgressState } from '../../index';\r\nimport InventorySearchApi from './api';\r\nimport tools from '../../util/tools';\r\n\r\nconst loadingIcon = 'https://newretail.static.chanjet.com/loading.gif';\r\n\r\n@observer\r\nexport default class Tab extends React.Component {\r\n constructor(props) {\r\n super(props);\r\n this.state = {\r\n activePage: 1,\r\n emptyHeight: 200,\r\n selectedRowIndex: -1\r\n };\r\n }\r\n componentDidMount() {\r\n this.setTableHeight();\r\n this.windowEvent = this.setTableHeight.bind(this);\r\n window.addEventListener('resize', this.windowEvent);\r\n }\r\n\r\n componentWillUnmount() {\r\n window.removeEventListener('resize', this.windowEvent);\r\n }\r\n\r\n setTableHeight() {\r\n let _this = this;\r\n setTimeout(() => {\r\n let height = Number(_this.tabDom.clientHeight - 200);\r\n _this.setState({ tableHeight: height })\r\n }, 0)\r\n }\r\n\r\n onRowClick = (record, index) => {\r\n this.props.onRowClick && this.props.onRowClick(record, this.props.type)\r\n this.setState({ selectedRowIndex: index })\r\n }\r\n\r\n resetPageNo = () => {\r\n this.setState({\r\n activePage: 1\r\n })\r\n }\r\n\r\n previous = () => {\r\n this.setState({\r\n activePage: this.state.activePage - 1\r\n }, () => {\r\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\r\n })\r\n }\r\n\r\n next = () => {\r\n this.setState({\r\n activePage: this.state.activePage + 1\r\n }, () => {\r\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\r\n })\r\n }\r\n getRowClassName = (record, index) => {\r\n const { selectedRowIndex } = this.state;\r\n if (selectedRowIndex == index) {\r\n return 'row-selected'\r\n } else {\r\n return '';\r\n }\r\n }\r\n\r\n // 获取列字段集合\r\n getNewColumnsList = (type, searchDesigns) => {\r\n let columns = [];\r\n //周边门店要显示门店名称\r\n if (type == '2') {\r\n columns.push({\r\n title: '门店名称',\r\n width: 120,\r\n dataIndex: 'WarehouseName',\r\n key: 'WarehouseName',\r\n fixed: 'left',\r\n render: (text, record, index) => {\r\n return <div className='text-2line-overflow'>{text}</div>\r\n }\r\n })\r\n }\r\n searchDesigns.map(item => {\r\n let { OriginalTitle, FieldName, Precision, IsFormat } = item || {};\r\n let newItem = {\r\n title: OriginalTitle,\r\n width: 100,\r\n dataIndex: FieldName,\r\n key: FieldName,\r\n Precision: Precision,\r\n IsFormat: IsFormat,\r\n ellipsis: true,\r\n }\r\n switch (FieldName) {\r\n case 'InventoryName':\r\n newItem.width = 160;\r\n newItem.render = (text, record, index) => {\r\n return <div className='text-2line-overflow'>{text}</div>\r\n }\r\n break;\r\n case 'InventoryCode': newItem.width = 160; break;\r\n case 'ExistingBaseQuantity': newItem.width = 80; break;\r\n }\r\n if ((Precision || Precision == 0) && IsFormat) {\r\n newItem.render = (text, record, index) => {\r\n let renderText = InventorySearchApi.formatNumber(text, Precision);\r\n return <span>{renderText}</span>\r\n }\r\n }\r\n if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {\r\n newItem.render = (text, record, index) => {\r\n let renderText = tools.dateFormat(text);\r\n return <span>{renderText}</span>\r\n }\r\n }\r\n columns.push(newItem);\r\n })\r\n return columns;\r\n }\r\n\r\n // loading图标\r\n getLoadingIcon = () => {\r\n return <img src={loadingIcon} style={{ width: '200px', height: '189px' }} />\r\n }\r\n\r\n render() {\r\n let { activePage } = this.state;\r\n let { dataSource, TotalPage, loading, type, searchDesigns } = this.props;\r\n let columns = this.getNewColumnsList(type, searchDesigns);\r\n return (\r\n <div ref={(dom) => { this.tabDom = dom }}\r\n className={`${dataSource && dataSource.length > 0 ? 'inventoryTable' : ''} inventory-tab ${type == '2' ? 'table2' : 'table1'}`}>\r\n {\r\n dataSource && dataSource.length > 0 ?\r\n <Table\r\n columns={columns}\r\n dataSource={dataSource}\r\n scroll={{ y: \"calc(~'100% - 43px')\" }}\r\n loading={{\r\n spinning: loading,\r\n indicator: this.getLoadingIcon()\r\n }}\r\n pagination={false}\r\n rowClassName={this.getRowClassName}\r\n onRow={(record, index) => {\r\n return {\r\n onClick: () => this.onRowClick(record, index)\r\n }\r\n }} />\r\n :\r\n <ProgressState\r\n state={loading? 'load': \"empty\"}\r\n stateCommonStyle={{ height: \"100%\" }}\r\n empty={{ info: '暂无数据~~', buttonVisible: false }} />\r\n }\r\n {!(TotalPage == 0 || !TotalPage) && <div className=\"primary-color\" style={{ fontSize: '13px'}}>温馨提示:点击选中该行商品可直接带入至开单页</div>}\r\n <Page\r\n total={TotalPage}\r\n currentIndex={activePage}\r\n previous={this.previous}\r\n next={this.next}\r\n className='inventory-page'\r\n />\r\n </div>\r\n )\r\n }\r\n}"]}
|