...
|
...
|
@@ -57,23 +57,30 @@ var Bll = { |
|
|
button: [{
|
|
|
value: "保存",
|
|
|
callback: function () {
|
|
|
var couponIds=Bll.module.couponsIds||[];
|
|
|
var ids=[];
|
|
|
for(var i=0;i<couponIds.length;i++){
|
|
|
var couponIds = Bll.module.couponsIds || [];
|
|
|
var flag = true;
|
|
|
var ids = [];
|
|
|
for (var i = 0; i < couponIds.length; i++) {
|
|
|
ids.push(couponIds[i].id);
|
|
|
}
|
|
|
Bll.module.couponsIds=ids.join(",");
|
|
|
if (edit.validate()) {
|
|
|
if (ids.join(",").indexOf("-1") > -1) {
|
|
|
flag = false;
|
|
|
common.util.__tip("请正确选择优惠券ID", "warning");
|
|
|
} else {
|
|
|
Bll.module.couponsIds = ids.join(",");
|
|
|
}
|
|
|
//console.log("最终上传数据Bll.module",Bll.module);
|
|
|
if (edit.validate() && flag) {
|
|
|
common.util.__ajax({
|
|
|
url: "/couponSendManager/addOrUpdate",
|
|
|
data: Bll.module
|
|
|
data: Bll.module
|
|
|
}, function (res) {
|
|
|
if(res.code=='200'){
|
|
|
if (res.code == '200') {
|
|
|
g.reload();
|
|
|
d.close();
|
|
|
}
|
|
|
else{
|
|
|
common.util.__tip(res.message,"warning");
|
|
|
else {
|
|
|
common.util.__tip(res.message, "warning");
|
|
|
}
|
|
|
});
|
|
|
}
|
...
|
...
|
@@ -99,7 +106,7 @@ var Bll = { |
|
|
/*监听输入框变化*/
|
|
|
$(document).on("change", ".observe", function () {
|
|
|
var $this = $(this);
|
|
|
var name = $this.data("field")?$this.data("field"):$this.data("name");
|
|
|
var name = $this.data("field") ? $this.data("field") : $this.data("name");
|
|
|
Bll.module = common.util.__buildobj(name, '.', Bll.module, function (obj, name) {
|
|
|
obj[name] = $this.val();
|
|
|
});
|
...
|
...
|
|