tijian_tieying/web/dccdc/Views/WeiXin/BNYYWX.cshtml
2025-02-20 12:14:39 +08:00

143 lines
5.2 KiB
Plaintext

@{
ViewBag.Title = "不能预约日期维护";
}
<table class="t1">
<tr>
<td class="ltd" style="width:100px">日期:</td>
<td class="rtd" style="width:160px"><input id="rq" type="text" /></td>
<td>
<input type="button" class="l-button" id="cx" value="查询" />
</td>
</tr>
</table>
<div id="rqlist"></div>
<div id="wh" style="display:none">
<table class="t1" style="width:300px">
<tr>
<td class="ltd" style="width:100px"><input id="id" type="hidden" value="0" />日期:</td>
<td class="rtd" style="width:200px"><input id="arq" type="text" /></td>
</tr>
</table>
</div>
@section scripts{
<script src="@Url.Content("~/Scripts/public.js")"></script>
<script>
$(function () {
$("#rq").ligerDateEditor();
$("#arq").ligerDateEditor();
$("#cx").bind("click", function () {
liger.get("rqlist").set("parms", { key: $("#rq").val() });
liger.get("rqlist").changePage("first");
liger.get("rqlist").reload();
});
$("#rqlist").ligerGrid({
url: "@Url.Action("getBKYYList")",
toolbar: {
items: [
{
text: '添加', click: itemclick, icon: 'add'
},
{ line: true },
{ text: '修改', click: itemclick, icon: "edit" },
{ line: true },
{ text: '删除', click: itemclick, icon: 'delete' }
]
},
title: "不可预约日期列表",
parms: { key: $("#rq").val() },
columns: [
{ name: "id", display: "id", width: 60, align: "left", },
{ name: "rq", display: "不可预约日期", width: 180, align: "center", render:function(r, i, v) { return formatDate(v);} }
], width: "98%",
height: "100%",
rownumbers: true,
usePager: true,
heightDiff: -20
});
});
function itemclick(item) {
if(item.text=="添加")
{
$("#id").val("0");
$("#arq").val("");
$.ligerDialog.open({
title: "添加不可预约日期", target: $("#wh"), width: 418, height: 105, buttons: [{
text: "确定", onclick: function (item, dialg) {
f_save(dialg);
}
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
});
}
else if(item.text == "修改")
{
var r = liger.get("rqlist").getSelectedRow();
if (!r)
{
$.ligerDialog.alert("请选择要修改的行!");
return;
}
$("#id").val(r.id);
$("#arq").val(formatDate(r.rq));
$.ligerDialog.open({
title: "修改不可预约日期", target: $("#wh"), width: 418, height: 105, buttons: [{
text: "确定", onclick: function (item, dialg) {
f_save(dialg);
}
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
});
}
else if (item.text === "删除") {
var r1 = liger.get("rqlist").getSelectedRow();
if (!r1) {
$.ligerDialog.alert("请选择要删除的数据!");
return;
} else {
$.ajax({
url: "@Url.Action("delRqlist")", type: "post", dataType: "json", data: {id:r1.id},
success: function (d) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
liger.get("rqlist").reload();
return;
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
}
}
function f_save(dialg)
{
$.ajax({url:"@Url.Action("saveBKYYRQ")",
type: "post", dataType: "json",data:{id:$("#id").val(),rq:$("#arq").val()},
success: function (data) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(data.Message, function () {
if(data.State==1)
{
dialg.hidden();
liger.get("rqlist").reload();
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
</script>
}