|
|
|
@ -408,6 +408,50 @@
|
|
|
|
|
</form>
|
|
|
|
|
<a class="ajax-post add-butn <notempty name='commonset'>addSIsetted</notempty>" href="javascript:;" target-form="addShortcutIcon" url="{:U('Think/addShortcutIcon')}"><img src="__IMG__/zwmimages/icon_jia.png"><span><notempty name='commonset'>已添加<else />添加至常用设置</notempty></span></a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script type="text/html" id="addSubSpendTpl">
|
|
|
|
|
<div style="padding:10px 40px 30px;">
|
|
|
|
|
<spend style="font-size:14px;color:#666;">
|
|
|
|
|
最后固定数据时间:【{$lastSynTime}】<br/>仅能固定最后固定数据时间之后的订单<br/>订单日期表示:最后固定的时间到所选时间(含)之间的订单数据进行固定
|
|
|
|
|
</spend>
|
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:30px;">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="l noticeinfo" style="width:80px;">订单日期:</td>
|
|
|
|
|
<td class="r table_radio">
|
|
|
|
|
<input type="text" id="addSubSpendTime" name="addSubSpendTime" autocomplete="off" class="date" placeholder="订单日期" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<button class="submit_btn mlspacing" id="addSubSpendSubmit" type="submit" style="margin-top:30px;">
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
<script type="text/html" id="updateSubSpendTpl">
|
|
|
|
|
<div style="padding:10px 40px 30px;">
|
|
|
|
|
<spend style="font-size:14px;color:#666;">
|
|
|
|
|
已固定订单时间:【{$lastSynTime}】<br/>重新固定的数据将覆盖之前的订单数据
|
|
|
|
|
</spend>
|
|
|
|
|
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:30px;">
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="l noticeinfo" style="width:100px;">订单开始日期:</td>
|
|
|
|
|
<td class="r table_radio">
|
|
|
|
|
<input type="text" id="updateSubSpendStart" name="updateSubSpendStart" autocomplete="off" class="date" placeholder="订单开始日期" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
<tr style="height:20px;"></tr>
|
|
|
|
|
<tr>
|
|
|
|
|
<td class="l noticeinfo" style="width:100px;">订单结束日期:</td>
|
|
|
|
|
<td class="r table_radio">
|
|
|
|
|
<input type="text" id="updateSubSpendEnd" name="updateSubSpendEnd" autocomplete="off" class="date" placeholder="订单结束日期" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<button class="submit_btn mlspacing" id="updateSubSpendSubmit" type="submit" style="margin-top:30px;">
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</block>
|
|
|
|
|
|
|
|
|
@ -428,10 +472,154 @@
|
|
|
|
|
</volist>
|
|
|
|
|
$(".select_gallery").select2();
|
|
|
|
|
</script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var SPENDOP={
|
|
|
|
|
lastSynTime:"{$lastSynTime}",
|
|
|
|
|
publiucAjax:function(url,senddata,callback){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'post',
|
|
|
|
|
url: url,
|
|
|
|
|
data:senddata,
|
|
|
|
|
success: function(data) {
|
|
|
|
|
console.log(data)
|
|
|
|
|
if(data.status == 1){
|
|
|
|
|
callback(data.info);
|
|
|
|
|
}else{
|
|
|
|
|
layer.alert(data.info);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
layer.alert("网络错误或超时");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
initFun(){
|
|
|
|
|
this.mainEven();
|
|
|
|
|
},
|
|
|
|
|
closeLayer(){
|
|
|
|
|
layer.closeAll();
|
|
|
|
|
},
|
|
|
|
|
reload(){
|
|
|
|
|
setTimeout(function(){
|
|
|
|
|
window.location.reload();
|
|
|
|
|
},1000);
|
|
|
|
|
},
|
|
|
|
|
oepnHtml(title,dom,callback){
|
|
|
|
|
var html = $(dom).html();
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 1,
|
|
|
|
|
title: title,
|
|
|
|
|
maxWidth:720,
|
|
|
|
|
closeBtn: 1,
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
content: html,
|
|
|
|
|
success:callback
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
mainEven(){
|
|
|
|
|
$("#addSubSpendSet").on("click",function() {
|
|
|
|
|
SPENDOP.oepnHtml("新增固定订单","#addSubSpendTpl",SPENDOP.addSubSpendSetEvent);
|
|
|
|
|
});
|
|
|
|
|
$("#updateSubSpend").on("click",function() {
|
|
|
|
|
SPENDOP.oepnHtml("重新固定订单","#updateSubSpendTpl",SPENDOP.updateSubSpendEvent);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
addSubSpendSetEvent(){
|
|
|
|
|
$("#addSubSpendSubmit").off("click");
|
|
|
|
|
$("#addSubSpendTime").datetimepicker({
|
|
|
|
|
format: 'yyyy-mm-dd',
|
|
|
|
|
language: "zh-CN",
|
|
|
|
|
showMeridian:true,
|
|
|
|
|
pickDate:true,
|
|
|
|
|
minView: 2,
|
|
|
|
|
autoclose: true,
|
|
|
|
|
pickTime:true,
|
|
|
|
|
todayBtn:true,
|
|
|
|
|
});
|
|
|
|
|
$("#addSubSpendSubmit").on("click",function() {
|
|
|
|
|
var subtime= $("#addSubSpendTime").val();
|
|
|
|
|
|
|
|
|
|
var day2 = new Date();
|
|
|
|
|
day2.setTime(day2.getTime());
|
|
|
|
|
var today = day2.getFullYear()+"-" + (day2.getMonth()+1) + "-" + day2.getDate();
|
|
|
|
|
|
|
|
|
|
var lastSynTime = Date.parse(SPENDOP.lastSynTime);
|
|
|
|
|
today = Date.parse(today);
|
|
|
|
|
var subtimenum = Date.parse(subtime);
|
|
|
|
|
|
|
|
|
|
if(subtimenum >= today) {
|
|
|
|
|
layer.msg('固化数据必须小于当日');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(subtimenum <= lastSynTime) {
|
|
|
|
|
layer.msg('所选时间已固化');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
//执行
|
|
|
|
|
SPENDOP.publiucAjax("{:U('addSubSpendSet')}",{time:subtime},function(info){
|
|
|
|
|
layer.alert(info);
|
|
|
|
|
SPENDOP.reload();
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
updateSubSpendEvent(){
|
|
|
|
|
$("#updateSubSpendSubmit").off("click");
|
|
|
|
|
$("#updateSubSpendStart").datetimepicker({
|
|
|
|
|
format: 'yyyy-mm-dd',
|
|
|
|
|
language: "zh-CN",
|
|
|
|
|
showMeridian:true,
|
|
|
|
|
pickDate:true,
|
|
|
|
|
minView: 2,
|
|
|
|
|
autoclose: true,
|
|
|
|
|
pickTime:true,
|
|
|
|
|
todayBtn:true,
|
|
|
|
|
});
|
|
|
|
|
$("#updateSubSpendEnd").datetimepicker({
|
|
|
|
|
format: 'yyyy-mm-dd',
|
|
|
|
|
language: "zh-CN",
|
|
|
|
|
showMeridian:true,
|
|
|
|
|
pickDate:true,
|
|
|
|
|
minView: 2,
|
|
|
|
|
autoclose: true,
|
|
|
|
|
pickTime:true,
|
|
|
|
|
todayBtn:true,
|
|
|
|
|
});
|
|
|
|
|
$("#updateSubSpendSubmit").on("click",function() {
|
|
|
|
|
var begin= $("#updateSubSpendStart").val();
|
|
|
|
|
var end= $("#updateSubSpendEnd").val();
|
|
|
|
|
|
|
|
|
|
var startNum = Date.parse(begin);
|
|
|
|
|
var endNum = Date.parse(end);
|
|
|
|
|
var lastSynTime = Date.parse(SPENDOP.lastSynTime);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(startNum > endNum) {
|
|
|
|
|
layer.msg('开始时间必须小于结束时间');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(endNum > lastSynTime) {
|
|
|
|
|
layer.msg('重算结束时间必须在最后固定时间之前');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
//执行
|
|
|
|
|
SPENDOP.publiucAjax("{:U('updateSubSpend')}",{begin:begin,end:end},function(info){
|
|
|
|
|
layer.alert(info);
|
|
|
|
|
SPENDOP.reload();
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
//导航高亮
|
|
|
|
|
highlight_subnav("{:U('lists')}");
|
|
|
|
|
$(function () {
|
|
|
|
|
SPENDOP.initFun();
|
|
|
|
|
//搜索功能
|
|
|
|
|
$("#search").click(function () {
|
|
|
|
|
var sdate = Date.parse($('#time-start').val()) / 1000;
|
|
|
|
|