tplus-components-touch 3.54.4 → 3.54.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -359,7 +359,6 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
359
359
  };
360
360
 
361
361
  _this2.payQuick = function () {
362
- var IdbusiType = _this2.context.viewModel.data.IdbusiType;
363
362
  var _this2$state = _this2.state,
364
363
  currentKey = _this2$state.currentKey,
365
364
  returnAmount = _this2$state.returnAmount;
@@ -367,13 +366,19 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
367
366
  var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
368
367
  PayStyle = _enumController$getEn.PayStyle;
369
368
 
369
+ var newAmount = _this2.props.amount;
370
+ if (_this2.props.type != 1) {
371
+ var IdbusiType = _this2.context.viewModel.data.IdbusiType;
372
+
373
+ if (IdbusiType === 42) newAmount = -returnAmount;
374
+ }
370
375
  _this2.store.init({
371
376
  context: _this2.props.type == 1 ? null : _this2.context,
372
377
  amounthandler: _this2.props.onHandleAmount,
373
378
  datasource: _this2.props.dataSource.Code_02,
374
379
  storeinfo: _this2.props.storeInfo,
375
380
  bquick: true,
376
- amount: IdbusiType === 42 ? -returnAmount : _this2.props.amount,
381
+ amount: newAmount,
377
382
  type: _this2.props.type,
378
383
  data: _this2.props.dto,
379
384
  payModeKey: currentKey
@@ -438,20 +443,24 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
438
443
  };
439
444
 
440
445
  _this2.payFun = function () {
441
- var IdbusiType = _this2.context.viewModel.data.IdbusiType;
442
446
  var returnAmount = _this2.state.returnAmount;
443
447
 
448
+ var newAmount = _this2.props.amount;
449
+ if (_this2.props.type != 1) {
450
+ var IdbusiType = _this2.context.viewModel.data.IdbusiType;
451
+
452
+ if (IdbusiType === 42) newAmount = -returnAmount;
453
+ }
444
454
  _this2.store.init({
445
455
  context: _this2.props.type == 1 ? null : _this2.context,
446
456
  amounthandler: _this2.props.onHandleAmount,
447
457
  datasource: _this2.props.dataSource.Code_02,
448
458
  storeinfo: _this2.props.storeInfo,
449
459
  bquick: false,
450
- amount: IdbusiType === 42 ? -returnAmount : _this2.props.amount,
460
+ amount: newAmount,
451
461
  type: _this2.props.type,
452
462
  data: _this2.props.dto,
453
463
  creditSalesVoucher: _this2.props.creditSalesVoucher,
454
- saleTotalTaxAmount: _this2.props.saleTotalTaxAmount,
455
464
  custVendorId: _this2.props.custVendorId
456
465
  });
457
466
  var amount = _this2.store.paymode.amount;
@@ -2313,13 +2322,116 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2313
2322
  };
2314
2323
  }();
2315
2324
 
2316
- _this2.handleCzk = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14() {
2317
- var curmode, promises, _enumController$getEn22, PayStyle;
2325
+ _this2.handleCzk = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16() {
2326
+ var handleUserInputs = function () {
2327
+ var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(promises) {
2328
+ var results, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, p, _result2;
2329
+
2330
+ return _regenerator2.default.wrap(function _callee15$(_context15) {
2331
+ while (1) {
2332
+ switch (_context15.prev = _context15.next) {
2333
+ case 0:
2334
+ results = [];
2335
+ _context15.prev = 1;
2336
+ _iteratorNormalCompletion2 = true;
2337
+ _didIteratorError2 = false;
2338
+ _iteratorError2 = undefined;
2339
+ _context15.prev = 5;
2340
+ _iterator2 = (0, _getIterator3.default)(promises);
2341
+
2342
+ case 7:
2343
+ if (_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done) {
2344
+ _context15.next = 16;
2345
+ break;
2346
+ }
2347
+
2348
+ p = _step2.value;
2349
+ _context15.next = 11;
2350
+ return p;
2351
+
2352
+ case 11:
2353
+ _result2 = _context15.sent;
2354
+
2355
+ results.push(_result2);
2356
+
2357
+ case 13:
2358
+ _iteratorNormalCompletion2 = true;
2359
+ _context15.next = 7;
2360
+ break;
2361
+
2362
+ case 16:
2363
+ _context15.next = 22;
2364
+ break;
2365
+
2366
+ case 18:
2367
+ _context15.prev = 18;
2368
+ _context15.t0 = _context15['catch'](5);
2369
+ _didIteratorError2 = true;
2370
+ _iteratorError2 = _context15.t0;
2371
+
2372
+ case 22:
2373
+ _context15.prev = 22;
2374
+ _context15.prev = 23;
2375
+
2376
+ if (!_iteratorNormalCompletion2 && _iterator2.return) {
2377
+ _iterator2.return();
2378
+ }
2379
+
2380
+ case 25:
2381
+ _context15.prev = 25;
2382
+
2383
+ if (!_didIteratorError2) {
2384
+ _context15.next = 28;
2385
+ break;
2386
+ }
2387
+
2388
+ throw _iteratorError2;
2389
+
2390
+ case 28:
2391
+ return _context15.finish(25);
2392
+
2393
+ case 29:
2394
+ return _context15.finish(22);
2395
+
2396
+ case 30:
2397
+ _context15.next = 32;
2398
+ return commit(results);
2318
2399
 
2319
- return _regenerator2.default.wrap(function _callee14$(_context14) {
2400
+ case 32:
2401
+ _context15.next = 37;
2402
+ break;
2403
+
2404
+ case 34:
2405
+ _context15.prev = 34;
2406
+ _context15.t1 = _context15['catch'](1);
2407
+
2408
+ if (_context15.t1 != "cancelpwd") {
2409
+ _message2.default.error(_context15.t1);
2410
+ setTimeout(function () {
2411
+ that.handleCzk();
2412
+ }, 500);
2413
+ }
2414
+
2415
+ case 37:
2416
+ case 'end':
2417
+ return _context15.stop();
2418
+ }
2419
+ }
2420
+ }, _callee15, this, [[1, 34], [5, 18, 22, 30], [23,, 25, 29]]);
2421
+ }));
2422
+
2423
+ return function handleUserInputs(_x9) {
2424
+ return _ref18.apply(this, arguments);
2425
+ };
2426
+ }();
2427
+
2428
+ var that, curmode, promises, _enumController$getEn22, PayStyle, commit;
2429
+
2430
+ return _regenerator2.default.wrap(function _callee16$(_context16) {
2320
2431
  while (1) {
2321
- switch (_context14.prev = _context14.next) {
2432
+ switch (_context16.prev = _context16.next) {
2322
2433
  case 0:
2434
+ that = _this2;
2323
2435
  curmode = _this2.store.paymode.currentMode;
2324
2436
  promises = [];
2325
2437
 
@@ -2339,12 +2451,69 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2339
2451
  }
2340
2452
  }
2341
2453
 
2342
- case 3:
2454
+ commit = function () {
2455
+ var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee14(values) {
2456
+ var result;
2457
+ return _regenerator2.default.wrap(function _callee14$(_context14) {
2458
+ while (1) {
2459
+ switch (_context14.prev = _context14.next) {
2460
+ case 0:
2461
+ if (!(values.length > 0)) {
2462
+ _context14.next = 6;
2463
+ break;
2464
+ }
2465
+
2466
+ _context14.next = 3;
2467
+ return that.store.validePwd(values[0]);
2468
+
2469
+ case 3:
2470
+ _context14.t0 = _context14.sent;
2471
+ _context14.next = 7;
2472
+ break;
2473
+
2474
+ case 6:
2475
+ _context14.t0 = "";
2476
+
2477
+ case 7:
2478
+ result = _context14.t0;
2479
+
2480
+ if (!(result == "")) {
2481
+ _context14.next = 13;
2482
+ break;
2483
+ }
2484
+
2485
+ //成功
2486
+ //返回
2487
+ that.setCurrentFocusAndAddPay(curmode.paymentType, null, curmode.paymethodId);
2488
+ _promise2.default.resolve();
2489
+ _context14.next = 15;
2490
+ break;
2491
+
2492
+ case 13:
2493
+ _context14.next = 15;
2494
+ return _promise2.default.reject(result);
2495
+
2496
+ case 15:
2497
+ case 'end':
2498
+ return _context14.stop();
2499
+ }
2500
+ }
2501
+ }, _callee14, _this3);
2502
+ }));
2503
+
2504
+ return function commit(_x8) {
2505
+ return _ref17.apply(this, arguments);
2506
+ };
2507
+ }();
2508
+
2509
+ handleUserInputs(promises);
2510
+
2511
+ case 6:
2343
2512
  case 'end':
2344
- return _context14.stop();
2513
+ return _context16.stop();
2345
2514
  }
2346
2515
  }
2347
- }, _callee14, _this3);
2516
+ }, _callee16, _this3);
2348
2517
  }));
