| | |
| | | autoRow: true, |
| | | }); |
| | | |
| | | // initValue(); |
| | | initGoodsUpdateValue(); |
| | | }) |
| | | |
| | | var couponRule = xmSelect.render({ |
| | | el: '#coupon-rule', |
| | | language: 'zn', |
| | | prop : { |
| | | value : 'id', |
| | | children : 'child' |
| | | }, |
| | | iconfont: { |
| | | parent: 'hidden', |
| | | }, |
| | | // radio: true, |
| | | clickClose: true, |
| | | tree: { |
| | | show: true, |
| | | //非严格模式 |
| | | strict: false, |
| | | }, |
| | | data: [] |
| | | }) |
| | | |
| | | febs.get(ctx + 'admin/goods/couponTreeSet', null, function(res) { |
| | | couponRule.update({ |
| | | data : res.data, |
| | | autoRow: true, |
| | | }); |
| | | |
| | | initValue(); |
| | | }) |
| | | // var couponRule = xmSelect.render({ |
| | | // el: '#coupon-rule', |
| | | // language: 'zn', |
| | | // prop : { |
| | | // value : 'id', |
| | | // children : 'child' |
| | | // }, |
| | | // iconfont: { |
| | | // parent: 'hidden', |
| | | // }, |
| | | // // radio: true, |
| | | // clickClose: true, |
| | | // tree: { |
| | | // show: true, |
| | | // //非严格模式 |
| | | // strict: false, |
| | | // }, |
| | | // data: [] |
| | | // }) |
| | | // |
| | | // febs.get(ctx + 'admin/goods/couponTreeSet', null, function(res) { |
| | | // couponRule.update({ |
| | | // data : res.data, |
| | | // autoRow: true, |
| | | // }); |
| | | // |
| | | // initGoodsUpdateValue(); |
| | | // }) |
| | | |
| | | var carriageRule = xmSelect.render({ |
| | | el: '#carriage-rule', |
| | |
| | | }) |
| | | } |
| | | |
| | | function initValue() { |
| | | function initGoodsUpdateValue() { |
| | | var images = goodsInfo.images; |
| | | var thumbs = images.join(","); |
| | | form.val("goods-update-form", { |
| | |
| | | arrCarriageRule.push(goodsInfo.carriageRuleId) |
| | | carriageRule.setValue(arrCarriageRule); |
| | | |
| | | couponRule.setValue(goodsInfo.couponIds); |
| | | // couponRule.setValue(goodsInfo.couponIds); |
| | | |
| | | if (goodsInfo.isNormal == 2) { |
| | | $(".tc-set").show(); |
| | |
| | | } |
| | | |
| | | form.on('submit(goods-update-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.couponIds=couponIds; |
| | | } |
| | | // let couponRuleList = couponRule.getValue(); |
| | | // if (couponRuleList.length > 0) { |
| | | // var couponIds = []; |
| | | // layui.each(couponRuleList, function (key, item) { |
| | | // couponIds.push(item.id) |
| | | // }); |
| | | // data.field.couponIds=couponIds; |
| | | // } |
| | | data.field.goodsType=1; |
| | | data.field.mailGoodsSkuDto = tableSkuData; |
| | | data.field.delSkuId=delSku; |