tplus-components-touch 3.45.1 → 3.45.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (224) hide show
  1. package/README.md +16 -16
  2. package/dist/components/acCitySelect/CitySelect.js +18 -18
  3. package/dist/components/acCitySelect/CitySelect.js.map +1 -1
  4. package/dist/components/acCitySelect/CitySelect.less +9 -9
  5. package/dist/components/acCitySelect/citys.js.map +1 -1
  6. package/dist/components/acCitySelect/index.js.map +1 -1
  7. package/dist/components/acCitySelect/provinceData.js +7 -7
  8. package/dist/components/acCitySelect/provinceData.js.map +1 -1
  9. package/dist/components/addLog/AddLogProcessor.js +6 -6
  10. package/dist/components/addLog/AddLogProcessor.js.map +1 -1
  11. package/dist/components/addLog/OperationLogApi.js +3 -3
  12. package/dist/components/addLog/OperationLogApi.js.map +1 -1
  13. package/dist/components/autoComplete/index.js +14 -14
  14. package/dist/components/autoComplete/index.js.map +1 -1
  15. package/dist/components/autoComplete/index.less +89 -89
  16. package/dist/components/autoComplete/option.js.map +1 -1
  17. package/dist/components/autoCompleteWithKeyboard/index.js +14 -14
  18. package/dist/components/autoCompleteWithKeyboard/index.js.map +1 -1
  19. package/dist/components/autoCompleteWithKeyboard/index.less +18 -18
  20. package/dist/components/billSearch/api.js +29 -29
  21. package/dist/components/billSearch/api.js.map +1 -1
  22. package/dist/components/billSearch/index.js +8 -8
  23. package/dist/components/billSearch/index.js.map +1 -1
  24. package/dist/components/billSearch/index.less +384 -384
  25. package/dist/components/cloudPrint/BTPrintFormatUtil.js +19 -19
  26. package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +1 -1
  27. package/dist/components/cloudPrint/api.js.map +1 -1
  28. package/dist/components/cloudPrint/index.js +893 -608
  29. package/dist/components/cloudPrint/index.js.map +1 -1
  30. package/dist/components/cloudPrint/printDispatch.js +189 -53
  31. package/dist/components/cloudPrint/printDispatch.js.map +1 -1
  32. package/dist/components/cloudPrint/printTemplate/dialy_one.json +239 -0
  33. package/dist/components/cloudPrint/printTemplate/duty_one.json +239 -0
  34. package/dist/components/cloudPrint/printTemplate/retail_one.json +204 -0
  35. package/dist/components/cloudPrint/printTemplate/retail_two.json +220 -0
  36. package/dist/components/cloudPrint/printTemplate/storage_one.json +129 -0
  37. package/dist/components/cloudPrint/printTemplate/template.js +52 -0
  38. package/dist/components/cloudPrint/printTemplate/template.js.map +1 -0
  39. package/dist/components/commonForm/addressPicker/index.js +241 -0
  40. package/dist/components/commonForm/addressPicker/index.js.map +1 -0
  41. package/dist/components/commonForm/addressPicker/style.less +10 -10
  42. package/dist/components/commonForm/autoComplete/index.js +260 -0
  43. package/dist/components/commonForm/autoComplete/index.js.map +1 -0
  44. package/dist/components/commonForm/autoComplete/style.less +2 -2
  45. package/dist/components/commonForm/datePicker/index.js +92 -0
  46. package/dist/components/commonForm/datePicker/index.js.map +1 -0
  47. package/dist/components/commonForm/datePicker/style.less +4 -4
  48. package/dist/components/commonForm/formControl/index.js +144 -0
  49. package/dist/components/commonForm/formControl/index.js.map +1 -0
  50. package/dist/components/commonForm/index.js +4 -4
  51. package/dist/components/commonForm/index.js.map +1 -1
  52. package/dist/components/commonForm/inputNumber/index.js +272 -0
  53. package/dist/components/commonForm/inputNumber/index.js.map +1 -0
  54. package/dist/components/commonForm/inputNumber/style.less +10 -10
  55. package/dist/components/commonForm/radio/index.js +132 -0
  56. package/dist/components/commonForm/radio/index.js.map +1 -0
  57. package/dist/components/commonForm/style.less +1 -1
  58. package/dist/components/deliverySearch/api.js +21 -21
  59. package/dist/components/deliverySearch/api.js.map +1 -1
  60. package/dist/components/deliverySearch/index.js +6 -6
  61. package/dist/components/deliverySearch/index.js.map +1 -1
  62. package/dist/components/deliverySearch/index.less +553 -553
  63. package/dist/components/form/index.js.map +1 -1
  64. package/dist/components/hardwareAPI/index.js +46 -12
  65. package/dist/components/hardwareAPI/index.js.map +1 -1
  66. package/dist/components/hotKey/config.js +23 -23
  67. package/dist/components/hotKey/config.js.map +1 -1
  68. package/dist/components/hotKey/hotKeyModal.js.map +1 -1
  69. package/dist/components/hotKey/index.js +26 -26
  70. package/dist/components/hotKey/index.js.map +1 -1
  71. package/dist/components/hotKey/localConfig.js.map +1 -1
  72. package/dist/components/hotKey/style.less +96 -96
  73. package/dist/components/hotKey/utils.js.map +1 -1
  74. package/dist/components/input/index.js +6 -6
  75. package/dist/components/input/index.js.map +1 -1
  76. package/dist/components/input/scanInput.js.map +1 -1
  77. package/dist/components/input/scanInput.less +30 -30
  78. package/dist/components/input/style.less +106 -106
  79. package/dist/components/input/tplusInput/index.js +81 -0
  80. package/dist/components/input/tplusInput/index.js.map +1 -0
  81. package/dist/components/input/tplusInput/inputContent.js +128 -0
  82. package/dist/components/input/tplusInput/inputContent.js.map +1 -0
  83. package/dist/components/input/tplusInput/inputs.js +151 -0
  84. package/dist/components/input/tplusInput/inputs.js.map +1 -0
  85. package/dist/components/input/tplusInput/style.less +132 -132
  86. package/dist/components/input/utils/index.js +26 -0
  87. package/dist/components/input/utils/index.js.map +1 -0
  88. package/dist/components/inventorySearch/api.js +58 -58
  89. package/dist/components/inventorySearch/api.js.map +1 -1
  90. package/dist/components/inventorySearch/index.js +3 -3
  91. package/dist/components/inventorySearch/index.js.map +1 -1
  92. package/dist/components/inventorySearch/index.less +119 -119
  93. package/dist/components/inventorySearch/store.js.map +1 -1
  94. package/dist/components/inventorySearch/tab.js.map +1 -1
  95. package/dist/components/keyboard/index.js.map +1 -1
  96. package/dist/components/keyboard/index.less +485 -485
  97. package/dist/components/keyboard/letterKeyboard.js +2 -2
  98. package/dist/components/keyboard/letterKeyboard.js.map +1 -1
  99. package/dist/components/keyboard/numKeyboard.js +4 -4
  100. package/dist/components/keyboard/numKeyboard.js.map +1 -1
  101. package/dist/components/keyboard/numKeyboardScan.js.map +1 -1
  102. package/dist/components/keyboard/numberButton_input.js +5 -5
  103. package/dist/components/keyboard/numberButton_input.js.map +1 -1
  104. package/dist/components/keyboard/numkeyboardPassword.js +4 -4
  105. package/dist/components/keyboard/numkeyboardPassword.js.map +1 -1
  106. package/dist/components/keyboard/onlyKeyboard.js +7 -7
  107. package/dist/components/keyboard/onlyKeyboard.js.map +1 -1
  108. package/dist/components/keyboard/onlyLetterButton.js +2 -2
  109. package/dist/components/keyboard/onlyLetterButton.js.map +1 -1
  110. package/dist/components/keyboard/onlyLetterButton2.js +2 -2
  111. package/dist/components/keyboard/onlyLetterButton2.js.map +1 -1
  112. package/dist/components/keyboard/onlyLetterButton2.less +156 -156
  113. package/dist/components/keyboard/onlyNumberButton.js +2 -2
  114. package/dist/components/keyboard/onlyNumberButton.js.map +1 -1
  115. package/dist/components/keyboard/onlyNumberButton2.js +3 -3
  116. package/dist/components/keyboard/onlyNumberButton2.js.map +1 -1
  117. package/dist/components/keyboard/textKeyboard.js.map +1 -1
  118. package/dist/components/layout/hamburger.js.map +1 -1
  119. package/dist/components/layout/index.js +10 -10
  120. package/dist/components/layout/index.js.map +1 -1
  121. package/dist/components/layout/layout.js.map +1 -1
  122. package/dist/components/layout/sider.js +12 -12
  123. package/dist/components/layout/sider.js.map +1 -1
  124. package/dist/components/layout/style.less +82 -82
  125. package/dist/components/loading/index.js +15 -15
  126. package/dist/components/loading/index.js.map +1 -1
  127. package/dist/components/loading/loadingContent.js.map +1 -1
  128. package/dist/components/loading/style.less +72 -72
  129. package/dist/components/loading/utils.js.map +1 -1
  130. package/dist/components/message/index.js +8 -8
  131. package/dist/components/message/index.js.map +1 -1
  132. package/dist/components/message/index.less +101 -101
  133. package/dist/components/modal/index.js.map +1 -1
  134. package/dist/components/modal/index.less +19 -19
  135. package/dist/components/modalVertical/index.js +7 -7
  136. package/dist/components/modalVertical/index.js.map +1 -1
  137. package/dist/components/modalVertical/style.less +60 -60
  138. package/dist/components/modalWraper/index.js +15 -15
  139. package/dist/components/modalWraper/index.js.map +1 -1
  140. package/dist/components/modalWraper/style.less +262 -262
  141. package/dist/components/modalWraper/utils.js.map +1 -1
  142. package/dist/components/notification/index.js +4 -4
  143. package/dist/components/notification/index.js.map +1 -1
  144. package/dist/components/notification/index.less +51 -51
  145. package/dist/components/overflowTip/index.js +15 -15
  146. package/dist/components/overflowTip/index.js.map +1 -1
  147. package/dist/components/overflowTip/style.less +66 -66
  148. package/dist/components/page/index.js.map +1 -1
  149. package/dist/components/page/index.less +21 -21
  150. package/dist/components/presale/pickup.js.map +1 -1
  151. package/dist/components/presale/style.less +58 -58
  152. package/dist/components/product/detail.js +7 -7
  153. package/dist/components/product/detail.js.map +1 -1
  154. package/dist/components/product/getCard.js +5 -5
  155. package/dist/components/product/getCard.js.map +1 -1
  156. package/dist/components/product/index.less +128 -128
  157. package/dist/components/progressState/EmptyAndErrorView.js.map +1 -1
  158. package/dist/components/progressState/ProgressState.js +10 -10
  159. package/dist/components/progressState/ProgressState.js.map +1 -1
  160. package/dist/components/progressState/index.js.map +1 -1
  161. package/dist/components/progressState/style.less +65 -65
  162. package/dist/components/scan/index.js.map +1 -1
  163. package/dist/components/scan/index.less +33 -33
  164. package/dist/components/select/index.js.map +1 -1
  165. package/dist/components/select/index.less +11 -11
  166. package/dist/components/settlement/asyncModal.js.map +1 -1
  167. package/dist/components/settlement/index.js.map +1 -1
  168. package/dist/components/settlement/moreCzkTable/index.js +156 -0
  169. package/dist/components/settlement/moreCzkTable/index.js.map +1 -0
  170. package/dist/components/settlement/moreCzkTable/style.less +6 -6
  171. package/dist/components/settlement/prototypeTable/index.js +353 -0
  172. package/dist/components/settlement/prototypeTable/index.js.map +1 -0
  173. package/dist/components/settlement/prototypeTable/style.less +58 -58
  174. package/dist/components/settlement/prototypeTable/utils.js +14 -0
  175. package/dist/components/settlement/prototypeTable/utils.js.map +1 -0
  176. package/dist/components/settlement/settlement.js +15 -24
  177. package/dist/components/settlement/settlement.js.map +1 -1
  178. package/dist/components/settlement/settlement.less +1707 -1707
  179. package/dist/components/settlement/settlementApi.js +7 -7
  180. package/dist/components/settlement/settlementApi.js.map +1 -1
  181. package/dist/components/settlement/settlementStore.js +2823 -0
  182. package/dist/components/settlement/settlementStore.js.map +1 -0
  183. package/dist/components/settlement/utils.js +249 -0
  184. package/dist/components/settlement/utils.js.map +1 -0
  185. package/dist/components/socket/index.js +221 -0
  186. package/dist/components/socket/index.js.map +1 -0
  187. package/dist/components/spin/index.js +95 -0
  188. package/dist/components/spin/index.js.map +1 -0
  189. package/dist/components/spin/spin-style.less +436 -436
  190. package/dist/components/test/index.js +330 -0
  191. package/dist/components/test/index.js.map +1 -0
  192. package/dist/components/ticon/iconfont/demo.css +539 -539
  193. package/dist/components/ticon/iconfont/demo_index.html +5248 -5248
  194. package/dist/components/ticon/iconfont/iconfont.css +895 -895
  195. package/dist/components/ticon/iconfont/iconfont.js +36 -0
  196. package/dist/components/ticon/iconfont/iconfont.js.map +1 -0
  197. package/dist/components/ticon/iconfont/iconfont.json +1549 -1549
  198. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  199. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  200. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  201. package/dist/components/ticon/index.js +60 -0
  202. package/dist/components/ticon/index.js.map +1 -0
  203. package/dist/components/touchScroll/index.js +186 -0
  204. package/dist/components/touchScroll/index.js.map +1 -0
  205. package/dist/components/touchTable/AuthProcess.js +42 -0
  206. package/dist/components/touchTable/AuthProcess.js.map +1 -0
  207. package/dist/components/touchTable/generateWater.js +59 -0
  208. package/dist/components/touchTable/generateWater.js.map +1 -0
  209. package/dist/components/touchTable/index.js +1146 -0
  210. package/dist/components/touchTable/index.js.map +1 -0
  211. package/dist/components/touchTable/index.less +376 -376
  212. package/dist/components/touchTable/utils.js +27 -0
  213. package/dist/components/touchTable/utils.js.map +1 -0
  214. package/dist/demo/PopOverDemo.js.map +1 -1
  215. package/dist/index.js +7 -7
  216. package/dist/index.js.map +1 -1
  217. package/dist/util/tools.js.map +1 -1
  218. package/locales/zh/tplus-components-touch.json +1 -1
  219. package/locales/zh-CN/tplus-components-touch.json +1 -1
  220. package/mocks/memberInfo.json +79 -79
  221. package/package.json +2 -2
  222. package/tsconfig.json +26 -26
  223. package/dist/components/ticon/iconfont/iconfont.eot +0 -0
  224. package/dist/components/ticon/iconfont/iconfont.svg +0 -593
