154 lines
5.7 KiB
Plaintext
154 lines
5.7 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "thdView";
|
|
}
|
|
|
|
<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["gyslist"] 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.thrid != "@ViewData["userid"].ToString()") {
|
|
$.ligerDialog.alert("只有本人才能操作!");
|
|
return;
|
|
}
|
|
}
|
|
openf = $.ligerDialog.open({
|
|
url: "@Url.Action("thdMessage")?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("thdMessage")?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.thrid != "@ViewData["userid"].ToString()") {
|
|
$.ligerDialog.alert("只有本人才能操作!");
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: "@Url.Action("deleteThd")", 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 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: 'thdh', align: 'left', width: 100 },
|
|
{ display: '退货人', name: 'thr', width: 80 },
|
|
{ display: '退货日期', name: 'thsj', width: 100, render: function (r, i, v) { if (v) return formatTime(v) } },
|
|
{ display: '供应商', name: 'gys', width: 150 },
|
|
{ display: '退货金额', name: 'thje', width: 80 },
|
|
{ display: '退货原因', name: 'thyy', width: 150 },
|
|
],
|
|
url: "@Url.Action("getthdPage")",
|
|
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: del, icon: 'delete' },
|
|
{ line: true },
|
|
{
|
|
text: "打印", click: function () {
|
|
var id;
|
|
var r = liger.get("maingrid").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要打印的退货单!");
|
|
return;
|
|
}
|
|
id = r.thdh;
|
|
var url = "@(Request.Url.Scheme + "://" + Request.Url.Authority + Url.Content("~/"))";
|
|
if (window.top.Formium.external.Print.finit( "thd.frx")) {
|
|
window.top.Formium.external.Print.PrintTHD(id, "打印");
|
|
}
|
|
}, icon: 'print'
|
|
}
|
|
]
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
}
|
|
|
|
|
|
<div class="dispReport">
|
|
<object classid="clsid:F6A015E2-092A-4006-93DA-4CBDE3AFF4B8" id="window.top.Formium.external.Print" width="300" height="50"></object>
|
|
</div>
|