ComplianceServer/oldcode/WEB/Views/WeiXin/BonusGrouper/Index.cshtml

166 lines
5.4 KiB
Plaintext

@using WX.CRM.WebHelper
@{
ViewBag.Title = "";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<style type="text/css">
.table1 td {
height: 30px;
}
</style>
<div class="mvctool">
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="bas_datagrid">
<table style="width: 100%;">
<tr>
<td width="50%" style="padding: 5px;">
<div id="panel1" data-options="iconCls:'icon-details'" class="easyui-panel" title="一周组业绩排名">
<div style="padding: 5px; height: auto" class="grid_toolbar">
<ul class="toolBar_ul">
<li>
<a href="javascript:void(0);" onclick="backDate('week1');">上一周</a><input type="text" id="week1" style="width: 140px;" /><input type="hidden" id="hidweek1" /><a href="javascript:void(0);" onclick="nextDate('week1');">下一周</a>
</li>
<li><input type="button" value="查询" onclick="LoadGrouperBonusWeek()" /></li>
</ul>
</div>
@Html.Raw(ViewBag.table1)
</div>
</td>
</tr>
</table>
</div>
<div id="dlg" style="display: none;">
<div id="dlg4" class="easyui-dialog" closed="true" style="width: 600px; height: 600px; padding: 10px;">
<table class="table1">
<tr>
<td align="left">
一周组业绩排名
<a href="javascript:void(0);" onclick="backDate3('week3');">上一周</a><input type="text" id="week3" style="width: 140px;" /><input type="hidden" id="hidweek3" /><a href="javascript:void(0);" onclick="nextDate3('week3');">下一周</a>
</td>
<td>
<input type="button" value="确定" onclick="SaveGrouperBonusWeek()" />
</td>
</tr>
</table>
</div>
</div>
<script type="text/javascript">
var curD = new Date();
var firstD = new Date();
var lastD = new Date();
var dayTime = 24 * 60 * 60 * 1000;
function initDate(id) {
curD.setHours(12, 12, 12, 0);
var dateLong = curD.getTime();
if (curD.getDay() === 0) {
dateLong = dateLong - (6 * dayTime);
} else {
dateLong = dateLong - (curD.getDay() - 1) * dayTime;
}
curD.setTime(dateLong);
firstD = curD;
lastD.setTime(firstD.getTime() + 6 * dayTime);
var ss = firstD.getFullYear() + '-' + (firstD.getMonth() + 1) + '-' + firstD.getDate() + ' 至 ' + lastD.getFullYear() + '-' + (lastD.getMonth() + 1) + '-' + lastD.getDate();
$("#" + id).val(ss);
$("#hid" + id).val(firstD.getFullYear() + '-' + (firstD.getMonth() + 1) + '-' + firstD.getDate());
}
function backDate(id) {
var dateLong = curD.getTime();
curD.setTime(dateLong - (6 * dayTime));
initDate(id);
LoadGrouperBonusWeek();
}
function nextDate(id) {
var dateLong = curD.getTime();
curD.setTime(dateLong + (7 * dayTime));
initDate(id);
LoadGrouperBonusWeek();
}
var curD3 = new Date();
var firstD3 = new Date();
var lastD3 = new Date();
function initDate3(id) {
curD3.setHours(12, 12, 12, 0);
var dateLong = curD3.getTime();
if (curD3.getDay() === 0) {
dateLong = dateLong - (6 * dayTime);
} else {
dateLong = dateLong - (curD3.getDay() - 1) * dayTime;
}
curD3.setTime(dateLong);
firstD3 = curD3;
lastD3.setTime(firstD3.getTime() + 6 * dayTime);
var ss = firstD3.getFullYear() + '-' + (firstD3.getMonth() + 1) + '-' + firstD3.getDate() + ' 至 ' + lastD3.getFullYear() + '-' + (lastD3.getMonth() + 1) + '-' + lastD3.getDate();
$("#" + id).val(ss);
$("#hid" + id).val(firstD3.getFullYear() + '-' + (firstD3.getMonth() + 1) + '-' + firstD3.getDate());
}
function backDate3(id) {
var dateLong = curD3.getTime();
curD3.setTime(dateLong - (6 * dayTime));
initDate3(id);
}
function nextDate3(id) {
var dateLong = curD3.getTime();
curD3.setTime(dateLong + (7 * dayTime));
initDate3(id);
}
$(function () {
initDate('week1');
initDate('week3');
LoadGrouperBonusWeek();
});
function BtnSvae() {
$("#dlg").show();
$('#dlg4').dialog({
title: "奖励提交",
width: 550,
height: 250,
closed: false,
cache: false,
modal: true
});
}
function LoadGrouperBonusWeek() {
$("#tablist1").tablegrid({
url: '/weixin/BonusGrouper/GetGrouperBonusWeek',
height: $(window).height()/3 - 130,
loadNow: true,
data: { week: $("#hidweek1").val() }
});
}
function SaveGrouperBonusWeek() {
$.r_ajax({
url: "/weixin/BonusUser/SaveGrouperBonusWeek",
type: "Post",
data: { week: $("#hidweek3").val() },
dataType: "json",
loading: true,
success: function (data) {
if (data.result === "ok") {
$.messageBox5s('提示', data.message);
}
else {
$.messageBox5s('提示', data.message);
}
}
});
}
</script>