@@ -0,0 +1,2823 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Member = exports.PayMode = exports.default = undefined;
7
+
8
+ var _isInteger = require('babel-runtime/core-js/number/is-integer');
9
+
10
+ var _isInteger2 = _interopRequireDefault(_isInteger);
11
+
12
+ var _defineProperty = require('babel-runtime/core-js/object/define-property');
13
+
14
+ var _defineProperty2 = _interopRequireDefault(_defineProperty);
15
+
16
+ var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor');
17
+
18
+ var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);
19
+
20
+ var _stringify = require('babel-runtime/core-js/json/stringify');
21
+
22
+ var _stringify2 = _interopRequireDefault(_stringify);
23
+
24
+ var _promise = require('babel-runtime/core-js/promise');
25
+
26
+ var _promise2 = _interopRequireDefault(_promise);
27
+
28
+ var _regenerator = require('babel-runtime/regenerator');
29
+
30
+ var _regenerator2 = _interopRequireDefault(_regenerator);
31
+
32
+ var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
33
+
34
+ var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
35
+
36
+ var _extends2 = require('babel-runtime/helpers/extends');
37
+
38
+ var _extends3 = _interopRequireDefault(_extends2);
39
+
40
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
41
+
42
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
43
+
44
+ var _createClass2 = require('babel-runtime/helpers/createClass');
45
+
46
+ var _createClass3 = _interopRequireDefault(_createClass2);
47
+
48
+ var _desc, _value, _class, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _class2, _temp, _initialiseProps, _desc2, _value2, _class3, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _desc3, _value3, _class5, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21;
49
+
50
+ var _mobx = require('mobx');
51
+
52
+ var _mutantsMicrofx = require('mutants-microfx');
53
+
54
+ var _find2 = require('lodash/find');
55
+
56
+ var _find3 = _interopRequireDefault(_find2);
57
+
58
+ var _remove2 = require('lodash/remove');
59
+
60
+ var _remove3 = _interopRequireDefault(_remove2);
61
+
62
+ var _each2 = require('lodash/each');
63
+
64
+ var _each3 = _interopRequireDefault(_each2);
65
+
66
+ var _map2 = require('lodash/map');
67
+
68
+ var _map3 = _interopRequireDefault(_map2);
69
+
70
+ var _join2 = require('lodash/join');
71
+
72
+ var _join3 = _interopRequireDefault(_join2);
73
+
74
+ var _trim2 = require('lodash/trim');
75
+
76
+ var _trim3 = _interopRequireDefault(_trim2);
77
+
78
+ var _filter2 = require('lodash/filter');
79
+
80
+ var _filter3 = _interopRequireDefault(_filter2);
81
+
82
+ var _findIndex2 = require('lodash/findIndex');
83
+
84
+ var _findIndex3 = _interopRequireDefault(_findIndex2);
85
+
86
+ var _findLastIndex2 = require('lodash/findLastIndex');
87
+
88
+ var _findLastIndex3 = _interopRequireDefault(_findLastIndex2);
89
+
90
+ var _findKey2 = require('lodash/findKey');
91
+
92
+ var _findKey3 = _interopRequireDefault(_findKey2);
93
+
94
+ var _tplusPoslogin = require('tplus-poslogin');
95
+
96
+ var _utils = require('./utils');
97
+
98
+ var _tplusApi = require('tplus-api');
99
+
100
+ var _cloneDeep = require('lodash/cloneDeep');
101
+
102
+ var _cloneDeep2 = _interopRequireDefault(_cloneDeep);
103
+
104
+ var _message = require('../message');
105
+
106
+ var _message2 = _interopRequireDefault(_message);
107
+
108
+ var _mutantsUtil = require('mutants-util');
109
+
110
+ var _tplusComponentsTouch = require('tplus-components-touch');
111
+
112
+ var _moment = require('moment');
113
+
114
+ var _moment2 = _interopRequireDefault(_moment);
115
+
116
+ var _reduce2 = require('lodash/reduce');
117
+
118
+ var _reduce3 = _interopRequireDefault(_reduce2);
119
+
120
+ var _settlementApi = require('./settlementApi');
121
+
122
+ var _settlementApi2 = _interopRequireDefault(_settlementApi);
123
+
124
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
125
+
126
+ function _initDefineProp(target, property, descriptor, context) {
127
+ if (!descriptor) return;
128
+ (0, _defineProperty2.default)(target, property, {
129
+ enumerable: descriptor.enumerable,
130
+ configurable: descriptor.configurable,
131
+ writable: descriptor.writable,
132
+ value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
133
+ });
134
+ }
135
+
136
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
137
+ var desc = {};
138
+ Object['ke' + 'ys'](descriptor).forEach(function (key) {
139
+ desc[key] = descriptor[key];
140
+ });
141
+ desc.enumerable = !!desc.enumerable;
142
+ desc.configurable = !!desc.configurable;
143
+
144
+ if ('value' in desc || desc.initializer) {
145
+ desc.writable = true;
146
+ }
147
+
148
+ desc = decorators.slice().reverse().reduce(function (desc, decorator) {
149
+ return decorator(target, property, desc) || desc;
150
+ }, desc);
151
+
152
+ if (context && desc.initializer !== void 0) {
153
+ desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
154
+ desc.initializer = undefined;
155
+ }
156
+
157
+ if (desc.initializer === void 0) {
158
+ Object['define' + 'Property'](target, property, desc);
159
+ desc = null;
160
+ }
161
+
162
+ return desc;
163
+ }
164
+
165
+ function _initializerWarningHelper(descriptor, context) {
166
+ throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
167
+ }
168
+
169
+ var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
170
+
171
+ var SettlementStore = (_class = (_temp = _class2 = function () {
172
+ // 预售都是全款;预订是否全款,在点击确认支付时计算订金和商品金额计算得出
173
+ function SettlementStore() {
174
+ (0, _classCallCheck3.default)(this, SettlementStore);
175
+
176
+ _initialiseProps.call(this);
177
+
178
+ this.paymode = new PayMode();
179
+ var params = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
180
+ if (params) this.cloudPrintArguments = params;
181
+ this.setNewStyle();
182
+ this.SettlementApi = _settlementApi2.default;
183
+ } //type==2
184
+
185
+
186
+ (0, _createClass3.default)(SettlementStore, [{
187
+ key: 'initPaymodes',
188
+ value: function initPaymodes(event, type, isIntegralExchange) {
189
+ this.isIntegralExchange = isIntegralExchange;
190
+ this.paymode.setPaymodes(type, isIntegralExchange);
191
+ this.updateEvent = event;
192
+ }
193
+ }, {
194
+ key: 'init',
195
+ value: function init(context, amounthandler, datasource, storeinfo, bquick, amount, type, data, payModeKey) {
196
+ var _this2 = this;
197
+
198
+ this.setNewStyle();
199
+ this.type = type;
200
+ if (context) {
201
+ this.context = context;
202
+ this.amountHandler = amounthandler;
203
+ this.dataSource = datasource;
204
+ this.storeInfo = storeinfo;
205
+ this.dto = context.viewModel.data;
206
+ (0, _mobx.runInAction)(function () {
207
+ // 单品金额抹零
208
+ if (global.DealSingleRowAmountSettingProcessorBlock) {
209
+ global.DealSingleRowAmountSettingProcessorBlock.execute(_this2.dto);
210
+ }
211
+
212
+ var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
213
+ PayStyle = _enumController$getEn.PayStyle;
214
+
215
+ var isQuickCash = bquick && payModeKey == PayStyle.xianjin;
216
+
217
+ // 成交金额抹零
218
+ if (global.DealAmountSettingProcessorBlock) {
219
+ global.DealAmountSettingProcessorBlock.execute(_this2.dto, isQuickCash);
220
+ }
221
+ });
222
+ // this.member=context.stores && context.stores.memberStore && context.stores.memberStore.member;
223
+ this.member = this.dto.Member; //stores.selectMemberStore.selectMemberInfo;
224
+
225
+ this.paymode.isNotFullBook = false;
226
+ this.paymode.isNotFullOnlyBook = false;
227
+ //预订按比例收取订金处理
228
+ var value = this.dto.TotalTaxAmount;
229
+
230
+ var _getLoginInfo = this.getLoginInfo(),
231
+ PreSellOrBook = _getLoginInfo.PreSellOrBook,
232
+ PercentageWhenBook = _getLoginInfo.PercentageWhenBook;
233
+
234
+ var _ref = this.dto || {},
235
+ IdbusiType = _ref.IdbusiType,
236
+ DistributionMode = _ref.DistributionMode;
237
+
238
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
239
+ this.paymode.bookMaxValue = value;
240
+ this.paymode.isNotFullBook = true;
241
+ this.paymode.isNotFullOnlyBook = true;
242
+ value = value * PercentageWhenBook / 100;
243
+ }
244
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK') {
245
+ (0, _mobx.runInAction)(function () {
246
+ _this2.dto.PrepaidAmount = value;
247
+ });
248
+ }
249
+ //预订计算快递或同城配送运费
250
+ if (IdbusiType == 38 && PreSellOrBook != 'DISABLED' && (DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE')) {
251
+ value += this.dto.BuyerPayFreight || 0;
252
+ }
253
+ //预订取货应补款金额
254
+ if (IdbusiType == 39) {
255
+ value = _mutantsMicrofx.stores.drawerStore.thisWaitPaidAmount;
256
+ if (_mutantsMicrofx.stores.drawerStore.totalWaitPaidAmount > 0) {
257
+ this.paymode.isNotFullBook = true;
258
+ this.paymode.bookMaxValue = _mutantsMicrofx.stores.drawerStore.totalWaitPaidAmount;
259
+ }
260
+ }
261
+
262
+ this.brefund = this.paymode.setAmount(value, this.dto.OnlinePaymentAmount);
263
+ } else {
264
+ this.brefund = this.paymode.setAmount(amount, 0);
265
+ this.dto = data;
266
+ }
267
+ this.paymode.clean();
268
+
269
+ //this.dto.TotalTaxAmount<0;
270
+ this.bquick = !!bquick;
271
+ this.boriginReturn = JSON.getCellValue(this.dto, "IsOriginalReturn");
272
+ if (this.boriginReturn) {
273
+ this.initByOriginReturn();
274
+ }
275
+ if (this.newStyle) {
276
+ this.setModes();
277
+ }
278
+ }
279
+ }, {
280
+ key: 'setModes',
281
+ value: function setModes() {
282
+ var _this3 = this;
283
+
284
+ (0, _each3.default)(this.paymode.paymodes, function (p) {
285
+ if ((0, _findIndex3.default)(_this3.paymode.thePaymodes, function (mode) {
286
+ return p.paymentType == mode.paymentType;
287
+ }) == -1) {
288
+ _this3.addPay(p.paymentType);
289
+ }
290
+ });
291
+ if (!this.boriginReturn && this.paymode.thePaymodes.length > 0) {
292
+ this.changeValue(this.paymode.thePaymodes[0].paymethodId, 0, true);
293
+ }
294
+ }
295
+ }, {
296
+ key: 'amountChanged',
297
+ value: function amountChanged(amount) {
298
+ if (this.type == 1) {
299
+ this.brefund = this.paymode.setAmount(amount, 0);
300
+ }
301
+ }
302
+ }, {
303
+ key: 'initByOriginReturn',
304
+ value: function initByOriginReturn() {
305
+ var _this4 = this;
306
+
307
+ var _enumController$getEn2 = _mutantsUtil.enumController.getEnumOj(),
308
+ PayStyle = _enumController$getEn2.PayStyle;
309
+
310
+ var _ref2 = _mutantsUtil.platform || {},
311
+ isNewRetailBCPos = _ref2.isNewRetailBCPos;
312
+
313
+ console.log(this.dto, 'dto==========');
314
+ this.paymode.checkList = [];
315
+ (0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
316
+ var themode = (0, _find3.default)(_this4.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
317
+ if (detail.SettleStyle.Code === PayStyle.hyczk && !themode) {
318
+ _tplusComponentsTouch.ModalWraper.info({
319
+ title: '温馨提示',
320
+ content: '没有储值结算方式,请在后台添加储值余额结算方式。',
321
+ okText: '确定',
322
+ okType: 'primary'
323
+ });
324
+ }
325
+ if (themode && themode.paymentType && themode.paymentType != PayStyle.hyczk) {
326
+ var newmode = (0, _extends3.default)({}, _this4.genNewMode(themode.paymentType, false, detail.Amount), {
327
+ authCode: detail.PaymentCode,
328
+ steadCashIntegral: detail.SteadCashIntegral,
329
+ overchargesAmount: detail.OverchargesAmount,
330
+ boriginReturn: true,
331
+ thirdPaymentReturnInfo: detail.ThirdPaymentReturnInfo
332
+ });
333
+ _this4.paymode.currentMode = newmode;
334
+ if (themode.paymentType == PayStyle.djq) {
335
+ (0, _each3.default)(_this4.dto.RetailCouponDetails, function (djq) {
336
+ if (isNewRetailBCPos) {
337
+ var _ref3 = djq || {},
338
+ displayText = _ref3.displayText,
339
+ promoRuleId = _ref3.promoRuleId,
340
+ dateMount = _ref3.dateMount,
341
+ promoMethodEnum = _ref3.promoMethodEnum,
342
+ discountPct = _ref3.discountPct,
343
+ promoId = _ref3.promoId,
344
+ id = _ref3.id;
345
+
346
+ _this4.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this4.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
347
+ return;
348
+ }
349
+ _this4.addDjq(djq.CouponCode, djq.CouponTitle, true, null, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
350
+ });
351
+ }
352
+ _this4.paymode.thePaymodes.push(newmode);
353
+ }
354
+ });
355
+ (0, _each3.default)(this.dto.RetailStorageDetails, function (detail) {
356
+ var balanceAmount = null;
357
+ var storageCardNo = null;
358
+ var meStorageCardId = null;
359
+ detail.DynamicPropertyKeys.forEach(function (ele, index) {
360
+ if (ele === "mestoragecard") {
361
+ balanceAmount = detail.DynamicPropertyValues[index].BalanceStorage - detail.StoragePaymentAmount;
362
+ storageCardNo = detail.DynamicPropertyValues[index].StorageCardNo;
363
+ meStorageCardId = detail.DynamicPropertyValues[index].MeStorageCardId;
364
+ }
365
+ });
366
+ var newmode = (0, _extends3.default)({}, _this4.genNewMode(PayStyle.hyczk, false, detail.StoragePaymentAmount), {
367
+ member: new Member(detail.Member ? detail.Member : null),
368
+ authCode: detail.Password ? detail.Password : null,
369
+ balance: balanceAmount,
370
+ boriginReturn: true,
371
+ meStorageCardId: meStorageCardId ? meStorageCardId : detail.MeStorageCardId,
372
+ storageCardNo: storageCardNo ? storageCardNo : detail.StorageCardNo
373
+ });
374
+ _this4.paymode.thePaymodes.push(newmode);
375
+ });
376
+ this.paymode.calcReserved();
377
+ }
378
+ }, {
379
+ key: 'clean',
380
+ value: function clean() {
381
+ this.bquick = false;
382
+ this.paymode.clean();
383
+ }
384
+ }, {
385
+ key: 'quickSettle',
386
+ value: function quickSettle(key) {
387
+ this.addPay(key, null, true);
388
+ }
389
+
390
+ //outer call
391
+ //(type===PayStyle.hyczk || type===PayStyle.jfczk || type===PayStyle.jfdx || type===PayStyle.djq)
392
+
393
+ }, {
394
+ key: 'changeFocusAndAddPay',
395
+ value: function changeFocusAndAddPay(type, bookType) {
396
+ var _this5 = this;
397
+
398
+ var _enumController$getEn3 = _mutantsUtil.enumController.getEnumOj(),
399
+ PayStyle = _enumController$getEn3.PayStyle;
400
+
401
+ this.paymode.currentFocus = type;
402
+ if (this.paymode.currentMode) {
403
+ if (type == PayStyle.jfdx) {
404
+ if (this.newStyle) {
405
+ var index = (0, _findIndex3.default)(this.paymode.thePaymodes, function (m) {
406
+ return m.paymentType == PayStyle.jfdx;
407
+ });
408
+ this.paymode.thePaymodes.splice(index, 1, this.paymode.currentMode);
409
+ this.paymode.calcReserved();
410
+ } else {
411
+ this.addPayDirectly(this.paymode.currentMode);
412
+ }
413
+
414
+ //抵现积分
415
+ this.SettlementApi.CalculdateIntegralSteadCash({ IntegralSteadCashParams: {
416
+ Idmember: this.paymode.currentMode.memberId,
417
+ TotalTaxAmount: this.paymode.amount,
418
+ BalanceTaxAmount: this.paymode.currentMode.value
419
+ } }).then(function (result) {
420
+ // this.paymode.currentMode.steadCashIntegral=result.Integral;
421
+ // this.paymode.currentMode.perIntegral=result.perIntegral;
422
+ // this.paymode.currentMode.cashAmount=result.cashAmount;
423
+ _this5.paymode.currentMode.integralCashOverOrderAmount = result.isIntegralCashOverOrderAmount;
424
+ _this5.paymode.currentMode.overchargesAmount = result.Amount - _this5.paymode.currentMode.value;
425
+ });
426
+ } else {
427
+ this.addPayDirectly(this.paymode.currentMode);
428
+ }
429
+ } else {
430
+ this.addPay(type, bookType);
431
+ }
432
+ }
433
+
434
+ // 设置密码后更新会员信息
435
+
436
+
437
+ // 查看会员卡信息
438
+
439
+ }, {
440
+ key: 'getLoginInfo',
441
+ value: function getLoginInfo() {
442
+ return _mutantsMicrofx.stores.user.options.get('loginInfo');
443
+ }
444
+ }, {
445
+ key: 'loadCzk',
446
+ value: function loadCzk(v, returnType) {
447
+ var _this6 = this;
448
+
449
+ if ((0, _trim3.default)(v) === "") {
450
+ (0, _mobx.runInAction)(function () {
451
+ _this6.paymode.currentMode.errinfo = "请输入储值卡";
452
+ });
453
+ return;
454
+ }
455
+ var isOnlyEnabled = returnType ? false : true; //非原单退货为false,其他true
456
+ return this.SettlementApi.getCardInfoByCardNo(v, isOnlyEnabled).then(function () {
457
+ var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(result) {
458
+ var data, m;
459
+ return _regenerator2.default.wrap(function _callee$(_context) {
460
+ while (1) {
461
+ switch (_context.prev = _context.next) {
462
+ case 0:
463
+ data = result.data;
464
+ m = data && data.length && data[0];
465
+
466
+ if (!(result && result.data.length)) {
467
+ _context.next = 25;
468
+ break;
469
+ }
470
+
471
+ if (!(result.data.length === 1)) {
472
+ _context.next = 14;
473
+ break;
474
+ }
475
+
476
+ if (!(m.CardTypeEnum === 'BALANCE_CARD')) {
477
+ _context.next = 10;
478
+ break;
479
+ }
480
+
481
+ _this6.paymode.updateCardInfo(m);
482
+ _this6.handleCzkData(m);
483
+ return _context.abrupt('return', result.data);
484
+
485
+ case 10:
486
+ _context.next = 12;
487
+ return _this6.SettlementApi.validateRetailStorageCard({ dto: _this6.dto, meStorageCardId: m.MeStorageCardId }).then(function (result1) {
488
+ var data1 = result1.data ? JSON.parse(result1.data)[0] : {};
489
+ if (data1.enable) {
490
+ _this6.paymode.updateCardInfo(m);
491
+ _this6.handleCzkData(m);
492
+ return result1.data;
493
+ } else {
494
+ _message2.default.warn(data1.disableReason);
495
+ }
496
+ });
497
+
498
+ case 12:
499
+ _context.next = 25;
500
+ break;
501
+
502
+ case 14:
503
+ if (!(result.data && result.data.length === 1)) {
504
+ _context.next = 19;
505
+ break;
506
+ }
507
+
508
+ _this6.paymode.updateCardInfo(result.data[0]);
509
+ return _context.abrupt('return', result.data);
510
+
511
+ case 19:
512
+ if (!(result.data && result.data.length > 1)) {
513
+ _context.next = 23;
514
+ break;
515
+ }
516
+
517
+ return _context.abrupt('return', result.data);
518
+
519
+ case 23:
520
+ _message2.default.warn('没有可用储值卡!');
521
+ return _context.abrupt('return', false);
522
+
523
+ case 25:
524
+ case 'end':
525
+ return _context.stop();
526
+ }
527
+ }
528
+ }, _callee, _this6);
529
+ }));
530
+
531
+ return function (_x) {
532
+ return _ref4.apply(this, arguments);
533
+ };
534
+ }());
535
+ }
536
+ }, {
537
+ key: 'addDjq',
538
+ value: function addDjq(promoCouponCode, name, IsEnable, nominalAmount, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
539
+ var djq = {
540
+ code: promoCouponCode,
541
+ promoCouponCode: promoCouponCode,
542
+ name: name,
543
+ IsEnable: IsEnable,
544
+ nominalAmount: nominalAmount,
545
+ amount: amount,
546
+ doorsill: doorsill, //:"无门槛"
547
+ LastTS: LastTS,
548
+ checked: checked,
549
+ IsRepelWithPoints: IsRepelWithPoints,
550
+ UMemberID: UMemberID,
551
+ expired: expired, //还剩多少过期
552
+ displayText: displayText,
553
+ promoMethodEnum: promoMethodEnum,
554
+ discountPct: discountPct,
555
+ promoId: promoId,
556
+ promoRuleId: promoRuleId,
557
+ couponCategoryEnum: couponCategoryEnum,
558
+ id: id,
559
+ count: count === 1 && (couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT') ? 1 : null
560
+ };
561
+ this.paymode.currentMode.djqs.push(djq);
562
+ // let copyData = _clonedeep(this.data[targetIndex]);
563
+ !unCheck && !this.boriginReturn && this.paymode.calcDjqValue(djq);
564
+ }
565
+ }, {
566
+ key: 'setCurrentMode',
567
+ value: function setCurrentMode(id, type, append) {
568
+ var _enumController$getEn4 = _mutantsUtil.enumController.getEnumOj(),
569
+ PayStyle = _enumController$getEn4.PayStyle;
570
+
571
+ var mode = (0, _find3.default)(this.paymode.thePaymodes, { paymethodId: id });
572
+ if (mode) {
573
+ this.paymode.currentMode = mode;
574
+ if (this.newStyle) {
575
+ this.afterSetCurrentMode(type);
576
+ }
577
+ } else {
578
+ this.paymode.currentMode = this.genNewMode(type, append);
579
+ this.afterSetCurrentMode(type);
580
+ }
581
+ }
582
+ }, {
583
+ key: 'afterSetCurrentMode',
584
+ value: function afterSetCurrentMode(type) {
585
+ var _this7 = this;
586
+
587
+ var _enumController$getEn5 = _mutantsUtil.enumController.getEnumOj(),
588
+ PayStyle = _enumController$getEn5.PayStyle;
589
+
590
+ if (type == PayStyle.djq) {
591
+ this.paymode.calcDjqValue();
592
+ } else if (type == PayStyle.jfdx) {
593
+ //获取可兑换的金额
594
+ if (this.newStyle) {
595
+ var themode = (0, _find3.default)(this.paymode.thePaymodes, { paymentType: PayStyle.jfdx });
596
+ if (themode && parseFloat(themode.value || 0) != 0) {
597
+ this.paymode.currentMode.value = themode.value;
598
+ }
599
+ }
600
+
601
+ //积分抵现不包含运费
602
+ var BuyerPayFreight = this.dto.BuyerPayFreight;
603
+ var DistributionMode = this.dto.DistributionMode;
604
+ var IdbusiType = this.dto.IdbusiType;
605
+
606
+ var _getLoginInfo2 = this.getLoginInfo(),
607
+ PreSellOrBook = _getLoginInfo2.PreSellOrBook,
608
+ PercentageWhenBook = _getLoginInfo2.PercentageWhenBook;
609
+
610
+ var value = 0;
611
+ if ((DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && BuyerPayFreight && BuyerPayFreight > 0) {
612
+ value = (0, _utils.getFixedNumber)(Math.Minus(this.paymode.amount, BuyerPayFreight));
613
+ } else if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
614
+ //预订场景下:现场提货,且订金比例非100%时,积分抵现按全款计算(因为只有全款才能使用积分抵现)
615
+ value = this.paymode.bookMaxValue;
616
+ } else {
617
+ value = this.paymode.amount;
618
+ }
619
+
620
+ this.SettlementApi.CalculdateIntegralSteadCash({ IntegralSteadCashParams: {
621
+ Idmember: this.paymode.currentMode.memberId,
622
+ TotalTaxAmount: value,
623
+ BalanceTaxAmount: value
624
+ } }).then(function (result) {
625
+ _this7.paymode.currentMode.member.setExchangable(result.MaxAmount);
626
+ _this7.paymode.currentMode.perIntegral = result.perIntegral;
627
+ _this7.paymode.currentMode.cashAmount = result.cashAmount;
628
+ _this7.paymode.currentMode.integralCashOverOrderAmount = result.isIntegralCashOverOrderAmount;
629
+ _this7.updateEvent();
630
+ if (_this7.checkReceived(_this7.paymode.currentMode, "exchangable")) {
631
+ (0, _mobx.runInAction)(function () {
632
+ _this7.paymode.currentMode.errinfo = '余额不足';
633
+ });
634
+ }
635
+ });
636
+ }
637
+ }
638
+ }, {
639
+ key: 'checkReceived',
640
+ value: function checkReceived(mode, name) {
641
+ return !this.brefund && parseFloat(mode.value) > parseFloat(mode.maxamount || mode.member[name] || 0);
642
+ }
643
+ }, {
644
+ key: 'genNewMode',
645
+ value: function genNewMode(type, notwithm, v, isQuick) {
646
+ var _enumController$getEn6 = _mutantsUtil.enumController.getEnumOj(),
647
+ PayStyle = _enumController$getEn6.PayStyle;
648
+
649
+ var value = (0, _utils.getFixedNumber)(v || (this.brefund ? this.paymode.receivable : Math.max(this.paymode.receivable, 0)));
650
+ var themode = (0, _find3.default)(this.paymode.paymodes, { 'paymentType': type });
651
+ var memberId = this.member && this.member.ID ? this.member.ID : null;
652
+ var mode = (0, _mobx.observable)({
653
+ paymethodId: this.paymode.counter,
654
+ name: themode.name,
655
+ exchangeRate: themode.exchangeRate,
656
+ calDirection: themode.calDirection,
657
+ thridPayment: themode.thridPayment,
658
+ value: value,
659
+ value2: (0, _utils.getFixedNumber)(themode.calDirection == "88" ? value / themode.exchangeRate : value * themode.exchangeRate),
660
+ value3: value,
661
+ order: this.paymode.thePaymodes.length + 1,
662
+ paymentType: type,
663
+ djqs: [],
664
+ card: null,
665
+ memberId: !notwithm ? memberId : null,
666
+ member: new Member(!notwithm ? this.member : null),
667
+ authCode: '',
668
+ steadCashIntegral: null,
669
+ errinfo: '',
670
+ maxamount: this.paymode.amount,
671
+ virtualPay: themode.virtualPay
672
+ });
673
+ if (type == PayStyle.hyczk) {
674
+ if (!mode.storageCardNo) {
675
+ (0, _mobx.runInAction)(function () {
676
+ mode.errinfo = '未录入手机号或储值卡号';
677
+ });
678
+ } else if (this.checkReceived(mode, "balance")) {
679
+ (0, _mobx.runInAction)(function () {
680
+ mode.errinfo = '余额不足';
681
+ });
682
+ }
683
+ }
684
+ if (type == PayStyle.hyczk || type == PayStyle.jfdx || type == PayStyle.djq) {
685
+ this.setMaxAmount(type, mode);
686
+ }
687
+ console.log('\u5F53\u524D\u64CD\u4F5C\u7ED3\u7B97\u65B9\u5F0F\u4FE1\u606F:' + mode);
688
+ return mode;
689
+ }
690
+ }, {
691
+ key: 'setMaxAmount',
692
+ value: function setMaxAmount(type, mode) {
693
+ var _this8 = this;
694
+
695
+ var _enumController$getEn7 = _mutantsUtil.enumController.getEnumOj(),
696
+ PayStyle = _enumController$getEn7.PayStyle;
697
+
698
+ var sum = 0;
699
+ if (type == PayStyle.hyczk) {
700
+ (0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
701
+ return m.paymentType == type;
702
+ }), function (q) {
703
+ sum = Math.Add(sum, q.value);
704
+ });
705
+ } else if (type == PayStyle.djq || type == PayStyle.jfdx) {
706
+ (0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
707
+ return m.paymentType == PayStyle.djq || m.paymentType == PayStyle.jfdx;
708
+ }), function (q) {
709
+ sum = Math.Add(sum, q.value);
710
+ });
711
+ }
712
+
713
+ this.amountHandler && this.amountHandler(type).then(function () {
714
+ (0, _mobx.runInAction)(function () {
715
+
716
+ //预售储值结算应包含运费
717
+ var BuyerPayFreight = _this8.dto.BuyerPayFreight;
718
+ var DistributionMode = _this8.dto.DistributionMode;
719
+ var value = 0;
720
+ if ((DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && BuyerPayFreight && BuyerPayFreight > 0 && type == PayStyle.hyczk) {
721
+ value = (0, _utils.getFixedNumber)(parseFloat(_this8.context.viewModel.getViewItem('Voucher').availableAmount) + parseFloat(BuyerPayFreight));
722
+ } else {
723
+ value = _this8.context.viewModel.getViewItem('Voucher').availableAmount;
724
+ }
725
+ mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(value, sum));
726
+ _this8.updateEvent();
727
+ });
728
+ });
729
+ }
730
+ }, {
731
+ key: 'changeFocusOnly',
732
+ value: function changeFocusOnly(type) {
733
+ this.paymode.currentFocus = type;
734
+ }
735
+ }, {
736
+ key: 'changeClickFocusOnly',
737
+ value: function changeClickFocusOnly(type) {
738
+ this.paymode.currentFocus = type;
739
+ // 获取焦点时带入剩余的值
740
+ var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymentType': type });
741
+ if (mode) {
742
+ var shouldSetValue = (0, _utils.getFixedNumber)(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
743
+ mode.value = shouldSetValue;
744
+ mode.value2 = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? shouldSetValue / mode.exchangeRate : shouldSetValue * mode.exchangeRate);
745
+ mode.value3 = shouldSetValue;
746
+ this.paymode.calcReserved('bookPay'); //参数multiPay代表复合结算
747
+ }
748
+ }
749
+ }, {
750
+ key: 'changeValue',
751
+ value: function changeValue(index, value, blur, type) {
752
+ var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
753
+ var v = blur ? (0, _utils.getFixedNumber)(value) : isNaN(value) && value != '-' ? 0.00 : value;
754
+ if (mode) {
755
+ if (mode.exchangeRate != 1) {
756
+ if ((0, _utils.getFixedNumber)(mode.calDirection == "88" ? mode.value3 / mode.exchangeRate : mode.value3 * mode.exchangeRate) != v) {
757
+ mode.value = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? v * mode.exchangeRate : v / mode.exchangeRate);
758
+ } else {
759
+ mode.value = mode.value3;
760
+ }
761
+ mode.value2 = v;
762
+ } else {
763
+ mode.value = v;
764
+ mode.value2 = v;
765
+ }
766
+
767
+ this.paymode.calcReserved(type);
768
+ }
769
+ }
770
+ }, {
771
+ key: 'addPayDirectly',
772
+ value: function addPayDirectly(pay) {
773
+ var _enumController$getEn8 = _mutantsUtil.enumController.getEnumOj(),
774
+ PayStyle = _enumController$getEn8.PayStyle;
775
+
776
+ if (!(0, _find3.default)(this.paymode.thePaymodes, { paymethodId: pay.paymethodId })) {
777
+ var pos = this.paymode.thePaymodes.length;
778
+ if (pay.paymentType == PayStyle.hyczk) {
779
+ var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
780
+ return m.paymethodId != pay.paymethodId && m.paymentType == PayStyle.hyczk;
781
+ });
782
+ pos = index == -1 ? pos : index + 1;
783
+ }
784
+ // this.paymode.thePaymodes.push(pay);
785
+ this.paymode.thePaymodes.splice(pos, 0, pay);
786
+ }
787
+ this.paymode.calcReserved();
788
+ }
789
+ }, {
790
+ key: 'addPay',
791
+ value: function addPay(type, bookType, isQuick) {
792
+ var _enumController$getEn9 = _mutantsUtil.enumController.getEnumOj(),
793
+ PayStyle = _enumController$getEn9.PayStyle;
794
+
795
+ var pos = this.paymode.thePaymodes.length;
796
+ if (type == PayStyle.hyczk) {
797
+ var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
798
+ return m.paymentType == PayStyle.hyczk;
799
+ });
800
+ pos = index == -1 ? pos : index + 1;
801
+ }
802
+ this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk, undefined, isQuick));
803
+ this.paymode.calcReserved(bookType);
804
+ }
805
+ }, {
806
+ key: 'delPay',
807
+ value: function delPay(index, bookType) {
808
+ var _enumController$getEn10 = _mutantsUtil.enumController.getEnumOj(),
809
+ PayStyle = _enumController$getEn10.PayStyle;
810
+
811
+ (0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
812
+ return mode.paymethodId === index;
813
+ });
814
+ this.paymode.currentFocus = -1;
815
+ this.paymode.calcReserved(bookType);
816
+ }
817
+
818
+ // 获取储值是否重复, 在commit方法中使用
819
+
820
+ }, {
821
+ key: 'findStorageBillValidate',
822
+ value: function findStorageBillValidate() {
823
+ var _this9 = this;
824
+
825
+ var _enumController$getEn11 = _mutantsUtil.enumController.getEnumOj(),
826
+ PayStyle = _enumController$getEn11.PayStyle;
827
+
828
+ (0, _mobx.runInAction)(function () {
829
+ _this9.dto.StorageMutiSettleDetails = [];
830
+ var thePaymodes = _this9.newStyle ? (0, _filter3.default)(_this9.paymode.thePaymodes, function (mode) {
831
+ return parseFloat(mode.value) != 0;
832
+ }) : _this9.paymode.thePaymodes;
833
+ (0, _each3.default)(thePaymodes, function (mode) {
834
+ var themode = (0, _find3.default)(_this9.paymode.paymodes, { 'paymentType': mode.paymentType });
835
+
836
+ var value = parseFloat(mode.value);
837
+ var giveChange = null;
838
+ if (mode.paymentType == PayStyle.xianjin && _this9.paymode.receivable < 0 && value > Math.abs(_this9.paymode.receivable)) {
839
+ value = Math.Add(value, _this9.paymode.receivable);
840
+ giveChange = Math.abs(_this9.paymode.receivable);
841
+ }
842
+ _this9.dto.StorageMutiSettleDetails.push({
843
+ Code: mode.paymethodId,
844
+ StorageAmount: value,
845
+ GiveChange: giveChange,
846
+ IdsettleStyle: themode.idSettleStyle,
847
+ IdbankAccount: themode.idBankAccount,
848
+ PaymentCode: mode.authCode,
849
+ DynamicPropertyKeys: [],
850
+ DynamicPropertyValues: [],
851
+ DataSource: { Id: _this9.dataSource }
852
+ });
853
+ });
854
+ });
855
+ return this.SettlementApi.findStorageBillValidate((0, _extends3.default)({}, this.dto));
856
+ }
857
+
858
+ //判断是否重复弹框
859
+
860
+ }, {
861
+ key: 'commit',
862
+ value: function () {
863
+ var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
864
+ var status, paylist, ret, _ref6, _ref6$data, code, returnMsg, state, ret1, ret2;
865
+
866
+ return _regenerator2.default.wrap(function _callee2$(_context2) {
867
+ while (1) {
868
+ switch (_context2.prev = _context2.next) {
869
+ case 0:
870
+ console.log('settlementStore.commit开始,参数:' + bTest);
871
+
872
+ if (!bTest) {
873
+ _context2.next = 3;
874
+ break;
875
+ }
876
+
877
+ return _context2.abrupt('return', _promise2.default.resolve(true));
878
+
879
+ case 3:
880
+ status = this.type;
881
+ _context2.prev = 4;
882
+ paylist = this.paymode.thePaymodes.filter(function (v) {
883
+ return !!v.thridPayment && Math.abs(v.value) > 0;
884
+ }) || [];
885
+
886
+ if (!(paylist && paylist.length > 1)) {
887
+ _context2.next = 9;
888
+ break;
889
+ }
890
+
891
+ _message2.default.warn('二开支付目前仅支持单一结算方式。');
892
+ return _context2.abrupt('return', _promise2.default.resolve(false));
893
+
894
+ case 9:
895
+ if (!(status == 1)) {
896
+ _context2.next = 31;
897
+ break;
898
+ }
899
+
900
+ _context2.next = 12;
901
+ return this.findStorageBillValidate();
902
+
903
+ case 12:
904
+ ret = _context2.sent;
905
+ _ref6 = ret || {}, _ref6$data = _ref6.data;
906
+ _ref6$data = _ref6$data === undefined ? {} : _ref6$data;
907
+ code = _ref6$data.code, returnMsg = _ref6$data.returnMsg;
908
+
909
+ if (!(code && code == 10001)) {
910
+ _context2.next = 24;
911
+ break;
912
+ }
913
+
914
+ _context2.next = 19;
915
+ return this.repeatStorageModal(returnMsg);
916
+
917
+ case 19:
918
+ state = _context2.sent;
919
+
920
+ if (!(state === false)) {
921
+ _context2.next = 22;
922
+ break;
923
+ }
924
+
925
+ return _context2.abrupt('return', _promise2.default.resolve(false));
926
+
927
+ case 22:
928
+ _context2.next = 29;
929
+ break;
930
+
931
+ case 24:
932
+ _context2.next = 26;
933
+ return this.saveMember();
934
+
935
+ case 26:
936
+ ret1 = _context2.sent;
937
+
938
+ if (!(ret1 === false)) {
939
+ _context2.next = 29;
940
+ break;
941
+ }
942
+
943
+ return _context2.abrupt('return', _promise2.default.resolve(false));
944
+
945
+ case 29:
946
+ _context2.next = 40;
947
+ break;
948
+
949
+ case 31:
950
+ _context2.next = 33;
951
+ return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
952
+
953
+ case 33:
954
+ _context2.next = 35;
955
+ return this.save();
956
+
957
+ case 35:
958
+ ret2 = _context2.sent;
959
+
960
+ if (!(ret2 === false)) {
961
+ _context2.next = 38;
962
+ break;
963
+ }
964
+
965
+ return _context2.abrupt('return', _promise2.default.resolve(false));
966
+
967
+ case 38:
968
+ _context2.next = 40;
969
+ return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
970
+
971
+ case 40:
972
+ return _context2.abrupt('return', _promise2.default.resolve(true));
973
+
974
+ case 43:
975
+ _context2.prev = 43;
976
+ _context2.t0 = _context2['catch'](4);
977
+
978
+ console.error('settlementStore.commit失败,错误信息:' + _context2.t0);
979
+ //其他支付失败时,处理二开支付情况。
980
+ this.thirdPayRefund(status == 1 ? 2 : 1);
981
+ return _context2.abrupt('return', _promise2.default.resolve(_context2.t0));
982
+
983
+ case 48:
984
+ case 'end':
985
+ return _context2.stop();
986
+ }
987
+ }
988
+ }, _callee2, this, [[4, 43]]);
989
+ }));
990
+
991
+ function commit(_x2) {
992
+ return _ref5.apply(this, arguments);
993
+ }
994
+
995
+ return commit;
996
+ }()
997
+ }, {
998
+ key: 'handlePrint',
999
+ value: function handlePrint(resp) {
1000
+ // 储值打印
1001
+ return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp, {});
1002
+ }
1003
+ }, {
1004
+ key: 'saveMember',
1005
+ value: function () {
1006
+ var _ref7 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
1007
+ var _this10 = this;
1008
+
1009
+ var _enumController$getEn12, PayStyle, TradeType, IPMSG, dtoParams, payList, payment, tradeType, ret, _ref8, type, data, msg, code;
1010
+
1011
+ return _regenerator2.default.wrap(function _callee3$(_context3) {
1012
+ while (1) {
1013
+ switch (_context3.prev = _context3.next) {
1014
+ case 0:
1015
+ _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn12.PayStyle, TradeType = _enumController$getEn12.TradeType;
1016
+
1017
+ (0, _mobx.runInAction)(function () {
1018
+ _this10.dto.StorageMutiSettleDetails = [];
1019
+ var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1020
+ return parseFloat(mode.value) != 0;
1021
+ }) : _this10.paymode.thePaymodes;
1022
+ (0, _each3.default)(thePaymodes, function (mode) {
1023
+ var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1024
+
1025
+ var value = parseFloat(mode.value);
1026
+ var giveChange = null;
1027
+ if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1028
+ value = Math.Add(value, _this10.paymode.receivable);
1029
+ giveChange = Math.abs(_this10.paymode.receivable);
1030
+ }
1031
+ _this10.dto.StorageMutiSettleDetails.push({
1032
+ Code: mode.paymethodId,
1033
+ StorageAmount: value,
1034
+ GiveChange: giveChange,
1035
+ IdsettleStyle: themode.idSettleStyle,
1036
+ IdbankAccount: themode.idBankAccount,
1037
+ PaymentCode: mode.authCode,
1038
+ DynamicPropertyKeys: [],
1039
+ DynamicPropertyValues: [],
1040
+ DataSource: { Id: _this10.dataSource },
1041
+ ThirdPaymentInfo: themode.thridPayment || null,
1042
+ ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
1043
+ });
1044
+ });
1045
+ });
1046
+ // cc结算调用
1047
+ IPMSG = {};
1048
+
1049
+ if (!!window.localStorage.IPMSG) {
1050
+ IPMSG = JSON.parse(window.localStorage.IPMSG);
1051
+ }
1052
+ dtoParams = this.dto;
1053
+ //处理存在二开支付情况
1054
+
1055
+ payList = dtoParams.StorageMutiSettleDetails.filter(function (v) {
1056
+ return v.ThirdPaymentInfo;
1057
+ });
1058
+
1059
+ if (!(payList && payList.length > 0)) {
1060
+ _context3.next = 19;
1061
+ break;
1062
+ }
1063
+
1064
+ payment = payList[0];
1065
+ tradeType = payment && payment.StorageAmount > 0 ? TradeType.PAY : TradeType.REFUND;
1066
+ _context3.next = 11;
1067
+ return this.thirdPay(2, payment, tradeType, dtoParams);
1068
+
1069
+ case 11:
1070
+ ret = _context3.sent;
1071
+ _ref8 = ret || {}, type = _ref8.type, data = _ref8.data, msg = _ref8.msg, code = _ref8.code;
1072
+
1073
+ if (!(type === true)) {
1074
+ _context3.next = 17;
1075
+ break;
1076
+ }
1077
+
1078
+ dtoParams = data;
1079
+ _context3.next = 19;
1080
+ break;
1081
+
1082
+ case 17:
1083
+ _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1084
+ return _context3.abrupt('return', false);
1085
+
1086
+ case 19:
1087
+ this.dtoParams = dtoParams;
1088
+ console.log('储值结算信息:', dtoParams);
1089
+ return _context3.abrupt('return', this.SettlementApi.INewRetailMemberStorageSave({ dto: dtoParams }).then(function (resp) {
1090
+ _this10.handlePrint(resp);
1091
+ }));
1092
+
1093
+ case 22:
1094
+ case 'end':
1095
+ return _context3.stop();
1096
+ }
1097
+ }
1098
+ }, _callee3, this);
1099
+ }));
1100
+
1101
+ function saveMember() {
1102
+ return _ref7.apply(this, arguments);
1103
+ }
1104
+
1105
+ return saveMember;
1106
+ }()
1107
+ }, {
1108
+ key: 'save',
1109
+ value: function () {
1110
+ var _ref9 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1111
+ var _this11 = this;
1112
+
1113
+ var _enumController$getEn13, PayStyle, TradeType, IPMSG, RetailTypeEnum, _getLoginInfo3, PreSellOrBook, PercentageWhenBook, _ref10, IdbusiType, DistributionMode, prepaidAmount, fullPayment, dtoParams, payList, payment, tradeType, ret, _ref11, type, data, msg, code;
1114
+
1115
+ return _regenerator2.default.wrap(function _callee4$(_context4) {
1116
+ while (1) {
1117
+ switch (_context4.prev = _context4.next) {
1118
+ case 0:
1119
+ _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn13.PayStyle, TradeType = _enumController$getEn13.TradeType;
1120
+
1121
+ (0, _mobx.runInAction)(function () {
1122
+ _this11.dto.RetailPaymentDetails = [];
1123
+ _this11.dto.RetailStorageDetails = [];
1124
+ _this11.dto.RetailCouponDetails = [];
1125
+ var czkSum = 0;
1126
+ var count = 0;
1127
+ var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1128
+ return parseFloat(mode.value) != 0;
1129
+ }) : _this11.paymode.thePaymodes;
1130
+ (0, _each3.default)(thePaymodes, function (mode, index) {
1131
+ var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1132
+ if (mode.paymentType == PayStyle.hyczk) {
1133
+ czkSum = Math.Add(czkSum, mode.value);
1134
+ _this11.dto.RetailStorageDetails.push({
1135
+ Code: mode.paymethodId,
1136
+ MeStorageCardId: mode.meStorageCardId,
1137
+ StoragePaymentAmount: mode.value,
1138
+ IsOrigReturn: false,
1139
+ BalanceStorage: mode.balance,
1140
+ Idmember: mode.memberId,
1141
+ DynamicPropertyKeys: [],
1142
+ DynamicPropertyValues: [],
1143
+ DataSource: { Id: _this11.dataSource },
1144
+ Password: mode.authCode
1145
+ });
1146
+ } else {
1147
+ var value = parseFloat(mode.value);
1148
+ var giveChange = null;
1149
+ if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1150
+ value = Math.Add(value, _this11.paymode.receivable);
1151
+ giveChange = Math.abs(_this11.paymode.receivable);
1152
+ }
1153
+ _this11.dto.RetailPaymentDetails.push({
1154
+ Code: mode.paymethodId,
1155
+ OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
1156
+ Amount: value,
1157
+ GiveChange: giveChange,
1158
+ IdsettleStyle: themode.idSettleStyle,
1159
+ IdbankAccount: themode.idBankAccount,
1160
+ Idcurrency: themode.idCurrency,
1161
+ ExchangeRate: themode.exchangeRate,
1162
+ PaymentCode: mode.authCode,
1163
+ SteadCashIntegral: mode.steadCashIntegral,
1164
+ OverchargesAmount: mode.overchargesAmount,
1165
+ DynamicPropertyKeys: [],
1166
+ DynamicPropertyValues: [],
1167
+ DataSource: { Id: _this11.dataSource },
1168
+ ThirdPaymentInfo: themode.thridPayment || null,
1169
+ SettleStyle: { Name: mode.name },
1170
+ ThirdPaymentReturnInfo: mode.thirdPaymentReturnInfo || null
1171
+ });
1172
+ if (mode.paymentType == PayStyle.djq) {
1173
+ (0, _each3.default)(_this11.paymode.checkList && _this11.paymode.checkList.length ? _this11.paymode.checkList : mode.djqs, function (djq) {
1174
+ _this11.dto.RetailCouponDetails.push({
1175
+ CouponCode: djq.promoCouponCode,
1176
+ ReductionAmount: djq.amount,
1177
+ EnableAmount: djq.doorsill,
1178
+ CouponTitle: djq.name,
1179
+ IdMember: djq.UMemberID ? mode.memberId : null,
1180
+ LastTS: djq.LastTS,
1181
+ PromotionId: djq.promoId,
1182
+ PromotionRuleId: djq.promoRuleId,
1183
+ PromoCouponAllocatedId: djq.id,
1184
+ DataSource: { Id: _this11.dataSource }
1185
+ });
1186
+ });
1187
+ }
1188
+ }
1189
+ });
1190
+ if (_this11.dto.RetailStorageDetails.length > 0) {
1191
+ var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1192
+ _this11.dto.RetailPaymentDetails.push({
1193
+ Code: _this11.paymode.counter,
1194
+ OrigAmount: czkSum,
1195
+ Amount: czkSum,
1196
+ IdsettleStyle: themode.idSettleStyle,
1197
+ IdbankAccount: themode.idBankAccount,
1198
+ DynamicPropertyKeys: [],
1199
+ DynamicPropertyValues: [],
1200
+ DataSource: { Id: _this11.dataSource },
1201
+ RetailStorageDetails: _this11.dto.RetailStorageDetails
1202
+ });
1203
+ }
1204
+ });
1205
+ console.log('\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1206
+ // cc结算调用
1207
+ IPMSG = {};
1208
+
1209
+ if (!!window.localStorage.IPMSG) {
1210
+ IPMSG = JSON.parse(window.localStorage.IPMSG);
1211
+ }
1212
+ RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1213
+ _getLoginInfo3 = this.getLoginInfo(), PreSellOrBook = _getLoginInfo3.PreSellOrBook, PercentageWhenBook = _getLoginInfo3.PercentageWhenBook;
1214
+ _ref10 = this.dto || {}, IdbusiType = _ref10.IdbusiType, DistributionMode = _ref10.DistributionMode;
1215
+
1216
+ if (IdbusiType == 38 && PreSellOrBook == 'BOOK' && PercentageWhenBook < 100 && (!DistributionMode.Id || DistributionMode.Id == 'ON_SITE_PICKUP')) {
1217
+ prepaidAmount = (0, _utils.getFixedNumber)(this.dto.RetailPaymentDetails.reduce(function (c, item) {
1218
+ return c + (item.Amount || 0);
1219
+ }, 0));
1220
+ fullPayment = (0, _utils.getFixedNumber)(this.dto.RetailDetails.reduce(function (c, item) {
1221
+ return c + (item.TaxAmount || 0);
1222
+ }, 0));
1223
+
1224
+ this.isFull = fullPayment == prepaidAmount; // 是否全款
1225
+ (0, _mobx.runInAction)(function () {
1226
+ _this11.dto.PrepaidAmount = prepaidAmount;
1227
+ });
1228
+ }
1229
+ _context4.t1 = this.dto.IdbusiType == 37;
1230
+
1231
+ if (!_context4.t1) {
1232
+ _context4.next = 14;
1233
+ break;
1234
+ }
1235
+
1236
+ _context4.next = 13;
1237
+ return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1238
+
1239
+ case 13:
1240
+ _context4.t1 = _context4.sent;
1241
+
1242
+ case 14:
1243
+ _context4.t0 = _context4.t1;
1244
+
1245
+ if (_context4.t0) {
1246
+ _context4.next = 17;
1247
+ break;
1248
+ }
1249
+
1250
+ _context4.t0 = this.dto.IdbusiType != 37;
1251
+
1252
+ case 17:
1253
+ if (!_context4.t0) {
1254
+ _context4.next = 36;
1255
+ break;
1256
+ }
1257
+
1258
+ dtoParams = (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } });
1259
+ //处理存在二开支付情况
1260
+
1261
+ payList = dtoParams.RetailPaymentDetails.filter(function (v) {
1262
+ return v.ThirdPaymentInfo;
1263
+ });
1264
+
1265
+ if (!(payList && payList.length > 0)) {
1266
+ _context4.next = 33;
1267
+ break;
1268
+ }
1269
+
1270
+ payment = payList[0];
1271
+ tradeType = payment && payment.Amount > 0 ? TradeType.PAY : TradeType.REFUND;
1272
+ _context4.next = 25;
1273
+ return this.thirdPay(1, payment, tradeType, dtoParams);
1274
+
1275
+ case 25:
1276
+ ret = _context4.sent;
1277
+ _ref11 = ret || {}, type = _ref11.type, data = _ref11.data, msg = _ref11.msg, code = _ref11.code;
1278
+
1279
+ if (!(type === true)) {
1280
+ _context4.next = 31;
1281
+ break;
1282
+ }
1283
+
1284
+ dtoParams = data;
1285
+ _context4.next = 33;
1286
+ break;
1287
+
1288
+ case 31:
1289
+ _message2.default.warn('\u5237\u5361\u652F\u4ED8\u5931\u8D25,\u9519\u8BEF\u7801:' + code);
1290
+ return _context4.abrupt('return', false);
1291
+
1292
+ case 33:
1293
+ this.dtoParams = dtoParams;
1294
+ console.log('结算信息:', dtoParams);
1295
+ return _context4.abrupt('return', this.SettlementApi.retailPosSettle({ dto: dtoParams, cip: IPMSG.query || "" }).then(function (resp) {
1296
+ var _ref12 = resp || {},
1297
+ ID = _ref12.ID;
1298
+
1299
+ _this11.setDtoID(ID);
1300
+ _this11.billID = ID;
1301
+ _this11.paymode.checkList = [];
1302
+ }));
1303
+
1304
+ case 36:
1305
+ case 'end':
1306
+ return _context4.stop();
1307
+ }
1308
+ }
1309
+ }, _callee4, this);
1310
+ }));
1311
+
1312
+ function save() {
1313
+ return _ref9.apply(this, arguments);
1314
+ }
1315
+
1316
+ return save;
1317
+ }()
1318
+
1319
+ //裁剪二开支付数据
1320
+
1321
+ }, {
1322
+ key: 'removeThirdPayDto',
1323
+ value: function removeThirdPayDto(dto) {
1324
+ var data = (0, _extends3.default)({}, dto);
1325
+ delete data['DynamicPropertyKeys'];
1326
+ delete data['DynamicPropertyValues'];
1327
+ return data;
1328
+ }
1329
+
1330
+ /**
1331
+ * 二开支付
1332
+ * vType:1零售单、2储值单
1333
+ * payment:结算方式
1334
+ * trade:00表示结算、02表示退款
1335
+ * dto:结算数据集合
1336
+ */
1337
+
1338
+ }, {
1339
+ key: 'thirdPay',
1340
+ value: function () {
1341
+ var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(vType, payment, trade, dto) {
1342
+ var cto, params, ret, _ref14, Code, _Message, Result, _ref15, ThirdPaymentReturnInfo;
1343
+
1344
+ return _regenerator2.default.wrap(function _callee5$(_context5) {
1345
+ while (1) {
1346
+ switch (_context5.prev = _context5.next) {
1347
+ case 0:
1348
+ _context5.prev = 0;
1349
+ cto = this.removeThirdPayDto(dto);
1350
+ params = { VoucherType: vType, Payment: payment, TradeType: trade, dto: cto };
1351
+
1352
+ console.log('刷卡信息:', (0, _stringify2.default)(params));
1353
+ _context5.next = 6;
1354
+ return new _promise2.default(function (resolve, reject) {
1355
+ _mutantsMicrofx.nativeMs.setIpcRendererMethod('ThirdPayment', (0, _extends3.default)({}, params), function (res) {
1356
+ return resolve(res);
1357
+ });
1358
+ });
1359
+
1360
+ case 6:
1361
+ ret = _context5.sent;
1362
+
1363
+ console.log('刷卡返回信息:', ret);
1364
+ ret = JSON.parse(ret);
1365
+ _ref14 = ret || {}, Code = _ref14.Code, _Message = _ref14.Message, Result = _ref14.Result;
1366
+
1367
+ if (!(Code > 0)) {
1368
+ _context5.next = 14;
1369
+ break;
1370
+ }
1371
+
1372
+ return _context5.abrupt('return', { type: false, data: null, msg: _Message, code: Code });
1373
+
1374
+ case 14:
1375
+ if (!(trade == '00')) {
1376
+ _context5.next = 20;
1377
+ break;
1378
+ }
1379
+
1380
+ _ref15 = Result || {}, ThirdPaymentReturnInfo = _ref15.ThirdPaymentReturnInfo;
1381
+
1382
+ if (vType == 1) {
1383
+ dto.RetailPaymentDetails.forEach(function (v) {
1384
+ if (v.ThirdPaymentInfo != null && Math.abs(v.Amount) > 0) {
1385
+ v.ThirdPaymentReturnInfo = ThirdPaymentReturnInfo;
1386
+ }
1387
+ });
1388
+ } else if (vType == 2) {
1389
+ dto.StorageMutiSettleDetails.forEach(function (v) {
1390
+ if (v.ThirdPaymentInfo != null && Math.abs(v.StorageAmount) > 0) {
1391
+ v.ThirdPaymentReturnInfo = ThirdPaymentReturnInfo;
1392
+ }
1393
+ });
1394
+ }
1395
+ return _context5.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
1396
+
1397
+ case 20:
1398
+ if (!(trade == '02')) {
1399
+ _context5.next = 22;
1400
+ break;
1401
+ }
1402
+
1403
+ return _context5.abrupt('return', { type: true, data: dto, msg: _Message, code: Code });
1404
+
1405
+ case 22:
1406
+ _context5.next = 27;
1407
+ break;
1408
+
1409
+ case 24:
1410
+ _context5.prev = 24;
1411
+ _context5.t0 = _context5['catch'](0);
1412
+ return _context5.abrupt('return', { type: false, data: null, msg: _context5.t0, code: '9999' });
1413
+
1414
+ case 27:
1415
+ case 'end':
1416
+ return _context5.stop();
1417
+ }
1418
+ }
1419
+ }, _callee5, this, [[0, 24]]);
1420
+ }));
1421
+
1422
+ function thirdPay(_x3, _x4, _x5, _x6) {
1423
+ return _ref13.apply(this, arguments);
1424
+ }
1425
+
1426
+ return thirdPay;
1427
+ }()
1428
+
1429
+ //二开支付强制退款情况
1430
+
1431
+ }, {
1432
+ key: 'thirdPayRefund',
1433
+ value: function () {
1434
+ var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type) {
1435
+ var _this12 = this;
1436
+
1437
+ var dto, pay, payment, _enumController$getEn14, TradeType;
1438
+
1439
+ return _regenerator2.default.wrap(function _callee7$(_context7) {
1440
+ while (1) {
1441
+ switch (_context7.prev = _context7.next) {
1442
+ case 0:
1443
+ dto = type == 1 ? this.dtoParams.RetailPaymentDetails : this.dtoParams.StorageMutiSettleDetails;
1444
+ pay = dto && dto.filter(function (v) {
1445
+ return v.ThirdPaymentInfo;
1446
+ });
1447
+
1448
+ if (pay && pay.length > 0) {
1449
+ setTimeout(function () {
1450
+ _message2.default.warn("支付出现异常,将发起刷卡退款。", { duration: 4.5 });
1451
+ }, 1000);
1452
+ payment = pay[0];
1453
+ _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(), TradeType = _enumController$getEn14.TradeType;
1454
+
1455
+ setTimeout((0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6() {
1456
+ var ret, _ref18, msg;
1457
+
1458
+ return _regenerator2.default.wrap(function _callee6$(_context6) {
1459
+ while (1) {
1460
+ switch (_context6.prev = _context6.next) {
1461
+ case 0:
1462
+ _context6.next = 2;
1463
+ return _this12.thirdPay(type, payment, TradeType.REFUND, dto);
1464
+
1465
+ case 2:
1466
+ ret = _context6.sent;
1467
+ _ref18 = ret || {}, msg = _ref18.msg;
1468
+
1469
+ console.log('\u5237\u5361\u652F\u4ED8\u9000\u6B3E:' + msg);
1470
+
1471
+ case 5:
1472
+ case 'end':
1473
+ return _context6.stop();
1474
+ }
1475
+ }
1476
+ }, _callee6, _this12);
1477
+ })), 4500);
1478
+ }
1479
+
1480
+ case 3:
1481
+ case 'end':
1482
+ return _context7.stop();
1483
+ }
1484
+ }
1485
+ }, _callee7, this);
1486
+ }));
1487
+
1488
+ function thirdPayRefund(_x7) {
1489
+ return _ref16.apply(this, arguments);
1490
+ }
1491
+
1492
+ return thirdPayRefund;
1493
+ }()
1494
+ }, {
1495
+ key: 'setDtoID',
1496
+ value: function setDtoID(id) {
1497
+ this.context.viewModel.data.ID = id;
1498
+ }
1499
+ }, {
1500
+ key: 'querySettleResult',
1501
+ value: function () {
1502
+ var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee8() {
1503
+ return _regenerator2.default.wrap(function _callee8$(_context8) {
1504
+ while (1) {
1505
+ switch (_context8.prev = _context8.next) {
1506
+ case 0:
1507
+ _context8.prev = 0;
1508
+ _context8.t0 = _promise2.default;
1509
+ _context8.next = 4;
1510
+ return this.SettlementApi.QuerySettleResult({ RetailCode: this.dto.Code });
1511
+
1512
+ case 4:
1513
+ _context8.t1 = _context8.sent;
1514
+ return _context8.abrupt('return', _context8.t0.resolve.call(_context8.t0, _context8.t1));
1515
+
1516
+ case 8:
1517
+ _context8.prev = 8;
1518
+ _context8.t2 = _context8['catch'](0);
1519
+ return _context8.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1520
+
1521
+ case 11:
1522
+ case 'end':
1523
+ return _context8.stop();
1524
+ }
1525
+ }
1526
+ }, _callee8, this, [[0, 8]]);
1527
+ }));
1528
+
1529
+ function querySettleResult() {
1530
+ return _ref19.apply(this, arguments);
1531
+ }
1532
+
1533
+ return querySettleResult;
1534
+ }()
1535
+ }, {
1536
+ key: 'setCookie',
1537
+ value: function setCookie(key, val) {
1538
+ var exp = new Date();
1539
+ exp.setTime((0, _moment2.default)().endOf('day').valueOf());
1540
+ document.cookie = key + '=' + val + ';expires=' + exp.toGMTString();
1541
+ }
1542
+ }, {
1543
+ key: 'getAllCookies',
1544
+ value: function getAllCookies() {
1545
+ var cookies = document.cookie.split(/;\s/g);
1546
+ var cookieObj = {};
1547
+ cookies.forEach(function (item) {
1548
+ var key = item.split('=')[0];
1549
+ cookieObj[key] = item.split('=')[1];
1550
+ });
1551
+ return cookieObj;
1552
+ }
1553
+ }, {
1554
+ key: 'validePwd',
1555
+ value: function () {
1556
+ var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee9(value) {
1557
+ var _ref21, isNewRetailBCPos, cook1, cook2, message, memberStorageId, _paymode$currentMode, cardTypeEnum, memberId, meStorageCardId, cardStatusEnum, checkPaymentPasswordParams, checkPaymentPasswordId, result, count, _result;
1558
+
1559
+ return _regenerator2.default.wrap(function _callee9$(_context9) {
1560
+ while (1) {
1561
+ switch (_context9.prev = _context9.next) {
1562
+ case 0:
1563
+ _ref21 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref21.isNewRetailBCPos;
1564
+ _context9.prev = 1;
1565
+
1566
+ if (!isNewRetailBCPos) {
1567
+ _context9.next = 23;
1568
+ break;
1569
+ }
1570
+
1571
+ cook1 = this.getAllCookies()['errorPwd'];
1572
+ cook2 = cook1 && JSON.parse(cook1);
1573
+ message = '密码输入错误';
1574
+ memberStorageId = this.paymode.currentMode.meStorageCardId;
1575
+
1576
+ if (!cook2) {
1577
+ _context9.next = 12;
1578
+ break;
1579
+ }
1580
+
1581
+ if (!cook2.hasOwnProperty(memberStorageId + "")) {
1582
+ _context9.next = 12;
1583
+ break;
1584
+ }
1585
+
1586
+ if (!(cook2[memberStorageId] > 3)) {
1587
+ _context9.next = 12;
1588
+ break;
1589
+ }
1590
+
1591
+ message = '今日密码错误已达上限,不可使用储值消费,请明日再试,如忘记请重置密码或修改密码。';
1592
+ return _context9.abrupt('return', _promise2.default.resolve(message));
1593
+
1594
+ case 12:
1595
+ _paymode$currentMode = this.paymode.currentMode, cardTypeEnum = _paymode$currentMode.cardTypeEnum, memberId = _paymode$currentMode.memberId, meStorageCardId = _paymode$currentMode.meStorageCardId, cardStatusEnum = _paymode$currentMode.cardStatusEnum;
1596
+ checkPaymentPasswordParams = {};
1597
+ checkPaymentPasswordId = null;
1598
+
1599
+ if (cardTypeEnum === 'BALANCE_CARD') {
1600
+ checkPaymentPasswordParams = {
1601
+ md5Password: _tplusApi.User.pwdEncrypt(value.pwd),
1602
+ cardType: cardTypeEnum
1603
+ };
1604
+ checkPaymentPasswordId = memberId;
1605
+ } else {
1606
+ if (cardStatusEnum === 'BINDING' && this.member && this.member.ID === memberId) {
1607
+ checkPaymentPasswordParams = {
1608
+ md5Password: _tplusApi.User.pwdEncrypt(value.pwd),
1609
+ password: value.pwd,
1610
+ cardType: cardTypeEnum
1611
+ };
1612
+ checkPaymentPasswordId = meStorageCardId;
1613
+ } else {
1614
+ checkPaymentPasswordParams = {
1615
+ password: value.pwd,
1616
+ cardType: cardTypeEnum
1617
+ };
1618
+ checkPaymentPasswordId = meStorageCardId;
1619
+ }
1620
+ }
1621
+ _context9.next = 18;
1622
+ return this.SettlementApi.checkPaymentPassword(checkPaymentPasswordParams, checkPaymentPasswordId);
1623
+
1624
+ case 18:
1625
+ result = _context9.sent;
1626
+
1627
+ if (!result.data) {
1628
+ if (cook2) {
1629
+ if (cook2.hasOwnProperty(memberStorageId + "")) {
1630
+ count = cook2[memberStorageId];
1631
+
1632
+ cook2[memberStorageId] = count + 1;
1633
+ } else {
1634
+ cook2[memberStorageId] = 1;
1635
+ }
1636
+ } else {
1637
+ cook2 = {};
1638
+ cook2[memberStorageId] = 1;
1639
+ }
1640
+ this.setCookie('errorPwd', '', -1);
1641
+ this.setCookie('errorPwd', (0, _stringify2.default)(cook2));
1642
+ }
1643
+ return _context9.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1644
+
1645
+ case 23:
1646
+ _context9.next = 25;
1647
+ return this.SettlementApi.CheckoutMemberPassword({ "CheckoutParams": {
1648
+ "Idmember": value.id,
1649
+ "Password": value.pwd
1650
+ } });
1651
+
1652
+ case 25:
1653
+ _result = _context9.sent;
1654
+ return _context9.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1655
+
1656
+ case 27:
1657
+ _context9.next = 32;
1658
+ break;
1659
+
1660
+ case 29:
1661
+ _context9.prev = 29;
1662
+ _context9.t0 = _context9['catch'](1);
1663
+ return _context9.abrupt('return', "failed");
1664
+
1665
+ case 32:
1666
+ case 'end':
1667
+ return _context9.stop();
1668
+ }
1669
+ }
1670
+ }, _callee9, this, [[1, 29]]);
1671
+ }));
1672
+
1673
+ function validePwd(_x8) {
1674
+ return _ref20.apply(this, arguments);
1675
+ }
1676
+
1677
+ return validePwd;
1678
+ }()
1679
+ }]);
1680
+ return SettlementStore;
1681
+ }(), _initialiseProps = function _initialiseProps() {
1682
+ var _this13 = this;
1683
+
1684
+ this.paymode = null;
1685
+ this.dto = null;
1686
+ this.dtoParams = null;
1687
+ this.member = null;
1688
+ this.brefund = false;
1689
+ this.bquick = false;
1690
+ this.boriginReturn = false;
1691
+
1692
+ _initDefineProp(this, 'newStyle', _descriptor, this);
1693
+
1694
+ this.isFull = true;
1695
+
1696
+ _initDefineProp(this, 'setNewStyle', _descriptor2, this);
1697
+
1698
+ _initDefineProp(this, 'queryPwd', _descriptor3, this);
1699
+
1700
+ _initDefineProp(this, 'updateMemberInfo', _descriptor4, this);
1701
+
1702
+ _initDefineProp(this, 'updateCurrentMode', _descriptor5, this);
1703
+
1704
+ _initDefineProp(this, 'updateCardInfo', _descriptor6, this);
1705
+
1706
+ this.handleCzkData = function (m) {
1707
+ if (!m || !m.StorageCardNo) {
1708
+ (0, _mobx.runInAction)(function () {
1709
+ _this13.paymode.currentMode.errinfo = "无效的会员卡号";
1710
+ });
1711
+ } else {
1712
+ (0, _mobx.runInAction)(function () {
1713
+ _this13.paymode.currentMode.errinfo = "";
1714
+ _this13.paymode.currentMode.memberId = m.ID;
1715
+ _this13.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this13.brefund ? _this13.paymode.receivable : Math.max(_this13.paymode.receivable, 0));
1716
+ _this13.updateEvent();
1717
+ var message = '';
1718
+ var sum = (0, _reduce3.default)(_this13.paymode.thePaymodes, function (total, cur) {
1719
+ return total + cur.value;
1720
+ }, 0);
1721
+ // 对于卡不用判断会员的一些信息
1722
+ // if (global.CheckMemberStorageProcessorBlock ) {
1723
+ // message= CheckMemberStorageProcessorBlock.execute(m);
1724
+ // }
1725
+ if (!String.isNullOrEmpty(message)) {
1726
+ _this13.paymode.currentMode.errinfo = message;
1727
+ } else if (_this13.checkReceived(_this13.paymode.currentMode, "balance")) {
1728
+ _this13.paymode.currentMode.errinfo = "余额不足";
1729
+ } else if (_this13.paymode.amount > 0 && parseFloat(_this13.paymode.amount) !== sum && _this13.paymode.currentMode.value == 0) {
1730
+ _this13.paymode.currentMode.errinfo = "实收金额必须录入";
1731
+ } else {
1732
+ // 查询成功后将焦点移入下一个输入框
1733
+ setTimeout(function () {
1734
+ var nextInput = document.querySelector('.czk .received .input');
1735
+ nextInput && nextInput.select();
1736
+ }, 300);
1737
+ }
1738
+ });
1739
+ }
1740
+ };
1741
+
1742
+ this.getCouponList = function (coupon_code) {
1743
+ var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
1744
+ PayStyle = _enumController$getEn15.PayStyle,
1745
+ Differentiate = _enumController$getEn15.Differentiate;
1746
+
1747
+ var couponApplyRule = (0, _tplusPoslogin.PosInitData)('CouponApplyRule');
1748
+
1749
+ var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1750
+ CouponApplyRule = _enumController$getEn16.CouponApplyRule;
1751
+
1752
+ if (couponApplyRule == CouponApplyRule.SHOWN_BY_CUSTOMER && !!coupon_code || couponApplyRule != CouponApplyRule.SHOWN_BY_CUSTOMER) {
1753
+ var dto = _this13.dto;
1754
+ var promoVoucher = {};
1755
+ _this13.paymode.clearDjqs();
1756
+ _this13.paymode.reCalculationDjqs();
1757
+ promoVoucher.coupon_code = coupon_code || "";
1758
+ promoVoucher.boName = "Retail";
1759
+ promoVoucher.voucherId = dto.ID;
1760
+ var onlinePaymentAmount = 0;
1761
+ if (dto.OnlinePaymentAmount) {
1762
+ onlinePaymentAmount = dto.OnlinePaymentAmount;
1763
+ }
1764
+ promoVoucher.promoLinks = (0, _filter3.default)(_this13.paymode.currentMode.djqs, function (djq) {
1765
+ return djq.checked;
1766
+ });
1767
+ promoVoucher.totalAmountWithTax = Math.Minus(dto.TotalTaxAmount, onlinePaymentAmount);
1768
+ promoVoucher.redBlueFlagEnum = "BLUE";
1769
+ promoVoucher.meMemberId = dto.Idmember;
1770
+ promoVoucher.storeFactorId = dto.Idstore;
1771
+ promoVoucher.voucherDetailList = [];
1772
+ dto.RetailDetails.forEach(function (item) {
1773
+ var detailDTO = {};
1774
+ detailDTO.uuid = item.Code;
1775
+ detailDTO.detailBoName = "RetailDetail";
1776
+ detailDTO.voucherDetailId = item.ID;
1777
+ detailDTO.productId = item.Idinventory;
1778
+ detailDTO.uomId = item.Idunit;
1779
+ detailDTO.productSpecId = item.ProductSpecId;
1780
+ detailDTO.isManualFreeGift = item.IsPresent;
1781
+ detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
1782
+ detailDTO.IsManualChangePrice = item.IsManualChangePrice;
1783
+ // if(detailDTO.IsManualChangePrice)//如果是手工改价
1784
+ // {
1785
+ // detailDTO.listPrice = item.TaxPrice;
1786
+ // detailDTO.netAmountWithTax = item.TaxAmount;
1787
+ // }
1788
+ // else
1789
+ // {
1790
+ var bookingQuantity = 0;
1791
+ if (item.BookingQuantity) {
1792
+ bookingQuantity = item.BookingQuantity;
1793
+ }
1794
+ detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
1795
+ detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
1796
+ //}
1797
+ detailDTO.taxRate = item.TaxRate;
1798
+ detailDTO.quantity = item.Quantity;
1799
+
1800
+ detailDTO.amountWithTax = item.RetailAmount;
1801
+ // 促销 start
1802
+ if (item.PromotionDetails && item.PromotionDetails.length != 0) {
1803
+ var promoLinks = [];
1804
+ item.PromotionDetails.forEach(function (promotion) {
1805
+ promoLinks.push({
1806
+ promoId: promotion.IdSalesPromotionDTO,
1807
+ promoRuleId: promotion.PromotionRuleId
1808
+ });
1809
+ });
1810
+ if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
1811
+ }
1812
+ // 促销 end
1813
+ promoVoucher.voucherDetailList.push(detailDTO);
1814
+ });
1815
+ return _this13.SettlementApi.findUsefulCouponPromoList(promoVoucher).then(function (result) {
1816
+ if (result && result.length != 0) {
1817
+ result.forEach(function (element) {
1818
+ var _ref22 = element || {},
1819
+ couponCode = _ref22.couponCode,
1820
+ name = _ref22.name,
1821
+ tieredAmountResult = _ref22.tieredAmountResult,
1822
+ fromDate = _ref22.fromDate,
1823
+ dateMount = _ref22.dateMount,
1824
+ promoMethodEnum = _ref22.promoMethodEnum,
1825
+ discountPct = _ref22.discountPct,
1826
+ nominalAmount = _ref22.nominalAmount,
1827
+ promoId = _ref22.promoId,
1828
+ id = _ref22.id;
1829
+
1830
+ var condValue = tieredAmountResult.condValue,
1831
+ promoDiscount = tieredAmountResult.promoDiscount,
1832
+ displayText = tieredAmountResult.displayText,
1833
+ promoRuleId = tieredAmountResult.promoRuleId,
1834
+ couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
1835
+
1836
+ if (result.IsRepelWithPoints && (0, _find3.default)(_this13.paymode.thePaymodes, function (themode) {
1837
+ return themode.paymentType == PayStyle.jfdx;
1838
+ })) {
1839
+ _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
1840
+ } else {
1841
+ var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
1842
+ _this13.addDjq(couponCode, name, IsEnable, promoMethodEnum == "CASH_COUPON" && nominalAmount, promoDiscount, condValue, null, false, !result.IsRepelWithPoints, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, true, 1);
1843
+ }
1844
+ });
1845
+ if (promoVoucher.coupon_code) {
1846
+ _this13.paymode.calcDjqCheckValue(_this13.paymode.currentMode.djqs[0], _this13.dto, 'single');
1847
+ }
1848
+ } else {
1849
+ if (promoVoucher.coupon_code) {
1850
+ _message2.default.info(Differentiate.COUPON + '\u53F7\u4E0D\u5B58\u5728\uFF01');
1851
+ _this13.getCouponList();
1852
+ } else {
1853
+ _message2.default.info('\u6CA1\u6709\u627E\u5230\u53EF\u4F7F\u7528\u7684' + Differentiate.COUPON + '\uFF01');
1854
+ }
1855
+ }
1856
+ });
1857
+ }
1858
+ };
1859
+
1860
+ this.getSettleGift = function () {
1861
+ return _this13.SettlementApi.executeRightsForPos(_this13.billID);
1862
+ };
1863
+
1864
+ this.getRefWareHouseList = function () {
1865
+ return _this13.SettlementApi.getRefWareHouseList();
1866
+ };
1867
+
1868
+ this.checkCoupon = function () {
1869
+ var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee10(sn) {
1870
+ var _ref24, isNewRetailBCPos, _enumController$getEn17, PayStyle, Differentiate, params;
1871
+
1872
+ return _regenerator2.default.wrap(function _callee10$(_context10) {
1873
+ while (1) {
1874
+ switch (_context10.prev = _context10.next) {
1875
+ case 0:
1876
+ _ref24 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref24.isNewRetailBCPos;
1877
+
1878
+ if (!isNewRetailBCPos) {
1879
+ _context10.next = 7;
1880
+ break;
1881
+ }
1882
+
1883
+ _context10.next = 4;
1884
+ return _this13.getCouponList(sn, 'sinlge');
1885
+
1886
+ case 4:
1887
+ return _context10.abrupt('return', _context10.sent);
1888
+
1889
+ case 7:
1890
+ _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn17.PayStyle, Differentiate = _enumController$getEn17.Differentiate;
1891
+ params = { request: {
1892
+ Uid: _this13.paymode.currentMode.member.uid || '',
1893
+ SN: sn,
1894
+ StoreCode: _this13.dto.Idstore,
1895
+ Inventories: (0, _map3.default)((0, _filter3.default)(_this13.dto.RetailDetails, function (d) {
1896
+ return d.Quantity > 0 && !d.IsPresent;
1897
+ }), function (detail) {
1898
+ return {
1899
+ IdInventory: detail.Inventory.ID,
1900
+ IdUnit: detail.Idunit,
1901
+ Code: detail.Inventory.Code,
1902
+ FreeItem0: JSON.getCellValue(detail, "freeitem0"),
1903
+ FreeItem1: JSON.getCellValue(detail, "freeitem1"),
1904
+ FreeItem2: JSON.getCellValue(detail, "freeitem2"),
1905
+ FreeItem3: JSON.getCellValue(detail, "freeitem3"),
1906
+ FreeItem4: JSON.getCellValue(detail, "freeitem4"),
1907
+ FreeItem5: JSON.getCellValue(detail, "freeitem5"),
1908
+ FreeItem6: JSON.getCellValue(detail, "freeitem6"),
1909
+ FreeItem7: JSON.getCellValue(detail, "freeitem7"),
1910
+ FreeItem8: JSON.getCellValue(detail, "freeitem8"),
1911
+ FreeItem9: JSON.getCellValue(detail, "freeitem9")
1912
+ };
1913
+ }),
1914
+ // inventoryCodes:_join(_map(this.dto.RetailDetails,(detail)=>{return detail.Inventory.Code;}),','),
1915
+ InventoryClassCodes: (0, _join3.default)((0, _map3.default)((0, _filter3.default)(_this13.dto.RetailDetails, function (d) {
1916
+ return d.Quantity > 0;
1917
+ }), function (detail) {
1918
+ return (detail.Inventory.InventoryClass || { Code: '' }).Code;
1919
+ }), ','),
1920
+ Amount: _this13.paymode.amount
1921
+ } };
1922
+ return _context10.abrupt('return', _this13.SettlementApi.CheckCoupon(params).then(function (result) {
1923
+ if ((0, _find3.default)(_this13.paymode.currentMode.djqs, function (djq) {
1924
+ return djq.code == result.SN;
1925
+ })) {
1926
+ _message2.default.info(Differentiate.COUPON + '\u5DF2\u6DFB\u52A0');
1927
+ } else if (result.IsRepelWithPoints && (0, _find3.default)(_this13.paymode.thePaymodes, function (themode) {
1928
+ return themode.paymentType == PayStyle.jfdx;
1929
+ })) {
1930
+ _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
1931
+ } else {
1932
+ _this13.addDjq(result.SN, result.Title, result.ReduceAmount, result.StartAmount, result.LastTS, false, !result.IsRepelWithPoints, result.UMemberID);
1933
+ }
1934
+ }));
1935
+
1936
+ case 10:
1937
+ case 'end':
1938
+ return _context10.stop();
1939
+ }
1940
+ }
1941
+ }, _callee10, _this13);
1942
+ }));
1943
+
1944
+ return function (_x9) {
1945
+ return _ref23.apply(this, arguments);
1946
+ };
1947
+ }();
1948
+
1949
+ this.repeatStorageModal = function (content) {
1950
+ return new _promise2.default(function (resolve, reject) {
1951
+ _tplusComponentsTouch.ModalWraper.confirm({
1952
+ title: '',
1953
+ okText: '继续储值',
1954
+ className: 'repeat-modal',
1955
+ zIndex: 1007,
1956
+ content: content,
1957
+ onOk: function () {
1958
+ var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee11() {
1959
+ var ret;
1960
+ return _regenerator2.default.wrap(function _callee11$(_context11) {
1961
+ while (1) {
1962
+ switch (_context11.prev = _context11.next) {
1963
+ case 0:
1964
+ _context11.next = 2;
1965
+ return _this13.saveMember();
1966
+
1967
+ case 2:
1968
+ ret = _context11.sent;
1969
+
1970
+ if (ret === false) {
1971
+ resolve(false);
1972
+ } else {
1973
+ resolve(true);
1974
+ }
1975
+
1976
+ case 4:
1977
+ case 'end':
1978
+ return _context11.stop();
1979
+ }
1980
+ }
1981
+ }, _callee11, _this13);
1982
+ }));
1983
+
1984
+ return function onOk() {
1985
+ return _ref25.apply(this, arguments);
1986
+ };
1987
+ }(),
1988
+ onCancel: function onCancel() {
1989
+ resolve(false);
1990
+ }
1991
+ });
1992
+ });
1993
+ };
1994
+
1995
+ this.checkIntegralExchangeReturn = function (id) {
1996
+ return new _promise2.default(function (resolve, reject) {
1997
+ _this13.SettlementApi.GetNewIntegralExchange({ param: { refVoucherId: id } }).then(function (resp) {
1998
+ if (resp && resp.expireIntegral > 0) {
1999
+ _tplusComponentsTouch.ModalWraper.confirm({
2000
+ className: 'tplus-confirm-modal',
2001
+ title: "温馨提示",
2002
+ content: '\u5B58\u5728\u5DF2\u7ECF\u8FC7\u671F\u7684\u79EF\u5206' + resp.expireIntegral + '\u9000\u8D27\u540E\u79EF\u5206\u4E0D\u4F1A\u8FD4\u8FD8\u3002\u662F\u5426\u7EE7\u7EED\u9000\u8D27\uFF1F',
2003
+ cancelable: false,
2004
+ onOk: function onOk() {
2005
+ resolve(true);
2006
+ },
2007
+ onCancel: function onCancel() {
2008
+ reject(false);
2009
+ }
2010
+ });
2011
+ } else {
2012
+ resolve(true);
2013
+ }
2014
+ });
2015
+ });
2016
+ };
2017
+ }, _temp), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'newStyle', [_mobx.observable], {
2018
+ enumerable: true,
2019
+ initializer: function initializer() {
2020
+ return true;
2021
+ }
2022
+ }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'setNewStyle', [_mobx.action], {
2023
+ enumerable: true,
2024
+ initializer: function initializer() {
2025
+ var _this14 = this;
2026
+
2027
+ return function () {
2028
+ var voucherDefaultPosMode = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') || 'touch';
2029
+ _this14.newStyle = voucherDefaultPosMode == 'voucher';
2030
+ };
2031
+ }
2032
+ }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
2033
+ enumerable: true,
2034
+ initializer: function initializer() {
2035
+ var _this15 = this;
2036
+
2037
+ return function (newPass, newPassConfirm) {
2038
+ if (!newPass || !newPassConfirm) {
2039
+ return _message2.default.warn('您还有未填写项');
2040
+ }
2041
+ if (newPass !== newPassConfirm) {
2042
+ return _message2.default.warn('您两次输入的密码不一致');
2043
+ }
2044
+ var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
2045
+ return _this15.SettlementApi.setWalletPayPassword({
2046
+ Idstore: idstore,
2047
+ meMemberId: _this15.paymode.currentMode.memberId,
2048
+ oldPassword: null,
2049
+ newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
2050
+ dataSource: "POS"
2051
+ }).then(function (resp) {
2052
+ if (resp.successful) {
2053
+ return true;
2054
+ }
2055
+ });
2056
+ };
2057
+ }
2058
+ }), _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), _descriptor4 = _applyDecoratedDescriptor(_class.prototype, 'updateMemberInfo', [_mobx.action], {
2059
+ enumerable: true,
2060
+ initializer: function initializer() {
2061
+ var _this16 = this;
2062
+
2063
+ return function () {
2064
+ var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee12(_this) {
2065
+ var _getLoginInfo4, IdStore, StoreCode, resp;
2066
+
2067
+ return _regenerator2.default.wrap(function _callee12$(_context12) {
2068
+ while (1) {
2069
+ switch (_context12.prev = _context12.next) {
2070
+ case 0:
2071
+ _getLoginInfo4 = _this16.getLoginInfo(), IdStore = _getLoginInfo4.IdStore, StoreCode = _getLoginInfo4.StoreCode;
2072
+ _context12.next = 3;
2073
+ return _this16.SettlementApi.GetUmemberDTO({ Idmember: _this16.member.ID, IdStore: IdStore, StoreCode: StoreCode });
2074
+
2075
+ case 3:
2076
+ resp = _context12.sent;
2077
+
2078
+ _this.member = resp;
2079
+ _this.paymode.updateMemberStorageCardNo(resp.StorageCardNo, resp.WalletEnabled);
2080
+ return _context12.abrupt('return', _promise2.default.resolve(resp));
2081
+
2082
+ case 7:
2083
+ case 'end':
2084
+ return _context12.stop();
2085
+ }
2086
+ }
2087
+ }, _callee12, _this16);
2088
+ }));
2089
+
2090
+ return function (_x10) {
2091
+ return _ref26.apply(this, arguments);
2092
+ };
2093
+ }();
2094
+ }
2095
+ }), _descriptor5 = _applyDecoratedDescriptor(_class.prototype, 'updateCurrentMode', [_mobx.action], {
2096
+ enumerable: true,
2097
+ initializer: function initializer() {
2098
+ var _this17 = this;
2099
+
2100
+ return function () {
2101
+ var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee13(memberId, returnType) {
2102
+ var isOnlyEnabled, result;
2103
+ return _regenerator2.default.wrap(function _callee13$(_context13) {
2104
+ while (1) {
2105
+ switch (_context13.prev = _context13.next) {
2106
+ case 0:
2107
+ isOnlyEnabled = returnType ? false : true; //非原单退货为false,其他true
2108
+ // 查看会员卡信息
2109
+
2110
+ _context13.next = 3;
2111
+ return _this17.SettlementApi.getCardInfoByMemberId(memberId, isOnlyEnabled);
2112
+
2113
+ case 3:
2114
+ result = _context13.sent;
2115
+
2116
+ if (!(result && result.data.length)) {
2117
+ _context13.next = 21;
2118
+ break;
2119
+ }
2120
+
2121
+ if (!(result.data.length === 1)) {
2122
+ _context13.next = 10;
2123
+ break;
2124
+ }
2125
+
2126
+ _this17.paymode.updateCardInfo(result.data[0]);
2127
+ return _context13.abrupt('return', result.data);
2128
+
2129
+ case 10:
2130
+ if (!(result.data && result.data.length === 1)) {
2131
+ _context13.next = 15;
2132
+ break;
2133
+ }
2134
+
2135
+ _this17.paymode.updateCardInfo(result.data[0]);
2136
+ return _context13.abrupt('return', result.data);
2137
+
2138
+ case 15:
2139
+ if (!(result.data && result.data.length > 1)) {
2140
+ _context13.next = 19;
2141
+ break;
2142
+ }
2143
+
2144
+ return _context13.abrupt('return', result.data);
2145
+
2146
+ case 19:
2147
+ _message2.default.warn('没有可用储值卡!');
2148
+ return _context13.abrupt('return', false);
2149
+
2150
+ case 21:
2151
+ case 'end':
2152
+ return _context13.stop();
2153
+ }
2154
+ }
2155
+ }, _callee13, _this17);
2156
+ }));
2157
+
2158
+ return function (_x11, _x12) {
2159
+ return _ref27.apply(this, arguments);
2160
+ };
2161
+ }();
2162
+ }
2163
+ }), _descriptor6 = _applyDecoratedDescriptor(_class.prototype, 'updateCardInfo', [_mobx.action], {
2164
+ enumerable: true,
2165
+ initializer: function initializer() {
2166
+ var _this18 = this;
2167
+
2168
+ return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
2169
+ var ctMode, cardNo, result;
2170
+ return _regenerator2.default.wrap(function _callee14$(_context14) {
2171
+ while (1) {
2172
+ switch (_context14.prev = _context14.next) {
2173
+ case 0:
2174
+ ctMode = _this18.paymode && _this18.paymode.currentMode;
2175
+ cardNo = ctMode && ctMode.storageCardNo;
2176
+ _context14.next = 4;
2177
+ return _this18.SettlementApi.getCardInfoByCardNo(cardNo);
2178
+
2179
+ case 4:
2180
+ result = _context14.sent;
2181
+
2182
+ _this18.paymode.updateCardInfo(result && result.data);
2183
+
2184
+ case 6:
2185
+ case 'end':
2186
+ return _context14.stop();
2187
+ }
2188
+ }
2189
+ }, _callee14, _this18);
2190
+ }));
2191
+ }
2192
+ }), _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, 'changeClickFocusOnly', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeClickFocusOnly'), _class.prototype), _applyDecoratedDescriptor(_class.prototype, 'changeValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'changeValue'), _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, 'setDtoID', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class.prototype, 'setDtoID'), _class.prototype)), _class);
2193
+ exports.default = SettlementStore;
2194
+ var PayMode = exports.PayMode = (_class3 = function () {
2195
+ //预订场景下,现场提货,且选项设置订金比例非100% or 取货最大补款数大于0时 为 true
2196
+ function PayMode() {
2197
+ // this.amount=getFixedNumber(amount);
2198
+ // this.calcReserved();
2199
+
2200
+ (0, _classCallCheck3.default)(this, PayMode);
2201
+ this._counter = 0;
2202
+ this.amount = 0;
2203
+ this.onlineamount = 0;
2204
+ this.maxamount = 0;
2205
+
2206
+ _initDefineProp(this, 'currentFocus', _descriptor7, this);
2207
+
2208
+ _initDefineProp(this, 'received', _descriptor8, this);
2209
+
2210
+ _initDefineProp(this, 'receivable', _descriptor9, this);
2211
+
2212
+ _initDefineProp(this, 'paymodes', _descriptor10, this);
2213
+
2214
+ _initDefineProp(this, 'thePaymodes', _descriptor11, this);
2215
+
2216
+ this.bookMaxValue = 0;
2217
+ this.isNotFullBook = false;
2218
+ this.isNotFullOnlyBook = false;
2219
+
2220
+ _initDefineProp(this, 'storageCardNo', _descriptor12, this);
2221
+
2222
+ _initDefineProp(this, 'balance', _descriptor13, this);
2223
+
2224
+ this.currentMode = null;
2225
+ this.checkList = [];
2226
+ this.settle = {
2227
+ name: "复合结算",
2228
+ hotKey: "Ctrl+M"
2229
+ };
2230
+
2231
+ _initDefineProp(this, 'calcCheckList', _descriptor14, this);
2232
+
2233
+ _initDefineProp(this, 'setCouponNum', _descriptor15, this);
2234
+
2235
+ _initDefineProp(this, 'addDjqs', _descriptor16, this);
2236
+ }
2237
+ // @observable store = null;
2238
+ //只是预订场景下,现场提货,且选项设置订金比例非100%时 为 true
2239
+ //应收
2240
+
2241
+
2242
+ (0, _createClass3.default)(PayMode, [{
2243
+ key: 'clean',
2244
+ value: function clean() {
2245
+ this.thePaymodes = [];
2246
+ this.calcReserved();
2247
+ }
2248
+ }, {
2249
+ key: 'clear',
2250
+ value: function clear() {
2251
+ this.thePaymodes = [];
2252
+ this.calcReserved();
2253
+ this.paymodes = [];
2254
+ }
2255
+ }, {
2256
+ key: 'setAmount',
2257
+ value: function setAmount(a, o) {
2258
+ this.amount = (0, _utils.getFixedNumber)((a || 0) - (o || 0));
2259
+ this.onlineamount = (0, _utils.getFixedNumber)(o || 0);
2260
+ this.calcReserved();
2261
+ return this.amount < 0;
2262
+ }
2263
+ }, {
2264
+ key: 'calcReserved',
2265
+ value: function calcReserved(type) {
2266
+ var sum = 0;
2267
+ (0, _each3.default)(this.thePaymodes, function (mode) {
2268
+ sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
2269
+ });
2270
+ this.received = (0, _utils.getFixedNumber)(sum);
2271
+ if (type === 'bookPay' && this.isNotFullBook) {
2272
+ if (this.amount <= sum && sum <= this.bookMaxValue) {
2273
+ this.receivable = (0, _utils.getFixedNumber)(0);
2274
+ }
2275
+ if (sum < this.amount) {
2276
+ this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
2277
+ }
2278
+ if (sum > this.bookMaxValue) {
2279
+ this.receivable = (0, _utils.getFixedNumber)(this.bookMaxValue - sum);
2280
+ }
2281
+ } else {
2282
+ this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
2283
+ }
2284
+ }
2285
+ }, {
2286
+ key: 'updateMemberStorageCardNo',
2287
+ value: function updateMemberStorageCardNo(storageCardNo, walletEnabled) {
2288
+ this.currentMode.storageCardNo = storageCardNo;
2289
+ this.currentMode.walletEnabled = walletEnabled;
2290
+ }
2291
+ }, {
2292
+ key: 'updateCardInfo',
2293
+ value: function updateCardInfo(m) {
2294
+ this.currentMode.cardStatusEnum = m.CardStatusEnum;
2295
+ this.currentMode.isNeedPassword = m.IsNeedPassword;
2296
+ this.currentMode.meStorageCardId = m.MeStorageCardId;
2297
+ this.currentMode.storageCardNo = m.StorageCardNo;
2298
+ this.currentMode.balance = m.BalanceStorage;
2299
+ this.currentMode.rawbalance = m.BalanceStorage;
2300
+ this.currentMode.cardTypeEnum = m.CardTypeEnum;
2301
+ this.currentMode.walletEnabled = m.WalletEnabled;
2302
+ this.currentMode.memberId = m.ID;
2303
+ this.currentMode.freePaymentPasswordStore = m.FreePaymentPasswordStore;
2304
+ }
2305
+ }, {
2306
+ key: 'calcDjqCheckValue',
2307
+ value: function calcDjqCheckValue(q1, dto, params) {
2308
+ var _this19 = this;
2309
+
2310
+ var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
2311
+ var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
2312
+ return djq.checked;
2313
+ });
2314
+ if (qList.length === useLimitPerOrder && !q1.checked) {
2315
+ _message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
2316
+ return;
2317
+ }
2318
+ if (params === 'single') {
2319
+ this.checkList = [];
2320
+ }
2321
+
2322
+ var _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(),
2323
+ PayStyle = _enumController$getEn18.PayStyle,
2324
+ Differentiate = _enumController$getEn18.Differentiate;
2325
+
2326
+ if (q1) {
2327
+ if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
2328
+ _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
2329
+ return;
2330
+ }
2331
+ var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
2332
+ return djq.promoCouponCode == q1.promoCouponCode;
2333
+ });
2334
+ if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
2335
+ _message2.default.error("本单金额低于使用门槛,该券不可使用。");
2336
+ return;
2337
+ }
2338
+ //判断是否是选择优惠券 //CC优惠券只能使用一个
2339
+ // if (q1 && !q1.checked && isNewRetailBCPos) {
2340
+ // // 检查是否有已经选定优惠券 并且去除选定的优惠券
2341
+ // this.currentMode.djqs.forEach((djq, index) => {
2342
+ // if (djq.checked) this.currentMode.djqs[index].checked = false;
2343
+ // })
2344
+ // }
2345
+ q && (q.checked = !q.checked);
2346
+ }
2347
+ var sum = 0;
2348
+ // console.log(this.store, 'stores-------');
2349
+ if (!q1.checked) {
2350
+ this.checkList.forEach(function (ele, i) {
2351
+ if (ele.id === q1.id) {
2352
+ _this19.checkList.splice(i, 1);
2353
+ }
2354
+ });
2355
+ } else {
2356
+ this.checkList.push(q1);
2357
+ }
2358
+
2359
+ this.checkList.forEach(function (ele) {
2360
+ sum = Math.Add(sum, ele.amount);
2361
+ });
2362
+ this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
2363
+ console.log(this.receivable, sum, Math.min(this.receivable, sum, this.currentMode.maxamount), 'sum---------');
2364
+ this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - Math.min(this.receivable, sum, this.currentMode.maxamount));
2365
+ this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
2366
+ if (params === 'single') {
2367
+ return;
2368
+ }
2369
+ var promoVoucher = {};
2370
+ promoVoucher.boName = "Retail";
2371
+ // promoVoucher.promoLinks = _filter(this.currentMode.djqs,djq=>djq.checked);
2372
+ promoVoucher.meMemberId = this.currentMode.member.id;
2373
+ promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
2374
+ promoVoucher.voucherDetailList = [];
2375
+ dto.RetailDetails.forEach(function (item) {
2376
+ var detailDTO = {};
2377
+ detailDTO.uuid = item.Code;
2378
+ detailDTO.detailBoName = "RetailDetail";
2379
+ detailDTO.voucherDetailId = item.ID;
2380
+ detailDTO.productId = item.Idinventory;
2381
+ detailDTO.uomId = item.Idunit;
2382
+ detailDTO.productSpecId = item.ProductSpecId;
2383
+ detailDTO.isManualFreeGift = item.IsPresent;
2384
+ detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
2385
+ detailDTO.IsManualChangePrice = item.IsManualChangePrice;
2386
+
2387
+ // if(detailDTO.IsManualChangePrice)//如果是手工改价
2388
+ // {
2389
+ // detailDTO.listPrice = item.TaxPrice;
2390
+ // detailDTO.netAmountWithTax = item.TaxAmount;
2391
+ // }
2392
+ // else
2393
+ // {
2394
+
2395
+ var bookingQuantity = 0;
2396
+ if (item.BookingQuantity) {
2397
+ bookingQuantity = item.BookingQuantity;
2398
+ }
2399
+ detailDTO.listPrice = JSON.getCellValue(item, "listPrice");
2400
+ detailDTO.netAmountWithTax = Math.Multiply(detailDTO.listPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
2401
+ detailDTO.taxRate = item.TaxRate;
2402
+ detailDTO.quantity = item.Quantity;
2403
+
2404
+ detailDTO.amountWithTax = item.RetailAmount;
2405
+ // 促销 start
2406
+ if (item.PromotionDetails && item.PromotionDetails.length != 0) {
2407
+ var promoLinks = [];
2408
+ item.PromotionDetails.forEach(function (promotion) {
2409
+ promoLinks.push({
2410
+ promoId: promotion.IdSalesPromotionDTO,
2411
+ promoRuleId: promotion.PromotionRuleId
2412
+ });
2413
+ });
2414
+ if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
2415
+ }
2416
+ // 促销 end
2417
+ promoVoucher.voucherDetailList.push(detailDTO);
2418
+ });
2419
+ promoVoucher.promoLinks = this.checkList;
2420
+ return this.SettlementApi.findUsefulCouponPromoList(promoVoucher).then(function (result) {
2421
+ if (result && result.length != 0) {
2422
+ result.forEach(function (element, index) {
2423
+ var djq1 = false;
2424
+ _this19.currentMode.djqs.forEach(function (djq) {
2425
+ if (element.id === djq.id) {
2426
+ djq1 = true;
2427
+ }
2428
+ });
2429
+
2430
+ var _ref29 = element || {},
2431
+ couponCode = _ref29.couponCode,
2432
+ name = _ref29.name,
2433
+ tieredAmountResult = _ref29.tieredAmountResult,
2434
+ fromDate = _ref29.fromDate,
2435
+ dateMount = _ref29.dateMount,
2436
+ promoMethodEnum = _ref29.promoMethodEnum,
2437
+ discountPct = _ref29.discountPct,
2438
+ nominalAmount = _ref29.nominalAmount,
2439
+ promoId = _ref29.promoId,
2440
+ id = _ref29.id,
2441
+ doorsill = _ref29.doorsill;
2442
+
2443
+ var condValue = tieredAmountResult.condValue,
2444
+ promoDiscount = tieredAmountResult.promoDiscount,
2445
+ displayText = tieredAmountResult.displayText,
2446
+ promoRuleId = tieredAmountResult.promoRuleId,
2447
+ couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
2448
+
2449
+ if (!djq1) {
2450
+ // this.currentMode.djqs.push({
2451
+ // promoCouponCode: element.CouponCode,
2452
+ // name: element.CouponTitle,
2453
+ // IsEnable: true,
2454
+ // amount: element.ReductionAmount,
2455
+ // doorsill: element.EnableAmount,
2456
+ // LastTS: element.LastTS,
2457
+ // checked: false,
2458
+ // IsRepelWithPoints: true,
2459
+ // UMemberID: dto.Idmember,
2460
+ // expired: null,
2461
+ // displayText,
2462
+ // promoMethodEnum,
2463
+ // discountPct,
2464
+ // promoId,
2465
+ // promoRuleId,
2466
+ // couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
2467
+ // id
2468
+ // })
2469
+ _this19.addDjqs(couponCode, name, true, nominalAmount, promoDiscount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
2470
+ djq1 = false;
2471
+ } else {
2472
+ _this19.setCouponNum(element.id, couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
2473
+ // this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
2474
+ // djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
2475
+ }
2476
+ });
2477
+ }
2478
+ // 优惠券【6052098985043】与【6120822326451】不可叠加使用
2479
+ });
2480
+ //this.receivable = getFixedNumber(this.receivable - sum);
2481
+ }
2482
+ }, {
2483
+ key: 'calcDjqValue',
2484
+ value: function calcDjqValue(q1) {
2485
+ var _enumController$getEn19 = _mutantsUtil.enumController.getEnumOj(),
2486
+ Differentiate = _enumController$getEn19.Differentiate;
2487
+
2488
+ if (q1) {
2489
+ if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
2490
+ _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
2491
+ return;
2492
+ }
2493
+ var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
2494
+ return djq.code == q1.code;
2495
+ });
2496
+ if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
2497
+ _message2.default.error("本单金额低于使用门槛,该券不可使用。");
2498
+ return;
2499
+ }
2500
+ //判断是否是选择优惠券 //CC优惠券只能使用一个
2501
+ // if (q1 && !q1.checked && isNewRetailBCPos) {
2502
+ // // 检查是否有已经选定优惠券 并且去除选定的优惠券
2503
+ // this.currentMode.djqs.forEach((djq, index) => {
2504
+ // if (djq.checked) this.currentMode.djqs[index].checked = false;
2505
+ // })
2506
+ // }
2507
+ q && (q.checked = !q.checked);
2508
+ }
2509
+ var sum = 0;
2510
+ // console.log(this.store, 'stores-------');
2511
+ (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
2512
+ return djq.checked;
2513
+ }), function (q) {
2514
+ sum = Math.Add(sum, q.amount);
2515
+ });
2516
+ this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
2517
+ this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
2518
+ this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
2519
+
2520
+ //this.receivable = getFixedNumber(this.receivable - sum);
2521
+ }
2522
+ }, {
2523
+ key: 'reCalculationDjqs',
2524
+ value: function reCalculationDjqs() {
2525
+ var sum = 0;
2526
+ (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
2527
+ return djq.checked;
2528
+ }), function (q) {
2529
+ sum = Math.Add(sum, q.amount);
2530
+ });
2531
+ this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
2532
+ this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
2533
+ this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
2534
+ this.currentMode.maxamount = this.currentMode.receivable || this.currentMode.receivable;
2535
+ }
2536
+ }, {
2537
+ key: 'clearDjqs',
2538
+ value: function clearDjqs() {
2539
+ this.currentMode.djqs = [];
2540
+ }
2541
+ }, {
2542
+ key: 'setCurrentModeValue',
2543
+ value: function setCurrentModeValue(v, max) {
2544
+ this.currentMode.value = parseFloat(v) || 0;
2545
+ this.currentMode.errinfo = '';
2546
+ var sum = this.amount;
2547
+
2548
+ var _enumController$getEn20 = _mutantsUtil.enumController.getEnumOj(),
2549
+ PayStyle = _enumController$getEn20.PayStyle;
2550
+
2551
+ this.thePaymodes && this.thePaymodes.forEach(function (mode) {
2552
+ if (mode.paymentType === PayStyle.hyczk) {
2553
+ sum -= mode.value;
2554
+ }
2555
+ });
2556
+
2557
+ if (this.amount > 0 && (v === '' || v === '0.00') && sum !== 0) {
2558
+ this.currentMode.errinfo = "实收金额必须录入";
2559
+ } else if (Math.abs(parseFloat(v)) > Math.abs((0, _utils.getFixedNumber)(sum))) {
2560
+ this.currentMode.errinfo = "实收不应大于应收";
2561
+ } else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
2562
+ this.currentMode.errinfo = "余额不足";
2563
+ }
2564
+ // 如果是积分抵现的一些判断
2565
+ if (this.currentMode.paymentType === PayStyle.jfdx) {
2566
+ if (this.currentMode.integralCashOverOrderAmount === true) {
2567
+ this.currentMode.steadCashIntegral = Math.ceil(this.currentMode.value / this.currentMode.cashAmount) * this.currentMode.perIntegral;
2568
+ } else if (this.currentMode.integralCashOverOrderAmount === false) {
2569
+ var v1 = this.currentMode.value / this.currentMode.cashAmount;
2570
+ if ((0, _isInteger2.default)(v1)) {
2571
+ this.currentMode.steadCashIntegral = Math.floor(this.currentMode.value / this.currentMode.cashAmount) * this.currentMode.perIntegral;
2572
+ } else {
2573
+ this.currentMode.errinfo = '\u8BF7\u6309\u7167\u79EF\u5206\u62B5\u73B0\u89C4\u5219' + this.currentMode.perIntegral + '\u79EF\u5206\u62B5\u7528' + this.currentMode.cashAmount + '\u5143\u8F93\u5165\u91D1\u989D';
2574
+ }
2575
+ }
2576
+ }
2577
+ }
2578
+ }, {
2579
+ key: 'calcMemberBalance',
2580
+ value: function calcMemberBalance() {
2581
+ this.currentMode.balance = this.currentMode.rawbalance - this.currentMode.value;
2582
+ }
2583
+ }, {
2584
+ key: 'setPaymodes',
2585
+ value: function () {
2586
+ var _ref30 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(type, isIntegralExchange) {
2587
+ var _this20 = this;
2588
+
2589
+ var _ref31, isHorizontalPad, isHorizontalSunMi, isMobileEnvironment, _enumController$getEn21, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
2590
+
2591
+ return _regenerator2.default.wrap(function _callee15$(_context15) {
2592
+ while (1) {
2593
+ switch (_context15.prev = _context15.next) {
2594
+ case 0:
2595
+ // 是否移动端判断
2596
+ _ref31 = _mutantsUtil.platform || {}, isHorizontalPad = _ref31.isHorizontalPad, isHorizontalSunMi = _ref31.isHorizontalSunMi;
2597
+ isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
2598
+ _enumController$getEn21 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn21.settleStyleType, PayStyle = _enumController$getEn21.PayStyle;
2599
+ memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
2600
+ param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
2601
+ _context15.next = 7;
2602
+ return _settlementApi2.default.GetNewStoreSettleStyles({ param: param });
2603
+
2604
+ case 7:
2605
+ modes = _context15.sent;
2606
+
2607
+ if (modes) {
2608
+ (0, _mobx.runInAction)(function () {
2609
+ var paymodes = [];
2610
+ var settleLists = modes.SettleStyles;
2611
+ settleLists = isMobileEnvironment ? settleLists.filter(function (v) {
2612
+ return !v.ThirdPaymentInfo;
2613
+ }) : settleLists;
2614
+ (0, _each3.default)(settleLists, function (mode, index) {
2615
+ //产品需求确认会员储值卡结算方式前端展示统一调整为“储值卡" tuzha by 2020-07-08
2616
+ if (mode.Code == PayStyle.hyczk) {
2617
+ mode.Name = '储值卡';
2618
+ }
2619
+ paymodes.push({
2620
+ name: mode.Name,
2621
+ isDefault: mode.IsDefaultSettleStyle,
2622
+ isQuick: (0, _findIndex3.default)(modes.QuickSettleStyles, { 'Code': mode.Code }) >= 0,
2623
+ orderBy: 1,
2624
+ paymentType: mode.Code,
2625
+ offlineDisable: mode.offlineDisable,
2626
+ idSettleStyle: mode.IdSettleStyle,
2627
+ idBankAccount: mode.IdBankAccount,
2628
+ exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
2629
+ idCurrency: mode.Currency ? mode.Currency.ID : -1,
2630
+ calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88",
2631
+ virtualPay: mode.VirtualPay,
2632
+ thridPayment: mode.ThirdPaymentInfo
2633
+ });
2634
+ });
2635
+ _this20.paymodes = paymodes;
2636
+ });
2637
+ }
2638
+
2639
+ case 9:
2640
+ case 'end':
2641
+ return _context15.stop();
2642
+ }
2643
+ }
2644
+ }, _callee15, this);
2645
+ }));
2646
+
2647
+ function setPaymodes(_x13, _x14) {
2648
+ return _ref30.apply(this, arguments);
2649
+ }
2650
+
2651
+ return setPaymodes;
2652
+ }()
2653
+ }, {
2654
+ key: 'charge',
2655
+ get: function get() {
2656
+ return Math.abs(this.receivable);
2657
+ }
2658
+ }, {
2659
+ key: 'counter',
2660
+ get: function get() {
2661
+ return ++this._counter;
2662
+ }
2663
+ }]);
2664
+ return PayMode;
2665
+ }(), (_descriptor7 = _applyDecoratedDescriptor(_class3.prototype, 'currentFocus', [_mobx.observable], {
2666
+ enumerable: true,
2667
+ initializer: function initializer() {
2668
+ return "";
2669
+ }
2670
+ }), _descriptor8 = _applyDecoratedDescriptor(_class3.prototype, 'received', [_mobx.observable], {
2671
+ enumerable: true,
2672
+ initializer: function initializer() {
2673
+ return 0;
2674
+ }
2675
+ }), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'receivable', [_mobx.observable], {
2676
+ enumerable: true,
2677
+ initializer: function initializer() {
2678
+ return 0;
2679
+ }
2680
+ }), _descriptor10 = _applyDecoratedDescriptor(_class3.prototype, 'paymodes', [_mobx.observable], {
2681
+ enumerable: true,
2682
+ initializer: function initializer() {
2683
+ return [];
2684
+ }
2685
+ }), _descriptor11 = _applyDecoratedDescriptor(_class3.prototype, 'thePaymodes', [_mobx.observable], {
2686
+ enumerable: true,
2687
+ initializer: function initializer() {
2688
+ return [];
2689
+ }
2690
+ }), _descriptor12 = _applyDecoratedDescriptor(_class3.prototype, 'storageCardNo', [_mobx.observable], {
2691
+ enumerable: true,
2692
+ initializer: function initializer() {
2693
+ return null;
2694
+ }
2695
+ }), _descriptor13 = _applyDecoratedDescriptor(_class3.prototype, 'balance', [_mobx.observable], {
2696
+ enumerable: true,
2697
+ initializer: function initializer() {
2698
+ return null;
2699
+ }
2700
+ }), _applyDecoratedDescriptor(_class3.prototype, 'clean', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clean'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clear', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clear'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcReserved', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcReserved'), _class3.prototype), _descriptor14 = _applyDecoratedDescriptor(_class3.prototype, 'calcCheckList', [_mobx.action], {
2701
+ enumerable: true,
2702
+ initializer: function initializer() {
2703
+ var _this21 = this;
2704
+
2705
+ return function () {
2706
+ _this21.checkList = [];
2707
+ };
2708
+ }
2709
+ }), _applyDecoratedDescriptor(_class3.prototype, 'updateMemberStorageCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'updateMemberStorageCardNo'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'updateCardInfo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'updateCardInfo'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor15 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
2710
+ enumerable: true,
2711
+ initializer: function initializer() {
2712
+ var _this22 = this;
2713
+
2714
+ return function (id, couponNum, promoMethodEnum, nominalAmount, promoDiscount) {
2715
+ _this22.currentMode.djqs.forEach(function (ele) {
2716
+ if (ele.id === id) {
2717
+ ele.amount = promoDiscount;
2718
+ promoMethodEnum == "CASH_COUPON" && (ele.nominalAmount = nominalAmount);
2719
+ ele.couponCategoryEnum = couponNum;
2720
+ var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
2721
+ ele.IsEnable = IsEnable;
2722
+ }
2723
+ });
2724
+ };
2725
+ }
2726
+ }), _descriptor16 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
2727
+ enumerable: true,
2728
+ initializer: function initializer() {
2729
+ var _this23 = this;
2730
+
2731
+ return function (promoCouponCode, name, IsEnable, nominalAmount, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2732
+ var djq = {
2733
+ promoCouponCode: promoCouponCode,
2734
+ name: name,
2735
+ IsEnable: IsEnable,
2736
+ nominalAmount: nominalAmount,
2737
+ amount: amount,
2738
+ doorsill: doorsill,
2739
+ LastTS: LastTS,
2740
+ checked: checked,
2741
+ IsRepelWithPoints: IsRepelWithPoints,
2742
+ UMemberID: UMemberID,
2743
+ expired: expired,
2744
+ displayText: displayText,
2745
+ promoMethodEnum: promoMethodEnum,
2746
+ discountPct: discountPct,
2747
+ promoId: promoId,
2748
+ promoRuleId: promoRuleId,
2749
+ couponCategoryEnum: couponCategoryEnum,
2750
+ id: id
2751
+ };
2752
+ _this23.currentMode.djqs.push(djq);
2753
+ };
2754
+ }
2755
+ }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqValue'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'reCalculationDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'reCalculationDjqs'), _class3.prototype), _applyDecoratedDescriptor(_class3.prototype, 'clearDjqs', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'clearDjqs'), _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);
2756
+ var Member = exports.Member = (_class5 = function () {
2757
+ function Member(m) {
2758
+ var _this24 = this;
2759
+
2760
+ (0, _classCallCheck3.default)(this, Member);
2761
+
2762
+ _initDefineProp(this, 'cardNo', _descriptor17, this);
2763
+
2764
+ _initDefineProp(this, 'balance', _descriptor18, this);
2765
+
2766
+ _initDefineProp(this, 'exchangable', _descriptor19, this);
2767
+
2768
+ _initDefineProp(this, 'meStorageCardId', _descriptor20, this);
2769
+
2770
+ _initDefineProp(this, 'storageCardNo', _descriptor21, this);
2771
+
2772
+ if (m) {
2773
+ this.id = m.ID;
2774
+ this.uid = m.Uid;
2775
+ this.type = m.MemberType ? m.MemberType.Name : "普通";
2776
+ this.rawbalance = m.BalanceStorage;
2777
+ var index = (0, _findIndex3.default)(m.DynamicPropertyKeys, function (key) {
2778
+ return key == 'canusedbalancestorage';
2779
+ });
2780
+ (0, _mobx.runInAction)(function () {
2781
+ _this24.cardNo = m.CardCode;
2782
+ if (index >= 0) {
2783
+ _this24.balance = parseFloat(m.DynamicPropertyValues[index]);
2784
+ } else {
2785
+ _this24.balance = _this24.rawbalance;
2786
+ }
2787
+ });
2788
+ this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
2789
+ this.NeedModifyPassword = m.NeedModifyPassword;
2790
+ this.bonusPoints = m.BalanceIntegral;
2791
+ }
2792
+ }
2793
+
2794
+ (0, _createClass3.default)(Member, [{
2795
+ key: 'setExchangable',
2796
+ value: function setExchangable(v) {
2797
+ this.exchangable = v;
2798
+ }
2799
+ }, {
2800
+ key: 'setCardNo',
2801
+ value: function setCardNo(v) {
2802
+ this.cardNo = v;
2803
+ this.id = null;
2804
+ }
2805
+ }]);
2806
+ return Member;
2807
+ }(), (_descriptor17 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
2808
+ enumerable: true,
2809
+ initializer: null
2810
+ }), _descriptor18 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
2811
+ enumerable: true,
2812
+ initializer: null
2813
+ }), _descriptor19 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
2814
+ enumerable: true,
2815
+ initializer: null
2816
+ }), _descriptor20 = _applyDecoratedDescriptor(_class5.prototype, 'meStorageCardId', [_mobx.observable], {
2817
+ enumerable: true,
2818
+ initializer: null
2819
+ }), _descriptor21 = _applyDecoratedDescriptor(_class5.prototype, 'storageCardNo', [_mobx.observable], {
2820
+ enumerable: true,
2821
+ initializer: null
2822
+ }), _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);
2823
+ //# sourceMappingURL=settlementStore.js.map