|
|
|
@ -225,6 +225,24 @@
|
|
|
|
|
</table>
|
|
|
|
|
<div style="width: 100%;height: 50px;"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<script type="text/html" id="updateStatementTpl">
|
|
|
|
|
<div style="padding:10px 40px 30px;">
|
|
|
|
|
<spend style="font-size:14px;color:#666;">
|
|
|
|
|
按月份对汇总数据进行重算,任务提交成功后,大约需等待3-5分钟才会完成重算
|
|
|
|
|
</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="updateStatementTime" name="updateStatementTime" autocomplete="off" class="date" placeholder="重算月份" />
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
<button class="submit_btn mlspacing" id="updateStatementSubmit" type="submit" style="margin-top:30px;">
|
|
|
|
|
保存
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</block>
|
|
|
|
|
|
|
|
|
@ -285,26 +303,70 @@
|
|
|
|
|
window.location.href = url;
|
|
|
|
|
});
|
|
|
|
|
$("#updateStatement").on("click",function(){
|
|
|
|
|
layer.confirm("重算需要花费2分钟左右时间,并且只统计上个月信息,无需重算请取消,上次重算时间【{$lastRecount}】",{title:false}, function(index){
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'post',
|
|
|
|
|
url: "{:U('updateStatement')}",
|
|
|
|
|
data:{},
|
|
|
|
|
success: function(data) {
|
|
|
|
|
if(data.success){
|
|
|
|
|
layer.alert('添加重算任务成功,请2分钟后刷新查看',function(){
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
layer.alert('添加任务失败,已有重算任务。请等待上个重算任务完成');
|
|
|
|
|
var html = $("#updateStatementTpl").html();
|
|
|
|
|
layer.open({
|
|
|
|
|
type: 1,
|
|
|
|
|
title: "汇总重算",
|
|
|
|
|
maxWidth:720,
|
|
|
|
|
closeBtn: 1,
|
|
|
|
|
shadeClose: true,
|
|
|
|
|
content: html,
|
|
|
|
|
success:function(){
|
|
|
|
|
$("#updateStatementSubmit").off("click");
|
|
|
|
|
$("#updateStatementTime").datetimepicker({
|
|
|
|
|
format: 'yyyy-mm',
|
|
|
|
|
language: "zh-CN",
|
|
|
|
|
showMeridian:true,
|
|
|
|
|
pickDate:true,
|
|
|
|
|
startView: 3,
|
|
|
|
|
minView: 3,
|
|
|
|
|
autoclose: true,
|
|
|
|
|
pickTime:true
|
|
|
|
|
});
|
|
|
|
|
$("#updateStatementSubmit").on("click",function() {
|
|
|
|
|
var subtime= $("#updateStatementTime").val();
|
|
|
|
|
if(subtime == ''){
|
|
|
|
|
layer.msg('请先选择要重算的月份');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
layer.alert("网络错误或超时");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
var subtimeArr = subtime.split("-");
|
|
|
|
|
|
|
|
|
|
var today = new Date();
|
|
|
|
|
today.setTime(today.getTime());
|
|
|
|
|
var year = today.getFullYear();
|
|
|
|
|
var month = today.getMonth()+1;
|
|
|
|
|
|
|
|
|
|
if(subtimeArr[0] > year){
|
|
|
|
|
layer.msg('要重算的月份必须小于当前时间');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if(subtimeArr[0] == year && subtimeArr[1] >= month){
|
|
|
|
|
layer.msg('要重算的月份必须小于当前时间');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: 'post',
|
|
|
|
|
url: "{:U('updateStatement')}",
|
|
|
|
|
data:{time:subtime},
|
|
|
|
|
success: function(data) {
|
|
|
|
|
if(data.success){
|
|
|
|
|
layer.alert('添加重算任务成功,请2分钟后刷新查看',function(){
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
}else{
|
|
|
|
|
layer.alert('添加任务失败,已有重算任务。请等待上个重算任务完成');
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
error:function(){
|
|
|
|
|
layer.alert("网络错误或超时");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
//回车自动提交
|
|
|
|
|