tplus-components-touch 3.54.1 → 3.55.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/cloudPrint/printTemplate/template.js +52 -0
- package/dist/components/cloudPrint/printTemplate/template.js.map +1 -0
- package/dist/components/commonForm/addressPicker/index.js +255 -0
- package/dist/components/commonForm/addressPicker/index.js.map +1 -0
- package/dist/components/commonForm/autoComplete/index.js +260 -0
- package/dist/components/commonForm/autoComplete/index.js.map +1 -0
- package/dist/components/commonForm/datePicker/index.js +92 -0
- package/dist/components/commonForm/datePicker/index.js.map +1 -0
- package/dist/components/commonForm/formControl/index.js +144 -0
- package/dist/components/commonForm/formControl/index.js.map +1 -0
- package/dist/components/commonForm/index.js +231 -0
- package/dist/components/commonForm/index.js.map +1 -0
- package/dist/components/commonForm/inputNumber/index.js +272 -0
- package/dist/components/commonForm/inputNumber/index.js.map +1 -0
- package/dist/components/commonForm/radio/index.js +132 -0
- package/dist/components/commonForm/radio/index.js.map +1 -0
- package/dist/components/deliverySearch/api.js +355 -0
- package/dist/components/deliverySearch/api.js.map +1 -0
- package/dist/components/deliverySearch/index.js +1222 -0
- package/dist/components/deliverySearch/index.js.map +1 -0
- package/dist/components/form/index.js +310 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/hardwareAPI/index.js +215 -0
- package/dist/components/hardwareAPI/index.js.map +1 -0
- package/dist/components/hotKey/config.js +306 -0
- package/dist/components/hotKey/config.js.map +1 -0
- package/dist/components/hotKey/hotKeyModal.js +479 -0
- package/dist/components/hotKey/hotKeyModal.js.map +1 -0
- package/dist/components/hotKey/index.js +795 -0
- package/dist/components/hotKey/index.js.map +1 -0
- package/dist/components/hotKey/localConfig.js +1216 -0
- package/dist/components/hotKey/localConfig.js.map +1 -0
- package/dist/components/hotKey/utils.js +135 -0
- package/dist/components/hotKey/utils.js.map +1 -0
- package/dist/components/input/index.js +254 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/scanInput.js +98 -0
- package/dist/components/input/scanInput.js.map +1 -0
- package/dist/components/input/tplusInput/index.js +81 -0
- package/dist/components/input/tplusInput/index.js.map +1 -0
- package/dist/components/input/tplusInput/inputContent.js +128 -0
- package/dist/components/input/tplusInput/inputContent.js.map +1 -0
- package/dist/components/input/tplusInput/inputs.js +151 -0
- package/dist/components/input/tplusInput/inputs.js.map +1 -0
- package/dist/components/input/utils/index.js +26 -0
- package/dist/components/input/utils/index.js.map +1 -0
- package/dist/components/inventorySearch/api.js +214 -0
- package/dist/components/inventorySearch/api.js.map +1 -0
- package/dist/components/inventorySearch/index.js +303 -0
- package/dist/components/inventorySearch/index.js.map +1 -0
- package/dist/components/inventorySearch/store.js +363 -0
- package/dist/components/inventorySearch/store.js.map +1 -0
- package/dist/components/inventorySearch/tab.js +280 -0
- package/dist/components/inventorySearch/tab.js.map +1 -0
- package/dist/components/keyboard/index.js +259 -0
- package/dist/components/keyboard/index.js.map +1 -0
- package/dist/components/keyboard/letterKeyboard.js +227 -0
- package/dist/components/keyboard/letterKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboard.js +469 -0
- package/dist/components/keyboard/numKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboardScan.js +208 -0
- package/dist/components/keyboard/numKeyboardScan.js.map +1 -0
- package/dist/components/keyboard/numberButton_input.js +305 -0
- package/dist/components/keyboard/numberButton_input.js.map +1 -0
- package/dist/components/keyboard/numkeyboardPassword.js +477 -0
- package/dist/components/keyboard/numkeyboardPassword.js.map +1 -0
- package/dist/components/keyboard/onlyKeyboard.js +90 -0
- package/dist/components/keyboard/onlyKeyboard.js.map +1 -0
- package/dist/components/keyboard/onlyLetterButton.js +187 -0
- package/dist/components/keyboard/onlyLetterButton.js.map +1 -0
- package/dist/components/keyboard/onlyLetterButton2.js +235 -0
- package/dist/components/keyboard/onlyLetterButton2.js.map +1 -0
- package/dist/components/keyboard/onlyNumberButton.js +128 -0
- package/dist/components/keyboard/onlyNumberButton.js.map +1 -0
- package/dist/components/keyboard/onlyNumberButton2.js +115 -0
- package/dist/components/keyboard/onlyNumberButton2.js.map +1 -0
- package/dist/components/keyboard/textKeyboard.js +50 -0
- package/dist/components/keyboard/textKeyboard.js.map +1 -0
- package/dist/components/layout/hamburger.js +29 -0
- package/dist/components/layout/hamburger.js.map +1 -0
- package/dist/components/layout/index.js +31 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/layout.js +182 -0
- package/dist/components/layout/layout.js.map +1 -0
- package/dist/components/layout/sider.js +167 -0
- package/dist/components/layout/sider.js.map +1 -0
- package/dist/components/loading/index.js +198 -0
- package/dist/components/loading/index.js.map +1 -0
- package/dist/components/loading/loadingContent.js +188 -0
- package/dist/components/loading/loadingContent.js.map +1 -0
- package/dist/components/loading/utils.js +29 -0
- package/dist/components/loading/utils.js.map +1 -0
- package/dist/components/message/index.js +309 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/modal/index.js +93 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modalVertical/index.js +325 -0
- package/dist/components/modalVertical/index.js.map +1 -0
- package/dist/components/modalWraper/index.js +485 -0
- package/dist/components/modalWraper/index.js.map +1 -0
- package/dist/components/modalWraper/utils.js +48 -0
- package/dist/components/modalWraper/utils.js.map +1 -0
- package/dist/components/notification/index.js +118 -0
- package/dist/components/notification/index.js.map +1 -0
- package/dist/components/overflowTip/index.js +269 -0
- package/dist/components/overflowTip/index.js.map +1 -0
- package/dist/components/page/index.js +49 -0
- package/dist/components/page/index.js.map +1 -0
- package/dist/components/presale/pickup.js +479 -0
- package/dist/components/presale/pickup.js.map +1 -0
- package/dist/components/product/detail.js +148 -0
- package/dist/components/product/detail.js.map +1 -0
- package/dist/components/product/getCard.js +145 -0
- package/dist/components/product/getCard.js.map +1 -0
- package/dist/components/progressState/EmptyAndErrorView.js +142 -0
- package/dist/components/progressState/EmptyAndErrorView.js.map +1 -0
- package/dist/components/progressState/ProgressState.js +158 -0
- package/dist/components/progressState/ProgressState.js.map +1 -0
- package/dist/components/progressState/index.js +14 -0
- package/dist/components/progressState/index.js.map +1 -0
- package/dist/components/scan/index.js +219 -0
- package/dist/components/scan/index.js.map +1 -0
- package/dist/components/select/index.js +28 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/settlement/asyncModal.js +207 -0
- package/dist/components/settlement/asyncModal.js.map +1 -0
- package/dist/components/settlement/index.js +25 -0
- package/dist/components/settlement/index.js.map +1 -0
- package/dist/components/settlement/moreCzkTable/index.js +156 -0
- package/dist/components/settlement/moreCzkTable/index.js.map +1 -0
- package/dist/components/settlement/prototypeTable/index.js +353 -0
- package/dist/components/settlement/prototypeTable/index.js.map +1 -0
- package/dist/components/settlement/prototypeTable/utils.js +14 -0
- package/dist/components/settlement/prototypeTable/utils.js.map +1 -0
- package/dist/components/settlement/settlement.js +5557 -0
- package/dist/components/settlement/settlement.js.map +1 -0
- package/dist/components/settlement/settlement.less +0 -10
- package/dist/components/settlement/settlementApi.js +512 -0
- package/dist/components/settlement/settlementApi.js.map +1 -0
- package/dist/components/settlement/settlementStore.js +2833 -0
- package/dist/components/settlement/settlementStore.js.map +1 -0
- package/dist/components/settlement/utils.js +249 -0
- package/dist/components/settlement/utils.js.map +1 -0
- package/dist/components/socket/index.js +221 -0
- package/dist/components/socket/index.js.map +1 -0
- package/dist/components/spin/index.js +95 -0
- package/dist/components/spin/index.js.map +1 -0
- package/dist/components/test/index.js +330 -0
- package/dist/components/test/index.js.map +1 -0
- package/dist/components/ticon/iconfont/demo_index.html +3 -72
- package/dist/components/ticon/iconfont/iconfont.css +3 -15
- package/dist/components/ticon/iconfont/iconfont.js +36 -0
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -0
- package/dist/components/ticon/iconfont/iconfont.json +0 -21
- 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 +60 -0
- package/dist/components/ticon/index.js.map +1 -0
- package/dist/components/touchScroll/index.js +186 -0
- package/dist/components/touchScroll/index.js.map +1 -0
- package/dist/components/touchTable/AuthProcess.js +42 -0
- package/dist/components/touchTable/AuthProcess.js.map +1 -0
- package/dist/components/touchTable/generateWater.js +59 -0
- package/dist/components/touchTable/generateWater.js.map +1 -0
- package/dist/components/touchTable/index.js +1148 -0
- package/dist/components/touchTable/index.js.map +1 -0
- package/dist/components/touchTable/utils.js +27 -0
- package/dist/components/touchTable/utils.js.map +1 -0
- package/dist/index.js +1 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/collection/api.js +0 -105
- package/dist/components/collection/api.js.map +0 -1
- package/dist/components/collection/searchView/index.less +0 -134
- package/dist/components/password/style.less +0 -95
@@ -0,0 +1,363 @@
|
|
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
|
+
this.params.IsInCludeZero = IsInCludeZero;
|
174
|
+
this.getList1((0, _extends3.default)({}, this.params, { Key: key, IsInCludeZero: IsInCludeZero }));
|
175
|
+
}
|
176
|
+
}, {
|
177
|
+
key: 'search2',
|
178
|
+
value: function search2(key, IsInCludeZero) {
|
179
|
+
this.params.IsInCludeZero = IsInCludeZero;
|
180
|
+
this.getList2((0, _extends3.default)({}, this.params, { Key: key, IsQueryAround: true, IsInCludeZero: IsInCludeZero }));
|
181
|
+
}
|
182
|
+
}, {
|
183
|
+
key: 'searchMore',
|
184
|
+
value: function searchMore(key, pageNo) {
|
185
|
+
var pageSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 15;
|
186
|
+
var type = arguments[3];
|
187
|
+
|
188
|
+
if (type == 1) {
|
189
|
+
this.getList1((0, _extends3.default)({}, this.params, { Key: key, CurrentPage: pageNo, PageSize: pageSize }));
|
190
|
+
} else if (type == 2) {
|
191
|
+
this.getList2((0, _extends3.default)({}, this.params, { Key: key, IsQueryAround: true, CurrentPage: pageNo, PageSize: pageSize }));
|
192
|
+
}
|
193
|
+
}
|
194
|
+
}, {
|
195
|
+
key: 'getList1',
|
196
|
+
value: function () {
|
197
|
+
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(params) {
|
198
|
+
var _this2 = this;
|
199
|
+
|
200
|
+
var _ref5, TotalPage, Data, TotalCount;
|
201
|
+
|
202
|
+
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
203
|
+
while (1) {
|
204
|
+
switch (_context2.prev = _context2.next) {
|
205
|
+
case 0:
|
206
|
+
_context2.prev = 0;
|
207
|
+
|
208
|
+
this.loading = true;
|
209
|
+
_context2.next = 4;
|
210
|
+
return _api2.default.searchInventoryAvailableQuantity(params);
|
211
|
+
|
212
|
+
case 4:
|
213
|
+
_ref5 = _context2.sent;
|
214
|
+
TotalPage = _ref5.TotalPage;
|
215
|
+
Data = _ref5.Data;
|
216
|
+
TotalCount = _ref5.TotalCount;
|
217
|
+
|
218
|
+
if (!TotalCount || TotalCount == 0) {
|
219
|
+
_message2.default.error('无库存信息');
|
220
|
+
}
|
221
|
+
(0, _mobx.runInAction)(function () {
|
222
|
+
_this2.list1 = Data;
|
223
|
+
_this2.TotalPage1 = TotalPage;
|
224
|
+
_this2.loading = false;
|
225
|
+
});
|
226
|
+
_context2.next = 16;
|
227
|
+
break;
|
228
|
+
|
229
|
+
case 12:
|
230
|
+
_context2.prev = 12;
|
231
|
+
_context2.t0 = _context2['catch'](0);
|
232
|
+
|
233
|
+
console.error('getList1获取库存信息报错', _context2.t0);
|
234
|
+
this.loading = false;
|
235
|
+
|
236
|
+
case 16:
|
237
|
+
case 'end':
|
238
|
+
return _context2.stop();
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}, _callee2, this, [[0, 12]]);
|
242
|
+
}));
|
243
|
+
|
244
|
+
function getList1(_x2) {
|
245
|
+
return _ref4.apply(this, arguments);
|
246
|
+
}
|
247
|
+
|
248
|
+
return getList1;
|
249
|
+
}()
|
250
|
+
}, {
|
251
|
+
key: 'getList2',
|
252
|
+
value: function () {
|
253
|
+
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(params) {
|
254
|
+
var _this3 = this;
|
255
|
+
|
256
|
+
var _ref7, TotalPage, Data, TotalCount;
|
257
|
+
|
258
|
+
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
259
|
+
while (1) {
|
260
|
+
switch (_context3.prev = _context3.next) {
|
261
|
+
case 0:
|
262
|
+
_context3.prev = 0;
|
263
|
+
|
264
|
+
this.loading = true;
|
265
|
+
_context3.next = 4;
|
266
|
+
return _api2.default.searchInventoryAvailableQuantity(params);
|
267
|
+
|
268
|
+
case 4:
|
269
|
+
_ref7 = _context3.sent;
|
270
|
+
TotalPage = _ref7.TotalPage;
|
271
|
+
Data = _ref7.Data;
|
272
|
+
TotalCount = _ref7.TotalCount;
|
273
|
+
|
274
|
+
if (!TotalCount || TotalCount == 0) {
|
275
|
+
_message2.default.error('无库存信息');
|
276
|
+
}
|
277
|
+
(0, _mobx.runInAction)(function () {
|
278
|
+
_this3.list2 = Data && Data.map(function (item, i) {
|
279
|
+
item.key = i;
|
280
|
+
item.WarehouseName = item.StoreName;
|
281
|
+
return item;
|
282
|
+
});
|
283
|
+
_this3.TotalPage2 = TotalPage;
|
284
|
+
_this3.loading = false;
|
285
|
+
});
|
286
|
+
|
287
|
+
_context3.next = 16;
|
288
|
+
break;
|
289
|
+
|
290
|
+
case 12:
|
291
|
+
_context3.prev = 12;
|
292
|
+
_context3.t0 = _context3['catch'](0);
|
293
|
+
|
294
|
+
console.error('getList2获取库存信息报错', _context3.t0);
|
295
|
+
this.loading = false;
|
296
|
+
|
297
|
+
case 16:
|
298
|
+
case 'end':
|
299
|
+
return _context3.stop();
|
300
|
+
}
|
301
|
+
}
|
302
|
+
}, _callee3, this, [[0, 12]]);
|
303
|
+
}));
|
304
|
+
|
305
|
+
function getList2(_x3) {
|
306
|
+
return _ref6.apply(this, arguments);
|
307
|
+
}
|
308
|
+
|
309
|
+
return getList2;
|
310
|
+
}()
|
311
|
+
}, {
|
312
|
+
key: 'toJSList1',
|
313
|
+
get: function get() {
|
314
|
+
return (0, _mobx.toJS)(this.list1).map(function (item, i) {
|
315
|
+
item.key = i;
|
316
|
+
return item;
|
317
|
+
});
|
318
|
+
}
|
319
|
+
}, {
|
320
|
+
key: 'toJSList2',
|
321
|
+
get: function get() {
|
322
|
+
return (0, _mobx.toJS)(this.list2);
|
323
|
+
}
|
324
|
+
}, {
|
325
|
+
key: 'toJSSearchDesigns',
|
326
|
+
get: function get() {
|
327
|
+
return (0, _mobx.toJS)(this.searchDesigns);
|
328
|
+
}
|
329
|
+
}]);
|
330
|
+
return InventoryStore;
|
331
|
+
}(), (_applyDecoratedDescriptor(_class.prototype, 'init', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'init'), _class.prototype), _descriptor = _applyDecoratedDescriptor(_class.prototype, 'list1', [_mobx.observable], {
|
332
|
+
enumerable: true,
|
333
|
+
initializer: function initializer() {
|
334
|
+
return [];
|
335
|
+
}
|
336
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'list2', [_mobx.observable], {
|
337
|
+
enumerable: true,
|
338
|
+
initializer: function initializer() {
|
339
|
+
return [];
|
340
|
+
}
|
341
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'TotalPage1', [_mobx.observable], {
|
342
|
+
enumerable: true,
|
343
|
+
initializer: function initializer() {
|
344
|
+
return 0;
|
345
|
+
}
|
346
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'TotalPage2', [_mobx.observable], {
|
347
|
+
enumerable: true,
|
348
|
+
initializer: function initializer() {
|
349
|
+
return 0;
|
350
|
+
}
|
351
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, 'loading', [_mobx.observable], {
|
352
|
+
enumerable: true,
|
353
|
+
initializer: function initializer() {
|
354
|
+
return false;
|
355
|
+
}
|
356
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, 'searchDesigns', [_mobx.observable], {
|
357
|
+
enumerable: true,
|
358
|
+
initializer: function initializer() {
|
359
|
+
return [];
|
360
|
+
}
|
361
|
+
}), _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);
|
362
|
+
exports.default = InventoryStore;
|
363
|
+
//# sourceMappingURL=store.js.map
|
@@ -0,0 +1 @@
|
|
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","console","list2","map","item","i","WarehouseName","StoreName","TotalPage2","action","observable","computed"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAEqBA,c;AAEnB,4BAAc;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA;;AAAA,SAgBdC,MAhBc,GAgBL;AACPC,WAAK,EADE;AAEPC,qBAAe,KAFR;AAGPC,qBAAe,KAHR;AAIPC,mBAAa,CAJN;AAKPC,gBAAU,EALH;AAMPC,eAAS;AANF,KAhBK;AACb;;;;+BACyB;AAAA,UAAXA,OAAW,QAAXA,OAAW;;AACxB,WAAKC,gBAAL;AACA;AACA;AACA,WAAKP,MAAL,CAAYM,OAAZ,GAAsBA,OAAtB;AACD,K,CAEuB;AACA;;;;;;;;;;;;;;;uBAgBHE,cAAmBC,mBAAnB,CAAuC,WAAvC,C;;;;AAAdC,oB,SAAAA,I;;AACL,uCAAY,YAAM;AAChB,wBAAKC,aAAL,GAAqBD,KAAKE,IAAL,CAAU,UAACC,CAAD,EAAIC,CAAJ;AAAA,2BAAUD,EAAEE,SAAF,GAAcD,EAAEC,SAA1B;AAAA,mBAAV,CAArB,CAAoE;AACrE,iBAFD;;;;;;;;;;;;;;;;;;4BAKMC,G,EAAKb,a,EAAe;AAC1B,WAAKH,MAAL,CAAYG,aAAZ,GAA4BA,aAA5B;AACA,WAAKc,QAAL,4BAAmB,KAAKjB,MAAxB,IAAgCC,KAAKe,GAArC,EAA0Cb,eAAeA,aAAzD;AACD;;;4BAEOa,G,EAAKb,a,EAAe;AAC1B,WAAKH,MAAL,CAAYG,aAAZ,GAA4BA,aAA5B;AACA,WAAKe,QAAL,4BAAmB,KAAKlB,MAAxB,IAAgCC,KAAKe,GAArC,EAA0Cd,eAAe,IAAzD,EAA+DC,eAAeA,a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AaP,QAAQA,KAAKQ,GAAL,CAAS,UAACC,IAAD,EAAOC,CAAP,EAAa;AACzCD,yBAAKlB,GAAL,GAAWmB,CAAX;AACAD,yBAAKE,aAAL,GAAqBF,KAAKG,SAA1B;AACA,2BAAOH,IAAP;AACD,mBAJoB,CAArB;AAKA,yBAAKI,UAAL,GAAkBd,SAAlB;AACA,yBAAKF,OAAL,GAAe,KAAf;AACD,iBARD;;;;;;;;;AAWAS,wBAAQH,KAAR,CAAc,kBAAd;AACA,qBAAKN,OAAL,GAAe,KAAf;;;;;;;;;;;;;;;;;;wBAIsB;AACxB,aAAO,gBAAK,KAAKO,KAAV,EAAiBI,GAAjB,CAAqB,UAACC,IAAD,EAAOC,CAAP,EAAa;AACvCD,aAAKlB,GAAL,GAAWmB,CAAX;AACA,eAAOD,IAAP;AACD,OAHM,CAAP;AAID;;;wBAEyB;AACxB,aAAO,gBAAK,KAAKF,KAAV,CAAP;AACD;;;wBAEiC;AAChC,aAAO,gBAAK,KAAKrB,aAAV,CAAP;AACD;;;2DAvGA4B,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,8JA0BAA,Y,sJAkBAA,Y,uJAuBAE,c,wJAOAA,c,gKAIAA,c;kBAzGkB1C,c","file":"store.js","sourcesContent":["import { observable, transaction, map, computed, when, reaction, runInAction, action, toJS, autorun } from 'mobx';\nimport InventorySearchApi from './api';\nimport Message from '../message';\n\nexport default class InventoryStore {\n\n constructor() {\n }\n @action init({ IdStore }) {\n this.getSearchDesigns();\n // this.getList1(this.params);\n // this.getList2({...this.params, IsQueryAround: true});\n this.params.IdStore = IdStore;\n }\n\n @observable list1 = []; // 自家门店 的库存\n @observable list2 = []; // 周边门店 的库存\n @observable TotalPage1 = 0;\n @observable TotalPage2 = 0;\n @observable loading = false;\n @observable searchDesigns = [];\n\n params = {\n Key: '',\n IsQueryAround: false,\n IsInCludeZero: false,\n CurrentPage: 1,\n PageSize: 15,\n IdStore: ''\n }\n\n @action async getSearchDesigns() {\n let {list} = await InventorySearchApi.getPOSSearchDesigns('Inventory');\n runInAction(() => {\n this.searchDesigns = list.sort((a, b) => a.ShowIndex - b.ShowIndex);;\n })\n }\n\n search1(key, IsInCludeZero) {\n this.params.IsInCludeZero = IsInCludeZero;\n this.getList1({ ...this.params, Key: key, IsInCludeZero: IsInCludeZero });\n }\n\n search2(key, IsInCludeZero) {\n this.params.IsInCludeZero = IsInCludeZero;\n this.getList2({ ...this.params, Key: key, IsQueryAround: true, IsInCludeZero: IsInCludeZero });\n }\n\n\n searchMore(key, pageNo, pageSize = 15, type) {\n if (type == 1) {\n this.getList1({ ...this.params, Key: key, CurrentPage: pageNo, PageSize: pageSize });\n } else if (type == 2) {\n this.getList2({ ...this.params, Key: key, IsQueryAround: true, CurrentPage: pageNo, PageSize: pageSize });\n }\n }\n\n @action async getList1(params) {\n try {\n this.loading = true;\n let { TotalPage, Data, TotalCount } = await InventorySearchApi.searchInventoryAvailableQuantity(params);\n if (!TotalCount || TotalCount == 0) {\n Message.error('无库存信息')\n }\n runInAction(() => {\n this.list1 = Data;\n this.TotalPage1 = TotalPage;\n this.loading = false;\n })\n } catch (ex) {\n console.error('getList1获取库存信息报错', ex);\n this.loading = false;\n }\n }\n\n @action async getList2(params) {\n try {\n this.loading = true;\n let { TotalPage, Data, TotalCount } = await InventorySearchApi.searchInventoryAvailableQuantity(params);\n if (!TotalCount || TotalCount == 0) {\n Message.error('无库存信息')\n }\n runInAction(() => {\n this.list2 = Data && Data.map((item, i) => {\n item.key = i;\n item.WarehouseName = item.StoreName;\n return item;\n })\n this.TotalPage2 = TotalPage;\n this.loading = false;\n })\n\n } catch (ex) {\n console.error('getList2获取库存信息报错', ex);\n this.loading = false;\n }\n }\n\n @computed get toJSList1() {\n return toJS(this.list1).map((item, i) => {\n item.key = i;\n return item;\n })\n }\n\n @computed get toJSList2() {\n return toJS(this.list2);\n }\n\n @computed get toJSSearchDesigns() {\n return toJS(this.searchDesigns);\n }\n}"]}
|
@@ -0,0 +1,280 @@
|
|
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 _mutantsUtil = require('mutants-util');
|
43
|
+
|
44
|
+
var _index = require('../../index');
|
45
|
+
|
46
|
+
var _api = require('./api');
|
47
|
+
|
48
|
+
var _api2 = _interopRequireDefault(_api);
|
49
|
+
|
50
|
+
var _tools = require('../../util/tools');
|
51
|
+
|
52
|
+
var _tools2 = _interopRequireDefault(_tools);
|
53
|
+
|
54
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
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.sys_parms = {
|
65
|
+
orangeloading: window.ossAliyuncsFileURL + '/bc_pos/loading3.gif',
|
66
|
+
blueloading: window.ossAliyuncsFileURL + '/bc_pos/loading4.gif'
|
67
|
+
};
|
68
|
+
|
69
|
+
_this2.onRowClick = function (record, index) {
|
70
|
+
_this2.props.onRowClick && _this2.props.onRowClick(record, _this2.props.type);
|
71
|
+
_this2.setState({ selectedRowIndex: index });
|
72
|
+
};
|
73
|
+
|
74
|
+
_this2.resetPageNo = function () {
|
75
|
+
_this2.setState({
|
76
|
+
activePage: 1
|
77
|
+
});
|
78
|
+
};
|
79
|
+
|
80
|
+
_this2.previous = function () {
|
81
|
+
_this2.setState({
|
82
|
+
activePage: _this2.state.activePage - 1
|
83
|
+
}, function () {
|
84
|
+
_this2.props.store.searchMore(_this2.props.searchValue, _this2.state.activePage, 15, _this2.props.type);
|
85
|
+
});
|
86
|
+
};
|
87
|
+
|
88
|
+
_this2.next = function () {
|
89
|
+
_this2.setState({
|
90
|
+
activePage: _this2.state.activePage + 1
|
91
|
+
}, function () {
|
92
|
+
_this2.props.store.searchMore(_this2.props.searchValue, _this2.state.activePage, 15, _this2.props.type);
|
93
|
+
});
|
94
|
+
};
|
95
|
+
|
96
|
+
_this2.getRowClassName = function (record, index) {
|
97
|
+
var selectedRowIndex = _this2.state.selectedRowIndex;
|
98
|
+
|
99
|
+
if (selectedRowIndex == index) {
|
100
|
+
return 'row-selected';
|
101
|
+
} else {
|
102
|
+
return '';
|
103
|
+
}
|
104
|
+
};
|
105
|
+
|
106
|
+
_this2.getNewColumnsList = function (type, searchDesigns) {
|
107
|
+
var columns = [];
|
108
|
+
//周边门店要显示门店名称
|
109
|
+
if (type == '2') {
|
110
|
+
columns.push({
|
111
|
+
title: '门店名称',
|
112
|
+
width: 120,
|
113
|
+
dataIndex: 'WarehouseName',
|
114
|
+
key: 'WarehouseName',
|
115
|
+
// fixed: 'left', 注释掉,否则鼠标悬浮无效
|
116
|
+
ellipsis: true, // 加上,否则鼠标悬浮无效
|
117
|
+
render: function render(text, record, index) {
|
118
|
+
return _react2.default.createElement(
|
119
|
+
'div',
|
120
|
+
{ className: 'text-2line-overflow' },
|
121
|
+
text
|
122
|
+
);
|
123
|
+
}
|
124
|
+
});
|
125
|
+
}
|
126
|
+
searchDesigns.map(function (item) {
|
127
|
+
var _ref = item || {},
|
128
|
+
OriginalTitle = _ref.OriginalTitle,
|
129
|
+
FieldName = _ref.FieldName,
|
130
|
+
Precision = _ref.Precision,
|
131
|
+
IsFormat = _ref.IsFormat;
|
132
|
+
|
133
|
+
var newItem = {
|
134
|
+
title: OriginalTitle,
|
135
|
+
width: 100,
|
136
|
+
dataIndex: FieldName,
|
137
|
+
key: FieldName,
|
138
|
+
Precision: Precision,
|
139
|
+
IsFormat: IsFormat,
|
140
|
+
ellipsis: true
|
141
|
+
};
|
142
|
+
switch (FieldName) {
|
143
|
+
case 'InventoryName':
|
144
|
+
newItem.width = 160;
|
145
|
+
newItem.render = function (text, record, index) {
|
146
|
+
return _react2.default.createElement(
|
147
|
+
'div',
|
148
|
+
{ className: 'text-2line-overflow' },
|
149
|
+
text
|
150
|
+
);
|
151
|
+
};
|
152
|
+
break;
|
153
|
+
case 'InventoryCode':
|
154
|
+
newItem.width = 160;break;
|
155
|
+
case 'ExistingBaseQuantity':
|
156
|
+
newItem.width = 80;break;
|
157
|
+
}
|
158
|
+
if ((Precision || Precision == 0) && IsFormat) {
|
159
|
+
newItem.render = function (text, record, index) {
|
160
|
+
var renderText = _api2.default.formatNumber(text, Precision);
|
161
|
+
return _react2.default.createElement(
|
162
|
+
'span',
|
163
|
+
null,
|
164
|
+
renderText
|
165
|
+
);
|
166
|
+
};
|
167
|
+
}
|
168
|
+
if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {
|
169
|
+
newItem.render = function (text, record, index) {
|
170
|
+
var renderText = _tools2.default.dateFormat(text);
|
171
|
+
return _react2.default.createElement(
|
172
|
+
'span',
|
173
|
+
null,
|
174
|
+
renderText
|
175
|
+
);
|
176
|
+
};
|
177
|
+
}
|
178
|
+
columns.push(newItem);
|
179
|
+
});
|
180
|
+
return columns;
|
181
|
+
};
|
182
|
+
|
183
|
+
_this2.loadingIcon = function () {
|
184
|
+
var theme = _mutantsUtil.localStore.get('theme');
|
185
|
+
var img = theme == 'blue' || theme == 'dark' ? _this2.sys_parms.blueloading : _this2.sys_parms.orangeloading;
|
186
|
+
return _react2.default.createElement('img', { src: img, className: 'loading-img-symbol', style: { width: '90px', height: '90px' } });
|
187
|
+
};
|
188
|
+
|
189
|
+
_this2.state = {
|
190
|
+
activePage: 1,
|
191
|
+
emptyHeight: 200,
|
192
|
+
selectedRowIndex: -1
|
193
|
+
};
|
194
|
+
return _this2;
|
195
|
+
}
|
196
|
+
|
197
|
+
(0, _createClass3.default)(Tab, [{
|
198
|
+
key: 'componentDidMount',
|
199
|
+
value: function componentDidMount() {
|
200
|
+
this.setTableHeight();
|
201
|
+
this.windowEvent = this.setTableHeight.bind(this);
|
202
|
+
window.addEventListener('resize', this.windowEvent);
|
203
|
+
}
|
204
|
+
}, {
|
205
|
+
key: 'componentWillUnmount',
|
206
|
+
value: function componentWillUnmount() {
|
207
|
+
window.removeEventListener('resize', this.windowEvent);
|
208
|
+
}
|
209
|
+
}, {
|
210
|
+
key: 'setTableHeight',
|
211
|
+
value: function setTableHeight() {
|
212
|
+
var _this = this;
|
213
|
+
setTimeout(function () {
|
214
|
+
var height = Number(_this.tabDom.clientHeight - 200);
|
215
|
+
_this.setState({ tableHeight: height });
|
216
|
+
}, 0);
|
217
|
+
}
|
218
|
+
|
219
|
+
// 获取列字段集合
|
220
|
+
|
221
|
+
}, {
|
222
|
+
key: 'render',
|
223
|
+
value: function render() {
|
224
|
+
var _this3 = this;
|
225
|
+
|
226
|
+
var activePage = this.state.activePage;
|
227
|
+
var _props = this.props,
|
228
|
+
dataSource = _props.dataSource,
|
229
|
+
TotalPage = _props.TotalPage,
|
230
|
+
loading = _props.loading,
|
231
|
+
type = _props.type,
|
232
|
+
searchDesigns = _props.searchDesigns;
|
233
|
+
|
234
|
+
var columns = this.getNewColumnsList(type, searchDesigns);
|
235
|
+
return _react2.default.createElement(
|
236
|
+
'div',
|
237
|
+
{ ref: function ref(dom) {
|
238
|
+
_this3.tabDom = dom;
|
239
|
+
},
|
240
|
+
className: (dataSource && dataSource.length > 0 ? 'inventoryTable' : '') + ' inventory-tab ' + (type == '2' ? 'table2' : 'table1') },
|
241
|
+
dataSource && dataSource.length > 0 ? _react2.default.createElement(_table2.default, {
|
242
|
+
columns: columns,
|
243
|
+
dataSource: dataSource,
|
244
|
+
scroll: { y: "calc(~'100% - 43px')" },
|
245
|
+
loading: {
|
246
|
+
spinning: loading,
|
247
|
+
indicator: this.loadingIcon()
|
248
|
+
},
|
249
|
+
pagination: false,
|
250
|
+
rowClassName: this.getRowClassName,
|
251
|
+
onRow: function onRow(record, index) {
|
252
|
+
return {
|
253
|
+
onClick: function onClick() {
|
254
|
+
return _this3.onRowClick(record, index);
|
255
|
+
}
|
256
|
+
};
|
257
|
+
} }) : _react2.default.createElement(_index.ProgressState, {
|
258
|
+
state: loading ? 'load' : "empty",
|
259
|
+
stateCommonStyle: { height: "100%" },
|
260
|
+
empty: { info: '暂无数据~~', buttonVisible: false } }),
|
261
|
+
!(TotalPage == 0 || !TotalPage) && _react2.default.createElement(
|
262
|
+
'div',
|
263
|
+
{ className: 'primary-color', style: { fontSize: '13px' } },
|
264
|
+
'\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u4E2D\u8BE5\u884C\u5546\u54C1\u53EF\u76F4\u63A5\u5E26\u5165\u81F3\u5F00\u5355\u9875'
|
265
|
+
),
|
266
|
+
_react2.default.createElement(_index.Page, {
|
267
|
+
total: TotalPage,
|
268
|
+
currentIndex: activePage,
|
269
|
+
previous: this.previous,
|
270
|
+
next: this.next,
|
271
|
+
className: 'inventory-page'
|
272
|
+
})
|
273
|
+
);
|
274
|
+
}
|
275
|
+
}]);
|
276
|
+
return Tab;
|
277
|
+
}(_react2.default.Component)) || _class;
|
278
|
+
|
279
|
+
exports.default = Tab;
|
280
|
+
//# sourceMappingURL=tab.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/inventorySearch/tab.js"],"names":["Tab","observer","props","sys_parms","orangeloading","window","ossAliyuncsFileURL","blueloading","onRowClick","record","index","type","setState","selectedRowIndex","resetPageNo","activePage","previous","state","store","searchMore","searchValue","next","getRowClassName","getNewColumnsList","searchDesigns","columns","push","title","width","dataIndex","key","ellipsis","render","text","map","item","OriginalTitle","FieldName","Precision","IsFormat","newItem","renderText","InventorySearchApi","formatNumber","tools","dateFormat","loadingIcon","theme","localStore","get","img","height","emptyHeight","setTableHeight","windowEvent","bind","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;;;;AACA;;;;;;IAEqBA,G,OADpBC,wB;;;AAQC,eAAYC,KAAZ,EAAmB;AAAA;;AAAA,iIACXA,KADW;;AAAA,WALnBC,SAKmB,GALP;AACVC,qBAAkBC,OA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,CAAgBC,MAAhB,EAAwBC,KAAxB,CAAN;AAAA;AADJ,aAAP;AAGD,WAdH,GADF,GAiBE,8BAAC,oBAAD;AACE,iBAAOwD,UAAS,MAAT,GAAiB,OAD1B;AAEE,4BAAkB,EAAEf,QAAQ,MAAV,EAFpB;AAGE,iBAAO,EAAEsB,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,wBAAclD,UAFhB;AAGE,oBAAU,KAAKC,QAHjB;AAIE,gBAAM,KAAKK,IAJb;AAKE,qBAAU;AALZ;AA1BF,OADF;AAoCD;;;EA1K8BuD,gBAAMC,S;;kBAAlB7E,G","file":"tab.js","sourcesContent":["import React from 'react';\nimport { Table } from 'antd';\nimport { observer } from 'mutants-microfx';\nimport { localStore } from 'mutants-util';\nimport { Page, ProgressState } from '../../index';\nimport InventorySearchApi from './api';\nimport tools from '../../util/tools';\n@observer\nexport default class Tab extends React.Component {\n\n sys_parms = {\n orangeloading: `${window.ossAliyuncsFileURL}/bc_pos/loading3.gif`,\n blueloading: `${window.ossAliyuncsFileURL}/bc_pos/loading4.gif`,\n }\n\n constructor(props) {\n super(props);\n this.state = {\n activePage: 1,\n emptyHeight: 200,\n selectedRowIndex: -1\n };\n }\n componentDidMount() {\n this.setTableHeight();\n this.windowEvent = this.setTableHeight.bind(this);\n window.addEventListener('resize', this.windowEvent);\n }\n\n componentWillUnmount() {\n window.removeEventListener('resize', this.windowEvent);\n }\n\n setTableHeight() {\n let _this = this;\n setTimeout(() => {\n let height = Number(_this.tabDom.clientHeight - 200);\n _this.setState({ tableHeight: height })\n }, 0)\n }\n\n onRowClick = (record, index) => {\n this.props.onRowClick && this.props.onRowClick(record, this.props.type)\n this.setState({ selectedRowIndex: index })\n }\n\n resetPageNo = () => {\n this.setState({\n activePage: 1\n })\n }\n\n previous = () => {\n this.setState({\n activePage: this.state.activePage - 1\n }, () => {\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\n })\n }\n\n next = () => {\n this.setState({\n activePage: this.state.activePage + 1\n }, () => {\n this.props.store.searchMore(this.props.searchValue, this.state.activePage, 15, this.props.type)\n })\n }\n getRowClassName = (record, index) => {\n const { selectedRowIndex } = this.state;\n if (selectedRowIndex == index) {\n return 'row-selected'\n } else {\n return '';\n }\n }\n\n // 获取列字段集合\n getNewColumnsList = (type, searchDesigns) => {\n let columns = [];\n //周边门店要显示门店名称\n if (type == '2') {\n columns.push({\n title: '门店名称',\n width: 120,\n dataIndex: 'WarehouseName',\n key: 'WarehouseName',\n // fixed: 'left', 注释掉,否则鼠标悬浮无效\n ellipsis: true, // 加上,否则鼠标悬浮无效\n render: (text, record, index) => {\n return <div className='text-2line-overflow'>{text}</div>\n }\n })\n }\n searchDesigns.map(item => {\n let { OriginalTitle, FieldName, Precision, IsFormat } = item || {};\n let newItem = {\n title: OriginalTitle,\n width: 100,\n dataIndex: FieldName,\n key: FieldName,\n Precision: Precision,\n IsFormat: IsFormat,\n ellipsis: true,\n }\n switch (FieldName) {\n case 'InventoryName':\n newItem.width = 160;\n newItem.render = (text, record, index) => {\n return <div className='text-2line-overflow'>{text}</div>\n }\n break;\n case 'InventoryCode': newItem.width = 160; break;\n case 'ExistingBaseQuantity': newItem.width = 80; break;\n }\n if ((Precision || Precision == 0) && IsFormat) {\n newItem.render = (text, record, index) => {\n let renderText = InventorySearchApi.formatNumber(text, Precision);\n return <span>{renderText}</span>\n }\n }\n if (FieldName == 'ProductionDate' || FieldName == 'ExpiryDate') {\n newItem.render = (text, record, index) => {\n let renderText = tools.dateFormat(text);\n return <span>{renderText}</span>\n }\n }\n columns.push(newItem);\n });\n return columns;\n }\n loadingIcon = () => {\n const theme = localStore.get('theme');\n const img = (theme == 'blue' || theme == 'dark') ? this.sys_parms.blueloading : this.sys_parms.orangeloading;\n return (\n <img src={img} className=\"loading-img-symbol\" style={{ width: '90px', height: '90px' }} />\n )\n }\n\n render() {\n let { activePage } = this.state;\n let { dataSource, TotalPage, loading, type, searchDesigns } = this.props;\n let columns = this.getNewColumnsList(type, searchDesigns);\n return (\n <div ref={(dom) => { this.tabDom = dom }}\n className={`${dataSource && dataSource.length > 0 ? 'inventoryTable' : ''} inventory-tab ${type == '2' ? 'table2' : 'table1'}`}>\n {\n dataSource && dataSource.length > 0 ?\n <Table\n columns={columns}\n dataSource={dataSource}\n scroll={{ y: \"calc(~'100% - 43px')\" }}\n loading={{\n spinning: loading,\n indicator: this.loadingIcon()\n }}\n pagination={false}\n rowClassName={this.getRowClassName}\n onRow={(record, index) => {\n return {\n onClick: () => this.onRowClick(record, index)\n }\n }} />\n :\n <ProgressState\n state={loading? 'load': \"empty\"}\n stateCommonStyle={{ height: \"100%\" }}\n empty={{ info: '暂无数据~~', buttonVisible: false }} />\n }\n {!(TotalPage == 0 || !TotalPage) && <div className=\"primary-color\" style={{ fontSize: '13px'}}>温馨提示:点击选中该行商品可直接带入至开单页</div>}\n <Page\n total={TotalPage}\n currentIndex={activePage}\n previous={this.previous}\n next={this.next}\n className='inventory-page'\n />\n </div>\n )\n }\n}"]}
|