|
|
'use strict';
|
|
|
var $ = require('jquery'),
|
|
|
common = require('../../../common/common');
|
|
|
//require('../util/custom.js');
|
|
|
/*
|
|
|
* 获取业务数据
|
|
|
*/
|
|
|
window.NETSALEDATA= window.ViewModel.data;
|
|
|
console.log(window.NETSALEDATA);
|
|
|
|
|
|
var ENUM = {
|
|
|
status: {
|
|
|
'0': '已下架',
|
|
|
'1': '已上架',
|
|
|
'2': '待审核',
|
|
|
'3': '上架驳回',
|
|
|
'4': '通过',
|
|
|
'5': '再上架待审核',
|
|
|
'6': '再上架驳回',
|
|
|
'7': '再上架通过',
|
|
|
'8': '待上架',
|
|
|
'9': '下架驳回',
|
|
|
'10':'下架待审核'
|
|
|
},
|
|
|
tab: {
|
|
|
'1': 0,
|
|
|
'2': 0,
|
|
|
'3': 0,
|
|
|
'4': 0,
|
|
|
'5': 0
|
|
|
},
|
|
|
|
|
|
tabName:[
|
|
|
{en:"baseinfo",cn:"基本信息"},
|
|
|
{en:"condition",cn:"促销条件"},
|
|
|
{en:"operation",cn:"促销操作"},
|
|
|
{en:"limit",cn:"促销限制"},
|
|
|
{en:"reject",cn:"互斥促销"},
|
|
|
{en:"display",cn:"促销显示"},]
|
|
|
};
|
|
|
//tab 页组件
|
|
|
var t = new common.tab2({
|
|
|
el: "#basicTab",
|
|
|
active: 6,
|
|
|
click: function () {
|
|
|
var columnname = t.options.columns[t.options.active].name;
|
|
|
|
|
|
if (columnname === ENUM.tabName[0].en) {
|
|
|
var html_baseinfo=$("#fm_baseInfo").html();
|
|
|
$("#tab_body").html(html_baseinfo);
|
|
|
}else if(columnname === ENUM.tabName[1].en) {
|
|
|
|
|
|
} else if(columnname === ENUM.tabName[2].en) {
|
|
|
|
|
|
}else if(columnname === ENUM.tabName[3].en) {
|
|
|
|
|
|
}else if(columnname === ENUM.tabName[4].en) {
|
|
|
//todo 加载促销列表
|
|
|
grid_promotions.init("/promotionInfo/list");
|
|
|
}else if(columnname === ENUM.tabName[5].en) {
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
columns: [{
|
|
|
name: ENUM.tabName[0].en,
|
|
|
value: '8',
|
|
|
display: ENUM.tabName[0].cn
|
|
|
}, {
|
|
|
name: ENUM.tabName[1].en,
|
|
|
value: '1',
|
|
|
display: ENUM.tabName[1].cn
|
|
|
}, {
|
|
|
name: ENUM.tabName[2].en,
|
|
|
value: '1',
|
|
|
display: ENUM.tabName[2].cn
|
|
|
}, {
|
|
|
name: ENUM.tabName[3].en,
|
|
|
value: '1',
|
|
|
display: ENUM.tabName[3].cn
|
|
|
}, {
|
|
|
name: ENUM.tabName[4].en,
|
|
|
value: '0',
|
|
|
display: ENUM.tabName[4].cn
|
|
|
},{
|
|
|
name: ENUM.tabName[5].en,
|
|
|
value: 'all',
|
|
|
display: ENUM.tabName[5].cn
|
|
|
}]
|
|
|
}).init(ENUM.tab);
|
|
|
|
|
|
//促销列表
|
|
|
var grid_promotions = new common.grid({
|
|
|
el: '#basicTable_promotion',
|
|
|
size: 10,
|
|
|
parms: function() {
|
|
|
return {
|
|
|
startTime: common.util.__input('startTime'),
|
|
|
endTime:common.util.__input("endTime")
|
|
|
};
|
|
|
},
|
|
|
columns: [{
|
|
|
display: "ID",
|
|
|
name: "id"
|
|
|
}, {
|
|
|
display: "促销名称",
|
|
|
name: "title"
|
|
|
}, {
|
|
|
display: '优先级',
|
|
|
name: "priority"
|
|
|
}, {
|
|
|
display: '开始时间',
|
|
|
name: "startTime",
|
|
|
render: function(item) {
|
|
|
var date = new Date(item.startTime * 1000);
|
|
|
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
|
|
|
}
|
|
|
}, {
|
|
|
display: '结束时间',
|
|
|
name: "endTime",
|
|
|
render: function(item) {
|
|
|
var date = new Date(item.endTime * 1000);
|
|
|
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' ' + date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
|
|
|
}
|
|
|
}, {
|
|
|
display: '是否启用',
|
|
|
name: "status",
|
|
|
render: function(item) {
|
|
|
if(item.status==1){
|
|
|
var name ="已启用" ;
|
|
|
}else {
|
|
|
var name ="未启用" ;
|
|
|
}
|
|
|
return name;
|
|
|
}
|
|
|
}, {
|
|
|
display: '优惠券限制使用',
|
|
|
name: "status",
|
|
|
render: function(item) {
|
|
|
if(item.status==1){
|
|
|
var name ="是" ;
|
|
|
}else {
|
|
|
var name ="否" ;
|
|
|
}
|
|
|
return name;
|
|
|
}
|
|
|
}]
|
|
|
}) |
...
|
...
|
|