tplus-components-touch 3.41.1 → 3.41.3
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/cloudPrint/index.js +31 -8
- package/dist/components/cloudPrint/index.js.map +1 -1
- package/dist/components/cloudPrint/printDispatch.js +55 -42
- package/dist/components/cloudPrint/printDispatch.js.map +1 -1
- package/dist/components/hardwareAPI/index.js +46 -12
- package/dist/components/hardwareAPI/index.js.map +1 -1
- package/dist/components/settlement/settlement.js +34 -11
- package/dist/components/settlement/settlement.js.map +1 -1
- package/package.json +35 -35
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
+
var _stringify = require('babel-runtime/core-js/json/stringify');
|
8
|
+
|
9
|
+
var _stringify2 = _interopRequireDefault(_stringify);
|
10
|
+
|
7
11
|
var _regenerator = require('babel-runtime/regenerator');
|
8
12
|
|
9
13
|
var _regenerator2 = _interopRequireDefault(_regenerator);
|
@@ -22,8 +26,18 @@ var _createClass3 = _interopRequireDefault(_createClass2);
|
|
22
26
|
|
23
27
|
var _mutantsMicrofx = require('mutants-microfx');
|
24
28
|
|
29
|
+
var _mutantsUtil = require('mutants-util');
|
30
|
+
|
25
31
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26
32
|
|
33
|
+
/*
|
34
|
+
* @Descripttion:
|
35
|
+
* @version:
|
36
|
+
* @Author: chenlongad
|
37
|
+
* @Date: 2021-01-11 10:07:55
|
38
|
+
* @LastEditors: chenlongad
|
39
|
+
* @LastEditTime: 2022-03-14 16:15:50
|
40
|
+
*/
|
27
41
|
var HardwareAPI = function () {
|
28
42
|
function HardwareAPI(props) {
|
29
43
|
(0, _classCallCheck3.default)(this, HardwareAPI);
|
@@ -123,15 +137,25 @@ var HardwareAPI = function () {
|
|
123
137
|
key: 'handleBalEntryTare',
|
124
138
|
value: function () {
|
125
139
|
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4(params, cb) {
|
140
|
+
var _ref5, isHorizontalSunMi;
|
141
|
+
|
126
142
|
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
127
143
|
while (1) {
|
128
144
|
switch (_context4.prev = _context4.next) {
|
129
145
|
case 0:
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
146
|
+
_ref5 = _mutantsUtil.platform || {}, isHorizontalSunMi = _ref5.isHorizontalSunMi;
|
147
|
+
|
148
|
+
if (isHorizontalSunMi && window.sunMi_SystemProperties.systemModal == 'S2') {
|
149
|
+
window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.entryTare().then(function (ret) {
|
150
|
+
return cb((0, _stringify2.default)(ret));
|
151
|
+
});
|
152
|
+
} else {
|
153
|
+
_mutantsMicrofx.nativeMs.setIpcRendererMethod('HandleBalEntryTare', params, function (ret) {
|
154
|
+
return cb(ret);
|
155
|
+
});
|
156
|
+
}
|
157
|
+
|
158
|
+
case 2:
|
135
159
|
case 'end':
|
136
160
|
return _context4.stop();
|
137
161
|
}
|
@@ -150,16 +174,26 @@ var HardwareAPI = function () {
|
|
150
174
|
}, {
|
151
175
|
key: 'handleBalEntryZero',
|
152
176
|
value: function () {
|
153
|
-
var
|
177
|
+
var _ref6 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee5(params, cb) {
|
178
|
+
var _ref7, isHorizontalSunMi;
|
179
|
+
|
154
180
|
return _regenerator2.default.wrap(function _callee5$(_context5) {
|
155
181
|
while (1) {
|
156
182
|
switch (_context5.prev = _context5.next) {
|
157
183
|
case 0:
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
184
|
+
_ref7 = _mutantsUtil.platform || {}, isHorizontalSunMi = _ref7.isHorizontalSunMi;
|
185
|
+
|
186
|
+
if (isHorizontalSunMi && window.sunMi_SystemProperties.systemModal == 'S2') {
|
187
|
+
window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.returnZero().then(function (ret) {
|
188
|
+
return cb((0, _stringify2.default)(ret));
|
189
|
+
});
|
190
|
+
} else {
|
191
|
+
_mutantsMicrofx.nativeMs.setIpcRendererMethod('HandleBalEntryZero', params, function (ret) {
|
192
|
+
return cb(ret);
|
193
|
+
});
|
194
|
+
}
|
195
|
+
|
196
|
+
case 2:
|
163
197
|
case 'end':
|
164
198
|
return _context5.stop();
|
165
199
|
}
|
@@ -168,7 +202,7 @@ var HardwareAPI = function () {
|
|
168
202
|
}));
|
169
203
|
|
170
204
|
function handleBalEntryZero(_x9, _x10) {
|
171
|
-
return
|
205
|
+
return _ref6.apply(this, arguments);
|
172
206
|
}
|
173
207
|
|
174
208
|
return handleBalEntryZero;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/hardwareAPI/index.js"],"names":["HardwareAPI","props","params","cb","nativeMs","setIpcRendererMethod","ret"],"mappings":"
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/hardwareAPI/index.js"],"names":["HardwareAPI","props","params","cb","nativeMs","setIpcRendererMethod","ret","platform","isHorizontalSunMi","window","sunMi_SystemProperties","systemModal","sunMi_OperatingCashier","entryTare","then","returnZero"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;;AACA;;;;AATA;;;;;;;;IAWMA,W;AACJ,uBAAYC,KAAZ,EAAmB;AAAA;AAAG;;AAEtB;;;;;;2GACkBC,M,EAAQC,E;;;;;AACxBC,yCAASC,oBAAT,CAA8B,aAA9B,EAA6CH,MAA7C,EAAqD;AAAA,yBAAOC,GAAGG,GAAH,CAAP;AAAA,iBAArD;;;;;;;;;;;;;;;;;AAGF;;;;;6GACsBJ,M,EAAQC,E;;;;;AAC5BC,yCAASC,oBAAT,CAA8B,iBAA9B,EAAiDH,MAAjD,EAAyD;AAAA,yBAAOC,GAAGG,GAAH,CAAP;AAAA,iBAAzD;;;;;;;;;;;;;;;;;AAGF;;;;;6GACmBJ,M,EAAQC,E;;;;;AACzBC,yCAASC,oBAAT,CAA8B,cAA9B,EAA8CH,MAA9C,EAAsD;AAAA,yBAAOC,GAAGG,GAAH,CAAP;AAAA,iBAAtD;;;;;;;;;;;;;;;;;AAGF;;;;;6GACyBJ,M,EAAQC,E;;;;;;;wBACDI,yBAAY,E,EAAlCC,iB,SAAAA,iB;;AACR,oBAAGA,qBAAqBC,OAAOC,sBAAP,CAA8BC,WAA9B,IAA6C,IAArE,EAA0E;AACxEF,yBAAOG,sBAAP,IAAiCH,OAAOG,sBAAP,CAA8BC,SAA9B,GAA0CC,IAA1C,CAA+C;AAAA,2BAAOX,GAAG,yBAAeG,GAAf,CAAH,CAAP;AAAA,mBAA/C,CAAjC;AACD,iBAFD,MAEK;AACHF,2CAASC,oBAAT,CAA8B,oBAA9B,EAAoDH,MAApD,EAA4D;AAAA,2BAAOC,GAAGG,GAAH,CAAP;AAAA,mBAA5D;AACD;;;;;;;;;;;;;;;;AAGH;;;;;6GACyBJ,M,EAAQC,E;;;;;;;wBACDI,yBAAY,E,EAAlCC,iB,SAAAA,iB;;AACR,oBAAGA,qBAAqBC,OAAOC,sBAAP,CAA8BC,WAA9B,IAA6C,IAArE,EAA0E;AACxEF,yBAAOG,sBAAP,IAAiCH,OAAOG,sBAAP,CAA8BG,UAA9B,GAA2CD,IAA3C,CAAgD;AAAA,2BAAOX,GAAG,yBAAeG,GAAf,CAAH,CAAP;AAAA,mBAAhD,CAAjC;AACD,iBAFD,MAEK;AACHF,2CAASC,oBAAT,CAA8B,oBAA9B,EAAoDH,MAApD,EAA4D;AAAA,2BAAOC,GAAGG,GAAH,CAAP;AAAA,mBAA5D;AACD;;;;;;;;;;;;;;;;;;;;kBAGU,IAAIN,WAAJ,E","file":"index.js","sourcesContent":["/*\r\n * @Descripttion: \r\n * @version: \r\n * @Author: chenlongad\r\n * @Date: 2021-01-11 10:07:55\r\n * @LastEditors: chenlongad\r\n * @LastEditTime: 2022-03-14 16:15:50\r\n */\r\nimport { nativeMs } from 'mutants-microfx';\r\nimport { platform } from 'mutants-util';\r\n\r\nclass HardwareAPI {\r\n constructor(props) { }\r\n\r\n //打开客显\r\n async openCusDisp(params, cb) {\r\n nativeMs.setIpcRendererMethod('OpenCusDisp', params, ret => cb(ret))\r\n }\r\n\r\n //推送客显信息\r\n async sendDataCusDisp(params, cb) {\r\n nativeMs.setIpcRendererMethod('SendDataCusDisp', params, ret => cb(ret))\r\n }\r\n\r\n //关闭客显\r\n async closeCusDisp(params, cb) {\r\n nativeMs.setIpcRendererMethod('CloseCusDisp', params, ret => cb(ret))\r\n }\r\n\r\n //电子秤-去皮\r\n async handleBalEntryTare(params, cb) {\r\n const { isHorizontalSunMi } = platform || {};\r\n if(isHorizontalSunMi && window.sunMi_SystemProperties.systemModal == 'S2'){\r\n window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.entryTare().then(ret => cb(JSON.stringify(ret)));\r\n }else{\r\n nativeMs.setIpcRendererMethod('HandleBalEntryTare', params, ret => cb(ret))\r\n }\r\n \r\n }\r\n //电子秤-清零\r\n async handleBalEntryZero(params, cb) {\r\n const { isHorizontalSunMi } = platform || {};\r\n if(isHorizontalSunMi && window.sunMi_SystemProperties.systemModal == 'S2'){\r\n window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.returnZero().then(ret => cb(JSON.stringify(ret)));\r\n }else{\r\n nativeMs.setIpcRendererMethod('HandleBalEntryZero', params, ret => cb(ret))\r\n }\r\n }\r\n}\r\nexport default new HardwareAPI;"]}
|
@@ -522,6 +522,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
522
522
|
|
523
523
|
_this2.settleZero = function () {
|
524
524
|
var that = _this2;
|
525
|
+
//预售取货无需支付时省略弹框确认这一步
|
526
|
+
var IdbusiType = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data && _this2.context.viewModel.data.IdbusiType;
|
527
|
+
if (IdbusiType == 39) {
|
528
|
+
that.handleSettle("zero");
|
529
|
+
return;
|
530
|
+
}
|
525
531
|
_modalWraper2.default.confirm({
|
526
532
|
className: 'tplus-confirm-modal',
|
527
533
|
title: '结算',
|
@@ -1910,6 +1916,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
1910
1916
|
message = "退货成功";
|
1911
1917
|
} else if (MemberPoints && Number(amount) == Number(0)) {
|
1912
1918
|
message = "兑换成功";
|
1919
|
+
} else if (IdbusiType == 39 && received == 0) {
|
1920
|
+
message = "取货成功";
|
1913
1921
|
}
|
1914
1922
|
window.__successModal = (0, _utils.showSuccessModal)(amount, received, charge, _this.props.onModalClose, isXianjin, message, resp1 && resp1.data, _mutantsMicrofx.stores, IdbusiType, isFull, function () {
|
1915
1923
|
_this.handleGuestShow(5);
|
@@ -2640,7 +2648,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
2640
2648
|
|
2641
2649
|
_this2.btnDebounced = function () {
|
2642
2650
|
var _ref27 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16(type, bquick) {
|
2643
|
-
var IdbusiType, CustomerPhone, DistributionMode, Address, title, _enumController$getEn23, PayStyle, _this2$store8, paymode, brefund, boriginReturn, newStyle, status;
|
2651
|
+
var IdbusiType, CustomerPhone, DistributionMode, Address, isEnableSerialNumber, resultObj, title, _enumController$getEn23, PayStyle, _this2$store8, paymode, brefund, boriginReturn, newStyle, status;
|
2644
2652
|
|
2645
2653
|
return _regenerator2.default.wrap(function _callee16$(_context16) {
|
2646
2654
|
while (1) {
|
@@ -2653,24 +2661,39 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
2653
2661
|
//预订时,若没录入买家手机号,或配送方式为快递时,弹框买家信息确认框
|
2654
2662
|
|
2655
2663
|
if (!(IdbusiType == 38)) {
|
2656
|
-
_context16.next =
|
2664
|
+
_context16.next = 14;
|
2657
2665
|
break;
|
2658
2666
|
}
|
2659
2667
|
|
2668
|
+
//预售下单时,启用了序列号管理和批号/有效期管理的商品,不支持快递和同城配送
|
2669
|
+
isEnableSerialNumber = (0, _tplusPoslogin.PosInitData)("IsEnableSerialNumber");
|
2670
|
+
resultObj = _this2.context.viewModel.data.RetailDetails.find(function (o) {
|
2671
|
+
return o.Inventory.IsSerialNumber && (o.Inventory.IsBatch || o.Inventory.IsQualityPeriod);
|
2672
|
+
});
|
2673
|
+
|
2674
|
+
if (!(isEnableSerialNumber && resultObj && (DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE'))) {
|
2675
|
+
_context16.next = 9;
|
2676
|
+
break;
|
2677
|
+
}
|
2678
|
+
|
2679
|
+
return _context16.abrupt('return', _message2.default.error('启用了序列号管理和批号/有效期管理的商品,不支持快递和同城配送'));
|
2680
|
+
|
2681
|
+
case 9:
|
2682
|
+
|
2660
2683
|
if (DistributionMode.Id == 'ON_SITE_PICKUP' && !CustomerPhone && _this2.context.viewModel.data.Member.Mobilephone) {
|
2661
2684
|
_this2.props.syncMemberInfoProcessor();
|
2662
2685
|
}
|
2663
2686
|
|
2664
2687
|
if (!(!CustomerPhone && !_this2.context.viewModel.data.Member.Mobilephone || DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE')) {
|
2665
|
-
_context16.next =
|
2688
|
+
_context16.next = 14;
|
2666
2689
|
break;
|
2667
2690
|
}
|
2668
2691
|
|
2669
2692
|
title = (DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && Address ? '收货地址确认' : '收货人';
|
2670
|
-
_context16.next =
|
2693
|
+
_context16.next = 14;
|
2671
2694
|
return _this2.props.openBuyerModal(title);
|
2672
2695
|
|
2673
|
-
case
|
2696
|
+
case 14:
|
2674
2697
|
|
2675
2698
|
_this2.setState({
|
2676
2699
|
bquick: bquick,
|
@@ -2680,13 +2703,13 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
2680
2703
|
_this2$store8 = _this2.store, paymode = _this2$store8.paymode, brefund = _this2$store8.brefund, boriginReturn = _this2$store8.boriginReturn, newStyle = _this2$store8.newStyle;
|
2681
2704
|
|
2682
2705
|
if (!(bquick && !_mutantsMicrofx.stores.offlineSys.shouldSettlement(type))) {
|
2683
|
-
_context16.next =
|
2706
|
+
_context16.next = 19;
|
2684
2707
|
break;
|
2685
2708
|
}
|
2686
2709
|
|
2687
2710
|
return _context16.abrupt('return', false);
|
2688
2711
|
|
2689
|
-
case
|
2712
|
+
case 19:
|
2690
2713
|
status = false;
|
2691
2714
|
|
2692
2715
|
paymode.thePaymodes.forEach(function (v) {
|
@@ -2699,13 +2722,13 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
2699
2722
|
});
|
2700
2723
|
|
2701
2724
|
if (!_this2.btndebounced) {
|
2702
|
-
_context16.next =
|
2725
|
+
_context16.next = 24;
|
2703
2726
|
break;
|
2704
2727
|
}
|
2705
2728
|
|
2706
2729
|
return _context16.abrupt('return');
|
2707
2730
|
|
2708
|
-
case
|
2731
|
+
case 24:
|
2709
2732
|
_this2.btndebounced = (0, _debounce3.default)(function () {
|
2710
2733
|
if (bquick) {
|
2711
2734
|
_this2.quickSettle(type);
|
@@ -2722,7 +2745,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
2722
2745
|
_this2.btndebounced = null;
|
2723
2746
|
}, 2000);
|
2724
2747
|
|
2725
|
-
case
|
2748
|
+
case 27:
|
2726
2749
|
case 'end':
|
2727
2750
|
return _context16.stop();
|
2728
2751
|
}
|
@@ -3953,7 +3976,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
|
|
3953
3976
|
{ key: 'settle', className: (0, _classnames4.default)({ "settle": true, "settle2": type == 1, "settleStorage": true, 'primary-btn': true }), onClick: function onClick() {
|
3954
3977
|
_this8.btnDebounced();
|
3955
3978
|
}, disabled: productsIsEmpty },
|
3956
|
-
this.props.isMemberPoints ? '立即兑换' : this.props.isMemberPointsReturn ? '退货' : settle.name
|
3979
|
+
this.props.isMemberPoints ? '立即兑换' : this.props.isMemberPointsReturn ? '退货' : IdbusiType == 39 && _mutantsMicrofx.stores.drawerStore.thisWaitPaidAmount == 0 ? '取货' : settle.name
|
3957
3980
|
)
|
3958
3981
|
),
|
3959
3982
|
!newStyle && _react2.default.createElement(
|