197 lines
7.6 KiB
Plaintext
197 lines
7.6 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_name" class="l-text" /></td>
|
|
<td class="ltd" style="width:100px">疫苗名称:</td>
|
|
<td class="rtd" style="width:120px">
|
|
<select id="s_type" name="s_type">
|
|
<option value=""></option>
|
|
<option value="一类疫苗">一类疫苗</option>
|
|
<option value="二类疫苗">二类疫苗</option>
|
|
</select>
|
|
</td>
|
|
<td class="rtd"><div id="search">查询</div></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="vaccineList">
|
|
|
|
</div>
|
|
<div id="vaccineModify" 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="name" class="l-text" name="name" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd" width="100px">生产厂商:</td>
|
|
<td class="rtd"><input id="firm" class="l-text" name="firm" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd" width="100px">规格:</td>
|
|
<td class="rtd"><input id="spec" class="l-text" name="spec" /></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">疫苗类型:</td>
|
|
<td class="rtd">
|
|
<select id="type" name="type">
|
|
<option value="一类疫苗">一类疫苗</option>
|
|
<option value="二类疫苗">二类疫苗</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">是否收费:</td>
|
|
<td class="rtd">
|
|
<select id="isCharge" name="isCharge">
|
|
<option value="是">是</option>
|
|
<option value="否">否</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">是否启用:</td>
|
|
<td class="rtd">
|
|
<select id="status" name="status">
|
|
<option value="是">是</option>
|
|
<option value="否">否</option>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd">收费项目:</td>
|
|
<td class="rtd"><input id="chargeId" class="l-text" name="chargeId" /></td>
|
|
<td class="rtd"><div id="getCharge">选择</div></td>
|
|
</tr>
|
|
</table>
|
|
</form>
|
|
</div>
|
|
@section scripts{
|
|
<script type="text/javascript">
|
|
var dia;
|
|
function selectedQY(data) {
|
|
$("#chargeId").val(data.id);
|
|
dia.close();
|
|
}
|
|
$(function () {
|
|
$("#search").ligerButton({
|
|
click: function () {
|
|
liger.get("vaccineList").set("parms", { name: $("#s_name").val(),type:$("#s_type").val() });
|
|
liger.get("vaccineList").changePage("first");
|
|
liger.get("vaccineList").reload();
|
|
}
|
|
});
|
|
$("#getCharge").ligerButton({
|
|
click: function () {
|
|
dia = $.ligerDialog.open({
|
|
title: "选择疫苗",
|
|
url: "@Url.Action("SelectChargeProjectV", "Common")",
|
|
width: 811,
|
|
height: 422
|
|
});
|
|
}
|
|
});
|
|
$("#vaccineList").ligerGrid({
|
|
url: "@Url.Action("getvaccineList")",
|
|
toolbar: {
|
|
items: [
|
|
{
|
|
text: '添加', click: itemclick, icon: 'add'
|
|
},
|
|
{ line: true },
|
|
{ text: '修改', click: itemclick, icon: "edit" },
|
|
|
|
]
|
|
},
|
|
title: "疫苗维护列表",
|
|
parms: { name: $("#s_name").val(),type:$("#s_type").val() },
|
|
columns: [
|
|
{ name: "id", display: "编码", width: 60, align: "left", },
|
|
{ name: "name", display: "疫苗名称", width: 180, align: "left" },
|
|
{ name: "firm", display: "生产厂家", width: 80, align: "left" }
|
|
, { name: "spec", display: "规格", width: 82, align: "left" }
|
|
, { name: "type", display: "疫苗类型", width: 82, align: "left" }
|
|
, { name: "isCharge", display: "是否收费", width: 82, align: "left" }
|
|
, { name: "status", display: "是否启用", width: 82, align: "left" }
|
|
], width: "98%",
|
|
height: "100%",
|
|
rownumbers: true,
|
|
usePager: true,
|
|
heightDiff: -20
|
|
});
|
|
|
|
});
|
|
function itemclick(item) {
|
|
if (item.text == "添加") {
|
|
$("#name").val("");
|
|
$("#firm").val("");
|
|
$("#spec").val("");
|
|
$("#chargeId").val("");
|
|
$("#id").val("0");
|
|
$.ligerDialog.open({
|
|
title: "添加疫苗", target: $("#vaccineModify"), width: 418, height: 300, buttons: [{
|
|
text: "确定", onclick: function (item, dialg) {
|
|
f_save(dialg);
|
|
|
|
}
|
|
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
|
|
});
|
|
}
|
|
else if (item.text == "修改") {
|
|
var r = liger.get("vaccineList").getSelectedRow();
|
|
if (!r) {
|
|
$.ligerDialog.alert("请选择要修改的数据!");
|
|
return;
|
|
}
|
|
$("#id").val(r.id);
|
|
$("#name").val(r.name);
|
|
$("#firm").val(r.firm);
|
|
$("#spec").val(r.spec);
|
|
$("#type").val(r.type);
|
|
$("#status").val(r.status);
|
|
$("#chargeId").val(r.chargeId);
|
|
$("#isCharge").val(r.isCharge);
|
|
$.ligerDialog.open({
|
|
title: "修改疫苗", target: $("#vaccineModify"), width: 418, height: 300, buttons: [{
|
|
text: "确定", onclick: function (item, dialg) {
|
|
f_save(dialg);
|
|
|
|
}
|
|
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
|
|
});
|
|
}
|
|
}
|
|
function f_save(dialg) {
|
|
if (!$("#name").val()) {
|
|
$.ligerDialog.alert("疫苗名称不能为空!");
|
|
return;
|
|
}
|
|
var data = $("#editform").serializeArray();
|
|
$.ajax(
|
|
{
|
|
url: "@Url.Action("savevaccine")", type: "post", dataType: "json", data: data,
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
$.ligerDialog.alert(d.Message, function () {
|
|
if (d.State == 1) {
|
|
dialg.hidden();
|
|
liger.get("vaccineList").reload();
|
|
}
|
|
});
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
}
|
|
|