tplus-components-touch 1.27.1 → 1.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/dist/components/addLog/AddLogProcessor.js +53 -0
  2. package/dist/components/addLog/AddLogProcessor.js.map +1 -0
  3. package/dist/components/addLog/OperationLogApi.js +164 -0
  4. package/dist/components/addLog/OperationLogApi.js.map +1 -0
  5. package/dist/components/autoComplete/index.js +259 -0
  6. package/dist/components/autoComplete/index.js.map +1 -0
  7. package/dist/components/autoComplete/index.less +89 -0
  8. package/dist/components/autoComplete/option.js +75 -0
  9. package/dist/components/autoComplete/option.js.map +1 -0
  10. package/dist/components/autoCompleteWithKeyboard/index.js +206 -0
  11. package/dist/components/autoCompleteWithKeyboard/index.js.map +1 -0
  12. package/dist/components/autoCompleteWithKeyboard/index.less +5 -0
  13. package/dist/components/billSearch/api.js +425 -0
  14. package/dist/components/billSearch/api.js.map +1 -0
  15. package/dist/components/billSearch/index.js +2030 -0
  16. package/dist/components/billSearch/index.js.map +1 -0
  17. package/dist/components/billSearch/index.less +573 -0
  18. package/dist/components/cloudPrint/BTPrintFormatUtil.js +568 -0
  19. package/dist/components/cloudPrint/BTPrintFormatUtil.js.map +1 -0
  20. package/dist/components/cloudPrint/api.js +454 -0
  21. package/dist/components/cloudPrint/api.js.map +1 -0
  22. package/dist/components/cloudPrint/index.js +974 -0
  23. package/dist/components/cloudPrint/index.js.map +1 -0
  24. package/dist/components/cloudPrint/printDispatch.js +336 -0
  25. package/dist/components/cloudPrint/printDispatch.js.map +1 -0
  26. package/dist/components/commonForm/autoComplete/index.js +272 -0
  27. package/dist/components/commonForm/autoComplete/index.js.map +1 -0
  28. package/dist/components/commonForm/autoComplete/style.less +8 -0
  29. package/dist/components/commonForm/datePicker/index.js +117 -0
  30. package/dist/components/commonForm/datePicker/index.js.map +1 -0
  31. package/dist/components/commonForm/datePicker/style.less +11 -0
  32. package/dist/components/commonForm/formControl/index.js +183 -0
  33. package/dist/components/commonForm/formControl/index.js.map +1 -0
  34. package/dist/components/commonForm/formControl/style.less +8 -0
  35. package/dist/components/commonForm/index.js +208 -0
  36. package/dist/components/commonForm/index.js.map +1 -0
  37. package/dist/components/commonForm/inputNumber/index.js +291 -0
  38. package/dist/components/commonForm/inputNumber/index.js.map +1 -0
  39. package/dist/components/commonForm/inputNumber/style.less +17 -0
  40. package/dist/components/commonForm/radio/index.js +157 -0
  41. package/dist/components/commonForm/radio/index.js.map +1 -0
  42. package/dist/components/commonForm/radio/style.less +11 -0
  43. package/dist/components/commonForm/style.less +12 -0
  44. package/dist/components/deliverySearch/api.js +355 -0
  45. package/dist/components/deliverySearch/api.js.map +1 -0
  46. package/dist/components/deliverySearch/index.js +1254 -0
  47. package/dist/components/deliverySearch/index.js.map +1 -0
  48. package/dist/components/deliverySearch/index.less +624 -0
  49. package/dist/components/form/index.js +325 -0
  50. package/dist/components/form/index.js.map +1 -0
  51. package/dist/components/hardwareAPI/index.js +181 -0
  52. package/dist/components/hardwareAPI/index.js.map +1 -0
  53. package/dist/components/hotKey/config.js +306 -0
  54. package/dist/components/hotKey/config.js.map +1 -0
  55. package/dist/components/hotKey/hotKeyModal.js +479 -0
  56. package/dist/components/hotKey/hotKeyModal.js.map +1 -0
  57. package/dist/components/hotKey/index.js +782 -0
  58. package/dist/components/hotKey/index.js.map +1 -0
  59. package/dist/components/hotKey/localConfig.js +3831 -0
  60. package/dist/components/hotKey/localConfig.js.map +1 -0
  61. package/dist/components/hotKey/style.less +99 -0
  62. package/dist/components/hotKey/utils.js +135 -0
  63. package/dist/components/hotKey/utils.js.map +1 -0
  64. package/dist/components/input/index.js +257 -0
  65. package/dist/components/input/index.js.map +1 -0
  66. package/dist/components/input/style.less +107 -0
  67. package/dist/components/input/tplusInput/index.js +89 -0
  68. package/dist/components/input/tplusInput/index.js.map +1 -0
  69. package/dist/components/input/tplusInput/inputContent.js +130 -0
  70. package/dist/components/input/tplusInput/inputContent.js.map +1 -0
  71. package/dist/components/input/tplusInput/inputs.js +201 -0
  72. package/dist/components/input/tplusInput/inputs.js.map +1 -0
  73. package/dist/components/input/tplusInput/style.less +194 -0
  74. package/dist/components/input/utils/index.js +26 -0
  75. package/dist/components/input/utils/index.js.map +1 -0
  76. package/dist/components/inventorySearch/api.js +214 -0
  77. package/dist/components/inventorySearch/api.js.map +1 -0
  78. package/dist/components/inventorySearch/index.js +303 -0
  79. package/dist/components/inventorySearch/index.js.map +1 -0
  80. package/dist/components/inventorySearch/index.less +244 -0
  81. package/dist/components/inventorySearch/store.js +344 -0
  82. package/dist/components/inventorySearch/store.js.map +1 -0
  83. package/dist/components/inventorySearch/tab.js +255 -0
  84. package/dist/components/inventorySearch/tab.js.map +1 -0
  85. package/dist/components/keyboard/index.js +258 -0
  86. package/dist/components/keyboard/index.js.map +1 -0
  87. package/dist/components/keyboard/index.less +556 -0
  88. package/dist/components/keyboard/letterKeyboard.js +222 -0
  89. package/dist/components/keyboard/letterKeyboard.js.map +1 -0
  90. package/dist/components/keyboard/numKeyboard.js +458 -0
  91. package/dist/components/keyboard/numKeyboard.js.map +1 -0
  92. package/dist/components/keyboard/numKeyboardDigit.js +502 -0
  93. package/dist/components/keyboard/numKeyboardDigit.js.map +1 -0
  94. package/dist/components/keyboard/numKeyboardScan.js +215 -0
  95. package/dist/components/keyboard/numKeyboardScan.js.map +1 -0
  96. package/dist/components/keyboard/numberButtonInteger.js +296 -0
  97. package/dist/components/keyboard/numberButtonInteger.js.map +1 -0
  98. package/dist/components/keyboard/numberButton_input.js +300 -0
  99. package/dist/components/keyboard/numberButton_input.js.map +1 -0
  100. package/dist/components/keyboard/onlyKeyboard.js +90 -0
  101. package/dist/components/keyboard/onlyKeyboard.js.map +1 -0
  102. package/dist/components/keyboard/onlyLetterButton.js +187 -0
  103. package/dist/components/keyboard/onlyLetterButton.js.map +1 -0
  104. package/dist/components/keyboard/onlyLetterButton2.js +235 -0
  105. package/dist/components/keyboard/onlyLetterButton2.js.map +1 -0
  106. package/dist/components/keyboard/onlyLetterButton2.less +184 -0
  107. package/dist/components/keyboard/onlyNumberButton.js +128 -0
  108. package/dist/components/keyboard/onlyNumberButton.js.map +1 -0
  109. package/dist/components/keyboard/onlyNumberButton2.js +115 -0
  110. package/dist/components/keyboard/onlyNumberButton2.js.map +1 -0
  111. package/dist/components/keyboard/textKeyboard.js +50 -0
  112. package/dist/components/keyboard/textKeyboard.js.map +1 -0
  113. package/dist/components/layout/hamburger.js +29 -0
  114. package/dist/components/layout/hamburger.js.map +1 -0
  115. package/dist/components/layout/index.js +31 -0
  116. package/dist/components/layout/index.js.map +1 -0
  117. package/dist/components/layout/layout.js +182 -0
  118. package/dist/components/layout/layout.js.map +1 -0
  119. package/dist/components/layout/sider.js +165 -0
  120. package/dist/components/layout/sider.js.map +1 -0
  121. package/dist/components/layout/style.less +83 -0
  122. package/dist/components/loading/index.js +193 -0
  123. package/dist/components/loading/index.js.map +1 -0
  124. package/dist/components/loading/loadingContent.js +159 -0
  125. package/dist/components/loading/loadingContent.js.map +1 -0
  126. package/dist/components/loading/style.less +51 -0
  127. package/dist/components/loading/utils.js +29 -0
  128. package/dist/components/loading/utils.js.map +1 -0
  129. package/dist/components/message/index.js +286 -0
  130. package/dist/components/message/index.js.map +1 -0
  131. package/dist/components/message/index.less +150 -0
  132. package/dist/components/modal/index.js +93 -0
  133. package/dist/components/modal/index.js.map +1 -0
  134. package/dist/components/modal/index.less +19 -0
  135. package/dist/components/modalVertical/index.js +338 -0
  136. package/dist/components/modalVertical/index.js.map +1 -0
  137. package/dist/components/modalVertical/style.less +114 -0
  138. package/dist/components/modalWraper/index.js +482 -0
  139. package/dist/components/modalWraper/index.js.map +1 -0
  140. package/dist/components/modalWraper/style.less +363 -0
  141. package/dist/components/modalWraper/utils.js +49 -0
  142. package/dist/components/modalWraper/utils.js.map +1 -0
  143. package/dist/components/notification/index.js +124 -0
  144. package/dist/components/notification/index.js.map +1 -0
  145. package/dist/components/notification/index.less +58 -0
  146. package/dist/components/overflowTip/index.js +269 -0
  147. package/dist/components/overflowTip/index.js.map +1 -0
  148. package/dist/components/overflowTip/style.less +66 -0
  149. package/dist/components/page/index.js +49 -0
  150. package/dist/components/page/index.js.map +1 -0
  151. package/dist/components/page/index.less +26 -0
  152. package/dist/components/product/detail.js +97 -0
  153. package/dist/components/product/detail.js.map +1 -0
  154. package/dist/components/product/getCard.js +145 -0
  155. package/dist/components/product/getCard.js.map +1 -0
  156. package/dist/components/product/index.less +354 -0
  157. package/dist/components/progressState/EmptyAndErrorView.js +143 -0
  158. package/dist/components/progressState/EmptyAndErrorView.js.map +1 -0
  159. package/dist/components/progressState/ProgressState.js +157 -0
  160. package/dist/components/progressState/ProgressState.js.map +1 -0
  161. package/dist/components/progressState/index.js +14 -0
  162. package/dist/components/progressState/index.js.map +1 -0
  163. package/dist/components/progressState/style.less +65 -0
  164. package/dist/components/scan/index.js +219 -0
  165. package/dist/components/scan/index.js.map +1 -0
  166. package/dist/components/scan/index.less +34 -0
  167. package/dist/components/select/index.js +28 -0
  168. package/dist/components/select/index.js.map +1 -0
  169. package/dist/components/select/index.less +12 -0
  170. package/dist/components/settlement/asyncModal.js +178 -0
  171. package/dist/components/settlement/asyncModal.js.map +1 -0
  172. package/dist/components/settlement/index.js +16 -0
  173. package/dist/components/settlement/index.js.map +1 -0
  174. package/dist/components/settlement/settlement.js +5488 -0
  175. package/dist/components/settlement/settlement.js.map +1 -0
  176. package/dist/components/settlement/settlement.less +1604 -0
  177. package/dist/components/settlement/settlementStore.js +1460 -0
  178. package/dist/components/settlement/settlementStore.js.map +1 -0
  179. package/dist/components/settlement/utils.js +295 -0
  180. package/dist/components/settlement/utils.js.map +1 -0
  181. package/dist/components/socket/index.js +220 -0
  182. package/dist/components/socket/index.js.map +1 -0
  183. package/dist/components/spin/index.js +95 -0
  184. package/dist/components/spin/index.js.map +1 -0
  185. package/dist/components/spin/spin-style.less +436 -0
  186. package/dist/components/test/index.js +338 -0
  187. package/dist/components/test/index.js.map +1 -0
  188. package/dist/components/ticon/iconfont/demo.css +539 -0
  189. package/dist/components/ticon/iconfont/demo_index.html +4765 -0
  190. package/dist/components/ticon/iconfont/iconfont.css +811 -0
  191. package/dist/components/ticon/iconfont/iconfont.eot +0 -0
  192. package/dist/components/ticon/iconfont/iconfont.js +33 -0
  193. package/dist/components/ticon/iconfont/iconfont.js.map +1 -0
  194. package/dist/components/ticon/iconfont/iconfont.json +1402 -0
  195. package/dist/components/ticon/iconfont/iconfont.svg +572 -0
  196. package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
  197. package/dist/components/ticon/iconfont/iconfont.woff +0 -0
  198. package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
  199. package/dist/components/ticon/index.js +60 -0
  200. package/dist/components/ticon/index.js.map +1 -0
  201. package/dist/components/touchScroll/index.js +182 -0
  202. package/dist/components/touchScroll/index.js.map +1 -0
  203. package/dist/components/touchTable/AuthProcess.js +42 -0
  204. package/dist/components/touchTable/AuthProcess.js.map +1 -0
  205. package/dist/components/touchTable/generateWater.js +59 -0
  206. package/dist/components/touchTable/generateWater.js.map +1 -0
  207. package/dist/components/touchTable/index.js +958 -0
  208. package/dist/components/touchTable/index.js.map +1 -0
  209. package/dist/components/touchTable/index.less +190 -0
  210. package/dist/components/touchTable/utils.js +14 -0
  211. package/dist/components/touchTable/utils.js.map +1 -0
  212. package/dist/demo/PopOverDemo.js +126 -0
  213. package/dist/demo/PopOverDemo.js.map +1 -0
  214. package/dist/index.js +246 -0
  215. package/dist/index.js.map +1 -0
  216. package/dist/util/tools.js +210 -0
  217. package/dist/util/tools.js.map +1 -0
  218. package/package.json +1 -1