2349
2518
 
2350
2519
  _this2.fKeyboardOnOk = function (paymethodeId) {
@@ -2384,12 +2553,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2384
2553
  };
2385
2554
 
2386
2555
  _this2.handleBtnDebounced = function () {
2387
- var _ref17 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee15(type, bquick) {
2556
+ var _ref19 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(type, bquick) {
2388
2557
  var IdbusiType, CustomerPhone, DistributionMode, Address, isEnableSerialNumber, resultObj, title, productStore, checkResult, _enumController$getEn23, PayStyle, _this2$store7, paymode, brefund, boriginReturn, newStyle, status;
2389
2558
 
2390
- return _regenerator2.default.wrap(function _callee15$(_context15) {
2559
+ return _regenerator2.default.wrap(function _callee17$(_context17) {
2391
2560
  while (1) {
2392
- switch (_context15.prev = _context15.next) {
2561
+ switch (_context17.prev = _context17.next) {
2393
2562
  case 0:
2394
2563
  IdbusiType = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data && _this2.context.viewModel.data.IdbusiType;
2395
2564
  CustomerPhone = _this2.context && _this2.context.viewModel && _this2.context.viewModel.data && _this2.context.viewModel.data.CustomerPhone;
@@ -2398,7 +2567,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2398
2567
  //预订时,若没录入买家手机号,或配送方式为快递时,弹框买家信息确认框
2399
2568
 
2400
2569
  if (!(IdbusiType == 38)) {
2401
- _context15.next = 14;
2570
+ _context17.next = 14;
2402
2571
  break;
2403
2572
  }
2404
2573
 
@@ -2409,11 +2578,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2409
2578
  });
2410
2579
 
2411
2580
  if (!(isEnableSerialNumber && resultObj && (DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE'))) {
2412
- _context15.next = 9;
2581
+ _context17.next = 9;
2413
2582
  break;
2414
2583
  }
2415
2584
 
2416
- return _context15.abrupt('return', _message2.default.error('启用了序列号管理和批号/有效期管理的商品,不支持快递和同城配送'));
2585
+ return _context17.abrupt('return', _message2.default.error('启用了序列号管理和批号/有效期管理的商品,不支持快递和同城配送'));
2417
2586
 
2418
2587
  case 9:
2419
2588
 
@@ -2422,12 +2591,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2422
2591
  }
2423
2592
 
2424
2593
  if (!(!CustomerPhone && !_this2.context.viewModel.data.Member.Mobilephone || DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE')) {
2425
- _context15.next = 14;
2594
+ _context17.next = 14;
2426
2595
  break;
2427
2596
  }
2428
2597
 
2429
2598
  title = (DistributionMode.Id == 'ELECTRONIC' || DistributionMode.Id == 'CITY_DISTRIBUTE') && Address ? '收货地址确认' : '收货人';
2430
- _context15.next = 14;
2599
+ _context17.next = 14;
2431
2600
  return _this2.props.openBuyerModal(title);
2432
2601
 
2433
2602
  case 14:
@@ -2435,18 +2604,18 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2435
2604
  // 极速模式错误校验
2436
2605
 
2437
2606
  productStore = _mutantsMicrofx.stores.productStore;
2438
- _context15.next = 17;
2607
+ _context17.next = 17;
2439
2608
  return productStore.checkShouldSettlement();
2440
2609
 
2441
2610
  case 17:
2442
- checkResult = _context15.sent;
2611
+ checkResult = _context17.sent;
2443
2612
 
2444
2613
  if (checkResult) {
2445
- _context15.next = 20;
2614
+ _context17.next = 20;
2446
2615
  break;
2447
2616
  }
2448
2617
 
2449
- return _context15.abrupt('return', false);
2618
+ return _context17.abrupt('return', false);
2450
2619
 
2451
2620
  case 20:
2452
2621
 
@@ -2457,11 +2626,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2457
2626
  _this2$store7 = _this2.store, paymode = _this2$store7.paymode, brefund = _this2$store7.brefund, boriginReturn = _this2$store7.boriginReturn, newStyle = _this2$store7.newStyle;
2458
2627
 
2459
2628
  if (!(bquick && !_mutantsMicrofx.stores.offlineSys.shouldSettlement(type))) {
2460
- _context15.next = 25;
2629
+ _context17.next = 25;
2461
2630
  break;
2462
2631
  }
2463
2632
 
2464
- return _context15.abrupt('return', false);
2633
+ return _context17.abrupt('return', false);
2465
2634
 
2466
2635
  case 25:
2467
2636
  status = false;
@@ -2476,11 +2645,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2476
2645
  });
2477
2646
 
2478
2647
  if (!_this2.btndebounced) {
2479
- _context15.next = 30;
2648
+ _context17.next = 30;
2480
2649
  break;
2481
2650
  }
2482
2651
 
2483
- return _context15.abrupt('return');
2652
+ return _context17.abrupt('return');
2484
2653
 
2485
2654
  case 30:
2486
2655
  _this2.btndebounced = (0, _debounce3.default)(function () {
@@ -2501,42 +2670,48 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2501
2670
 
2502
2671
  case 33:
2503
2672
  case 'end':
2504
- return _context15.stop();
2673
+ return _context17.stop();
2505
2674
  }
2506
2675
  }
2507
- }, _callee15, _this3);
2676
+ }, _callee17, _this3);
2508
2677
  }));
2509
2678
 
2510
- return function (_x8, _x9) {
2511
- return _ref17.apply(this, arguments);
2679
+ return function (_x10, _x11) {
2680
+ return _ref19.apply(this, arguments);
2512
2681
  };
2513
2682
  }();
2514
2683
 
2515
2684
  _this2.btnDebounced = function () {
2516
- var _ref18 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee16(type, bquick) {
2517
- var _this2$context$viewMo2, IdbusiType, _this2$context$viewMo3, TotalTaxAmount, _this2$context$viewMo4, ArrearsAmount, save, _this2$props3, settlementType, _this2$props3$creditS, creditSalesVoucher, notSelectableVoucherList, returnAmount1, _result2;
2685
+ var _ref20 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee18(type, bquick) {
2686
+ var _this2$props3, settlementType, _this2$props3$creditS, creditSalesVoucher, amount, notSelectableVoucherList, _this2$context$viewMo2, IdbusiType, _this2$context$viewMo3, TotalTaxAmount, _this2$context$viewMo4, ArrearsAmount, returnAmount1, _result3;
2518
2687
 
2519
- return _regenerator2.default.wrap(function _callee16$(_context16) {
2688
+ return _regenerator2.default.wrap(function _callee18$(_context18) {
2520
2689
  while (1) {
2521
- switch (_context16.prev = _context16.next) {
2690
+ switch (_context18.prev = _context18.next) {
2522
2691
  case 0:
2523
- _this2$context$viewMo2 = _this2.context.viewModel.data, IdbusiType = _this2$context$viewMo2.IdbusiType, _this2$context$viewMo3 = _this2$context$viewMo2.TotalTaxAmount, TotalTaxAmount = _this2$context$viewMo3 === undefined ? 0 : _this2$context$viewMo3, _this2$context$viewMo4 = _this2$context$viewMo2.ArrearsAmount, ArrearsAmount = _this2$context$viewMo4 === undefined ? 0 : _this2$context$viewMo4;
2524
- save = _this2.store.save;
2525
- _this2$props3 = _this2.props, settlementType = _this2$props3.type, _this2$props3$creditS = _this2$props3.creditSalesVoucher, creditSalesVoucher = _this2$props3$creditS === undefined ? [] : _this2$props3$creditS;
2692
+ _this2$props3 = _this2.props, settlementType = _this2$props3.type, _this2$props3$creditS = _this2$props3.creditSalesVoucher, creditSalesVoucher = _this2$props3$creditS === undefined ? [] : _this2$props3$creditS, amount = _this2$props3.amount;
2526
2693
  notSelectableVoucherList = [];
2527
2694
  //赊销-未生成零售结算单的单据不能进行收款
2528
2695
 
2529
2696
  if (!(settlementType == 2)) {
2530
- _context16.next = 9;
2697
+ _context18.next = 9;
2698
+ break;
2699
+ }
2700
+
2701
+ if (!(Number(amount) < 0)) {
2702
+ _context18.next = 5;
2531
2703
  break;
2532
2704
  }
2533
2705
 
2706
+ return _context18.abrupt('return', _message2.default.warn('所勾选零售单的欠款合计须大于等于0!'));
2707
+
2708
+ case 5:
2534
2709
  notSelectableVoucherList = creditSalesVoucher.filter(function (o) {
2535
2710
  return o.SettleStatusEnum != 'SETTLED';
2536
2711
  });
2537
2712
 
2538
2713
  if (!(notSelectableVoucherList.length > 0)) {
2539
- _context16.next = 9;
2714
+ _context18.next = 9;
2540
2715
  break;
2541
2716
  }
2542
2717
 
@@ -2565,11 +2740,19 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2565
2740
  )
2566
2741
  )
2567
2742
  });
2568
- return _context16.abrupt('return');
2743
+ return _context18.abrupt('return');
2569
2744
 
2570
2745
  case 9:
2746
+ if (!(_this2.props.type != 1)) {
2747
+ _context18.next = 28;
2748
+ break;
2749
+ }
2750
+
2751
+ _this2$context$viewMo2 = _this2.context.viewModel.data, IdbusiType = _this2$context$viewMo2.IdbusiType, _this2$context$viewMo3 = _this2$context$viewMo2.TotalTaxAmount, TotalTaxAmount = _this2$context$viewMo3 === undefined ? 0 : _this2$context$viewMo3, _this2$context$viewMo4 = _this2$context$viewMo2.ArrearsAmount, ArrearsAmount = _this2$context$viewMo4 === undefined ? 0 : _this2$context$viewMo4;
2752
+ //赊销原单退货
2753
+
2571
2754
  if (!(IdbusiType === 42)) {
2572
- _context16.next = 23;
2755
+ _context18.next = 25;
2573
2756
  break;
2574
2757
  }
2575
2758
 
@@ -2582,7 +2765,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2582
2765
  //判断欠款金额
2583
2766
 
2584
2767
  if (!(returnAmount1 > 0)) {
2585
- _context16.next = 16;
2768
+ _context18.next = 18;
2586
2769
  break;
2587
2770
  }
2588
2771
 
@@ -2595,18 +2778,18 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2595
2778
  },
2596
2779
  onCancel: function onCancel() {}
2597
2780
  });
2598
- _context16.next = 21;
2781
+ _context18.next = 23;
2599
2782
  break;
2600
2783
 
2601
- case 16:
2784
+ case 18:
2602
2785
  returnAmount1 = 0;
2603
- _context16.next = 19;
2786
+ _context18.next = 21;
2604
2787
  return _this2.store.commit(_this2.props.bTest, _this2.context.viewModel.data);
2605
2788
 
2606
- case 19:
2607
- _result2 = _context16.sent;
2789
+ case 21:
2790
+ _result3 = _context18.sent;
2608
2791
 
2609
- if (_result2 === true) {
2792
+ if (_result3 === true) {
2610
2793
  //成功
2611
2794
  _this2.settleSuccess('onCreditReturn');
2612
2795
  _promise2.default.resolve();
@@ -2623,29 +2806,36 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
2623
2806
  }, 0);
2624
2807
  }
2625
2808
 
2626
- case 21:
2627
- _context16.next = 24;
2809
+ case 23:
2810
+ _context18.next = 26;
2628
2811
  break;
2629
2812
 
2630
- case 23:
2813
+ case 25:
2814
+ _this2.handleBtnDebounced(type, bquick);
2815
+
2816
+ case 26:
2817
+ _context18.next = 29;
2818
+ break;
2819
+
2820
+ case 28:
2631
2821
  _this2.handleBtnDebounced(type, bquick);
2632
2822
 
2633
- case 24:
2823
+ case 29:
2634
2824
  case 'end':
2635
- return _context16.stop();
2825
+ return _context18.stop();
2636
2826
  }
2637
2827
  }
2638
- }, _callee16, _this3);
2828
+ }, _callee18, _this3);
2639
2829
  }));
