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

157 lines
6.3 KiB
Plaintext

@{
ViewBag.Title = "收费项目维护";
}
<div style="width:100%">
<table class="t1" style="width:100%">
<tr>
<td class="ltd" style="width:100px">收费方式名称:</td>
<td class="rtd" style="width:120px"><input id="s_method_name" class="l-text" /></td>
<td class="rtd"><div id="search">查询</div></td>
</tr>
</table>
</div>
<div id="ChargeMethodList">
</div>
<div id="ChargeMethodMaintainModify" style="display:none">
<form id="editform">
<input id="id" type="hidden" name="id" value="0" />
<table class="t1" style="width:100%">
<tr>
<td class="ltd" width="100px">收费方式名称:</td>
<td class="rtd"><input id="charge_method" class="l-text" name="charge_method" /></td>
</tr>
<tr>
<td class="ltd">状态:</td>
<td class="rtd">
<select id="is_review" name="status">
<option value="是">是</option>
<option value="否">否</option>
</select>
</td>
</tr>
</table>
</form>
</div>
@section scripts{
<script type="text/javascript">
$(function () {
$("#search").ligerButton({
click: function () {
liger.get("ChargeMethodList").set("parms", { key: $("#s_method_name").val() });
liger.get("ChargeMethodList").changePage("first");
liger.get("ChargeMethodList").reload();
}
});
$("#ChargeMethodList").ligerGrid({
url: "@Url.Action("getChargeMethodMaintainist")",
toolbar: {
items: [
{
text: '添加', click: itemclick, icon: 'add'
},
{ line: true },
{ text: '修改', click: itemclick, icon: "edit" },
{ line: true },
{ text: '删除', click: itemclick, icon: 'delete' }
]
},
title: "收费方式",
parms: { key: $("#s_method_name").val() },
columns: [
{ name: "id", display: "编码", width: 60, align: "left", },
{ name: "charge_method", display: "收费方式名称", width: 180, align: "left" },
{ name: "status", display: "状态", width: 80, align: "left" }
, { name: "creator", display: "创建人", width: 82, align: "left" }
, { name: "create_time", display: "创建时间", width: 82, align: "left" }
], width: "98%",
height: "100%",
rownumbers: true,
usePager: true,
heightDiff: -20
});
});
function itemclick(item) {
if (item.text == "添加") {
$("#charge_method").val("");
$("#id").val("0");
$.ligerDialog.open({
title: "添加收费方式", target: $("#ChargeMethodMaintainModify"), width: 418, height: 120, buttons: [{
text: "确定", onclick: function (item, dialg) {
f_save(dialg);
}
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
});
}
else if (item.text == "修改") {
var r = liger.get("ChargeMethodList").getSelectedRow();
if (!r) {
$.ligerDialog.alert("请选择要修改的数据!");
return;
}
$("#charge_method").val(r.charge_method);
$("#id").val(r.id);
$("#status").val(r.status);
$.ligerDialog.open({
title: "修改收费方式", target: $("#ChargeMethodMaintainModify"), width: 418, height: 120, buttons: [{
text: "确定", onclick: function (item, dialg) {
f_save(dialg);
}
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
});
}
else if (item.text === "删除") {
var r1 = liger.get("ChargeMethodList").getSelectedRow();
if (!r1) {
$.ligerDialog.alert("请选择要删除的数据!");
return;
} else {
$.ajax({
url: "@Url.Action("delChargeMethod")", type: "post", dataType: "json", data: {id:r1.id},
success: function (d) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
liger.get("ChargeMethodList").reload();
return;
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
}
}
function f_save(dialg) {
if (!$("#charge_method").val()) {
$.ligerDialog.alert("收费方式名称不能为空!");
return;
}
var data = $("#editform").serializeArray();
$.ajax(
{
url: "@Url.Action("saveChargeMethodMaintain")", type: "post", dataType: "json", data: data,
success: function (d) {
$.ligerDialog.closeWaitting();
$.ligerDialog.alert(d.Message, function () {
if (d.State == 1) {
dialg.hidden();
liger.get("ChargeMethodList").reload();
}
});
},
beforeSend: function () {
$.ligerDialog.waitting("正在保存请稍后……");
}
});
}
</script>
}