tplus-components-touch 1.27.1 → 1.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/addLog/AddLogProcessor.js +53 -0
- package/dist/components/addLog/AddLogProcessor.js.map +1 -0
- package/dist/components/addLog/OperationLogApi.js +164 -0
- package/dist/components/addLog/OperationLogApi.js.map +1 -0
- package/dist/components/autoComplete/index.js +259 -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 +206 -0
- package/dist/components/autoCompleteWithKeyboard/index.js.map +1 -0
- package/dist/components/autoCompleteWithKeyboard/index.less +5 -0
- package/dist/components/billSearch/api.js +425 -0
- package/dist/components/billSearch/api.js.map +1 -0
- package/dist/components/billSearch/index.js +2030 -0
- package/dist/components/billSearch/index.js.map +1 -0
- package/dist/components/billSearch/index.less +573 -0
- package/dist/components/cloudPrint/BTPrintFormatUtil.js +568 -0
- package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +1 -0
- package/dist/components/cloudPrint/api.js +454 -0
- package/dist/components/cloudPrint/api.js.map +1 -0
- package/dist/components/cloudPrint/index.js +974 -0
- package/dist/components/cloudPrint/index.js.map +1 -0
- package/dist/components/cloudPrint/printDispatch.js +336 -0
- package/dist/components/cloudPrint/printDispatch.js.map +1 -0
- package/dist/components/commonForm/autoComplete/index.js +272 -0
- package/dist/components/commonForm/autoComplete/index.js.map +1 -0
- package/dist/components/commonForm/autoComplete/style.less +8 -0
- package/dist/components/commonForm/datePicker/index.js +117 -0
- package/dist/components/commonForm/datePicker/index.js.map +1 -0
- package/dist/components/commonForm/datePicker/style.less +11 -0
- package/dist/components/commonForm/formControl/index.js +183 -0
- package/dist/components/commonForm/formControl/index.js.map +1 -0
- package/dist/components/commonForm/formControl/style.less +8 -0
- package/dist/components/commonForm/index.js +208 -0
- package/dist/components/commonForm/index.js.map +1 -0
- package/dist/components/commonForm/inputNumber/index.js +291 -0
- package/dist/components/commonForm/inputNumber/index.js.map +1 -0
- package/dist/components/commonForm/inputNumber/style.less +17 -0
- package/dist/components/commonForm/radio/index.js +157 -0
- package/dist/components/commonForm/radio/index.js.map +1 -0
- package/dist/components/commonForm/radio/style.less +11 -0
- package/dist/components/commonForm/style.less +12 -0
- package/dist/components/deliverySearch/api.js +355 -0
- package/dist/components/deliverySearch/api.js.map +1 -0
- package/dist/components/deliverySearch/index.js +1254 -0
- package/dist/components/deliverySearch/index.js.map +1 -0
- package/dist/components/deliverySearch/index.less +624 -0
- package/dist/components/form/index.js +325 -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 +782 -0
- package/dist/components/hotKey/index.js.map +1 -0
- package/dist/components/hotKey/localConfig.js +3831 -0
- package/dist/components/hotKey/localConfig.js.map +1 -0
- package/dist/components/hotKey/style.less +99 -0
- package/dist/components/hotKey/utils.js +135 -0
- package/dist/components/hotKey/utils.js.map +1 -0
- package/dist/components/input/index.js +257 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/style.less +107 -0
- package/dist/components/input/tplusInput/index.js +89 -0
- package/dist/components/input/tplusInput/index.js.map +1 -0
- package/dist/components/input/tplusInput/inputContent.js +130 -0
- package/dist/components/input/tplusInput/inputContent.js.map +1 -0
- package/dist/components/input/tplusInput/inputs.js +201 -0
- package/dist/components/input/tplusInput/inputs.js.map +1 -0
- package/dist/components/input/tplusInput/style.less +194 -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 +244 -0
- package/dist/components/inventorySearch/store.js +344 -0
- package/dist/components/inventorySearch/store.js.map +1 -0
- package/dist/components/inventorySearch/tab.js +255 -0
- package/dist/components/inventorySearch/tab.js.map +1 -0
- package/dist/components/keyboard/index.js +258 -0
- package/dist/components/keyboard/index.js.map +1 -0
- package/dist/components/keyboard/index.less +556 -0
- package/dist/components/keyboard/letterKeyboard.js +222 -0
- package/dist/components/keyboard/letterKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboard.js +458 -0
- package/dist/components/keyboard/numKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboardDigit.js +502 -0
- package/dist/components/keyboard/numKeyboardDigit.js.map +1 -0
- package/dist/components/keyboard/numKeyboardScan.js +215 -0
- package/dist/components/keyboard/numKeyboardScan.js.map +1 -0
- package/dist/components/keyboard/numberButtonInteger.js +296 -0
- package/dist/components/keyboard/numberButtonInteger.js.map +1 -0
- package/dist/components/keyboard/numberButton_input.js +300 -0
- package/dist/components/keyboard/numberButton_input.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 +184 -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 +83 -0
- package/dist/components/loading/index.js +193 -0
- package/dist/components/loading/index.js.map +1 -0
- package/dist/components/loading/loadingContent.js +159 -0
- package/dist/components/loading/loadingContent.js.map +1 -0
- package/dist/components/loading/style.less +51 -0
- package/dist/components/loading/utils.js +29 -0
- package/dist/components/loading/utils.js.map +1 -0
- package/dist/components/message/index.js +286 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/message/index.less +150 -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 +338 -0
- package/dist/components/modalVertical/index.js.map +1 -0
- package/dist/components/modalVertical/style.less +114 -0
- package/dist/components/modalWraper/index.js +482 -0
- package/dist/components/modalWraper/index.js.map +1 -0
- package/dist/components/modalWraper/style.less +363 -0
- package/dist/components/modalWraper/utils.js +49 -0
- package/dist/components/modalWraper/utils.js.map +1 -0
- package/dist/components/notification/index.js +124 -0
- package/dist/components/notification/index.js.map +1 -0
- package/dist/components/notification/index.less +58 -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 +26 -0
- package/dist/components/product/detail.js +97 -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 +354 -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 +178 -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/settlement.js +5488 -0
- package/dist/components/settlement/settlement.js.map +1 -0
- package/dist/components/settlement/settlement.less +1604 -0
- package/dist/components/settlement/settlementStore.js +1460 -0
- package/dist/components/settlement/settlementStore.js.map +1 -0
- package/dist/components/settlement/utils.js +295 -0
- package/dist/components/settlement/utils.js.map +1 -0
- package/dist/components/socket/index.js +220 -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 +338 -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 +4765 -0
- package/dist/components/ticon/iconfont/iconfont.css +811 -0
- package/dist/components/ticon/iconfont/iconfont.eot +0 -0
- package/dist/components/ticon/iconfont/iconfont.js +33 -0
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -0
- package/dist/components/ticon/iconfont/iconfont.json +1402 -0
- package/dist/components/ticon/iconfont/iconfont.svg +572 -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 +958 -0
- package/dist/components/touchTable/index.js.map +1 -0
- package/dist/components/touchTable/index.less +190 -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 +246 -0
- package/dist/index.js.map +1 -0
- package/dist/util/tools.js +210 -0
- package/dist/util/tools.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,1460 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Member = exports.PayMode = exports.default = exports.PayIcon2 = exports.PayIcon = exports.BankNoType = exports.PayStyle = 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 _regenerator = require('babel-runtime/regenerator');
|
|
17
|
+
|
|
18
|
+
var _regenerator2 = _interopRequireDefault(_regenerator);
|
|
19
|
+
|
|
20
|
+
var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
|
|
21
|
+
|
|
22
|
+
var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
|
|
23
|
+
|
|
24
|
+
var _promise = require('babel-runtime/core-js/promise');
|
|
25
|
+
|
|
26
|
+
var _promise2 = _interopRequireDefault(_promise);
|
|
27
|
+
|
|
28
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
|
29
|
+
|
|
30
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
|
31
|
+
|
|
32
|
+
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
|
|
33
|
+
|
|
34
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
|
35
|
+
|
|
36
|
+
var _createClass2 = require('babel-runtime/helpers/createClass');
|
|
37
|
+
|
|
38
|
+
var _createClass3 = _interopRequireDefault(_createClass2);
|
|
39
|
+
|
|
40
|
+
var _desc, _value, _class, _desc2, _value2, _class3, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _desc3, _value3, _class5, _descriptor6, _descriptor7, _descriptor8;
|
|
41
|
+
|
|
42
|
+
var _mobx = require('mobx');
|
|
43
|
+
|
|
44
|
+
var _mutantsMicrofx = require('mutants-microfx');
|
|
45
|
+
|
|
46
|
+
var _find2 = require('lodash/find');
|
|
47
|
+
|
|
48
|
+
var _find3 = _interopRequireDefault(_find2);
|
|
49
|
+
|
|
50
|
+
var _remove2 = require('lodash/remove');
|
|
51
|
+
|
|
52
|
+
var _remove3 = _interopRequireDefault(_remove2);
|
|
53
|
+
|
|
54
|
+
var _each2 = require('lodash/each');
|
|
55
|
+
|
|
56
|
+
var _each3 = _interopRequireDefault(_each2);
|
|
57
|
+
|
|
58
|
+
var _map2 = require('lodash/map');
|
|
59
|
+
|
|
60
|
+
var _map3 = _interopRequireDefault(_map2);
|
|
61
|
+
|
|
62
|
+
var _join2 = require('lodash/join');
|
|
63
|
+
|
|
64
|
+
var _join3 = _interopRequireDefault(_join2);
|
|
65
|
+
|
|
66
|
+
var _trim2 = require('lodash/trim');
|
|
67
|
+
|
|
68
|
+
var _trim3 = _interopRequireDefault(_trim2);
|
|
69
|
+
|
|
70
|
+
var _filter2 = require('lodash/filter');
|
|
71
|
+
|
|
72
|
+
var _filter3 = _interopRequireDefault(_filter2);
|
|
73
|
+
|
|
74
|
+
var _findIndex2 = require('lodash/findIndex');
|
|
75
|
+
|
|
76
|
+
var _findIndex3 = _interopRequireDefault(_findIndex2);
|
|
77
|
+
|
|
78
|
+
var _findLastIndex2 = require('lodash/findLastIndex');
|
|
79
|
+
|
|
80
|
+
var _findLastIndex3 = _interopRequireDefault(_findLastIndex2);
|
|
81
|
+
|
|
82
|
+
var _findKey2 = require('lodash/findKey');
|
|
83
|
+
|
|
84
|
+
var _findKey3 = _interopRequireDefault(_findKey2);
|
|
85
|
+
|
|
86
|
+
var _utils = require('./utils');
|
|
87
|
+
|
|
88
|
+
var _tplusApi = require('tplus-api');
|
|
89
|
+
|
|
90
|
+
var _message = require('../message');
|
|
91
|
+
|
|
92
|
+
var _message2 = _interopRequireDefault(_message);
|
|
93
|
+
|
|
94
|
+
var _mutantsUtil = require('mutants-util');
|
|
95
|
+
|
|
96
|
+
var _tplusComponentsTouch = require('tplus-components-touch');
|
|
97
|
+
|
|
98
|
+
var _tplusPoslogin = require('tplus-poslogin');
|
|
99
|
+
|
|
100
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
101
|
+
|
|
102
|
+
function _initDefineProp(target, property, descriptor, context) {
|
|
103
|
+
if (!descriptor) return;
|
|
104
|
+
(0, _defineProperty2.default)(target, property, {
|
|
105
|
+
enumerable: descriptor.enumerable,
|
|
106
|
+
configurable: descriptor.configurable,
|
|
107
|
+
writable: descriptor.writable,
|
|
108
|
+
value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function _initializerWarningHelper(descriptor, context) {
|
|
113
|
+
throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
|
|
117
|
+
var desc = {};
|
|
118
|
+
Object['ke' + 'ys'](descriptor).forEach(function (key) {
|
|
119
|
+
desc[key] = descriptor[key];
|
|
120
|
+
});
|
|
121
|
+
desc.enumerable = !!desc.enumerable;
|
|
122
|
+
desc.configurable = !!desc.configurable;
|
|
123
|
+
|
|
124
|
+
if ('value' in desc || desc.initializer) {
|
|
125
|
+
desc.writable = true;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
desc = decorators.slice().reverse().reduce(function (desc, decorator) {
|
|
129
|
+
return decorator(target, property, desc) || desc;
|
|
130
|
+
}, desc);
|
|
131
|
+
|
|
132
|
+
if (context && desc.initializer !== void 0) {
|
|
133
|
+
desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
|
|
134
|
+
desc.initializer = undefined;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (desc.initializer === void 0) {
|
|
138
|
+
Object['define' + 'Property'](target, property, desc);
|
|
139
|
+
desc = null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return desc;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
|
|
146
|
+
|
|
147
|
+
/*
|
|
148
|
+
1,现金
|
|
149
|
+
93、积分储值卡
|
|
150
|
+
94、储值卡
|
|
151
|
+
99、积分抵现
|
|
152
|
+
995、 扫码收款
|
|
153
|
+
996、代金券
|
|
154
|
+
999、支付宝
|
|
155
|
+
998、微信
|
|
156
|
+
997、转账
|
|
157
|
+
*/
|
|
158
|
+
var PayStyle = exports.PayStyle = {
|
|
159
|
+
xianjin: "1",
|
|
160
|
+
jfczk: "93",
|
|
161
|
+
hyczk: "94",
|
|
162
|
+
jfdx: "99",
|
|
163
|
+
smzf: '995',
|
|
164
|
+
djq: "996", //996
|
|
165
|
+
zfb: "999",
|
|
166
|
+
wx: "998",
|
|
167
|
+
zz: "997"
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var BankNoType = exports.BankNoType = {
|
|
171
|
+
xianjin: 309
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
var PayIcon = exports.PayIcon = {
|
|
175
|
+
"1": "xianjin2",
|
|
176
|
+
"93": "chuzhiqia",
|
|
177
|
+
"94": "chuzhiqia",
|
|
178
|
+
"99": "jifendixian",
|
|
179
|
+
"995": "saomashoukuan",
|
|
180
|
+
"996": "daijinquan",
|
|
181
|
+
"999": "zhifubao",
|
|
182
|
+
"998": "weixin",
|
|
183
|
+
//"997":"zhifubao",
|
|
184
|
+
"gengduo": "gengduo2",
|
|
185
|
+
"default": "moban1"
|
|
186
|
+
};
|
|
187
|
+
var PayIcon2 = exports.PayIcon2 = {
|
|
188
|
+
"1": "xianjinfanbai",
|
|
189
|
+
"998": "weixinfanbai",
|
|
190
|
+
"999": "zhifubaofanbai",
|
|
191
|
+
"995": "saomafanbai",
|
|
192
|
+
"chenggong": "zhifuchenggong",
|
|
193
|
+
"94": "chuzhikakuai",
|
|
194
|
+
"default": "mobanfanbai"
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
var SettlementStore = (_class = function () {
|
|
198
|
+
//type==2
|
|
199
|
+
function SettlementStore() {
|
|
200
|
+
(0, _classCallCheck3.default)(this, SettlementStore);
|
|
201
|
+
this.paymode = null;
|
|
202
|
+
this.dto = null;
|
|
203
|
+
this.member = null;
|
|
204
|
+
this.brefund = false;
|
|
205
|
+
this.bquick = false;
|
|
206
|
+
this.boriginReturn = false;
|
|
207
|
+
this.newStyle = true;
|
|
208
|
+
|
|
209
|
+
this.calculationIsXianJin = function (mode) {
|
|
210
|
+
return mode.bankNoType != undefined ? mode.bankNoType == BankNoType.xianjin : mode.paymentType == PayStyle.xianjin;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
this.paymode = new PayMode();
|
|
214
|
+
this.newStyle = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') == 'voucher';
|
|
215
|
+
this.isCheckDate = true;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
(0, _createClass3.default)(SettlementStore, [{
|
|
219
|
+
key: 'initPaymodes',
|
|
220
|
+
value: function initPaymodes(event, type, isProject) {
|
|
221
|
+
this.paymode.setPaymodes(type);
|
|
222
|
+
this.updateEvent = event;
|
|
223
|
+
this.isProject = isProject;
|
|
224
|
+
}
|
|
225
|
+
}, {
|
|
226
|
+
key: 'init',
|
|
227
|
+
value: function init(context, amounthandler, datasource, storeinfo, bquick, amount, type, data) {
|
|
228
|
+
var _this = this;
|
|
229
|
+
|
|
230
|
+
this.type = type;
|
|
231
|
+
if (context) {
|
|
232
|
+
this.context = context;
|
|
233
|
+
this.amountHandler = amounthandler;
|
|
234
|
+
this.dataSource = datasource;
|
|
235
|
+
this.storeInfo = storeinfo;
|
|
236
|
+
this.dto = context.viewModel.data;
|
|
237
|
+
(0, _mobx.runInAction)(function () {
|
|
238
|
+
// 单品金额抹零
|
|
239
|
+
if (global.DealSingleRowAmountSettingProcessorBlock) {
|
|
240
|
+
global.DealSingleRowAmountSettingProcessorBlock.execute(_this.dto);
|
|
241
|
+
}
|
|
242
|
+
// 成交金额抹零
|
|
243
|
+
if (global.DealAmountSettingProcessorBlock) {
|
|
244
|
+
global.DealAmountSettingProcessorBlock.execute(_this.dto);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
// this.member=context.stores && context.stores.memberStore && context.stores.memberStore.member;
|
|
249
|
+
this.member = this.dto.Member; //stores.selectMemberStore.selectMemberInfo;
|
|
250
|
+
this.brefund = this.paymode.setAmount(this.dto.TotalTaxAmount, this.dto.OnlinePaymentAmount);
|
|
251
|
+
} else {
|
|
252
|
+
this.brefund = this.paymode.setAmount(amount, 0);
|
|
253
|
+
this.dto = data;
|
|
254
|
+
}
|
|
255
|
+
this.paymode.clean();
|
|
256
|
+
|
|
257
|
+
//this.dto.TotalTaxAmount<0;
|
|
258
|
+
this.bquick = !!bquick;
|
|
259
|
+
this.boriginReturn = JSON.getCellValue(this.dto, "IsOriginalReturn");
|
|
260
|
+
if (this.boriginReturn) {
|
|
261
|
+
this.initByOriginReturn();
|
|
262
|
+
}
|
|
263
|
+
if (this.newStyle) {
|
|
264
|
+
this.setModes();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}, {
|
|
268
|
+
key: 'setModes',
|
|
269
|
+
value: function setModes() {
|
|
270
|
+
var _this2 = this;
|
|
271
|
+
|
|
272
|
+
(0, _each3.default)(this.paymode.paymodes, function (p) {
|
|
273
|
+
if ((0, _findIndex3.default)(_this2.paymode.thePaymodes, function (mode) {
|
|
274
|
+
return p.paymentType == mode.paymentType;
|
|
275
|
+
}) == -1) {
|
|
276
|
+
_this2.addPay(p.paymentType);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
if (!this.boriginReturn && this.paymode.thePaymodes.length > 0) {
|
|
280
|
+
this.changeValue(this.paymode.thePaymodes[0].paymethodId, 0, true);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}, {
|
|
284
|
+
key: 'amountChanged',
|
|
285
|
+
value: function amountChanged(amount) {
|
|
286
|
+
if (this.type == 1) {
|
|
287
|
+
this.brefund = this.paymode.setAmount(amount, 0);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
key: 'initByOriginReturn',
|
|
292
|
+
value: function initByOriginReturn() {
|
|
293
|
+
var _this3 = this;
|
|
294
|
+
|
|
295
|
+
(0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
|
|
296
|
+
var themode = (0, _find3.default)(_this3.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
|
|
297
|
+
if (themode.paymentType != PayStyle.hyczk) {
|
|
298
|
+
var newmode = (0, _extends3.default)({}, _this3.genNewMode(themode.paymentType, false, detail.Amount), {
|
|
299
|
+
authCode: detail.PaymentCode,
|
|
300
|
+
steadCashIntegral: detail.SteadCashIntegral,
|
|
301
|
+
overchargesAmount: detail.OverchargesAmount,
|
|
302
|
+
boriginReturn: true
|
|
303
|
+
});
|
|
304
|
+
_this3.paymode.currentMode = newmode;
|
|
305
|
+
if (themode.paymentType == PayStyle.djq) {
|
|
306
|
+
(0, _each3.default)(_this3.dto.RetailCouponDetails, function (djq) {
|
|
307
|
+
_this3.addDjq(djq.CouponCode, djq.CouponTitle, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
_this3.paymode.thePaymodes.push(newmode);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
(0, _each3.default)(this.dto.RetailStorageDetails, function (detail) {
|
|
314
|
+
var newmode = (0, _extends3.default)({}, _this3.genNewMode(PayStyle.hyczk, false, detail.StoragePaymentAmount), {
|
|
315
|
+
member: new Member(detail.Member),
|
|
316
|
+
authCode: detail.Password,
|
|
317
|
+
balance: detail.BalanceStorage,
|
|
318
|
+
boriginReturn: true
|
|
319
|
+
});
|
|
320
|
+
_this3.paymode.thePaymodes.push(newmode);
|
|
321
|
+
});
|
|
322
|
+
this.paymode.calcReserved();
|
|
323
|
+
}
|
|
324
|
+
}, {
|
|
325
|
+
key: 'clean',
|
|
326
|
+
value: function clean() {
|
|
327
|
+
this.bquick = false;
|
|
328
|
+
this.paymode.clean();
|
|
329
|
+
}
|
|
330
|
+
}, {
|
|
331
|
+
key: 'quickSettle',
|
|
332
|
+
value: function quickSettle(key) {
|
|
333
|
+
this.addPay(key);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
//outer call
|
|
337
|
+
//(type===PayStyle.hyczk || type===PayStyle.jfczk || type===PayStyle.jfdx || type===PayStyle.djq)
|
|
338
|
+
|
|
339
|
+
}, {
|
|
340
|
+
key: 'changeFocusAndAddPay',
|
|
341
|
+
value: function changeFocusAndAddPay(type) {
|
|
342
|
+
var _this4 = this;
|
|
343
|
+
|
|
344
|
+
this.paymode.currentFocus = type;
|
|
345
|
+
if (this.paymode.currentMode) {
|
|
346
|
+
if (type == PayStyle.jfdx) {
|
|
347
|
+
if (this.newStyle) {
|
|
348
|
+
var index = (0, _findIndex3.default)(this.paymode.thePaymodes, function (m) {
|
|
349
|
+
return m.paymentType == PayStyle.jfdx;
|
|
350
|
+
});
|
|
351
|
+
this.paymode.thePaymodes.splice(index, 1, this.paymode.currentMode);
|
|
352
|
+
this.paymode.calcReserved();
|
|
353
|
+
} else {
|
|
354
|
+
this.addPayDirectly(this.paymode.currentMode);
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
//抵现积分
|
|
358
|
+
(0, _tplusApi.tApi)({ IntegralSteadCashParams: {
|
|
359
|
+
Idmember: this.paymode.currentMode.member.id,
|
|
360
|
+
TotalTaxAmount: this.paymode.amount,
|
|
361
|
+
BalanceTaxAmount: this.paymode.currentMode.value
|
|
362
|
+
} }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
|
|
363
|
+
_this4.paymode.currentMode.steadCashIntegral = result.Integral;
|
|
364
|
+
_this4.paymode.currentMode.overchargesAmount = result.Amount - _this4.paymode.currentMode.value;
|
|
365
|
+
});
|
|
366
|
+
} else {
|
|
367
|
+
this.addPayDirectly(this.paymode.currentMode);
|
|
368
|
+
}
|
|
369
|
+
} else {
|
|
370
|
+
this.addPay(type);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}, {
|
|
374
|
+
key: 'loadCzk',
|
|
375
|
+
value: function loadCzk(v) {
|
|
376
|
+
var _this5 = this;
|
|
377
|
+
|
|
378
|
+
if ((0, _trim3.default)(v) === "") {
|
|
379
|
+
(0, _mobx.runInAction)(function () {
|
|
380
|
+
_this5.paymode.currentMode.member = new Member(null);
|
|
381
|
+
_this5.paymode.currentMode.errinfo = "请输入储值卡";
|
|
382
|
+
});
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
var IdStore = this.storeInfo.storeID;
|
|
386
|
+
var StoreCode = this.storeInfo.storeCode; //_find(this.storeInfo.storeInfos,(store)=>{return store.ID==IdStore;}).Code;
|
|
387
|
+
return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, 'AA.DR.newRetailMember.SearchMember', false, false).then(function (result) {
|
|
388
|
+
var data = JSON.parse(result.Data);
|
|
389
|
+
var m = data && data.length > 0 && data[0];
|
|
390
|
+
if (!m || !m.ID) {
|
|
391
|
+
(0, _mobx.runInAction)(function () {
|
|
392
|
+
_this5.paymode.currentMode.errinfo = "无效的会员卡号";
|
|
393
|
+
});
|
|
394
|
+
} else {
|
|
395
|
+
(0, _mobx.runInAction)(function () {
|
|
396
|
+
_this5.paymode.currentMode.errinfo = "";
|
|
397
|
+
_this5.paymode.currentMode.member = new Member(m);
|
|
398
|
+
_this5.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this5.brefund ? _this5.paymode.receivable : Math.max(_this5.paymode.receivable, 0));
|
|
399
|
+
_this5.updateEvent();
|
|
400
|
+
var message = '';
|
|
401
|
+
if (global.CheckMemberStorageProcessorBlock) {
|
|
402
|
+
message = CheckMemberStorageProcessorBlock.execute(data[0]);
|
|
403
|
+
}
|
|
404
|
+
if (!String.isNullOrEmpty(message)) {
|
|
405
|
+
_this5.paymode.currentMode.errinfo = message;
|
|
406
|
+
} else if (_this5.checkReceived(_this5.paymode.currentMode, "balance")) {
|
|
407
|
+
_this5.paymode.currentMode.errinfo = "余额不足";
|
|
408
|
+
} else if (_this5.paymode.amount > 0 && _this5.paymode.currentMode.value == 0) {
|
|
409
|
+
_this5.paymode.currentMode.errinfo = "实收金额必须录入";
|
|
410
|
+
} else {
|
|
411
|
+
// 查询成功后将焦点移入下一个输入框
|
|
412
|
+
var nextInput = document.querySelector('.czk .received .input');
|
|
413
|
+
nextInput && nextInput.focus();
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
}, {
|
|
420
|
+
key: 'checkCoupon',
|
|
421
|
+
value: function checkCoupon(sn) {
|
|
422
|
+
var _this6 = this;
|
|
423
|
+
|
|
424
|
+
var receivable = 0;
|
|
425
|
+
var djqs = this.paymode.currentMode.djqs;
|
|
426
|
+
djqs && djqs.map(function (value) {
|
|
427
|
+
receivable += value.doorsill;
|
|
428
|
+
});
|
|
429
|
+
var obj = {};
|
|
430
|
+
this.dto.RetailDetails.forEach(function (item) {
|
|
431
|
+
if (obj[item.Inventory.ID]) {
|
|
432
|
+
obj[item.Inventory.ID] += item.TaxAmount;
|
|
433
|
+
} else {
|
|
434
|
+
obj[item.Inventory.ID] = item.TaxAmount;
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
return (0, _tplusApi.tApi)({ request: {
|
|
438
|
+
Uid: this.paymode.currentMode.member.uid || '',
|
|
439
|
+
SN: sn,
|
|
440
|
+
StoreCode: this.dto.Idstore,
|
|
441
|
+
RetailCode: this.dto.Code,
|
|
442
|
+
Inventories: (0, _map3.default)((0, _filter3.default)(this.dto.RetailDetails, function (d) {
|
|
443
|
+
return d.Quantity > 0 && !d.IsPresent;
|
|
444
|
+
}), function (detail) {
|
|
445
|
+
return {
|
|
446
|
+
IdInventory: detail.Inventory.ID,
|
|
447
|
+
singleTotalAmount: obj[detail.Inventory.ID],
|
|
448
|
+
IdUnit: detail.Idunit,
|
|
449
|
+
Code: detail.Inventory.Code,
|
|
450
|
+
FreeItem0: JSON.getCellValue(detail, "freeitem0"),
|
|
451
|
+
FreeItem1: JSON.getCellValue(detail, "freeitem1"),
|
|
452
|
+
FreeItem2: JSON.getCellValue(detail, "freeitem2"),
|
|
453
|
+
FreeItem3: JSON.getCellValue(detail, "freeitem3"),
|
|
454
|
+
FreeItem4: JSON.getCellValue(detail, "freeitem4"),
|
|
455
|
+
FreeItem5: JSON.getCellValue(detail, "freeitem5"),
|
|
456
|
+
FreeItem6: JSON.getCellValue(detail, "freeitem6"),
|
|
457
|
+
FreeItem7: JSON.getCellValue(detail, "freeitem7"),
|
|
458
|
+
FreeItem8: JSON.getCellValue(detail, "freeitem8"),
|
|
459
|
+
FreeItem9: JSON.getCellValue(detail, "freeitem9")
|
|
460
|
+
};
|
|
461
|
+
}),
|
|
462
|
+
// inventoryCodes:_join(_map(this.dto.RetailDetails,(detail)=>{return detail.Inventory.Code;}),','),
|
|
463
|
+
InventoryClassCodes: (0, _join3.default)((0, _map3.default)((0, _filter3.default)(this.dto.RetailDetails, function (d) {
|
|
464
|
+
return d.Quantity > 0;
|
|
465
|
+
}), function (detail) {
|
|
466
|
+
return (detail.Inventory.InventoryClass || { Code: '' }).Code;
|
|
467
|
+
}), ','),
|
|
468
|
+
Amount: this.paymode.amount,
|
|
469
|
+
Receivable: this.paymode.currentMode.maxamount - receivable
|
|
470
|
+
} }, 'chanjet.AA.DR.coupon.CheckCoupon', false, false).then(function (result) {
|
|
471
|
+
if ((0, _find3.default)(_this6.paymode.currentMode.djqs, function (djq) {
|
|
472
|
+
return djq.code == result.SN;
|
|
473
|
+
})) {
|
|
474
|
+
_message2.default.info('代金券已添加');
|
|
475
|
+
} else if (result.IsRepelWithPoints && (0, _find3.default)(_this6.paymode.thePaymodes, function (themode) {
|
|
476
|
+
return themode.paymentType == PayStyle.jfdx;
|
|
477
|
+
})) {
|
|
478
|
+
_message2.default.error('\u4EE3\u91D1\u5238\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
|
|
479
|
+
} else {
|
|
480
|
+
_this6.addDjq(result.SN, result.Title, result.ReduceAmount, result.StartAmount, result.LastTS, false, !result.IsRepelWithPoints, result.UMemberID);
|
|
481
|
+
}
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
}, {
|
|
485
|
+
key: 'addDjq',
|
|
486
|
+
value: function addDjq(code, name, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID) {
|
|
487
|
+
var djq = {
|
|
488
|
+
code: code,
|
|
489
|
+
name: name,
|
|
490
|
+
amount: amount,
|
|
491
|
+
doorsill: doorsill, //:"无门槛"
|
|
492
|
+
LastTS: LastTS,
|
|
493
|
+
checked: checked,
|
|
494
|
+
IsRepelWithPoints: IsRepelWithPoints,
|
|
495
|
+
UMemberID: UMemberID
|
|
496
|
+
};
|
|
497
|
+
this.paymode.currentMode.djqs.push(djq);
|
|
498
|
+
!this.boriginReturn && this.paymode.calcDjqValue(djq);
|
|
499
|
+
}
|
|
500
|
+
}, {
|
|
501
|
+
key: 'setCurrentMode',
|
|
502
|
+
value: function setCurrentMode(id, type, append) {
|
|
503
|
+
var mode = (0, _find3.default)(this.paymode.thePaymodes, { paymethodId: id });
|
|
504
|
+
if (mode) {
|
|
505
|
+
this.paymode.currentMode = mode;
|
|
506
|
+
if (this.newStyle) {
|
|
507
|
+
this.afterSetCurrentMode(type);
|
|
508
|
+
}
|
|
509
|
+
} else {
|
|
510
|
+
this.paymode.currentMode = this.genNewMode(type, append);
|
|
511
|
+
this.afterSetCurrentMode(type);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}, {
|
|
515
|
+
key: 'afterSetCurrentMode',
|
|
516
|
+
value: function afterSetCurrentMode(type) {
|
|
517
|
+
var _this7 = this;
|
|
518
|
+
|
|
519
|
+
if (type == PayStyle.djq) {
|
|
520
|
+
this.paymode.calcDjqValue();
|
|
521
|
+
} else if (type == PayStyle.jfdx) {
|
|
522
|
+
//获取可兑换的金额
|
|
523
|
+
if (this.newStyle) {
|
|
524
|
+
var themode = (0, _find3.default)(this.paymode.thePaymodes, { paymentType: PayStyle.jfdx });
|
|
525
|
+
if (themode && parseFloat(themode.value || 0) != 0) {
|
|
526
|
+
this.paymode.currentMode.value = themode.value;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
(0, _tplusApi.tApi)({ IntegralSteadCashParams: {
|
|
531
|
+
Idmember: this.paymode.currentMode.member.id,
|
|
532
|
+
TotalTaxAmount: this.paymode.amount,
|
|
533
|
+
BalanceTaxAmount: this.paymode.amount
|
|
534
|
+
} }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
|
|
535
|
+
_this7.paymode.currentMode.member.setExchangable(result.MaxAmount);
|
|
536
|
+
_this7.updateEvent();
|
|
537
|
+
if (_this7.checkReceived(_this7.paymode.currentMode, "exchangable")) {
|
|
538
|
+
(0, _mobx.runInAction)(function () {
|
|
539
|
+
_this7.paymode.currentMode.errinfo = '余额不足';
|
|
540
|
+
});
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}, {
|
|
546
|
+
key: 'checkReceived',
|
|
547
|
+
value: function checkReceived(mode, name) {
|
|
548
|
+
return !this.brefund && parseFloat(mode.value) > parseFloat(mode.maxamount || mode.member[name] || 0);
|
|
549
|
+
}
|
|
550
|
+
}, {
|
|
551
|
+
key: 'genNewMode',
|
|
552
|
+
value: function genNewMode(type, notwithm, v) {
|
|
553
|
+
var value = (0, _utils.getFixedNumber)(v || (this.brefund ? this.paymode.receivable : Math.max(this.paymode.receivable, 0)));
|
|
554
|
+
var themode = (0, _find3.default)(this.paymode.paymodes, { 'paymentType': type });
|
|
555
|
+
var mode = (0, _mobx.observable)({
|
|
556
|
+
paymethodId: this.paymode.counter,
|
|
557
|
+
name: themode.name,
|
|
558
|
+
exchangeRate: themode.exchangeRate,
|
|
559
|
+
calDirection: themode.calDirection,
|
|
560
|
+
value: value,
|
|
561
|
+
value2: (0, _utils.getFixedNumber)(themode.calDirection == "88" ? value / themode.exchangeRate : value * themode.exchangeRate),
|
|
562
|
+
value3: value,
|
|
563
|
+
order: this.paymode.thePaymodes.length + 1,
|
|
564
|
+
paymentType: type,
|
|
565
|
+
djqs: [],
|
|
566
|
+
member: new Member(!notwithm ? this.member : null),
|
|
567
|
+
authCode: '',
|
|
568
|
+
steadCashIntegral: null,
|
|
569
|
+
errinfo: '',
|
|
570
|
+
maxamount: this.paymode.amount,
|
|
571
|
+
bankNoType: themode.bankNoType
|
|
572
|
+
});
|
|
573
|
+
if (type == PayStyle.hyczk) {
|
|
574
|
+
if (!mode.member.id) {
|
|
575
|
+
(0, _mobx.runInAction)(function () {
|
|
576
|
+
mode.errinfo = '未录入储值卡';
|
|
577
|
+
});
|
|
578
|
+
} else if (this.checkReceived(mode, "balance")) {
|
|
579
|
+
(0, _mobx.runInAction)(function () {
|
|
580
|
+
mode.errinfo = '余额不足';
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
if (type == PayStyle.hyczk || type == PayStyle.jfdx || type == PayStyle.djq) {
|
|
585
|
+
this.setMaxAmount(type, mode);
|
|
586
|
+
}
|
|
587
|
+
console.log(mode);
|
|
588
|
+
return mode;
|
|
589
|
+
}
|
|
590
|
+
}, {
|
|
591
|
+
key: 'setMaxAmount',
|
|
592
|
+
value: function setMaxAmount(type, mode) {
|
|
593
|
+
var _this8 = this;
|
|
594
|
+
|
|
595
|
+
var sum = 0;
|
|
596
|
+
if (type == PayStyle.hyczk) {
|
|
597
|
+
(0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
|
|
598
|
+
return m.paymentType == type;
|
|
599
|
+
}), function (q) {
|
|
600
|
+
sum = Math.Add(sum, q.value);
|
|
601
|
+
});
|
|
602
|
+
} else if (type == PayStyle.djq || type == PayStyle.jfdx) {
|
|
603
|
+
(0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
|
|
604
|
+
return m.paymentType == PayStyle.djq || m.paymentType == PayStyle.jfdx;
|
|
605
|
+
}), function (q) {
|
|
606
|
+
sum = Math.Add(sum, q.value);
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
this.amountHandler(type).then(function () {
|
|
611
|
+
(0, _mobx.runInAction)(function () {
|
|
612
|
+
mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(_this8.context.viewModel.getViewItem('Voucher').availableAmount, sum));
|
|
613
|
+
_this8.updateEvent();
|
|
614
|
+
});
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
}, {
|
|
618
|
+
key: 'changeFocusOnly',
|
|
619
|
+
value: function changeFocusOnly(type) {
|
|
620
|
+
this.paymode.currentFocus = type;
|
|
621
|
+
// 获取焦点时带入剩余的值
|
|
622
|
+
var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymentType': type });
|
|
623
|
+
|
|
624
|
+
var _ref = mode || {},
|
|
625
|
+
value = _ref.value;
|
|
626
|
+
|
|
627
|
+
if (mode && (value == '0.00' || value == null)) {
|
|
628
|
+
var shouldSetValue = (0, _utils.getFixedNumber)(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
|
|
629
|
+
mode.value = shouldSetValue;
|
|
630
|
+
mode.value2 = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? shouldSetValue / mode.exchangeRate : shouldSetValue * mode.exchangeRate);
|
|
631
|
+
mode.value3 = shouldSetValue;
|
|
632
|
+
this.paymode.calcReserved();
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
}, {
|
|
636
|
+
key: 'changeInputStorageValue',
|
|
637
|
+
value: function changeInputStorageValue(cashChange, giveChangeForStorage) {
|
|
638
|
+
this.cashChange = cashChange;
|
|
639
|
+
this.giveChangeForStorage = giveChangeForStorage;
|
|
640
|
+
}
|
|
641
|
+
}, {
|
|
642
|
+
key: 'clearInputStorageData',
|
|
643
|
+
value: function clearInputStorageData() {
|
|
644
|
+
this.cashChange = null;
|
|
645
|
+
this.giveChangeForStorage = null;
|
|
646
|
+
}
|
|
647
|
+
}, {
|
|
648
|
+
key: 'changeValue',
|
|
649
|
+
value: function changeValue(index, value, blur, storage, change, istoChange) {
|
|
650
|
+
var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
|
|
651
|
+
var v = blur ? (0, _utils.getFixedNumber)(value) : isNaN(value) && value != '-' ? 0.00 : value;
|
|
652
|
+
if (mode) {
|
|
653
|
+
if (mode.exchangeRate != 1) {
|
|
654
|
+
if ((0, _utils.getFixedNumber)(mode.calDirection == "88" ? mode.value3 / mode.exchangeRate : mode.value3 * mode.exchangeRate) != v) {
|
|
655
|
+
mode.value = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? v * mode.exchangeRate : v / mode.exchangeRate);
|
|
656
|
+
} else {
|
|
657
|
+
mode.value = mode.value3;
|
|
658
|
+
}
|
|
659
|
+
if (istoChange) {
|
|
660
|
+
mode.value2 = change;
|
|
661
|
+
} else {
|
|
662
|
+
mode.value2 = v;
|
|
663
|
+
}
|
|
664
|
+
} else {
|
|
665
|
+
mode.value = v;
|
|
666
|
+
if (istoChange) {
|
|
667
|
+
mode.value2 = change;
|
|
668
|
+
} else {
|
|
669
|
+
mode.value2 = v;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
this.paymode.calcReserved();
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}, {
|
|
677
|
+
key: 'changeReturnValue',
|
|
678
|
+
value: function changeReturnValue(index, change) {
|
|
679
|
+
var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
|
|
680
|
+
if (mode) {
|
|
681
|
+
if (mode.exchangeRate != 1) {
|
|
682
|
+
mode.value2 = change;
|
|
683
|
+
} else {
|
|
684
|
+
mode.value2 = change;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
this.paymode.calcReserved();
|
|
688
|
+
}
|
|
689
|
+
}, {
|
|
690
|
+
key: 'addPayDirectly',
|
|
691
|
+
value: function addPayDirectly(pay) {
|
|
692
|
+
|
|
693
|
+
if (!(0, _find3.default)(this.paymode.thePaymodes, { paymethodId: pay.paymethodId })) {
|
|
694
|
+
var pos = this.paymode.thePaymodes.length;
|
|
695
|
+
if (pay.paymentType == PayStyle.hyczk) {
|
|
696
|
+
var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
|
|
697
|
+
return m.paymethodId != pay.paymethodId && m.paymentType == PayStyle.hyczk;
|
|
698
|
+
});
|
|
699
|
+
pos = index == -1 ? pos : index + 1;
|
|
700
|
+
}
|
|
701
|
+
// this.paymode.thePaymodes.push(pay);
|
|
702
|
+
this.paymode.thePaymodes.splice(pos, 0, pay);
|
|
703
|
+
}
|
|
704
|
+
this.paymode.calcReserved();
|
|
705
|
+
}
|
|
706
|
+
}, {
|
|
707
|
+
key: 'addPay',
|
|
708
|
+
value: function addPay(type) {
|
|
709
|
+
var pos = this.paymode.thePaymodes.length;
|
|
710
|
+
if (type == PayStyle.hyczk) {
|
|
711
|
+
var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
|
|
712
|
+
return m.paymentType == PayStyle.hyczk;
|
|
713
|
+
});
|
|
714
|
+
pos = index == -1 ? pos : index + 1;
|
|
715
|
+
}
|
|
716
|
+
// this.paymode.thePaymodes.push(this.genNewMode(type) );
|
|
717
|
+
this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk));
|
|
718
|
+
this.paymode.calcReserved();
|
|
719
|
+
}
|
|
720
|
+
}, {
|
|
721
|
+
key: 'delPay',
|
|
722
|
+
value: function delPay(index) {
|
|
723
|
+
(0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
|
|
724
|
+
return mode.paymethodId === index;
|
|
725
|
+
});
|
|
726
|
+
this.paymode.currentFocus = -1;
|
|
727
|
+
this.paymode.calcReserved();
|
|
728
|
+
}
|
|
729
|
+
}, {
|
|
730
|
+
key: 'changeIsCheckDate',
|
|
731
|
+
value: function changeIsCheckDate(isCheckDate) {
|
|
732
|
+
this.isCheckDate = isCheckDate;
|
|
733
|
+
}
|
|
734
|
+
}, {
|
|
735
|
+
key: 'getChangeToStorage',
|
|
736
|
+
value: function getChangeToStorage(wipechange) {
|
|
737
|
+
return _promise2.default.resolve((0, _tplusApi.tApi)({ idmember: this.dto.Idmember, idStore: this.dto.Idstore, wipechange: wipechange }, 'AA.DR.newRetailMember.GetChangeToStorage', false, false, { timeout_skip: true }));
|
|
738
|
+
}
|
|
739
|
+
}, {
|
|
740
|
+
key: 'CheckExpirationDate',
|
|
741
|
+
value: function () {
|
|
742
|
+
var _ref2 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
|
743
|
+
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
744
|
+
while (1) {
|
|
745
|
+
switch (_context.prev = _context.next) {
|
|
746
|
+
case 0:
|
|
747
|
+
return _context.abrupt('return', (0, _tplusApi.tApi)({ ExpirationDate: _mutantsMicrofx.stores.memberProjectStore.data.ExpirationDate }, 'chanjet.ME.IProjectStorage.CheckExpirationDate', false, false));
|
|
748
|
+
|
|
749
|
+
case 1:
|
|
750
|
+
case 'end':
|
|
751
|
+
return _context.stop();
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}, _callee, this);
|
|
755
|
+
}));
|
|
756
|
+
|
|
757
|
+
function CheckExpirationDate() {
|
|
758
|
+
return _ref2.apply(this, arguments);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
return CheckExpirationDate;
|
|
762
|
+
}()
|
|
763
|
+
}, {
|
|
764
|
+
key: 'getMemberRetailDetail',
|
|
765
|
+
value: function () {
|
|
766
|
+
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
|
|
767
|
+
var _getLoginInfo, IdStore;
|
|
768
|
+
|
|
769
|
+
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
770
|
+
while (1) {
|
|
771
|
+
switch (_context2.prev = _context2.next) {
|
|
772
|
+
case 0:
|
|
773
|
+
_getLoginInfo = this.getLoginInfo(), IdStore = _getLoginInfo.IdStore;
|
|
774
|
+
return _context2.abrupt('return', (0, _tplusApi.tApi)({ Idmember: this.dto.Idmember, IdStore: IdStore }, 'chanjet.AA.DR.INewRetailMember.GetMemberRetailDetail', false, false));
|
|
775
|
+
|
|
776
|
+
case 2:
|
|
777
|
+
case 'end':
|
|
778
|
+
return _context2.stop();
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}, _callee2, this);
|
|
782
|
+
}));
|
|
783
|
+
|
|
784
|
+
function getMemberRetailDetail() {
|
|
785
|
+
return _ref3.apply(this, arguments);
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
return getMemberRetailDetail;
|
|
789
|
+
}()
|
|
790
|
+
}, {
|
|
791
|
+
key: 'getLoginInfo',
|
|
792
|
+
value: function getLoginInfo() {
|
|
793
|
+
var _ref4 = _mutantsMicrofx.localStore.get('user') || {},
|
|
794
|
+
_ref4$loginInfo = _ref4.loginInfo,
|
|
795
|
+
loginInfo = _ref4$loginInfo === undefined ? {} : _ref4$loginInfo;
|
|
796
|
+
|
|
797
|
+
return loginInfo;
|
|
798
|
+
}
|
|
799
|
+
}, {
|
|
800
|
+
key: 'commit',
|
|
801
|
+
value: function () {
|
|
802
|
+
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3(bTest) {
|
|
803
|
+
var resp;
|
|
804
|
+
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
805
|
+
while (1) {
|
|
806
|
+
switch (_context3.prev = _context3.next) {
|
|
807
|
+
case 0:
|
|
808
|
+
console.log('settlementStore.commit开始,参数:' + bTest);
|
|
809
|
+
|
|
810
|
+
if (!bTest) {
|
|
811
|
+
_context3.next = 3;
|
|
812
|
+
break;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
return _context3.abrupt('return', _promise2.default.resolve(true));
|
|
816
|
+
|
|
817
|
+
case 3:
|
|
818
|
+
_context3.prev = 3;
|
|
819
|
+
|
|
820
|
+
if (!this.isProject) {
|
|
821
|
+
_context3.next = 12;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
_context3.next = 7;
|
|
826
|
+
return this.saveByPost();
|
|
827
|
+
|
|
828
|
+
case 7:
|
|
829
|
+
resp = _context3.sent;
|
|
830
|
+
|
|
831
|
+
if (!resp.IsSucceed) {
|
|
832
|
+
_context3.next = 10;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return _context3.abrupt('return', _promise2.default.resolve(true));
|
|
837
|
+
|
|
838
|
+
case 10:
|
|
839
|
+
_context3.next = 20;
|
|
840
|
+
break;
|
|
841
|
+
|
|
842
|
+
case 12:
|
|
843
|
+
if (!(this.type == 1)) {
|
|
844
|
+
_context3.next = 17;
|
|
845
|
+
break;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
_context3.next = 15;
|
|
849
|
+
return this.saveMember();
|
|
850
|
+
|
|
851
|
+
case 15:
|
|
852
|
+
_context3.next = 19;
|
|
853
|
+
break;
|
|
854
|
+
|
|
855
|
+
case 17:
|
|
856
|
+
_context3.next = 19;
|
|
857
|
+
return this.save();
|
|
858
|
+
|
|
859
|
+
case 19:
|
|
860
|
+
return _context3.abrupt('return', _promise2.default.resolve(true));
|
|
861
|
+
|
|
862
|
+
case 20:
|
|
863
|
+
_context3.next = 26;
|
|
864
|
+
break;
|
|
865
|
+
|
|
866
|
+
case 22:
|
|
867
|
+
_context3.prev = 22;
|
|
868
|
+
_context3.t0 = _context3['catch'](3);
|
|
869
|
+
|
|
870
|
+
console.error('settlementStore.commit失败,错误信息:' + _context3.t0);
|
|
871
|
+
return _context3.abrupt('return', _promise2.default.resolve(_context3.t0));
|
|
872
|
+
|
|
873
|
+
case 26:
|
|
874
|
+
case 'end':
|
|
875
|
+
return _context3.stop();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
}, _callee3, this, [[3, 22]]);
|
|
879
|
+
}));
|
|
880
|
+
|
|
881
|
+
function commit(_x) {
|
|
882
|
+
return _ref5.apply(this, arguments);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
return commit;
|
|
886
|
+
}()
|
|
887
|
+
}, {
|
|
888
|
+
key: 'handlePrint',
|
|
889
|
+
value: function handlePrint(resp) {
|
|
890
|
+
// 储值打印
|
|
891
|
+
return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp.ID, {});
|
|
892
|
+
}
|
|
893
|
+
}, {
|
|
894
|
+
key: 'handleProjectStoragePrint',
|
|
895
|
+
value: function handleProjectStoragePrint(resp) {
|
|
896
|
+
// 项目储值打印
|
|
897
|
+
return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_PROJECT_STORAGE_PRINT, resp.Data.ID, {});
|
|
898
|
+
}
|
|
899
|
+
}, {
|
|
900
|
+
key: 'saveByPost',
|
|
901
|
+
value: function saveByPost() {
|
|
902
|
+
var _this9 = this;
|
|
903
|
+
|
|
904
|
+
(0, _mobx.runInAction)(function () {
|
|
905
|
+
_this9.dto.StorageMutiSettleDetails = [];
|
|
906
|
+
var thePaymodes = _this9.newStyle ? (0, _filter3.default)(_this9.paymode.thePaymodes, function (mode) {
|
|
907
|
+
return parseFloat(mode.value) != 0;
|
|
908
|
+
}) : _this9.paymode.thePaymodes;
|
|
909
|
+
(0, _each3.default)(thePaymodes, function (mode) {
|
|
910
|
+
var themode = (0, _find3.default)(_this9.paymode.paymodes, { 'paymentType': mode.paymentType });
|
|
911
|
+
|
|
912
|
+
var value = parseFloat(mode.value);
|
|
913
|
+
var giveChange = null;
|
|
914
|
+
if (_this9.calculationIsXianJin(mode) && _this9.paymode.receivable < 0 && value > Math.abs(_this9.paymode.receivable)) {
|
|
915
|
+
value = Math.Add(value, _this9.paymode.receivable);
|
|
916
|
+
giveChange = Math.abs(_this9.paymode.receivable);
|
|
917
|
+
}
|
|
918
|
+
_this9.dto.ExternalCode = _this9.dto.Idmember + "_" + (0, _tplusPoslogin.PosInitData)('posCode') + "_" + new Date().toArray().join("_") + Math.floor(Math.random() * 1000 + 1);
|
|
919
|
+
_this9.dto.StorageMutiSettleDetails.push({
|
|
920
|
+
Code: mode.paymethodId,
|
|
921
|
+
StorageAmount: value,
|
|
922
|
+
GiveChange: giveChange,
|
|
923
|
+
IdsettleStyle: themode.idSettleStyle,
|
|
924
|
+
IdbankAccount: themode.idBankAccount,
|
|
925
|
+
PaymentCode: mode.authCode,
|
|
926
|
+
DynamicPropertyKeys: [],
|
|
927
|
+
DynamicPropertyValues: [],
|
|
928
|
+
DataSource: { Id: _this9.dataSource }
|
|
929
|
+
});
|
|
930
|
+
});
|
|
931
|
+
});
|
|
932
|
+
return (0, _tplusApi.tApi)({ dto: this.dto, isCheckDate: this.isCheckDate }, 'chanjet.ME.IProjectStorage.SaveByPost', false, false).then(function (resp) {
|
|
933
|
+
if (resp.IsSucceed) {
|
|
934
|
+
_this9.getMemberRetailDetail().then(function (ret) {
|
|
935
|
+
var Storages = ret.Storages;
|
|
936
|
+
|
|
937
|
+
_mutantsMicrofx.stores.memberStore.setStoragesData(Storages);
|
|
938
|
+
});
|
|
939
|
+
_this9.handleProjectStoragePrint(resp); //项目储值打印
|
|
940
|
+
return resp;
|
|
941
|
+
} else {
|
|
942
|
+
// if (resp.ErrorMsg === '当前储值已失效,是否保存?') {
|
|
943
|
+
// ModalWraper.confirm({
|
|
944
|
+
// title: "温馨提示",
|
|
945
|
+
// content: resp.ErrorMsg,
|
|
946
|
+
// cancelable: false,
|
|
947
|
+
// okText: '确定',
|
|
948
|
+
// okType: 'warning',
|
|
949
|
+
// onOk: async() => {
|
|
950
|
+
// this.isCheckDate = false;
|
|
951
|
+
// },
|
|
952
|
+
// onCancel: () => {
|
|
953
|
+
// this.isCheckDate = true;
|
|
954
|
+
// }
|
|
955
|
+
// })
|
|
956
|
+
// } else {
|
|
957
|
+
_tplusComponentsTouch.ModalWraper.warning({
|
|
958
|
+
title: '温馨提示',
|
|
959
|
+
content: resp.ErrorMsg,
|
|
960
|
+
okText: '确定',
|
|
961
|
+
okType: 'warning'
|
|
962
|
+
});
|
|
963
|
+
// }
|
|
964
|
+
}
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
}, {
|
|
968
|
+
key: 'saveMember',
|
|
969
|
+
value: function saveMember() {
|
|
970
|
+
var _this10 = this;
|
|
971
|
+
|
|
972
|
+
(0, _mobx.runInAction)(function () {
|
|
973
|
+
_this10.dto.StorageMutiSettleDetails = [];
|
|
974
|
+
var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
|
|
975
|
+
return parseFloat(mode.value) != 0;
|
|
976
|
+
}) : _this10.paymode.thePaymodes;
|
|
977
|
+
(0, _each3.default)(thePaymodes, function (mode) {
|
|
978
|
+
var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
|
|
979
|
+
|
|
980
|
+
var value = parseFloat(mode.value);
|
|
981
|
+
var giveChange = null;
|
|
982
|
+
if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
|
|
983
|
+
value = Math.Add(value, _this10.paymode.receivable);
|
|
984
|
+
giveChange = Math.abs(_this10.paymode.receivable);
|
|
985
|
+
}
|
|
986
|
+
_this10.dto.StorageMutiSettleDetails.push({
|
|
987
|
+
Code: mode.paymethodId,
|
|
988
|
+
StorageAmount: value,
|
|
989
|
+
GiveChange: giveChange,
|
|
990
|
+
IdsettleStyle: themode.idSettleStyle,
|
|
991
|
+
IdbankAccount: themode.idBankAccount,
|
|
992
|
+
PaymentCode: mode.authCode,
|
|
993
|
+
DynamicPropertyKeys: [],
|
|
994
|
+
DynamicPropertyValues: [],
|
|
995
|
+
DataSource: { Id: _this10.dataSource }
|
|
996
|
+
});
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
|
|
1000
|
+
_this10.handlePrint(resp);
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
}, {
|
|
1004
|
+
key: 'save',
|
|
1005
|
+
value: function save() {
|
|
1006
|
+
var _this11 = this;
|
|
1007
|
+
|
|
1008
|
+
(0, _mobx.runInAction)(function () {
|
|
1009
|
+
_this11.dto.RetailPaymentDetails = [];
|
|
1010
|
+
_this11.dto.RetailStorageDetails = [];
|
|
1011
|
+
_this11.dto.RetailCouponDetails = [];
|
|
1012
|
+
var czkSum = 0;
|
|
1013
|
+
var Idmember = _this11.dto.Idmember;
|
|
1014
|
+
var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
|
|
1015
|
+
return parseFloat(mode.value) != 0;
|
|
1016
|
+
}) : _this11.paymode.thePaymodes;
|
|
1017
|
+
(0, _each3.default)(thePaymodes, function (mode) {
|
|
1018
|
+
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
|
|
1019
|
+
if (mode.paymentType == PayStyle.hyczk) {
|
|
1020
|
+
if (!Idmember) {
|
|
1021
|
+
Idmember = mode.member.id;
|
|
1022
|
+
}
|
|
1023
|
+
czkSum = Math.Add(czkSum, mode.value);
|
|
1024
|
+
_this11.dto.RetailStorageDetails.push({
|
|
1025
|
+
Code: mode.paymethodId,
|
|
1026
|
+
StoragePaymentAmount: mode.value,
|
|
1027
|
+
IsOrigReturn: false,
|
|
1028
|
+
BalanceStorage: mode.balance,
|
|
1029
|
+
Idmember: mode.member.id,
|
|
1030
|
+
DynamicPropertyKeys: [],
|
|
1031
|
+
DynamicPropertyValues: [],
|
|
1032
|
+
DataSource: { Id: _this11.dataSource },
|
|
1033
|
+
Password: mode.authCode
|
|
1034
|
+
});
|
|
1035
|
+
} else {
|
|
1036
|
+
var value = parseFloat(mode.value);
|
|
1037
|
+
var giveChange = null;
|
|
1038
|
+
if (_this11.calculationIsXianJin(mode) && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
|
|
1039
|
+
value = Math.Add(value, _this11.paymode.receivable);
|
|
1040
|
+
giveChange = Math.abs(_this11.paymode.receivable);
|
|
1041
|
+
}
|
|
1042
|
+
var giveChangeForStorage = null;
|
|
1043
|
+
if (_this11.giveChangeForStorage > 0 && _this11.calculationIsXianJin(mode)) {
|
|
1044
|
+
giveChange = _this11.cashChange;
|
|
1045
|
+
giveChangeForStorage = _this11.giveChangeForStorage;
|
|
1046
|
+
}
|
|
1047
|
+
_this11.dto.GiveChangeForStorageAmount = _this11.giveChangeForStorage;
|
|
1048
|
+
_this11.dto.RetailPaymentDetails.push({
|
|
1049
|
+
Code: mode.paymethodId,
|
|
1050
|
+
OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
|
|
1051
|
+
Amount: value,
|
|
1052
|
+
GiveChange: giveChange,
|
|
1053
|
+
GiveChangeForStorage: giveChangeForStorage,
|
|
1054
|
+
IdsettleStyle: themode.idSettleStyle,
|
|
1055
|
+
IdbankAccount: themode.idBankAccount,
|
|
1056
|
+
Idcurrency: themode.idCurrency,
|
|
1057
|
+
ExchangeRate: themode.exchangeRate,
|
|
1058
|
+
PaymentCode: mode.authCode,
|
|
1059
|
+
SteadCashIntegral: mode.steadCashIntegral,
|
|
1060
|
+
OverchargesAmount: mode.overchargesAmount,
|
|
1061
|
+
DynamicPropertyKeys: [],
|
|
1062
|
+
DynamicPropertyValues: [],
|
|
1063
|
+
DataSource: { Id: _this11.dataSource }
|
|
1064
|
+
});
|
|
1065
|
+
if (mode.paymentType == PayStyle.djq) {
|
|
1066
|
+
(0, _each3.default)(mode.djqs, function (djq) {
|
|
1067
|
+
if (djq.checked) {
|
|
1068
|
+
_this11.dto.RetailCouponDetails.push({
|
|
1069
|
+
CouponCode: djq.code,
|
|
1070
|
+
ReductionAmount: djq.amount,
|
|
1071
|
+
EnableAmount: djq.doorsill,
|
|
1072
|
+
CouponTitle: djq.name,
|
|
1073
|
+
IdMember: djq.UMemberID ? mode.member.id : null,
|
|
1074
|
+
LastTS: djq.LastTS,
|
|
1075
|
+
DataSource: { Id: _this11.dataSource }
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
if (_this11.dto.RetailStorageDetails.length > 0) {
|
|
1083
|
+
var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
|
|
1084
|
+
_this11.dto.RetailPaymentDetails.push({
|
|
1085
|
+
Code: _this11.paymode.counter,
|
|
1086
|
+
OrigAmount: czkSum,
|
|
1087
|
+
Amount: czkSum,
|
|
1088
|
+
IdsettleStyle: themode.idSettleStyle,
|
|
1089
|
+
IdbankAccount: themode.idBankAccount,
|
|
1090
|
+
DynamicPropertyKeys: [],
|
|
1091
|
+
DynamicPropertyValues: [],
|
|
1092
|
+
DataSource: { Id: _this11.dataSource }
|
|
1093
|
+
});
|
|
1094
|
+
_this11.dto.Idmember = Idmember;
|
|
1095
|
+
}
|
|
1096
|
+
});
|
|
1097
|
+
console.log('结算数据:', this.dto);
|
|
1098
|
+
return (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
|
|
1099
|
+
_this11.setDtoID(resp.ID);
|
|
1100
|
+
// runInAction(()=>{
|
|
1101
|
+
// this.context.viewModel.data.ID=resp.ID;
|
|
1102
|
+
// });
|
|
1103
|
+
});
|
|
1104
|
+
// return new Promise((resolve,reject)=>{
|
|
1105
|
+
// setTimeout(()=>{
|
|
1106
|
+
// if(result){
|
|
1107
|
+
// resolve(result);
|
|
1108
|
+
// }else{
|
|
1109
|
+
// reject(result);
|
|
1110
|
+
// }
|
|
1111
|
+
// },3000);//5000
|
|
1112
|
+
// })
|
|
1113
|
+
}
|
|
1114
|
+
}, {
|
|
1115
|
+
key: 'setDtoID',
|
|
1116
|
+
value: function setDtoID(id) {
|
|
1117
|
+
this.context.viewModel.data.ID = id;
|
|
1118
|
+
}
|
|
1119
|
+
}, {
|
|
1120
|
+
key: 'querySettleResult',
|
|
1121
|
+
value: function () {
|
|
1122
|
+
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
|
|
1123
|
+
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
|
1124
|
+
while (1) {
|
|
1125
|
+
switch (_context4.prev = _context4.next) {
|
|
1126
|
+
case 0:
|
|
1127
|
+
_context4.prev = 0;
|
|
1128
|
+
_context4.t0 = _promise2.default;
|
|
1129
|
+
_context4.next = 4;
|
|
1130
|
+
return (0, _tplusApi.tApi)({ RetailCode: this.dto.Code }, 'chanjet.RE.newRetail.QuerySettleResult', false, false, { timeout_skip: true });
|
|
1131
|
+
|
|
1132
|
+
case 4:
|
|
1133
|
+
_context4.t1 = _context4.sent;
|
|
1134
|
+
return _context4.abrupt('return', _context4.t0.resolve.call(_context4.t0, _context4.t1));
|
|
1135
|
+
|
|
1136
|
+
case 8:
|
|
1137
|
+
_context4.prev = 8;
|
|
1138
|
+
_context4.t2 = _context4['catch'](0);
|
|
1139
|
+
return _context4.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
|
|
1140
|
+
|
|
1141
|
+
case 11:
|
|
1142
|
+
case 'end':
|
|
1143
|
+
return _context4.stop();
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}, _callee4, this, [[0, 8]]);
|
|
1147
|
+
}));
|
|
1148
|
+
|
|
1149
|
+
function querySettleResult() {
|
|
1150
|
+
return _ref6.apply(this, arguments);
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
return querySettleResult;
|
|
1154
|
+
}()
|
|
1155
|
+
}, {
|
|
1156
|
+
key: 'validePwd',
|
|
1157
|
+
value: function () {
|
|
1158
|
+
var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(value) {
|
|
1159
|
+
var result;
|
|
1160
|
+
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
|
1161
|
+
while (1) {
|
|
1162
|
+
switch (_context5.prev = _context5.next) {
|
|
1163
|
+
case 0:
|
|
1164
|
+
_context5.prev = 0;
|
|
1165
|
+
_context5.next = 3;
|
|
1166
|
+
return (0, _tplusApi.tApi)({ "CheckoutParams": {
|
|
1167
|
+
"Idmember": value.id,
|
|
1168
|
+
"Password": value.pwd
|
|
1169
|
+
} }, 'AA.DR.newRetailMember.CheckoutMemberPassword', false, false);
|
|
1170
|
+
|
|
1171
|
+
case 3:
|
|
1172
|
+
result = _context5.sent;
|
|
1173
|
+
return _context5.abrupt('return', _promise2.default.resolve(result.Success ? "" : result.Message));
|
|
1174
|
+
|
|
1175
|
+
case 7:
|
|
1176
|
+
_context5.prev = 7;
|
|
1177
|
+
_context5.t0 = _context5['catch'](0);
|
|
1178
|
+
return _context5.abrupt('return', "failed");
|
|
1179
|
+
|
|
1180
|
+
case 10:
|
|
1181
|
+
case 'end':
|
|
1182
|
+
return _context5.stop();
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}, _callee5, this, [[0, 7]]);
|
|
1186
|
+
}));
|
|
1187
|
+
|
|
1188
|
+
function validePwd(_x2) {
|
|
1189
|
+
return _ref7.apply(this, arguments);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
return validePwd;
|
|
1193
|
+
}()
|
|
1194
|
+
}]);
|
|
1195
|
+
return SettlementStore;
|
|
1196
|
+
}(), (_applyDecoratedDescriptor(_class.prototype, 'initByOriginReturn', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'initByOriginReturn'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'quickSettle', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'quickSettle'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusAndAddPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusAndAddPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addDjq', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addDjq'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeInputStorageValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeInputStorageValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'clearInputStorageData', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'clearInputStorageData'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeReturnValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeReturnValue'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPayDirectly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPayDirectly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'addPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'addPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'delPay', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'delPay'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeIsCheckDate', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeIsCheckDate'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'CheckExpirationDate', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'CheckExpirationDate'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'setDtoID', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'setDtoID'), _class.prototype)), _class);
|
|
1197
|
+
exports.default = SettlementStore;
|
|
1198
|
+
var PayMode = exports.PayMode = (_class3 = function () {
|
|
1199
|
+
function PayMode() {
|
|
1200
|
+
// this.amount=getFixedNumber(amount);
|
|
1201
|
+
// this.calcReserved();
|
|
1202
|
+
|
|
1203
|
+
(0, _classCallCheck3.default)(this, PayMode);
|
|
1204
|
+
this._counter = 0;
|
|
1205
|
+
this.amount = 0;
|
|
1206
|
+
this.onlineamount = 0;
|
|
1207
|
+
this.maxamount = 0;
|
|
1208
|
+
|
|
1209
|
+
_initDefineProp(this, 'currentFocus', _descriptor, this);
|
|
1210
|
+
|
|
1211
|
+
_initDefineProp(this, 'received', _descriptor2, this);
|
|
1212
|
+
|
|
1213
|
+
_initDefineProp(this, 'receivable', _descriptor3, this);
|
|
1214
|
+
|
|
1215
|
+
_initDefineProp(this, 'paymodes', _descriptor4, this);
|
|
1216
|
+
|
|
1217
|
+
_initDefineProp(this, 'thePaymodes', _descriptor5, this);
|
|
1218
|
+
|
|
1219
|
+
this.currentMode = null;
|
|
1220
|
+
this.settle = {
|
|
1221
|
+
name: "复合结算",
|
|
1222
|
+
hotKey: "Ctrl+M"
|
|
1223
|
+
};
|
|
1224
|
+
} //应收
|
|
1225
|
+
|
|
1226
|
+
|
|
1227
|
+
(0, _createClass3.default)(PayMode, [{
|
|
1228
|
+
key: 'clean',
|
|
1229
|
+
value: function clean() {
|
|
1230
|
+
this.thePaymodes = [];
|
|
1231
|
+
this.calcReserved();
|
|
1232
|
+
}
|
|
1233
|
+
}, {
|
|
1234
|
+
key: 'setAmount',
|
|
1235
|
+
value: function setAmount(a, o) {
|
|
1236
|
+
this.amount = (0, _utils.getFixedNumber)((a || 0) - (o || 0));
|
|
1237
|
+
this.onlineamount = (0, _utils.getFixedNumber)(o || 0);
|
|
1238
|
+
this.calcReserved();
|
|
1239
|
+
return this.amount < 0;
|
|
1240
|
+
}
|
|
1241
|
+
}, {
|
|
1242
|
+
key: 'calcReserved',
|
|
1243
|
+
value: function calcReserved() {
|
|
1244
|
+
var sum = 0;
|
|
1245
|
+
(0, _each3.default)(this.thePaymodes, function (mode) {
|
|
1246
|
+
sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
|
|
1247
|
+
});
|
|
1248
|
+
this.received = (0, _utils.getFixedNumber)(sum);
|
|
1249
|
+
this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
|
|
1250
|
+
}
|
|
1251
|
+
}, {
|
|
1252
|
+
key: 'calcReservedDjq',
|
|
1253
|
+
value: function calcReservedDjq() {
|
|
1254
|
+
var sum = 0;
|
|
1255
|
+
(0, _each3.default)(this.thePaymodes, function (mode) {
|
|
1256
|
+
if (mode.paymentType != PayStyle.djq || mode.checked) {
|
|
1257
|
+
sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
this.received = (0, _utils.getFixedNumber)(sum);
|
|
1261
|
+
this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
|
|
1262
|
+
}
|
|
1263
|
+
}, {
|
|
1264
|
+
key: 'calcDjqValue',
|
|
1265
|
+
value: function calcDjqValue(q1) {
|
|
1266
|
+
if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
|
|
1267
|
+
_message2.default.error("本单没有代金券可用金额,该券不可使用。");
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
|
|
1271
|
+
return djq.code == q1.code;
|
|
1272
|
+
});
|
|
1273
|
+
if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
|
|
1274
|
+
_message2.default.error("本单金额低于使用门槛,该券不可使用。");
|
|
1275
|
+
return;
|
|
1276
|
+
}
|
|
1277
|
+
q && (q.checked = !q.checked);
|
|
1278
|
+
var sum = 0;
|
|
1279
|
+
(0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
|
|
1280
|
+
return djq.checked;
|
|
1281
|
+
}), function (q) {
|
|
1282
|
+
sum = Math.Add(sum, q.amount);
|
|
1283
|
+
});
|
|
1284
|
+
if (q && !q.checked) {
|
|
1285
|
+
this.calcReservedDjq();
|
|
1286
|
+
};
|
|
1287
|
+
this.currentMode.value = (0, _utils.getFixedNumber)(Math.max(0, Math.min(this.receivable, sum, this.currentMode.maxamount)));
|
|
1288
|
+
this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
|
|
1289
|
+
this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
|
|
1290
|
+
}
|
|
1291
|
+
}, {
|
|
1292
|
+
key: 'setCurrentModeValue',
|
|
1293
|
+
value: function setCurrentModeValue(v, max) {
|
|
1294
|
+
this.currentMode.value = parseFloat(v) || 0;
|
|
1295
|
+
this.currentMode.errinfo = '';
|
|
1296
|
+
if (this.amount > 0 && (v === '' || v === '0.00')) {
|
|
1297
|
+
this.currentMode.errinfo = "实收金额必须录入";
|
|
1298
|
+
} else if (Math.abs(parseFloat(v)) > Math.abs(this.amount)) {
|
|
1299
|
+
this.currentMode.errinfo = "实收不应大于应收";
|
|
1300
|
+
} else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
|
|
1301
|
+
this.currentMode.errinfo = "余额不足";
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}, {
|
|
1305
|
+
key: 'calcMemberBalance',
|
|
1306
|
+
value: function calcMemberBalance() {
|
|
1307
|
+
this.currentMode.balance = this.currentMode.member.rawbalance - this.currentMode.value;
|
|
1308
|
+
}
|
|
1309
|
+
}, {
|
|
1310
|
+
key: 'setPaymodes',
|
|
1311
|
+
value: function () {
|
|
1312
|
+
var _ref8 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(type) {
|
|
1313
|
+
var _this12 = this;
|
|
1314
|
+
|
|
1315
|
+
var modes;
|
|
1316
|
+
return _regenerator2.default.wrap(function _callee6$(_context6) {
|
|
1317
|
+
while (1) {
|
|
1318
|
+
switch (_context6.prev = _context6.next) {
|
|
1319
|
+
case 0:
|
|
1320
|
+
_context6.next = 2;
|
|
1321
|
+
return (0, _tplusApi.tApi)({ settleStyleType: type == 1 ? '63002' : '63001' }, 'chanjet.RE.NewPos.GetStoreSettleStyles', false, false);
|
|
1322
|
+
|
|
1323
|
+
case 2:
|
|
1324
|
+
modes = _context6.sent;
|
|
1325
|
+
|
|
1326
|
+
if (modes) {
|
|
1327
|
+
(0, _mobx.runInAction)(function () {
|
|
1328
|
+
(0, _each3.default)(modes.SettleStyles, function (mode, index) {
|
|
1329
|
+
//产品需求确认会员储值卡结算方式前端展示统一调整为“储值卡" tuzha by 2020-07-08
|
|
1330
|
+
if (mode.Code == PayStyle.hyczk) {
|
|
1331
|
+
mode.Name = '储值卡';
|
|
1332
|
+
}
|
|
1333
|
+
_this12.paymodes.push({
|
|
1334
|
+
name: mode.Name,
|
|
1335
|
+
isDefault: mode.IsDefaultSettleStyle,
|
|
1336
|
+
isQuick: (0, _findIndex3.default)(modes.QuickSettleStyles, { 'Code': mode.Code }) >= 0,
|
|
1337
|
+
orderBy: 1,
|
|
1338
|
+
paymentType: mode.Code,
|
|
1339
|
+
idSettleStyle: mode.IdSettleStyle,
|
|
1340
|
+
idBankAccount: mode.IdBankAccount,
|
|
1341
|
+
exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
|
|
1342
|
+
idCurrency: mode.Currency ? mode.Currency.ID : -1,
|
|
1343
|
+
calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88",
|
|
1344
|
+
bankNoType: mode.BankNoType
|
|
1345
|
+
});
|
|
1346
|
+
});
|
|
1347
|
+
//modes.QuickSettleStyles
|
|
1348
|
+
});
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
case 4:
|
|
1352
|
+
case 'end':
|
|
1353
|
+
return _context6.stop();
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
}, _callee6, this);
|
|
1357
|
+
}));
|
|
1358
|
+
|
|
1359
|
+
function setPaymodes(_x3) {
|
|
1360
|
+
return _ref8.apply(this, arguments);
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
return setPaymodes;
|
|
1364
|
+
}()
|
|
1365
|
+
}, {
|
|
1366
|
+
key: 'charge',
|
|
1367
|
+
get: function get() {
|
|
1368
|
+
return Math.abs(this.receivable);
|
|
1369
|
+
}
|
|
1370
|
+
}, {
|
|
1371
|
+
key: 'counter',
|
|
1372
|
+
get: function get() {
|
|
1373
|
+
return ++this._counter;
|
|
1374
|
+
}
|
|
1375
|
+
}]);
|
|
1376
|
+
return PayMode;
|
|
1377
|
+
}(), (_descriptor = _applyDecoratedDescriptor(_class3.prototype, 'currentFocus', [_mobx.observable], {
|
|
1378
|
+
enumerable: true,
|
|
1379
|
+
initializer: function initializer() {
|
|
1380
|
+
return "";
|
|
1381
|
+
}
|
|
1382
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class3.prototype, 'received', [_mobx.observable], {
|
|
1383
|
+
enumerable: true,
|
|
1384
|
+
initializer: function initializer() {
|
|
1385
|
+
return 0;
|
|
1386
|
+
}
|
|
1387
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class3.prototype, 'receivable', [_mobx.observable], {
|
|
1388
|
+
enumerable: true,
|
|
1389
|
+
initializer: function initializer() {
|
|
1390
|
+
return 0;
|
|
1391
|
+
}
|
|
1392
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class3.prototype, 'paymodes', [_mobx.observable], {
|
|
1393
|
+
enumerable: true,
|
|
1394
|
+
initializer: function initializer() {
|
|
1395
|
+
return [];
|
|
1396
|
+
}
|
|
1397
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class3.prototype, 'thePaymodes', [_mobx.observable], {
|
|
1398
|
+
enumerable: true,
|
|
1399
|
+
initializer: function initializer() {
|
|
1400
|
+
return [];
|
|
1401
|
+
}
|
|
1402
|
+
}), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReservedDjq', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReservedDjq'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'setCurrentModeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'setCurrentModeValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcMemberBalance', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcMemberBalance'), _class3.prototype)), _class3);
|
|
1403
|
+
var Member = exports.Member = (_class5 = function () {
|
|
1404
|
+
function Member(m) {
|
|
1405
|
+
var _this13 = this;
|
|
1406
|
+
|
|
1407
|
+
(0, _classCallCheck3.default)(this, Member);
|
|
1408
|
+
|
|
1409
|
+
_initDefineProp(this, 'cardNo', _descriptor6, this);
|
|
1410
|
+
|
|
1411
|
+
_initDefineProp(this, 'balance', _descriptor7, this);
|
|
1412
|
+
|
|
1413
|
+
_initDefineProp(this, 'exchangable', _descriptor8, this);
|
|
1414
|
+
|
|
1415
|
+
if (m) {
|
|
1416
|
+
this.id = m.ID;
|
|
1417
|
+
this.uid = m.Uid;
|
|
1418
|
+
this.type = m.MemberType ? m.MemberType.Name : "普通";
|
|
1419
|
+
this.rawbalance = m.BalanceStorage;
|
|
1420
|
+
var index = (0, _findIndex3.default)(m.DynamicPropertyKeys, function (key) {
|
|
1421
|
+
return key == 'canusedbalancestorage';
|
|
1422
|
+
});
|
|
1423
|
+
(0, _mobx.runInAction)(function () {
|
|
1424
|
+
_this13.cardNo = m.CardCode;
|
|
1425
|
+
if (index >= 0) {
|
|
1426
|
+
_this13.balance = parseFloat(m.DynamicPropertyValues[index]);
|
|
1427
|
+
} else {
|
|
1428
|
+
_this13.balance = _this13.rawbalance;
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
|
|
1432
|
+
this.NeedModifyPassword = m.NeedModifyPassword;
|
|
1433
|
+
this.bonusPoints = m.BalanceIntegral;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
(0, _createClass3.default)(Member, [{
|
|
1438
|
+
key: 'setExchangable',
|
|
1439
|
+
value: function setExchangable(v) {
|
|
1440
|
+
this.exchangable = v;
|
|
1441
|
+
}
|
|
1442
|
+
}, {
|
|
1443
|
+
key: 'setCardNo',
|
|
1444
|
+
value: function setCardNo(v) {
|
|
1445
|
+
this.cardNo = v;
|
|
1446
|
+
this.id = null;
|
|
1447
|
+
}
|
|
1448
|
+
}]);
|
|
1449
|
+
return Member;
|
|
1450
|
+
}(), (_descriptor6 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
|
|
1451
|
+
enumerable: true,
|
|
1452
|
+
initializer: null
|
|
1453
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
|
|
1454
|
+
enumerable: true,
|
|
1455
|
+
initializer: null
|
|
1456
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
|
|
1457
|
+
enumerable: true,
|
|
1458
|
+
initializer: null
|
|
1459
|
+
}), _applyDecoratedDescriptor(_class5.prototype, 'setExchangable', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setExchangable'), _class5.prototype), _applyDecoratedDescriptor(_class5.prototype, 'setCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setCardNo'), _class5.prototype)), _class5);
|
|
1460
|
+
//# sourceMappingURL=settlementStore.js.map
|