Authored by chenchao

add reject

@@ -291,6 +291,12 @@ $(document).on("change", "#useLimitType", function () { @@ -291,6 +291,12 @@ $(document).on("change", "#useLimitType", function () {
291 */ 291 */
292 $(document).on("change", "#useRange", function () { 292 $(document).on("change", "#useRange", function () {
293 couponBean.useRange = $(this).val(); 293 couponBean.useRange = $(this).val();
  294 + var _useRange = couponBean.useRange;
  295 + if(_useRange){
  296 + if(_useRange== 2|| _useRange == 3){
  297 + PrdPoolService.dropPrdPool();
  298 + }
  299 + }
294 Bll.__render(couponBean, type); 300 Bll.__render(couponBean, type);
295 }); 301 });
296 302
@@ -571,6 +577,7 @@ var initShop = function () {//初始化店铺弹框 @@ -571,6 +577,7 @@ var initShop = function () {//初始化店铺弹框
571 }); 577 });
572 couponBean.shopLimit = Bll.selectShopIds.join(','); 578 couponBean.shopLimit = Bll.selectShopIds.join(',');
573 couponBean.shopList = Bll.selectShops.join(";"); 579 couponBean.shopList = Bll.selectShops.join(";");
  580 + PrdPoolService.dropPrdPool();
574 Bll.__render(couponBean, type); 581 Bll.__render(couponBean, type);
575 }else{ 582 }else{
576 couponBean.shopList = ""; 583 couponBean.shopList = "";
@@ -667,16 +674,29 @@ var PrdPoolService = { @@ -667,16 +674,29 @@ var PrdPoolService = {
667 Bll.selectPrdPool = {}; 674 Bll.selectPrdPool = {};
668 675
669 if ($(".prdPoolLimit").length > 0) { 676 if ($(".prdPoolLimit").length > 0) {
  677 + var _pass = true;
670 $(".prdPoolLimit").each(function(index){ 678 $(".prdPoolLimit").each(function(index){
671 - Bll.selectPrdPool.id = $(this).val();  
672 - Bll.selectPrdPool.name = $(this).text().replace("选择商品池","").trim() 679 + var _id = $(this).val();
  680 + if(_id <= 0){
  681 +
  682 + _pass = false;
  683 + return false;
  684 + }else{
  685 + Bll.selectPrdPool.name = $(this).text().replace("选择商品池","").trim()
  686 + Bll.selectPrdPool.id = _id;
  687 + }
  688 +
673 }); 689 });
  690 + if (!_pass) {
  691 + common.util.__tip("请选择商品池", 'warning');
  692 + return false;
  693 + }
674 couponBean.prdPoolLimit = Bll.selectPrdPool.id; 694 couponBean.prdPoolLimit = Bll.selectPrdPool.id;
675 couponBean.prdPoolLimitName = Bll.selectPrdPool.name; 695 couponBean.prdPoolLimitName = Bll.selectPrdPool.name;
  696 + dropShop();
676 Bll.__render(couponBean, type); 697 Bll.__render(couponBean, type);
677 }else{ 698 }else{
678 - couponBean.prdPoolLimit = "";  
679 - 699 + couponBean.prdPoolLimit = "";
680 Bll.__render(couponBean, type); 700 Bll.__render(couponBean, type);
681 } 701 }
682 }, 702 },
@@ -714,6 +734,10 @@ var PrdPoolService = { @@ -714,6 +734,10 @@ var PrdPoolService = {
714 ajax: 'productPool', 734 ajax: 'productPool',
715 params : {diffType : 3} 735 params : {diffType : 3}
716 }); 736 });
  737 + },
  738 + dropPrdPool : function(){
  739 + couponBean.prdPoolLimit = "";
  740 + Bll.selectPrdPool = {};
717 } 741 }
718 } 742 }
719 743
@@ -723,4 +747,9 @@ $(document).on('click', "#addPrdPool", function () { @@ -723,4 +747,9 @@ $(document).on('click', "#addPrdPool", function () {
723 PrdPoolService.clickHandle(); 747 PrdPoolService.clickHandle();
724 }); 748 });
725 749
726 - 750 +var dropShop = function(){
  751 + Bll.selectShopIds = [];
  752 + Bll.selectShops = [];
  753 + couponBean.shopLimit = "";
  754 + couponBean.shopList = "";
  755 +}