Authored by dongjunjie

品牌管理控制器优化

... ... @@ -2,9 +2,7 @@ module.exports = function (app){
app.get("/erpproduct/brands/index", "brand.Index", function (req,res){
this.$extend={
moduleName:"品牌管理",
pageName:"品牌管理",
bottons:'{"edit":true}',
gridurl:'/brand/getBrandList'
pageName:"品牌管理"
}
});
... ...
... ... @@ -53,7 +53,4 @@
</div>
</div>
<input type="hidden" id="btnAuthority" value="<%bottons%>">
<input type="hidden" id="gridurl" value="<%gridurl%>">
<%include '../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
... ... @@ -23,9 +23,6 @@ $('.hasDatepicker').fdatepicker({
format: 'yyyy-mm-dd'
});
var btnAuthority = JSON.parse($("#btnAuthority").val());
var g = new common.grid({
el: '#basicTable',
size: 10,
... ... @@ -69,10 +66,8 @@ var g = new common.grid({
name: "status",
render: function(items) {
var HtmArr = [];
HtmArr.push('<a href="/erpproduct/brands/edit/' + items.id + '"" class="btn btn-info btn-xs">编辑</a>');
if (btnAuthority.edit) {
HtmArr.push('<a href="/erpproduct/brands/edit/' + items.id + '"" class="btn btn-info btn-xs">编辑</a>');
}
if (items.status === 0) {
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-warning btn-xs open-brand">开启品牌</a>');
}
... ... @@ -83,7 +78,7 @@ var g = new common.grid({
}
}]
})
g.init($("#gridurl").val());
g.init('/brand/getBrandList');
$("#filter-btn").click(function() {
g.reload(1);
... ... @@ -100,7 +95,6 @@ $('tbody').on('click', '.close-brand', function() {
status: 0
}
}, function(res) {
console.log(res);
if (res.code == 200) {
common.util.__tip('关闭品牌成功', 'success');
g.reload();
... ... @@ -119,7 +113,6 @@ $('tbody').on('click', '.open-brand', function() {
status: 1
}
}, function(res) {
console.log(res);
if (res.code == 200) {
common.util.__tip('开启品牌成功', 'success');
g.reload();
... ...