...
|
...
|
@@ -91,21 +91,15 @@ var Bll = { |
|
|
{
|
|
|
value: "保存",
|
|
|
callback: function () {
|
|
|
var couponIds = Bll.module.couponsIds || [];
|
|
|
var flag = true;
|
|
|
var ids = [];
|
|
|
for (var i = 0; i < couponIds.length; i++) {
|
|
|
ids.push(couponIds[i].id);
|
|
|
}
|
|
|
if (ids.join(",").indexOf("-1") > -1) {
|
|
|
if (Bll.module.sendCouponId === '-1') {
|
|
|
flag = false;
|
|
|
common.util.__tip("请正确选择优惠券ID", "warning");
|
|
|
} else {
|
|
|
Bll.module.couponsIds = ids.join(",");
|
|
|
}
|
|
|
if (edit.validate() && flag) {
|
|
|
const url = Bll.module.id ? '/exchangeCouponManager/update' : '/exchangeCouponManager/add'
|
|
|
common.util.__ajax({
|
|
|
url: "/exchangeCouponManager/addOrUpdate",
|
|
|
url,
|
|
|
data: Bll.module
|
|
|
}, function (res) {
|
|
|
if (res.code == '200') {
|
...
|
...
|
@@ -136,7 +130,7 @@ var Bll = { |
|
|
__editRender: function () {
|
|
|
edit.init();
|
|
|
new common.dropDown({
|
|
|
el: '.couponsIds',
|
|
|
el: '.sendCouponId',
|
|
|
ajax: 'couponID'
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -187,13 +181,9 @@ $('#add-content').on('click', function () { |
|
|
var item = {
|
|
|
"id": "",
|
|
|
"name": "",
|
|
|
"couponsIds": [
|
|
|
{
|
|
|
"id": "",
|
|
|
"text": ""
|
|
|
}
|
|
|
],
|
|
|
"status": 1
|
|
|
"subName": "",
|
|
|
"sendCouponId": "",
|
|
|
"sendCouponName":""
|
|
|
};
|
|
|
Bll.toast(item, "添加");
|
|
|
});
|
...
|
...
|
|