| | |
| | | validators: { |
| | | notEmpty: { |
| | | message: '优惠券名称不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^[\u4E00-\u9FA5A-Za-z\s]+$/, |
| | | message: '不能输入特殊字符和数字' |
| | | } |
| | | } |
| | | }, |
| | |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择服务类类型' |
| | | } |
| | | } |
| | | }, |
| | | couponCount: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '优惠券数量不能为空' |
| | | }, |
| | | regexp: { |
| | | regexp: /^[1-9]\d*$/, |
| | | message: '请输入大于0的正整数' |
| | | } |
| | | } |
| | | }, |
| | |
| | | return ; |
| | | } |
| | | |
| | | var couponConditionalAmount = $('#couponConditionalAmount').val(); |
| | | if(couponConditionalAmount < 14){ |
| | | Feng.info("条件金额最低14元!") |
| | | return; |
| | | } |
| | | |
| | | var couponCount = $('#couponCount').val(); |
| | | var couponType = $('#couponType').val(); |
| | | if(couponType == 2 && (couponCount == null || couponCount == '')){ |
| | | Feng.info("请填写优惠券限制数量!") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCoupon/add", function(data){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCoupon.table.refresh(); |
| | | TCouponInfoDlg.close(); |
| | | if(500 == data.code){ |
| | | Feng.error(data.message) |
| | | return; |
| | | }else { |
| | | Feng.success("添加成功!"); |
| | | window.parent.TCoupon.table.refresh(); |
| | | TCouponInfoDlg.close(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |