477 lines
21 KiB
Plaintext
477 lines
21 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "疫苗登记";
|
|
}
|
|
|
|
@section scripts{
|
|
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
|
<script type="text/javascript">
|
|
var diag;
|
|
var jdbm = 0;
|
|
function closesq() {
|
|
diag.close();
|
|
}
|
|
function searchdjxx(e, o) {
|
|
var keynum
|
|
var keychar
|
|
var numcheck
|
|
|
|
if (window.event) // IE
|
|
{
|
|
keynum = e.keyCode
|
|
}
|
|
else if (e.which) // Netscape/Firefox/Opera
|
|
{
|
|
keynum = e.which
|
|
}
|
|
if (keynum == 13) {
|
|
@*
|
|
var num = $(o).val();
|
|
$.ajax({
|
|
type: "post",
|
|
url: "@Url.Action("getJZMYTM")?id=" + $("#jfdw").val(),
|
|
dataType: "json"
|
|
, success: function (data) {
|
|
|
|
if (data.obj != "") {
|
|
$("#idusername").val(data.obj.username);
|
|
//$("#idusername").attr('disabled', true);
|
|
flag = true;
|
|
if (data.obj.jdid == "") {
|
|
|
|
openf = $.ligerDialog.open({
|
|
title: "修改接种免疫条码",
|
|
url: "@Url.Action("JZMYTMView", "Dictionaries")?id=" + data.obj.id + "|2",
|
|
width: 600,
|
|
height: 400
|
|
});
|
|
}
|
|
else {
|
|
chooseComplete(data.obj.id, 2);
|
|
}
|
|
} else {
|
|
//$("#idusername").attr('disabled', false);
|
|
flag = false;
|
|
}
|
|
$("#idusername").focus();
|
|
},
|
|
error: function (err) {
|
|
$.ligerDialog.error(err.responseText);
|
|
}
|
|
});*@
|
|
var num = $(o).val();
|
|
$.ajax({
|
|
type: "post",
|
|
url: "@Url.Action("getJZMYTM")?id=" + $("#jfdw").val(),
|
|
dataType: "json"
|
|
, success: function (data) {
|
|
if (data.obj != "") {
|
|
$("#idusername").val(data.obj.username);
|
|
//$("#idusername").attr('disabled', true);
|
|
flag = true;
|
|
if (data.obj.jdid == "") {
|
|
if ('@dccdc.Common.Global.QYYMYY' == 'true'){
|
|
openf = $.ligerDialog.open({
|
|
title: "修改接种免疫条码",
|
|
url: "@Url.Action("JZMYTMView", "Dictionaries")?id=" + data.obj.id + "|2",
|
|
width: 600,
|
|
height: 400
|
|
});
|
|
}
|
|
}
|
|
else {
|
|
if ('@dccdc.Common.Global.QYYMYY' == 'true')
|
|
chooseComplete(data.obj.barcode, 2);
|
|
}
|
|
} else {
|
|
//$("#idusername").attr('disabled', false);
|
|
flag = false;
|
|
}
|
|
$("#idusername").focus();
|
|
},
|
|
error: function (err) {
|
|
$.ligerDialog.error(err.responseText);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
$(function () {
|
|
$("#layout1").ligerLayout({ leftWidth: 360 });
|
|
$("#btSelect").click(function () {
|
|
liger.get("grid1").set("parms", { sfxm: $("#sfxm").val() });
|
|
liger.get("grid1").reload();
|
|
})
|
|
$("#sfxm").keydown(function (e) {
|
|
var curKey = e.which;
|
|
if (curKey == 13) {
|
|
liger.get("grid1").set("parms", { sfxm: $("#sfxm").val() });
|
|
liger.get("grid1").reload();
|
|
return false;
|
|
}
|
|
});
|
|
$("#ssje").keydown(function (e) {
|
|
var curKey = e.which;
|
|
if (curKey == 13) {
|
|
$("#zlje").val($("#ssje").val() - $("#ysje").val())
|
|
return false;
|
|
}
|
|
});
|
|
|
|
$("#grid1").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: 'id', name: 'id', align: 'left', width: 40 },
|
|
{ display: '疫苗名称', name: 'name', align: 'left', width: 250 },
|
|
],
|
|
url: "@Url.Action("getSFXMData")",
|
|
pageSize: 30,
|
|
rownumbers: true,
|
|
usePager: false,
|
|
onDblClickRow: function (rowdata, rowid, rowobj) {
|
|
liger.get("grid1").remove(rowdata);
|
|
var id = rowdata.chargeId;
|
|
$.ajax({
|
|
url: "@Url.Action("getFJX")", type: "post", dataType: "json", data: { id: id },
|
|
success: function (d) {
|
|
var total = 0;
|
|
for (var i = 0; i < d.length; i++) {
|
|
total = eval(total + "+" + d[i].fee);
|
|
}
|
|
rowdata.fee = total;
|
|
var rows = liger.get("grid2").getData();
|
|
for (var i in rows) {
|
|
if (rows[i].id == rowdata.id)
|
|
return;
|
|
}
|
|
//添加数量
|
|
if (rowdata.sl == undefined)
|
|
rowdata.sl = 1;
|
|
liger.get("grid2").add(rowdata);
|
|
//计算
|
|
sum();
|
|
},
|
|
});
|
|
}
|
|
});
|
|
|
|
$("#grid2").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: 'id', name: 'id', align: 'left', width: 40 },
|
|
{ display: '疫苗名称', name: 'name', align: 'left', width: 150 },
|
|
{ display: '单价', name: 'fee', align: 'right', width: 100, type: 'float', editor: { type: 'float' } },
|
|
{ display: '数量', name: 'sl', align: 'left', width: 100, type: 'int', editor: { type: 'int' } }
|
|
],
|
|
url: "@Url.Action("getFJX")?id=-1",
|
|
pageSize: 30,
|
|
rownumbers: true,
|
|
usePager: false,
|
|
enabledEdit: true,
|
|
onDblClickRow: function (rowdata, rowid, rowobj) {
|
|
liger.get("grid2").remove(rowdata);
|
|
//计算
|
|
sum();
|
|
|
|
var rows = liger.get("grid1").getData();
|
|
for (var i in rows) {
|
|
if (rows[i].id == rowdata.id)
|
|
return;
|
|
}
|
|
liger.get("grid1").add(rowdata);
|
|
},
|
|
onAfterEdit: function (e) {
|
|
//计算
|
|
sum();
|
|
}
|
|
});
|
|
$("#rylb").val("儿童");
|
|
});
|
|
function sum() {
|
|
var rows = liger.get("grid2").getData();
|
|
var result = 0;
|
|
for (var i in rows) {
|
|
result += rows[i].fee * rows[i].sl;
|
|
}
|
|
$("#ysje").val(result);
|
|
}
|
|
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;
|
|
}
|
|
|
|
var sfid;
|
|
function save(arg) {
|
|
var rows = liger.get("grid2").getData();
|
|
if (rows.length == 0) {
|
|
$.ligerDialog.error("请添加收费项目!");
|
|
return false;
|
|
}
|
|
var jfdw = $("#idusername").val();
|
|
var jfbm = $("#jfbm").val();
|
|
var register_num = $("#jfdw").val();
|
|
var rylb = $("#rylb").val();
|
|
var jffs = "";
|
|
var ysje = $("#ysje").val();
|
|
if (!jfdw || !jfbm || !ysje || !rylb) {
|
|
$.ligerDialog.error("请填写详细信息!");
|
|
return false;
|
|
}
|
|
if (!rylb) {
|
|
$.ligerDialog.error("请选择人员类别!");
|
|
return false;
|
|
}
|
|
var items = "";
|
|
for (var i in rows) {
|
|
items += rows[i].id + "|" + rows[i].charge_project_name + "|" + rows[i].fee + "|" + rows[i].sl + "|" + rows[i].pid + "|" + rows[i].isCharge + "|" + rows[i].chargeId + ",";
|
|
}
|
|
ertbm = $("#jfdw").val();
|
|
$.ajax({
|
|
url: "@Url.Action("opSave")", type: "post", dataType: "text", data: { jfdw: jfdw, register_num: register_num, jfbm: jfbm, jffs: jffs, ysje: ysje, items: items, jmsq: arg, jdbm: jdbm, ertbm: ertbm },
|
|
success: function (d) {
|
|
if (arg == "1") {
|
|
if (d == 0) {
|
|
$.ligerDialog.success("操作成功!");
|
|
}
|
|
else {
|
|
diag = $.ligerDialog.open({
|
|
title: "减免项目",
|
|
url: "@Url.Action("Jmsq")?chargeid=" + d,
|
|
width: 600,
|
|
height: 400
|
|
});
|
|
$.ligerDialog.closeWaitting();
|
|
}
|
|
}
|
|
$.ligerDialog.closeWaitting();
|
|
//if (d.toLocaleLowerCase() != "0") {
|
|
if (arg == "0") {
|
|
if (d != 0) {
|
|
var url = "@(Request.Url.Scheme + "://" + Request.Url.Authority + Url.Content("~/"))";
|
|
try {
|
|
if (window.top.Formium.external.Print.finit( "barcode.frx")) {
|
|
window.top.Formium.external.Print.printJFD(d);
|
|
}
|
|
}
|
|
catch (e) {
|
|
$.ligerDialog.warn(e.message);
|
|
}
|
|
if ('@dccdc.Common.Global.QYYMYY' == 'true') {
|
|
if (rylb == "儿童") {
|
|
diag = $.ligerDialog.open({
|
|
title: "预约疫苗",
|
|
url: "@Url.Action("Jmyy")?ertbm=" + ertbm,
|
|
width: 650,
|
|
height: 600
|
|
});
|
|
$.ligerDialog.closeWaitting();
|
|
|
|
}
|
|
}
|
|
$.ligerDialog.success("操作成功!");
|
|
|
|
}
|
|
//初始化
|
|
$("#jfdw").val("");
|
|
$("#idusername").val("");
|
|
$("#ysje").val("0");
|
|
$("#ssje").val("0");
|
|
$("#zlje").val("0");
|
|
liger.get("grid1").set("parms", { sfxm: $("#sfxm").val() });
|
|
liger.get("grid1").reload();
|
|
liger.get("grid2").reload();
|
|
return true;
|
|
//}
|
|
//else {
|
|
// $.ligerDialog.error("操作失败!");
|
|
//}
|
|
}
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在进行请稍后……");
|
|
}
|
|
});
|
|
}
|
|
function jmsq(arg) {
|
|
save(arg);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function chooseComplete(obj, bj) {
|
|
|
|
|
|
if (bj == 1) {
|
|
openf.close();
|
|
}
|
|
if ('@dccdc.Common.Global.QYYMYY' == 'true') {
|
|
ertbm = obj;
|
|
if (obj != undefined && obj != null) {
|
|
|
|
var id = obj;
|
|
$.ajax({
|
|
type: "post", cache: "false", async: true, dataType: "json",
|
|
data: { id: obj },
|
|
url: "@Url.Action("GetYmyyjl")",
|
|
success: function (data) {
|
|
|
|
if (data != null) {
|
|
jdbm = data.jdid + 1;
|
|
$.ajax({
|
|
url: "@Url.Action("GetYmsList")", dataType: "json", type: "post", data: { ymList: data.ymList },
|
|
success: function (data1) {
|
|
|
|
$.each(data1, function (i, item) {
|
|
|
|
liger.get("grid1").remove(item);
|
|
var id = item.chargeId;
|
|
$.ajax({
|
|
url: "@Url.Action("getFJX")", type: "post", dataType: "json", data: { id: id },
|
|
success: function (d) {
|
|
var total = 0;
|
|
for (var i = 0; i < d.length; i++) {
|
|
total = eval(total + "+" + d[i].fee);
|
|
}
|
|
item.fee = total;
|
|
var rows = liger.get("grid2").getData();
|
|
for (var i in rows) {
|
|
if (rows[i].id == item.id)
|
|
return;
|
|
}
|
|
//添加数量
|
|
if (item.sl == undefined)
|
|
item.sl = 1;
|
|
liger.get("grid2").add(item);
|
|
//计算
|
|
sum();
|
|
},
|
|
});
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
$.ajax({
|
|
url: "@Url.Action("GetJzymTmdy")", type: "post", dataType: "json", data: { id: id },
|
|
success: function (data) {
|
|
debugger;
|
|
if (data.jdid != undefined && data.jdid != null) {
|
|
jdbm = data.jdid + 1;
|
|
$.ajax({
|
|
url: "@Url.Action("GetYmjzlcList")", dataType: "json", type: "post", data: { jdid: data.jdid },
|
|
success: function (data1) {
|
|
|
|
$.each(data1, function (i, item) {
|
|
|
|
liger.get("grid1").remove(item);
|
|
var id = item.chargeId;
|
|
|
|
$.ajax({
|
|
url: "@Url.Action("getFJX")", type: "post", dataType: "json", data: { id: id },
|
|
success: function (d) {
|
|
|
|
var total = 0;
|
|
for (var i = 0; i < d.length; i++) {
|
|
total = eval(total + "+" + d[i].fee);
|
|
}
|
|
item.fee = total;
|
|
var rows = liger.get("grid2").getData();
|
|
for (var i in rows) {
|
|
if (rows[i].id == item.id)
|
|
return;
|
|
}
|
|
//添加数量
|
|
if (item.sl == undefined)
|
|
item.sl = 1;
|
|
liger.get("grid2").add(item);
|
|
//计算
|
|
sum();
|
|
},
|
|
});
|
|
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
$.ligerDialog.open({
|
|
title: "修改接种免疫条码",
|
|
url: "@Url.Action("JZMYTMView")?id=" + data.id + "|2",
|
|
width: 600,
|
|
height: 400
|
|
});
|
|
}
|
|
}, error: function (msg) {
|
|
$.ligerDialog.alert(msg);
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
},
|
|
error: function (msg) {
|
|
$.ligerDialog.alert(msg);
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
}
|
|
|
|
<div class="l-clear"></div>
|
|
<div id="layout1">
|
|
<div position="left">
|
|
<table class="t1" style="width: 100%">
|
|
<tr>
|
|
<td class="ltd" width="100px">疫苗名称:</td>
|
|
<td class="rtd">
|
|
@Html.TextBox("sfxm", "", new { @class = "l-text" })
|
|
</td>
|
|
<td class="rtd">
|
|
<input type="button" id="btSelect" value="查询" class="l-button" />
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div id="grid1"></div>
|
|
</div>
|
|
<div position="center" title="疫苗(双击增删)">
|
|
<div id="grid2"></div>
|
|
</div>
|
|
<div position="top">
|
|
<table class="t1" style="width:100%">
|
|
<tr>
|
|
<td width="70" class="ltd">人员类别</td>
|
|
<td width="100" class="rtd">@Html.DropDownList("rylb", ViewBag.rylb as SelectList, "----请选择----")</td>
|
|
<td width="70" class="ltd">编码</td>
|
|
<td width="150" class="rtd">@Html.TextBox("jfdw", "", new { @class = "l-text", @onkeydown = "searchdjxx(event,this)" })</td>
|
|
<td width="70" class="ltd">人员类别</td>
|
|
<td width="100" class="rtd">@Html.DropDownList("rylb", ViewBag.rylb as SelectList, "----请选择----")</td>
|
|
<td width="70" class="ltd">姓名</td>
|
|
<td width="150" class="rtd"><input id="idusername" class="l-text" name="username" /></td>
|
|
<td width="70" class="ltd">缴费部门</td>
|
|
<td width="100" class="rtd">@Html.DropDownList("jfbm", ViewBag.jfbmD as SelectList, "----请选择----")</td>
|
|
<td width="70" class="ltd">应收金额</td>
|
|
<td width="150" class="rtd">@Html.TextBox("ysje", "0", new { @class = "l-text l-text-field-number", @type = "number", @readonly = "readonly" })</td>
|
|
<td width="100" class="rtd" rowspan="2"><input type="button" value="登记" onclick='save("0")' class="l-button" />@* <input type="button" value="申请减免" onclick='save("1")' class="l-button" />*@</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div style="display:none;"></div>
|
|
<div class="dispReport">
|
|
<object classid="clsid:F6A015E2-092A-4006-93DA-4CBDE3AFF4B8" id="window.top.Formium.external.Print" width="300" height="50"></object>
|
|
</div>
|
|
|
|
|