tplus-components-touch 3.22.15 → 3.22.16

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 (233) hide show
  1. package/package.json +1 -1
  2. package/dist/components/acCitySelect/CitySelect.js +0 -541
  3. package/dist/components/acCitySelect/CitySelect.js.map +0 -1
  4. package/dist/components/acCitySelect/CitySelect.less +0 -10
  5. package/dist/components/acCitySelect/citys.js +0 -1270
  6. package/dist/components/acCitySelect/citys.js.map +0 -1
  7. package/dist/components/acCitySelect/index.js +0 -18
  8. package/dist/components/acCitySelect/index.js.map +0 -1
  9. package/dist/components/acCitySelect/provinceData.js +0 -40
  10. package/dist/components/acCitySelect/provinceData.js.map +0 -1
  11. package/dist/components/addLog/AddLogProcessor.js +0 -49
  12. package/dist/components/addLog/AddLogProcessor.js.map +0 -1
  13. package/dist/components/addLog/OperationLogApi.js +0 -125
  14. package/dist/components/addLog/OperationLogApi.js.map +0 -1
  15. package/dist/components/autoComplete/index.js +0 -245
  16. package/dist/components/autoComplete/index.js.map +0 -1
  17. package/dist/components/autoComplete/index.less +0 -89
  18. package/dist/components/autoComplete/option.js +0 -75
  19. package/dist/components/autoComplete/option.js.map +0 -1
  20. package/dist/components/autoCompleteWithKeyboard/index.js +0 -231
  21. package/dist/components/autoCompleteWithKeyboard/index.js.map +0 -1
  22. package/dist/components/autoCompleteWithKeyboard/index.less +0 -8
  23. package/dist/components/billSearch/api.js +0 -465
  24. package/dist/components/billSearch/api.js.map +0 -1
  25. package/dist/components/billSearch/index.js +0 -2063
  26. package/dist/components/billSearch/index.js.map +0 -1
  27. package/dist/components/billSearch/index.less +0 -373
  28. package/dist/components/cloudPrint/BTPrintFormatUtil.js +0 -568
  29. package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +0 -1
  30. package/dist/components/cloudPrint/api.js +0 -349
  31. package/dist/components/cloudPrint/api.js.map +0 -1
  32. package/dist/components/cloudPrint/index.js +0 -674
  33. package/dist/components/cloudPrint/index.js.map +0 -1
  34. package/dist/components/cloudPrint/printDispatch.js +0 -223
  35. package/dist/components/cloudPrint/printDispatch.js.map +0 -1
  36. package/dist/components/commonForm/addressPicker/index.js +0 -232
  37. package/dist/components/commonForm/addressPicker/index.js.map +0 -1
  38. package/dist/components/commonForm/addressPicker/style.less +0 -11
  39. package/dist/components/commonForm/autoComplete/index.js +0 -241
  40. package/dist/components/commonForm/autoComplete/index.js.map +0 -1
  41. package/dist/components/commonForm/autoComplete/style.less +0 -3
  42. package/dist/components/commonForm/datePicker/index.js +0 -89
  43. package/dist/components/commonForm/datePicker/index.js.map +0 -1
  44. package/dist/components/commonForm/datePicker/style.less +0 -5
  45. package/dist/components/commonForm/formControl/index.js +0 -143
  46. package/dist/components/commonForm/formControl/index.js.map +0 -1
  47. package/dist/components/commonForm/formControl/style.less +0 -0
  48. package/dist/components/commonForm/index.js +0 -225
  49. package/dist/components/commonForm/index.js.map +0 -1
  50. package/dist/components/commonForm/inputNumber/index.js +0 -272
  51. package/dist/components/commonForm/inputNumber/index.js.map +0 -1
  52. package/dist/components/commonForm/inputNumber/style.less +0 -11
  53. package/dist/components/commonForm/radio/index.js +0 -132
  54. package/dist/components/commonForm/radio/index.js.map +0 -1
  55. package/dist/components/commonForm/radio/style.less +0 -0
  56. package/dist/components/commonForm/style.less +0 -2
  57. package/dist/components/deliverySearch/api.js +0 -355
  58. package/dist/components/deliverySearch/api.js.map +0 -1
  59. package/dist/components/deliverySearch/index.js +0 -1214
  60. package/dist/components/deliverySearch/index.js.map +0 -1
  61. package/dist/components/deliverySearch/index.less +0 -554
  62. package/dist/components/form/index.js +0 -310
  63. package/dist/components/form/index.js.map +0 -1
  64. package/dist/components/hardwareAPI/index.js +0 -181
  65. package/dist/components/hardwareAPI/index.js.map +0 -1
  66. package/dist/components/hotKey/config.js +0 -306
  67. package/dist/components/hotKey/config.js.map +0 -1
  68. package/dist/components/hotKey/hotKeyModal.js +0 -479
  69. package/dist/components/hotKey/hotKeyModal.js.map +0 -1
  70. package/dist/components/hotKey/index.js +0 -785
  71. package/dist/components/hotKey/index.js.map +0 -1
  72. package/dist/components/hotKey/localConfig.js +0 -1021
  73. package/dist/components/hotKey/localConfig.js.map +0 -1
  74. package/dist/components/hotKey/style.less +0 -96
  75. package/dist/components/hotKey/utils.js +0 -135
  76. package/dist/components/hotKey/utils.js.map +0 -1
  77. package/dist/components/input/index.js +0 -251
  78. package/dist/components/input/index.js.map +0 -1
  79. package/dist/components/input/style.less +0 -99
  80. package/dist/components/input/tplusInput/index.js +0 -81
  81. package/dist/components/input/tplusInput/index.js.map +0 -1
  82. package/dist/components/input/tplusInput/inputContent.js +0 -128
  83. package/dist/components/input/tplusInput/inputContent.js.map +0 -1
  84. package/dist/components/input/tplusInput/inputs.js +0 -151
  85. package/dist/components/input/tplusInput/inputs.js.map +0 -1
  86. package/dist/components/input/tplusInput/style.less +0 -132
  87. package/dist/components/input/utils/index.js +0 -26
  88. package/dist/components/input/utils/index.js.map +0 -1
  89. package/dist/components/inventorySearch/api.js +0 -214
  90. package/dist/components/inventorySearch/api.js.map +0 -1
  91. package/dist/components/inventorySearch/index.js +0 -303
  92. package/dist/components/inventorySearch/index.js.map +0 -1
  93. package/dist/components/inventorySearch/index.less +0 -120
  94. package/dist/components/inventorySearch/store.js +0 -344
  95. package/dist/components/inventorySearch/store.js.map +0 -1
  96. package/dist/components/inventorySearch/tab.js +0 -258
  97. package/dist/components/inventorySearch/tab.js.map +0 -1
  98. package/dist/components/keyboard/index.js +0 -255
  99. package/dist/components/keyboard/index.js.map +0 -1
  100. package/dist/components/keyboard/index.less +0 -470
  101. package/dist/components/keyboard/letterKeyboard.js +0 -210
  102. package/dist/components/keyboard/letterKeyboard.js.map +0 -1
  103. package/dist/components/keyboard/numKeyboard.js +0 -459
  104. package/dist/components/keyboard/numKeyboard.js.map +0 -1
  105. package/dist/components/keyboard/numKeyboardScan.js +0 -195
  106. package/dist/components/keyboard/numKeyboardScan.js.map +0 -1
  107. package/dist/components/keyboard/numberButton_input.js +0 -303
  108. package/dist/components/keyboard/numberButton_input.js.map +0 -1
  109. package/dist/components/keyboard/numkeyboardPassword.js +0 -460
  110. package/dist/components/keyboard/numkeyboardPassword.js.map +0 -1
  111. package/dist/components/keyboard/onlyKeyboard.js +0 -90
  112. package/dist/components/keyboard/onlyKeyboard.js.map +0 -1
  113. package/dist/components/keyboard/onlyLetterButton.js +0 -187
  114. package/dist/components/keyboard/onlyLetterButton.js.map +0 -1
  115. package/dist/components/keyboard/onlyLetterButton2.js +0 -235
  116. package/dist/components/keyboard/onlyLetterButton2.js.map +0 -1
  117. package/dist/components/keyboard/onlyLetterButton2.less +0 -162
  118. package/dist/components/keyboard/onlyNumberButton.js +0 -128
  119. package/dist/components/keyboard/onlyNumberButton.js.map +0 -1
  120. package/dist/components/keyboard/onlyNumberButton2.js +0 -115
  121. package/dist/components/keyboard/onlyNumberButton2.js.map +0 -1
  122. package/dist/components/keyboard/textKeyboard.js +0 -50
  123. package/dist/components/keyboard/textKeyboard.js.map +0 -1
  124. package/dist/components/layout/hamburger.js +0 -29
  125. package/dist/components/layout/hamburger.js.map +0 -1
  126. package/dist/components/layout/index.js +0 -31
  127. package/dist/components/layout/index.js.map +0 -1
  128. package/dist/components/layout/layout.js +0 -182
  129. package/dist/components/layout/layout.js.map +0 -1
  130. package/dist/components/layout/sider.js +0 -165
  131. package/dist/components/layout/sider.js.map +0 -1
  132. package/dist/components/layout/style.less +0 -82
  133. package/dist/components/loading/index.js +0 -198
  134. package/dist/components/loading/index.js.map +0 -1
  135. package/dist/components/loading/loadingContent.js +0 -176
  136. package/dist/components/loading/loadingContent.js.map +0 -1
  137. package/dist/components/loading/style.less +0 -61
  138. package/dist/components/loading/utils.js +0 -29
  139. package/dist/components/loading/utils.js.map +0 -1
  140. package/dist/components/message/index.js +0 -308
  141. package/dist/components/message/index.js.map +0 -1
  142. package/dist/components/message/index.less +0 -101
  143. package/dist/components/modal/index.js +0 -93
  144. package/dist/components/modal/index.js.map +0 -1
  145. package/dist/components/modal/index.less +0 -19
  146. package/dist/components/modalVertical/index.js +0 -325
  147. package/dist/components/modalVertical/index.js.map +0 -1
  148. package/dist/components/modalVertical/style.less +0 -60
  149. package/dist/components/modalWraper/index.js +0 -470
  150. package/dist/components/modalWraper/index.js.map +0 -1
  151. package/dist/components/modalWraper/style.less +0 -257
  152. package/dist/components/modalWraper/utils.js +0 -48
  153. package/dist/components/modalWraper/utils.js.map +0 -1
  154. package/dist/components/notification/index.js +0 -119
  155. package/dist/components/notification/index.js.map +0 -1
  156. package/dist/components/notification/index.less +0 -52
  157. package/dist/components/overflowTip/index.js +0 -269
  158. package/dist/components/overflowTip/index.js.map +0 -1
  159. package/dist/components/overflowTip/style.less +0 -66
  160. package/dist/components/page/index.js +0 -49
  161. package/dist/components/page/index.js.map +0 -1
  162. package/dist/components/page/index.less +0 -22
  163. package/dist/components/product/detail.js +0 -148
  164. package/dist/components/product/detail.js.map +0 -1
  165. package/dist/components/product/getCard.js +0 -145
  166. package/dist/components/product/getCard.js.map +0 -1
  167. package/dist/components/product/index.less +0 -128
  168. package/dist/components/progressState/EmptyAndErrorView.js +0 -143
  169. package/dist/components/progressState/EmptyAndErrorView.js.map +0 -1
  170. package/dist/components/progressState/ProgressState.js +0 -157
  171. package/dist/components/progressState/ProgressState.js.map +0 -1
  172. package/dist/components/progressState/index.js +0 -14
  173. package/dist/components/progressState/index.js.map +0 -1
  174. package/dist/components/progressState/style.less +0 -65
  175. package/dist/components/scan/index.js +0 -219
  176. package/dist/components/scan/index.js.map +0 -1
  177. package/dist/components/scan/index.less +0 -34
  178. package/dist/components/select/index.js +0 -28
  179. package/dist/components/select/index.js.map +0 -1
  180. package/dist/components/select/index.less +0 -12
  181. package/dist/components/settlement/asyncModal.js +0 -204
  182. package/dist/components/settlement/asyncModal.js.map +0 -1
  183. package/dist/components/settlement/index.js +0 -16
  184. package/dist/components/settlement/index.js.map +0 -1
  185. package/dist/components/settlement/prototypeTable/index.js +0 -349
  186. package/dist/components/settlement/prototypeTable/index.js.map +0 -1
  187. package/dist/components/settlement/prototypeTable/style.less +0 -59
  188. package/dist/components/settlement/prototypeTable/utils.js +0 -14
  189. package/dist/components/settlement/prototypeTable/utils.js.map +0 -1
  190. package/dist/components/settlement/settlement.js +0 -5471
  191. package/dist/components/settlement/settlement.js.map +0 -1
  192. package/dist/components/settlement/settlement.less +0 -1594
  193. package/dist/components/settlement/settlementStore.js +0 -2099
  194. package/dist/components/settlement/settlementStore.js.map +0 -1
  195. package/dist/components/settlement/utils.js +0 -249
  196. package/dist/components/settlement/utils.js.map +0 -1
  197. package/dist/components/socket/index.js +0 -220
  198. package/dist/components/socket/index.js.map +0 -1
  199. package/dist/components/spin/index.js +0 -95
  200. package/dist/components/spin/index.js.map +0 -1
  201. package/dist/components/spin/spin-style.less +0 -436
  202. package/dist/components/test/index.js +0 -330
  203. package/dist/components/test/index.js.map +0 -1
  204. package/dist/components/ticon/iconfont/demo.css +0 -539
  205. package/dist/components/ticon/iconfont/demo_index.html +0 -5202
  206. package/dist/components/ticon/iconfont/iconfont.css +0 -887
  207. package/dist/components/ticon/iconfont/iconfont.eot +0 -0
  208. package/dist/components/ticon/iconfont/iconfont.js +0 -35
  209. package/dist/components/ticon/iconfont/iconfont.js.map +0 -1
  210. package/dist/components/ticon/iconfont/iconfont.json +0 -1535
  211. package/dist/components/ticon/iconfont/iconfont.svg +0 -593
  212. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  213. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  214. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  215. package/dist/components/ticon/index.js +0 -60
  216. package/dist/components/ticon/index.js.map +0 -1
  217. package/dist/components/touchScroll/index.js +0 -182
  218. package/dist/components/touchScroll/index.js.map +0 -1
  219. package/dist/components/touchTable/AuthProcess.js +0 -42
  220. package/dist/components/touchTable/AuthProcess.js.map +0 -1
  221. package/dist/components/touchTable/generateWater.js +0 -59
  222. package/dist/components/touchTable/generateWater.js.map +0 -1
  223. package/dist/components/touchTable/index.js +0 -1109
  224. package/dist/components/touchTable/index.js.map +0 -1
  225. package/dist/components/touchTable/index.less +0 -370
  226. package/dist/components/touchTable/utils.js +0 -14
  227. package/dist/components/touchTable/utils.js.map +0 -1
  228. package/dist/demo/PopOverDemo.js +0 -126
  229. package/dist/demo/PopOverDemo.js.map +0 -1
  230. package/dist/index.js +0 -249
  231. package/dist/index.js.map +0 -1
  232. package/dist/util/tools.js +0 -202
  233. package/dist/util/tools.js.map +0 -1
