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

407 lines
19 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@using dccdc.Models;
@{
ViewBag.Title = "核酸检测登记列表";
}
<form id="search">
<table class="t1" >
<tr>
<td class="ltd" style="width:100px;">姓名:</td>
<td class="rtd" style="width:140px"><input id="xm" type="text" style="width:140px" class="l-text" name="xm" /></td>
<td class="ltd" style="width:100px">登记日期:</td>
<td class="rtd" style="width:160px"><input id="yyrq" name="yyrq" type="text" /></td>
<td class="ltd" style="width:120px">所属街道:</td>
<td class="rtd" style="width:200px">
<select id="ssjd" style="width:180px">
<option value="" selected="selected">全部</option>
<option value="新湖办事处">新湖办事处</option>
<option value="新华办事处">新华办事处</option>
<option value="广川办事处">广川办事处</option>
<option value="天衢办事处">天衢办事处</option>
<option value="运河办事处">运河办事处</option>
<option value="二屯办事处">二屯办事处</option>
<option value="黄河崖办事处">黄河崖办事处</option>
<option value="其他">其他</option>
</select>
</td>
</tr>
<tr>
<td class="ltd">样管条码:</td>
<td class="rtd"><input id="cygtm" type="text" style="width:140px" class="l-text" name="cygtm" /></td>
<td class="ltd">人员类型:</td>
<td class="rtd">
<select id="rylx" name="rylx">
<option value="" selected="selected">全部</option>
@foreach (var lx in (ViewBag.rylxs as List<xg_rylx>))
{
<option value="@lx.id">@lx.flmc</option>
}
</select>
</td>
<td class="rtd"><input id="cx" type="button" class="l-button" value="查询" /></td>
<td class="rtd" colspan="3"><input id="dc" type="button" class="l-button" value="导出" /></td>
</tr>
</table>
</form>
<div id="yyList"></div>
<div id="xgyyrqdiv" style="display:none">
<table class="t1" style="width:450px">
<tr>
<td class="ltd" style="width:100px">姓名:</td>
<td class="rtd" style="width:120px">
<input id="f_xm" class="l-text" style="width:110px" />
</td>
<td class="ltd" style="width:100px">手机号:</td>
<td class="rtd" style="width:120px">
<input id="f_sjh" class="l-text" style="width:110px" />
</td>
</tr>
<tr>
<td class="ltd" style="width:100px">身份证号:</td>
<td class="rtd" colspan="2">
<input id="f_sfzh" class="l-text" style="width:160px" />
</td>
<td class="rtd">
<input type="button" id="dk" value="读卡" class="l-button" />
</td>
</tr>
<tr>
<td class="ltd">检查样品:</td>
<td class="rtd" colspan="3">
<div style="float:left;width:80px"><input type="checkbox" name="yplx" value="1" checked="checked" />咽拭子</div>
<div style="float:left;width:80px"><input type="checkbox" name="yplx" value="2" />肛拭子</div>
<div style="float:left;width:100px"><input type="checkbox" name="yplx" value="3" />血清抗体</div>
</td>
</tr>
</table>
</div>
<div style="display:none">
<iframe id="if_dc" src="about:blank"></iframe>
<div class="dispReport">
<object classid="clsid:F6A015E2-092A-4006-93DA-4CBDE3AFF4B8" id="window.top.Formium.external.Print" width="300" height="50"></object>
<object id="CardReader1" classid="clsid:F225795B-A882-4FBA-934C-805E1B2FBD1B" style="background: #F5F7FF;"></object>
</div>
</div>
@section scripts{
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
<script>
var isInit = false;
function printTM(arg) {
var url = "@(Request.Url.Scheme + "://" + Request.Url.Authority + Url.Content("~/"))";
try {
if (window.top.Formium.external.Print.finit( "xgtm.frx")) {
window.top.Formium.external.Print.PrintXgtm(arg);
}
} catch (e) {
$.ligerDialog.error("打印条码出错:" + e.message);
}
}
var isInit = false;
function readCard() {
////debugger
var obj = document.getElementById("CardReader1");
//var form1=byId("formCard");
if (false == isInit) {
//设置端口号1表示串口12表示串口2依此类推1001表示USB。0表示自动选择
obj.setPortNum(0);
isInit = true;
}
//使用重复读卡功能
obj.Flag = 0;
//设置照片保存路径,照片文件名:(身份证号).bmp。默认路径为系统临时目录,照片文件名image.bmp
//obj.PhotoPath=form1.photoPath.value;
//读卡
var rst = obj.ReadCard();
//获取各项信息
if (0x90 == rst) {
//form1.person_name.value = obj.NameL();//姓名
//form1.sex.value = obj.SexL();//性别
//var birthsd = obj.BornL();//出生日期
//document.getElementById("birth").value=birthsd.substring(0,4)+"-"+birthsd.substring(5,7)+"-"+birthsd.substring(8,10);
//form1.card_number.value =obj.CardNo();//身份证号码
//form1.photoshop.value =obj.GetImage();//BASE64码
//var dates = document.getElementById("register_date").value;
//var chushen = document.getElementById("birth").value;//出生日期
//var strnum = chushen.substring(0,4)+chushen.substring(5,7)+chushen.substring(8,10);
//var dengji = document.getElementById("register_date").value;//登记日期
//var djtime = dengji.substring(0,4)+dengji.substring(5,7)+dengji.substring(8,10);
// 计算年龄:
//var age = getAgeByBrithday(birthsd.substring(0, 4), birthsd.substring(5, 7), birthsd.substring(8, 10));
//document.getElementById("person_age").value = age;// 年龄
//var photoshopd = document.getElementById("photoshop").value;
//shuipho("data:image/jpeg;base64," + obj.GetImage());
//$("#jtzz").val(obj.Address()); //住址
$("#f_xm").val(obj.NameL());
$("#f_sfzh").val(obj.CardNo());
//$("#cardnumber").trigger("blur");
$.ajax("@Url.Action("getyyxx")", {
type: "post", dataType: "json", data: { sfzh: $("#f_sfzh").val() }, success: function (data) {
$.ligerDialog.closeWaitting();
$("#f_sjh").val(data.sjh);
$('input[name="yplx"][value="1"]').prop("checked", false);
$('input[name="yplx"][value="2"]').prop("checked", false);
$('input[name="yplx"][value="3"]').prop("checked", false);
if (data.yymx.length > 0) {
for (var h = 0; h < data.yymx.length;h++)
$('input[name="yplx"][value="'+data.yymx[h].xmid+'"]').prop("checked", true);
}
},
beforeSend: function () {
$.ligerDialog.waitting("正在获取预约信息……");
}
});
}
//读完卡后,将焦点放在电话上
$("#f_sjh").focus();
}
$(function () {
$("#dk").bind("click", readCard);
$("#xgyyrq").ligerDateEditor({ width: 140 });
$("#yyrq").ligerDateEditor({ width: 140 });
$("#cx").bind("click", function () {
liger.get("yyList").set("parms", {
xm: $("#xm").val(),
cygtm: $("#cygtm").val(),
yyrq: $("#yyrq").val(),
jd: $("#ssjd").val(),
ryfl: $("#rylx").val()
});
liger.get("yyList").reload();
});
$("#dc").bind("click", function () {
$.ajax("@Url.Action("export")", {
data: {
xm: $("#xm").val(),
cygtm: $("#cygtm").val(),
yyrq: $("#yyrq").val(),
jd: $("#ssjd").val(),
ryfl: $("#rylx").val()
}, type: "post", dataType: "json", beforeSend: function () {
$.ligerDialog.waitting("正在导出请稍后……");
},
success: function (d) {
$.ligerDialog.closeWaitting();
if (d.state == 1)
$("#if_dc").attr("src", d.msg);
else
$.ligerDialog.alert(d.msg);
}
});
liger.get("yyList").reload();
});
$("#yyList").ligerGrid({
pageSizeOptions: [10, 20, 30, 40, 50,500],
parms: {}, url: "@Url.Action("getdjList")",
columns: [
{ name: "xlh", display: "采样管条码", width: 150, align: "left" },
{ name: "bgbh", display: "报告编码", width: 100, align: "left" },
{ name: "xm", display: "姓名", width: 80, align: "left" },
{
name: "sfzh", display: "身份证号", width: 160, align: "left"
},
{ name: "jcrq", display: "登记日期", width: 100, align: "left" }
, { name: "sjh", display: "联系电话", width: 100, align: "left" }
, { name: "ypmc", display: "样本名称", width: 100, align: "left" }
, {
name: "bgzt", display: "报告状态", width: 80, render: function (r, i, v) {
if (v == 0) {
return "未报告";
}
else {
return "已报告";
}
}
},
{
name: "del", display: "删除", width: 80, render: function (r, i, v) {
return "<input type='button' onclick=\"djDel('" + r.xm + "','" + r.id + "')\" class='l-button' value='删除'/>";
}
}
], width: "98%",
height: "100%",
rownumbers: true,
usePager: true,
heightDiff: -20,
checkbox: true, onDblClickRow: function (data, rowindex, rowobj) {
if (data.bgzt == 0) {
$.ligerDialog.alert("当前样本尚未报告!");
return;
}
//liger.get("grid1").select(rowobj);
$.ligerDialog.open({
url: "@Url.Action("down")?id=" + data.id + "&guid=" + data.guid,top:10,
title: "检验报告单",
width: 800,
height: 600, buttons: [
{
text: "确定", onclick: function (item, diag) {
diag.hidden();
}
}, {
text: "取消", onclick: function (item, diag) {
diag.hidden();
}
}
]
});
},
delayLoad: true,toolbar: {
items: [
{
text: '检测登记', click: function () {
$.ligerDialog.open({
title: "核酸检测登记", target: $("#xgyyrqdiv"), width: 500, height: 150,top:100, buttons: [{
text: "确定", onclick: function (item, dialg) {
var cks = $('input[name="yplx"]:checked');
if (cks.length == 0) {
$.ligerDialog.alert("请选择检查样品");
return;
}
if (!$("#f_sfzh").val()) {
$.ligerDialog.alert("身份证号不能为空");
return;
}
if (!$("#f_sjh").val()) {
$.ligerDialog.alert("手机号不能为空");
return;
}
if (!$("#f_xm").val()) {
$.ligerDialog.alert("姓名不能为空");
return;
}
var scks = "";
for (var i = 0; i < cks.length; i++) {
scks += $(cks[i]).val()+",";
}
$.ajax({
url: "@Url.Action("xgdj")", type: "post", dataType: "json", data: {
sfzh: $("#f_sfzh").val(), xm: $("#f_xm").val(), sjh: $("#f_sjh").val(), cks: scks
},
success: function (data) {
if (data.State == 1) {
$.ligerDialog.alert("操作成功!", function () {
$('input[name="yplx"][value="1"]').prop("checked", true);
$('input[name="yplx"][value="2"]').prop("checked", false);
$('input[name="yplx"][value="3"]').prop("checked", false);
$("#f_sfzh").val("");
$("#f_xm").val("");
$("#f_sjh").val("");
//dialg.hidden();
printTM(data.id);
liger.get("yyList").reload();
});
}
else {
$.ligerDialog.alert(data.Message);
}
}
});
}
}, { text: "取消", onclick: function (item, dialg) { dialg.hidden(); } }]
});
}, icon: 'edit'
},{
text: '补打条码', click: function () {
var r = liger.get("yyList").getSelectedRow();
if (!r) {
$.ligerDialog.alert("请选择要修改的行!");
return;
}
printTM(r.id);
}, icon: 'print'
}, {
text: '批量上传阴性结果', click: function () {
var r = liger.get("yyList").getSelectedRows();
let ids = "";
//for (let item of r)
//{
// if (ids === "") {
// ids += item.id;
// continue;
// }
// ids+=","+item.id
//}
for (let i in r) {
if (ids === "") {
ids += r[i].id;
continue;
}
ids += "," + r[i].id
}
if (ids === "") {
$.ligerDialog.alert("请选择要上传的行!");
return;
}
$.ligerDialog.confirm("你确定要上传选中行吗!", function (confirm) {
if (confirm) {
$.ajax({
url: "@Url.Action("reportids")", type: "post", dataType: "json", data: {
ids:ids
},
success: function (data) {
if (data.State == 1) {
$.ligerDialog.alert("操作成功!", function () {
liger.get("yyList").reload();
});
}
else {
$.ligerDialog.alert(data.Message);
}
}
});
}
});
}, icon: 'edit'
}
]
}
});
});
function djDel(name,delId)
{
//console.log(name, delId);
$.ligerDialog.confirm("你确定要删除姓名为"+name+"的数据吗!", function (confirm) {
if (confirm) {
$.ajax({
url: "@Url.Action("deletedj")", type: "post", dataType: "json", data: {
id:delId
},
success: function (data) {
if (data.State == 1) {
$.ligerDialog.alert("操作成功!", function () {
liger.get("yyList").reload();
});
}
else {
$.ligerDialog.alert(data.Message);
}
}
});
}
});
}
</script>
}