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

119 lines
5.2 KiB
Plaintext

@{
ViewBag.Title = "cgsqslQuery";
}
@section scripts{
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
<script type="text/javascript">
$(function () {
$("#start").ligerDateEditor();
$("#end").ligerDateEditor();
$("#start").ligerGetDateEditorManager().setValue(fun_date(-30));
$("#end").ligerGetDateEditorManager().setValue(fun_date(0));
cx();
})
function cx() {
var data = $("#searchForm").serializeArray();
$.ajax({
url: "@Url.Action("getCGSQSL")", data: data, type: "post", dataType: "json",
success: function (data) {
$("#grid1").ligerGrid({
height: '98%',
width: '98%',
isScroll: true,
dataAction: "local",
selectRowButtonOnly: true,
data: data.data,
columns: [
{ name: "sqksid", display: "采购部门id", width: 50, align: "left" },
{ name: "sqks", display: "采购部门", width:300, align: "left" },
{ name: "count", display: "采购单数量", width: 100, align: "left", totalSummary: { type: 'sum' } },
{ name: "cgje", display: "采购金额", width: 100, align: "right", totalSummary: { type: 'sum' } },
],
alternatingRow: false,
usePager: false,
//rownumbers: true,
detail: { onShowDetail: f_showOrder },
});
liger.get("grid1").reRender();
}
});
}
//显示明细
function f_showOrder(row, detailPanel, callback) {
var grid = document.createElement('div');
$(detailPanel).append(grid);
$(grid).css('margin', 10).ligerGrid({
columns:
[
{ display: '申请人', name: 'sqr', width: 80 },
{ display: '申请科室', name: 'sqks', width: 80 },
{ display: '申请日期', name: 'sqrq', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } },
{ display: '采购金额', name: 'cgje', width: 80 },
{
display: '状态', name: 'zt', width: 80, render: function (r, i, v) {
switch (v) {
case 0: return "等待审批";
case 1: return "部门领导已审批";
case 2: return "领导审批";
case -1: return "审批不通过";
}
}
},
{
display: '采购状态', name: 'cgzt', width: 80, render: function (r, i, v) {
switch (v) {
case 0: return "未审批";
case 1: return "采购中";
case 2: return "采购完成";
}
}
},
],
url: "@Url.Action("getCGSQSL2")?start=" + $("#start").val() + "&end=" + $("#end").val() + "&key=" + encodeURI( row.sqks),
isScroll: false,
width: '90%',
onAfterShowData: callback,
usePager: false,
});
}
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;
}
</script>
}
<form id="searchForm">
<table class="t1" style="width:100%">
<tr>
<td width="70" class="ltd">采购申请日期</td>
<td width="150" class="rtd"><input type="text" id="start" name="start"></td>
<td width="20" class="ltd">到</td>
<td width="150" class="rtd"><input type="text" id="end" name="end"></td>
<td width="70" class="ltd">申请科室</td>
<td width="150" class="rtd">@Html.TextBox("key", "", new { @class = "l-text" })</td>
<td width="100" class="rtd"><input type="button" value="查询" onclick="cx();" class="l-button" /></td>
</tr>
</table>
</form>
<div id="grid1"></div>