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

178 lines
8.3 KiB
Plaintext

@{
ViewBag.Title = "sqyscx";
}
<div style="width:100%">
<table class="t1" style="width:100%">
<tr>
<td class="ltd" style="width:80px">开始时间:</td>
<td class="rtd" style="width:150px"><input id="start" class="l-text" /></td>
<td class="ltd" style="width:70px">结束时间:</td>
<td class="rtd" style="width:150px"><input id="end" class="l-text" /></td>
<td class="ltd" style="width:70px">预算年份:</td>
<td class="rtd" style="width:150px">@Html.TextBox("year", "", new { @class = "l-text" })</td>
</tr>
<tr>
<td class="ltd" style="width:70px">申请人:</td>
<td class="rtd" style="width:150px">@Html.TextBox("sqr", "", new { @class = "l-text" })</td>
<td class="ltd" style="width:70px">申请科室:</td>
<td class="rtd" style="width:150px">
@if (ViewBag.disabled == "1")
{
@Html.DropDownList("ksid", ViewBag.ksD as SelectList, "所有科室", new { @class = "l-text", @disabled = "disabled" })
}
else
{
@Html.DropDownList("ksid", ViewBag.ksD as SelectList, "所有科室", new { @class = "l-text" })
}
</td>
<td class="rtd" style="width:220px" colspan="2">
<button type="button" id="search" class="l-button">查询</button>
@*<button type="button" id="save" class="l-button">保存</button>*@
</td>
</tr>
</table>
</div>
<div id="maingrid"></div>
@using Newtonsoft.Json;
@section scripts{
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
<script type="text/javascript">
function fun_date(days) {
var date1 = new Date(),
time1 = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate();//time1表示当前时间
var date2 = new Date(date1);
date2.setDate(date1.getDate() + days);
var y = date2.getFullYear();
var m = date2.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = date2.getDate();
d = d < 10 ? ('0' + d) : d;
var time2 = y + "-" + m + "-" + d;
return time2;
}
$(function () {
$("#start").ligerDateEditor();
$("#end").ligerDateEditor();
//$("#start").ligerGetDateEditorManager().setValue(fun_date(-10));
//$("#end").ligerGetDateEditorManager().setValue(fun_date(0));
$("#search").click(function () {
liger.get("maingrid").set("parms", { start: $("#start").val(), end: $("#end").val(), sqr: $("#sqr").val(), ksid: $("#ksid").val(), year: $("#year").val() });
liger.get("maingrid").changePage("first");
liger.get("maingrid").reload();
})
$("#save").click(function () {
liger.get("maingrid").endEdit();
var rows = liger.get("maingrid").getData();
var items = "";
for (var i in rows) {
if (rows[i].syje > 0) {
items += +rows[i].id + "|" + rows[i].syje + ",";
}
}
if (items == "") {
$.ligerDialog.error("请维护使用金额!");
return;
}
if (window.parent.selectedYSBX) {
window.parent.selectedYSBX(items);
}
})
$("#maingrid").ligerGrid({
height: '100%',
columns: [
{ display: '编号', name: 'id', align: 'left', width: 60 },
//{ display: "经费类别", name: "jflbmc", align: "left", width: 100 },
{
display: "经费名称", name: "jfmc", align: "left", width: 100, render: function (r, i, v) {
if (!v) {
return r.xmmc;
}
return v;
}
},
//{ display: "科目名称", name: "kmmc", align: "left", width: 100 },
{
display: "预算金额", name: "dj", align: "right", width: 80, totalSummary: {
render: function (suminf, column) {
return "<span style='color:red'>合计:" + suminf.sum + "</span>";
}
}
},
{
display: "已用金额", name: "yyje", align: "right", width: 80, totalSummary: {
render: function (suminf, column) {
return "<span style='color:red'>合计:" + suminf.sum + "</span>";
}
}
},
{
display: "剩余金额", name: "syje2", align: "right", width: 80, totalSummary: {
render: function (suminf, column) {
return "<span style='color:red'>合计:" + suminf.sum + "</span>";
}
}
},
//{ display: "使用金额", name: "syje", align: "right", width: 70, type: 'float', editor: { type: 'float' } },
//{ display: '申请单号', name: 'sqdh', align: 'left', width: 90 },
//{ display: '申请科室', name: 'ksmc', align: 'left', width: 80 },
//{ display: '申请人', name: 'sqr', align: 'left', width: 80 },
{ display: '预算年份', name: 'year', align: 'left', width: 80 },
{ display: '测算依据', name: 'csyj', align: 'left', width: 160 },
{ display: '项目内容', name: 'xmnr', align: 'left', width: 160 },
{ display: '项目目标', name: 'xmmb', align: 'left', width: 160 }
//{ display: '预算金额', name: 'je', align: 'right', width: 60 },
//{ display: '申请时间', name: 'sqsj', width: 150 },
//{ display: '备注', name: 'bz', align: 'left', width: 200 },
//{
// display: '状态', name: 'zt', width: 110, render: function (r, i, v) {
// switch (v) {
// case 1: return "等待科室领导审批";
// case 2: return "等待分管领导审批";
// case 3: return "等待内审领导审批";
// case 4: return "等待所有会签审批";
// case 5: return "等待备案领导审批";
// case 6: return "等待财务领导审批";
// case 7: return "等待中心领导审批";
// case 8: return "审核完成";
// case -1: return "科室领导驳回";
// case -2: return "分管领导驳回";
// case -3: return "内审领导驳回";
// case -4: return "会签驳回";
// case -5: return "备案领导驳回";
// case -6: return "财务领导驳回";
// case -7: return "中心领导驳回";
// }
// }
//}
],
url: "@Url.Action("getSqysbxPage")?have=true&ksid=@ViewBag.ksid",
pageSize: 10,
rownumbers: true,
usePager: false,
enabledEdit: true,
heightDiff: -20,
onAfterEdit: function (e) {
if (e.value > (e.record.dj - e.record.yyje)) {
$.ligerDialog.error("超出剩余金额!");
liger.get("maingrid").updateCell("syje", (e.record.dj - e.record.yyje), e.rowindex);
}
}
});
});
</script>
}