From 5c656bf6da9673b88d8dfefb5b3b459d29946472 Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Wed, 11 Oct 2023 15:40:19 +0800 Subject: [PATCH] redbagprod --- src/main/resources/templates/febs/views/modules/goods/goodsCouponUpdate.html | 52 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 51 insertions(+), 1 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/goods/goodsCouponUpdate.html b/src/main/resources/templates/febs/views/modules/goods/goodsCouponUpdate.html index fbf9a2c..5f29717 100644 --- a/src/main/resources/templates/febs/views/modules/goods/goodsCouponUpdate.html +++ b/src/main/resources/templates/febs/views/modules/goods/goodsCouponUpdate.html @@ -45,6 +45,17 @@ <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> @@ -88,7 +99,37 @@ form.render(); - initValue(); + var couponRuleGoodsIds = 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) { + couponRuleGoodsIds.update({ + data : res.data, + autoRow: true, + }); + initValue(); + }) + function initValue() { form.val("coupon-rule-update-form", { @@ -98,9 +139,18 @@ "costAmount": couponRule.costAmount, "realAmount": couponRule.realAmount }); + couponRuleGoodsIds.setValue(couponRule.goodsIds); } form.on('submit(coupon-rule-update-form-submit)', function (data) { + let couponRuleList = couponRuleGoodsIds.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/couponUpdate', 'type':'post', -- Gitblit v1.9.1