298 lines
12 KiB
Plaintext
298 lines
12 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "cgsqdView";
|
|
}
|
|
<div style="width:100%">
|
|
<table class="t1" style="width:100%">
|
|
<tr>
|
|
<td class="ltd" style="width:120px">状态:</td>
|
|
<td class="rtd" style="width:120px">@Html.DropDownList("key", ViewData["ztlist"] as SelectList, "----请选择----")</td>
|
|
<td class="rtd"><div id="search" class="l-button">查询</div></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="maingrid"></div>
|
|
|
|
@section scripts{
|
|
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
|
<script type="text/javascript">
|
|
var openf;
|
|
function edit(item) {
|
|
var id;
|
|
if (item.text === "增加") {
|
|
id = "";
|
|
}
|
|
else if (item.text === "修改") {
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
|
|
if (r.zt != "0") {
|
|
$.ligerDialog.alert("只有未审核状态才能操作!");
|
|
return;
|
|
}
|
|
if (r.sqrid != "@ViewData["userid"].ToString()") {
|
|
$.ligerDialog.alert("只有本人才能操作!");
|
|
return;
|
|
}
|
|
}
|
|
openf = $.ligerDialog.open({
|
|
url: "@Url.Action("cgsqdMessage")?type=button&id=" + id,
|
|
title: item.text,
|
|
width: 900,
|
|
height: 600
|
|
});
|
|
}
|
|
function view(item) {
|
|
var id;
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
|
|
openf = $.ligerDialog.open({
|
|
url: "@Url.Action("cgsqdMessage")?type=hidden&id=" + id,
|
|
title: item.text,
|
|
width: 900,
|
|
height: 600
|
|
});
|
|
}
|
|
function del(item) {
|
|
var id;
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
|
|
if (r.zt != "0") {
|
|
$.ligerDialog.alert("只有未审核状态才能操作!");
|
|
return;
|
|
}
|
|
if (r.sqrid != "@ViewData["userid"].ToString()") {
|
|
$.ligerDialog.alert("只有本人才能操作!");
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: "@Url.Action("delete")", type: "post", dataType: "json", data: { id: id },
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
liger.get("maingrid").reload();
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
function check(item) {
|
|
var id;
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
var zt = 0;
|
|
if (item.text === "部门审核") {
|
|
if (r.zt != "0") {
|
|
$.ligerDialog.alert("只有未审核状态才能操作!");
|
|
return;
|
|
}
|
|
if ("@ViewData["level"].ToString()" != "1") {
|
|
$.ligerDialog.alert("只有部门领导才能操作!");
|
|
return;
|
|
}
|
|
zt = 1;
|
|
}
|
|
else {
|
|
if (r.zt != "1") {
|
|
$.ligerDialog.alert("只有部门审核后才能操作!");
|
|
return;
|
|
}
|
|
if ("@ViewData["level"].ToString()" != "2") {
|
|
$.ligerDialog.alert("只有单位领导才能操作!");
|
|
return;
|
|
}
|
|
zt = 2;
|
|
}
|
|
$.ajax({
|
|
url: "@Url.Action("check")", type: "post", dataType: "json", data: { id: id, zt: zt },
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
liger.get("maingrid").reload();
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
function checkNo(item) {
|
|
var id;
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
|
|
if (r.zt != "0" && r.zt != 1) {
|
|
$.ligerDialog.alert("只有未审核与部门审核才能操作!");
|
|
return;
|
|
}
|
|
if ("@ViewData["level"].ToString()" != "1" && "@ViewData["level"].ToString()" != "2") {
|
|
$.ligerDialog.alert("只有部门领导与单位领导才能操作!");
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: "@Url.Action("check")", type: "post", dataType: "json", data: { id: id, zt: "-1" },
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
liger.get("maingrid").reload();
|
|
return;
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
|
|
}
|
|
function store(item) {
|
|
$.ligerDialog.alert("请通过入库单入库!");
|
|
return;
|
|
|
|
var id;
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
id = r.id;
|
|
if (r.zt != "2") {
|
|
$.ligerDialog.alert("只有单位审核后才能操作!");
|
|
return;
|
|
}
|
|
openf = $.ligerDialog.open({
|
|
url: "@Url.Action("rkdMessage")?type=button&id=" + id,
|
|
title: item.text,
|
|
width: 900,
|
|
height: 600
|
|
});
|
|
}
|
|
function init() {
|
|
liger.get("maingrid").reload();
|
|
openf.close();
|
|
}
|
|
$(function () {
|
|
$("#search").click(function () {
|
|
liger.get("maingrid").set("parms", { key: $("#key").val() });
|
|
liger.get("maingrid").changePage("first");
|
|
liger.get("maingrid").reload();
|
|
})
|
|
|
|
$("#maingrid").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: '编号', name: 'id', align: 'left', width: 60 },
|
|
{ display: '申请单号', name: 'sqdh', align: 'left', width: 100 },
|
|
{ display: '申请人', name: 'sqr', width: 80 },
|
|
{ display: '申请科室id', name: 'sqksid', width: 90 },
|
|
{ display: '申请科室', name: 'sqks', width: 90 },
|
|
{ display: '申请日期', name: 'sqrq', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } },
|
|
{ display: '经费来源', name: 'jfly', width: 60 },
|
|
{ display: '申请原因', name: 'sqyy', width: 80 },
|
|
{ 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: 'bmld', width: 80 },
|
|
{ display: '部门申请日期', name: 'bmshsj', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } },
|
|
{ display: '单位领导', name: 'dwld', width: 80 },
|
|
{ display: '单位申请日期', name: 'dwshsj', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } },
|
|
{ display: '操作日期', name: 'czsj', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } },
|
|
{
|
|
display: '采购状态', name: 'cgzt', width: 80, render: function (r, i, v) {
|
|
switch (v) {
|
|
case 0: return "未审批";
|
|
case 1: return "采购中";
|
|
case 2: return "采购完成";
|
|
}
|
|
}
|
|
},
|
|
],
|
|
url: "@Url.Action("getcgsqdPage")",
|
|
pageSize: 10,
|
|
rownumbers: true,
|
|
usePager: true,
|
|
heightDiff: -20,
|
|
toolbar: {
|
|
items: [
|
|
{ text: '增加', click: edit, icon: 'add' },
|
|
{ line: true },
|
|
{ text: '查看', click: view, icon: 'view' },
|
|
{ line: true },
|
|
{ text: '修改', click: edit, icon: 'modify' },
|
|
{ line: true },
|
|
{ text: '删除', click: del, icon: 'delete' },
|
|
{ line: true },
|
|
{ text: '部门审核', click: check, icon: 'ok' },
|
|
{ line: true },
|
|
{ text: '单位审核', click: check, icon: 'ok' },
|
|
{ line: true },
|
|
{ text: '审核不通过', click: checkNo, icon: 'prev' },
|
|
{ line: true },
|
|
{
|
|
text: '打印采购单', icon: 'plus', click: function () {
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
var url = "@(Request.Url.Scheme + "://" + Request.Url.Authority + Url.Content("~/"))";
|
|
if (window.top.Formium.external.Print.finit( "cgsqd.frx")) {
|
|
window.top.Formium.external.Print.PrintCGSQD(r.sqdh, "打印");
|
|
}
|
|
}
|
|
},
|
|
{ line: true },
|
|
{ text: '入库', click: store, icon: 'plus' }
|
|
]
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
}
|
|
|
|
|
|
|
|
<div class="dispReport">
|
|
<object classid="clsid:F6A015E2-092A-4006-93DA-4CBDE3AFF4B8" id="window.top.Formium.external.Print" width="300" height="50"></object>
|
|
</div>
|
|
<div style="display:none;"></div>
|