tplus-components-touch 3.30.1 → 3.31.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/billSearch/index.js +156 -18
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +6 -3
- package/dist/components/cloudPrint/api.js +85 -43
- package/dist/components/cloudPrint/api.js.map +1 -1
- package/dist/components/cloudPrint/printDispatch.js +213 -108
- package/dist/components/cloudPrint/printDispatch.js.map +1 -1
- package/dist/components/hotKey/localConfig.js +133 -14
- package/dist/components/hotKey/localConfig.js.map +1 -1
- package/dist/components/inventorySearch/tab.js +77 -67
- package/dist/components/inventorySearch/tab.js.map +1 -1
- package/dist/components/keyboard/numberButton_input.js +4 -2
- package/dist/components/keyboard/numberButton_input.js.map +1 -1
- package/dist/components/keyboard/onlyLetterButton2.less +35 -40
- package/dist/components/progressState/EmptyAndErrorView.js +4 -3
- package/dist/components/progressState/EmptyAndErrorView.js.map +1 -1
- package/dist/components/progressState/ProgressState.js +2 -1
- package/dist/components/progressState/ProgressState.js.map +1 -1
- package/dist/components/settlement/moreCzkTable/index.js +156 -0
- package/dist/components/settlement/moreCzkTable/index.js.map +1 -0
- package/dist/components/settlement/moreCzkTable/style.less +7 -0
- package/dist/components/settlement/settlement.js +740 -479
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlement.less +75 -5
- package/dist/components/settlement/settlementStore.js +542 -313
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/ticon/iconfont/demo_index.html +5248 -5202
- package/dist/components/ticon/iconfont/iconfont.css +895 -887
- package/dist/components/ticon/iconfont/iconfont.js +6 -6
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
- package/dist/components/ticon/iconfont/iconfont.json +1549 -1535
- package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
- package/dist/components/touchScroll/index.js +6 -2
- package/dist/components/touchScroll/index.js.map +1 -1
- package/dist/components/touchTable/index.js +4 -3
- package/dist/components/touchTable/index.js.map +1 -1
- package/dist/components/touchTable/index.less +20 -13
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/package.json +35 -35
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.printDispatch = exports.DoNameList = undefined;
|
|
6
|
+
exports.getCheckedPrintTypeDefaults = exports.isOldOpen = exports.printDispatch = exports.DoNameList = undefined;
|
|
7
7
|
|
|
8
8
|
var _regenerator = require('babel-runtime/regenerator');
|
|
9
9
|
|
|
@@ -21,6 +21,8 @@ var _mutantsUtil = require('mutants-util');
|
|
|
21
21
|
|
|
22
22
|
var _mutantsMicrofx = require('mutants-microfx');
|
|
23
23
|
|
|
24
|
+
var _tplusPoslogin = require('tplus-poslogin');
|
|
25
|
+
|
|
24
26
|
var _index = require('./index');
|
|
25
27
|
|
|
26
28
|
var _index2 = _interopRequireDefault(_index);
|
|
@@ -29,21 +31,27 @@ var _message = require('../message');
|
|
|
29
31
|
|
|
30
32
|
var _message2 = _interopRequireDefault(_message);
|
|
31
33
|
|
|
34
|
+
var _api = require('./api');
|
|
35
|
+
|
|
36
|
+
var _api2 = _interopRequireDefault(_api);
|
|
37
|
+
|
|
32
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
39
|
|
|
34
|
-
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
|
|
40
|
+
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail'); /*
|
|
41
|
+
* @Descripttion:
|
|
42
|
+
* @version:
|
|
43
|
+
* @Author: chenlongad
|
|
44
|
+
* @Date: 2020-11-17 10:02:02
|
|
45
|
+
* @LastEditors: chenlongad
|
|
46
|
+
* @LastEditTime: 2021-12-27 14:41:52
|
|
47
|
+
*/
|
|
48
|
+
|
|
35
49
|
|
|
36
50
|
// 打印调用方法对照
|
|
37
|
-
/*
|
|
38
|
-
* @Descripttion:
|
|
39
|
-
* @version:
|
|
40
|
-
* @Author: chenlongad
|
|
41
|
-
* @Date: 2020-11-17 10:02:02
|
|
42
|
-
* @LastEditors: chenlongad
|
|
43
|
-
* @LastEditTime: 2021-02-21 10:18:28
|
|
44
|
-
*/
|
|
45
51
|
var DoNameList = exports.DoNameList = {
|
|
46
52
|
DO_PRINT: "doPrint",
|
|
53
|
+
DO_ONLY_PRINT: "doOnlyRetail",
|
|
54
|
+
DO_MT_RETAIL: "doMtRetail",
|
|
47
55
|
DO_DUTY_PRINT: "doDutyPrint",
|
|
48
56
|
DO_DIALY_PRINT: "doDialyPrint",
|
|
49
57
|
DO_STORAGE_PRINT: "doStoragePrint",
|
|
@@ -52,162 +60,155 @@ var DoNameList = exports.DoNameList = {
|
|
|
52
60
|
|
|
53
61
|
// 打印调用方法名字对照
|
|
54
62
|
};var DoDesName = {
|
|
55
|
-
doPrint: "",
|
|
63
|
+
doPrint: "小票",
|
|
64
|
+
doMtRetail: "美团",
|
|
65
|
+
doOnlyRetail: "小票",
|
|
56
66
|
doDutyPrint: "交班",
|
|
57
67
|
doDialyPrint: "日结",
|
|
58
68
|
doStoragePrint: "储值",
|
|
59
|
-
doProjectStoragePrint: "
|
|
69
|
+
doProjectStoragePrint: "项目储值",
|
|
60
70
|
doProjectConsumePrint: "扣次"
|
|
61
71
|
|
|
62
72
|
// window打印调用方法对照
|
|
63
73
|
};var DoPrintGlobalFunction = {
|
|
64
|
-
doPrint: "",
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
doPrint: "RetailPrintProcessBlock",
|
|
75
|
+
doOnlyRetail: "OnlyRetailPrintProcess",
|
|
76
|
+
doMtRetail: "MeiTuanPrintProcessBlock",
|
|
77
|
+
doDutyPrint: "printShiftVoucher",
|
|
78
|
+
doDialyPrint: "printDailyVoucher",
|
|
67
79
|
doStoragePrint: "StoragePrintProcessBlock",
|
|
68
80
|
doProjectStoragePrint: "ProjectStoragePrintProcessBlock",
|
|
69
81
|
doProjectConsumePrint: "ProjectConsumePrintProcessBlock"
|
|
82
|
+
};
|
|
70
83
|
|
|
71
|
-
|
|
72
|
-
};var printDispatch = exports.printDispatch = function printDispatch(doName, ID, otherParams) {
|
|
84
|
+
var printDispatch = exports.printDispatch = function printDispatch(doName, ID, otherParams) {
|
|
73
85
|
return new _promise2.default(function () {
|
|
74
|
-
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(res
|
|
75
|
-
var
|
|
86
|
+
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(res) {
|
|
87
|
+
var _getLoginInfo, Idstore, POSCode, printEntity, isOpenPrint, checkedPrintType, cloudPrintArguments, _ref2, electronPrint, openCashBox, dto, _ref3, isHorizontalSunMi, result;
|
|
76
88
|
|
|
77
89
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
78
90
|
while (1) {
|
|
79
91
|
switch (_context.prev = _context.next) {
|
|
80
92
|
case 0:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
93
|
+
_getLoginInfo = getLoginInfo(), Idstore = _getLoginInfo.IdStore, POSCode = _getLoginInfo.posCode;
|
|
94
|
+
_context.next = 3;
|
|
95
|
+
return _api2.default.GetPrintInfomation({
|
|
96
|
+
Idstore: Idstore,
|
|
97
|
+
POSCode: POSCode
|
|
98
|
+
});
|
|
85
99
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_ref3 = cloudPrintArguments || {}, Open = _ref3.Open, Key = _ref3.Key, Sign = _ref3.Sign, Name = _ref3.Name, Card = _ref3.Card;
|
|
100
|
+
case 3:
|
|
101
|
+
printEntity = _context.sent;
|
|
89
102
|
|
|
90
|
-
if (!(
|
|
91
|
-
_context.next =
|
|
103
|
+
if (!(!printEntity.AutoPrintTicket && doName == DoNameList.DO_PRINT)) {
|
|
104
|
+
_context.next = 6;
|
|
92
105
|
break;
|
|
93
106
|
}
|
|
94
107
|
|
|
95
|
-
|
|
96
|
-
_context.next = 13;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
108
|
+
return _context.abrupt('return', res());
|
|
99
109
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
110
|
+
case 6:
|
|
111
|
+
// 是否开启打印机
|
|
112
|
+
isOpenPrint = isOldOpen(printEntity.PrintDetailEntitys);
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
res();
|
|
107
|
-
return _context.abrupt('return');
|
|
108
|
-
|
|
109
|
-
case 10:
|
|
110
|
-
printUtil[doName]({ Open: Open, Key: Key, Sign: Sign, Name: Name, Card: Card }, ID, function (s) {
|
|
111
|
-
var msg = s.msg,
|
|
112
|
-
ret = s.ret;
|
|
113
|
-
|
|
114
|
-
if (ret === 0) {
|
|
115
|
-
_message2.default.success(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u6210\u529F\u3002'));
|
|
116
|
-
} else if (ret === -1) {
|
|
117
|
-
_message2.default.error(t(msg));
|
|
118
|
-
} else {
|
|
119
|
-
_message2.default.error(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u5931\u8D25\u3002'));
|
|
120
|
-
}
|
|
121
|
-
res();
|
|
122
|
-
});
|
|
123
|
-
_context.next = 15;
|
|
124
|
-
break;
|
|
114
|
+
// 获取打印机开启的类型
|
|
125
115
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
116
|
+
checkedPrintType = getCheckedPrintTypeDefaults();
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
if (!isOpenPrint) checkedPrintType = null;
|
|
120
|
+
|
|
121
|
+
// 获取云打印参数
|
|
122
|
+
cloudPrintArguments = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
123
|
+
_ref2 = otherParams || {}, electronPrint = _ref2.electronPrint, openCashBox = _ref2.openCashBox, dto = _ref2.dto;
|
|
129
124
|
|
|
130
|
-
|
|
131
|
-
|
|
125
|
+
if (!dto) {
|
|
126
|
+
dto = {};
|
|
127
|
+
dto.Idstore = (0, _tplusPoslogin.PosInitData)('storeID');
|
|
128
|
+
dto.POSCode = (0, _tplusPoslogin.PosInitData)('posCode');
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
_ref3 = _mutantsUtil.platform || {}, isHorizontalSunMi = _ref3.isHorizontalSunMi;
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
_context.next = 23;
|
|
133
|
+
if (!(isOpenPrint && checkedPrintType === "3" || !checkedPrintType && !!isHorizontalSunMi)) {
|
|
134
|
+
_context.next = 21;
|
|
136
135
|
break;
|
|
137
136
|
}
|
|
138
137
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
_message2.default.error(t(msg));
|
|
147
|
-
} else {
|
|
148
|
-
_message2.default.error(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u5931\u8D25\u3002'));
|
|
149
|
-
}
|
|
150
|
-
res();
|
|
151
|
-
});
|
|
152
|
-
return _context.abrupt('return');
|
|
138
|
+
// 1.如果未开启打印并且是商米平台 使用自带的打印机 2如果开启打印并且使用飞蛾打印机
|
|
139
|
+
if (!!isHorizontalSunMi && openCashBox) {
|
|
140
|
+
// 开启商米的钱箱
|
|
141
|
+
syncOpenCashBox(printEntity);
|
|
142
|
+
}
|
|
143
|
+
_context.next = 17;
|
|
144
|
+
return cloudPrintNoTemplate(doName, ID, cloudPrintArguments || {});
|
|
153
145
|
|
|
154
|
-
case
|
|
155
|
-
|
|
156
|
-
|
|
146
|
+
case 17:
|
|
147
|
+
result = _context.sent;
|
|
148
|
+
|
|
149
|
+
res(result);
|
|
150
|
+
_context.next = 44;
|
|
151
|
+
break;
|
|
152
|
+
|
|
153
|
+
case 21:
|
|
154
|
+
if (!(isOpenPrint && (checkedPrintType === "2" || checkedPrintType === "1"))) {
|
|
155
|
+
_context.next = 43;
|
|
157
156
|
break;
|
|
158
157
|
}
|
|
159
158
|
|
|
160
|
-
if (!(_mutantsMicrofx.env.platform !== _mutantsMicrofx.env.constant.platform.electron)) {
|
|
161
|
-
_context.next =
|
|
159
|
+
if (!(_mutantsMicrofx.env.platform !== _mutantsMicrofx.env.constant.platform.electron && checkedPrintType === "1")) {
|
|
160
|
+
_context.next = 25;
|
|
162
161
|
break;
|
|
163
162
|
}
|
|
164
163
|
|
|
165
164
|
//获取当前是否处于Electron环境中
|
|
166
165
|
_message2.default.warn(t('打印小票只能在客户端中执行'));
|
|
167
|
-
res();
|
|
168
|
-
return _context.abrupt('return');
|
|
166
|
+
return _context.abrupt('return', res());
|
|
169
167
|
|
|
170
|
-
case
|
|
168
|
+
case 25:
|
|
171
169
|
_context.t0 = doName;
|
|
172
|
-
_context.next = _context.t0 === DoNameList.DO_PRINT ?
|
|
170
|
+
_context.next = _context.t0 === DoNameList.DO_PRINT ? 28 : _context.t0 === DoNameList.DO_MT_RETAIL ? 28 : _context.t0 === DoNameList.DO_ONLY_PRINT ? 28 : _context.t0 === DoNameList.DO_DUTY_PRINT ? 28 : _context.t0 === DoNameList.DO_DIALY_PRINT ? 28 : _context.t0 === DoNameList.DO_STORAGE_PRINT ? 28 : _context.t0 === DoNameList.DO_PROJECT_STORAGE_PRINT ? 28 : _context.t0 === DoNameList.DO_PROJECT_CONSUME_PRINT ? 28 : 37;
|
|
173
171
|
break;
|
|
174
172
|
|
|
175
|
-
case
|
|
176
|
-
return _context.abrupt('break', 42);
|
|
177
|
-
|
|
178
|
-
case 32:
|
|
173
|
+
case 28:
|
|
179
174
|
if (!global[DoPrintGlobalFunction[doName]]) {
|
|
180
|
-
_context.next =
|
|
175
|
+
_context.next = 34;
|
|
181
176
|
break;
|
|
182
177
|
}
|
|
183
178
|
|
|
184
|
-
_context.next =
|
|
185
|
-
return global[DoPrintGlobalFunction[doName]].execute(ID);
|
|
179
|
+
_context.next = 31;
|
|
180
|
+
return global[DoPrintGlobalFunction[doName]].execute(ID, dto, openCashBox);
|
|
186
181
|
|
|
187
|
-
case
|
|
188
|
-
res();
|
|
189
|
-
return _context.abrupt('break', 42);
|
|
182
|
+
case 31:
|
|
183
|
+
return _context.abrupt('return', res());
|
|
190
184
|
|
|
191
|
-
case
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
185
|
+
case 34:
|
|
186
|
+
if (electronPrint) {
|
|
187
|
+
_context.next = 37;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
195
190
|
|
|
196
|
-
|
|
197
|
-
|
|
191
|
+
_message2.default.warn(t('打印小票只能在客户端中执行'));
|
|
192
|
+
return _context.abrupt('return', res());
|
|
198
193
|
|
|
194
|
+
case 37:
|
|
199
195
|
if (!electronPrint) {
|
|
200
|
-
_context.next =
|
|
196
|
+
_context.next = 40;
|
|
201
197
|
break;
|
|
202
198
|
}
|
|
203
199
|
|
|
204
|
-
_context.next =
|
|
200
|
+
_context.next = 40;
|
|
205
201
|
return electronPrint();
|
|
206
202
|
|
|
207
|
-
case
|
|
203
|
+
case 40:
|
|
204
|
+
res();
|
|
205
|
+
_context.next = 44;
|
|
206
|
+
break;
|
|
207
|
+
|
|
208
|
+
case 43:
|
|
208
209
|
res();
|
|
209
210
|
|
|
210
|
-
case
|
|
211
|
+
case 44:
|
|
211
212
|
case 'end':
|
|
212
213
|
return _context.stop();
|
|
213
214
|
}
|
|
@@ -215,9 +216,113 @@ var DoNameList = exports.DoNameList = {
|
|
|
215
216
|
}, _callee, undefined);
|
|
216
217
|
}));
|
|
217
218
|
|
|
218
|
-
return function (_x
|
|
219
|
+
return function (_x) {
|
|
219
220
|
return _ref.apply(this, arguments);
|
|
220
221
|
};
|
|
221
222
|
}());
|
|
222
223
|
};
|
|
224
|
+
|
|
225
|
+
var cloudPrintNoTemplate = function cloudPrintNoTemplate(doName, ID, _ref4) {
|
|
226
|
+
var Open = _ref4.Open,
|
|
227
|
+
Key = _ref4.Key,
|
|
228
|
+
Sign = _ref4.Sign,
|
|
229
|
+
Name = _ref4.Name,
|
|
230
|
+
Card = _ref4.Card;
|
|
231
|
+
|
|
232
|
+
return new _promise2.default(function (resolve) {
|
|
233
|
+
var printUtil = new _index2.default();
|
|
234
|
+
printUtil[doName]({ Open: Open, Key: Key, Sign: Sign, Name: Name, Card: Card }, ID, function (s) {
|
|
235
|
+
var msg = s.msg,
|
|
236
|
+
ret = s.ret;
|
|
237
|
+
|
|
238
|
+
if (ret === 0) {
|
|
239
|
+
_message2.default.success(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u6210\u529F\u3002'));
|
|
240
|
+
} else if (ret === -1) {
|
|
241
|
+
_message2.default.error(t(msg));
|
|
242
|
+
} else {
|
|
243
|
+
_message2.default.error(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u5931\u8D25\u3002'));
|
|
244
|
+
}
|
|
245
|
+
resolve();
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
var syncOpenCashBox = function () {
|
|
251
|
+
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(printEntity) {
|
|
252
|
+
var _ref6, CashBoxCmd;
|
|
253
|
+
|
|
254
|
+
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
255
|
+
while (1) {
|
|
256
|
+
switch (_context2.prev = _context2.next) {
|
|
257
|
+
case 0:
|
|
258
|
+
_ref6 = printEntity || {}, CashBoxCmd = _ref6.CashBoxCmd;
|
|
259
|
+
return _context2.abrupt('return', window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.OpenDrawer(CashBoxCmd));
|
|
260
|
+
|
|
261
|
+
case 2:
|
|
262
|
+
case 'end':
|
|
263
|
+
return _context2.stop();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}, _callee2, undefined);
|
|
267
|
+
}));
|
|
268
|
+
|
|
269
|
+
return function syncOpenCashBox(_x2) {
|
|
270
|
+
return _ref5.apply(this, arguments);
|
|
271
|
+
};
|
|
272
|
+
}();
|
|
273
|
+
|
|
274
|
+
var getLoginInfo = function getLoginInfo() {
|
|
275
|
+
var _ref7 = _mutantsMicrofx.localStore.get('user') || {},
|
|
276
|
+
_ref7$loginInfo = _ref7.loginInfo,
|
|
277
|
+
loginInfo = _ref7$loginInfo === undefined ? {} : _ref7$loginInfo;
|
|
278
|
+
|
|
279
|
+
return loginInfo;
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
var isOldOpen = exports.isOldOpen = function isOldOpen(printDetailEntitys) {
|
|
283
|
+
var _ref8 = _mutantsUtil.platform || {},
|
|
284
|
+
isVerticalTouch = _ref8.isVerticalTouch;
|
|
285
|
+
|
|
286
|
+
if (isVerticalTouch) return true;
|
|
287
|
+
var isOpenPrintValue = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('isOpenPrint');
|
|
288
|
+
if (isOpenPrintValue !== null) {
|
|
289
|
+
return isOpenPrintValue === "true";
|
|
290
|
+
}
|
|
291
|
+
var localOrYinMeiOpen = printDetailEntitys && printDetailEntitys.filter(function (item) {
|
|
292
|
+
return item.IsEnablePrinter === true;
|
|
293
|
+
}).length > 0;
|
|
294
|
+
var cloudPrintArguments = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
295
|
+
|
|
296
|
+
var _ref9 = cloudPrintArguments || {},
|
|
297
|
+
cloudOpen = _ref9.Open;
|
|
298
|
+
|
|
299
|
+
return localOrYinMeiOpen || cloudOpen;
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
var getCheckedPrintTypeDefaults = exports.getCheckedPrintTypeDefaults = function getCheckedPrintTypeDefaults() {
|
|
303
|
+
var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
|
|
304
|
+
|
|
305
|
+
var _ref10 = _mutantsUtil.platform || {},
|
|
306
|
+
isVerticalTouch = _ref10.isVerticalTouch;
|
|
307
|
+
// 打印机选择的类型
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
var checkedPrintType = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('checkedPrintType');
|
|
311
|
+
var cloudPrintArguments = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
312
|
+
if (checkedPrintType === null) {
|
|
313
|
+
if (hasElectron || !!isVerticalTouch) {
|
|
314
|
+
checkedPrintType = '1';
|
|
315
|
+
} else {
|
|
316
|
+
var _ref11 = cloudPrintArguments || {},
|
|
317
|
+
Open = _ref11.Open;
|
|
318
|
+
|
|
319
|
+
if (Open) {
|
|
320
|
+
checkedPrintType = '3';
|
|
321
|
+
} else {
|
|
322
|
+
checkedPrintType = '2';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return checkedPrintType;
|
|
327
|
+
};
|
|
223
328
|
//# sourceMappingURL=printDispatch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/cloudPrint/printDispatch.js"],"names":["t","i18n","getFixedT","DoNameList","DO_PRINT","DO_DUTY_PRINT","DO_DIALY_PRINT","DO_STORAGE_PRINT","DO_PROJECT_STORAGE_PRINT","DO_PROJECT_CONSUME_PRINT","DoDesName","doPrint","doDutyPrint","doDialyPrint","doStoragePrint","doProjectStoragePrint","doProjectConsumePrint","DoPrintGlobalFunction","printDispatch","doName","ID","otherParams","res","rej","cloudPrintArguments","localStore","get","platform","isHorizontalPad","isHorizontalSunMi","printUtil","PrintUtil","Open","Key","Sign","Name","Card","Message","warn","msg","s","ret","success","error","env","constant","electron","global","execute","electronPrint"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AACA;;;;AACA;;;;;;AAEA,IAAMA,IAAIC,qBAAKC,SAAL,CAAe,IAAf,EAAqB,WA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,MAAV,CAAP,oCAAd;AACH;AACDG;AACH,6BAVD;AAlCY;;AAAA;AAAA,iCA+CTsB,mBA/CS;AAAA;AAAA;AAAA;;AAAA,kCAgDJA,oBAAIjB,QAAJ,KAAiBiB,oBAAIC,QAAJ,CAAalB,QAAb,CAAsBmB,QAhDnC;AAAA;AAAA;AAAA;;AAgD8C;AAClDT,8CAAQC,IAAR,CAAatC,EAAE,eAAF,CAAb;AACAsB;AAlDI;;AAAA;AAAA,0CAqDDH,MArDC;AAAA,4DAsDChB,WAAWC,QAtDZ,wBAuDCD,WAAWI,gBAvDZ,wBAwDCJ,WAAWK,wBAxDZ,wBAyDCL,WAAWM,wBAzDZ;AAAA;;AAAA;AAAA;;AAAA;AAAA,iCA0DIsC,OAAO9B,sBAAsBE,MAAtB,CAAP,CA1DJ;AAAA;AAAA;AAAA;;AAAA;AAAA,mCA2DU4B,OAAO9B,sBAAsBE,MAAtB,CAAP,EAAsC6B,OAAtC,CAA8C5B,EAA9C,CA3DV;;AAAA;AA4DIE;AA5DJ;;AAAA;AA+DIe,8CAAQC,IAAR,CAAatC,EAAE,eAAF,CAAb;AACAsB;AAhEJ;;AAAA;AAAA,oCAqEgBD,eAAe,EArE/B,EAqED4B,aArEC,SAqEDA,aArEC;;AAAA,iCAsELA,aAtEK;AAAA;AAAA;AAAA;;AAAA;AAAA,mCAsEgBA,eAtEhB;;AAAA;AAuER3B;;AAvEQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAb;;AAAA;AAAA;AAAA;AAAA,QAAP;AA2EH,CA5EM","file":"printDispatch.js","sourcesContent":["/*\r\n * @Descripttion: \r\n * @version: \r\n * @Author: chenlongad\r\n * @Date: 2020-11-17 10:02:02\r\n * @LastEditors: chenlongad\r\n * @LastEditTime: 2021-02-21 10:18:28\r\n */\r\nimport { platform } from 'mutants-util';\r\nimport {localStore,env} from 'mutants-microfx';\r\nimport PrintUtil from './index'\r\nimport Message from '../message';\r\nimport {i18n} from 'mutants-microfx';\r\nconst t = i18n.getFixedT(null, 'newretail');\r\n\r\n// 打印调用方法对照\r\nexport const DoNameList = {\r\n DO_PRINT:\"doPrint\",\r\n DO_DUTY_PRINT:\"doDutyPrint\",\r\n DO_DIALY_PRINT:\"doDialyPrint\",\r\n DO_STORAGE_PRINT:\"doStoragePrint\",\r\n DO_PROJECT_STORAGE_PRINT:\"doProjectStoragePrint\",\r\n DO_PROJECT_CONSUME_PRINT:\"doProjectConsumePrint\"\r\n}\r\n\r\n// 打印调用方法名字对照\r\nconst DoDesName = {\r\n doPrint:\"\",\r\n doDutyPrint:\"交班\",\r\n doDialyPrint:\"日结\",\r\n doStoragePrint:\"储值\",\r\n doProjectStoragePrint:\"储值\",\r\n doProjectConsumePrint:\"扣次\"\r\n}\r\n\r\n// window打印调用方法对照\r\nconst DoPrintGlobalFunction = {\r\n doPrint:\"\",\r\n doDutyPrint:\"交班\",\r\n doDialyPrint:\"日结\",\r\n doStoragePrint:\"StoragePrintProcessBlock\",\r\n doProjectStoragePrint:\"ProjectStoragePrintProcessBlock\",\r\n doProjectConsumePrint:\"ProjectConsumePrintProcessBlock\"\r\n}\r\n\r\n\r\n// TODO: 日结交班还没有处理 等下个版本处理 \r\nexport const printDispatch = (doName,ID,otherParams) => {\r\n return new Promise( async (res,rej)=>{\r\n // 获取云打印参数\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n \r\n // \r\n const { isHorizontalPad ,isHorizontalSunMi } = platform || {};\r\n const printUtil = new PrintUtil();\r\n\r\n const { Open, Key, Sign, Name, Card } = cloudPrintArguments || {};\r\n if (isHorizontalPad === true) { // pad打印\r\n //执行移动端云打印\r\n if (cloudPrintArguments) {\r\n if (!Open) {\r\n Message.warn(t('云打印未启用,请设置。'))\r\n res();\r\n return;\r\n }\r\n printUtil[doName]({Open, Key, Sign, Name, Card }, ID, s => {\r\n const { msg, ret } = s;\r\n if (ret === 0) {\r\n Message.success(t(`打印${DoDesName[doName]}小票成功。`))\r\n }else if(ret === -1){\r\n Message.error(t(msg))\r\n } else {\r\n Message.error(t(`打印${DoDesName[doName]}小票失败。`))\r\n }\r\n res();\r\n })\r\n } else {\r\n Message.warn(t('云打印未启用,请设置。'))\r\n res();\r\n }\r\n return;\r\n } else if (isHorizontalSunMi === true) {\r\n printUtil[doName]({Open , Key, Sign, Name, Card }, ID, s => {\r\n const { msg, ret } = s;\r\n if (ret === 0) {\r\n Message.success(t(`打印${DoDesName[doName]}小票成功。`))\r\n } else if (ret === -1) {\r\n Message.error(t(msg))\r\n } else {\r\n Message.error(t(`打印${DoDesName[doName]}小票失败。`))\r\n }\r\n res();\r\n })\r\n return;\r\n }else{\r\n if(env){\r\n if (env.platform !== env.constant.platform.electron) {//获取当前是否处于Electron环境中\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n res();\r\n return;\r\n }\r\n switch(doName){\r\n case DoNameList.DO_PRINT: break;\r\n case DoNameList.DO_STORAGE_PRINT: \r\n case DoNameList.DO_PROJECT_STORAGE_PRINT:\r\n case DoNameList.DO_PROJECT_CONSUME_PRINT:{\r\n if (global[DoPrintGlobalFunction[doName]]) {\r\n await global[DoPrintGlobalFunction[doName]].execute(ID);\r\n res();\r\n break;\r\n } else{\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n res();\r\n break;\r\n }\r\n }\r\n } \r\n const {electronPrint} = otherParams || {}\r\n if(electronPrint) await electronPrint()\r\n res();\r\n }\r\n }\r\n })\r\n}"]}
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/cloudPrint/printDispatch.js"],"names":["t","i18n","getFixedT","DoNameList","DO_PRINT","DO_ONLY_PRINT","DO_MT_RETAIL","DO_DUTY_PRINT","DO_DIALY_PRINT","DO_STORAGE_PRINT","DO_PROJECT_STORAGE_PRINT","DO_PROJECT_CONSUME_PRINT","DoDesName","doPrint","doMtRetail","doOnlyRetail","doDutyPrint","doDialyPrint","doStoragePrint","doProjectStoragePrint","doProjectConsumePrint","DoPrintGlobalFunction","printDispatch","doName","ID","otherParams","res","getLoginInfo","Idstore","IdStore","POSCode","posCode","API","GetPrintInfomation","printEntity","AutoPrintTicket","isOpenPrint","isOldOpen","PrintDetailEntitys","checkedPrintType","getCheckedPrintTypeDefaults","cloudPrintArguments","localStore","get","electronPrint","openCashBox","dto","platform","isHorizontalSunMi","syncOpenCashBox","cloudPrintNoTemplate","result","env","constant","electron","Message","warn","global","execute","Open","Key","Sign","Name","Card","resolve","printUtil","PrintUtil","msg","s","ret","success","error","CashBoxCmd","window","sunMi_OperatingCashier","OpenDrawer","loginInfo","printDetailEntitys","isVerticalTouch","isOpenPrintValue","localOrYinMeiOpen","filter","item","IsEnablePrinter","length","cloudOpen","hasElectron"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AACA;;AACA;;;;AACA;;;;AAEA;;;;;;AADA,IAAMA,IAAIC,qBAAKC,SAAL,CAAe,IAAf,EAAqB,WAArB,CAAV,C,CAbA;;;;;;;;;;AAgBA;AACO,IAAMC,kCAAa;AACtBC,cAAS,SADa;AAEtBC,mBAAc,cAFQ;AAGtBC,kBAAa,YAHS;AAItBC,mBAAc,aAJQ;AAKtBC,oBAAe,cALO;AAMtBC,sBAAiB,gBANK;AAOtBC,8BAAyB,uBAPH;AAQtBC,8BAAyB;;AAG7B;AAX0B,CAAnB,CAYP,IAAMC,YAAY;AACdC,aAAQ,IADM;AAEdC,gBAAW,IAFG;AAGdC,kBAAa,IAHC;AAIdC,iBAAY,IAJE;AAKdC,kBAAa,IALC;AAMdC,oBAAe,IAND;AAOdC,2BAAsB,MAPR;AAQdC,2BAAsB;;AAG1B;AAXkB,CAAlB,CAYA,IAAMC,wBAAwB;AAC1BR,aAAQ,yBADkB;AAE1BE,kBAAa,wBAFa;AAG1BD,gBAAW,0BAHe;AAI1BE,iBAAY,mBAJc;AAK1BC,kBAAa,mBALa;AAM1BC,oBAAe,0BANW;AAO1BC,2BAAsB,iCAPI;AAQ1BC,2BAAsB;AARI,CAA9B;;AAYO,IAAME,wCAAg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B;AAC1B,YAAG+C,eAAe,CAAC,CAACR,eAApB,EAAoC;AAChCvC,+BAAmB,GAAnB;AACH,SAFD,MAEM;AAAA,yBACeE,uBAAuB,EADtC;AAAA,gBACMkB,IADN,UACMA,IADN;;AAEF,gBAAGA,IAAH,EAAQ;AACJpB,mCAAmB,GAAnB;AACH,aAFD,MAEK;AACDA,mCAAmB,GAAnB;AACH;AACJ;AACJ;AACD,WAAOA,gBAAP;AACH,CAnBM","file":"printDispatch.js","sourcesContent":["/*\r\n * @Descripttion: \r\n * @version: \r\n * @Author: chenlongad\r\n * @Date: 2020-11-17 10:02:02\r\n * @LastEditors: chenlongad\r\n * @LastEditTime: 2021-12-27 14:41:52\r\n */\r\nimport { platform } from 'mutants-util';\r\nimport {localStore,env,i18n} from 'mutants-microfx';\r\nimport { PosInitData } from 'tplus-poslogin';\r\nimport PrintUtil from './index'\r\nimport Message from '../message';\r\nconst t = i18n.getFixedT(null, 'newretail');\r\nimport API from './api';\r\n\r\n// 打印调用方法对照\r\nexport const DoNameList = {\r\n DO_PRINT:\"doPrint\",\r\n DO_ONLY_PRINT:\"doOnlyRetail\",\r\n DO_MT_RETAIL:\"doMtRetail\",\r\n DO_DUTY_PRINT:\"doDutyPrint\",\r\n DO_DIALY_PRINT:\"doDialyPrint\",\r\n DO_STORAGE_PRINT:\"doStoragePrint\",\r\n DO_PROJECT_STORAGE_PRINT:\"doProjectStoragePrint\",\r\n DO_PROJECT_CONSUME_PRINT:\"doProjectConsumePrint\"\r\n}\r\n\r\n// 打印调用方法名字对照\r\nconst DoDesName = {\r\n doPrint:\"小票\",\r\n doMtRetail:\"美团\",\r\n doOnlyRetail:\"小票\",\r\n doDutyPrint:\"交班\",\r\n doDialyPrint:\"日结\",\r\n doStoragePrint:\"储值\",\r\n doProjectStoragePrint:\"项目储值\",\r\n doProjectConsumePrint:\"扣次\"\r\n}\r\n\r\n// window打印调用方法对照\r\nconst DoPrintGlobalFunction = {\r\n doPrint:\"RetailPrintProcessBlock\",\r\n doOnlyRetail:\"OnlyRetailPrintProcess\",\r\n doMtRetail:\"MeiTuanPrintProcessBlock\",\r\n doDutyPrint:\"printShiftVoucher\",\r\n doDialyPrint:\"printDailyVoucher\",\r\n doStoragePrint:\"StoragePrintProcessBlock\",\r\n doProjectStoragePrint:\"ProjectStoragePrintProcessBlock\",\r\n doProjectConsumePrint:\"ProjectConsumePrintProcessBlock\"\r\n}\r\n\r\n\r\nexport const printDispatch = (doName,ID,otherParams) => {\r\n return new Promise(async (res) => {\r\n\r\n const { IdStore:Idstore,posCode:POSCode} = getLoginInfo();\r\n const printEntity = await API.GetPrintInfomation({\r\n Idstore,\r\n POSCode\r\n });\r\n // 开启结算完自动打印小票的选项 只判断是结算小票打印 其他的打印方式继续打印\r\n if (!printEntity.AutoPrintTicket && doName == DoNameList.DO_PRINT) {\r\n return res();\r\n }\r\n // 是否开启打印机\r\n const isOpenPrint = isOldOpen(printEntity.PrintDetailEntitys);\r\n\r\n // 获取打印机开启的类型\r\n let checkedPrintType = getCheckedPrintTypeDefaults()\r\n\r\n if(!isOpenPrint) checkedPrintType = null;\r\n\r\n // 获取云打印参数\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n\r\n let { electronPrint,openCashBox,dto} = otherParams || {};\r\n if(!dto){\r\n dto={};\r\n dto.Idstore = PosInitData('storeID');\r\n dto.POSCode = PosInitData('posCode');\r\n }\r\n\r\n const { isHorizontalSunMi } = platform || {};\r\n if (isOpenPrint && checkedPrintType === \"3\" || !checkedPrintType && !!isHorizontalSunMi) {\r\n // 1.如果未开启打印并且是商米平台 使用自带的打印机 2如果开启打印并且使用飞蛾打印机\r\n if(!!isHorizontalSunMi && openCashBox){\r\n // 开启商米的钱箱\r\n syncOpenCashBox(printEntity) \r\n }\r\n let result = await cloudPrintNoTemplate(doName, ID, cloudPrintArguments || {});\r\n res(result);\r\n } else if (isOpenPrint && (checkedPrintType === \"2\" || checkedPrintType === \"1\")) {\r\n if (env.platform !== env.constant.platform.electron && checkedPrintType === \"1\") {//获取当前是否处于Electron环境中\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n return res();\r\n }\r\n switch (doName) {\r\n case DoNameList.DO_PRINT:\r\n case DoNameList.DO_MT_RETAIL:\r\n case DoNameList.DO_ONLY_PRINT:\r\n case DoNameList.DO_DUTY_PRINT:\r\n case DoNameList.DO_DIALY_PRINT:\r\n case DoNameList.DO_STORAGE_PRINT:\r\n case DoNameList.DO_PROJECT_STORAGE_PRINT:\r\n case DoNameList.DO_PROJECT_CONSUME_PRINT: {\r\n if (global[DoPrintGlobalFunction[doName]]) {\r\n await global[DoPrintGlobalFunction[doName]].execute(ID,dto, openCashBox);\r\n return res();\r\n } else {\r\n if(!electronPrint){\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n return res();\r\n }\r\n }\r\n }\r\n }\r\n \r\n if (electronPrint) await electronPrint()\r\n res();\r\n }else {\r\n res();\r\n }\r\n })\r\n}\r\n\r\nconst cloudPrintNoTemplate = (doName,ID,{Open, Key, Sign, Name, Card }) => {\r\n return new Promise((resolve) => {\r\n const printUtil = new PrintUtil();\r\n printUtil[doName]({Open, Key, Sign, Name, Card }, ID, s => {\r\n const { msg, ret } = s;\r\n if (ret === 0) {\r\n Message.success(t(`打印${DoDesName[doName]}小票成功。`))\r\n }else if(ret === -1){\r\n Message.error(t(msg))\r\n } else {\r\n Message.error(t(`打印${DoDesName[doName]}小票失败。`))\r\n }\r\n resolve();\r\n })\r\n })\r\n}\r\n\r\nconst syncOpenCashBox = async(printEntity) =>{\r\n const { CashBoxCmd } = printEntity || {}\r\n return window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.OpenDrawer(CashBoxCmd);\r\n}\r\n\r\nconst getLoginInfo = () => {\r\n const { loginInfo = {} } = localStore.get('user') || {};\r\n return loginInfo;\r\n}\r\n\r\nexport const isOldOpen = (printDetailEntitys) => {\r\n const { isVerticalTouch } = platform || {}\r\n if(isVerticalTouch) return true;\r\n const isOpenPrintValue = localStore && localStore.get('isOpenPrint');\r\n if(isOpenPrintValue !==null){\r\n return isOpenPrintValue === \"true\";\r\n }\r\n const localOrYinMeiOpen = printDetailEntitys && printDetailEntitys.filter((item)=>{\r\n return item.IsEnablePrinter === true\r\n }).length > 0;\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n const { Open:cloudOpen } = cloudPrintArguments || {};\r\n return localOrYinMeiOpen || cloudOpen;\r\n}\r\n\r\nexport const getCheckedPrintTypeDefaults = () => {\r\n const hasElectron = (env.platform === env.constant.platform.electron);\r\n const { isVerticalTouch } = platform || {}\r\n // 打印机选择的类型\r\n let checkedPrintType = localStore && localStore.get('checkedPrintType');\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n if(checkedPrintType === null) {\r\n if(hasElectron || !!isVerticalTouch){\r\n checkedPrintType = '1'\r\n }else {\r\n const { Open } = cloudPrintArguments || {};\r\n if(Open){\r\n checkedPrintType = '3'\r\n }else{\r\n checkedPrintType = '2'\r\n }\r\n }\r\n }\r\n return checkedPrintType\r\n}"]}
|
|
@@ -627,6 +627,19 @@ exports.default = [{
|
|
|
627
627
|
"ParamType": "SHORTCUT_KEY",
|
|
628
628
|
"Name": "MemberAdd",
|
|
629
629
|
"TabIndex": 510
|
|
630
|
+
}, {
|
|
631
|
+
"DefaultValue": "shift+1",
|
|
632
|
+
"IsEnable": true,
|
|
633
|
+
"IsRequired": false,
|
|
634
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":1,\"enableEdit\":1,\"classification\":1,\"operation\":[\".pos-side-bar .sider-bar-menu-item .sub-menu-item span=储值卡\"]}",
|
|
635
|
+
"Value": "shift+1",
|
|
636
|
+
"Title": "储值卡",
|
|
637
|
+
"ID": 1644862880743537,
|
|
638
|
+
"IdRef": "",
|
|
639
|
+
"IsVisible": true,
|
|
640
|
+
"ParamType": "SHORTCUT_KEY",
|
|
641
|
+
"Name": "MemberManagement",
|
|
642
|
+
"TabIndex": 512
|
|
630
643
|
}, {
|
|
631
644
|
"DefaultValue": "ctrl+2",
|
|
632
645
|
"IsEnable": true,
|
|
@@ -965,20 +978,22 @@ exports.default = [{
|
|
|
965
978
|
"ParamType": "SHORTCUT_KEY",
|
|
966
979
|
"Name": "OtherStore",
|
|
967
980
|
"TabIndex": 195
|
|
968
|
-
},
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
981
|
+
},
|
|
982
|
+
// {
|
|
983
|
+
// "DefaultValue":"f2",
|
|
984
|
+
// "IsEnable":true,
|
|
985
|
+
// "IsRequired":false,
|
|
986
|
+
// "ExtField":"{\"isdisplay\":1,\"dynamic\":1,\"operationType\":4,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-content-tab .member-menu-el span=储值\"]}",
|
|
987
|
+
// "Value":"f2",
|
|
988
|
+
// "Title":"储值",
|
|
989
|
+
// "ID":1398167653056512,
|
|
990
|
+
// "IdRef":"",
|
|
991
|
+
// "IsVisible":true,
|
|
992
|
+
// "ParamType":"SHORTCUT_KEY",
|
|
993
|
+
// "Name":"MemberStorage",
|
|
994
|
+
// "TabIndex":470
|
|
995
|
+
// },
|
|
996
|
+
{
|
|
982
997
|
"DefaultValue": "f3",
|
|
983
998
|
"IsEnable": true,
|
|
984
999
|
"IsRequired": false,
|
|
@@ -1017,5 +1032,109 @@ exports.default = [{
|
|
|
1017
1032
|
"ParamType": "SHORTCUT_KEY",
|
|
1018
1033
|
"Name": "PosResetPwd",
|
|
1019
1034
|
"TabIndex": 473
|
|
1035
|
+
}, {
|
|
1036
|
+
"DefaultValue": "f6",
|
|
1037
|
+
"IsEnable": true,
|
|
1038
|
+
"IsRequired": false,
|
|
1039
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":4,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-content-tab .member-menu-el span=绑卡\"]}",
|
|
1040
|
+
"Value": "f6",
|
|
1041
|
+
"Title": "绑卡",
|
|
1042
|
+
"ID": 1398167653056516,
|
|
1043
|
+
"IdRef": "",
|
|
1044
|
+
"IsVisible": true,
|
|
1045
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1046
|
+
"Name": "BindCard",
|
|
1047
|
+
"TabIndex": 474
|
|
1048
|
+
}, {
|
|
1049
|
+
"DefaultValue": "f2",
|
|
1050
|
+
"IsEnable": true,
|
|
1051
|
+
"IsRequired": false,
|
|
1052
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=储值\"]}",
|
|
1053
|
+
"Value": "f2",
|
|
1054
|
+
"Title": "储值",
|
|
1055
|
+
"ID": 1398167653056517,
|
|
1056
|
+
"IdRef": "",
|
|
1057
|
+
"IsVisible": true,
|
|
1058
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1059
|
+
"Name": "MemberStorage",
|
|
1060
|
+
"TabIndex": 780
|
|
1061
|
+
}, {
|
|
1062
|
+
"DefaultValue": "f3",
|
|
1063
|
+
"IsEnable": true,
|
|
1064
|
+
"IsRequired": false,
|
|
1065
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=退储值\"]}",
|
|
1066
|
+
"Value": "f3",
|
|
1067
|
+
"Title": "退储值",
|
|
1068
|
+
"ID": 1398167653056518,
|
|
1069
|
+
"IdRef": "",
|
|
1070
|
+
"IsVisible": true,
|
|
1071
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1072
|
+
"Name": "RefundStorage",
|
|
1073
|
+
"TabIndex": 781
|
|
1074
|
+
}, {
|
|
1075
|
+
"DefaultValue": "f4",
|
|
1076
|
+
"IsEnable": true,
|
|
1077
|
+
"IsRequired": false,
|
|
1078
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=设置密码\"]}",
|
|
1079
|
+
"Value": "f4",
|
|
1080
|
+
"Title": "设置密码",
|
|
1081
|
+
"ID": 1398167653056519,
|
|
1082
|
+
"IdRef": "",
|
|
1083
|
+
"IsVisible": true,
|
|
1084
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1085
|
+
"Name": "CardSetPassword",
|
|
1086
|
+
"TabIndex": 782
|
|
1087
|
+
}, {
|
|
1088
|
+
"DefaultValue": "f5",
|
|
1089
|
+
"IsEnable": true,
|
|
1090
|
+
"IsRequired": false,
|
|
1091
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=修改密码\"]}",
|
|
1092
|
+
"Value": "f5",
|
|
1093
|
+
"Title": "修改密码",
|
|
1094
|
+
"ID": 1398167653056520,
|
|
1095
|
+
"IdRef": "",
|
|
1096
|
+
"IsVisible": true,
|
|
1097
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1098
|
+
"Name": "CardModifyPassword",
|
|
1099
|
+
"TabIndex": 783
|
|
1100
|
+
}, {
|
|
1101
|
+
"DefaultValue": "f6",
|
|
1102
|
+
"IsEnable": true,
|
|
1103
|
+
"IsRequired": false,
|
|
1104
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=重置密码\"]}",
|
|
1105
|
+
"Value": "f6",
|
|
1106
|
+
"Title": "重置密码",
|
|
1107
|
+
"ID": 1398167653056521,
|
|
1108
|
+
"IdRef": "",
|
|
1109
|
+
"IsVisible": true,
|
|
1110
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1111
|
+
"Name": "CardPosResetPwd",
|
|
1112
|
+
"TabIndex": 784
|
|
1113
|
+
}, {
|
|
1114
|
+
"DefaultValue": "f7",
|
|
1115
|
+
"IsEnable": true,
|
|
1116
|
+
"IsRequired": false,
|
|
1117
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=会员绑定\"]}",
|
|
1118
|
+
"Value": "f7",
|
|
1119
|
+
"Title": "会员绑定",
|
|
1120
|
+
"ID": 1398167653056522,
|
|
1121
|
+
"IdRef": "",
|
|
1122
|
+
"IsVisible": true,
|
|
1123
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1124
|
+
"Name": "BindStorageCard",
|
|
1125
|
+
"TabIndex": 785
|
|
1126
|
+
}, {
|
|
1127
|
+
"DefaultValue": "f8",
|
|
1128
|
+
"IsEnable": true,
|
|
1129
|
+
"IsRequired": false,
|
|
1130
|
+
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":10,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".member-menu .member-menu-el span=解绑\"]}",
|
|
1131
|
+
"Value": "f8",
|
|
1132
|
+
"Title": "解绑",
|
|
1133
|
+
"ID": 1398167653056523,
|
|
1134
|
+
"IdRef": "",
|
|
1135
|
+
"IsVisible": true,
|
|
1136
|
+
"ParamType": "SHORTCUT_KEY",
|
|
1137
|
+
"Name": "UnBindStorageCard",
|
|
1138
|
+
"TabIndex": 786
|
|
1020
1139
|
}];
|
|
1021
1140
|
//# sourceMappingURL=localConfig.js.map
|