Authored by chenchao

temp save

... ... @@ -6,14 +6,14 @@ module.exports = function (app){
pageName:"促销管理"
}
});
//新增基本信息
//新增促销基本信息
app.get("/promotionInfo/addNew", "customService.promotion.Add", function (req,res){
this.$extend={
moduleName:"客服管理",
pageName:"促销编辑"
}
});
//编辑页
//促销编辑页
app.get("/promotionInfo/edit/:brandId", "customService.promotion.Edit","promotion_getPromotionInfo", function (rs,req,res){
this.$extend={
action: '/promotion/update',
... ... @@ -22,12 +22,23 @@ module.exports = function (app){
return rs.data;
});
//列表
//促销列表
app.post("/promotionInfo/list","promotion_getPromotionInfoList");
//新增
//新增促销信息
app.post("/promotionInfo/add","promotion_addPromotionInfo");
//编辑
//编辑促销信息
app.post("/promotionInfo/update","promotion_updatePromotionInfo");
//删除
//删除促销信息
app.post("/promotionInfo/delete","promotion_deletePromotionInfo");
//参数-促销条件
//参数-促销操作
//参数- 促销限制
//参数-互斥促销
//参数-促销显示
}
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<form id="basicForm" role="form" class="form-horizontal form-bordered" method="post" action="<%action%>">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
</div>
<div class="panel-body" id="basicInfo">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">促销名称&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-10">
<input type="text" id="title" class="form-control" value="<%data.title%>" placeholder="促销名称" required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">促销描述 </label>
<div class="col-sm-10">
<textarea style="width: 400px; height: 90px;" name="description" id="description"><%data.description%></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">渠道</label>
<div class="col-sm-3">
<label class="radio-inline" style="padding-left: 0">
<input type="checkbox" name="fit_channel" value="1">有货官网</label>
<label class="radio-inline">
<input type="checkbox" name="fit_channel" value="2">iphone</label>
<label class="radio-inline">
<input type="checkbox" name="fit_channel" value="3">android</label>
<input type="hidden" id="fit_channel" name="fit_channel" value="<%data.fit_channel%>" for="checkbox" placeholder="渠道" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">起始时间&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-4">
<input id="startTime" class="form-control" jsaction="time:end:endTime" type="text" placeholder="预售上架时间"
value="<%data.startTime%>" readonly required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">结束时间&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-4">
<input id="endTime" class="form-control" jsaction="time:start:startTime" type="text" placeholder="预售下架时间"
value="<%data.endTime%>" readonly required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">优先级&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-10">
<input type="text" id="priority" name='priority' class="form-control" value="<%data.priority%>" required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态 <span class="red">*</span></label>
<div class="col-sm-2">
<label class="radio-inline">
<input type="radio" name="status" value="1">启用</label>
<label class="radio-inline">
<input type="radio" name="status" value="0" selected="selected">不启用</label>
<input type="hidden" id="status" name="status" value="<%data.status||'0'%>" for="radio" required />
</div>
</div>
</div>
</div>
<input type="hidden" id="id" value="<%data.id%>">
<div class="panel-footer">
<button class="btn btn-primary" id="save">保存</button>
</div>
</div>
</form>
</div>
</div>
</div>
<%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
<%include '../../../common/views/__ui/header'%>
<%include '../../../common/views/__partail/ListHeader'%>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
</div>
<div class="dataTab_wrapper" id="basicTab" style="margin-bottom: 10px"></div>
<div class="panel-body" id="tab_body"></div>
</div>
</div>
</div>
</div>
<script type="text/template" id="fm_baseInfo">
<%include './__fragement/base_info'%>
</script>
<script type="text/template" id="fm_reject">
<div class="dataTables_length" id="basicTable_promotion">
</div>
</script>
<%include '../../../common/views/__ui/footer'%>
\ No newline at end of file
... ...
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">促销名称&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-10">
<input type="text" id="title" class="form-control" value="<%data.title%>" placeholder="促销名称" required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">促销描述 </label>
<div class="col-sm-10">
<textarea style="width: 400px; height: 90px;" name="description" id="description"><%data.description%></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">渠道</label>
<div class="col-sm-3">
<label class="radio-inline" style="padding-left: 0">
<input type="checkbox" name="fit_channel" value="1">有货官网</label>
<label class="radio-inline">
<input type="checkbox" name="fit_channel" value="2">iphone</label>
<label class="radio-inline">
<input type="checkbox" name="fit_channel" value="3">android</label>
<input type="hidden" id="fit_channel" name="fit_channel" value="<%data.fit_channel%>" for="checkbox" placeholder="渠道" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">起始时间&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-4">
<input id="startTime" class="form-control" jsaction="time:end:endTime" type="text" placeholder="预售上架时间"
value="<%data.startTime%>" readonly required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">结束时间&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-4">
<input id="endTime" class="form-control" jsaction="time:start:startTime" type="text" placeholder="预售下架时间"
value="<%data.endTime%>" readonly required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">优先级&nbsp;&nbsp;<span class="red">*</span></label>
<div class="col-sm-10">
<input type="text" id="priority" name='priority' class="form-control" value="<%data.priority%>" required/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">状态 <span class="red">*</span></label>
<div class="col-sm-2">
<label class="radio-inline">
<input type="radio" name="status" value="1">启用</label>
<label class="radio-inline">
<input type="radio" name="status" value="0" selected="selected">不启用</label>
<input type="hidden" id="status" name="status" value="<%data.status||'0'%>" for="radio" required />
</div>
</div>
</div>
<input type="hidden" id="id" value="<%data.id%>">
<div class="panel-footer">
<button class="btn btn-primary" id="save">保存</button>
</div>
\ No newline at end of file
... ...
'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;
}
}]
})
... ...