Authored by 姜敏

界面优化1

... ... @@ -21,7 +21,7 @@ var ENUM = {
status: {0: '待审核', 1: '审核通过', 2: '驳回', '-1': '过期', 3: '作废'},//全部
tips: {"0": 0, "1": 0, "2": 0, "3": 0, "4": 0, "all": 0}
};
var columnname="all";
var couponIds = {};
/**
* 初始化下拉框
... ... @@ -29,9 +29,8 @@ var couponIds = {};
new common.dropDown({el: '#filter-dep'});
common.util.__ajax({
url: "/coupon/queryList",//获取所有优惠券ID
data: {}
data: {size:1000}
}, function (res) {
//console.log("res",res);
$("#couponsIds").html(common.util.__template2($("#search-coupon").html(), res));
new common.dropDown({el: "#choose-coupon"});
couponIds = res.data;
... ... @@ -43,7 +42,30 @@ common.util.__ajax({
var t = new common.tab({
el: "#basicTab",
click: function () {
g.reload(1);
columnname = $(this).find('a').attr('columnname');
g.options.columns[6].hidden = true;
g.options.columns[7].hidden = true;
switch (columnname){
case "1":{
g.options.columns[8].hidden = true;
}
break;
case "2":{
g.options.columns[6].hidden = false;
g.options.columns[8].hidden = true;
}
break;
case "3":{
g.options.columns[7].hidden = false;
g.options.columns[8].hidden = true;
}
break;
case "all":{
g.options.columns[8].hidden = false;
}
break;
}
g.init("/coupon/queryCouponList");
},
columns: [
{name: "all", display: "全部"},
... ... @@ -54,63 +76,6 @@ var t = new common.tab({
{name: "-1", display: "已过期"}
]
}).init(ENUM.tips);
var activeTip= t.active;
/**
* 通用方法
* @type {{getTime: Function, toast: Function, toastInfo: Function}}
*/
var Bll = {
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
},
toast: function (content, url,data) {
common.dialog.confirm("温馨提示", content, function () {
common.util.__ajax({
url:url,
data:data()
}, function () {
g.reload();
});
});
},
toastPass: function (content, url,data) {
common.dialog.confirm("温馨提示", content, function () {
common.util.__ajax({
url:url,
data:data
}, function () {
g.reload();
});
});
},
toastInfo: function (item, hint) {
common.dialog({
title: hint,
content: common.util.__template2($("#templateInfo").html(), item),
width: "60%",
button: [{
value: '取消'
}
]
})
},
getButtons: function (index, id, array) {
var btns = [];
var buttons = [
'<a class="btn btn-warning btn-xs apply-back" data-index="' + index + '" >驳回</a>',
'<a class="btn btn-primary btn-xs apply-success" data-index="' + index + '" >通过</a>',
'<a data-index="' + index + '" class="btn btn-info btn-xs coupon-info">查看详情</a>',
'<a data-index="' + index + '"class="btn btn-info btn-xs apply-modify" href="/market/couponList/update/'+id +'">修改</a>',
'<a class="btn btn-danger btn-xs apply-cancel" data-index="' + index + '" >作废</a>'
];
for (var i = 0; i < array.length; i++) {
btns.push(buttons[array[i]])
}
return btns;
}
};
/**
* 列表
* @type {common.grid}
... ... @@ -118,7 +83,6 @@ var Bll = {
var g = new common.grid({
el: '#basicTable',
parms: function () {
return {
couponId: common.util.__input("choose-coupon"),
couponName: common.util.__input("filter-couponName"),
... ... @@ -159,8 +123,14 @@ var g = new common.grid({
},
{display: "优惠券说明", name: "explains"},
{display: "申请人", name: "proposer"},
{display:"驳回理由",hidden:true,name:"rejectReason",render:function(item){
return "<p style='color: red'>"+item.rejectReason+"</p>"
}},
{display:"作废理由",hidden:true,name:"invalidReason",render:function(item){
return "<p style='color: red'>"+item.invalidReason+"</p>"
}},
{
display: '状态', render: function (item) {
display: '状态',render: function (item) {
var html = ENUM.status[item.status] || '全部';
if (item.reason) {
if (item.status == 2 || item.status == 4) {
... ... @@ -181,6 +151,64 @@ var g = new common.grid({
});
g.init("/coupon/queryCouponList");
/**
* 通用方法
* @type {{getTime: Function, toast: Function, toastInfo: Function}}
*/
var Bll = {
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
},
toast: function (content, url,data) {
common.dialog.confirm("温馨提示", content, function () {
common.util.__ajax({
url:url,
data:data()
}, function () {
g.reload();
});
});
},
toastPass: function (content, url,data) {
common.dialog.confirm("温馨提示", content, function () {
common.util.__ajax({
url:url,
data:data
}, function () {
g.reload();
});
});
},
toastInfo: function (item, hint) {
common.dialog({
title: hint,
content: common.util.__template2($("#templateInfo").html(), item),
width: "60%",
button: [{
value: '取消',
css:"btn btn-primary"
}
]
})
},
getButtons: function (index, id, array) {
var btns = [];
var buttons = [
'<a class="btn btn-warning btn-xs apply-back" data-index="' + index + '" >驳回</a>',
'<a class="btn btn-primary btn-xs apply-success" data-index="' + index + '" >通过</a>',
'<a data-index="' + index + '" class="btn btn-info btn-xs coupon-info">查看详情</a>',
'<a data-index="' + index + '"class="btn btn-info btn-xs apply-modify" href="/market/couponList/update/'+id +'">修改</a>',
'<a class="btn btn-danger btn-xs apply-cancel" data-index="' + index + '" >作废</a>'
];
for (var i = 0; i < array.length; i++) {
btns.push(buttons[array[i]])
}
return btns;
}
};
/**
* 筛选
*/
$("#filter-btn").click(function () {
... ... @@ -229,7 +257,6 @@ $(document).on('click', '.apply-cancel', function () {
*/
$(document).on('click', '.coupon-info', function () {
var item = g.rows[$(this).data("index")];
console.log("item.options",item.options);
var item1 = $.extend(true, {}, item);
item1.createTime = Bll.getTime(item1.createTime);
item1.startTime = Bll.getTime(item1.startTime);
... ...
... ... @@ -10,6 +10,7 @@ var type = $("#basicForm").attr("role"),//类型 新增或修改
action = $("#basicForm").data("action");//路由
var startTimeObj;
var endTimeObj;
var customType=[];
/**
* 监听输入值的变化
... ... @@ -110,9 +111,9 @@ var Bll = {
new common.dropDown({el: '#filter-department'});
if(type=='update'){
if(couponBean.customType){
var customType=couponBean.customType.split(',');
customType=couponBean.customType.split(',');
for(var i=0;i<customType.length;i++){
custom = "custom-" + customType[i];
var custom = "custom-" + customType[i];
$("input ." + custom).attr("checked","checked");
}
}
... ... @@ -181,7 +182,7 @@ $(document).on('click',"#addSorts",function(){
},
css: "btn btn-primary"
}, {
value: "取消"
value: "返回"
}]
});
tabTreeArr = [];
... ...
exports.domain =require('../config/common.js').domain;
exports.domain = require('../config/common.js').domain;
//exports.domain = 'http://172.16.6.250:2081/platform';//庞洁
exports.res = [
//原 supplier
{
route:'/supplier/supplier/getSupplierListByIdName',
method:'POST',
route: '/supplier/supplier/getSupplierListByIdName',
method: 'POST',
url: '/supplier/supplier/getSupplierListByIdName',
params:[
{name:"idName",type:"String",def: 1}
params: [
{name: "idName", type: "String", def: 1}
]
},
{
... ... @@ -19,9 +19,9 @@ exports.res = [
{
name: 'idName',
type: 'String'
},{
name:'status',
type:'Number'
}, {
name: 'status',
type: 'Number'
}
]
},
... ... @@ -29,41 +29,41 @@ exports.res = [
// 根据身份选择管理员
route: '/supplier/storeadmin/managerName',
method: 'POST',
url:"/ShopsAdminRest/getUsersByIdentity",
src:'/store/adminedit',
params:[
{name:"identity",type:"Number"},
{name:"shopsId",type:"Number"}
url: "/ShopsAdminRest/getUsersByIdentity",
src: '/store/adminedit',
params: [
{name: "identity", type: "Number"},
{name: "shopsId", type: "Number"}
]
},
{//添加品类关联尺码属性接口【验证通过】
route: '/erpproduct/sortattribute/ajax/automatic',
method: 'POST',
url: '/product/querySizeAttributesByName',
params:[
{name:"idName",type:"String"},
{name:"sortId",type:"Number"}
params: [
{name: "idName", type: "String"},
{name: "sortId", type: "Number"}
]
},
{
route:'/erpproduct/sortsize/ajax/querySizeListBySortId4Html',
method:'POST',
url:'/product/querySizeListBySortId4Html',
params:[
{name:"idName",type:"String"},
{name:"sortId",type:"Number"}
route: '/erpproduct/sortsize/ajax/querySizeListBySortId4Html',
method: 'POST',
url: '/product/querySizeListBySortId4Html',
params: [
{name: "idName", type: "String"},
{name: "sortId", type: "Number"}
]
},
{//尺码模糊查询【验证通过】
route:'/erpproduct/sortsize/ajax/automatic',
method:'POST',
route: '/erpproduct/sortsize/ajax/automatic',
method: 'POST',
url: '/product/querySizeByNameForSelect',
params:[
{name:"idName",type:"String"},
{name:"sortId",type:"Number"}
params: [
{name: "idName", type: "String"},
{name: "sortId", type: "Number"}
]
},{
}, {
//查询品牌列表接口
route: '/goods/query/brand',
method: 'POST',
... ... @@ -109,54 +109,59 @@ exports.res = [
name: 'idName',
type: 'String'
}]
},{//根据品牌查询店铺
route:'/goods/query/queryShopsByBrandId',
method:'POST',
url:'/ShopsRest/queryShopsByBrandId',
}, {//根据品牌查询店铺
route: '/goods/query/queryShopsByBrandId',
method: 'POST',
url: '/ShopsRest/queryShopsByBrandId',
params: [{
name: 'idName',
type: 'String'
},{name:'brandId',type:'Number'}]
}, {name: 'brandId', type: 'Number'}]
},
{//模糊查询
route:'/limit/xiangouID/selectActivityListForSelect',
method:'POST',
url:'/DrawlineActivityRest/selectActivityListForSelect',
params:[
{name:"idName",type:'String'}
route: '/limit/xiangouID/selectActivityListForSelect',
method: 'POST',
url: '/DrawlineActivityRest/selectActivityListForSelect',
params: [
{name: "idName", type: 'String'}
]
},{
}, {
// 店铺列表
route: '/ShopsRest/getShopsByName',
method: 'POST',
url:"/ShopsRest/selectCheckPassShopsByName",
params:[
{name:"idName",type:"String"}
url: "/ShopsRest/selectCheckPassShopsByName",
params: [
{name: "idName", type: "String"}
]
},{
}, {
//获取JIT店铺
route:'/goods/query/getJitSupplierByBrandld',
method:'POST',
url:'/AgreementRest/getJitSupplierByBrandId',
params:[
{name:"brandId",type:"Number"}
route: '/goods/query/getJitSupplierByBrandld',
method: 'POST',
url: '/AgreementRest/getJitSupplierByBrandId',
params: [
{name: "brandId", type: "Number"}
]
},{
route:'/ajax/guang/article/getSortList',
method:'POST',
url:'/guang/article/getSortList',
params:[
{name:"parentId",type:"Number"}
}, {
route: '/ajax/guang/article/getSortList',
method: 'POST',
url: '/guang/article/getSortList',
params: [
{name: "parentId", type: "Number"}
]
}
//发券搜索
,{
route:'/coupon/queryList',
method:'POST',
url:'/coupon/queryList',
params: [{
name: 'idName',
type: 'String'
}]
, {
route: '/coupon/queryList',
method: 'POST',
url: '/coupon/queryList',
params: [
{
name: 'idName',
type: 'String'
},{
name:"size",
type:"Number"
}
]
}
];
\ No newline at end of file
... ...
/**
* Created by yoho on 2016/5/27.
*/
//exports.domain = require('../config/common.js').domain;
exports.domain ='http://172.16.6.120:8088/platform';//曹燕
exports.domain = require('../config/common.js').domain;
//exports.domain ='http://172.16.6.120:8088/platform';//曹燕
exports.res = [
//主界面
{
... ...
... ... @@ -205,11 +205,9 @@
<label class="col-sm-2 control-label">申请人</label>
<div class="col-sm-8">
<input type="text" class="form-control" value="{{auth.name}}" readonly>
<input type="text" class="form-control" value="[[proposer]]" readonly>
</div>
</div>
<input id="auth_id" type="hidden" value="{{auth.uid}}">
<input id="auth_name" type="hidden" value="{{auth.name}}">
</div>
</div>
</div>
... ...
... ... @@ -93,7 +93,7 @@
<label class="col-sm-2 control-label">数量<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" placeholder="数量" class="form-control observe number" data-field="couponNum"
<input type="text" placeholder="数量" prompt="数量" class="form-control observe number" data-field="couponNum"
required value="[[couponNum]]">
</div>
</div>
... ... @@ -111,8 +111,8 @@
<label class="col-sm-2 control-label">申请部门<i class="red">*</i></label>
<div class="col-sm-8">
<select id="filter-department" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[department]]" data-field="department" required>
<select id="filter-department" placeholder="申请部门" tabindex="-1" class="select2-offscreen brandBtn-group observe"
value="[[department]]" data-field="department" required >
<option value="-1">申请部门</option>
<option value="1">渠道二部</option>
<option value="2">渠道一部</option>
... ... @@ -262,9 +262,10 @@
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<div class="col-sm-4 col-sm-offset-4">
<button id="save_brand" type="button" data-loading-text="保存中..." class="btn btn-primary">提交</button>
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
<button id="save_brand" type="button" data-loading-text="保存中..." class="btn btn-primary">保存</button>
</div>
</div>
</div>
... ...
... ... @@ -12,7 +12,7 @@
<div>
<div style="width: 30%;float: left;">
<h4>新增优惠券</h4>
<h4>发券管理</h4>
</div>
</div>
</div>
... ...
... ... @@ -11,7 +11,7 @@
</ul>
<div>
<div style="width: 30%;float: left;">
<h4>公开券</h4>
<h4>公开券码查询</h4>
</div>
</div>
</div>
... ...
... ... @@ -12,7 +12,7 @@
<div>
<div style="width: 30%;float: left;">
<h4>新增优惠</h4>
<h4></h4>
</div>
</div>
</div>
... ...