@@ -0,0 +1,974 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
8
+
9
+ var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
10
+
11
+ var _map = require('babel-runtime/core-js/map');
12
+
13
+ var _map2 = _interopRequireDefault(_map);
14
+
15
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
16
+
17
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
18
+
19
+ var _createClass2 = require('babel-runtime/helpers/createClass');
20
+
21
+ var _createClass3 = _interopRequireDefault(_createClass2);
22
+
23
+ var _BTPrintFormatUtil = require('./BTPrintFormatUtil');
24
+
25
+ var _BTPrintFormatUtil2 = _interopRequireDefault(_BTPrintFormatUtil);
26
+
27
+ var _api = require('./api');
28
+
29
+ var _api2 = _interopRequireDefault(_api);
30
+
31
+ var _mutantsUtil = require('mutants-util');
32
+
33
+ var _tplusPoslogin = require('tplus-poslogin');
34
+
35
+ var _tools = require('../../util/tools');
36
+
37
+ var _tools2 = _interopRequireDefault(_tools);
38
+
39
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40
+
41
+ var IdsettleStyleList = {
42
+ '10': '微信',
43
+ '11': '转账',
44
+ '12': '扫码收款',
45
+ '13': '代金券',
46
+ '1': '现金',
47
+ '5': '支票',
48
+ '4': '银行汇款',
49
+ '3': '银行本票',
50
+ '2': '信用卡',
51
+ '6': '积分储值卡',
52
+ '7': '储值卡',
53
+ '8': '积分抵现',
54
+ '9': '支付宝'
55
+ };
56
+
57
+ var PrintUtil = function () {
58
+ function PrintUtil() {
59
+ var _this2 = this;
60
+
61
+ (0, _classCallCheck3.default)(this, PrintUtil);
62
+
63
+ this.doTestPrint = function (printParams, callback) {
64
+ _this2.cloudAddList(printParams, function (result) {
65
+ var ret = result.ret;
66
+
67
+ if (ret === 0) {
68
+ _this2.cloudPrint('\n\n' + '飞蛾打印机测试打印成功。' + '\n\n', printParams, callback);
69
+ } else {
70
+ if (typeof callback == 'function') callback(result);
71
+ }
72
+ });
73
+ };
74
+
75
+ this.doOnlyRetail = function (printParams, Id, callback) {
76
+ _this2.doPrint(printParams, Id, callback);
77
+ };
78
+
79
+ this.doPrint = function (printParams, Id, callback) {
80
+ if (!printParams || !Id) return;
81
+ var _this = _this2;
82
+ _api2.default.getPrintDataInfo(Id).then(function (ret) {
83
+ var _ref = ret || {},
84
+ Store = _ref.Store,
85
+ UserName = _ref.UserName,
86
+ Code = _ref.Code,
87
+ CreatedTime = _ref.CreatedTime,
88
+ TotalCount = _ref.TotalCount,
89
+ TotalTaxAmount = _ref.TotalTaxAmount,
90
+ WipeChange = _ref.WipeChange,
91
+ RetailDetails = _ref.RetailDetails,
92
+ Member = _ref.Member,
93
+ BalanceIntegral = _ref.BalanceIntegral,
94
+ Integral = _ref.Integral,
95
+ BalanceStorage = _ref.BalanceStorage;
96
+
97
+ Member = _tools2.default.changePrivateInfo(Member, 'print');
98
+
99
+ var details = [];
100
+ if (RetailDetails && RetailDetails.length > 0) {
101
+ RetailDetails.map(function (item) {
102
+ var quantity = _this2.toDecimal2NoZero(item.Quantity);
103
+ // tool.formatPrecision (
104
+ // item.Quantity,
105
+ // this.Precision.Quantity
106
+ // );
107
+ quantity += item.Unit.Name;
108
+ var taxPrice = _this2.toDecimal2NoZero(item.TaxPrice);
109
+ // item.TaxPrice,
110
+ // this.Precision.Price
111
+ var taxAmount = _mutantsUtil.tools.formatPrecision(item.TaxAmount, _this2.Precision.TaxAmount);
112
+ details.push([item.Inventory.Name, quantity, taxPrice, taxAmount]);
113
+ });
114
+ }
115
+ var constr = _this.loadBTPrintData({
116
+ Store: Store,
117
+ UserName: UserName,
118
+ Code: Code,
119
+ CreatedTime: CreatedTime,
120
+ details: details,
121
+ TotalCount: TotalCount,
122
+ TotalTaxAmount: TotalTaxAmount,
123
+ WipeChange: WipeChange,
124
+ Member: Member,
125
+ BalanceIntegral: BalanceIntegral,
126
+ Integral: Integral,
127
+ BalanceStorage: BalanceStorage
128
+ });
129
+ _this.cloudPrint(constr, printParams, callback);
130
+ });
131
+ };
132
+
133
+ this.doDialyPrint = function (printParams, Id, callback) {
134
+ if (!Id) return;
135
+ var _this = _this2;
136
+ _api2.default.getDialyPrintDataInfo(Id).then(function (ret) {
137
+ var constr = _this.loadBTDutyAndDialyPrintData(ret, 'Dialy');
138
+ _this.cloudPrint(constr, printParams, callback);
139
+ });
140
+ };
141
+
142
+ this.doDutyPrint = function (printParams, Id, callback) {
143
+ if (!Id) return;
144
+ var _this = _this2;
145
+ _api2.default.getDutyPrintDataInfo(Id).then(function (ret) {
146
+ var constr = _this.loadBTDutyAndDialyPrintData(ret, 'Duty');
147
+ _this.cloudPrint(constr, printParams, callback);
148
+ });
149
+ };
150
+
151
+ this.doStoragePrint = function (printParams, Id, callback) {
152
+ if (!Id) return;
153
+ var _this = _this2;
154
+ _api2.default.getStoragePrintDataInfo(Id).then(function (ret) {
155
+ var _ref2 = ret || {},
156
+ Store = _ref2.Store,
157
+ StorageDetails = _ref2.StorageDetails,
158
+ MadeDate = _ref2.MadeDate,
159
+ Member = _ref2.Member,
160
+ CardCode = _ref2.CardCode,
161
+ StorageMutiSettleDetails = _ref2.StorageMutiSettleDetails,
162
+ CreatedTime = _ref2.CreatedTime,
163
+ Person = _ref2.Person;
164
+
165
+ Member = _tools2.default.changePrivateInfo(Member, 'print');
166
+ var constr = _this.loadBTStoragePrintData({
167
+ Store: Store,
168
+ StorageDetails: StorageDetails,
169
+ MadeDate: MadeDate,
170
+ Member: Member,
171
+ CardCode: CardCode,
172
+ StorageMutiSettleDetails: StorageMutiSettleDetails,
173
+ CreatedTime: CreatedTime,
174
+ Person: Person
175
+ });
176
+ _this.cloudPrint(constr, printParams, callback);
177
+ });
178
+ };
179
+
180
+ this.loadBTStoragePrintData = function (params) {
181
+ var templateContent = '';
182
+ var printEntity = {};
183
+
184
+ var _ref3 = params || {},
185
+ Store = _ref3.Store,
186
+ StorageDetails = _ref3.StorageDetails,
187
+ CreatedTime = _ref3.CreatedTime,
188
+ Member = _ref3.Member,
189
+ StorageMutiSettleDetails = _ref3.StorageMutiSettleDetails,
190
+ Person = _ref3.Person;
191
+
192
+ var _ref4 = Member || {},
193
+ Mobilephone = _ref4.Mobilephone,
194
+ MemberName = _ref4.Name,
195
+ CardCode = _ref4.CardCode;
196
+
197
+ var _ref5 = Person || {},
198
+ StorageName = _ref5.Name;
199
+
200
+ var _ref6 = StorageDetails[0] || {},
201
+ ThisStorageAmount = _ref6.ThisStorageAmount,
202
+ ThisPresentAmount = _ref6.ThisPresentAmount,
203
+ AfterBalanceStorage = _ref6.AfterBalanceStorage;
204
+
205
+ printEntity.headerMap = new _map2.default();
206
+ printEntity.footerMap1 = new _map2.default();
207
+ printEntity.footerMap2 = new _map2.default();
208
+ printEntity.headerMap.set('日期', _mutantsUtil.tools.changeDateFormat(CreatedTime));
209
+ printEntity.headerMap.set('储值业务员', StorageName || '');
210
+ printEntity.headerMap.set('会员卡号', CardCode || '');
211
+ printEntity.headerMap.set('手机号', Mobilephone || '');
212
+ printEntity.headerMap.set('会员姓名', MemberName || '');
213
+ printEntity.headerMap.set('本次储值金额', _mutantsUtil.tools.format(ThisStorageAmount) || '');
214
+ printEntity.headerMap.set('本次赠送金额', _mutantsUtil.tools.format(ThisPresentAmount) || '');
215
+ printEntity.headerMap.set('本次储值后金额', _mutantsUtil.tools.format(AfterBalanceStorage) || '');
216
+ if (StorageMutiSettleDetails && StorageMutiSettleDetails.length != 0) {
217
+ StorageMutiSettleDetails.forEach(function (details) {
218
+ var IdsettleStyle = details.IdsettleStyle,
219
+ StorageAmount = details.StorageAmount;
220
+
221
+ if (IdsettleStyle !== undefined && IdsettleStyle !== null) {
222
+ printEntity.headerMap.set(IdsettleStyleList[IdsettleStyle], StorageAmount || '0.00');
223
+ }
224
+ });
225
+ }
226
+ printEntity.headerMap.set('顾客签字', '');
227
+
228
+ // 设定打印尺寸
229
+ _BTPrintFormatUtil2.default.setLineByteSize(_this2.lineSize);
230
+
231
+ //单据头部
232
+ templateContent += '\n';
233
+ templateContent += _BTPrintFormatUtil2.default.printTitle(Store.Name || '');
234
+ if (printEntity.headerMap && printEntity.headerMap.size > 0) {
235
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.headerMap);
236
+ }
237
+ templateContent += '\n\n\n\n';
238
+ return templateContent;
239
+ };
240
+
241
+ this.loadBTDutyAndDialyPrintData = function (params, type) {
242
+ var _printEntity$detailCo;
243
+
244
+ var templateContent = '';
245
+ var printEntity = {};
246
+
247
+ var _ref7 = params || {},
248
+ Code = _ref7.Code,
249
+ Store = _ref7.Store,
250
+ UserName = _ref7.UserName,
251
+ POSCode = _ref7.POSCode,
252
+ POS = _ref7.POS,
253
+ POSName = _ref7.POSName,
254
+ WorkingDate = _ref7.WorkingDate,
255
+ StartDate = _ref7.StartDate,
256
+ ShiftDate = _ref7.ShiftDate,
257
+ DailyDate = _ref7.DailyDate,
258
+ RetailAmount = _ref7.RetailAmount,
259
+ ReturnAmount = _ref7.ReturnAmount,
260
+ StorageAmount = _ref7.StorageAmount,
261
+ CashOutAmount = _ref7.CashOutAmount,
262
+ CouponsDeduct = _ref7.CouponsDeduct,
263
+ CouponsAmount = _ref7.CouponsAmount,
264
+ OnlineAmount = _ref7.OnlineAmount,
265
+ TotalCount = _ref7.TotalCount,
266
+ TotalCustom = _ref7.TotalCustom,
267
+ Price = _ref7.Price,
268
+ InitialAmount = _ref7.InitialAmount,
269
+ ImprestAmount = _ref7.ImprestAmount,
270
+ ImprestBalanceAmount = _ref7.ImprestBalanceAmount,
271
+ ShiftVoucherDetails = _ref7.ShiftVoucherDetails,
272
+ DailyDetails = _ref7.DailyDetails,
273
+ WorkingTime = _ref7.WorkingTime,
274
+ ShiftTime = _ref7.ShiftTime,
275
+ StartTime = _ref7.StartTime,
276
+ DailyTime = _ref7.DailyTime,
277
+ Memo = _ref7.Memo;
278
+
279
+ printEntity.headerMap = new _map2.default();
280
+ printEntity.footerMap1 = new _map2.default();
281
+ printEntity.footerMap2 = new _map2.default();
282
+ printEntity.detailTopList = [];
283
+ printEntity.detailContentList = [];
284
+ printEntity.headerMap.set('单号', Code);
285
+ printEntity.headerMap.set('门店', Store.Name || '');
286
+ printEntity.headerMap.set('POS编码', POSCode || '');
287
+ printEntity.headerMap.set('POS名称', type == 'Duty' ? POSName : POS || '');
288
+ printEntity.headerMap.set('收 银 员', UserName || '');
289
+ printEntity.headerMap.set('上班日期', _mutantsUtil.tools.changeDateFormat(type == 'Duty' ? WorkingDate : StartDate).replace('00:00:00', type == 'Duty' ? WorkingTime : StartTime));
290
+ printEntity.headerMap.set(type == 'Duty' ? '交班日期' : '日结日期', _mutantsUtil.tools.changeDateFormat(type == 'Duty' ? ShiftDate : DailyDate).replace('00:00:00', type == 'Duty' ? ShiftTime : DailyTime));
291
+
292
+ printEntity.footerMap1.set('销售金额', _mutantsUtil.tools.format(RetailAmount) || '0.00');
293
+ printEntity.footerMap1.set('退货金额', _mutantsUtil.tools.format(ReturnAmount) || '0.00');
294
+ printEntity.footerMap1.set('净销售金额', _mutantsUtil.tools.format(RetailAmount + ReturnAmount) || '0.00');
295
+ printEntity.footerMap1.set('储值销售金额', _mutantsUtil.tools.format(StorageAmount) || '0.00');
296
+ printEntity.footerMap1.set('抵现销售金额', _mutantsUtil.tools.format(CashOutAmount) || '0.00');
297
+ printEntity.footerMap1.set('券抵扣(负劳务行)', _mutantsUtil.tools.format(CouponsDeduct) || '0.00');
298
+ printEntity.footerMap1.set('代金券抵扣', _mutantsUtil.tools.format(CouponsAmount) || '0.00');
299
+ printEntity.footerMap1.set('线上收款金额', _mutantsUtil.tools.format(OnlineAmount) || '0.00');
300
+ printEntity.footerMap1.set('水单总数', TotalCount || '0');
301
+ printEntity.footerMap1.set('来客数量', TotalCustom || '0');
302
+ printEntity.footerMap1.set('客单价', _mutantsUtil.tools.format(Price) || '0.00');
303
+
304
+ printEntity.detailTopList.push({
305
+ Caption: '结算方式',
306
+ IsTitle: false,
307
+ IsFoot: false
308
+ });
309
+ printEntity.detailTopList.push({
310
+ Caption: '零售收款金额',
311
+ IsTitle: false,
312
+ IsFoot: false
313
+ });
314
+ printEntity.detailTopList.push({
315
+ Caption: '储值金额',
316
+ IsTitle: false,
317
+ IsFoot: false
318
+ });
319
+
320
+ var details = [];
321
+ var DailyDetailsCommon = [];
322
+ if (type == 'Duty') {
323
+ DailyDetailsCommon = ShiftVoucherDetails;
324
+ } else {
325
+ DailyDetailsCommon = DailyDetails;
326
+ }
327
+ if (DailyDetailsCommon && DailyDetailsCommon.length != 0) {
328
+ DailyDetailsCommon.forEach(function (detailsOb) {
329
+ var OrigAmount = detailsOb.OrigAmount,
330
+ MemberDepositAmount = detailsOb.MemberDepositAmount,
331
+ SettleStyle = detailsOb.SettleStyle;
332
+
333
+ var _ref8 = SettleStyle || {},
334
+ Name = _ref8.Name;
335
+
336
+ details.push([Name ? Name : '', _mutantsUtil.tools.format(OrigAmount), _mutantsUtil.tools.format(MemberDepositAmount)]);
337
+ });
338
+ }
339
+ (_printEntity$detailCo = printEntity.detailContentList).push.apply(_printEntity$detailCo, details);
340
+
341
+ templateContent += '\n';
342
+ // printEntity.footerMap2.set('现金', BalanceIntegral || '');
343
+ printEntity.footerMap2.set('备用金初始金额', _mutantsUtil.tools.format(InitialAmount) || '0.00');
344
+ printEntity.footerMap2.set('增减备用金', _mutantsUtil.tools.format(ImprestAmount) || '0.00');
345
+ printEntity.footerMap2.set('备用金余额', _mutantsUtil.tools.format(InitialAmount + ImprestAmount) || '0.00');
346
+ // 设定打印尺寸
347
+ _BTPrintFormatUtil2.default.setLineByteSize(_this2.lineSize);
348
+
349
+ //单据头部
350
+ templateContent += '\n';
351
+ templateContent += _BTPrintFormatUtil2.default.printTitle(type == 'Duty' ? '交班' : '日结');
352
+ templateContent += _BTPrintFormatUtil2.default.drawSeparateLine();
353
+ if (printEntity.headerMap && printEntity.headerMap.size > 0) {
354
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.headerMap);
355
+ }
356
+ templateContent += '\n';
357
+ templateContent += _BTPrintFormatUtil2.default.printStarTitle('销售看板');
358
+ templateContent += _BTPrintFormatUtil2.default.drawSeparateLine();
359
+ //单据底部1
360
+ if (printEntity.footerMap1 && printEntity.footerMap1.size > 0) {
361
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.footerMap1);
362
+ }
363
+ templateContent += '\n';
364
+ templateContent += _BTPrintFormatUtil2.default.printStarTitle('收银统计');
365
+ templateContent += _BTPrintFormatUtil2.default.drawSeparateLine();
366
+
367
+ //单据内容--头部
368
+ var mhList = [];
369
+ if (printEntity.detailTopList && printEntity.detailTopList.length > 0) {
370
+ printEntity.detailTopList.forEach(function (item) {
371
+ var mh = {
372
+ headerText: item.Caption,
373
+ headerWeight: 1,
374
+ isTitle: item.IsTitle,
375
+ isFoot: item.IsFoot
376
+ };
377
+ mhList.push(mh);
378
+ });
379
+ }
380
+ //单据内容--明细
381
+ var bodyValueList = [];
382
+ printEntity.detailContentList.forEach(function (items) {
383
+ var bodyValue = [];
384
+ items.forEach(function (item) {
385
+ bodyValue.push(item);
386
+ });
387
+ bodyValueList.push(bodyValue);
388
+ });
389
+ templateContent += _BTPrintFormatUtil2.default.printMenuMSG(bodyValueList, mhList, true);
390
+
391
+ //单据底部2
392
+ if (printEntity.footerMap2 && printEntity.footerMap2.size > 0) {
393
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.footerMap2);
394
+ }
395
+ templateContent += _BTPrintFormatUtil2.default.drawSeparateLine2();
396
+ templateContent += '备注:' + (Memo || '');
397
+ templateContent += '\n'; //备注
398
+ templateContent += '\n';
399
+ templateContent += _BTPrintFormatUtil2.default.spaceCenterPrintMsg('收银员签字:', '收银主管签字:');
400
+ templateContent += '\n\n\n\n';
401
+ return templateContent;
402
+ };
403
+
404
+ this.loadBTPrintData = function (params) {
405
+ var _printEntity$detailCo2;
406
+
407
+ var templateContent = '';
408
+ var printEntity = {};
409
+
410
+ var _ref9 = params || {},
411
+ Store = _ref9.Store,
412
+ UserName = _ref9.UserName,
413
+ Code = _ref9.Code,
414
+ CreatedTime = _ref9.CreatedTime,
415
+ details = _ref9.details,
416
+ TotalCount = _ref9.TotalCount,
417
+ TotalTaxAmount = _ref9.TotalTaxAmount,
418
+ WipeChange = _ref9.WipeChange,
419
+ Member = _ref9.Member,
420
+ BalanceIntegral = _ref9.BalanceIntegral,
421
+ Integral = _ref9.Integral,
422
+ BalanceStorage = _ref9.BalanceStorage;
423
+
424
+ printEntity.headerMap = new _map2.default();
425
+ printEntity.detailTopList = [];
426
+ printEntity.detailContentList = [];
427
+ printEntity.footerMap1 = new _map2.default();
428
+ printEntity.footerMap2 = new _map2.default();
429
+ printEntity.headerMap.set('门店名称', Store.Name || '');
430
+ printEntity.headerMap.set('门店电话', Store.Telephone || '');
431
+ printEntity.headerMap.set('收银员', UserName || '');
432
+ printEntity.headerMap.set('单号', Code);
433
+ printEntity.headerMap.set('日期', _mutantsUtil.tools.changeDateFormat(CreatedTime));
434
+ printEntity.detailTopList.push({
435
+ Caption: '存货名称',
436
+ IsTitle: true,
437
+ IsFoot: false
438
+ });
439
+ printEntity.detailTopList.push({
440
+ Caption: '数量',
441
+ IsTitle: false,
442
+ IsFoot: false
443
+ });
444
+ printEntity.detailTopList.push({
445
+ Caption: '单价',
446
+ IsTitle: false,
447
+ IsFoot: false
448
+ });
449
+ printEntity.detailTopList.push({
450
+ Caption: '金额',
451
+ IsTitle: false,
452
+ IsFoot: false
453
+ });
454
+ (_printEntity$detailCo2 = printEntity.detailContentList).push.apply(_printEntity$detailCo2, (0, _toConsumableArray3.default)(details));
455
+ printEntity.footerMap1.set('数量', TotalCount);
456
+ printEntity.footerMap1.set('金额', TotalTaxAmount);
457
+ printEntity.footerMap1.set('抹零', WipeChange);
458
+ printEntity.footerMap2.set('会员卡号', Member && Member.CardCode || '');
459
+ printEntity.footerMap2.set('会员手机', Member && Member.Mobilephone || '');
460
+ printEntity.footerMap2.set('积分余额', BalanceIntegral || '');
461
+ printEntity.footerMap2.set('本次积分', Integral || '');
462
+ printEntity.footerMap2.set('储值余额', BalanceStorage || '');
463
+ // 设定打印尺寸
464
+ _BTPrintFormatUtil2.default.setLineByteSize(_this2.lineSize);
465
+
466
+ //单据头部
467
+ templateContent += '\n';
468
+ if (printEntity.headerMap && printEntity.headerMap.size > 0) {
469
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.headerMap);
470
+ }
471
+ //单据内容--头部
472
+ var mhList = [];
473
+ if (printEntity.detailTopList && printEntity.detailTopList.length > 0) {
474
+ printEntity.detailTopList.forEach(function (item) {
475
+ var mh = {
476
+ headerText: item.Caption,
477
+ headerWeight: 1,
478
+ isTitle: item.IsTitle,
479
+ isFoot: item.IsFoot
480
+ };
481
+ mhList.push(mh);
482
+ });
483
+ }
484
+ //单据内容--明细
485
+ var bodyValueList = [];
486
+ printEntity.detailContentList.forEach(function (items) {
487
+ var bodyValue = [];
488
+ items.forEach(function (item) {
489
+ bodyValue.push(item);
490
+ });
491
+ bodyValueList.push(bodyValue);
492
+ });
493
+ templateContent += _BTPrintFormatUtil2.default.printMenuMSG(bodyValueList, mhList, true);
494
+ //单据底部1
495
+ if (printEntity.footerMap1 && printEntity.footerMap1.size > 0) {
496
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.footerMap1);
497
+ }
498
+ templateContent += _BTPrintFormatUtil2.default.drawSeparateLine();
499
+ templateContent += '\n';
500
+ //单据底部2
501
+ if (printEntity.footerMap2 && printEntity.footerMap2.size > 0) {
502
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.footerMap2);
503
+ }
504
+ templateContent += '\n';
505
+ templateContent += _BTPrintFormatUtil2.default.drawSeparateLine2();
506
+ templateContent += '\n';
507
+ templateContent += '\t谢谢惠顾,欢迎再次光临';
508
+ templateContent += '\n\n\n';
509
+ return templateContent;
510
+ };
511
+
512
+ this.cloudPrint = function (cloudContents, printParams, callback) {
513
+ var _ref10 = printParams || {},
514
+ Open = _ref10.Open,
515
+ Key = _ref10.Key,
516
+ Sign = _ref10.Sign,
517
+ Name = _ref10.Name,
518
+ Card = _ref10.Card,
519
+ isLocalSunMi = _ref10.isLocalSunMi;
520
+ // 商米没有配置则调用本地打印接口
521
+
522
+
523
+ if (_this2.isHorizontalSunMi && isLocalSunMi && Open) {
524
+ _this2.sunMiLocalPrint(cloudContents, Name, callback);
525
+ } else if (_this2.isHorizontalSunMi && !Open) {
526
+ console.log(cloudContents);
527
+ _this2.sunmiPrint(cloudContents, callback);
528
+ } else if (Open) {
529
+ var arr = [];
530
+ arr.push(Sign, Key);
531
+ if (Name) arr.push(Name);
532
+ if (Card) arr.push(Card);
533
+ var printerContent = arr.join('#');
534
+ var PrintCount = _this2.PrintCount; //打印次数
535
+ _api2.default.openPrintMsg({
536
+ content: cloudContents,
537
+ printerContent: printerContent,
538
+ apiname: 'Open_printMsg',
539
+ deviceCode: Sign,
540
+ times: PrintCount
541
+ }).then(function (s) {
542
+ if (typeof callback == 'function' && s && s.data) callback(s.data);
543
+ });
544
+ }
545
+ };
546
+
547
+ this.sunmiPrint = function (cloudContents, callback) {
548
+ window.sunMi_OperatingCashier && window.sunMi_OperatingCashier
549
+ // 检测打印机状态
550
+ .updatePrinterState().then(function (status) {
551
+ var _ref11 = status || {},
552
+ state = _ref11.state,
553
+ message = _ref11.message;
554
+
555
+ if (state == 1) {
556
+ window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.PrintSmallTicketter(cloudContents + '\n\n').then(function (ret) {
557
+ if (ret && ret.state && ret.state == 200) {
558
+ callback && callback({
559
+ ret: 0,
560
+ msg: "打印成功"
561
+ });
562
+ } else {
563
+ callback && callback({
564
+ ret: -1,
565
+ msg: ret.message ? ret.message : "打印失败"
566
+ });
567
+ }
568
+ });
569
+ } else {
570
+ callback && callback({
571
+ ret: -1,
572
+ msg: message ? message : "打印失败"
573
+ });
574
+ }
575
+ });
576
+ };
577
+
578
+ this.sunMiLocalPrint = function (cloudContents, deviceName, callback) {
579
+ window.LocalPrintPlugin.printByDeviceName({ deviceName: deviceName, printContent: cloudContents }).then(function (res) {
580
+ console.log("商米本地打印成功", res);
581
+ callback && callback({
582
+ ret: 0,
583
+ msg: "打印成功"
584
+ });
585
+ }).catch(function (error) {
586
+ console.log("商米本地打印失败", error);
587
+
588
+ var _ref12 = error || {},
589
+ message = _ref12.message;
590
+
591
+ callback && callback({
592
+ ret: -1,
593
+ msg: message || "打印失败"
594
+ });
595
+ });
596
+ };
597
+
598
+ this.doProjectStoragePrint = function (printParams, Id, callback) {
599
+ if (!Id) return;
600
+ var _this = _this2;
601
+ _api2.default.getProjectStoragePrintDataInfo(Id).then(function (ret) {
602
+ var _ref13 = ret || {},
603
+ Store = _ref13.Store,
604
+ Details = _ref13.Details,
605
+ MadeDate = _ref13.MadeDate,
606
+ Member = _ref13.Member,
607
+ StorageAmount = _ref13.StorageAmount,
608
+ StorageMutiSettleDetails = _ref13.StorageMutiSettleDetails,
609
+ CreatedTime = _ref13.CreatedTime;
610
+
611
+ Member = _tools2.default.changePrivateInfo(Member, 'print');
612
+ var constr = _this.loadBTProjectStoragePrintData({
613
+ Store: Store,
614
+ Details: Details,
615
+ MadeDate: MadeDate,
616
+ Member: Member,
617
+ StorageAmount: StorageAmount,
618
+ StorageMutiSettleDetails: StorageMutiSettleDetails,
619
+ CreatedTime: CreatedTime
620
+ });
621
+ _this.cloudPrint(constr, printParams, callback);
622
+ });
623
+ };
624
+
625
+ this.loadBTProjectStoragePrintData = function (params) {
626
+ var _printEntity$detailCo3;
627
+
628
+ var templateContent = '';
629
+ var printEntity = {};
630
+
631
+ var _ref14 = params || {},
632
+ Store = _ref14.Store,
633
+ Details = _ref14.Details,
634
+ CreatedTime = _ref14.CreatedTime,
635
+ Member = _ref14.Member,
636
+ StorageAmount = _ref14.StorageAmount,
637
+ StorageMutiSettleDetails = _ref14.StorageMutiSettleDetails;
638
+
639
+ var _ref15 = Member || {},
640
+ Mobilephone = _ref15.Mobilephone,
641
+ CardCode = _ref15.Code,
642
+ MemberName = _ref15.Name;
643
+
644
+ var _ref16 = Details[0].Person || {},
645
+ PersonName = _ref16.Name;
646
+ //const { StorageAmount} = Details[0] || {};
647
+
648
+
649
+ printEntity.detailTopList = [];
650
+ printEntity.detailContentList = [];
651
+ printEntity.headerMap = new _map2.default();
652
+ printEntity.footerMap = new _map2.default();
653
+ printEntity.headerMap.set('日期', _mutantsUtil.tools.changeDateFormat(CreatedTime));
654
+ printEntity.headerMap.set('储值业务员', PersonName || '');
655
+ printEntity.detailTopList.push({
656
+ Caption: '序号',
657
+ IsTitle: false,
658
+ IsFoot: false
659
+ });
660
+ printEntity.detailTopList.push({
661
+ Caption: '项目',
662
+ IsTitle: false,
663
+ IsFoot: false
664
+ });
665
+ printEntity.detailTopList.push({
666
+ Caption: '数量',
667
+ IsTitle: false,
668
+ IsFoot: false
669
+ });
670
+ var details = [];
671
+ if (Details && Details.length > 0) {
672
+ var i = 0;
673
+ Details.map(function (item) {
674
+ i++;
675
+ var quantity = _mutantsUtil.tools.formatPrecision(_this2.toDecimal2NoZero(item.Quantity), 0);
676
+ details.push([i, item.ServiceProject.Name, quantity]);
677
+ });
678
+ }
679
+ (_printEntity$detailCo3 = printEntity.detailContentList).push.apply(_printEntity$detailCo3, details);
680
+ printEntity.footerMap.set('会员卡号', CardCode || '');
681
+ printEntity.footerMap.set('手机号', Mobilephone || '');
682
+ printEntity.footerMap.set('会员姓名', MemberName || '');
683
+ printEntity.footerMap.set('储值金额', _mutantsUtil.tools.formatPrecision(StorageAmount, 2));
684
+
685
+ if (StorageMutiSettleDetails && StorageMutiSettleDetails.length != 0) {
686
+ StorageMutiSettleDetails.forEach(function (items) {
687
+ var IdsettleStyle = items.IdsettleStyle,
688
+ storageAmount = items.StorageAmount;
689
+
690
+ if (IdsettleStyle !== undefined && IdsettleStyle !== null) {
691
+ printEntity.footerMap.set(IdsettleStyleList[IdsettleStyle], _mutantsUtil.tools.formatPrecision(storageAmount, 2));
692
+ }
693
+ });
694
+ }
695
+ printEntity.footerMap.set('顾客签字', '');
696
+
697
+ // 设定打印尺寸
698
+ _BTPrintFormatUtil2.default.setLineByteSize(_this2.lineSize);
699
+
700
+ //单据头部
701
+ templateContent += '\n';
702
+ templateContent += _BTPrintFormatUtil2.default.printTitle(Store.Name || '');
703
+ if (printEntity.headerMap && printEntity.headerMap.size > 0) {
704
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.headerMap);
705
+ }
706
+ //单据内容--头部
707
+ _BTPrintFormatUtil2.default.drawSeparateLine();
708
+ var mhList = [];
709
+ if (printEntity.detailTopList && printEntity.detailTopList.length > 0) {
710
+ printEntity.detailTopList.forEach(function (item) {
711
+ var mh = {
712
+ headerText: item.Caption,
713
+ headerWeight: 1,
714
+ isTitle: item.IsTitle,
715
+ isFoot: item.IsFoot
716
+ };
717
+ mhList.push(mh);
718
+ });
719
+ }
720
+ _BTPrintFormatUtil2.default.drawSeparateLine();
721
+ //单据内容--明细
722
+ var bodyValueList = [];
723
+
724
+ printEntity.detailContentList.forEach(function (items) {
725
+ var bodyValue = [];
726
+ items.forEach(function (item) {
727
+ bodyValue.push(item);
728
+ });
729
+ bodyValueList.push(bodyValue);
730
+ });
731
+ templateContent += _BTPrintFormatUtil2.default.printMenuMSG(bodyValueList, mhList, true);
732
+ //单据底部
733
+ templateContent += '\n';
734
+ if (printEntity.footerMap && printEntity.footerMap.size > 0) {
735
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.footerMap);
736
+ }
737
+ templateContent += '\n\n\n\n';
738
+ return templateContent;
739
+ };
740
+
741
+ this.doProjectConsumePrint = function (printParams, Id, callback) {
742
+ if (!Id) return;
743
+ var _this = _this2;
744
+ _api2.default.getProjectConsumePrintDataInfo(Id).then(function (ret) {
745
+ var _ref17 = ret || {},
746
+ Store = _ref17.Store,
747
+ RetailDetails = _ref17.RetailDetails,
748
+ MadeDate = _ref17.MadeDate,
749
+ Member = _ref17.Member,
750
+ Person = _ref17.Person,
751
+ CreatedTime = _ref17.CreatedTime;
752
+
753
+ Member = _tools2.default.changePrivateInfo(Member, 'print');
754
+ var constr = _this.loadBTProjectConsumePrintData({
755
+ Store: Store,
756
+ RetailDetails: RetailDetails,
757
+ MadeDate: MadeDate,
758
+ Member: Member,
759
+ Person: Person,
760
+ CreatedTime: CreatedTime
761
+ });
762
+ _this.cloudPrint(constr, printParams, callback);
763
+ });
764
+ };
765
+
766
+ this.loadBTProjectConsumePrintData = function (params) {
767
+ var _printEntity$detailCo4;
768
+
769
+ var templateContent = '';
770
+ var printEntity = {};
771
+
772
+ var _ref18 = params || {},
773
+ Store = _ref18.Store,
774
+ RetailDetails = _ref18.RetailDetails,
775
+ CreatedTime = _ref18.CreatedTime,
776
+ Member = _ref18.Member,
777
+ Person = _ref18.Person;
778
+
779
+ var _ref19 = Member || {},
780
+ Mobilephone = _ref19.Mobilephone,
781
+ CardCode = _ref19.Code,
782
+ MemberName = _ref19.Name;
783
+
784
+ var _ref20 = Person || {},
785
+ PersonName = _ref20.Name;
786
+
787
+ printEntity.detailTopList = [];
788
+ printEntity.detailContentList = [];
789
+ //const { StorageAmount} = Details[0] || {};
790
+ printEntity.headerMap = new _map2.default();
791
+ printEntity.footerMap = new _map2.default();
792
+ printEntity.headerMap.set('日期', _mutantsUtil.tools.changeDateFormat(CreatedTime));
793
+ printEntity.headerMap.set('营业员', PersonName || '');
794
+ printEntity.footerMap.set('会员卡号', CardCode || '');
795
+ printEntity.footerMap.set('会员姓名', MemberName || '');
796
+ printEntity.footerMap.set('会员手机号', Mobilephone || '');
797
+ printEntity.footerMap.set('顾客签字', '');
798
+
799
+ printEntity.detailTopList.push({
800
+ Caption: '套餐',
801
+ IsTitle: true,
802
+ IsFoot: false
803
+ });
804
+ printEntity.detailTopList.push({
805
+ Caption: '项目',
806
+ IsTitle: false,
807
+ IsFoot: false
808
+ });
809
+ printEntity.detailTopList.push({
810
+ Caption: '本次使用',
811
+ IsTitle: false,
812
+ IsFoot: false
813
+ });
814
+ printEntity.detailTopList.push({
815
+ Caption: '剩余次数',
816
+ IsTitle: false,
817
+ IsFoot: false
818
+ });
819
+ var details = [];
820
+
821
+ if (RetailDetails && RetailDetails.length > 0) {
822
+ RetailDetails.map(function (item) {
823
+ var serviceprojectpackagename = _mutantsUtil.tools.getDynamicProperty(item.DynamicPropertyKeys, item.DynamicPropertyValues, 'serviceprojectpackagename');
824
+ var serviceprojectname = _mutantsUtil.tools.getDynamicProperty(item.DynamicPropertyKeys, item.DynamicPropertyValues, 'serviceprojectname');
825
+ var UsedTimes = _mutantsUtil.tools.formatPrecision(_this2.toDecimal2NoZero(_mutantsUtil.tools.getDynamicProperty(item.DynamicPropertyKeys, item.DynamicPropertyValues, 'usedtimes')), 0);
826
+ var BalanceTimes = _mutantsUtil.tools.formatPrecision(_this2.toDecimal2NoZero(_mutantsUtil.tools.getDynamicProperty(item.DynamicPropertyKeys, item.DynamicPropertyValues, 'balancetimes')), 0);
827
+
828
+ details.push([serviceprojectpackagename, serviceprojectname, UsedTimes, BalanceTimes == '0' ? '' : BalanceTimes]);
829
+ });
830
+ }
831
+ (_printEntity$detailCo4 = printEntity.detailContentList).push.apply(_printEntity$detailCo4, details);
832
+
833
+ // 设定打印尺寸
834
+ _BTPrintFormatUtil2.default.setLineByteSize(_this2.lineSize);
835
+
836
+ //单据头部
837
+ templateContent += '\n';
838
+ templateContent += _BTPrintFormatUtil2.default.printTitle(Store.Name || '');
839
+ if (printEntity.headerMap && printEntity.headerMap.size > 0) {
840
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.headerMap);
841
+ }
842
+ //单据内容--头部
843
+ _BTPrintFormatUtil2.default.drawSeparateLine();
844
+ var mhList = [];
845
+ if (printEntity.detailTopList && printEntity.detailTopList.length > 0) {
846
+ printEntity.detailTopList.forEach(function (item) {
847
+ var mh = {
848
+ headerText: item.Caption,
849
+ headerWeight: 1,
850
+ isTitle: item.IsTitle,
851
+ isFoot: item.IsFoot
852
+ };
853
+ mhList.push(mh);
854
+ });
855
+ }
856
+ _BTPrintFormatUtil2.default.drawSeparateLine();
857
+ //单据内容--明细
858
+ var bodyValueList = [];
859
+
860
+ printEntity.detailContentList.forEach(function (items) {
861
+ var bodyValue = [];
862
+ items.forEach(function (item) {
863
+ bodyValue.push(item);
864
+ });
865
+ bodyValueList.push(bodyValue);
866
+ });
867
+ templateContent += _BTPrintFormatUtil2.default.printMenuMSG(bodyValueList, mhList, true);
868
+ //单据底部
869
+ templateContent += '\n';
870
+ if (printEntity.footerMap && printEntity.footerMap.size > 0) {
871
+ templateContent += _BTPrintFormatUtil2.default.leftPrintMsg(printEntity.footerMap);
872
+ }
873
+ templateContent += '\n\n\n\n';
874
+ console.log('扣次打印', templateContent);
875
+ return templateContent;
876
+ };
877
+
878
+ this.cloudAddList = function (printParams, callback) {
879
+ var _ref21 = printParams || {},
880
+ Key = _ref21.Key,
881
+ Sign = _ref21.Sign,
882
+ Name = _ref21.Name,
883
+ Card = _ref21.Card;
884
+
885
+ var arr = [];
886
+ arr.push(Sign, Key);
887
+ if (Name) arr.push(Name);
888
+ if (Card) arr.push(Card);
889
+ var printerContent = arr.join('#');
890
+ var PrintCount = _this2.PrintCount; //按照添加一次的
891
+ _api2.default.openPrinterAddlist({
892
+ content: '',
893
+ printerContent: printerContent,
894
+ apiname: 'Open_printerAddlist',
895
+ deviceCode: Sign,
896
+ times: PrintCount
897
+ }).then(function (s) {
898
+ if (typeof callback == 'function' && s && s.data) callback(s.data);
899
+ });
900
+ };
901
+
902
+ this.BTPrintEntity = {};
903
+ this.BTPrintContent = '';
904
+ this.PrintCount = 1;
905
+ this.lineSize = 32;
906
+ this.Precision = {
907
+ Quantity: (0, _tplusPoslogin.PosInitData)('QuantityPrecision'),
908
+ Price: (0, _tplusPoslogin.PosInitData)('PricePrecision'),
909
+ TaxAmount: (0, _tplusPoslogin.PosInitData)('AmountPrecision')
910
+ };
911
+
912
+ var _ref22 = _mutantsUtil.platform || {},
913
+ isHorizontalSunMi = _ref22.isHorizontalSunMi;
914
+
915
+ this.isHorizontalSunMi = !!isHorizontalSunMi;
916
+ }
917
+
918
+ //执行测试打印
919
+
920
+
921
+ // 触发打印
922
+
923
+
924
+ // 日结打印
925
+
926
+
927
+ // 交班打印
928
+
929
+
930
+ // 储值打印
931
+
932
+
933
+ //储值打印
934
+
935
+
936
+ // 交班日结打印 type: Duty 交班 Dialy 日结
937
+
938
+
939
+ //正常打印机(58mm)数据 小票打印
940
+
941
+
942
+ //小票-云打印
943
+
944
+
945
+ //小票-商米打印
946
+
947
+
948
+ ////
949
+
950
+ // 项目储值打印
951
+
952
+ //项目储值打印
953
+
954
+
955
+ // 扣次打印
956
+
957
+ //扣次打印
958
+
959
+ ////
960
+
961
+
962
+ (0, _createClass3.default)(PrintUtil, [{
963
+ key: 'toDecimal2NoZero',
964
+ value: function toDecimal2NoZero(x) {
965
+ var f = Math.round(x * 100) / 100;
966
+ var s = f.toString();
967
+ return s;
968
+ }
969
+ }]);
970
+ return PrintUtil;
971
+ }();
972
+
973
+ exports.default = PrintUtil;
974
+ //# sourceMappingURL=index.js.map