Authored by chenchao

add clean limit prd

... ... @@ -60,5 +60,6 @@ module.exports = function (app) {
// 更新第三方信息
app.post("/coupon/updateCouponsUseRule", "CouponList_updateCouponsUseRule");
//清除指定商品
app.post("/coupon/cleanPrdLimit", "CouponList_cleanPrdLimit");
};
\ No newline at end of file
... ...
... ... @@ -98,6 +98,13 @@ module.exports = {
thirdId: {type: String},
publicNumberType: {type: Number}
}
},
cleanPrdLimit : {
title: "清除指定商品",
url: "/coupon/cleanPrdLimit",
params: {
param : {type: Number}
}
}
}
};
... ...
... ... @@ -256,6 +256,7 @@
<div class="col-sm-4">
<textarea name="productLimit" class="form-control observe" prompt="SKN除外" data-field="productLimit"
placeholder="skn用英文逗号分隔" style="resize: none">[[productLimit]]</textarea>
<a class="btn btn-primary btn-xs" style="margin:10px 0px 0px 200px;" href="javascript:;" id="cleanPrdLimit" [[if !productLimit]] disabled [[/if]]>清除所有</a>
</div>
</div>
[[/if]]
... ...
... ... @@ -124,6 +124,7 @@ var Bll = {
$("#select2-filter-department-container").html(departmentName);
}, true);
if (type == 'update') {
if (couponBean.customType) {
customType = couponBean.customType.split(',');
... ... @@ -132,8 +133,7 @@ var Bll = {
$("input ." + custom).attr("checked", "checked");
}
}
}
if (type == 'update') {
if (couponBean.shopPriceLimits) {
shopPriceLimits = couponBean.shopPriceLimits.split(',');
for (var i = 0; i < shopPriceLimits.length; i++) {
... ... @@ -141,6 +141,31 @@ var Bll = {
$("input ." + custom).attr("checked", "checked");
}
}
//delete product limit
if(couponBean.productLimit){
$("#cleanPrdLimit").on("click",function(){
var _cleanPrdLimit = $(this);
common.dialog.confirm("清除商品", "确认清除商品?",function(){
common.util.__ajax({
url: "/coupon/cleanPrdLimit",//获取所有部门
data: {param: couponBean.id}
}, function (res) {
if(res.code == 200){
couponBean.productLimit = null;
$("textarea[name=\"productLimit\"]").val('');
_cleanPrdLimit.attr("disabled",true);
common.util.__tip(res.message, 'success');
}else{
common.util.__tip(res.message, 'warning');
}
},true);
});
});
}
}
},
... ...
... ... @@ -36,6 +36,8 @@ var _import = function(el, type) {
var productLimit = window.ViewModel.productLimit + "," + import_skns.join(",");
$("textarea[name=\"productLimit\"]").val(productLimit);
}
}else{
common.util.__tip(response.message, 'warning');
}
if (loadModal) {
loadModal.close();
... ... @@ -44,7 +46,7 @@ var _import = function(el, type) {
$("#message").html(response.data.failFileReason.join('<br/>'));
return false;
}
common.util.__tip(response.message, 'warning');
}
};
}
... ...