tplus-components-touch 3.22.12 → 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 -5465
  191. package/dist/components/settlement/settlement.js.map +0 -1
  192. package/dist/components/settlement/settlement.less +0 -1586
  193. package/dist/components/settlement/settlementStore.js +0 -2122
  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,2122 +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 : isNewRetailBCPos && discountPct > 0 ? 0 : 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
- (0, _each3.default)(this.dto.RetailPaymentDetails, function (detail) {
497
- var themode = (0, _find3.default)(_this5.paymode.paymodes, { 'idSettleStyle': detail.IdsettleStyle });
498
- if (detail.SettleStyle.Code === PayStyle.hyczk && !themode) {
499
- _tplusComponentsTouch.ModalWraper.info({
500
- title: '温馨提示',
501
- content: '没有储值结算方式,请在后台添加储值余额结算方式。',
502
- okText: '确定',
503
- okType: 'primary'
504
- });
505
- }
506
- if (themode && themode.paymentType && themode.paymentType != PayStyle.hyczk) {
507
- var newmode = (0, _extends3.default)({}, _this5.genNewMode(themode.paymentType, false, detail.Amount), {
508
- authCode: detail.PaymentCode,
509
- steadCashIntegral: detail.SteadCashIntegral,
510
- overchargesAmount: detail.OverchargesAmount,
511
- boriginReturn: true
512
- });
513
- _this5.paymode.currentMode = newmode;
514
- if (themode.paymentType == PayStyle.djq) {
515
- (0, _each3.default)(_this5.dto.RetailCouponDetails, function (djq) {
516
- if (isNewRetailBCPos) {
517
- var _ref6 = djq || {},
518
- displayText = _ref6.displayText,
519
- promoRuleId = _ref6.promoRuleId,
520
- dateMount = _ref6.dateMount,
521
- promoMethodEnum = _ref6.promoMethodEnum,
522
- discountPct = _ref6.discountPct,
523
- promoId = _ref6.promoId,
524
- id = _ref6.id;
525
-
526
- _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);
527
- return;
528
- }
529
- _this5.addDjq(djq.CouponCode, djq.CouponTitle, true, djq.ReductionAmount, djq.EnableAmount, djq.LastTS, true, false);
530
- });
531
- }
532
- _this5.paymode.thePaymodes.push(newmode);
533
- }
534
- });
535
- (0, _each3.default)(this.dto.RetailStorageDetails, function (detail) {
536
- var balanceAmount = detail.Member.BalanceStorage;
537
- balanceAmount = balanceAmount - detail.StoragePaymentAmount;
538
- var newmode = (0, _extends3.default)({}, _this5.genNewMode(PayStyle.hyczk, false, detail.StoragePaymentAmount), {
539
- member: new Member(detail.Member),
540
- authCode: detail.Password,
541
- balance: balanceAmount,
542
- boriginReturn: true
543
- });
544
- _this5.paymode.thePaymodes.push(newmode);
545
- });
546
- this.paymode.calcReserved();
547
- }
548
- }, {
549
- key: 'clean',
550
- value: function clean() {
551
- this.bquick = false;
552
- this.paymode.clean();
553
- }
554
- }, {
555
- key: 'quickSettle',
556
- value: function quickSettle(key) {
557
- this.addPay(key);
558
- }
559
-
560
- //outer call
561
- //(type===PayStyle.hyczk || type===PayStyle.jfczk || type===PayStyle.jfdx || type===PayStyle.djq)
562
-
563
- }, {
564
- key: 'changeFocusAndAddPay',
565
- value: function changeFocusAndAddPay(type) {
566
- var _this6 = this;
567
-
568
- var _enumController$getEn5 = _mutantsUtil.enumController.getEnumOj(),
569
- PayStyle = _enumController$getEn5.PayStyle;
570
-
571
- this.paymode.currentFocus = type;
572
- if (this.paymode.currentMode) {
573
- if (type == PayStyle.jfdx) {
574
- if (this.newStyle) {
575
- var index = (0, _findIndex3.default)(this.paymode.thePaymodes, function (m) {
576
- return m.paymentType == PayStyle.jfdx;
577
- });
578
- this.paymode.thePaymodes.splice(index, 1, this.paymode.currentMode);
579
- this.paymode.calcReserved();
580
- } else {
581
- this.addPayDirectly(this.paymode.currentMode);
582
- }
583
-
584
- //抵现积分
585
- (0, _tplusApi.tApi)({ IntegralSteadCashParams: {
586
- Idmember: this.paymode.currentMode.member.id,
587
- TotalTaxAmount: this.paymode.amount,
588
- BalanceTaxAmount: this.paymode.currentMode.value
589
- } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
590
- _this6.paymode.currentMode.steadCashIntegral = result.Integral;
591
- _this6.paymode.currentMode.overchargesAmount = result.Amount - _this6.paymode.currentMode.value;
592
- });
593
- } else {
594
- this.addPayDirectly(this.paymode.currentMode);
595
- }
596
- } else {
597
- this.addPay(type);
598
- }
599
- }
600
-
601
- // 设置密码后更新会员信息
602
-
603
- }, {
604
- key: 'getLoginInfo',
605
- value: function getLoginInfo() {
606
- var _ref7 = _mutantsMicrofx.localStore.get('user') || {},
607
- _ref7$loginInfo = _ref7.loginInfo,
608
- loginInfo = _ref7$loginInfo === undefined ? {} : _ref7$loginInfo;
609
-
610
- return loginInfo;
611
- }
612
- }, {
613
- key: 'loadCzk',
614
- value: function loadCzk(v) {
615
- var _this7 = this;
616
-
617
- if ((0, _trim3.default)(v) === "") {
618
- (0, _mobx.runInAction)(function () {
619
- _this7.paymode.currentMode.member = new Member(null);
620
- _this7.paymode.currentMode.errinfo = "请输入储值卡";
621
- });
622
- return;
623
- }
624
- var IdStore = this.storeInfo.storeID;
625
- var StoreCode = this.storeInfo.storeCode; //_find(this.storeInfo.storeInfos,(store)=>{return store.ID==IdStore;}).Code;
626
-
627
- var _ref8 = _mutantsUtil.platform || {},
628
- isNewRetailBCPos = _ref8.isNewRetailBCPos;
629
-
630
- var address = '';
631
- if (isNewRetailBCPos) {
632
- // address = '/member/memberProfile/FindByStorageCode/'+v;
633
- address = '/member/MeMemberWallet/FindByStorageCode';
634
- return (0, _tplusApi.ccApi)({ code: v }, address, false, false, { method: 'get', timeout_skip: true }).then(function (result) {
635
- var data = result.data;
636
- var m = data;
637
-
638
- var _ref9 = _mutantsUtil.platform || {},
639
- isNewRetailBCPos = _ref9.isNewRetailBCPos;
640
-
641
- if (isNewRetailBCPos) {
642
- _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
643
- _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
644
- _this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
645
- _this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
646
- }
647
- if (!m || !m.ID) {
648
- (0, _mobx.runInAction)(function () {
649
- _this7.paymode.currentMode.errinfo = "无效的会员卡号";
650
- });
651
- } else {
652
- (0, _mobx.runInAction)(function () {
653
- _this7.paymode.currentMode.errinfo = "";
654
- _this7.paymode.currentMode.member = new Member(m);
655
- _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
656
- _this7.updateEvent();
657
- var message = '';
658
- if (global.CheckMemberStorageProcessorBlock) {
659
- message = CheckMemberStorageProcessorBlock.execute(m);
660
- }
661
- if (!String.isNullOrEmpty(message)) {
662
- _this7.paymode.currentMode.errinfo = message;
663
- } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
664
- _this7.paymode.currentMode.errinfo = "余额不足";
665
- } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
666
- _this7.paymode.currentMode.errinfo = "实收金额必须录入";
667
- } else {
668
- // 查询成功后将焦点移入下一个输入框
669
- var nextInput = document.querySelector('.czk .received .input');
670
- nextInput && nextInput.select();
671
- }
672
- });
673
- }
674
- });
675
- } else {
676
- address = 'AA.DR.newRetailMember.SearchMember';
677
- return (0, _tplusApi.tApi)({ SearchParams: { Key: v, IsSingleMember: true, IdStore: IdStore, StoreCode: StoreCode } }, address, false, false).then(function (result) {
678
- var data = JSON.parse(result.Data);
679
- var m = data && data.length > 0 && data[0];
680
-
681
- var _ref10 = _mutantsUtil.platform || {},
682
- isNewRetailBCPos = _ref10.isNewRetailBCPos;
683
-
684
- if (isNewRetailBCPos) {
685
- _this7.paymode && _this7.paymode.currentMode.member.setMeStorageCardId(m.MeStorageCardId);
686
- _this7.paymode && _this7.paymode.currentMode.member.setStorageCardNo(m.StorageCardNo);
687
- _this7.paymode && (_this7.paymode.currentMode.MeStorageCardId = m.MeStorageCardId);
688
- _this7.paymode && (_this7.paymode.currentMode.StorageCardNo = m.StorageCardNo);
689
- }
690
- if (!m || !m.ID) {
691
- (0, _mobx.runInAction)(function () {
692
- _this7.paymode.currentMode.errinfo = "无效的会员卡号";
693
- });
694
- } else {
695
- (0, _mobx.runInAction)(function () {
696
- _this7.paymode.currentMode.errinfo = "";
697
- _this7.paymode.currentMode.member = new Member(m);
698
- _this7.paymode.currentMode.value = (0, _utils.getFixedNumber)(_this7.brefund ? _this7.paymode.receivable : Math.max(_this7.paymode.receivable, 0));
699
- _this7.updateEvent();
700
- var message = '';
701
- if (global.CheckMemberStorageProcessorBlock) {
702
- message = CheckMemberStorageProcessorBlock.execute(data[0]);
703
- }
704
- if (!String.isNullOrEmpty(message)) {
705
- _this7.paymode.currentMode.errinfo = message;
706
- } else if (_this7.checkReceived(_this7.paymode.currentMode, "balance")) {
707
- _this7.paymode.currentMode.errinfo = "余额不足";
708
- } else if (_this7.paymode.amount > 0 && _this7.paymode.currentMode.value == 0) {
709
- _this7.paymode.currentMode.errinfo = "实收金额必须录入";
710
- } else {
711
- // 查询成功后将焦点移入下一个输入框
712
- var nextInput = document.querySelector('.czk .received .input');
713
- nextInput && nextInput.focus();
714
- }
715
- });
716
- }
717
- });
718
- }
719
- }
720
- }, {
721
- key: 'addDjq',
722
- value: function addDjq(promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id, unCheck, count) {
723
- var djq = {
724
- code: promoCouponCode,
725
- promoCouponCode: promoCouponCode,
726
- name: name,
727
- IsEnable: IsEnable,
728
- amount: amount,
729
- doorsill: doorsill, //:"无门槛"
730
- LastTS: LastTS,
731
- checked: checked,
732
- IsRepelWithPoints: IsRepelWithPoints,
733
- UMemberID: UMemberID,
734
- expired: expired, //还剩多少过期
735
- displayText: displayText,
736
- promoMethodEnum: promoMethodEnum,
737
- discountPct: discountPct,
738
- promoId: promoId,
739
- promoRuleId: promoRuleId,
740
- couponCategoryEnum: couponCategoryEnum,
741
- id: id,
742
- count: count === 1 && (couponCategoryEnum === 'RIGUP' || couponCategoryEnum === 'UN_MATCH' || couponCategoryEnum === "PREPARING" || couponCategoryEnum === 'PROMO_LIMITED' || couponCategoryEnum === 'COUPON_CONFLICT') ? 1 : null
743
- };
744
- this.paymode.currentMode.djqs.push(djq);
745
- // let copyData = _clonedeep(this.data[targetIndex]);
746
- !unCheck && !this.boriginReturn && this.paymode.calcDjqValue(djq);
747
- }
748
- }, {
749
- key: 'setCurrentMode',
750
- value: function setCurrentMode(id, type, append) {
751
- var _enumController$getEn6 = _mutantsUtil.enumController.getEnumOj(),
752
- PayStyle = _enumController$getEn6.PayStyle;
753
-
754
- var mode = (0, _find3.default)(this.paymode.thePaymodes, { paymethodId: id });
755
- if (mode) {
756
- this.paymode.currentMode = mode;
757
- if (this.newStyle) {
758
- this.afterSetCurrentMode(type);
759
- }
760
- } else {
761
- this.paymode.currentMode = this.genNewMode(type, append);
762
- this.afterSetCurrentMode(type);
763
- }
764
- }
765
- }, {
766
- key: 'afterSetCurrentMode',
767
- value: function afterSetCurrentMode(type) {
768
- var _this8 = this;
769
-
770
- var _enumController$getEn7 = _mutantsUtil.enumController.getEnumOj(),
771
- PayStyle = _enumController$getEn7.PayStyle;
772
-
773
- if (type == PayStyle.djq) {
774
- this.paymode.calcDjqValue();
775
- } else if (type == PayStyle.jfdx) {
776
- //获取可兑换的金额
777
- if (this.newStyle) {
778
- var themode = (0, _find3.default)(this.paymode.thePaymodes, { paymentType: PayStyle.jfdx });
779
- if (themode && parseFloat(themode.value || 0) != 0) {
780
- this.paymode.currentMode.value = themode.value;
781
- }
782
- }
783
-
784
- (0, _tplusApi.tApi)({ IntegralSteadCashParams: {
785
- Idmember: this.paymode.currentMode.member.id,
786
- TotalTaxAmount: this.paymode.amount,
787
- BalanceTaxAmount: this.paymode.amount
788
- } }, 'AA.DR.newRetailMember.CalculdateIntegralSteadCash', false, false).then(function (result) {
789
- _this8.paymode.currentMode.member.setExchangable(result.MaxAmount);
790
- _this8.updateEvent();
791
- if (_this8.checkReceived(_this8.paymode.currentMode, "exchangable")) {
792
- (0, _mobx.runInAction)(function () {
793
- _this8.paymode.currentMode.errinfo = '余额不足';
794
- });
795
- }
796
- });
797
- }
798
- }
799
- }, {
800
- key: 'checkReceived',
801
- value: function checkReceived(mode, name) {
802
- return !this.brefund && parseFloat(mode.value) > parseFloat(mode.maxamount || mode.member[name] || 0);
803
- }
804
- }, {
805
- key: 'genNewMode',
806
- value: function genNewMode(type, notwithm, v) {
807
- var _enumController$getEn8 = _mutantsUtil.enumController.getEnumOj(),
808
- PayStyle = _enumController$getEn8.PayStyle;
809
-
810
- var value = (0, _utils.getFixedNumber)(v || (this.brefund ? this.paymode.receivable : Math.max(this.paymode.receivable, 0)));
811
- var themode = (0, _find3.default)(this.paymode.paymodes, { 'paymentType': type });
812
- var mode = (0, _mobx.observable)({
813
- paymethodId: this.paymode.counter,
814
- name: themode.name,
815
- exchangeRate: themode.exchangeRate,
816
- calDirection: themode.calDirection,
817
- value: value,
818
- value2: (0, _utils.getFixedNumber)(themode.calDirection == "88" ? value / themode.exchangeRate : value * themode.exchangeRate),
819
- value3: value,
820
- order: this.paymode.thePaymodes.length + 1,
821
- paymentType: type,
822
- djqs: [],
823
- member: new Member(!notwithm ? this.member : null),
824
- authCode: '',
825
- steadCashIntegral: null,
826
- errinfo: '',
827
- maxamount: this.paymode.amount
828
- });
829
- if (type == PayStyle.hyczk) {
830
- if (!mode.member.id) {
831
- (0, _mobx.runInAction)(function () {
832
- mode.errinfo = '未录入储值卡';
833
- });
834
- } else if (this.checkReceived(mode, "balance")) {
835
- (0, _mobx.runInAction)(function () {
836
- mode.errinfo = '余额不足';
837
- });
838
- }
839
- }
840
- if (type == PayStyle.hyczk || type == PayStyle.jfdx || type == PayStyle.djq) {
841
- this.setMaxAmount(type, mode);
842
- }
843
- console.log(mode);
844
- return mode;
845
- }
846
- }, {
847
- key: 'setMaxAmount',
848
- value: function setMaxAmount(type, mode) {
849
- var _this9 = this;
850
-
851
- var _enumController$getEn9 = _mutantsUtil.enumController.getEnumOj(),
852
- PayStyle = _enumController$getEn9.PayStyle;
853
-
854
- var sum = 0;
855
- if (type == PayStyle.hyczk) {
856
- (0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
857
- return m.paymentType == type;
858
- }), function (q) {
859
- sum = Math.Add(sum, q.value);
860
- });
861
- } else if (type == PayStyle.djq || type == PayStyle.jfdx) {
862
- (0, _each3.default)((0, _filter3.default)(this.paymode.thePaymodes, function (m) {
863
- return m.paymentType == PayStyle.djq || m.paymentType == PayStyle.jfdx;
864
- }), function (q) {
865
- sum = Math.Add(sum, q.value);
866
- });
867
- }
868
-
869
- this.amountHandler && this.amountHandler(type).then(function () {
870
- (0, _mobx.runInAction)(function () {
871
- mode.maxamount = (0, _utils.getFixedNumber)(Math.Minus(_this9.context.viewModel.getViewItem('Voucher').availableAmount, sum));
872
- _this9.updateEvent();
873
- });
874
- });
875
- }
876
- }, {
877
- key: 'changeFocusOnly',
878
- value: function changeFocusOnly(type) {
879
- this.paymode.currentFocus = type;
880
- // 获取焦点时带入剩余的值
881
- // let mode=_find(this.paymode.thePaymodes,{'paymentType':type});
882
- // if(mode && this.isIntegralExchange){
883
- // const shouldSetValue =getFixedNumber(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
884
- // mode.value = shouldSetValue;
885
- // mode.value2 = getFixedNumber(mode.calDirection=="88"?shouldSetValue / mode.exchangeRate:(shouldSetValue * mode.exchangeRate));
886
- // mode.value3 = shouldSetValue;
887
- // this.paymode.calcReserved();
888
- // }
889
- }
890
- }, {
891
- key: 'changeClickFocusOnly',
892
- value: function changeClickFocusOnly(type) {
893
- this.paymode.currentFocus = type;
894
- // 获取焦点时带入剩余的值
895
- var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymentType': type });
896
- if (mode) {
897
- var shouldSetValue = (0, _utils.getFixedNumber)(parseFloat(this.paymode.receivable) + parseFloat(mode.value));
898
- mode.value = shouldSetValue;
899
- mode.value2 = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? shouldSetValue / mode.exchangeRate : shouldSetValue * mode.exchangeRate);
900
- mode.value3 = shouldSetValue;
901
- this.paymode.calcReserved();
902
- }
903
- }
904
- }, {
905
- key: 'changeValue',
906
- value: function changeValue(index, value, blur) {
907
- var mode = (0, _find3.default)(this.paymode.thePaymodes, { 'paymethodId': index });
908
- var v = blur ? (0, _utils.getFixedNumber)(value) : isNaN(value) && value != '-' ? 0.00 : value;
909
- if (mode) {
910
- if (mode.exchangeRate != 1) {
911
- if ((0, _utils.getFixedNumber)(mode.calDirection == "88" ? mode.value3 / mode.exchangeRate : mode.value3 * mode.exchangeRate) != v) {
912
- mode.value = (0, _utils.getFixedNumber)(mode.calDirection == "88" ? v * mode.exchangeRate : v / mode.exchangeRate);
913
- } else {
914
- mode.value = mode.value3;
915
- }
916
- mode.value2 = v;
917
- } else {
918
- mode.value = v;
919
- mode.value2 = v;
920
- }
921
-
922
- this.paymode.calcReserved();
923
- }
924
- }
925
- }, {
926
- key: 'addPayDirectly',
927
- value: function addPayDirectly(pay) {
928
- var _enumController$getEn10 = _mutantsUtil.enumController.getEnumOj(),
929
- PayStyle = _enumController$getEn10.PayStyle;
930
-
931
- if (!(0, _find3.default)(this.paymode.thePaymodes, { paymethodId: pay.paymethodId })) {
932
- var pos = this.paymode.thePaymodes.length;
933
- if (pay.paymentType == PayStyle.hyczk) {
934
- var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
935
- return m.paymethodId != pay.paymethodId && m.paymentType == PayStyle.hyczk;
936
- });
937
- pos = index == -1 ? pos : index + 1;
938
- }
939
- // this.paymode.thePaymodes.push(pay);
940
- this.paymode.thePaymodes.splice(pos, 0, pay);
941
- }
942
- this.paymode.calcReserved();
943
- }
944
- }, {
945
- key: 'addPay',
946
- value: function addPay(type) {
947
- var _enumController$getEn11 = _mutantsUtil.enumController.getEnumOj(),
948
- PayStyle = _enumController$getEn11.PayStyle;
949
-
950
- var pos = this.paymode.thePaymodes.length;
951
- if (type == PayStyle.hyczk) {
952
- var index = (0, _findLastIndex3.default)(this.paymode.thePaymodes, function (m) {
953
- return m.paymentType == PayStyle.hyczk;
954
- });
955
- pos = index == -1 ? pos : index + 1;
956
- }
957
- // this.paymode.thePaymodes.push(this.genNewMode(type) );
958
- this.paymode.thePaymodes.splice(pos, 0, this.genNewMode(type, this.newStyle && type == PayStyle.hyczk));
959
- this.paymode.calcReserved();
960
- }
961
- }, {
962
- key: 'delPay',
963
- value: function delPay(index) {
964
- var _enumController$getEn12 = _mutantsUtil.enumController.getEnumOj(),
965
- PayStyle = _enumController$getEn12.PayStyle;
966
-
967
- (0, _remove3.default)(this.paymode.thePaymodes, function (mode) {
968
- return mode.paymethodId === index;
969
- });
970
- this.paymode.currentFocus = -1;
971
- this.paymode.calcReserved();
972
- }
973
- }, {
974
- key: 'commit',
975
- value: function () {
976
- var _ref11 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(bTest) {
977
- var _ref12, isNewRetailBCPos;
978
-
979
- return _regenerator2.default.wrap(function _callee2$(_context2) {
980
- while (1) {
981
- switch (_context2.prev = _context2.next) {
982
- case 0:
983
- console.log('settlementStore.commit开始,参数:' + bTest);
984
-
985
- if (!bTest) {
986
- _context2.next = 3;
987
- break;
988
- }
989
-
990
- return _context2.abrupt('return', _promise2.default.resolve(true));
991
-
992
- case 3:
993
- _ref12 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref12.isNewRetailBCPos;
994
- _context2.prev = 4;
995
-
996
- if (!(this.type == 1)) {
997
- _context2.next = 10;
998
- break;
999
- }
1000
-
1001
- _context2.next = 8;
1002
- return this.saveMember();
1003
-
1004
- case 8:
1005
- _context2.next = 18;
1006
- break;
1007
-
1008
- case 10:
1009
- if (!isNewRetailBCPos) {
1010
- _context2.next = 13;
1011
- break;
1012
- }
1013
-
1014
- _context2.next = 13;
1015
- return _mutantsMicrofx.stores.offlineSys.generatorCode(this.dto);
1016
-
1017
- case 13:
1018
- _context2.next = 15;
1019
- return this.save();
1020
-
1021
- case 15:
1022
- if (!isNewRetailBCPos) {
1023
- _context2.next = 18;
1024
- break;
1025
- }
1026
-
1027
- _context2.next = 18;
1028
- return _mutantsMicrofx.stores.offlineSys.retailSequenceUpload();
1029
-
1030
- case 18:
1031
- return _context2.abrupt('return', _promise2.default.resolve(true));
1032
-
1033
- case 21:
1034
- _context2.prev = 21;
1035
- _context2.t0 = _context2['catch'](4);
1036
-
1037
- console.error('settlementStore.commit失败,错误信息:' + _context2.t0);
1038
- return _context2.abrupt('return', _promise2.default.resolve(_context2.t0));
1039
-
1040
- case 25:
1041
- case 'end':
1042
- return _context2.stop();
1043
- }
1044
- }
1045
- }, _callee2, this, [[4, 21]]);
1046
- }));
1047
-
1048
- function commit(_x2) {
1049
- return _ref11.apply(this, arguments);
1050
- }
1051
-
1052
- return commit;
1053
- }()
1054
- }, {
1055
- key: 'handlePrint',
1056
- value: function handlePrint(resp) {
1057
- // 储值打印
1058
- return (0, _tplusComponentsTouch.printDispatch)(_tplusComponentsTouch.DoNameList.DO_STORAGE_PRINT, resp, {});
1059
- }
1060
- }, {
1061
- key: 'saveMember',
1062
- value: function saveMember() {
1063
- var _this10 = this;
1064
-
1065
- var _enumController$getEn13 = _mutantsUtil.enumController.getEnumOj(),
1066
- PayStyle = _enumController$getEn13.PayStyle;
1067
-
1068
- (0, _mobx.runInAction)(function () {
1069
- _this10.dto.StorageMutiSettleDetails = [];
1070
- var thePaymodes = _this10.newStyle ? (0, _filter3.default)(_this10.paymode.thePaymodes, function (mode) {
1071
- return parseFloat(mode.value) != 0;
1072
- }) : _this10.paymode.thePaymodes;
1073
- (0, _each3.default)(thePaymodes, function (mode) {
1074
- var themode = (0, _find3.default)(_this10.paymode.paymodes, { 'paymentType': mode.paymentType });
1075
-
1076
- var value = parseFloat(mode.value);
1077
- var giveChange = null;
1078
- if (mode.paymentType == PayStyle.xianjin && _this10.paymode.receivable < 0 && value > Math.abs(_this10.paymode.receivable)) {
1079
- value = Math.Add(value, _this10.paymode.receivable);
1080
- giveChange = Math.abs(_this10.paymode.receivable);
1081
- }
1082
- _this10.dto.StorageMutiSettleDetails.push({
1083
- Code: mode.paymethodId,
1084
- StorageAmount: value,
1085
- GiveChange: giveChange,
1086
- IdsettleStyle: themode.idSettleStyle,
1087
- IdbankAccount: themode.idBankAccount,
1088
- PaymentCode: mode.authCode,
1089
- DynamicPropertyKeys: [],
1090
- DynamicPropertyValues: [],
1091
- DataSource: { Id: _this10.dataSource }
1092
- });
1093
- });
1094
- });
1095
- // cc结算调用
1096
- var IPMSG = {};
1097
- if (!!window.localStorage.IPMSG) {
1098
- IPMSG = JSON.parse(window.localStorage.IPMSG);
1099
- }
1100
- return (0, _tplusApi.tApi)({ dto: this.dto }, 'chanjet.ME.INewRetailMemberStorage.Save', false, false).then(function (resp) {
1101
- _this10.handlePrint(resp);
1102
- });
1103
- }
1104
- }, {
1105
- key: 'save',
1106
- value: function () {
1107
- var _ref13 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
1108
- var _this11 = this;
1109
-
1110
- var _enumController$getEn14, PayStyle, _ref15, isNewRetailBCPos, IPMSG, RetailTypeEnum;
1111
-
1112
- return _regenerator2.default.wrap(function _callee3$(_context3) {
1113
- while (1) {
1114
- switch (_context3.prev = _context3.next) {
1115
- case 0:
1116
- _enumController$getEn14 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn14.PayStyle;
1117
-
1118
- (0, _mobx.runInAction)(function () {
1119
- _this11.dto.RetailPaymentDetails = [];
1120
- _this11.dto.RetailStorageDetails = [];
1121
- _this11.dto.RetailCouponDetails = [];
1122
- var czkSum = 0;
1123
- var Idmember = _this11.dto.Idmember;
1124
- var count = 0;
1125
- var thePaymodes = _this11.newStyle ? (0, _filter3.default)(_this11.paymode.thePaymodes, function (mode) {
1126
- return parseFloat(mode.value) != 0;
1127
- }) : _this11.paymode.thePaymodes;
1128
- (0, _each3.default)(thePaymodes, function (mode, index) {
1129
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': mode.paymentType });
1130
- if (mode.paymentType == PayStyle.hyczk) {
1131
- if (!Idmember) {
1132
- Idmember = mode.member.id;
1133
- }
1134
- czkSum = Math.Add(czkSum, mode.value);
1135
- var MeStorageCardId = mode.member.MeStorageCardId ? mode.member.MeStorageCardId : _this11.member.MeStorageCardId;
1136
- _this11.dto.RetailStorageDetails.push({
1137
- Code: mode.paymethodId,
1138
- MeStorageCardId: MeStorageCardId,
1139
- StoragePaymentAmount: mode.value,
1140
- IsOrigReturn: false,
1141
- BalanceStorage: mode.balance,
1142
- Idmember: mode.member.id,
1143
- DynamicPropertyKeys: [],
1144
- DynamicPropertyValues: [],
1145
- DataSource: { Id: _this11.dataSource },
1146
- Password: mode.authCode
1147
- });
1148
- } else {
1149
- var value = parseFloat(mode.value);
1150
- var giveChange = null;
1151
- if (mode.paymentType == PayStyle.xianjin && _this11.paymode.receivable < 0 && value > Math.abs(_this11.paymode.receivable)) {
1152
- value = Math.Add(value, _this11.paymode.receivable);
1153
- giveChange = Math.abs(_this11.paymode.receivable);
1154
- }
1155
- _this11.dto.RetailPaymentDetails.push({
1156
- Code: mode.paymethodId,
1157
- OrigAmount: mode.exchangeRate != 1 ? mode.value2 : value,
1158
- Amount: value,
1159
- GiveChange: giveChange,
1160
- IdsettleStyle: themode.idSettleStyle,
1161
- IdbankAccount: themode.idBankAccount,
1162
- Idcurrency: themode.idCurrency,
1163
- ExchangeRate: themode.exchangeRate,
1164
- PaymentCode: mode.authCode,
1165
- SteadCashIntegral: mode.steadCashIntegral,
1166
- OverchargesAmount: mode.overchargesAmount,
1167
- DynamicPropertyKeys: [],
1168
- DynamicPropertyValues: [],
1169
- DataSource: { Id: _this11.dataSource }
1170
- });
1171
- if (mode.paymentType == PayStyle.djq) {
1172
- (0, _each3.default)(_this11.paymode.checkList, function (djq) {
1173
- _this11.dto.RetailCouponDetails.push({
1174
- CouponCode: djq.promoCouponCode,
1175
- ReductionAmount: djq.amount,
1176
- EnableAmount: djq.doorsill,
1177
- CouponTitle: djq.name,
1178
- IdMember: djq.UMemberID ? mode.member.id : null,
1179
- LastTS: djq.LastTS,
1180
- PromotionId: djq.promoId,
1181
- PromotionRuleId: djq.promoRuleId,
1182
- PromoCouponAllocatedId: djq.id,
1183
- DataSource: { Id: _this11.dataSource }
1184
- });
1185
- });
1186
- }
1187
- }
1188
- });
1189
-
1190
- var _ref14 = _mutantsUtil.platform || {},
1191
- isNewRetailBCPos = _ref14.isNewRetailBCPos;
1192
-
1193
- if (_this11.dto.RetailStorageDetails.length > 0) {
1194
- var themode = (0, _find3.default)(_this11.paymode.paymodes, { 'paymentType': PayStyle.hyczk });
1195
- if (isNewRetailBCPos) {
1196
- // this.dto.RetailStorageDetails && this.dto.RetailStorageDetails.forEach((value, index) => {
1197
- // value.MeStorageCardId = (mode.MeStorageCardId ? mode.MeStorageCardId : this.member.MeStorageCardId);
1198
- // })
1199
- _this11.dto.RetailPaymentDetails.push({
1200
- Code: _this11.paymode.counter,
1201
- OrigAmount: czkSum,
1202
- Amount: czkSum,
1203
- IdsettleStyle: themode.idSettleStyle,
1204
- IdbankAccount: themode.idBankAccount,
1205
- DynamicPropertyKeys: [],
1206
- DynamicPropertyValues: [],
1207
- DataSource: { Id: _this11.dataSource },
1208
- RetailStorageDetails: _this11.dto.RetailStorageDetails
1209
- });
1210
- } else {
1211
- _this11.dto.RetailPaymentDetails.push({
1212
- Code: _this11.paymode.counter,
1213
- OrigAmount: czkSum,
1214
- Amount: czkSum,
1215
- IdsettleStyle: themode.idSettleStyle,
1216
- IdbankAccount: themode.idBankAccount,
1217
- DynamicPropertyKeys: [],
1218
- DynamicPropertyValues: [],
1219
- DataSource: { Id: _this11.dataSource }
1220
- });
1221
- }
1222
- _this11.dto.Idmember = Idmember;
1223
- }
1224
- });
1225
- _ref15 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref15.isNewRetailBCPos;
1226
-
1227
- console.log('bc_pos\u73AF\u5883:' + isNewRetailBCPos + ',\u7ED3\u7B97\u6570\u636E\uFF1A', this.dto);
1228
-
1229
- if (!isNewRetailBCPos) {
1230
- _context3.next = 20;
1231
- break;
1232
- }
1233
-
1234
- // cc结算调用
1235
- IPMSG = {};
1236
-
1237
- if (!!window.localStorage.IPMSG) {
1238
- IPMSG = JSON.parse(window.localStorage.IPMSG);
1239
- }
1240
- RetailTypeEnum = this.dto.IdbusiType == 36 ? "INTEGRAL_EXCHANGE" : "NORMAL";
1241
- _context3.t1 = this.dto.IdbusiType == 37;
1242
-
1243
- if (!_context3.t1) {
1244
- _context3.next = 13;
1245
- break;
1246
- }
1247
-
1248
- _context3.next = 12;
1249
- return this.checkIntegralExchangeReturn(this.dto.RetailDetails[0].ReturnSourceId);
1250
-
1251
- case 12:
1252
- _context3.t1 = _context3.sent;
1253
-
1254
- case 13:
1255
- _context3.t0 = _context3.t1;
1256
-
1257
- if (_context3.t0) {
1258
- _context3.next = 16;
1259
- break;
1260
- }
1261
-
1262
- _context3.t0 = this.dto.IdbusiType != 37;
1263
-
1264
- case 16:
1265
- if (!_context3.t0) {
1266
- _context3.next = 18;
1267
- break;
1268
- }
1269
-
1270
- 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) {
1271
- _this11.setDtoID(resp.ID);
1272
- _this11.billID = resp.ID;
1273
- }));
1274
-
1275
- case 18:
1276
- _context3.next = 21;
1277
- break;
1278
-
1279
- case 20:
1280
- return _context3.abrupt('return', (0, _tplusApi.tApi)({ dto: this.dto.cut() }, 'chanjet.RE.newRetail.Settle', false, false, { timeout_skip: true }).then(function (resp) {
1281
- _this11.setDtoID(resp.ID);
1282
- _this11.billID = resp.ID;
1283
- }));
1284
-
1285
- case 21:
1286
- case 'end':
1287
- return _context3.stop();
1288
- }
1289
- }
1290
- }, _callee3, this);
1291
- }));
1292
-
1293
- function save() {
1294
- return _ref13.apply(this, arguments);
1295
- }
1296
-
1297
- return save;
1298
- }()
1299
- }, {
1300
- key: 'setDtoID',
1301
- value: function setDtoID(id) {
1302
- this.context.viewModel.data.ID = id;
1303
- }
1304
- }, {
1305
- key: 'querySettleResult',
1306
- value: function () {
1307
- var _ref16 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
1308
- return _regenerator2.default.wrap(function _callee4$(_context4) {
1309
- while (1) {
1310
- switch (_context4.prev = _context4.next) {
1311
- case 0:
1312
- _context4.prev = 0;
1313
- _context4.t0 = _promise2.default;
1314
- _context4.next = 4;
1315
- return (0, _tplusApi.tApi)({ RetailCode: this.dto.Code }, 'chanjet.RE.newRetail.QuerySettleResult', false, false, { timeout_skip: true });
1316
-
1317
- case 4:
1318
- _context4.t1 = _context4.sent;
1319
- return _context4.abrupt('return', _context4.t0.resolve.call(_context4.t0, _context4.t1));
1320
-
1321
- case 8:
1322
- _context4.prev = 8;
1323
- _context4.t2 = _context4['catch'](0);
1324
- return _context4.abrupt('return', _promise2.default.resolve({ Flag: "1" }));
1325
-
1326
- case 11:
1327
- case 'end':
1328
- return _context4.stop();
1329
- }
1330
- }
1331
- }, _callee4, this, [[0, 8]]);
1332
- }));
1333
-
1334
- function querySettleResult() {
1335
- return _ref16.apply(this, arguments);
1336
- }
1337
-
1338
- return querySettleResult;
1339
- }()
1340
- }, {
1341
- key: 'setCookie',
1342
- value: function setCookie(key, val) {
1343
- var exp = new Date();
1344
- exp.setTime((0, _moment2.default)().endOf('day').valueOf());
1345
- document.cookie = key + '=' + val + ';expires=' + exp.toGMTString();
1346
- }
1347
- }, {
1348
- key: 'getAllCookies',
1349
- value: function getAllCookies() {
1350
- var cookies = document.cookie.split(/;\s/g);
1351
- var cookieObj = {};
1352
- cookies.forEach(function (item) {
1353
- var key = item.split('=')[0];
1354
- cookieObj[key] = item.split('=')[1];
1355
- });
1356
- return cookieObj;
1357
- }
1358
- }, {
1359
- key: 'validePwd',
1360
- value: function () {
1361
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(value) {
1362
- var _ref18, isNewRetailBCPos, cook1, cook2, message, result, count, _result;
1363
-
1364
- return _regenerator2.default.wrap(function _callee5$(_context5) {
1365
- while (1) {
1366
- switch (_context5.prev = _context5.next) {
1367
- case 0:
1368
- _ref18 = _mutantsUtil.platform || {}, isNewRetailBCPos = _ref18.isNewRetailBCPos;
1369
- _context5.prev = 1;
1370
-
1371
- if (!isNewRetailBCPos) {
1372
- _context5.next = 18;
1373
- break;
1374
- }
1375
-
1376
- cook1 = this.getAllCookies()['errorPwd'];
1377
- cook2 = cook1 && JSON.parse(cook1);
1378
- message = '密码输入错误';
1379
-
1380
- if (!cook2) {
1381
- _context5.next = 11;
1382
- break;
1383
- }
1384
-
1385
- if (!cook2.hasOwnProperty(this.member.MeStorageCardId + "")) {
1386
- _context5.next = 11;
1387
- break;
1388
- }
1389
-
1390
- if (!(cook2[this.member.MeStorageCardId] > 3)) {
1391
- _context5.next = 11;
1392
- break;
1393
- }
1394
-
1395
- message = '今日密码错误已达上限,不可使用储值消费,请明日再试,如忘记请重置密码或修改密码。';
1396
- return _context5.abrupt('return', _promise2.default.resolve(message));
1397
-
1398
- case 11:
1399
- _context5.next = 13;
1400
- return (0, _tplusApi.ccApi)({ password: _tplusApi.User.pwdEncrypt(value.pwd) }, '/member/MeMemberWallet/checkPaymentPassword/' + value.id, false, false);
1401
-
1402
- case 13:
1403
- result = _context5.sent;
1404
-
1405
- if (!result.data) {
1406
- if (cook2) {
1407
- if (cook2.hasOwnProperty(this.member.MeStorageCardId + "")) {
1408
- count = cook2[this.member.MeStorageCardId];
1409
-
1410
- cook2[this.member.MeStorageCardId] = count + 1;
1411
- } else {
1412
- cook2[this.member.MeStorageCardId] = 1;
1413
- }
1414
- } else {
1415
- cook2 = {};
1416
- cook2[this.member.MeStorageCardId] = 1;
1417
- }
1418
- this.setCookie('errorPwd', '', -1);
1419
- this.setCookie('errorPwd', (0, _stringify2.default)(cook2));
1420
- }
1421
- return _context5.abrupt('return', _promise2.default.resolve(result.data ? "" : message));
1422
-
1423
- case 18:
1424
- _context5.next = 20;
1425
- return (0, _tplusApi.tApi)({ "CheckoutParams": {
1426
- "Idmember": value.id,
1427
- "Password": value.pwd
1428
- } }, 'AA.DR.newRetailMember.CheckoutMemberPassword', false, false);
1429
-
1430
- case 20:
1431
- _result = _context5.sent;
1432
- return _context5.abrupt('return', _promise2.default.resolve(_result.Success ? "" : _result.Message));
1433
-
1434
- case 22:
1435
- _context5.next = 27;
1436
- break;
1437
-
1438
- case 24:
1439
- _context5.prev = 24;
1440
- _context5.t0 = _context5['catch'](1);
1441
- return _context5.abrupt('return', "failed");
1442
-
1443
- case 27:
1444
- case 'end':
1445
- return _context5.stop();
1446
- }
1447
- }
1448
- }, _callee5, this, [[1, 24]]);
1449
- }));
1450
-
1451
- function validePwd(_x3) {
1452
- return _ref17.apply(this, arguments);
1453
- }
1454
-
1455
- return validePwd;
1456
- }()
1457
- }]);
1458
- return SettlementStore;
1459
- }(), (_descriptor = _applyDecoratedDescriptor(_class.prototype, 'queryPwd', [_mobx.action], {
1460
- enumerable: true,
1461
- initializer: function initializer() {
1462
- var _this12 = this;
1463
-
1464
- return function (newPass, newPassConfirm) {
1465
- if (!newPass || !newPassConfirm) {
1466
- return _message2.default.warn('您还有未填写项');
1467
- }
1468
- if (newPass !== newPassConfirm) {
1469
- return _message2.default.warn('您两次输入的密码不一致');
1470
- }
1471
- var idstore = (0, _tplusPoslogin.PosInitData)('storeID');
1472
- return (0, _tplusApi.ccApi)({
1473
- Idstore: idstore,
1474
- meMemberId: _this12.member.ID,
1475
- oldPassword: null,
1476
- newPassword: _tplusApi.User.pwdEncrypt(newPassConfirm),
1477
- dataSource: "POS"
1478
- }, '/member/MeMemberWallet/setWalletPayPassword', false, false, { method: 'post', timeout_skip: true }).then(function (resp) {
1479
- if (resp.successful) {
1480
- return true;
1481
- }
1482
- });
1483
- };
1484
- }
1485
- }), _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], {
1486
- enumerable: true,
1487
- initializer: function initializer() {
1488
- var _this13 = this;
1489
-
1490
- return function () {
1491
- var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee6(_this) {
1492
- var _getLoginInfo, IdStore, StoreCode, resp;
1493
-
1494
- return _regenerator2.default.wrap(function _callee6$(_context6) {
1495
- while (1) {
1496
- switch (_context6.prev = _context6.next) {
1497
- case 0:
1498
- _getLoginInfo = _this13.getLoginInfo(), IdStore = _getLoginInfo.IdStore, StoreCode = _getLoginInfo.StoreCode;
1499
- _context6.next = 3;
1500
- return (0, _tplusApi.tApi)({ Idmember: _this13.member.ID, IdStore: IdStore, StoreCode: StoreCode }, 'chanjet.AA.DR.INewRetailMember.GetUmemberDTO', false, false);
1501
-
1502
- case 3:
1503
- resp = _context6.sent;
1504
-
1505
- _this.member = resp;
1506
- _this.paymode.currentMode.member.setStorageCardNo(resp.StorageCardNo);
1507
- return _context6.abrupt('return', _promise2.default.resolve(resp));
1508
-
1509
- case 7:
1510
- case 'end':
1511
- return _context6.stop();
1512
- }
1513
- }
1514
- }, _callee6, _this13);
1515
- }));
1516
-
1517
- return function (_x4) {
1518
- return _ref19.apply(this, arguments);
1519
- };
1520
- }();
1521
- }
1522
- }), _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);
1523
- exports.default = SettlementStore;
1524
- var PayMode = exports.PayMode = (_class3 = function () {
1525
- //应收
1526
- function PayMode() {
1527
- // this.amount=getFixedNumber(amount);
1528
- // this.calcReserved();
1529
-
1530
- (0, _classCallCheck3.default)(this, PayMode);
1531
- this._counter = 0;
1532
- this.amount = 0;
1533
- this.onlineamount = 0;
1534
- this.maxamount = 0;
1535
-
1536
- _initDefineProp(this, 'currentFocus', _descriptor3, this);
1537
-
1538
- _initDefineProp(this, 'received', _descriptor4, this);
1539
-
1540
- _initDefineProp(this, 'receivable', _descriptor5, this);
1541
-
1542
- _initDefineProp(this, 'paymodes', _descriptor6, this);
1543
-
1544
- _initDefineProp(this, 'thePaymodes', _descriptor7, this);
1545
-
1546
- this.currentMode = null;
1547
- this.checkList = [];
1548
- this.settle = {
1549
- name: "复合结算",
1550
- hotKey: "Ctrl+M"
1551
- };
1552
-
1553
- _initDefineProp(this, 'calcCheckList', _descriptor8, this);
1554
-
1555
- _initDefineProp(this, 'setCouponNum', _descriptor9, this);
1556
-
1557
- _initDefineProp(this, 'addDjqs', _descriptor10, this);
1558
- }
1559
- // @observable store = null;
1560
-
1561
-
1562
- (0, _createClass3.default)(PayMode, [{
1563
- key: 'clean',
1564
- value: function clean() {
1565
- this.thePaymodes = [];
1566
- this.calcReserved();
1567
- }
1568
- }, {
1569
- key: 'clear',
1570
- value: function clear() {
1571
- this.thePaymodes = [];
1572
- this.calcReserved();
1573
- this.paymodes = [];
1574
- }
1575
- }, {
1576
- key: 'setAmount',
1577
- value: function setAmount(a, o) {
1578
- this.amount = (0, _utils.getFixedNumber)((a || 0) - (o || 0));
1579
- this.onlineamount = (0, _utils.getFixedNumber)(o || 0);
1580
- this.calcReserved();
1581
- return this.amount < 0;
1582
- }
1583
- }, {
1584
- key: 'calcReserved',
1585
- value: function calcReserved() {
1586
- var sum = 0;
1587
- (0, _each3.default)(this.thePaymodes, function (mode) {
1588
- sum = Math.Add(sum, mode.value == "" ? 0 : mode.value);
1589
- });
1590
- this.received = (0, _utils.getFixedNumber)(sum);
1591
- this.receivable = (0, _utils.getFixedNumber)(this.amount - sum);
1592
- }
1593
- }, {
1594
- key: 'calcDjqCheckValue',
1595
- value: function calcDjqCheckValue(q1, dto, params) {
1596
- var _this14 = this;
1597
-
1598
- var useLimitPerOrder = (0, _tplusPoslogin.PosInitData)('UseLimitPerOrder');
1599
- var qList = (0, _filter3.default)(this.currentMode.djqs, function (djq) {
1600
- return djq.checked;
1601
- });
1602
- if (qList.length === useLimitPerOrder && !q1.checked) {
1603
- _message2.default.warn('本单最多可用' + useLimitPerOrder + '张');
1604
- return;
1605
- }
1606
- if (params === 'single') {
1607
- this.checkList = [];
1608
- }
1609
-
1610
- var _ref20 = _mutantsUtil.platform || {},
1611
- isNewRetailBCPos = _ref20.isNewRetailBCPos;
1612
-
1613
- var _enumController$getEn15 = _mutantsUtil.enumController.getEnumOj(),
1614
- PayStyle = _enumController$getEn15.PayStyle,
1615
- Differentiate = _enumController$getEn15.Differentiate;
1616
-
1617
- if (q1) {
1618
- if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
1619
- _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
1620
- return;
1621
- }
1622
- var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
1623
- return djq.promoCouponCode == q1.promoCouponCode;
1624
- });
1625
- if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
1626
- _message2.default.error("本单金额低于使用门槛,该券不可使用。");
1627
- return;
1628
- }
1629
- //判断是否是选择优惠券 //CC优惠券只能使用一个
1630
- // if (q1 && !q1.checked && isNewRetailBCPos) {
1631
- // // 检查是否有已经选定优惠券 并且去除选定的优惠券
1632
- // this.currentMode.djqs.forEach((djq, index) => {
1633
- // if (djq.checked) this.currentMode.djqs[index].checked = false;
1634
- // })
1635
- // }
1636
- q && (q.checked = !q.checked);
1637
- }
1638
- var sum = 0;
1639
- // console.log(this.store, 'stores-------');
1640
- if (!q1.checked) {
1641
- this.checkList.forEach(function (ele, i) {
1642
- if (ele.id === q1.id) {
1643
- // this.checkList.forEach((ele1) => {
1644
- // if(ele.discountPct > 0) {
1645
- // this.currentMode.receivable = this.currentMode.receivable + ele.amount / (1 - discountPct);
1646
- // } else {
1647
- // this.currentMode.receivable = this.currentMode.receivable + ele.amount;
1648
- // }
1649
- // })
1650
- // if(ele.discountPct > 0) {
1651
- // this.currentMode.receivable = 100;
1652
- // } else {
1653
- // this.currentMode.receivable = this.currentMode.receivable + ele.amount;
1654
- // }
1655
- _this14.checkList.splice(i, 1);
1656
- }
1657
- });
1658
- } else {
1659
- if (q1.discountPct > 0) {
1660
- q1.amount = 0;
1661
- }
1662
- this.checkList.push(q1);
1663
- }
1664
-
1665
- var copy1 = (0, _cloneDeep2.default)(this.receivable);
1666
- this.checkList.forEach(function (ele, i) {
1667
- if (ele.discountPct > 0) {
1668
- ele.amount = (1 - ele.discountPct) * copy1;
1669
- copy1 -= ele.amount;
1670
- } else {
1671
- copy1 -= ele.amount;
1672
- }
1673
- sum = Math.Add(sum, ele.amount);
1674
- });
1675
- this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1676
- this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
1677
- this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1678
- if (params === 'single') {
1679
- return;
1680
- }
1681
- var promoVoucher = {};
1682
- promoVoucher.boName = "Retail";
1683
- // promoVoucher.promoLinks = _filter(this.currentMode.djqs,djq=>djq.checked);
1684
- promoVoucher.meMemberId = this.currentMode.member.id;
1685
- promoVoucher.storeFactorId = (0, _tplusPoslogin.PosInitData)('storeID');
1686
- promoVoucher.voucherDetailList = [];
1687
- dto.RetailDetails.forEach(function (item) {
1688
- var detailDTO = {};
1689
- detailDTO.uuid = item.Code;
1690
- detailDTO.detailBoName = "RetailDetail";
1691
- detailDTO.voucherDetailId = item.ID;
1692
- detailDTO.productId = item.Idinventory;
1693
- detailDTO.uomId = item.Idunit;
1694
- detailDTO.productSpecId = item.ProductSpecId;
1695
- detailDTO.isManualFreeGift = item.IsPresent;
1696
- detailDTO.isListPriceIncludingTax = item.TaxFlag || true;
1697
- detailDTO.IsManualChangePrice = item.IsManualChangePrice;
1698
- if (detailDTO.IsManualChangePrice) //如果是手工改价
1699
- {
1700
- detailDTO.listPrice = item.TaxPrice;
1701
- detailDTO.netAmountWithTax = item.TaxAmount;
1702
- } else {
1703
- var bookingQuantity = 0;
1704
- if (item.BookingQuantity) {
1705
- bookingQuantity = item.BookingQuantity;
1706
- }
1707
- detailDTO.listPrice = item.MemberPrice;
1708
- detailDTO.netAmountWithTax = Math.Multiply(item.MemberPrice, Math.Minus(item.Quantity, bookingQuantity)); //item.TaxAmount;
1709
- }
1710
- detailDTO.taxRate = item.TaxRate;
1711
- detailDTO.quantity = item.Quantity;
1712
-
1713
- detailDTO.amountWithTax = item.RetailAmount;
1714
- // 促销 start
1715
- if (item.PromotionDetails && item.PromotionDetails.length != 0) {
1716
- var promoLinks = [];
1717
- item.PromotionDetails.forEach(function (promotion) {
1718
- promoLinks.push({
1719
- promoId: promotion.IdSalesPromotionDTO,
1720
- promoRuleId: promotion.PromotionRuleId
1721
- });
1722
- });
1723
- if (promoLinks.length != 0) detailDTO.promoLinks = promoLinks;
1724
- }
1725
- // 促销 end
1726
- promoVoucher.voucherDetailList.push(detailDTO);
1727
- });
1728
- promoVoucher.promoLinks = this.checkList;
1729
- return (0, _tplusApi.ccApi)((0, _extends3.default)({}, promoVoucher), 'promotion/PromoCalculate/findUsefulCouponPromoList', false, false, { method: 'post', timeout_skip: true }).then(function (result) {
1730
- if (result && result.length != 0) {
1731
- result.forEach(function (element, index) {
1732
- var djq1 = false;
1733
- _this14.currentMode.djqs.forEach(function (djq) {
1734
- console.log(element.id, djq.id, element.id === djq.id, 'djq1111111111');
1735
- if (element.id === djq.id) {
1736
- djq1 = true;
1737
- }
1738
- });
1739
-
1740
- var _ref21 = element || {},
1741
- couponCode = _ref21.couponCode,
1742
- name = _ref21.name,
1743
- tieredAmountResult = _ref21.tieredAmountResult,
1744
- fromDate = _ref21.fromDate,
1745
- dateMount = _ref21.dateMount,
1746
- promoMethodEnum = _ref21.promoMethodEnum,
1747
- discountPct = _ref21.discountPct,
1748
- nominalAmount = _ref21.nominalAmount,
1749
- promoId = _ref21.promoId,
1750
- id = _ref21.id,
1751
- doorsill = _ref21.doorsill;
1752
-
1753
- var condValue = tieredAmountResult.condValue,
1754
- promoDiscount = tieredAmountResult.promoDiscount,
1755
- displayText = tieredAmountResult.displayText,
1756
- promoRuleId = tieredAmountResult.promoRuleId,
1757
- couponCategoryEnum = tieredAmountResult.couponCategoryEnum;
1758
-
1759
- if (!djq1) {
1760
- // this.currentMode.djqs.push({
1761
- // promoCouponCode: element.CouponCode,
1762
- // name: element.CouponTitle,
1763
- // IsEnable: true,
1764
- // amount: element.ReductionAmount,
1765
- // doorsill: element.EnableAmount,
1766
- // LastTS: element.LastTS,
1767
- // checked: false,
1768
- // IsRepelWithPoints: true,
1769
- // UMemberID: dto.Idmember,
1770
- // expired: null,
1771
- // displayText,
1772
- // promoMethodEnum,
1773
- // discountPct,
1774
- // promoId,
1775
- // promoRuleId,
1776
- // couponCategoryEnum: tieredAmountResult.couponCategoryEnum,
1777
- // id
1778
- // })
1779
- _this14.addDjqs(couponCode, name, true, nominalAmount, doorsill, element.LastTS, false, true, dto.Idmember, dateMount, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, tieredAmountResult.couponCategoryEnum, id);
1780
- djq1 = false;
1781
- } else {
1782
- _this14.setCouponNum(element.id, tieredAmountResult.couponCategoryEnum, nominalAmount);
1783
- // this.currentMode.djqs[0].couponCategoryEnum = 'couponCategoryEnum';
1784
- // djq1.couponCategoryEnum = element.tieredAmountResult.couponCategoryEnum
1785
- }
1786
- });
1787
- }
1788
- // 优惠券【6052098985043】与【6120822326451】不可叠加使用
1789
- });
1790
- //this.receivable = getFixedNumber(this.receivable - sum);
1791
- }
1792
- }, {
1793
- key: 'calcDjqValue',
1794
- value: function calcDjqValue(q1) {
1795
- var _ref22 = _mutantsUtil.platform || {},
1796
- isNewRetailBCPos = _ref22.isNewRetailBCPos;
1797
-
1798
- var _enumController$getEn16 = _mutantsUtil.enumController.getEnumOj(),
1799
- Differentiate = _enumController$getEn16.Differentiate;
1800
-
1801
- if (q1) {
1802
- if (!this.currentMode.boriginReturn && parseFloat(this.currentMode.maxamount) <= 0) {
1803
- _message2.default.error('\u672C\u5355\u6CA1\u6709' + Differentiate.COUPON + '\u53EF\u7528\u91D1\u989D\uFF0C\u8BE5\u5238\u4E0D\u53EF\u4F7F\u7528\u3002');
1804
- return;
1805
- }
1806
- var q = (0, _find3.default)(this.currentMode.djqs, function (djq) {
1807
- return djq.code == q1.code;
1808
- });
1809
- if (q && !q.checked && parseFloat(this.amount) < parseFloat(q.doorsill)) {
1810
- _message2.default.error("本单金额低于使用门槛,该券不可使用。");
1811
- return;
1812
- }
1813
- //判断是否是选择优惠券 //CC优惠券只能使用一个
1814
- // if (q1 && !q1.checked && isNewRetailBCPos) {
1815
- // // 检查是否有已经选定优惠券 并且去除选定的优惠券
1816
- // this.currentMode.djqs.forEach((djq, index) => {
1817
- // if (djq.checked) this.currentMode.djqs[index].checked = false;
1818
- // })
1819
- // }
1820
- q && (q.checked = !q.checked);
1821
- }
1822
- var sum = 0;
1823
- // console.log(this.store, 'stores-------');
1824
- (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
1825
- return djq.checked;
1826
- }), function (q) {
1827
- sum = Math.Add(sum, q.amount);
1828
- });
1829
- this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1830
- this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
1831
- this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1832
-
1833
- //this.receivable = getFixedNumber(this.receivable - sum);
1834
- }
1835
- }, {
1836
- key: 'reCalculationDjqs',
1837
- value: function reCalculationDjqs() {
1838
- var sum = 0;
1839
- (0, _each3.default)((0, _filter3.default)(this.currentMode.djqs, function (djq) {
1840
- return djq.checked;
1841
- }), function (q) {
1842
- sum = Math.Add(sum, q.amount);
1843
- });
1844
- this.currentMode.value = (0, _utils.getFixedNumber)(Math.min(this.receivable, sum, this.currentMode.maxamount));
1845
- this.currentMode.receivable = (0, _utils.getFixedNumber)(this.receivable - this.currentMode.value);
1846
- this.currentMode.overchargesAmount = (0, _utils.getFixedNumber)(sum - this.currentMode.value);
1847
- this.currentMode.maxamount = this.currentMode.receivable || this.currentMode.receivable;
1848
- }
1849
- }, {
1850
- key: 'clearDjqs',
1851
- value: function clearDjqs() {
1852
- this.currentMode.djqs = [];
1853
- }
1854
- }, {
1855
- key: 'setCurrentModeValue',
1856
- value: function setCurrentModeValue(v, max) {
1857
- this.currentMode.value = parseFloat(v) || 0;
1858
- this.currentMode.errinfo = '';
1859
- var sum = this.amount;
1860
-
1861
- var _enumController$getEn17 = _mutantsUtil.enumController.getEnumOj(),
1862
- PayStyle = _enumController$getEn17.PayStyle;
1863
-
1864
- this.paymodes.thePaymodes && this.paymodes.thePaymodes.forEach(function (mode) {
1865
- if (mode.paymentType === PayStyle.hyczk) {
1866
- sum -= mode.value;
1867
- }
1868
- });
1869
-
1870
- if (this.amount > 0 && (v === '' || v === '0.00')) {
1871
- this.currentMode.errinfo = "实收金额必须录入";
1872
- } else if (Math.abs(parseFloat(v)) > Math.abs(sum)) {
1873
- this.currentMode.errinfo = "实收不应大于应收";
1874
- } else if (parseFloat(v) > 0 && parseFloat(v) > (max || 0)) {
1875
- this.currentMode.errinfo = "余额不足";
1876
- }
1877
- }
1878
- }, {
1879
- key: 'calcMemberBalance',
1880
- value: function calcMemberBalance() {
1881
- this.currentMode.balance = this.currentMode.member.rawbalance - this.currentMode.value;
1882
- }
1883
- }, {
1884
- key: 'setPaymodes',
1885
- value: function () {
1886
- var _ref23 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee7(type, isIntegralExchange) {
1887
- var _this15 = this;
1888
-
1889
- var _enumController$getEn18, settleStyleType, PayStyle, memberStoreCode, settlementCode, param, modes;
1890
-
1891
- return _regenerator2.default.wrap(function _callee7$(_context7) {
1892
- while (1) {
1893
- switch (_context7.prev = _context7.next) {
1894
- case 0:
1895
- _enumController$getEn18 = _mutantsUtil.enumController.getEnumOj(), settleStyleType = _enumController$getEn18.settleStyleType, PayStyle = _enumController$getEn18.PayStyle;
1896
- memberStoreCode = settleStyleType.memberStoreCode, settlementCode = settleStyleType.settlementCode;
1897
- param = { 'settleStyleType': type == 1 ? memberStoreCode : settlementCode, isIntegralExchange: isIntegralExchange };
1898
- _context7.next = 5;
1899
- return (0, _tplusApi.tApi)({ param: param }, 'chanjet.RE.NewPos.GetNewStoreSettleStyles', false, false);
1900
-
1901
- case 5:
1902
- modes = _context7.sent;
1903
-
1904
- if (modes) {
1905
- (0, _mobx.runInAction)(function () {
1906
- var paymodes = [];
1907
- (0, _each3.default)(modes.SettleStyles, function (mode, index) {
1908
- //产品需求确认会员储值卡结算方式前端展示统一调整为“储值卡" tuzha by 2020-07-08
1909
-
1910
- if (mode.Code == PayStyle.hyczk) {
1911
- mode.Name = '储值余额';
1912
- }
1913
- paymodes.push({
1914
- name: mode.Name,
1915
- isDefault: mode.IsDefaultSettleStyle,
1916
- isQuick: (0, _findIndex3.default)(modes.QuickSettleStyles, { 'Code': mode.Code }) >= 0,
1917
- orderBy: 1,
1918
- paymentType: mode.Code,
1919
- offlineDisable: mode.offlineDisable,
1920
- idSettleStyle: mode.IdSettleStyle,
1921
- idBankAccount: mode.IdBankAccount,
1922
- exchangeRate: mode.Currency ? mode.Currency.ExchangeRate : 1,
1923
- idCurrency: mode.Currency ? mode.Currency.ID : -1,
1924
- calDirection: mode.Currency ? mode.Currency.CalDirection.Id : "88"
1925
- });
1926
- });
1927
- _this15.paymodes = paymodes;
1928
- //modes.QuickSettleStyles
1929
- });
1930
- }
1931
-
1932
- case 7:
1933
- case 'end':
1934
- return _context7.stop();
1935
- }
1936
- }
1937
- }, _callee7, this);
1938
- }));
1939
-
1940
- function setPaymodes(_x5, _x6) {
1941
- return _ref23.apply(this, arguments);
1942
- }
1943
-
1944
- return setPaymodes;
1945
- }()
1946
- }, {
1947
- key: 'charge',
1948
- get: function get() {
1949
- return Math.abs(this.receivable);
1950
- }
1951
- }, {
1952
- key: 'counter',
1953
- get: function get() {
1954
- return ++this._counter;
1955
- }
1956
- }]);
1957
- return PayMode;
1958
- }(), (_descriptor3 = _applyDecoratedDescriptor(_class3.prototype, 'currentFocus', [_mobx.observable], {
1959
- enumerable: true,
1960
- initializer: function initializer() {
1961
- return "";
1962
- }
1963
- }), _descriptor4 = _applyDecoratedDescriptor(_class3.prototype, 'received', [_mobx.observable], {
1964
- enumerable: true,
1965
- initializer: function initializer() {
1966
- return 0;
1967
- }
1968
- }), _descriptor5 = _applyDecoratedDescriptor(_class3.prototype, 'receivable', [_mobx.observable], {
1969
- enumerable: true,
1970
- initializer: function initializer() {
1971
- return 0;
1972
- }
1973
- }), _descriptor6 = _applyDecoratedDescriptor(_class3.prototype, 'paymodes', [_mobx.observable], {
1974
- enumerable: true,
1975
- initializer: function initializer() {
1976
- return [];
1977
- }
1978
- }), _descriptor7 = _applyDecoratedDescriptor(_class3.prototype, 'thePaymodes', [_mobx.observable], {
1979
- enumerable: true,
1980
- initializer: function initializer() {
1981
- return [];
1982
- }
1983
- }), _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], {
1984
- enumerable: true,
1985
- initializer: function initializer() {
1986
- var _this16 = this;
1987
-
1988
- return function () {
1989
- _this16.checkList = [];
1990
- };
1991
- }
1992
- }), _applyDecoratedDescriptor(_class3.prototype, 'calcDjqCheckValue', [_mobx.action], (0, _getOwnPropertyDescriptor2.default)(_class3.prototype, 'calcDjqCheckValue'), _class3.prototype), _descriptor9 = _applyDecoratedDescriptor(_class3.prototype, 'setCouponNum', [_mobx.action], {
1993
- enumerable: true,
1994
- initializer: function initializer() {
1995
- var _this17 = this;
1996
-
1997
- return function (id, couponNum, nominalAmount) {
1998
- _this17.currentMode.djqs.forEach(function (ele) {
1999
- if (ele.id === id) {
2000
- if (nominalAmount) {
2001
- ele.amount = nominalAmount;
2002
- }
2003
- ele.couponCategoryEnum = couponNum;
2004
- var IsEnable = ele.couponCategoryEnum === 'RIGUP' || ele.couponCategoryEnum === 'UN_MATCH' || ele.couponCategoryEnum === "PREPARING" || ele.couponCategoryEnum === 'PROMO_LIMITED' || ele.couponCategoryEnum === 'COUPON_CONFLICT' ? false : true;
2005
- ele.IsEnable = IsEnable;
2006
- }
2007
- });
2008
- };
2009
- }
2010
- }), _descriptor10 = _applyDecoratedDescriptor(_class3.prototype, 'addDjqs', [_mobx.action], {
2011
- enumerable: true,
2012
- initializer: function initializer() {
2013
- var _this18 = this;
2014
-
2015
- return function (promoCouponCode, name, IsEnable, amount, doorsill, LastTS, checked, IsRepelWithPoints, UMemberID, expired, displayText, promoMethodEnum, discountPct, promoId, promoRuleId, couponCategoryEnum, id) {
2016
- var djq = {
2017
- promoCouponCode: promoCouponCode,
2018
- name: name,
2019
- IsEnable: IsEnable,
2020
- amount: amount,
2021
- doorsill: doorsill,
2022
- LastTS: LastTS,
2023
- checked: checked,
2024
- IsRepelWithPoints: IsRepelWithPoints,
2025
- UMemberID: UMemberID,
2026
- expired: expired,
2027
- displayText: displayText,
2028
- promoMethodEnum: promoMethodEnum,
2029
- discountPct: discountPct,
2030
- promoId: promoId,
2031
- promoRuleId: promoRuleId,
2032
- couponCategoryEnum: couponCategoryEnum,
2033
- id: id
2034
- };
2035
- _this18.currentMode.djqs.push(djq);
2036
- };
2037
- }
2038
- }), _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);
2039
- var Member = exports.Member = (_class5 = function () {
2040
- function Member(m) {
2041
- var _this19 = this;
2042
-
2043
- (0, _classCallCheck3.default)(this, Member);
2044
-
2045
- _initDefineProp(this, 'cardNo', _descriptor11, this);
2046
-
2047
- _initDefineProp(this, 'balance', _descriptor12, this);
2048
-
2049
- _initDefineProp(this, 'exchangable', _descriptor13, this);
2050
-
2051
- _initDefineProp(this, 'MeStorageCardId', _descriptor14, this);
2052
-
2053
- _initDefineProp(this, 'StorageCardNo', _descriptor15, this);
2054
-
2055
- if (m) {
2056
- this.id = m.ID;
2057
- this.uid = m.Uid;
2058
- this.type = m.MemberType ? m.MemberType.Name : "普通";
2059
- this.rawbalance = m.BalanceStorage;
2060
- var index = (0, _findIndex3.default)(m.DynamicPropertyKeys, function (key) {
2061
- return key == 'canusedbalancestorage';
2062
- });
2063
-
2064
- var _ref24 = _mutantsUtil.platform || {},
2065
- isNewRetailBCPos = _ref24.isNewRetailBCPos;
2066
-
2067
- m.StorageCardNo && (this.StorageCardNo = m.StorageCardNo);
2068
- m.MeStorageCardId && (this.MeStorageCardId = m.MeStorageCardId);
2069
- (0, _mobx.runInAction)(function () {
2070
- _this19.cardNo = m.CardCode;
2071
- if (index >= 0) {
2072
- _this19.balance = parseFloat(m.DynamicPropertyValues[index]);
2073
- } else {
2074
- _this19.balance = _this19.rawbalance;
2075
- }
2076
- });
2077
- this.needPwd = m.MemberType ? m.MemberType.IsNeedPwd : false;
2078
- this.NeedModifyPassword = m.NeedModifyPassword;
2079
- this.bonusPoints = m.BalanceIntegral;
2080
- }
2081
- }
2082
-
2083
- (0, _createClass3.default)(Member, [{
2084
- key: 'setExchangable',
2085
- value: function setExchangable(v) {
2086
- this.exchangable = v;
2087
- }
2088
- }, {
2089
- key: 'setCardNo',
2090
- value: function setCardNo(v) {
2091
- this.cardNo = v;
2092
- this.id = null;
2093
- }
2094
- }, {
2095
- key: 'setMeStorageCardId',
2096
- value: function setMeStorageCardId(v) {
2097
- this.MeStorageCardId = v;
2098
- }
2099
- }, {
2100
- key: 'setStorageCardNo',
2101
- value: function setStorageCardNo(v) {
2102
- this.StorageCardNo = v;
2103
- }
2104
- }]);
2105
- return Member;
2106
- }(), (_descriptor11 = _applyDecoratedDescriptor(_class5.prototype, 'cardNo', [_mobx.observable], {
2107
- enumerable: true,
2108
- initializer: null
2109
- }), _descriptor12 = _applyDecoratedDescriptor(_class5.prototype, 'balance', [_mobx.observable], {
2110
- enumerable: true,
2111
- initializer: null
2112
- }), _descriptor13 = _applyDecoratedDescriptor(_class5.prototype, 'exchangable', [_mobx.observable], {
2113
- enumerable: true,
2114
- initializer: null
2115
- }), _descriptor14 = _applyDecoratedDescriptor(_class5.prototype, 'MeStorageCardId', [_mobx.observable], {
2116
- enumerable: true,
2117
- initializer: null
2118
- }), _descriptor15 = _applyDecoratedDescriptor(_class5.prototype, 'StorageCardNo', [_mobx.observable], {
2119
- enumerable: true,
2120
- initializer: null
2121
- }), _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);
2122
- //# sourceMappingURL=settlementStore.js.map