@@ -1,2099 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Member = exports.PayMode = exports.default = undefined;
7
-
8
- var _defineProperty = require('babel-runtime/core-js/object/define-property');
9
-
10
- var _defineProperty2 = _interopRequireDefault(_defineProperty);
11
-
12
- var _getOwnPropertyDescriptor = require('babel-runtime/core-js/object/get-own-property-descriptor');
13
-
14
- var _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);
15
-
16
- var _stringify = require('babel-runtime/core-js/json/stringify');
17
-
18
- var _stringify2 = _interopRequireDefault(_stringify);
19
-
20
- var _promise = require('babel-runtime/core-js/promise');
21
-
22
- var _promise2 = _interopRequireDefault(_promise);
23
-
24
- var _regenerator = require('babel-runtime/regenerator');
25
-
26
- var _regenerator2 = _interopRequireDefault(_regenerator);
27
-
28
- var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
29
-
30
- var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
31
-
32
- var _extends2 = require('babel-runtime/helpers/extends');
33
-
34
- var _extends3 = _interopRequireDefault(_extends2);
35
-
36
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
37
-
38
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
39
-
40
- var _createClass2 = require('babel-runtime/helpers/createClass');
41
-
42
- var _createClass3 = _interopRequireDefault(_createClass2);
43
-
44
- var _desc, _value, _class, _descriptor, _descriptor2, _desc2, _value2, _class3, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _desc3, _value3, _class5, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15;
45
-
46
- var _mobx = require('mobx');
47
-
48
- var _mutantsMicrofx = require('mutants-microfx');
49
-
50
- var _find2 = require('lodash/find');
51
-
52
- var _find3 = _interopRequireDefault(_find2);
53
-
54
- var _remove2 = require('lodash/remove');
55
-
56
- var _remove3 = _interopRequireDefault(_remove2);
57
-
58
- var _each2 = require('lodash/each');
59
-
60
- var _each3 = _interopRequireDefault(_each2);
61
-
62
- var _map2 = require('lodash/map');
63
-
64
- var _map3 = _interopRequireDefault(_map2);
65
-
66
- var _join2 = require('lodash/join');
67
-
68
- var _join3 = _interopRequireDefault(_join2);
69
-
70
- var _trim2 = require('lodash/trim');
71
-
72
- var _trim3 = _interopRequireDefault(_trim2);
73
-
74
- var _filter2 = require('lodash/filter');
75
-
76
- var _filter3 = _interopRequireDefault(_filter2);
77
-
78
- var _findIndex2 = require('lodash/findIndex');
79
-
80
- var _findIndex3 = _interopRequireDefault(_findIndex2);
81
-
82
- var _findLastIndex2 = require('lodash/findLastIndex');
83
-
84
- var _findLastIndex3 = _interopRequireDefault(_findLastIndex2);
85
-
86
- var _findKey2 = require('lodash/findKey');
87
-
88
- var _findKey3 = _interopRequireDefault(_findKey2);
89
-
90
- var _tplusPoslogin = require('tplus-poslogin');
91
-
92
- var _utils = require('./utils');
93
-
94
- var _tplusApi = require('tplus-api');
95
-
96
- var _cloneDeep = require('lodash/cloneDeep');
97
-
98
- var _cloneDeep2 = _interopRequireDefault(_cloneDeep);
99
-
100
- var _message = require('../message');
101
-
102
- var _message2 = _interopRequireDefault(_message);
103
-
104
- var _mutantsUtil = require('mutants-util');
105
-
106
- var _tplusComponentsTouch = require('tplus-components-touch');
107
-
108
- var _moment = require('moment');
109
-
110
- var _moment2 = _interopRequireDefault(_moment);
111
-
112
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
113
-
114
- function _initDefineProp(target, property, descriptor, context) {
115
- if (!descriptor) return;
116
- (0, _defineProperty2.default)(target, property, {
117
- enumerable: descriptor.enumerable,
118
- configurable: descriptor.configurable,
119
- writable: descriptor.writable,
120
- value: descriptor.initializer ? descriptor.initializer.call(context) : void 0
121
- });
122
- }
123
-
124
- function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {
125
- var desc = {};
126
- Object['ke' + 'ys'](descriptor).forEach(function (key) {
127
- desc[key] = descriptor[key];
128
- });
129
- desc.enumerable = !!desc.enumerable;
130
- desc.configurable = !!desc.configurable;
131
-
132
- if ('value' in desc || desc.initializer) {
133
- desc.writable = true;
134
- }
135
-
136
- desc = decorators.slice().reverse().reduce(function (desc, decorator) {
137
- return decorator(target, property, desc) || desc;
138
- }, desc);
139
-
140
- if (context && desc.initializer !== void 0) {
141
- desc.value = desc.initializer ? desc.initializer.call(context) : void 0;
142
- desc.initializer = undefined;
143
- }
144
-
145
- if (desc.initializer === void 0) {
146
- Object['define' + 'Property'](target, property, desc);
147
- desc = null;
148
- }
149
-
150
- return desc;
151
- }
152
-
153
- function _initializerWarningHelper(descriptor, context) {
154
- throw new Error('Decorating class property failed. Please ensure that transform-class-properties is enabled.');
155
- }
156
-
157
- var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
158
-
159
- var SettlementStore = (_class = function () {
160
- //type==2
161
- function SettlementStore() {
162
- var _this2 = this;
163
-
164
- (0, _classCallCheck3.default)(this, SettlementStore);
165
- this.paymode = null;
166
- this.dto = null;
167
- this.member = null;
168
- this.brefund = false;
169
- this.bquick = false;
170
- this.boriginReturn = false;
171
- this.newStyle = true;
172
-
173
- _initDefineProp(this, 'queryPwd', _descriptor, this);
174
-
175
- _initDefineProp(this, 'updateMemberInfo', _descriptor2, this);
176
-
177
- this.getCouponList = function (coupon_code) {
178
- var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
179
- PayStyle = _enumController$getEn.PayStyle,
180
- Differentiate = _enumController$getEn.Differentiate;
181
-
182
- var couponApplyRule = (0, _tplusPoslogin.PosInitData)('CouponApplyRule');
183
-
184
- var _enumController$getEn2 = _mutantsUtil.enumController.getEnumOj(),
185
- CouponApplyRule = _enumController$getEn2.CouponApplyRule;
186
-
187
- if (couponApplyRule == CouponApplyRule.SHOWN_BY_CUSTOMER && !!coupon_code || couponApplyRule != CouponApplyRule.SHOWN_BY_CUSTOMER) {
188
- var dto = _this2.dto;
189
- var promoVoucher = {};
190
- _this2.paymode.clearDjqs();
191
- _this2.paymode.reCalculationDjqs();
192
- // promoVoucher.bizDate = dto.VoucherDate;
193
- // promoVoucher.bizDate = new Date().getTime();
194
- promoVoucher.coupon_code = coupon_code || "";
195
- promoVoucher.boName = "Retail";
196
- promoVoucher.voucherId = dto.ID;
197
- var onlinePaymentAmount = 0;
198
- if (dto.OnlinePaymentAmount) {
199
- onlinePaymentAmount = dto.OnlinePaymentAmount;
200
- }
201
- promoVoucher.promoLinks = (0, _filter3.default)(_this2.paymode.currentMode.djqs, function (djq) {
202
- return djq.checked;
203
- });
204
- promoVoucher.totalAmountWithTax = Math.Minus(dto.TotalTaxAmount, onlinePaymentAmount);
205
- promoVoucher.redBlueFlagEnum = "BLUE";
206
- promoVoucher.meMemberId = dto.Idmember;
207
- promoVoucher.storeFactorId = dto.Idstore;
208
- promoVoucher.voucherDetailList = [];
209
- dto.RetailDetails.forEach(function (item) {
210
- var detailDTO = {};
211
- detailDTO.uuid = item.Code;
212
- detailDTO.detailBoName = "RetailDetail";
213
- detailDTO.voucherDetailId = item.ID;
214
- detailDTO.productId = item.Idinventory;
215
- detailDTO.uomId = item.Idunit;
216
- detailDTO.productSpecId = item.ProductSpecId;
217
- detailDTO.isManualFreeGift = item.IsPresent;
218
- detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
219
- detailDTO.IsManualChangePrice = item.IsManualChangePrice;
220
- if (detailDTO.IsManualChangePrice) //如果是手工改价
221
- {
222
- detailDTO.listPrice = item.TaxPrice;
223
- detailDTO.netAmountWithTax = item.TaxAmount;
224
- } else {
225
- var bookingQuantity = 0;
226
- if (item.BookingQuantity) {
227
- bookingQuantity = item.BookingQuantity;
228
- }
229
- detailDTO.listPrice = item.MemberPrice;
230
- detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
231
- }
232
- detailDTO.taxRate = item.TaxRate;
233
- detailDTO.quantity = item.Quantity;
234
-
235
- detailDTO.amountWithTax = item.RetailAmount;
236
- // 促销 start
237
- if (item.PromotionDetails && item.PromotionDetails.length != 0) {
238
- var promoLinks = [];
239
- item.PromotionDetails.forEach(function (promotion) {
240
- promoLinks.push({
241
- promoId: promotion.IdSalesPromotionDTO,
242
- promoRuleId: promotion.PromotionRuleId
243
- });
244
- });
245
- if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
246
- }
247
- // 促销 end
248
- promoVoucher.voucherDetailList.push(detailDTO);
249
- });
250
-
251
- return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
252
- if (result && result.length != 0) {
253
- result.forEach(function (element) {
254
- var _ref = element || {},
255
- couponCode = _ref.couponCode,
256
- name = _ref.name,
257
- tieredAmountResult = _ref.tieredAmountResult,
258
- fromDate = _ref.fromDate,
259
- dateMount = _ref.dateMount,
260
- promoMethodEnum = _ref.promoMethodEnum,
261
- discountPct = _ref.discountPct,
262
- nominalAmount = _ref.nominalAmount,
263
- promoId = _ref.promoId,
264
- id = _ref.id;
265
-
266
- var condValue = tieredAmountResult.condValue,
267
- promoDiscount = tieredAmountResult.promoDiscount,
268
- displayText = tieredAmountResult.displayText,
269
- promoRuleId = tieredAmountResult.promoRuleId,
270
- couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
271
-
272
- if (result.IsRepelWithPoints && (0, _find3.default)(_this2.paymode.thePaymodes, function (themode) {
273
- return themode.paymentType == PayStyle.jfdx;
274
- })) {
275
- _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
276
- } else {
277
- var IsEnable = couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
278
-
279
- var _ref2 = _mutantsUtil.platform || {},
280
- isNewRetailBCPos = _ref2.isNewRetailBCPos;
281
-
282
- _this2.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);
283
- }
284
- });
285
- if (promoVoucher.coupon_code) {
286
- _this2.paymode.calcDjqCheckValue(_this2.paymode.currentMode.djqs[0], _this2.dto, 'single');
287
- }
288
- } else {
289
- if (promoVoucher.coupon_code) {
290
- _message2.default.info(Differentiate.COUPON + '\u53F7\u4E0D\u5B58\u5728\uFF01');
291
- _this2.getCouponList();
292
- } else {
293
- _message2.default.info('\u6CA1\u6709\u627E\u5230\u53EF\u4F7F\u7528\u7684' + Differentiate.COUPON + '\uFF01');
294
- }
295
- }
296
- });
297
- }
298
- };
299
-
300
- this.getSettleGift = function () {
301
- return (0, _tplusApi.ccApi)({}, '/marketingtool/paygift/executeRightsForPos/' + _this2.billID, false, false, { method: 'get', timeout_skip: true });
302
- };
303
-
304
- this.checkCoupon = function () {
305
- var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(sn) {
306
- var _ref4, isNewRetailBCPos, _enumController$getEn3, PayStyle, Differentiate;
307
-
308
- return _regenerator2.default.wrap(function _callee$(_context) {
309
- while (1) {
310
- switch (_context.prev = _context.next) {
311
- case 0:
312
- _ref4 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref4.isNewRetailBCPos;
313
-
314
- if (!isNewRetailBCPos) {
315
- _context.next = 7;
316
- break;
317
- }
318
-
319
- _context.next = 4;
320
- return _this2.getCouponList(sn, 'sinlge');
321
-
322
- case 4:
323
- return _context.abrupt('return', _context.sent);
324
-
325
- case 7:
326
- _enumController$getEn3 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn3.PayStyle, Differentiate = _enumController$getEn3.Differentiate;
327
- return _context.abrupt('return', (0, _tplusApi.tApi)({ request: {
328
- Uid: _this2.paymode.currentMode.member.uid || '',
329
- SN: sn,
330
- StoreCode: _this2.dto.Idstore,
331
- Inventories: (0, _map3.default)((0, _filter3.default)(_this2.dto.RetailDetails, function (d) {
332
- return d.Quantity > 0 && !d.IsPresent;
333
- }), function (detail) {
334
- return {
335
- IdInventory: detail.Inventory.ID,
336
- IdUnit: detail.Idunit,
337
- Code: detail.Inventory.Code,
338
- FreeItem0: JSON.getCellValue(detail, "freeitem0"),
339
- FreeItem1: JSON.getCellValue(detail, "freeitem1"),
340
- FreeItem2: JSON.getCellValue(detail, "freeitem2"),
341
- FreeItem3: JSON.getCellValue(detail, "freeitem3"),
342
- FreeItem4: JSON.getCellValue(detail, "freeitem4"),
343
- FreeItem5: JSON.getCellValue(detail, "freeitem5"),
344
- FreeItem6: JSON.getCellValue(detail, "freeitem6"),
345
- FreeItem7: JSON.getCellValue(detail, "freeitem7"),
346
- FreeItem8: JSON.getCellValue(detail, "freeitem8"),
347
- FreeItem9: JSON.getCellValue(detail, "freeitem9")
348
- };
349
- }),
350
- // inventoryCodes:_join(_map(this.dto.RetailDetails,(detail)=>{return detail.Inventory.Code;}),','),
351
- InventoryClassCodes: (0, _join3.default)((0, _map3.default)((0, _filter3.default)(_this2.dto.RetailDetails, function (d) {
352
- return d.Quantity > 0;
353
- }), function (detail) {
354
- return (detail.Inventory.InventoryClass || { Code: '' }).Code;
355
- }), ','),
356
- Amount: _this2.paymode.amount
357
- } }, 'chanjet.AA.DR.coupon.CheckCoupon', false, false).then(function (result) {
358
- if ((0, _find3.default)(_this2.paymode.currentMode.djqs, function (djq) {
359
- return djq.code == result.SN;
360
- })) {
361
- _message2.default.info(Differentiate.COUPON + '\u5DF2\u6DFB\u52A0');
362
- } else if (result.IsRepelWithPoints && (0, _find3.default)(_this2.paymode.thePaymodes, function (themode) {
363
- return themode.paymentType == PayStyle.jfdx;
364
- })) {
365
- _message2.default.error(Differentiate.COUPON + '\uFF08' + result.SN + '\uFF09\u4E0D\u53EF\u4E0E\u79EF\u5206\u4E00\u8D77\u4F7F\u7528');
366
- } else {
367
- _this2.addDjq(result.SN, result.Title, result.ReduceAmount, result.StartAmount, result.LastTS, false, !result.IsRepelWithPoints, result.UMemberID);
368
- }
369
- }));
370
-
371
- case 9:
372
- case 'end':
373
- return _context.stop();
374
- }
375
- }
376
- }, _callee, _this2);
377
- }));
378
-
379
- return function (_x) {
380
- return _ref3.apply(this, arguments);
381
- };
382
- }();
383
-
384
- this.checkIntegralExchangeReturn = function (id) {
385
- return new _promise2.default(function (resolve, reject) {
386
- (0, _tplusApi.tApi)({ param: { refVoucherId: id } }, 'chanjet.RE.NewPos.GetNewIntegralExchange', false, false, { timeout_skip: true }).then(function (resp) {
387
- if (resp && resp.expireIntegral > 0) {
388
- _tplusComponentsTouch.ModalWraper.confirm({
389
- className: 'tplus-confirm-modal',
390
- title: "温馨提示",
391
- 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',
392
- cancelable: false,
393
- onOk: function onOk() {
394
- resolve(true);
395
- },
396
- onCancel: function onCancel() {
397
- reject(false);
398
- }
399
- });
400
- } else {
401
- resolve(true);
402
- }
403
- });
404
- });
405
- };
406
-
407
- this.paymode = new PayMode();
408
- var params = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
409
- if (params) this.cloudPrintArguments = params;
410
- this.newStyle = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') == 'voucher';
411
- }
412
-
413
- (0, _createClass3.default)(SettlementStore, [{
414
- key: 'initPaymodes',
415
- value: function initPaymodes(event, type, isIntegralExchange) {
416
- this.isIntegralExchange = isIntegralExchange;
417
- this.paymode.setPaymodes(type, isIntegralExchange);
418
- this.updateEvent = event;
419
- }
420
- }, {
421
- key: 'init',
422
- value: function init(context, amounthandler, datasource, storeinfo, bquick, amount, type, data) {
423
- var _this3 = this;
424
-
425
- this.newStyle = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('voucherDefaultPosMode') == 'voucher';
426
- this.type = type;
427
- if (context) {
428
- this.context = context;
429
- this.amountHandler = amounthandler;
430
- this.dataSource = datasource;
431
- this.storeInfo = storeinfo;
432
- this.dto = context.viewModel.data;
433
- (0, _mobx.runInAction)(function () {
434
- // 单品金额抹零
435
- if (global.DealSingleRowAmountSettingProcessorBlock) {
436
- global.DealSingleRowAmountSettingProcessorBlock.execute(_this3.dto);
437
- }
438
- // 成交金额抹零
439
- if (global.DealAmountSettingProcessorBlock) {
440
- global.DealAmountSettingProcessorBlock.execute(_this3.dto);
441
- }
442
- });
443
- // this.member=context.stores && context.stores.memberStore && context.stores.memberStore.member;
444
- this.member = this.dto.Member; //stores.selectMemberStore.selectMemberInfo;
445
- this.brefund = this.paymode.setAmount(this.dto.TotalTaxAmount, this.dto.OnlinePaymentAmount);
446
- } else {
447
- this.brefund = this.paymode.setAmount(amount, 0);
448
- this.dto = data;
449
- }
450
- this.paymode.clean();
451
-
452
- //this.dto.TotalTaxAmount<0;
453
- this.bquick = !!bquick;
454
- this.boriginReturn = JSON.getCellValue(this.dto, "IsOriginalReturn");
455
- if (this.boriginReturn) {
456
- this.initByOriginReturn();
457
- }
458
- if (this.newStyle) {
459
- this.setModes();
460
- }
461
- }
462
- }, {
463
- key: 'setModes',
464
- value: function setModes() {
465
- var _this4 = this;
466
-
467
- (0, _each3.default)(this.paymode.paymodes, function (p) {
468
- if ((0, _findIndex3.default)(_this4.paymode.thePaymodes, function (mode) {
469
- return p.paymentType == mode.paymentType;
470
- }) == -1) {
471
- _this4.addPay(p.paymentType);
472
- }
473
- });
474
- if (!this.boriginReturn && this.paymode.thePaymodes.length > 0) {
475
- this.changeValue(this.paymode.thePaymodes[0].paymethodId, 0, true);
476
- }
477
- }
478
- }, {
479
- key: 'amountChanged',
480
- value: function amountChanged(amount) {
481
- if (this.type == 1) {
482
- this.brefund = this.paymode.setAmount(amount, 0);
483
- }
484
- }
485
- }, {
486
- key: 'initByOriginReturn',
487
- value: function initByOriginReturn() {
488
- var _this5 = this;
489
-
490
- var _enumController$getEn4 = _mutantsUtil.enumController.getEnumOj(),
491
- PayStyle = _enumController$getEn4.PayStyle;
492
-
493
- var _ref5 = _mutantsUtil.platform || {},
494
- isNewRetailBCPos = _ref5.isNewRetailBCPos;
495
-
496
- console.log(this.dto, 'dto==========');
497
- (0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
498
- var themode = (0, _find3.default)(_this5.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
499
- if (detail.SettleStyle.Code === PayStyle.hyczk && !themode) {
500
- _tplusComponentsTouch.ModalWraper.info({
501
- title: '温馨提示',
502
- content: '没有储值结算方式,请在后台添加储值余额结算方式。',
503
- okText: '确定',
504
- okType: 'primary'
505
- });
506
- }
507
- if (themode && themode.paymentType && themode.paymentType != PayStyle.hyczk) {
508
- var newmode = (0, _extends3.default)({}, _this5.genNewMode(themode.paymentType, false, detail.Amount), {
509
- authCode: detail.PaymentCode,
510
- steadCashIntegral: detail.SteadCashIntegral,
511
- overchargesAmount: detail.OverchargesAmount,
512
- boriginReturn: true
513
- });
514
- _this5.paymode.currentMode = newmode;
515
- if (themode.paymentType == PayStyle.djq) {
516
- (0, _each3.default)(_this5.dto.RetailCouponDetails, function (djq) {
517
- if (isNewRetailBCPos) {
518
- var _ref6 = djq || {},
519
- displayText = _ref6.displayText,
520
- promoRuleId = _ref6.promoRuleId,
521
- dateMount = _ref6.dateMount,
522
- promoMethodEnum = _ref6.promoMethodEnum,
523
- discountPct = _ref6.discountPct,
524
- promoId = _ref6.promoId,
525
- id = _ref6.id;
526
-
527
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false, _this5.dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, null, id, true);
528
- return;
529
- }
530
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
531
- });
532
- }
533
- _this5.paymode.thePaymodes.push(newmode);
534
- }
535
- });
536
- (0, _each3.default)(this.dto.RetailStorageDetails, function (detail) {
537
- var balanceAmount = detail.Member.BalanceStorage;
538
- balanceAmount = balanceAmount - detail.StoragePaymentAmount;
539
- var newmode = (0, _extends3.default)({}, _this5.genNewMode(PayStyle.hyczk, false, detail.StoragePaymentAmount), {
540
- member: new Member(detail.Member),
541
- authCode: detail.Password,
542
- balance: balanceAmount,
543
- boriginReturn: true
544
- });
545
- _this5.paymode.thePaymodes.push(newmode);
546
- });
547
- this.paymode.calcReserved();
548
- }
549
- }, {
550
- key: 'clean',
551
- value: function clean() {
552
- this.bquick = false;
553
- this.paymode.clean();
554
- }
555
- }, {
556
- key: 'quickSettle',
557
- value: function quickSettle(key) {
558
- this.addPay(key);
559
- }
560
-
561
- //outer call
562
- //(type===PayStyle.hyczk || type===PayStyle.jfczk || type===PayStyle.jfdx || type===PayStyle.djq)
563
-
564
- }, {
565
- key: 'changeFocusAndAddPay',
566
- value: function changeFocusAndAddPay(type) {
567
- var _this6 = this;
568
-
569
- var _enumController$getEn5 = _mutantsUtil.enumController.getEnumOj(),
570
- PayStyle = _enumController$getEn5.PayStyle;
571
-
572
- this.paymode.currentFocus = type;
573
- if (this.paymode.currentMode) {
574
- if (type == PayStyle.jfdx) {
575
- if (this.newStyle) {
576
- var index = (0, _findIndex3.default)(this.paymode.thePaymodes, function (m) {
577
- return m.paymentType == PayStyle.jfdx;
578
- });
579
- this.paymode.thePaymodes.splice(index, 1, this.paymode.currentMode);
580
- this.paymode.calcReserved();
581
- } else {
582
- this.addPayDirectly(this.paymode.currentMode);
583
- }
584
-
585
- //抵现积分
586
- (0, _tplusApi.tApi)({ IntegralSteadCashParams: {
587
- Idmember: this.paymode.currentMode.member.id,
588
- TotalTaxAmount: this.paymode.amount,
589
- BalanceTaxAmount: this.paymode.currentMode.value
590
- } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
591
- _this6.paymode.currentMode.steadCashIntegral = result.Integral;
592
- _this6.paymode.currentMode.overchargesAmount = result.Amount - _this6.paymode.currentMode.value;
593
- });
594
- } else {
595
- this.addPayDirectly(this.paymode.currentMode);
596
- }
597
- } else {
598
- this.addPay(type);
599
- }
600
- }
601
-
602
- // 设置密码后更新会员信息
603
-
604
- }, {
605
- key: 'getLoginInfo',
606
- value: function getLoginInfo() {
607
- var _ref7 = _mutantsMicrofx.localStore.get('user') || {},
608
- _ref7$loginInfo = _ref7.loginInfo,
609
- loginInfo = _ref7$loginInfo === undefined ? {} : _ref7$loginInfo;
610
-
611
- return loginInfo;
612
- }
613
- }, {
614
- key: 'loadCzk',
615
- value: function loadCzk(v) {
616
- var _this7 = this;
617
-
618
- if ((0, _trim3.default)(v) === "") {
619
- (0, _mobx.runInAction)(function () {
620
- _this7.paymode.currentMode.member = new Member(null);
621
- _this7.paymode.currentMode.errinfo = "请输入储值卡";
622
- });
623
- return;
624
- }
625
- var IdStore = this.storeInfo.storeID;
626
- var StoreCode = this.storeInfo.storeCode; //_find(this.storeInfo.storeInfos,(store)=>{return store.ID==IdStore;}).Code;
627
-
628
- var _ref8 = _mutantsUtil.platform || {},
629
- isNewRetailBCPos = _ref8.isNewRetailBCPos;
630
-
631
- var address = '';
632
- if (isNewRetailBCPos) {
633
- // address = '/member/memberProfile/FindByStorageCode/'+v;
634
- address = '/member/MeMemberWallet/FindByStorageCode';
635
- return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function (result) {
636
- var data = result.data;
637
- var m = data;
638
-
639
- var _ref9 = _mutantsUtil.platform || {},
640
- isNewRetailBCPos = _ref9.isNewRetailBCPos;
641
-
642
- if (isNewRetailBCPos) {
643
- _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
644
- _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
645
- _this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
646
- _this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
647
- }
648
- if (!m || !m.ID) {
649
- (0, _mobx.runInAction)(function () {
650
- _this7.paymode.currentMode.errinfo = "无效的会员卡号";
651
- });
652
- } else {
653
- (0, _mobx.runInAction)(function () {
654
- _this7.paymode.currentMode.errinfo = "";
655
- _this7.paymode.currentMode.member = new Member(m);
656
- _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
657
- _this7.updateEvent();
658
- var message = '';
659
- if (global.CheckMemberStorageProcessorBlock) {
660
- message = CheckMemberStorageProcessorBlock.execute(m);
661
- }
662
- if (!String.isNullOrEmpty(message)) {
663
- _this7.paymode.currentMode.errinfo = message;
664
- } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
665
- _this7.paymode.currentMode.errinfo = "余额不足";
666
- } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
667
- _this7.paymode.currentMode.errinfo = "实收金额必须录入";
668
- } else {
669
- // 查询成功后将焦点移入下一个输入框
670
- var nextInput = document.querySelector('.czk .received .input');
671
- nextInput && nextInput.select();
672
- }
673
- });
674
- }
675
- });
676
- } else {
677
- address = 'AA.DR.newRetailMember.SearchMember';
678
- return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, address, false, false).then(function (result) {
679
- var data = JSON.parse(result.Data);
680
- var m = data && data.length > 0 && data[0];
681
-
682
- var _ref10 = _mutantsUtil.platform || {},
683
- isNewRetailBCPos = _ref10.isNewRetailBCPos;
684
-
685
- if (isNewRetailBCPos) {
686
- _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
687
- _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
688
- _this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
689
- _this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
690
- }
691
- if (!m || !m.ID) {
692
- (0, _mobx.runInAction)(function () {
693
- _this7.paymode.currentMode.errinfo = "无效的会员卡号";
694
- });
695
- } else {
696
- (0, _mobx.runInAction)(function () {
697
- _this7.paymode.currentMode.errinfo = "";
698
- _this7.paymode.currentMode.member = new Member(m);
699
- _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
700
- _this7.updateEvent();
701
- var message = '';
702
- if (global.CheckMemberStorageProcessorBlock) {
703
- message = CheckMemberStorageProcessorBlock.execute(data[0]);
704
- }
705
- if (!String.isNullOrEmpty(message)) {
706
- _this7.paymode.currentMode.errinfo = message;
707
- } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
708
- _this7.paymode.currentMode.errinfo = "余额不足";
709
- } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
710
- _this7.paymode.currentMode.errinfo = "实收金额必须录入";
711
- } else {
712
- // 查询成功后将焦点移入下一个输入框
713
- var nextInput = document.querySelector('.czk .received .input');
714
- nextInput && nextInput.focus();
715
- }
716
- });
717
- }
718
- });
719
- }
720
- }
721
- }, {
722
- key: 'addDjq',
723
- value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
724
- var djq = {
725
- code: promoCouponCode,
726
- promoCouponCode: promoCouponCode,
727
- name: name,
728
- IsEnable: IsEnable,
729
- amount: amount,
730
- doorsill: doorsill, //:"无门槛"
731
- LastTS: LastTS,
732
- checked: checked,
733
- IsRepelWithPoints: IsRepelWithPoints,
734
- UMemberID: UMemberID,
735
- expired: expired, //还剩多少过期
736
- displayText: displayText,
737
- promoMethodEnum: promoMethodEnum,
738
- discountPct: discountPct,
739
- promoId: promoId,
740
- promoRuleId: promoRuleId,
741
- couponCategoryEnum: couponCategoryEnum,
742
- id: id,
743
- count: count === 1 && (couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT') ? 1 : null
744
- };
745
- this.paymode.currentMode.djqs.push(djq);
746
- // let copyData = _clonedeep(this.data[targetIndex]);
747
- !unCheck && !this.boriginReturn && this.paymode.calcDjqValue(djq);
748
- }
749
- }, {
750
- key: 'setCurrentMode',
751
- value: function setCurrentMode(id, type, append) {
752
- var _enumController$getEn6 = _mutantsUtil.enumController.getEnumOj(),
753
- PayStyle = _enumController$getEn6.PayStyle;
754
-
755
- var mode = (0, _find3.default)(this.paymode.thePaymodes, { paymethodId: id });
756
- if (mode) {
757
- this.paymode.currentMode = mode;
758
- if (this.newStyle) {
759
- this.afterSetCurrentMode(type);
760
- }
761
- } else {
762
- this.paymode.currentMode = this.genNewMode(type, append);
763
- this.afterSetCurrentMode(type);
764
- }
765
- }
766
- }, {
767
- key: 'afterSetCurrentMode',
768
- value: function afterSetCurrentMode(type) {
769
- var _this8 = this;
770
-
771
- var _enumController$getEn7 = _mutantsUtil.enumController.getEnumOj(),
772
- PayStyle = _enumController$getEn7.PayStyle;
773
-
774
- if (type == PayStyle.djq) {
775
- this.paymode.calcDjqValue();
776
- } else if (type == PayStyle.jfdx) {
777
- //获取可兑换的金额
778
- if (this.newStyle) {
779
- var themode = (0, _find3.default)(this.paymode.thePaymodes, { paymentType: PayStyle.jfdx });
780
- if (themode && parseFloat(themode.value || 0) != 0) {
781
- this.paymode.currentMode.value = themode.value;
782
- }
783
- }
784
-
785
- (0, _tplusApi.tApi)({ IntegralSteadCashParams: {
786
- Idmember: this.paymode.currentMode.member.id,
787
- TotalTaxAmount: this.paymode.amount,
788
- BalanceTaxAmount: this.paymode.amount
789
- } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
790
- _this8.paymode.currentMode.member.setExchangable(result.MaxAmount);
791
- _this8.updateEvent();
792
- if (_this8.checkReceived(_this8.paymode.currentMode, "exchangable")) {
793
- (0, _mobx.runInAction)(function () {
794
- _this8.paymode.currentMode.errinfo = '余额不足';
795
- });
796
- }
797
- });
798
- }
799
- }
800
- }, {
801
- key: 'checkReceived',
802
- value: function checkReceived(mode, name) {
803
- return !this.brefund && parseFloat(mode.value) > parseFloat(mode.maxamount || mode.member[name] || 0);
804
- }
805
- }, {
806
- key: 'genNewMode',
807
- value: function genNewMode(type, notwithm, v) {
808
- var _enumController$getEn8 = _mutantsUtil.enumController.getEnumOj(),
809
- PayStyle = _enumController$getEn8.PayStyle;
810
-
811
- var value = (0, _utils.getFixedNumber)(v || (this.brefund ? this.paymode.receivable : Math.max(this.paymode.receivable, 0)));
812
- var themode = (0, _find3.default)(this.paymode.paymodes, { 'paymentType': type });
813
- var mode = (0, _mobx.observable)({
814
- paymethodId: this.paymode.counter,
815
- name: themode.name,
816
- exchangeRate: themode.exchangeRate,
817
- calDirection: themode.calDirection,
818
- value: value,
819
- value2: (0, _utils.getFixedNumber)(themode.calDirection == "88" ? value / themode.exchangeRate : value * themode.exchangeRate),
820
- value3: value,
821
- order: this.paymode.thePaymodes.length + 1,
822
- paymentType: type,
823
- djqs: [],
824
- member: new Member(!notwithm ? this.member : null),
825
- authCode: '',
826
- steadCashIntegral: null,
827
- errinfo: '',
828
- maxamount: this.paymode.amount
829
- });
830
- if (type == PayStyle.hyczk) {
831
- if (!mode.member.id) {
832
- (0, _mobx.runInAction)(function () {
833
- mode.errinfo = '未录入储值卡';
834
- });
835
- } else if (this.checkReceived(mode, "balance")) {
836
- (0, _mobx.runInAction)(function () {
837
- mode.errinfo = '余额不足';
838
- });
839
- }
840
- }
841
- if (type == PayStyle.hyczk || type == PayStyle.jfdx || type == PayStyle.djq) {
842
- this.setMaxAmount(type, mode);
843
- }
844
- console.log(mode);
845
- return mode;
846
- }
847
- }, {
848
- key: 'setMaxAmount',
849
- value: function setMaxAmount(type, mode) {
850
- var _this9 = this;
851
-
852
- var _enumController$getEn9 = _mutantsUtil.enumController.getEnumOj(),
853
- PayStyle = _enumController$getEn9.PayStyle;
854
-
855
- var sum = 0;
856
- if (type == PayStyle.hyczk) {
857
- (0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
858
- return m.paymentType == type;
859
- }), function (q) {
860
- sum = Math.Add(sum, q.value);
861
- });
862
- } else if (type == PayStyle.djq || type == PayStyle.jfdx) {
863
- (0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
864
- return m.paymentType == PayStyle.djq || m.paymentType == PayStyle.jfdx;
865
- }), function (q) {
866
- sum = Math.Add(sum, q.value);
867
- });
868
- }
869
-
870
- this.amountHandler && this.amountHandler(type).then(function () {
871
- (0, _mobx.runInAction)(function () {
872
- mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(_this9.context.viewModel.getViewItem('Voucher').availableAmount, sum));
873
- _this9.updateEvent();
874
- });
875
- });
876
- }
877
- }, {
878
- key: 'changeFocusOnly',
879
- value: function changeFocusOnly(type) {
880
- this.paymode.currentFocus = type;
881
- // 获取焦点时带入剩余的值
882
- // let mode=_find(this.paymode.thePaymodes,{'paymentType':type});
883
- // if(mode && this.isIntegralExchange){
884
- // const shouldSetValue =getFixedNumber(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
885
- // mode.value = shouldSetValue;
886
- // mode.value2 = getFixedNumber(mode.calDirection=="88"?shouldSetValue / mode.exchangeRate:(shouldSetValue * mode.exchangeRate));
887
- // mode.value3 = shouldSetValue;
888
- // this.paymode.calcReserved();
889
- // }
890
- }
891
- }, {
892
- key: 'changeClickFocusOnly',
893
- value: function changeClickFocusOnly(type) {
894
- this.paymode.currentFocus = type;
895
- // 获取焦点时带入剩余的值
896
- var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymentType': type });
897
- if (mode) {
898
- var shouldSetValue = (0, _utils.getFixedNumber)(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
899
- mode.value = shouldSetValue;
900
- mode.value2 = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? shouldSetValue / mode.exchangeRate : shouldSetValue * mode.exchangeRate);
901
- mode.value3 = shouldSetValue;
902
- this.paymode.calcReserved();
903
- }
904
- }
905
- }, {
906
- key: 'changeValue',
907
- value: function changeValue(index, value, blur) {
908
- var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
909
- var v = blur ? (0, _utils.getFixedNumber)(value) : isNaN(value) && value != '-' ? 0.00 : value;
910
- if (mode) {
911
- if (mode.exchangeRate != 1) {
912
- if ((0, _utils.getFixedNumber)(mode.calDirection == "88" ? mode.value3 / mode.exchangeRate : mode.value3 * mode.exchangeRate) != v) {
913
- mode.value = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? v * mode.exchangeRate : v / mode.exchangeRate);
914
- } else {
915
- mode.value = mode.value3;
916
- }
917
- mode.value2 = v;
918
- } else {
919
- mode.value = v;
920
- mode.value2 = v;
921
- }
922
-
923
- this.paymode.calcReserved();
924
- }
925
- }
926
- }, {
927
- key: 'addPayDirectly',
928
- value: function addPayDirectly(pay) {
929
- var _enumController$getEn10 = _mutantsUtil.enumController.getEnumOj(),
930
- PayStyle = _enumController$getEn10.PayStyle;
931
-
932
- if (!(0, _find3.default)(this.paymode.thePaymodes, { paymethodId: pay.paymethodId })) {
933
- var pos = this.paymode.thePaymodes.length;
934
- if (pay.paymentType == PayStyle.hyczk) {
935
- var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
936
- return m.paymethodId != pay.paymethodId && m.paymentType == PayStyle.hyczk;
937
- });
938
- pos = index == -1 ? pos : index + 1;
939
- }
940
- // this.paymode.thePaymodes.push(pay);
941
- this.paymode.thePaymodes.splice(pos, 0, pay);
942
- }
943
- this.paymode.calcReserved();
944
- }
945
- }, {
946
- key: 'addPay',
947
- value: function addPay(type) {
948
- var _enumController$getEn11 = _mutantsUtil.enumController.getEnumOj(),
949
- PayStyle = _enumController$getEn11.PayStyle;
950
-
951
- var pos = this.paymode.thePaymodes.length;
952
- if (type == PayStyle.hyczk) {
953
- var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
954
- return m.paymentType == PayStyle.hyczk;
955
- });
956
- pos = index == -1 ? pos : index + 1;
957
- }
958
- // this.paymode.thePaymodes.push(this.genNewMode(type) );
959
- this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk));
960
- this.paymode.calcReserved();
961
- }
962
- }, {
963
- key: 'delPay',
964
- value: function delPay(index) {
965
- var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
966
- PayStyle = _enumController$getEn12.PayStyle;
967
-
968
- (0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
969
- return mode.paymethodId === index;
970
- });
971
- this.paymode.currentFocus = -1;
972
- this.paymode.calcReserved();
973
- }
974
- }, {
975
- key: 'commit',
976
- value: function () {
977
- var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
978
- var _ref12, isNewRetailBCPos;
979
-
980
- return _regenerator2.default.wrap(function _callee2$(_context2) {
981
- while (1) {
982
- switch (_context2.prev = _context2.next) {
983
- case 0:
984
- console.log('settlementStore.commit开始,参数:' + bTest);
985
-
986
- if (!bTest) {
987
- _context2.next = 3;
988
- break;
989
- }
990
-
991
- return _context2.abrupt('return', _promise2.default.resolve(true));
992
-
993
- case 3:
994
- _ref12 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref12.isNewRetailBCPos;
995
- _context2.prev = 4;
996
-
997
- if (!(this.type == 1)) {
998
- _context2.next = 10;
999
- break;
1000
- }
1001
-
1002
- _context2.next = 8;
1003
- return this.saveMember();
1004
-
1005
- case 8:
1006
- _context2.next = 18;
1007
- break;
1008
-
1009
- case 10:
1010
- if (!isNewRetailBCPos) {
1011
- _context2.next = 13;
1012
- break;
1013
- }
1014
-
1015
- _context2.next = 13;
1016
- return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
1017
-
1018
- case 13:
1019
- _context2.next = 15;
1020
- return this.save();
1021
-
1022
- case 15:
1023
- if (!isNewRetailBCPos) {
1024
- _context2.next = 18;
1025
- break;
1026
- }
1027
-
1028
- _context2.next = 18;
1029
- return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
1030
-
1031
- case 18:
1032
- return _context2.abrupt('return', _promise2.default.resolve(true));
1033
-
1034
- case 21:
1035
- _context2.prev = 21;
1036
- _context2.t0 = _context2['catch'](4);
1037
-
1038
- console.error('settlementStore.commit失败,错误信息:' + _context2.t0);
1039
- return _context2.abrupt('return', _promise2.default.resolve(_context2.t0));
1040
-
1041
- case 25:
1042
- case 'end':
1043
- return _context2.stop();
1044
- }
1045
- }
1046
- }, _callee2, this, [[4, 21]]);
1047
- }));
1048
-
1049
- function commit(_x2) {
1050
- return _ref11.apply(this, arguments);
1051
- }
1052
-
1053
- return commit;
1054
- }()
1055
- }, {
1056
- key: 'handlePrint',
1057
- value: function handlePrint(resp) {
1058
- // 储值打印
1059
- return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp, {});
1060
- }
1061
- }, {
1062
- key: 'saveMember',
1063
- value: function saveMember() {
1064
- var _this10 = this;
1065
-
1066
- var _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(),
1067
- PayStyle = _enumController$getEn13.PayStyle;
1068
-
1069
- (0, _mobx.runInAction)(function () {
1070
- _this10.dto.StorageMutiSettleDetails = [];
1071
- var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1072
- return parseFloat(mode.value) != 0;
1073
- }) : _this10.paymode.thePaymodes;
1074
- (0, _each3.default)(thePaymodes, function (mode) {
1075
- var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1076
-
1077
- var value = parseFloat(mode.value);
1078
- var giveChange = null;
1079
- if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1080
- value = Math.Add(value, _this10.paymode.receivable);
1081
- giveChange = Math.abs(_this10.paymode.receivable);
1082
- }
1083
- _this10.dto.StorageMutiSettleDetails.push({
1084
- Code: mode.paymethodId,
1085
- StorageAmount: value,
1086
- GiveChange: giveChange,
1087
- IdsettleStyle: themode.idSettleStyle,
1088
- IdbankAccount: themode.idBankAccount,
1089
- PaymentCode: mode.authCode,
1090
- DynamicPropertyKeys: [],
1091
- DynamicPropertyValues: [],
1092
- DataSource: { Id: _this10.dataSource }
1093
- });
1094
- });
1095
- });
1096
- // cc结算调用
1097
- var IPMSG = {};
1098
- if (!!window.localStorage.IPMSG) {
1099
- IPMSG = JSON.parse(window.localStorage.IPMSG);
1100
- }
1101
- return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1102
- _this10.handlePrint(resp);
1103
- });
1104
- }
1105
- }, {
1106
- key: 'save',
1107
- value: function () {
1108
- var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
1109
- var _this11 = this;
1110
-
1111
- var _enumController$getEn14, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum;
1112
-
1113
- return _regenerator2.default.wrap(function _callee3$(_context3) {
1114
- while (1) {
1115
- switch (_context3.prev = _context3.next) {
1116
- case 0:
1117
- _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn14.PayStyle;
1118
-
1119
- (0, _mobx.runInAction)(function () {
1120
- _this11.dto.RetailPaymentDetails = [];
1121
- _this11.dto.RetailStorageDetails = [];
1122
- _this11.dto.RetailCouponDetails = [];
1123
- var czkSum = 0;
1124
- var Idmember = _this11.dto.Idmember;
1125
- var count = 0;
1126
- var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1127
- return parseFloat(mode.value) != 0;
1128
- }) : _this11.paymode.thePaymodes;
1129
- (0, _each3.default)(thePaymodes, function (mode, index) {
1130
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1131
- if (mode.paymentType == PayStyle.hyczk) {
1132
- if (!Idmember) {
1133
- Idmember = mode.member.id;
1134
- }
1135
- czkSum = Math.Add(czkSum, mode.value);
1136
- var MeStorageCardId = mode.member.MeStorageCardId ? mode.member.MeStorageCardId : _this11.member.MeStorageCardId;
1137
- _this11.dto.RetailStorageDetails.push({
1138
- Code: mode.paymethodId,
1139
- MeStorageCardId: MeStorageCardId,
1140
- StoragePaymentAmount: mode.value,
1141
- IsOrigReturn: false,
1142
- BalanceStorage: mode.balance,
1143
- Idmember: mode.member.id,
1144
- DynamicPropertyKeys: [],
1145
- DynamicPropertyValues: [],
1146
- DataSource: { Id: _this11.dataSource },
1147
- Password: mode.authCode
1148
- });
1149
- } else {
1150
- var value = parseFloat(mode.value);
1151
- var giveChange = null;
1152
- if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1153
- value = Math.Add(value, _this11.paymode.receivable);
1154
- giveChange = Math.abs(_this11.paymode.receivable);
1155
- }
1156
- _this11.dto.RetailPaymentDetails.push({
1157
- Code: mode.paymethodId,
1158
- OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
1159
- Amount: value,
1160
- GiveChange: giveChange,
1161
- IdsettleStyle: themode.idSettleStyle,
1162
- IdbankAccount: themode.idBankAccount,
1163
- Idcurrency: themode.idCurrency,
1164
- ExchangeRate: themode.exchangeRate,
1165
- PaymentCode: mode.authCode,
1166
- SteadCashIntegral: mode.steadCashIntegral,
1167
- OverchargesAmount: mode.overchargesAmount,
1168
- DynamicPropertyKeys: [],
1169
- DynamicPropertyValues: [],
1170
- DataSource: { Id: _this11.dataSource }
1171
- });
1172
- if (mode.paymentType == PayStyle.djq) {
1173
- (0, _each3.default)(_this11.paymode.checkList && _this11.paymode.checkList.length ? _this11.paymode.checkList : _this11.paymode.currentMode.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.member.id : 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
-
1191
- var _ref14 = _mutantsUtil.platform || {},
1192
- isNewRetailBCPos = _ref14.isNewRetailBCPos;
1193
-
1194
- if (_this11.dto.RetailStorageDetails.length > 0) {
1195
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1196
- if (isNewRetailBCPos) {
1197
- // this.dto.RetailStorageDetails && this.dto.RetailStorageDetails.forEach((value, index) => {
1198
- // value.MeStorageCardId = (mode.MeStorageCardId ? mode.MeStorageCardId : this.member.MeStorageCardId);
1199
- // })
1200
- _this11.dto.RetailPaymentDetails.push({
1201
- Code: _this11.paymode.counter,
1202
- OrigAmount: czkSum,
1203
- Amount: czkSum,
1204
- IdsettleStyle: themode.idSettleStyle,
1205
- IdbankAccount: themode.idBankAccount,
1206
- DynamicPropertyKeys: [],
1207
- DynamicPropertyValues: [],
1208
- DataSource: { Id: _this11.dataSource },
1209
- RetailStorageDetails: _this11.dto.RetailStorageDetails
1210
- });
1211
- } else {
1212
- _this11.dto.RetailPaymentDetails.push({
1213
- Code: _this11.paymode.counter,
1214
- OrigAmount: czkSum,
1215
- Amount: czkSum,
1216
- IdsettleStyle: themode.idSettleStyle,
1217
- IdbankAccount: themode.idBankAccount,
1218
- DynamicPropertyKeys: [],
1219
- DynamicPropertyValues: [],
1220
- DataSource: { Id: _this11.dataSource }
1221
- });
1222
- }
1223
- _this11.dto.Idmember = Idmember;
1224
- }
1225
- });
1226
- _ref15 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref15.isNewRetailBCPos;
1227
-
1228
- console.log('bc_pos\u73AF\u5883:' + isNewRetailBCPos + ',\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1229
-
1230
- if (!isNewRetailBCPos) {
1231
- _context3.next = 20;
1232
- break;
1233
- }
1234
-
1235
- // cc结算调用
1236
- IPMSG = {};
1237
-
1238
- if (!!window.localStorage.IPMSG) {
1239
- IPMSG = JSON.parse(window.localStorage.IPMSG);
1240
- }
1241
- RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1242
- _context3.t1 = this.dto.IdbusiType == 37;
1243
-
1244
- if (!_context3.t1) {
1245
- _context3.next = 13;
1246
- break;
1247
- }
1248
-
1249
- _context3.next = 12;
1250
- return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1251
-
1252
- case 12:
1253
- _context3.t1 = _context3.sent;
1254
-
1255
- case 13:
1256
- _context3.t0 = _context3.t1;
1257
-
1258
- if (_context3.t0) {
1259
- _context3.next = 16;
1260
- break;
1261
- }
1262
-
1263
- _context3.t0 = this.dto.IdbusiType != 37;
1264
-
1265
- case 16:
1266
- if (!_context3.t0) {
1267
- _context3.next = 18;
1268
- break;
1269
- }
1270
-
1271
- return _context3.abrupt('return', (0, _tplusApi.ccApi)({ dto: (0, _extends3.default)({}, this.dto.cut(), { RetailOms: { RetailTypeEnum: RetailTypeEnum } }), cip: IPMSG.query || "" }, '/retail/RetailPos/settle', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1272
- _this11.setDtoID(resp.ID);
1273
- _this11.billID = resp.ID;
1274
- }));
1275
-
1276
- case 18:
1277
- _context3.next = 21;
1278
- break;
1279
-
1280
- case 20:
1281
- return _context3.abrupt('return', (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
1282
- _this11.setDtoID(resp.ID);
1283
- _this11.billID = resp.ID;
1284
- }));
1285
-
1286
- case 21:
1287
- case 'end':
1288
- return _context3.stop();
1289
- }
1290
- }
1291
- }, _callee3, this);
1292
- }));
1293
-
1294
- function save() {
1295
- return _ref13.apply(this, arguments);
1296
- }
1297
-
1298
- return save;
1299
- }()
1300
- }, {
1301
- key: 'setDtoID',
1302
- value: function setDtoID(id) {
1303
- this.context.viewModel.data.ID = id;
1304
- }
1305
- }, {
1306
- key: 'querySettleResult',
1307
- value: function () {
1308
- var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1309
- return _regenerator2.default.wrap(function _callee4$(_context4) {
1310
- while (1) {
1311
- switch (_context4.prev = _context4.next) {
1312
- case 0:
1313
- _context4.prev = 0;
1314
- _context4.t0 = _promise2.default;
1315
- _context4.next = 4;
1316
- return (0, _tplusApi.tApi)({ RetailCode: this.dto.Code }, 'chanjet.RE.newRetail.QuerySettleResult', false, false, { timeout_skip: true });
1317
-
1318
- case 4:
1319
- _context4.t1 = _context4.sent;
1320
- return _context4.abrupt('return', _context4.t0.resolve.call(_context4.t0, _context4.t1));
1321
-
1322
- case 8:
1323
- _context4.prev = 8;
1324
- _context4.t2 = _context4['catch'](0);
1325
- return _context4.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1326
-
1327
- case 11:
1328
- case 'end':
1329
- return _context4.stop();
1330
- }
1331
- }
1332
- }, _callee4, this, [[0, 8]]);
1333
- }));
1334
-
1335
- function querySettleResult() {
1336
- return _ref16.apply(this, arguments);
1337
- }
1338
-
1339
- return querySettleResult;
1340
- }()
1341
- }, {
1342
- key: 'setCookie',
1343
- value: function setCookie(key, val) {
1344
- var exp = new Date();
1345
- exp.setTime((0, _moment2.default)().endOf('day').valueOf());
1346
- document.cookie = key + '=' + val + ';expires=' + exp.toGMTString();
1347
- }
1348
- }, {
1349
- key: 'getAllCookies',
1350
- value: function getAllCookies() {
1351
- var cookies = document.cookie.split(/;\s/g);
1352
- var cookieObj = {};
1353
- cookies.forEach(function (item) {
1354
- var key = item.split('=')[0];
1355
- cookieObj[key] = item.split('=')[1];
1356
- });
1357
- return cookieObj;
1358
- }
1359
- }, {
1360
- key: 'validePwd',
1361
- value: function () {
1362
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(value) {
1363
- var _ref18, isNewRetailBCPos, cook1, cook2, message, result, count, _result;
1364
-
1365
- return _regenerator2.default.wrap(function _callee5$(_context5) {
1366
- while (1) {
1367
- switch (_context5.prev = _context5.next) {
1368
- case 0:
1369
- _ref18 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref18.isNewRetailBCPos;
1370
- _context5.prev = 1;
1371
-
1372
- if (!isNewRetailBCPos) {
1373
- _context5.next = 18;
1374
- break;
1375
- }
1376
-
1377
- cook1 = this.getAllCookies()['errorPwd'];
1378
- cook2 = cook1 && JSON.parse(cook1);
1379
- message = '密码输入错误';
1380
-
1381
- if (!cook2) {
1382
- _context5.next = 11;
1383
- break;
1384
- }
1385
-
1386
- if (!cook2.hasOwnProperty(this.member.MeStorageCardId + "")) {
1387
- _context5.next = 11;
1388
- break;
1389
- }
1390
-
1391
- if (!(cook2[this.member.MeStorageCardId] > 3)) {
1392
- _context5.next = 11;
1393
- break;
1394
- }
1395
-
1396
- message = '今日密码错误已达上限,不可使用储值消费,请明日再试,如忘记请重置密码或修改密码。';
1397
- return _context5.abrupt('return', _promise2.default.resolve(message));
1398
-
1399
- case 11:
1400
- _context5.next = 13;
1401
- return (0, _tplusApi.ccApi)({ password: _tplusApi.User.pwdEncrypt(value.pwd) }, '/member/MeMemberWallet/checkPaymentPassword/' + value.id, false, false);
1402
-
1403
- case 13:
1404
- result = _context5.sent;
1405
-
1406
- if (!result.data) {
1407
- if (cook2) {
1408
- if (cook2.hasOwnProperty(this.member.MeStorageCardId + "")) {
1409
- count = cook2[this.member.MeStorageCardId];
1410
-
1411
- cook2[this.member.MeStorageCardId] = count + 1;
1412
- } else {
1413
- cook2[this.member.MeStorageCardId] = 1;
1414
- }
1415
- } else {
1416
- cook2 = {};
1417
- cook2[this.member.MeStorageCardId] = 1;
1418
- }
1419
- this.setCookie('errorPwd', '', -1);
1420
- this.setCookie('errorPwd', (0, _stringify2.default)(cook2));
1421
- }
1422
- return _context5.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1423
-
1424
- case 18:
1425
- _context5.next = 20;
1426
- return (0, _tplusApi.tApi)({ "CheckoutParams": {
1427
- "Idmember": value.id,
1428
- "Password": value.pwd
1429
- } }, 'AA.DR.newRetailMember.CheckoutMemberPassword', false, false);
1430
-
1431
- case 20:
1432
- _result = _context5.sent;
1433
- return _context5.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1434
-
1435
- case 22:
1436
- _context5.next = 27;
1437
- break;
1438
-
1439
- case 24:
1440
- _context5.prev = 24;
1441
- _context5.t0 = _context5['catch'](1);
1442
- return _context5.abrupt('return', "failed");
1443
-
1444
- case 27:
1445
- case 'end':
1446
- return _context5.stop();
1447
- }
1448
- }
1449
- }, _callee5, this, [[1, 24]]);
1450
- }));
1451
-
1452
- function validePwd(_x3) {
1453
- return _ref17.apply(this, arguments);
1454
- }
1455
-
1456
- return validePwd;
1457
- }()
1458
- }]);
1459
- return SettlementStore;
1460
- }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
1461
- enumerable: true,
1462
- initializer: function initializer() {
1463
- var _this12 = this;
1464
-
1465
- return function (newPass, newPassConfirm) {
1466
- if (!newPass || !newPassConfirm) {
1467
- return _message2.default.warn('您还有未填写项');
1468
- }
1469
- if (newPass !== newPassConfirm) {
1470
- return _message2.default.warn('您两次输入的密码不一致');
1471
- }
1472
- var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
1473
- return (0, _tplusApi.ccApi)({
1474
- Idstore: idstore,
1475
- meMemberId: _this12.member.ID,
1476
- oldPassword: null,
1477
- newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
1478
- dataSource: "POS"
1479
- }, '/member/MeMemberWallet/setWalletPayPassword', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1480
- if (resp.successful) {
1481
- return true;
1482
- }
1483
- });
1484
- };
1485
- }
1486
- }), _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), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, 'updateMemberInfo', [_mobx.action], {
1487
- enumerable: true,
1488
- initializer: function initializer() {
1489
- var _this13 = this;
1490
-
1491
- return function () {
1492
- var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_this) {
1493
- var _getLoginInfo, IdStore, StoreCode, resp;
1494
-
1495
- return _regenerator2.default.wrap(function _callee6$(_context6) {
1496
- while (1) {
1497
- switch (_context6.prev = _context6.next) {
1498
- case 0:
1499
- _getLoginInfo = _this13.getLoginInfo(), IdStore = _getLoginInfo.IdStore, StoreCode = _getLoginInfo.StoreCode;
1500
- _context6.next = 3;
1501
- return (0, _tplusApi.tApi)({ Idmember: _this13.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
1502
-
1503
- case 3:
1504
- resp = _context6.sent;
1505
-
1506
- _this.member = resp;
1507
- _this.paymode.currentMode.member.setStorageCardNo(resp.StorageCardNo);
1508
- return _context6.abrupt('return', _promise2.default.resolve(resp));
1509
-
1510
- case 7:
1511
- case 'end':
1512
- return _context6.stop();
1513
- }
1514
- }
1515
- }, _callee6, _this13);
1516
- }));
1517
-
1518
- return function (_x4) {
1519
- return _ref19.apply(this, arguments);
1520
- };
1521
- }();
1522
- }
1523
- }), _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);
1524
- exports.default = SettlementStore;
1525
- var PayMode = exports.PayMode = (_class3 = function () {
1526
- //应收
1527
- function PayMode() {
1528
- // this.amount=getFixedNumber(amount);
1529
- // this.calcReserved();
1530
-
1531
- (0, _classCallCheck3.default)(this, PayMode);
1532
- this._counter = 0;
1533
- this.amount = 0;
1534
- this.onlineamount = 0;
1535
- this.maxamount = 0;
1536
-
1537
- _initDefineProp(this, 'currentFocus', _descriptor3, this);
1538
-
1539
- _initDefineProp(this, 'received', _descriptor4, this);
1540
-
1541
- _initDefineProp(this, 'receivable', _descriptor5, this);
1542
-
1543
- _initDefineProp(this, 'paymodes', _descriptor6, this);
1544
-
1545
- _initDefineProp(this, 'thePaymodes', _descriptor7, this);
1546
-
1547
- this.currentMode = null;
1548
- this.checkList = [];
1549
- this.settle = {
1550
- name: "复合结算",
1551
- hotKey: "Ctrl+M"
1552
- };
1553
-
1554
- _initDefineProp(this, 'calcCheckList', _descriptor8, this);
1555
-
1556
- _initDefineProp(this, 'setCouponNum', _descriptor9, this);
1557
-
1558
- _initDefineProp(this, 'addDjqs', _descriptor10, this);
1559
- }
1560
- // @observable store = null;
1561
-
1562
-
1563
- (0, _createClass3.default)(PayMode, [{
1564
- key: 'clean',
1565
- value: function clean() {
1566
- this.thePaymodes = [];
1567
- this.calcReserved();
1568
- }
1569
- }, {
1570
- key: 'clear',
1571
- value: function clear() {
1572
- this.thePaymodes = [];
1573
- this.calcReserved();
1574
- this.paymodes = [];
1575
- }
1576
- }, {
1577
- key: 'setAmount',
1578
- value: function setAmount(a, o) {
1579
- this.amount = (0, _utils.getFixedNumber)((a || 0) - (o || 0));
1580
- this.onlineamount = (0, _utils.getFixedNumber)(o || 0);
1581
- this.calcReserved();
1582
- return this.amount < 0;
1583
- }
1584
- }, {
1585
- key: 'calcReserved',
1586
- value: function calcReserved() {
1587
- var sum = 0;
1588
- (0, _each3.default)(this.thePaymodes, function (mode) {
1589
- sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
1590
- });
1591
- this.received = (0, _utils.getFixedNumber)(sum);
1592
- this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
1593
- }
1594
- }, {
1595
- key: 'calcDjqCheckValue',
1596
- value: function calcDjqCheckValue(q1, dto, params) {
1597
- var _this14 = this;
1598
-
1599
- var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
1600
- var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
1601
- return djq.checked;
1602
- });
1603
- if (qList.length === useLimitPerOrder && !q1.checked) {
1604
- _message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
1605
- return;
1606
- }
1607
- if (params === 'single') {
1608
- this.checkList = [];
1609
- }
1610
-
1611
- var _ref20 = _mutantsUtil.platform || {},
1612
- isNewRetailBCPos = _ref20.isNewRetailBCPos;
1613
-
1614
- var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
1615
- PayStyle = _enumController$getEn15.PayStyle,
1616
- Differentiate = _enumController$getEn15.Differentiate;
1617
-
1618
- if (q1) {
1619
- if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
1620
- _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
1621
- return;
1622
- }
1623
- var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
1624
- return djq.promoCouponCode == q1.promoCouponCode;
1625
- });
1626
- if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
1627
- _message2.default.error("本单金额低于使用门槛,该券不可使用。");
1628
- return;
1629
- }
1630
- //判断是否是选择优惠券 //CC优惠券只能使用一个
1631
- // if (q1 && !q1.checked && isNewRetailBCPos) {
1632
- // // 检查是否有已经选定优惠券 并且去除选定的优惠券
1633
- // this.currentMode.djqs.forEach((djq, index) => {
1634
- // if (djq.checked) this.currentMode.djqs[index].checked = false;
1635
- // })
1636
- // }
1637
- q && (q.checked = !q.checked);
1638
- }
1639
- var sum = 0;
1640
- // console.log(this.store, 'stores-------');
1641
- if (!q1.checked) {
1642
- this.checkList.forEach(function (ele, i) {
1643
- if (ele.id === q1.id) {
1644
- _this14.checkList.splice(i, 1);
1645
- }
1646
- });
1647
- } else {
1648
- this.checkList.push(q1);
1649
- }
1650
-
1651
- this.checkList.forEach(function (ele) {
1652
- sum = Math.Add(sum, ele.amount);
1653
- });
1654
- this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1655
- console.log(this.receivable, sum, Math.min(this.receivable, sum, this.currentMode.maxamount), 'sum---------');
1656
- this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - Math.min(this.receivable, sum, this.currentMode.maxamount));
1657
- this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1658
- if (params === 'single') {
1659
- return;
1660
- }
1661
- var promoVoucher = {};
1662
- promoVoucher.boName = "Retail";
1663
- // promoVoucher.promoLinks = _filter(this.currentMode.djqs,djq=>djq.checked);
1664
- promoVoucher.meMemberId = this.currentMode.member.id;
1665
- promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
1666
- promoVoucher.voucherDetailList = [];
1667
- dto.RetailDetails.forEach(function (item) {
1668
- var detailDTO = {};
1669
- detailDTO.uuid = item.Code;
1670
- detailDTO.detailBoName = "RetailDetail";
1671
- detailDTO.voucherDetailId = item.ID;
1672
- detailDTO.productId = item.Idinventory;
1673
- detailDTO.uomId = item.Idunit;
1674
- detailDTO.productSpecId = item.ProductSpecId;
1675
- detailDTO.isManualFreeGift = item.IsPresent;
1676
- detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
1677
- detailDTO.IsManualChangePrice = item.IsManualChangePrice;
1678
- if (detailDTO.IsManualChangePrice) //如果是手工改价
1679
- {
1680
- detailDTO.listPrice = item.TaxPrice;
1681
- detailDTO.netAmountWithTax = item.TaxAmount;
1682
- } else {
1683
- var bookingQuantity = 0;
1684
- if (item.BookingQuantity) {
1685
- bookingQuantity = item.BookingQuantity;
1686
- }
1687
- detailDTO.listPrice = item.MemberPrice;
1688
- detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
1689
- }
1690
- detailDTO.taxRate = item.TaxRate;
1691
- detailDTO.quantity = item.Quantity;
1692
-
1693
- detailDTO.amountWithTax = item.RetailAmount;
1694
- // 促销 start
1695
- if (item.PromotionDetails && item.PromotionDetails.length != 0) {
1696
- var promoLinks = [];
1697
- item.PromotionDetails.forEach(function (promotion) {
1698
- promoLinks.push({
1699
- promoId: promotion.IdSalesPromotionDTO,
1700
- promoRuleId: promotion.PromotionRuleId
1701
- });
1702
- });
1703
- if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
1704
- }
1705
- // 促销 end
1706
- promoVoucher.voucherDetailList.push(detailDTO);
1707
- });
1708
- promoVoucher.promoLinks = this.checkList;
1709
- return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
1710
- if (result && result.length != 0) {
1711
- result.forEach(function (element, index) {
1712
- var djq1 = false;
1713
- _this14.currentMode.djqs.forEach(function (djq) {
1714
- if (element.id === djq.id) {
1715
- djq1 = true;
1716
- }
1717
- });
1718
-
1719
- var _ref21 = element || {},
1720
- couponCode = _ref21.couponCode,
1721
- name = _ref21.name,
1722
- tieredAmountResult = _ref21.tieredAmountResult,
1723
- fromDate = _ref21.fromDate,
1724
- dateMount = _ref21.dateMount,
1725
- promoMethodEnum = _ref21.promoMethodEnum,
1726
- discountPct = _ref21.discountPct,
1727
- nominalAmount = _ref21.nominalAmount,
1728
- promoId = _ref21.promoId,
1729
- id = _ref21.id,
1730
- doorsill = _ref21.doorsill;
1731
-
1732
- var condValue = tieredAmountResult.condValue,
1733
- promoDiscount = tieredAmountResult.promoDiscount,
1734
- displayText = tieredAmountResult.displayText,
1735
- promoRuleId = tieredAmountResult.promoRuleId,
1736
- couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
1737
-
1738
- if (!djq1) {
1739
- // this.currentMode.djqs.push({
1740
- // promoCouponCode: element.CouponCode,
1741
- // name: element.CouponTitle,
1742
- // IsEnable: true,
1743
- // amount: element.ReductionAmount,
1744
- // doorsill: element.EnableAmount,
1745
- // LastTS: element.LastTS,
1746
- // checked: false,
1747
- // IsRepelWithPoints: true,
1748
- // UMemberID: dto.Idmember,
1749
- // expired: null,
1750
- // displayText,
1751
- // promoMethodEnum,
1752
- // discountPct,
1753
- // promoId,
1754
- // promoRuleId,
1755
- // couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
1756
- // id
1757
- // })
1758
- _this14.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
1759
- djq1 = false;
1760
- } else {
1761
- _this14.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum, promoMethodEnum, nominalAmount, promoDiscount);
1762
- // this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
1763
- // djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
1764
- }
1765
- });
1766
- }
1767
- // 优惠券【6052098985043】与【6120822326451】不可叠加使用
1768
- });
1769
- //this.receivable = getFixedNumber(this.receivable - sum);
1770
- }
1771
- }, {
1772
- key: 'calcDjqValue',
1773
- value: function calcDjqValue(q1) {
1774
- var _ref22 = _mutantsUtil.platform || {},
1775
- isNewRetailBCPos = _ref22.isNewRetailBCPos;
1776
-
1777
- var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1778
- Differentiate = _enumController$getEn16.Differentiate;
1779
-
1780
- if (q1) {
1781
- if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
1782
- _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
1783
- return;
1784
- }
1785
- var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
1786
- return djq.code == q1.code;
1787
- });
1788
- if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
1789
- _message2.default.error("本单金额低于使用门槛,该券不可使用。");
1790
- return;
1791
- }
1792
- //判断是否是选择优惠券 //CC优惠券只能使用一个
1793
- // if (q1 && !q1.checked && isNewRetailBCPos) {
1794
- // // 检查是否有已经选定优惠券 并且去除选定的优惠券
1795
- // this.currentMode.djqs.forEach((djq, index) => {
1796
- // if (djq.checked) this.currentMode.djqs[index].checked = false;
1797
- // })
1798
- // }
1799
- q && (q.checked = !q.checked);
1800
- }
1801
- var sum = 0;
1802
- // console.log(this.store, 'stores-------');
1803
- (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
1804
- return djq.checked;
1805
- }), function (q) {
1806
- sum = Math.Add(sum, q.amount);
1807
- });
1808
- this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1809
- this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
1810
- this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1811
-
1812
- //this.receivable = getFixedNumber(this.receivable - sum);
1813
- }
1814
- }, {
1815
- key: 'reCalculationDjqs',
1816
- value: function reCalculationDjqs() {
1817
- var sum = 0;
1818
- (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
1819
- return djq.checked;
1820
- }), function (q) {
1821
- sum = Math.Add(sum, q.amount);
1822
- });
1823
- this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1824
- this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
1825
- this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1826
- this.currentMode.maxamount = this.currentMode.receivable || this.currentMode.receivable;
1827
- }
1828
- }, {
1829
- key: 'clearDjqs',
1830
- value: function clearDjqs() {
1831
- this.currentMode.djqs = [];
1832
- }
1833
- }, {
1834
- key: 'setCurrentModeValue',
1835
- value: function setCurrentModeValue(v, max) {
1836
- this.currentMode.value = parseFloat(v) || 0;
1837
- this.currentMode.errinfo = '';
1838
- var sum = this.amount;
1839
-
1840
- var _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(),
1841
- PayStyle = _enumController$getEn17.PayStyle;
1842
-
1843
- this.paymodes.thePaymodes && this.paymodes.thePaymodes.forEach(function (mode) {
1844
- if (mode.paymentType === PayStyle.hyczk) {
1845
- sum -= mode.value;
1846
- }
1847
- });
1848
-
1849
- if (this.amount > 0 && (v === '' || v === '0.00')) {
1850
- this.currentMode.errinfo = "实收金额必须录入";
1851
- } else if (Math.abs(parseFloat(v)) > Math.abs(sum)) {
1852
- this.currentMode.errinfo = "实收不应大于应收";
1853
- } else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
1854
- this.currentMode.errinfo = "余额不足";
1855
- }
1856
- }
1857
- }, {
1858
- key: 'calcMemberBalance',
1859
- value: function calcMemberBalance() {
1860
- this.currentMode.balance = this.currentMode.member.rawbalance - this.currentMode.value;
1861
- }
1862
- }, {
1863
- key: 'setPaymodes',
1864
- value: function () {
1865
- var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
1866
- var _this15 = this;
1867
-
1868
- var _enumController$getEn18, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
1869
-
1870
- return _regenerator2.default.wrap(function _callee7$(_context7) {
1871
- while (1) {
1872
- switch (_context7.prev = _context7.next) {
1873
- case 0:
1874
- _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn18.settleStyleType, PayStyle = _enumController$getEn18.PayStyle;
1875
- memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
1876
- param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
1877
- _context7.next = 5;
1878
- return (0, _tplusApi.tApi)({ param: param }, 'chanjet.RE.NewPos.GetNewStoreSettleStyles', false, false);
1879
-
1880
- case 5:
1881
- modes = _context7.sent;
1882
-
1883
- if (modes) {
1884
- (0, _mobx.runInAction)(function () {
1885
- var paymodes = [];
1886
- (0, _each3.default)(modes.SettleStyles, function (mode, index) {
1887
- //产品需求确认会员储值卡结算方式前端展示统一调整为“储值卡" tuzha by 2020-07-08
1888
-
1889
- if (mode.Code == PayStyle.hyczk) {
1890
- mode.Name = '储值余额';
1891
- }
1892
- paymodes.push({
1893
- name: mode.Name,
1894
- isDefault: mode.IsDefaultSettleStyle,
1895
- isQuick: (0, _findIndex3.default)(modes.QuickSettleStyles, { 'Code': mode.Code }) >= 0,
1896
- orderBy: 1,
1897
- paymentType: mode.Code,
1898
- offlineDisable: mode.offlineDisable,
1899
- idSettleStyle: mode.IdSettleStyle,
1900
- idBankAccount: mode.IdBankAccount,
1901
- exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
1902
- idCurrency: mode.Currency ? mode.Currency.ID : -1,
1903
- calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88"
1904
- });
1905
- });
1906
- _this15.paymodes = paymodes;
1907
- //modes.QuickSettleStyles
1908
- });
1909
- }
1910
-
1911
- case 7:
1912
- case 'end':
1913
- return _context7.stop();
1914
- }
1915
- }
1916
- }, _callee7, this);
1917
- }));
1918
-
1919
- function setPaymodes(_x5, _x6) {
1920
- return _ref23.apply(this, arguments);
1921
- }
1922
-
1923
- return setPaymodes;
1924
- }()
1925
- }, {
1926
- key: 'charge',
1927
- get: function get() {
1928
- return Math.abs(this.receivable);
1929
- }
1930
- }, {
1931
- key: 'counter',
1932
- get: function get() {
1933
- return ++this._counter;
1934
- }
1935
- }]);
1936
- return PayMode;
1937
- }(), (_descriptor3 = _applyDecoratedDescriptor(_class3.prototype, 'currentFocus', [_mobx.observable], {
1938
- enumerable: true,
1939
- initializer: function initializer() {
1940
- return "";
1941
- }
1942
- }), _descriptor4 = _applyDecoratedDescriptor(_class3.prototype, 'received', [_mobx.observable], {
1943
- enumerable: true,
1944
- initializer: function initializer() {
1945
- return 0;
1946
- }
1947
- }), _descriptor5 = _applyDecoratedDescriptor(_class3.prototype, 'receivable', [_mobx.observable], {
1948
- enumerable: true,
1949
- initializer: function initializer() {
1950
- return 0;
1951
- }
1952
- }), _descriptor6 = _applyDecoratedDescriptor(_class3.prototype, 'paymodes', [_mobx.observable], {
1953
- enumerable: true,
1954
- initializer: function initializer() {
1955
- return [];
1956
- }
1957
- }), _descriptor7 = _applyDecoratedDescriptor(_class3.prototype, 'thePaymodes', [_mobx.observable], {
1958
- enumerable: true,
1959
- initializer: function initializer() {
1960
- return [];
1961
- }
1962
- }), _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), _descriptor8 = _applyDecoratedDescriptor(_class3.prototype, 'calcCheckList', [_mobx.action], {
1963
- enumerable: true,
1964
- initializer: function initializer() {
1965
- var _this16 = this;
1966
-
1967
- return function () {
1968
- _this16.checkList = [];
1969
- };
1970
- }
1971
- }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
1972
- enumerable: true,
1973
- initializer: function initializer() {
1974
- var _this17 = this;
1975
-
1976
- return function (id, couponNum, promoMethodEnum, nominalAmount, promoDiscount) {
1977
- _this17.currentMode.djqs.forEach(function (ele) {
1978
- if (ele.id === id) {
1979
- promoMethodEnum == "CASH_COUPON" ? ele.amount = nominalAmount : ele.amount = promoDiscount;
1980
- ele.couponCategoryEnum = couponNum;
1981
- var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
1982
- ele.IsEnable = IsEnable;
1983
- }
1984
- });
1985
- };
1986
- }
1987
- }), _descriptor10 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
1988
- enumerable: true,
1989
- initializer: function initializer() {
1990
- var _this18 = this;
1991
-
1992
- return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
1993
- var djq = {
1994
- promoCouponCode: promoCouponCode,
1995
- name: name,
1996
- IsEnable: IsEnable,
1997
- amount: amount,
1998
- doorsill: doorsill,
1999
- LastTS: LastTS,
2000
- checked: checked,
2001
- IsRepelWithPoints: IsRepelWithPoints,
2002
- UMemberID: UMemberID,
2003
- expired: expired,
2004
- displayText: displayText,
2005
- promoMethodEnum: promoMethodEnum,
2006
- discountPct: discountPct,
2007
- promoId: promoId,
2008
- promoRuleId: promoRuleId,
2009
- couponCategoryEnum: couponCategoryEnum,
2010
- id: id
2011
- };
2012
- _this18.currentMode.djqs.push(djq);
2013
- };
2014
- }
2015
- }), _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);
2016
- var Member = exports.Member = (_class5 = function () {
2017
- function Member(m) {
2018
- var _this19 = this;
2019
-
2020
- (0, _classCallCheck3.default)(this, Member);
2021
-
2022
- _initDefineProp(this, 'cardNo', _descriptor11, this);
2023
-
2024
- _initDefineProp(this, 'balance', _descriptor12, this);
2025
-
2026
- _initDefineProp(this, 'exchangable', _descriptor13, this);
2027
-
2028
- _initDefineProp(this, 'MeStorageCardId', _descriptor14, this);
2029
-
2030
- _initDefineProp(this, 'StorageCardNo', _descriptor15, this);
2031
-
2032
- if (m) {
2033
- this.id = m.ID;
2034
- this.uid = m.Uid;
2035
- this.type = m.MemberType ? m.MemberType.Name : "普通";
2036
- this.rawbalance = m.BalanceStorage;
2037
- var index = (0, _findIndex3.default)(m.DynamicPropertyKeys, function (key) {
2038
- return key == 'canusedbalancestorage';
2039
- });
2040
-
2041
- var _ref24 = _mutantsUtil.platform || {},
2042
- isNewRetailBCPos = _ref24.isNewRetailBCPos;
2043
-
2044
- m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
2045
- m.MeStorageCardId && (this.MeStorageCardId = m.MeStorageCardId);
2046
- (0, _mobx.runInAction)(function () {
2047
- _this19.cardNo = m.CardCode;
2048
- if (index >= 0) {
2049
- _this19.balance = parseFloat(m.DynamicPropertyValues[index]);
2050
- } else {
2051
- _this19.balance = _this19.rawbalance;
2052
- }
2053
- });
2054
- this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
2055
- this.NeedModifyPassword = m.NeedModifyPassword;
2056
- this.bonusPoints = m.BalanceIntegral;
2057
- }
2058
- }
2059
-
2060
- (0, _createClass3.default)(Member, [{
2061
- key: 'setExchangable',
2062
- value: function setExchangable(v) {
2063
- this.exchangable = v;
2064
- }
2065
- }, {
2066
- key: 'setCardNo',
2067
- value: function setCardNo(v) {
2068
- this.cardNo = v;
2069
- this.id = null;
2070
- }
2071
- }, {
2072
- key: 'setMeStorageCardId',
2073
- value: function setMeStorageCardId(v) {
2074
- this.MeStorageCardId = v;
2075
- }
2076
- }, {
2077
- key: 'setStorageCardNo',
2078
- value: function setStorageCardNo(v) {
2079
- this.StorageCardNo = v;
2080
- }
2081
- }]);
2082
- return Member;
2083
- }(), (_descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
2084
- enumerable: true,
2085
- initializer: null
2086
- }), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
2087
- enumerable: true,
2088
- initializer: null
2089
- }), _descriptor13 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
2090
- enumerable: true,
2091
- initializer: null
2092
- }), _descriptor14 = _applyDecoratedDescriptor(_class5.prototype, 'MeStorageCardId', [_mobx.observable], {
2093
- enumerable: true,
2094
- initializer: null
2095
- }), _descriptor15 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
2096
- enumerable: true,
2097
- initializer: null
2098
- }), _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), _applyDecoratedDescriptor(_class5.prototype, 'setMeStorageCardId', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setMeStorageCardId'), _class5.prototype), _applyDecoratedDescriptor(_class5.prototype, 'setStorageCardNo', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class5.prototype, 'setStorageCardNo'), _class5.prototype)), _class5);
2099
- //# sourceMappingURL=settlementStore.js.map