tplus-components-touch 3.27.15 → 3.27.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,14 +16,6 @@ var _drawer = require('antd/es/drawer');
16
16
 
17
17
  var _drawer2 = _interopRequireDefault(_drawer);
18
18
 
19
- var _extends2 = require('babel-runtime/helpers/extends');
20
-
21
- var _extends3 = _interopRequireDefault(_extends2);
22
-
23
- var _carousel = require('antd/es/carousel');
24
-
25
- var _carousel2 = _interopRequireDefault(_carousel);
26
-
27
19
  var _table = require('antd/es/table');
28
20
 
29
21
  var _table2 = _interopRequireDefault(_table);
@@ -32,6 +24,14 @@ var _keys = require('babel-runtime/core-js/object/keys');
32
24
 
33
25
  var _keys2 = _interopRequireDefault(_keys);
34
26
 
27
+ var _extends2 = require('babel-runtime/helpers/extends');
28
+
29
+ var _extends3 = _interopRequireDefault(_extends2);
30
+
31
+ var _carousel = require('antd/es/carousel');
32
+
33
+ var _carousel2 = _interopRequireDefault(_carousel);
34
+
35
35
  var _button = require('antd/es/button');
36
36
 
37
37
  var _button2 = _interopRequireDefault(_button);
@@ -96,10 +96,10 @@ require('antd/es/modal/style');
96
96
 
97
97
  require('antd/es/drawer/style');
98
98
 
99
- require('antd/es/carousel/style');
100
-
101
99
  require('antd/es/table/style');
102
100
 
101
+ require('antd/es/carousel/style');
102
+
103
103
  require('antd/es/button/style');
104
104
 
105
105
  var _react = require('react');
@@ -365,7 +365,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
365
365
  isReturn = _this2$props.isReturn,
366
366
  type = _this2$props.type;
367
367
 