2640
2830
 
2641
- return function (_x10, _x11) {
2642
- return _ref18.apply(this, arguments);
2831
+ return function (_x12, _x13) {
2832
+ return _ref20.apply(this, arguments);
2643
2833
  };
2644
2834
  }();
2645
2835
 
2646
2836
  _this2.onCzkChange = function (v) {
2647
- var _ref19 = _mutantsUtil.platform || {},
2648
- isNewRetailBCPos = _ref19.isNewRetailBCPos;
2837
+ var _ref21 = _mutantsUtil.platform || {},
2838
+ isNewRetailBCPos = _ref21.isNewRetailBCPos;
2649
2839
 
2650
2840
  if (!isNewRetailBCPos) {
2651
2841
  _this2.store.paymode.currentMode.member.setCardNo(v);
@@ -3112,9 +3302,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3112
3302
  return false;
3113
3303
  }
3114
3304
  if (_this2.store.brefund) {
3115
- var _result3 = !(paymode.receivable == 0 && thePaymodes.length > 0);
3116
- console.log("settlement.checkSettleDisabled返回结果:", _result3);
3117
- return _result3;
3305
+ var _result4 = !(paymode.receivable == 0 && thePaymodes.length > 0);
3306
+ console.log("settlement.checkSettleDisabled返回结果:", _result4);
3307
+ return _result4;
3118
3308
  }
3119
3309
  var xj = (0, _find3.default)(thePaymodes, function (mode) {
3120
3310
  return mode.paymentType == PayStyle.xianjin;
@@ -3251,12 +3441,12 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3251
3441
 
3252
3442
  _this2.hasElectron = hasElectron;
3253
3443
 
3254
- var _ref20 = _mutantsMicrofx.stores.user.options.get('loginInfo') || {},
3255
- MemberMeStorageCardInputByKeyBoard = _ref20.MemberMeStorageCardInputByKeyBoard,
3256
- ICCardServer = _ref20.ICCardServer,
3257
- ICCardPassword = _ref20.ICCardPassword,
3258
- PreSellOrBook = _ref20.PreSellOrBook,
3259
- PercentageWhenBook = _ref20.PercentageWhenBook;
3444
+ var _ref22 = _mutantsMicrofx.stores.user.options.get('loginInfo') || {},
3445
+ MemberMeStorageCardInputByKeyBoard = _ref22.MemberMeStorageCardInputByKeyBoard,
3446
+ ICCardServer = _ref22.ICCardServer,
3447
+ ICCardPassword = _ref22.ICCardPassword,
3448
+ PreSellOrBook = _ref22.PreSellOrBook,
3449
+ PercentageWhenBook = _ref22.PercentageWhenBook;
3260
3450
 
3261
3451
  _this2.isStorageCardInputType = MemberMeStorageCardInputByKeyBoard; // 仅储值卡是否禁用键盘输入,'0'为不禁用 '1'为禁用
3262
3452
  _this2.iCCardServer = parseInt(ICCardServer); // 启用IC卡:0为禁用 1为启用
@@ -3265,9 +3455,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3265
3455
  _this2.percentageWhenBook = PercentageWhenBook;
3266
3456
  //移动端环境下,没有读取IC卡的方式。
3267
3457
 
3268
- var _ref21 = _mutantsUtil.platform || {},
3269
- isHorizontalPad = _ref21.isHorizontalPad,
3270
- isHorizontalSunMi = _ref21.isHorizontalSunMi;
3458
+ var _ref23 = _mutantsUtil.platform || {},
3459
+ isHorizontalPad = _ref23.isHorizontalPad,
3460
+ isHorizontalSunMi = _ref23.isHorizontalSunMi;
3271
3461
 
3272
3462
  _this2.isHorizontalPad = !!isHorizontalPad;
3273
3463
  _this2.isHorizontalSunMi = !!isHorizontalSunMi;
@@ -3416,8 +3606,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3416
3606
  }, {
3417
3607
  key: 'isNoProductTip',
3418
3608
  value: function isNoProductTip(nonProductMap) {
3419
- var _ref22 = this.context.viewModel.data || {},
3420
- RetailDetails = _ref22.RetailDetails;
3609
+ var _ref24 = this.context.viewModel.data || {},
3610
+ RetailDetails = _ref24.RetailDetails;
3421
3611
 
3422
3612
  var temphtml = [];
3423
3613
  if ((0, _keys2.default)(nonProductMap).length > 0) {
@@ -3616,7 +3806,9 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3616
3806
  isReturn = _props.isReturn,
3617
3807
  quantityDetail = _props.quantityDetail,
3618
3808
  memberDisabled = _props.memberDisabled,
3619
- noIsMinAmount = _props.noIsMinAmount;
3809
+ noIsMinAmount = _props.noIsMinAmount,
3810
+ _props$creditSalesVou = _props.creditSalesVoucher,
3811
+ creditSalesVoucher = _props$creditSalesVou === undefined ? [] : _props$creditSalesVou;
3620
3812
  // 原单退货
3621
3813
 
3622
3814
  var boriginReturn = this.getBoriginReturn();
@@ -3670,7 +3862,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3670
3862
  return paymode.isQuick;
3671
3863
  }
3672
3864
  });
3673
- var productsIsEmpty = !type && this.context.viewModel.data.RetailDetails.length == 0 || type == 1 && parseFloat(amount || 0) <= 0 || memberDisabled || noIsMinAmount || type == 2 && parseFloat(amount || 0) <= 0;
3865
+ var productsIsEmpty = !type && this.context.viewModel.data.RetailDetails.length == 0 || type == 1 && parseFloat(amount || 0) <= 0 || memberDisabled || noIsMinAmount || type == 2 && creditSalesVoucher.length === 0;
3674
3866
  var moreToolbtns = [];
3675
3867
  var params = {
3676
3868
  pagination: {
@@ -3688,11 +3880,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
3688
3880
  quantity4 = 0;
3689
3881
  var sumQuantity = 0; //数量总和的值,包括称重的。
3690
3882
 
3691
- var _ref23 = quantityDetail || {},
3692
- _ref23$buyQuantity = _ref23.buyQuantity,
3693
- buyQuantity = _ref23$buyQuantity === undefined ? 0 : _ref23$buyQuantity,
3694
- _ref23$returnQuantity = _ref23.returnQuantity,
3695
- returnQuantity = _ref23$returnQuantity === undefined ? 0 : _ref23$returnQuantity;
3883
+ var _ref25 = quantityDetail || {},
3884
+ _ref25$buyQuantity = _ref25.buyQuantity,
3885
+ buyQuantity = _ref25$buyQuantity === undefined ? 0 : _ref25$buyQuantity,
3886
+ _ref25$returnQuantity = _ref25.returnQuantity,
3887
+ returnQuantity = _ref25$returnQuantity === undefined ? 0 : _ref25$returnQuantity;
3696
3888
 
3697
3889
  var quantityPrecision = (0, _tplusPoslogin.PosInitData)("QuantityPrecision");
3698
3890
  quantityPrecision = quantityPrecision ? parseInt(quantityPrecision) : '';
@@ -4580,22 +4772,22 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
4580
4772
  return _this8.czkInput = input;
4581
4773
  },
4582
4774
  onKeyDown: function () {
4583
- var _ref24 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee17(e) {
4775
+ var _ref26 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee19(e) {
4584
4776
  var time, _paymode;
4585
4777
 
4586
- return _regenerator2.default.wrap(function _callee17$(_context17) {
4778
+ return _regenerator2.default.wrap(function _callee19$(_context19) {
4587
4779
  while (1) {
4588
- switch (_context17.prev = _context17.next) {
4780
+ switch (_context19.prev = _context19.next) {
4589
4781
  case 0:
4590
4782
  if (!(e.keyCode == 13)) {
4591
- _context17.next = 14;
4783
+ _context19.next = 14;
4592
4784
  break;
4593
4785
  }
4594
4786
 
4595
4787
  time = Date.parse(new Date());
4596
4788
 
4597
4789
  if (!(_this8.isStorageCardInputType && time - _this8.keypressStime > 350)) {
4598
- _context17.next = 7;
4790
+ _context19.next = 7;
4599
4791
  break;
4600
4792
  }
4601
4793
 
@@ -4604,11 +4796,11 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
4604
4796
  _this8.setState({
4605
4797
  czkValue: null
4606
4798
  });
4607
- return _context17.abrupt('return');
4799
+ return _context19.abrupt('return');
4608
4800
 
4609
4801
  case 7:
4610
4802
  _this8.keypressStime = null;
4611
- _context17.next = 10;
4803
+ _context19.next = 10;
4612
4804
  return _this8.loadCzk(e.target.value);
4613
4805
 
4614
4806
  case 10:
@@ -4619,7 +4811,7 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
4619
4811
  czkvalue: null
4620
4812
  });
4621
4813
  }
4622
- _context17.next = 15;
4814
+ _context19.next = 15;
4623
4815
  break;
4624
4816
 
4625
4817
  case 14:
@@ -4629,14 +4821,14 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
4629
4821
 
4630
4822
  case 15:
4631
4823
  case 'end':
4632
- return _context17.stop();
4824
+ return _context19.stop();
4633
4825
  }
4634
4826
  }
4635
- }, _callee17, _this8);
4827
+ }, _callee19, _this8);
4636
4828
  }));
4637
4829
 
4638
- return function (_x13) {
4639
- return _ref24.apply(this, arguments);
4830
+ return function (_x15) {
4831
+ return _ref26.apply(this, arguments);
4640
4832
  };
4641
4833
  }(),
4642
4834
  onFocus: function onFocus(e) {
@@ -4693,8 +4885,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
4693
4885
  _this8.setCurrentModeValue(event.target.value, Math.min(currentMode.maxamount, currentMode.balance));
4694
4886
  },
4695
4887
  defaultValue: currentMode && (0, _utils.getFixedNumber)(brefund ? currentMode.value : Math.min(currentMode.value, currentMode.maxamount, currentMode.balance)),
4696
- ref: function ref(_ref25) {
4697
- return _this8["inputCzkAmount"] = _ref25;
4888
+ ref: function ref(_ref27) {
4889
+ return _this8["inputCzkAmount"] = _ref27;
4698
4890
  },
4699
4891
  onFocus: function onFocus(e) {
4700
4892
  _this8.inputkey = "inputCzkAmount";
@@ -4813,8 +5005,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
4813
5005
  '\u786E\u5B9A'
4814
5006
  )
4815
5007
  )),
