|
@@ -91,21 +91,15 @@ var Bll = { |
|
@@ -91,21 +91,15 @@ var Bll = { |
91
|
{
|
91
|
{
|
92
|
value: "保存",
|
92
|
value: "保存",
|
93
|
callback: function () {
|
93
|
callback: function () {
|
94
|
- var couponIds = Bll.module.couponsIds || [];
|
|
|
95
|
var flag = true;
|
94
|
var flag = true;
|
96
|
- var ids = [];
|
|
|
97
|
- for (var i = 0; i < couponIds.length; i++) {
|
|
|
98
|
- ids.push(couponIds[i].id);
|
|
|
99
|
- }
|
|
|
100
|
- if (ids.join(",").indexOf("-1") > -1) {
|
95
|
+ if (Bll.module.sendCouponId === '-1') {
|
101
|
flag = false;
|
96
|
flag = false;
|
102
|
common.util.__tip("请正确选择优惠券ID", "warning");
|
97
|
common.util.__tip("请正确选择优惠券ID", "warning");
|
103
|
- } else {
|
|
|
104
|
- Bll.module.couponsIds = ids.join(",");
|
|
|
105
|
- }
|
98
|
+ }
|
106
|
if (edit.validate() && flag) {
|
99
|
if (edit.validate() && flag) {
|
|
|
100
|
+ const url = Bll.module.id ? '/exchangeCouponManager/update' : '/exchangeCouponManager/add'
|
107
|
common.util.__ajax({
|
101
|
common.util.__ajax({
|
108
|
- url: "/exchangeCouponManager/addOrUpdate",
|
102
|
+ url,
|
109
|
data: Bll.module
|
103
|
data: Bll.module
|
110
|
}, function (res) {
|
104
|
}, function (res) {
|
111
|
if (res.code == '200') {
|
105
|
if (res.code == '200') {
|
|
@@ -136,7 +130,7 @@ var Bll = { |
|
@@ -136,7 +130,7 @@ var Bll = { |
136
|
__editRender: function () {
|
130
|
__editRender: function () {
|
137
|
edit.init();
|
131
|
edit.init();
|
138
|
new common.dropDown({
|
132
|
new common.dropDown({
|
139
|
- el: '.couponsIds',
|
133
|
+ el: '.sendCouponId',
|
140
|
ajax: 'couponID'
|
134
|
ajax: 'couponID'
|
141
|
});
|
135
|
});
|
142
|
}
|
136
|
}
|
|
@@ -187,13 +181,9 @@ $('#add-content').on('click', function () { |
|
@@ -187,13 +181,9 @@ $('#add-content').on('click', function () { |
187
|
var item = {
|
181
|
var item = {
|
188
|
"id": "",
|
182
|
"id": "",
|
189
|
"name": "",
|
183
|
"name": "",
|
190
|
- "couponsIds": [
|
|
|
191
|
- {
|
|
|
192
|
- "id": "",
|
|
|
193
|
- "text": ""
|
|
|
194
|
- }
|
|
|
195
|
- ],
|
|
|
196
|
- "status": 1
|
184
|
+ "subName": "",
|
|
|
185
|
+ "sendCouponId": "",
|
|
|
186
|
+ "sendCouponName":""
|
197
|
};
|
187
|
};
|
198
|
Bll.toast(item, "添加");
|
188
|
Bll.toast(item, "添加");
|
199
|
});
|
189
|
});
|