tplus-components-touch 3.27.2 → 3.28.2

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