4816
- _react2.default.createElement(_ModifyPass2.default, { changeBtnDisabled: this.changeBtnDisabled, passwordTitle: '\u8BBE\u7F6E\u5BC6\u7801', ref: function ref(_ref26) {
4817
- return _this8.modifyPass = _ref26;
5008
+ _react2.default.createElement(_ModifyPass2.default, { changeBtnDisabled: this.changeBtnDisabled, passwordTitle: '\u8BBE\u7F6E\u5BC6\u7801', ref: function ref(_ref28) {
5009
+ return _this8.modifyPass = _ref28;
4818
5010
  }, cardList: this.store.paymode.currentMode, cancelModal: this.handleSetPwdCancel })
4819
5011
  ),
4820
5012
  _react2.default.createElement(
@@ -5337,8 +5529,8 @@ var Settlement = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (
5337
5529
  _this8.setCurrentModeValue(e.target.value, Math.min(currentMode.maxamount, currentMode.member.exchangable));
5338
5530
  },
5339
5531
  defaultValue: currentMode && currentMode.member && (0, _utils.getFixedNumber)(Math.min(currentMode.value, currentMode.maxamount, currentMode.member.exchangable)),
5340
- ref: function ref(_ref27) {
5341
- return _this8["inputJfdxAmount"] = _ref27;
5532
+ ref: function ref(_ref29) {
5533
+ return _this8["inputJfdxAmount"] = _ref29;
5342
5534
  },
5343
5535
  onFocus: function onFocus(e) {
5344
5536
  _this8.inputkey = "inputJfdxAmount";