天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

446 lines
19 KiB

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master"
Inherits="System.Web.Mvc.ViewPage<QMAPP.Web.Models.Sys.DataTaskPlanModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
数据处理任务设置
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%=Html.QPEdit("数据处理任务设置", string.IsNullOrEmpty(Model.PlanID) ? QMFrameWork.WebUI.panelType.Add : QMFrameWork.WebUI.panelType.Update)%>
<table id="editTable" cellpadding=0 cellspacing=0>
<tr>
<td>
<table style="margin: 5px">
<tr>
<th>
&nbsp;<%=Html.QV(p => p.PlanName)%>
</th>
<td colspan="2">
<%=Html.QC(p => p.PlanName)%>
<%=Html.CheckBoxFor(p =>p.IsUseFlg)%>
是否启用
</td>
</tr>
<tr>
<th>
&nbsp;
<%=Html.QV(p => p.TaskID)%>
</th>
<td colspan="3">
<%=Html.QC(p => p.TaskID)%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
<div class="easyui-panel" title="频率" data-options="border:false" style="padding: 0px; border: 1;width:502px">
<table>
<tr>
<td>
&nbsp;&nbsp;&nbsp;&nbsp;执&nbsp; 行
<%=Html.QC(p=>p.PeriodType) %>
</td>
<td>
<div id="divDay" style="height:56px;">
<table style="height:100%">
<tr>
<td>
&nbsp;&nbsp;执行间隔
<%=Html.QC(p=>p.DayPeriod) %>
</td>
</tr>
</table>
</div>
<div id="divWeek" style="display: none;height:56px">
<table style="height:100%">
<tr>
<td>
&nbsp;&nbsp;<%=Html.CheckBoxFor(p=>p.Week2) %>星期一
<%=Html.CheckBoxFor(p=>p.Week3) %>星期二
<%=Html.CheckBoxFor(p=>p.Week4) %>星期三
<%=Html.CheckBoxFor(p=>p.Week5) %>星期四
<br />
&nbsp;&nbsp;<%=Html.CheckBoxFor(p=>p.Week6) %>星期五
<%=Html.CheckBoxFor(p=>p.Week7) %>星期六
<%=Html.CheckBoxFor(p=>p.Week1) %>星期日
</td>
</tr>
</table>
</div>
<div id="divMonth" style="display: none;height:56px">
<table>
<tr>
<td>
&nbsp;
<%=Html.RadioButton("MonthMode", "1", Model.MonthMode == "1" ? true : false)%>&nbsp;
<%=Html.QC(p=>p.MonthDay1) %>
天 到
<%=Html.QC(p=>p.MonthDay2) %>
天 每
<%=Html.QC(p=>p.MonthPeriod1) %>
</td>
</tr>
<tr>
<td>
&nbsp;
<%=Html.RadioButton("MonthMode","2",Model.MonthMode == "2" ? true : false) %>
间隔
<%=Html.QC(p=>p.MonthDay3) %>
天 -&nbsp;
<%=Html.QC(p=>p.MonthPeriod2) %>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div id="divInterval" class="easyui-panel" data-options="border:false" title="每天频率" style="padding: 5px; border: 1">
<table>
<tr>
<td>
&nbsp;&nbsp;<%=Html.RadioButton("DayMode","1",Model.DayMode=="1" ? true : false) %>执行一次,时间为
<%=Html.QC(p=>p.OnceTime) %>
</td>
<td>
&nbsp;&nbsp;<%=Html.RadioButton("DayMode", "2", Model.DayMode == "2" ? true : false)%>执行间隔
<%=Html.QC(p=>p.Interval) %>
</td>
<td>
<%=Html.QC(p=>p.IntervalType) %>
</td>
</tr>
<%-- <td>
开始时间
</td>
<td>
<%=Html.QC(p=>p.DayStartTime) %>
</td>
</tr>
<tr>
<td>
结束时间
</td>
<td>
<%=Html.QC(p=>p.DayEndTime) %>
</td>
</tr>--%>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div id="divDate" class="easyui-panel" data-options="border:false" title="持续时间" style="padding: 5px; border: 1">
<table id="tbDate">
<tr>
<td>
&nbsp;&nbsp; <%=Html.QV(p=>p.PlanStartDate) %>
<%=Html.QC(p => p.PlanStartDate)%>
</td>
<td>
<%=Html.RadioButton("PlanDateMode", "1", Model.PlanDateMode == "1" ? true : false)%>
<%=Html.QV(p=>p.PlanEndDate) %>
<%=Html.QC(p => p.PlanEndDate)%>
</td>
</tr>
<tr>
<td>
</td>
<td>
<%=Html.RadioButton("PlanDateMode", "2", Model.PlanDateMode == "2" ? true : false)%>
无结束日期
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div id="divRemark" class="easyui-panel" data-options="border:false" title="备注" style="padding: 5px 5px 5px 26px; border: 1">
<%=Html.QC(p=>p.Remark) %>
</div>
</td>
</tr>
</table>
<%=Html.HiddenFor(p=>p.PlanID) %>
<%=Html.QPEnd() %>
<script type="text/javascript">
//根据频率切换对应的层
function ChangePeriod(obj) {
if (obj == "d") {
$("#divDay").css('display', 'block');
$("#divWeek").css('display', 'none');
$("#divMonth").css('display', 'none');
}
else if (obj == "w") {
$("#divDay").css('display', 'none');
$("#divWeek").css('display', 'block');
$("#divMonth").css('display', 'none');
}
else if (obj == "m") {
$("#divDay").css('display', 'none');
$("#divWeek").css('display', 'none');
$("#divMonth").css('display', 'block');
}
}
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<%=Html.QTButtonSave("", "", "Save()")%>
<%=Html.QTButton("close", "DataTaskPlanList", "close", "parent.closeAppWindow1();return false;", (s, f) => { return true; })%>
</td>
</tr>
</table>
<script type="text/javascript">
$(function () {
var curDate = new Date();
var dateFormat = curDate.getFullYear() + '-' + (curDate.getMonth() + 1) + '-' + curDate.getDate();
if ($("#PlanStartDate").val() == "") {
$("#PlanStartDate").val(dateFormat);
}
$('#PeriodType').combobox({
url: '/DataTaskPlan/GetPeriodTypeList',
editable: 'false',
valueField: 'id',
editable:false,
textField: 'text',
onSelect: function () {
ChangePeriod($('#PeriodType').combobox('getValue'));
}
});
ChangePeriod($('#PeriodType').combobox('getValue'));
});
//保存
function Save() {
//校验基本信息合法性
if (isValidate() == false) {
return false;
}
if ($("#PlanStartDate").val() == "") {
MSI("提示", "请填写开始日期。");
return false;
}
if ($('input:radio[name=PlanDateMode]:checked').val() == "1") {
if ($("#PlanEndDate").val() == "") {
MSI("提示", "请填写结束日期。");
return false;
}
var now = new Date();
var ed = new Date($("#PlanEndDate").val().replace("-", "/"));
if (now > ed) {
MSI("提示", "结束日期必须大于当前日期。");
return false;
}
}
if ($("#PlanDateMode").val() != "1") {
var PlanStartDate = $("#PlanStartDate").val();
var start = new Date(PlanStartDate.replace("-", "/"));
var PlanEndDate = $("#PlanEndDate").val();
var end = new Date(PlanEndDate.replace("-", "/"));
//较验起始和结束时间
if (PlanStartDate > PlanEndDate) {
MSI("提示", "结束时间必需大于或者等于起始时间。");
return false;
}
}
//判断频率为每月时判断天数是否输入正确
var PeriodType = $("#PeriodType").val();
if (PeriodType == "m") {
//选中第一种
if ($("#MonthMode").val() == "1") {
var MonthDay1 = $("#MonthDay1").val();
var MonthDay2 = $("#MonthDay2").val();
if (parseInt(MonthDay1) < 1 || parseInt(MonthDay1) > 31 || parseInt(MonthDay2) < 1 || parseInt(MonthDay2) > 31 || parseInt(MonthDay1) > parseInt(MonthDay2)) {
MSI("提示", "请填写正确的日期范围。");
return false;
}
//间隔多少个月
var MonthPeriod1 = $("#MonthPeriod1").val();
if (parseInt(MonthPeriod1) < 1 || MonthPeriod1 > 12) {
MSI("提示", "请填写正确的间隔月份。");
return false;
}
}
//选择第二种
if ($("#MonthMode").val() == "2") {
var MonthDay1 = $("#MonthDay1").val();
var MonthDay2 = $("#MonthDay2").val();
if (parseInt(MonthDay1) < 1 || parseInt(MonthDay1) > 31 || parseInt(MonthDay2) < 1 || parseInt(MonthDay2) > 31 || parseInt(MonthDay1) > parseInt(MonthDay2)) {
MSI("提示", "请填写正确的日期范围。");
return false;
}
//间隔多少个月
var MonthPeriod1 = $("#MonthPeriod1").val();
if (parseInt(MonthPeriod1) < 1 || MonthPeriod1 > 12) {
MSI("提示", "请填写正确的间隔月份。");
return false;
}
}
}
//分秒小时的较验
var IntervalType = $("#IntervalType").val();
if (IntervalType != "") {
if (IntervalType == "s") {
if (parseInt($("#Interval").val()) < 1 || parseInt($("#Interval").val()) > 60) {
MSI("提示", "请填写范围为1到60的秒数。");
return false;
}
}
if (IntervalType == "m") {
if (parseInt($("#Interval").val()) < 1 || parseInt($("#Interval").val()) > 60) {
MSI("提示", "请填写范围为1到60的分钟数。");
return false;
}
}
if (IntervalType == "h") {
if (parseInt($("#Interval").val()) < 1 || parseInt($("#Interval").val()) > 24) {
MSI("提示", "请填写范围为1到24的小时数。");
return false;
}
}
}
if ($('#PeriodType').combobox('getValue') == "d")
{
if (parseInt($('#DayPeriod').val()) < 1) {
MSI("提示", "执行间隔不能小于1。");
return;
}
if ($("#DayPeriod").val() == "") {
MSI("提示", "执行间隔不能为空。");
return;
}
}
if ($('#PeriodType').combobox('getValue') == "w") {
if ($('#Week1').prop('checked') == false
&& $('#Week2').prop('checked') == false
&& $('#Week3').prop('checked') == false
&& $('#Week4').prop('checked') == false
&& $('#Week5').prop('checked') == false
&& $('#Week6').prop('checked') == false
&& $('#Week7').prop('checked') == false) {
MSI("提示","请至少选择一天。");
return;
}
}
submitByButton("DataTaskPlanSave");
}
$(function () {
//设置默认时间
//月周期1
$("#MonthPeriod1").bind('blur', function () {
if ($("#MonthPeriod1").val() == "" || parseInt($("#MonthPeriod1").val()) < 1) {
$("#MonthPeriod1").val(1);
}
if (parseInt($("#MonthPeriod1").val()) > 12) {
$("#MonthPeriod1").val(12);
}
});
//月周期2
$("#MonthPeriod2").bind('blur', function () {
if ($("#MonthPeriod2").val() == "" || parseInt($("#MonthPeriod2").val()) < 1) {
$("#MonthPeriod2").val(1);
}
if (parseInt($("#MonthPeriod2").val()) > 12) {
$("#MonthPeriod2").val(12);
}
});
//日期1
$("#MonthDay1").bind('blur', function () {
if ($("#MonthDay1").val() == "" || parseInt($("#MonthDay1").val()) < 1) {
$("#MonthDay1").val(1);
}
if (parseInt($("#MonthDay1").val()) > 31) {
$("#MonthDay1").val(31);
}
});
//日期2
$("#MonthDay2").bind('blur', function () {
if ($("#MonthDay2").val() == "" || parseInt($("#MonthDay2").val()) < 1) {
$("#MonthDay2").val(1);
}
if (parseInt($("#MonthDay2").val()) > 31) {
$("#MonthDay2").val(31);
}
});
//日期2
$("#MonthDay3").bind('blur', function () {
if ($("#MonthDay3").val() == "" || parseInt($("#MonthDay3").val()) < 1) {
$("#MonthDay3").val(1);
}
if (parseInt($("#MonthDay3").val()) > 31) {
$("#MonthDay3").val(31);
}
});
//频率执行间隔
$("#Interval").bind('blur', function () {
if ($("#Interval").val() == "" || parseInt($("#Interval").val()) < 1) {
$("#Interval").val(1);
}
var it = $("#IntervalType").combobox("getValue");
if (it == "s") {
if (parseInt($("#Interval").val()) > 60) {
$("#Interval").val(60);
}
}
if (it == "m") {
if (parseInt($("#Interval").val()) > 60) {
$("#Interval").val(60);
}
}
if (it == "h") {
if (parseInt($("#Interval").val()) > 24) {
$("#Interval").val(24);
}
}
});
//每天频率执行间隔
$("#DayPeriod").bind('blur', function () {
if ($("#DayPeriod").val() == "" || parseInt($("#DayPeriod").val()) < 1) {
$("#DayPeriod").val(1);
}
if (parseInt($("#DayPeriod").val()) > 31) {
$("#DayPeriod").val(31);
}
});
});
</script>
</asp:Content>