tplus-components-touch 3.28.2 → 3.28.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/acCitySelect/CitySelect.js +541 -0
- package/dist/components/acCitySelect/CitySelect.js.map +1 -0
- package/dist/components/acCitySelect/CitySelect.less +10 -0
- package/dist/components/acCitySelect/citys.js +1270 -0
- package/dist/components/acCitySelect/citys.js.map +1 -0
- package/dist/components/acCitySelect/index.js +18 -0
- package/dist/components/acCitySelect/index.js.map +1 -0
- package/dist/components/acCitySelect/provinceData.js +40 -0
- package/dist/components/acCitySelect/provinceData.js.map +1 -0
- package/dist/components/addLog/AddLogProcessor.js +49 -0
- package/dist/components/addLog/AddLogProcessor.js.map +1 -0
- package/dist/components/addLog/OperationLogApi.js +125 -0
- package/dist/components/addLog/OperationLogApi.js.map +1 -0
- package/dist/components/autoComplete/index.js +245 -0
- package/dist/components/autoComplete/index.js.map +1 -0
- package/dist/components/autoComplete/index.less +89 -0
- package/dist/components/autoComplete/option.js +75 -0
- package/dist/components/autoComplete/option.js.map +1 -0
- package/dist/components/autoCompleteWithKeyboard/index.js +231 -0
- package/dist/components/autoCompleteWithKeyboard/index.js.map +1 -0
- package/dist/components/autoCompleteWithKeyboard/index.less +8 -0
- package/dist/components/billSearch/api.js +465 -0
- package/dist/components/billSearch/api.js.map +1 -0
- package/dist/components/billSearch/index.js +2201 -0
- package/dist/components/billSearch/index.js.map +1 -0
- package/dist/components/billSearch/index.less +376 -0
- package/dist/components/cloudPrint/BTPrintFormatUtil.js +568 -0
- package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +1 -0
- package/dist/components/cloudPrint/api.js +391 -0
- package/dist/components/cloudPrint/api.js.map +1 -0
- package/dist/components/cloudPrint/index.js +727 -0
- package/dist/components/cloudPrint/index.js.map +1 -0
- package/dist/components/cloudPrint/printDispatch.js +324 -0
- package/dist/components/cloudPrint/printDispatch.js.map +1 -0
- package/dist/components/commonForm/addressPicker/index.js +232 -0
- package/dist/components/commonForm/addressPicker/index.js.map +1 -0
- package/dist/components/commonForm/addressPicker/style.less +11 -0
- package/dist/components/commonForm/autoComplete/index.js +241 -0
- package/dist/components/commonForm/autoComplete/index.js.map +1 -0
- package/dist/components/commonForm/autoComplete/style.less +3 -0
- package/dist/components/commonForm/datePicker/index.js +89 -0
- package/dist/components/commonForm/datePicker/index.js.map +1 -0
- package/dist/components/commonForm/datePicker/style.less +5 -0
- package/dist/components/commonForm/formControl/index.js +143 -0
- package/dist/components/commonForm/formControl/index.js.map +1 -0
- package/dist/components/commonForm/formControl/style.less +0 -0
- package/dist/components/commonForm/index.js +225 -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/inputNumber/style.less +11 -0
- package/dist/components/commonForm/radio/index.js +132 -0
- package/dist/components/commonForm/radio/index.js.map +1 -0
- package/dist/components/commonForm/radio/style.less +0 -0
- package/dist/components/commonForm/style.less +2 -0
- package/dist/components/deliverySearch/api.js +355 -0
- package/dist/components/deliverySearch/api.js.map +1 -0
- package/dist/components/deliverySearch/index.js +1218 -0
- package/dist/components/deliverySearch/index.js.map +1 -0
- package/dist/components/deliverySearch/index.less +554 -0
- package/dist/components/form/index.js +310 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/hardwareAPI/index.js +181 -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 +785 -0
- package/dist/components/hotKey/index.js.map +1 -0
- package/dist/components/hotKey/localConfig.js +1021 -0
- package/dist/components/hotKey/localConfig.js.map +1 -0
- package/dist/components/hotKey/style.less +96 -0
- package/dist/components/hotKey/utils.js +135 -0
- package/dist/components/hotKey/utils.js.map +1 -0
- package/dist/components/input/index.js +251 -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/scanInput.less +28 -0
- package/dist/components/input/style.less +99 -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/tplusInput/style.less +132 -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/index.less +120 -0
- package/dist/components/inventorySearch/store.js +363 -0
- package/dist/components/inventorySearch/store.js.map +1 -0
- package/dist/components/inventorySearch/tab.js +274 -0
- package/dist/components/inventorySearch/tab.js.map +1 -0
- package/dist/components/keyboard/index.js +255 -0
- package/dist/components/keyboard/index.js.map +1 -0
- package/dist/components/keyboard/index.less +470 -0
- package/dist/components/keyboard/letterKeyboard.js +210 -0
- package/dist/components/keyboard/letterKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboard.js +459 -0
- package/dist/components/keyboard/numKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboardScan.js +195 -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 +460 -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/onlyLetterButton2.less +157 -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 +165 -0
- package/dist/components/layout/sider.js.map +1 -0
- package/dist/components/layout/style.less +82 -0
- package/dist/components/loading/index.js +198 -0
- package/dist/components/loading/index.js.map +1 -0
- package/dist/components/loading/loadingContent.js +185 -0
- package/dist/components/loading/loadingContent.js.map +1 -0
- package/dist/components/loading/style.less +72 -0
- package/dist/components/loading/utils.js +29 -0
- package/dist/components/loading/utils.js.map +1 -0
- package/dist/components/message/index.js +311 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/message/index.less +101 -0
- package/dist/components/modal/index.js +93 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modal/index.less +19 -0
- package/dist/components/modalVertical/index.js +325 -0
- package/dist/components/modalVertical/index.js.map +1 -0
- package/dist/components/modalVertical/style.less +60 -0
- package/dist/components/modalWraper/index.js +470 -0
- package/dist/components/modalWraper/index.js.map +1 -0
- package/dist/components/modalWraper/style.less +257 -0
- package/dist/components/modalWraper/utils.js +48 -0
- package/dist/components/modalWraper/utils.js.map +1 -0
- package/dist/components/notification/index.js +119 -0
- package/dist/components/notification/index.js.map +1 -0
- package/dist/components/notification/index.less +52 -0
- package/dist/components/overflowTip/index.js +269 -0
- package/dist/components/overflowTip/index.js.map +1 -0
- package/dist/components/overflowTip/style.less +66 -0
- package/dist/components/page/index.js +49 -0
- package/dist/components/page/index.js.map +1 -0
- package/dist/components/page/index.less +22 -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/product/index.less +128 -0
- package/dist/components/progressState/EmptyAndErrorView.js +143 -0
- package/dist/components/progressState/EmptyAndErrorView.js.map +1 -0
- package/dist/components/progressState/ProgressState.js +157 -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/progressState/style.less +65 -0
- package/dist/components/scan/index.js +219 -0
- package/dist/components/scan/index.js.map +1 -0
- package/dist/components/scan/index.less +34 -0
- package/dist/components/select/index.js +28 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/select/index.less +12 -0
- package/dist/components/settlement/asyncModal.js +204 -0
- package/dist/components/settlement/asyncModal.js.map +1 -0
- package/dist/components/settlement/index.js +16 -0
- package/dist/components/settlement/index.js.map +1 -0
- package/dist/components/settlement/prototypeTable/index.js +349 -0
- package/dist/components/settlement/prototypeTable/index.js.map +1 -0
- package/dist/components/settlement/prototypeTable/style.less +59 -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 +5479 -0
- package/dist/components/settlement/settlement.js.map +1 -0
- package/dist/components/settlement/settlement.less +1595 -0
- package/dist/components/settlement/settlementStore.js +2117 -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/spin/spin-style.less +436 -0
- package/dist/components/test/index.js +330 -0
- package/dist/components/test/index.js.map +1 -0
- package/dist/components/ticon/iconfont/demo.css +539 -0
- package/dist/components/ticon/iconfont/demo_index.html +5202 -0
- package/dist/components/ticon/iconfont/iconfont.css +887 -0
- package/dist/components/ticon/iconfont/iconfont.eot +0 -0
- package/dist/components/ticon/iconfont/iconfont.js +35 -0
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -0
- package/dist/components/ticon/iconfont/iconfont.json +1535 -0
- package/dist/components/ticon/iconfont/iconfont.svg +593 -0
- 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 +182 -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 +1111 -0
- package/dist/components/touchTable/index.js.map +1 -0
- package/dist/components/touchTable/index.less +377 -0
- package/dist/components/touchTable/utils.js +14 -0
- package/dist/components/touchTable/utils.js.map +1 -0
- package/dist/demo/PopOverDemo.js +126 -0
- package/dist/demo/PopOverDemo.js.map +1 -0
- package/dist/index.js +266 -0
- package/dist/index.js.map +1 -0
- package/dist/util/tools.js +200 -0
- package/dist/util/tools.js.map +1 -0
- package/package.json +1 -1
|
@@ -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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,qBAAKsB,OAAL,GAAe,IAAf;;uBAC4Cd,cAAmBe,gCAAnB,CAAoDvB,MAApD,C;;;;AAAtCwB,yB,SAAAA,S;AAAWC,oB,SAAAA,I;AAAMC,0B,SAAAA,U;;AACvB,oBAAI,CAACA,UAAD,IAAeA,cAAc,CAAjC,EAAoC;AAClCC,oCAAQC,KAAR,CAAc,OAAd;AACD;AACD,uCAAY,YAAM;AAChB,yBAAKI,KAAL,GAAaP,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,274 @@
|
|
|
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.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.loadingIcon = function () {
|
|
178
|
+
var theme = _mutantsUtil.localStore.get('theme');
|
|
179
|
+
var img = 'https://newretail.static.chanjet.com/bc_pos/loading' + (theme == 'blue' || theme == 'dark' ? '2' : '') + '.gif';
|
|
180
|
+
return _react2.default.createElement('img', { src: img, style: { width: '90px', height: '90px' } });
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
_this2.state = {
|
|
184
|
+
activePage: 1,
|
|
185
|
+
emptyHeight: 200,
|
|
186
|
+
selectedRowIndex: -1
|
|
187
|
+
};
|
|
188
|
+
return _this2;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
(0, _createClass3.default)(Tab, [{
|
|
192
|
+
key: 'componentDidMount',
|
|
193
|
+
value: function componentDidMount() {
|
|
194
|
+
this.setTableHeight();
|
|
195
|
+
this.windowEvent = this.setTableHeight.bind(this);
|
|
196
|
+
window.addEventListener('resize', this.windowEvent);
|
|
197
|
+
}
|
|
198
|
+
}, {
|
|
199
|
+
key: 'componentWillUnmount',
|
|
200
|
+
value: function componentWillUnmount() {
|
|
201
|
+
window.removeEventListener('resize', this.windowEvent);
|
|
202
|
+
}
|
|
203
|
+
}, {
|
|
204
|
+
key: 'setTableHeight',
|
|
205
|
+
value: function setTableHeight() {
|
|
206
|
+
var _this = this;
|
|
207
|
+
setTimeout(function () {
|
|
208
|
+
var height = Number(_this.tabDom.clientHeight - 200);
|
|
209
|
+
_this.setState({ tableHeight: height });
|
|
210
|
+
}, 0);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// 获取列字段集合
|
|
214
|
+
|
|
215
|
+
}, {
|
|
216
|
+
key: 'render',
|
|
217
|
+
value: function render() {
|
|
218
|
+
var _this3 = this;
|
|
219
|
+
|
|
220
|
+
var activePage = this.state.activePage;
|
|
221
|
+
var _props = this.props,
|
|
222
|
+
dataSource = _props.dataSource,
|
|
223
|
+
TotalPage = _props.TotalPage,
|
|
224
|
+
loading = _props.loading,
|
|
225
|
+
type = _props.type,
|
|
226
|
+
searchDesigns = _props.searchDesigns;
|
|
227
|
+
|
|
228
|
+
var columns = this.getNewColumnsList(type, searchDesigns);
|
|
229
|
+
return _react2.default.createElement(
|
|
230
|
+
'div',
|
|
231
|
+
{ ref: function ref(dom) {
|
|
232
|
+
_this3.tabDom = dom;
|
|
233
|
+
},
|
|
234
|
+
className: (dataSource && dataSource.length > 0 ? 'inventoryTable' : '') + ' inventory-tab ' + (type == '2' ? 'table2' : 'table1') },
|
|
235
|
+
dataSource && dataSource.length > 0 ? _react2.default.createElement(_table2.default, {
|
|
236
|
+
columns: columns,
|
|
237
|
+
dataSource: dataSource,
|
|
238
|
+
scroll: { y: "calc(~'100% - 43px')" },
|
|
239
|
+
loading: {
|
|
240
|
+
spinning: loading,
|
|
241
|
+
indicator: this.loadingIcon()
|
|
242
|
+
},
|
|
243
|
+
pagination: false,
|
|
244
|
+
rowClassName: this.getRowClassName,
|
|
245
|
+
onRow: function onRow(record, index) {
|
|
246
|
+
return {
|
|
247
|
+
onClick: function onClick() {
|
|
248
|
+
return _this3.onRowClick(record, index);
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
} }) : _react2.default.createElement(_index.ProgressState, {
|
|
252
|
+
state: loading ? 'load' : "empty",
|
|
253
|
+
stateCommonStyle: { height: "100%" },
|
|
254
|
+
empty: { info: '暂无数据~~', buttonVisible: false } }),
|
|
255
|
+
!(TotalPage == 0 || !TotalPage) && _react2.default.createElement(
|
|
256
|
+
'div',
|
|
257
|
+
{ className: 'primary-color', style: { fontSize: '13px' } },
|
|
258
|
+
'\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u4E2D\u8BE5\u884C\u5546\u54C1\u53EF\u76F4\u63A5\u5E26\u5165\u81F3\u5F00\u5355\u9875'
|
|
259
|
+
),
|
|
260
|
+
_react2.default.createElement(_index.Page, {
|
|
261
|
+
total: TotalPage,
|
|
262
|
+
currentIndex: activePage,
|
|
263
|
+
previous: this.previous,
|
|
264
|
+
next: this.next,
|
|
265
|
+
className: 'inventory-page'
|
|
266
|
+
})
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
}]);
|
|
270
|
+
return Tab;
|
|
271
|
+
}(_react2.default.Component)) || _class;
|
|
272
|
+
|
|
273
|
+
exports.default = Tab;
|
|
274
|
+
//# sourceMappingURL=tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/inventorySearch/tab.js"],"names":["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","loadingIcon","theme","localStore","get","img","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;;;;AACA;;;;;;IAEqBA,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,OAAK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GAAd;AAAmB,WAAxC;AACE,sBAAcH,cAAcA,WAAWI,MAAX,GAAoB,CAAlC,GAAsC,gBAAtC,GAAyD,EAAvE,yBAA2F3D,QAAQ,GAAR,GAAc,QAAd,GAAyB,QAApH,CADF;AAGIuD,sBAAcA,WAAWI,MAAX,GAAoB,CAAlC,GACE;AACE,mBAAS7C,OADX;AAEE,sBAAYyC,UAFd;AAGE,kBAAQ,EAAEK,GAAG,sBAAL,EAHV;AAIE,mBAAS;AACPC,sBAAUJ,OADH;AAEPK,uBAAW,KAAK1B,WAAL;AAFJ,WAJX;AAQE,sBAAY,KARd;AASE,wBAAc,KAAKzB,eATrB;AAUE,iBAAO,eAACb,MAAD,EAASC,KAAT,EAAmB;AACxB,mBAAO;AACLgE,uBAAS;AAAA,uBAAM,OAAKlE,UAAL,CAAgBC,MAAhB,EAAwBC,KAAxB,CAAN;AAAA;AADJ,aAAP;AAGD,WAdH,GADF,GAiBE,8BAAC,oBAAD;AACE,iBAAO0D,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,wBAAcpD,UAFhB;AAGE,oBAAU,KAAKC,QAHjB;AAIE,gBAAM,KAAKK,IAJb;AAKE,qBAAU;AALZ;AA1BF,OADF;AAoCD;;;EAnK8ByD,gBAAMC,S;;kBAAlB1E,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 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 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 = `https://newretail.static.chanjet.com/bc_pos/loading${(theme == 'blue' || theme == 'dark') ? '2' : ''}.gif`;\n return (\n <img src={img} 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}"]}
|