| | |
| | | <div class="layui-form-mid">(元)金额。</div> |
| | | <div class="layui-form-mid layui-word-aux">满足0元减免100元,则代表100元无门槛优惠卷。</div> |
| | | </div> |
| | | |
| | | <blockquote class="layui-elem-quote blue-border">商品设置</blockquote> |
| | | <div class="layui-form-item coupon-rule"> |
| | | <div class="layui-col-lg6"> |
| | | <label class="layui-form-label febs-form-item-require">商品:</label> |
| | | <div class="layui-input-block"> |
| | | <div id="coupon-rule"></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | validate = layui.validate, |
| | | element = layui.element; |
| | | |
| | | var couponRule = xmSelect.render({ |
| | | el: '#coupon-rule', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | toolbar: { |
| | | show: true, |
| | | }, |
| | | // radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }) |
| | | |
| | | febs.get(ctx + 'admin/goods/goodsTreeSet', null, function(res) { |
| | | couponRule.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | }) |
| | | |
| | | form.render(); |
| | | |
| | | |
| | | form.on('submit(coupon-rule-add-form-submit)', function (data) { |
| | | let couponRuleList = couponRule.getValue(); |
| | | if (couponRuleList.length > 0) { |
| | | var couponIds = []; |
| | | layui.each(couponRuleList, function (key, item) { |
| | | couponIds.push(item.id) |
| | | }); |
| | | data.field.goodsIds=couponIds; |
| | | } |
| | | $.ajax({ |
| | | 'url':ctx + 'admin/goods/couponRuleAdd', |
| | | 'type':'post', |