| | |
| | | data: [] |
| | | }); |
| | | |
| | | febs.get(ctx + 'admin/goods/coupon/tree', null, function(data) { |
| | | $.get(ctx + 'admin/goods/coupon/tree', function(data) { |
| | | var options = []; |
| | | for (var k in data) { |
| | | options.push({ |
| | |
| | | couponIds.push(selected[i].value); |
| | | } |
| | | data.field.couponIds = couponIds; |
| | | febs.post(ctx + 'admin/mallMember/salemanCoupon', data.field, function () { |
| | | layer.closeAll(); |
| | | febs.alert.success('操作成功'); |
| | | $('#febs-saleman-rule').find('#reset').click(); |
| | | $.ajax({ |
| | | url: ctx + 'admin/mallMember/salemanCoupon', |
| | | type: 'post', |
| | | dataType: 'json', |
| | | headers: {'Content-Type': 'application/json;charset=utf-8'}, |
| | | traditional: true, |
| | | data: JSON.stringify(data.field), |
| | | success: function (res) { |
| | | if (res.code == 200) { |
| | | layer.closeAll(); |
| | | febs.alert.success(res.message); |
| | | $('#febs-saleman-rule').find('#reset').click(); |
| | | } else { |
| | | febs.alert.warn(res.message); |
| | | } |
| | | }, |
| | | error: function () { |
| | | febs.alert.warn('服务器繁忙'); |
| | | } |
| | | }); |
| | | return false; |
| | | }); |