ComplianceServer/oldcode/Core.Web/Views/ComplianceOrder/SetTime.cshtml

113 lines
4.6 KiB
Plaintext

@model CRM.Core.Model.Entity.WX_SZZYORDER
@{
ViewBag.Title = "SetTime";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="x-body">
<div class="layui-form">
<table class="layui-table">
<colgroup>
<col width="200">
<col>
</colgroup>
<tbody>
<tr>
<td>订单号:</td>
<td>@Model.ORDERID</td>
</tr>
<tr>
<td>设置时间:</td>
<td>
<input id="startTime" type="text" name="ai_hgrecord_stime" autocomplete="off" placeholder="开始时间" value="@Model.ai_hgrecord_stime">&nbsp;
-&nbsp;<input id="endTime" type="text" name="ai_hgrecord_etime" autocomplete="off" placeholder="结束时间" value="@Model.ai_hgrecord_etime">
</td>
</tr>
</tbody>
</table>
@Html.HiddenFor(m => m.ORDERID)
<button class="layui-btn" id="save">确定</button>
</div>
</div>
<script>
$(function () {
layui.use('laydate', function () {
var laydate = layui.laydate;
var start = laydate.render({
elem: '#startTime'
, type: 'time'
, format: 'HH:mm'
, ready: function (date) {
var layKey = layui.$(this.elem).attr('lay-key');
layui.$('#layui-laydate' + layKey).find('.layui-laydate-list>li').width('50%').last('li').hide();
}
, done: function (value, date, endDate) {
var endValue = $("#endTime").val();
if (value != "" && endValue == "") {
var dateStr = value.split(":");
if (dateStr.length > 1) {
parseInt((parseInt(dateStr[1]) + 30) / 60)
var endStr = parseInt(dateStr[0]) * 60 + parseInt(dateStr[1]) + 30;
var hourstr = parseInt(endStr / 60);
var minStr = endStr % 60;
if (hourstr < 9) {
hourstr = "0" + hourstr;
}
if (minStr < 9) {
minStr = "0" + minStr;
}
endValue = hourstr + ":" + minStr;
$("#endTime").val(endValue);
}
}
end.config.min = {
year: date.year,
month: date.month - 1,
date: date.date,
hours: date.hours,
minutes: date.minutes + 30,
seconds: date.seconds
}; //开始日选好后,重置结束日的最小日期
}
})
var end = laydate.render({
elem: '#endTime'
, type: 'time'
, format: 'HH:mm'
, ready: function (date) {
var layKey = layui.$(this.elem).attr('lay-key');
layui.$('#layui-laydate' + layKey).find('.layui-laydate-list>li').width('50%').last('li').hide();
}
, done: function (value, date, endDate) {
start.config.max = {
year: date.year,
month: date.month - 1,
date: date.date,
hours: date.hours,
minutes: date.minutes - 30,
seconds: date.seconds
}; //结束日选好后,重置开始日的最大日期
}
});
})
layui.use('layer', function () {
var layer = layui.layer;
$("#save").click(function () {
var orderid = $("#ORDERID").val();
var startTime = $("#startTime").val();
var endTime = $("#endTime").val();
$.r_post('/ComplianceOrder/SetTime', { ORDERID: orderid, endTime: endTime, startTime: startTime }, function (result) {
if (result.result) {
@* layer.alert("操作成功!", {
yes: function () { parent.window.location.reload(); }
})*@
parent.window.location.reload();
} else {
layer.alert(result.retmsg);
}
});
});
});
});
</script>