368
- _promise2.default.resolve(!_this2.props.onValidate || _this2.props.onValidate()).then(function (result) {
368
+ _promise2.default.resolve(!_this2.props.onValidate || _this2.props.onValidate(function (data) {
369
+ return _this2.isNoProductTip(data);
370
+ })).then(function (result) {
369
371
  if (result) {
370
372
  _this2.setState({
371
373
  settleDisabled: false
@@ -484,7 +486,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
484
486
 
485
487
  var isAutoShowCouponWhenCash = (0, _tplusPoslogin.PosInitData)('IsAutoShowCouponWhenCash');
486
488
  // 支持异步验证过程
487
- _promise2.default.resolve(!_this2.props.onValidate || _this2.props.onValidate()).then(function (result) {
489
+ _promise2.default.resolve(!_this2.props.onValidate || _this2.props.onValidate(function (data) {
490
+ return _this2.isNoProductTip(data);
491
+ })).then(function (result) {
488
492
  if (result) {
489
493
  _this2.setState({
490
494
  settleDisabled: false
@@ -2503,78 +2507,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2503
2507
  };
2504
2508
  }();
2505
2509
 
2506
- _this2.isNoProductTip = function (nonProductMap) {
2507
- var _ref24 = _this2.context.viewModel.data || {},
2508
- RetailDetails = _ref24.RetailDetails;
2509
-
2510
- var temphtml = [];
2511
- if ((0, _keys2.default)(nonProductMap).length > 0) {
2512
- var columns = [{
2513
- title: '商品名称',
2514
- dataIndex: 'name',
2515
- key: 'name',
2516
- ellipsis: true
2517
- }, {
2518
- title: '原因',
2519
- dataIndex: 'reason',
2520
- key: 'reason',
2521
- ellipsis: true
2522
- }];
2523
-
2524
- var _loop = function _loop(key) {
2525
- var product = RetailDetails.find(function (o) {
2526
- return o.Idinventory == key;
2527
- });
2528
- temphtml.push({ name: product.Inventory.Name, reason: nonProductMap[key] });
2529
- };
2530
-
2531
- for (var key in nonProductMap) {
2532
- _loop(key);
2533
- }
2534
- var modal = (0, _asyncModal2.default)({
2535
- onPressEnter: function onPressEnter() {
2536
- modal.destroy();
2537
- },
2538
- maskClosable: false,
2539
- keyboard: false,
2540
- closable: true,
2541
- title: '不可配送商品',
2542
- width: 600,
2543
- className: '',
2544
- content: _react2.default.createElement(
2545
- 'div',
2546
- { className: 'not-distribution-tip' },
2547
- _react2.default.createElement(
2548
- 'div',
2549
- { className: 'tip-content' },
2550
- _react2.default.createElement(_table2.default, {
2551
- columns: columns,
2552
- dataSource: temphtml,
2553
- scroll: { y: 240 },
2554
- pagination: false,
2555
- size: 'middle' })
2556
- ),
2557
- _react2.default.createElement(
2558
- 'div',
2559
- { className: 'not-distribution-btn' },
2560
- _react2.default.createElement(
2561
- _button2.default,
2562
- { type: 'primary', onClick: function onClick() {
2563
- modal.destroy();
2564
- } },
2565
- '\u77E5\u9053\u4E86'
2566
- )
2567
- )
2568
- )
2569
- });
2570
- return true;
2571
- }
2572
- return false;
2573
- };
2574
-
2575
2510
  _this2.btnDebounced = function () {
2576
- var _ref25 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(type, bquick) {
2577
- var IdbusiType, CustomerPhone, DistributionMode, Address, title, _this2$store7, getPerformanceDistributionValue, getPosFreight, updataFreight, IPMSG, _ref26, nonProductMap, _ref26$freightProduct, freightProductDTOList, data, _enumController$getEn22, PayStyle, _this2$store8, paymode, brefund, boriginReturn, newStyle, status;
2511
+ var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(type, bquick) {
2512
+ var IdbusiType, CustomerPhone, DistributionMode, Address, title, _enumController$getEn22, PayStyle, _this2$store7, paymode, brefund, boriginReturn, newStyle, status;
2578
2513
 
2579
2514
  return _regenerator2.default.wrap(function _callee14$(_context14) {
2580
2515
  while (1) {
@@ -2587,7 +2522,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2587
2522
  //预订时,若没录入买家手机号,或配送方式为快递时,弹框买家信息确认框
2588
2523
 
2589
2524
  if (!(IdbusiType == 38)) {
2590
- _context14.next = 30;
2525
+ _context14.next = 9;
2591
2526
  break;
2592
2527
  }
2593
2528
 
@@ -2601,71 +2536,21 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2601
2536
  return _this2.props.openBuyerModal(title);
2602
2537
 
2603
2538
  case 9:
2604
- if (!(DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE')) {
2605
- _context14.next = 30;
2606
- break;
2607
- }
2608
-
2609
- _this2$store7 = _this2.store, getPerformanceDistributionValue = _this2$store7.getPerformanceDistributionValue, getPosFreight = _this2$store7.getPosFreight, updataFreight = _this2$store7.updataFreight;
2610
- IPMSG = {};
2611
-
2612
- if (!!window.localStorage.IPMSG) {
2613
- IPMSG = JSON.parse(window.localStorage.IPMSG);
2614
- }
2615
- _context14.next = 15;
2616
- return getPerformanceDistributionValue({ cip: IPMSG.query || "", dto: _this2.context.viewModel.data });
2617
-
2618
- case 15:
2619
- _ref26 = _context14.sent;
2620
- nonProductMap = _ref26.nonProductMap;
2621
- _ref26$freightProduct = _ref26.freightProductDTOList;
2622
- freightProductDTOList = _ref26$freightProduct === undefined ? [] : _ref26$freightProduct;
2623
-
2624
- if (!_this2.isNoProductTip(nonProductMap)) {
2625
- _context14.next = 21;
2626
- break;
2627
- }
2628
-
2629
- return _context14.abrupt('return');
2630
-
2631
- case 21:
2632
- _context14.next = 23;
2633
- return _this2.props.openWareHouseModal(freightProductDTOList);
2634
-
2635
- case 23:
2636
- _context14.next = 25;
2637
- return getPosFreight({ cip: IPMSG.query || "", dto: _this2.context.viewModel.data });
2638
-
2639
- case 25:
2640
- data = _context14.sent;
2641
-
2642
- if (!_this2.isNoProductTip(data.nonProductMap)) {
2643
- _context14.next = 28;
2644
- break;
2645
- }
2646
-
2647
- return _context14.abrupt('return');
2648
-
2649
- case 28:
2650
- _context14.next = 30;
2651
- return _this2.props.updataFreight(data.freight);
2652
-
2653
- case 30:
2654
2539
 
2655
2540
  _this2.setState({
2656
2541
  bquick: bquick
2657
2542
  });
2658
2543
  _enumController$getEn22 = _mutantsUtil.enumController.getEnumOj(), PayStyle = _enumController$getEn22.PayStyle;
2659
- _this2$store8 = _this2.store, paymode = _this2$store8.paymode, brefund = _this2$store8.brefund, boriginReturn = _this2$store8.boriginReturn, newStyle = _this2$store8.newStyle;
2544
+ _this2$store7 = _this2.store, paymode = _this2$store7.paymode, brefund = _this2$store7.brefund, boriginReturn = _this2$store7.boriginReturn, newStyle = _this2$store7.newStyle;
2660
2545
 
2661
2546
  if (!(bquick && !_mutantsMicrofx.stores.offlineSys.shouldSettlement(type))) {
2662
- _context14.next = 35;
2547
+ _context14.next = 14;
2663
2548
  break;
2664
2549
  }
2665
2550
 
2666
2551
  return _context14.abrupt('return', false);
2667
2552
 
2668
- case 35:
2553
+ case 14:
2669
2554
  status = false;
2670
2555
 
2671
2556
  paymode.thePaymodes.forEach(function (v) {
@@ -2678,13 +2563,13 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2678
2563
  });
2679
2564
 
2680
2565
  if (!_this2.btndebounced) {
2681
- _context14.next = 40;
2566
+ _context14.next = 19;
2682
2567
  break;
2683
2568
  }
2684
2569
 
2685
2570
  return _context14.abrupt('return');
2686
2571
 
2687
- case 40:
2572
+ case 19:
2688
2573
  _this2.btndebounced = (0, _debounce3.default)(function () {
2689
2574
  if (bquick) {
2690
2575
  _this2.quickSettle(type);
@@ -2701,7 +2586,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2701
2586
  _this2.btndebounced = null;
2702
2587
  }, 2000);
2703
2588
 
2704
- case 43:
2589
+ case 22:
2705
2590
  case 'end':
2706
2591
  return _context14.stop();
2707
2592
  }
@@ -2710,14 +2595,14 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2710
2595
  }));
2711
2596
 
2712
2597
  return function (_x8, _x9) {
2713
- return _ref25.apply(this, arguments);
2598
+ return _ref24.apply(this, arguments);
2714
2599
  };
2715
2600
  }();
2716
2601
 
2717
2602
  _this2.onCzkChange = function (v) {
2718
2603
  // console.log("czk change:"+new Date().toLocaleTimeString())
2719
- var _ref27 = _mutantsUtil.platform || {},
2720
- isNewRetailBCPos = _ref27.isNewRetailBCPos;
2604
+ var _ref25 = _mutantsUtil.platform || {},
2605
+ isNewRetailBCPos = _ref25.isNewRetailBCPos;
2721
2606
 
2722
2607
  if (!isNewRetailBCPos) {
2723
2608
  _this2.store.paymode.currentMode.member.setCardNo(v);
@@ -3133,9 +3018,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3133
3018
  };
3134
3019
 
3135
3020
  _this2.checkCurrentModeHaveMutex = function (type) {
3136
- var _this2$store9 = _this2.store,
3137
- paymode = _this2$store9.paymode,
3138
- newStyle = _this2$store9.newStyle;
3021
+ var _this2$store8 = _this2.store,
3022
+ paymode = _this2$store8.paymode,
3023
+ newStyle = _this2$store8.newStyle;
3139
3024
 
3140
3025
  var _enumController$getEn27 = _mutantsUtil.enumController.getEnumOj(),
3141
3026
  PayStyle = _enumController$getEn27.PayStyle;
@@ -3308,11 +3193,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3308
3193
 
3309
3194
  _this2.hasElectron = hasElectron;
3310
3195
 
3311
- var _ref28 = _mutantsMicrofx.stores.user.options.get('loginInfo') || {},
3312
- ICCardServer = _ref28.ICCardServer,
3313
- ICCardPassword = _ref28.ICCardPassword,
3314
- PreSellOrBook = _ref28.PreSellOrBook,
3315
- PercentageWhenBook = _ref28.PercentageWhenBook;
3196
+ var _ref26 = _mutantsMicrofx.stores.user.options.get('loginInfo') || {},
3197
+ ICCardServer = _ref26.ICCardServer,
3198
+ ICCardPassword = _ref26.ICCardPassword,
3199
+ PreSellOrBook = _ref26.PreSellOrBook,
3200
+ PercentageWhenBook = _ref26.PercentageWhenBook;
3316
3201
 
3317
3202
  _this2.iCCardServer = parseInt(ICCardServer); // 启用IC卡:0为禁用 1为启用
3318
3203
  _this2.iCCardPassword = ICCardPassword; //IC卡密码
@@ -3320,9 +3205,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3320
3205
  _this2.percentageWhenBook = PercentageWhenBook;
3321
3206
  //移动端环境下,没有读取IC卡的方式。
3322
3207
 
3323
- var _ref29 = _mutantsUtil.platform || {},
3324
- isHorizontalPad = _ref29.isHorizontalPad,
3325
- isHorizontalSunMi = _ref29.isHorizontalSunMi;
3208
+ var _ref27 = _mutantsUtil.platform || {},
3209
+ isHorizontalPad = _ref27.isHorizontalPad,
3210
+ isHorizontalSunMi = _ref27.isHorizontalSunMi;
3326
3211
 
3327
3212
  _this2.isHorizontalPad = !!isHorizontalPad;
3328
3213
  _this2.isHorizontalSunMi = !!isHorizontalSunMi;
@@ -3448,6 +3333,76 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3448
3333
 
3449
3334
  //that[`inputS${paymode.paymethodId}`]
3450
3335
 
3336
+ }, {
3337
+ key: 'isNoProductTip',
3338
+ value: function isNoProductTip(nonProductMap) {
3339
+ var _ref28 = this.context.viewModel.data || {},
3340
+ RetailDetails = _ref28.RetailDetails;
3341
+
3342
+ var temphtml = [];
3343
+ if ((0, _keys2.default)(nonProductMap).length > 0) {
3344
+ var columns = [{
3345
+ title: '商品名称',
3346
+ dataIndex: 'name',
3347
+ key: 'name',
3348
+ ellipsis: true
3349
+ }, {
3350
+ title: '原因',
3351
+ dataIndex: 'reason',
3352
+ key: 'reason',
3353
+ ellipsis: true
3354
+ }];
3355
+
3356
+ var _loop = function _loop(key) {
3357
+ var product = RetailDetails.find(function (o) {
3358
+ return o.Idinventory == key;
3359
+ });
3360
+ temphtml.push({ name: product.Inventory.Name, reason: nonProductMap[key] });
3361
+ };
3362
+
3363
+ for (var key in nonProductMap) {
3364
+ _loop(key);
3365
+ }
3366
+ var modal = (0, _asyncModal2.default)({
3367
+ onPressEnter: function onPressEnter() {
3368
+ modal.destroy();
3369
+ },
3370
+ maskClosable: false,
3371
+ keyboard: false,
3372
+ closable: true,
3373
+ title: '不可配送商品',
3374
+ width: 600,
3375
+ className: '',
3376
+ content: _react2.default.createElement(
3377
+ 'div',
3378
+ { className: 'not-distribution-tip' },
3379
+ _react2.default.createElement(
3380
+ 'div',
3381
+ { className: 'tip-content' },
3382
+ _react2.default.createElement(_table2.default, {
3383
+ columns: columns,
3384
+ dataSource: temphtml,
3385
+ scroll: { y: 240 },
3386
+ pagination: false,
3387
+ size: 'middle' })
3388
+ ),
3389
+ _react2.default.createElement(
3390
+ 'div',
3391
+ { className: 'not-distribution-btn' },
3392
+ _react2.default.createElement(
3393
+ _button2.default,
3394
+ { type: 'primary', onClick: function onClick() {
3395
+ modal.destroy();
3396
+ } },
3397
+ '\u77E5\u9053\u4E86'
3398
+ )
3399
+ )
3400
+ )
3401
+ });
3402
+ return true;
3403
+ }
3404
+ return false;
3405
+ }
3451
3406
  }, {
3452
3407
  key: 'checkThepaymode',
3453
3408
  value: function checkThepaymode(key) {
@@ -3557,8 +3512,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3557
3512
  discountPrototypeTotalAmount = _state2.discountPrototypeTotalAmount,
3558
3513
  storageValue = _state2.storageValue;
3559
3514
 
3560
- var _ref30 = _mutantsUtil.platform || {},
3561
- isNewRetailBCPos = _ref30.isNewRetailBCPos;
3515
+ var _ref29 = _mutantsUtil.platform || {},
3516
+ isNewRetailBCPos = _ref29.isNewRetailBCPos;
3562
3517
 
3563
3518
  var _store2 = this.store,
3564
3519
  paymode = _store2.paymode,
@@ -3633,11 +3588,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3633
3588
  quantity4 = 0;
3634
3589
  var sumQuantity = 0; //数量总和的值,包括称重的。
3635
3590
 
3636
- var _ref31 = quantityDetail || {},
3637
- _ref31$buyQuantity = _ref31.buyQuantity,
3638
- buyQuantity = _ref31$buyQuantity === undefined ? 0 : _ref31$buyQuantity,
3639
- _ref31$returnQuantity = _ref31.returnQuantity,
3640
- returnQuantity = _ref31$returnQuantity === undefined ? 0 : _ref31$returnQuantity;
3591
+ var _ref30 = quantityDetail || {},
3592
+ _ref30$buyQuantity = _ref30.buyQuantity,
3593
+ buyQuantity = _ref30$buyQuantity === undefined ? 0 : _ref30$buyQuantity,
3594
+ _ref30$returnQuantity = _ref30.returnQuantity,
3595
+ returnQuantity = _ref30$returnQuantity === undefined ? 0 : _ref30$returnQuantity;
3641
3596
 
3642
3597
  var quantityPrecision = (0, _tplusPoslogin.PosInitData)("QuantityPrecision");
3643
3598
  quantityPrecision = quantityPrecision ? parseInt(quantityPrecision) : '';
@@ -5030,8 +4985,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
5030
4985
  _this8.setCurrentModeValue(event.target.value, Math.min(currentMode.maxamount, currentMode.member.balance));
5031
4986
  },
5032
4987
  defaultValue: currentMode && (0, _utils.getFixedNumber)(brefund ? currentMode.value : Math.min(currentMode.value, currentMode.maxamount, currentMode.member.balance)),
5033
- ref: function ref(_ref32) {
5034
- return _this8["inputCzkAmount"] = _ref32;
4988
+ ref: function ref(_ref31) {
4989
+ return _this8["inputCzkAmount"] = _ref31;
5035
4990
  },
5036
4991
  onFocus: function onFocus(e) {
5037
4992
  _this8.inputkey = "inputCzkAmount";
@@ -5648,8 +5603,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
5648
5603
  _this8.setCurrentModeValue(e.target.value, Math.min(currentMode.maxamount, currentMode.member.exchangable));
5649
5604
  },
5650
5605
  defaultValue: currentMode && (0, _utils.getFixedNumber)(Math.min(currentMode.value, currentMode.maxamount, currentMode.member.exchangable)),
5651
- ref: function ref(_ref33) {
5652
- return _this8["inputJfdxAmount"] = _ref33;
5606
+ ref: function ref(_ref32) {
5607
+ return _this8["inputJfdxAmount"] = _ref32;
5653
5608
  },
5654
5609
  onFocus: function onFocus(e) {
5655
5610
  _this8.inputkey = "inputJfdxAmount";