190 lines
7.4 KiB
Plaintext
190 lines
7.4 KiB
Plaintext
@{ViewBag.Title = "条码与体检项目关系维护"; }
|
|
@model dccdc.Models.DictionariesViewModel.BarCodeProjectMaintain
|
|
<div class="l-clear"></div>
|
|
<div id="maingrid">
|
|
<div id="layout" style="margin-left: 8px;">
|
|
<div position="top">
|
|
</div>
|
|
<div position="left" title="条码">
|
|
<div id="barcode">
|
|
</div>
|
|
</div>
|
|
<div position="center" title="已选">
|
|
|
|
<div id="project">
|
|
</div>
|
|
</div>
|
|
<div position="right" title="未选">
|
|
<div>
|
|
<input id="wx" type="text" style="width:160px" class="l-text" /><a href="javascript:wxcx()" class="l-button" style="margin-left:5px;width:60px" >查询</a>
|
|
</div>
|
|
<div id="otherproject">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div style="display:none;">
|
|
</div>
|
|
|
|
@section scripts{
|
|
|
|
<script type="text/javascript">
|
|
var openf;
|
|
|
|
function wxcx()
|
|
{
|
|
debugger;
|
|
var result = liger.get("project").get("data");
|
|
var data = [];
|
|
for (var i = 0; i < result.Rows.length; i++) {
|
|
data.push(result.Rows[i].exam_project_maintain_id);
|
|
}
|
|
$.ajax({
|
|
type: "post", cache: "false", async: true, dataType: "json",
|
|
url: "@Url.Action("TjwxxmResult")",
|
|
data: { data: data,cxtj:$("#wx").val() },
|
|
success: function (result) {
|
|
|
|
liger.get("otherproject").changePage("first");
|
|
liger.get("otherproject").options.data = result;
|
|
liger.get("otherproject").reload();
|
|
},
|
|
error: function (msg) {
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
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;
|
|
}
|
|
openf= $.ligerDialog.open({
|
|
url: "@Url.Action("EditBCPM")?id=" + id,
|
|
title: item.text,
|
|
width: 380,
|
|
height: 200
|
|
});
|
|
}
|
|
function init() {
|
|
liger.get("maingrid").reload();
|
|
openf.close();
|
|
}
|
|
function getproject(rowdata) {
|
|
$.ajax({
|
|
type: "post", cache: "false", async: true, dataType: "json",
|
|
url: "@Url.Action("GetTjBCPMResultAll")?id=" + rowdata.id,
|
|
success: function (result) {
|
|
var data = [];
|
|
for (var i = 0; i < result.Rows.length; i++) {
|
|
data.push(result.Rows[i].exam_project_maintain_id);
|
|
}
|
|
$.ajax({
|
|
type: "post", cache: "false", async: true, dataType: "json",
|
|
url: "@Url.Action("TjwxxmResult")",
|
|
data: { data: data },
|
|
success: function (result) {
|
|
|
|
liger.get("otherproject").changePage("first");
|
|
liger.get("otherproject").options.data = result;
|
|
liger.get("otherproject").reload();
|
|
},
|
|
error: function (msg) {
|
|
return;
|
|
}
|
|
});
|
|
liger.get("project").changePage("first");
|
|
liger.get("project").options.data = result;
|
|
liger.get("project").reload();
|
|
|
|
},
|
|
error: function (msg) {
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
$(function() {
|
|
$("#layout").ligerLayout({ leftWidth: '25%', topHeight: 1, centerWidth: '25%',rightWidth:'25%' });
|
|
$("#barcode").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: 'ID', name: 'id', align: 'left', width: 100 },
|
|
{ display: '条码名称', name: 'code_name', align: 'left', width: 160}
|
|
], onSelectRow: function (rowdata, rowid, rowobj) {
|
|
getproject(rowdata);
|
|
},
|
|
url: "@Url.Action("GetBCMResultAll")",
|
|
usePager:false
|
|
});
|
|
|
|
$("#project").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: '项目ID', name: 'project_code', minWidth: 140 },
|
|
{ display: '项目名称', name: 'project', minWidth: 120 }
|
|
], onDblClickRow: function (data, rowindex, rowobj) {
|
|
var barcode = liger.get("barcode").getSelectedRow();
|
|
var barprojectdata = { "code_name": barcode.code_name, "bar_code_maintain_id": barcode.id, "project": data.project, "exam_project_maintain_id": data.project_code, "project_code": data.project_code };
|
|
|
|
$.ajax({
|
|
type: "post", cache: "false", async: true, dataType: "json",
|
|
url: "@Url.Action("delBarCodeProjectMaintain")",
|
|
data: barprojectdata ,
|
|
success: function (result) {
|
|
|
|
var bardata = liger.get("barcode").getSelectedRow();
|
|
getproject(bardata);
|
|
$.ligerDialog.closeWaitting();
|
|
},
|
|
error: function (msg) {
|
|
return;
|
|
}, beforeSend: function () {
|
|
$.ligerDialog.waitting("正在删除请稍后……");
|
|
}
|
|
});
|
|
}
|
|
});
|
|
$("#otherproject").ligerGrid({
|
|
height: '100%',
|
|
columns: [
|
|
{ display: '项目ID', name: 'project_id', minWidth: 140 },
|
|
{ display: '项目名称', name: 'project_name', minWidth: 120 }
|
|
], onDblClickRow: function (data, rowindex, rowobj) {
|
|
var barcode = liger.get("barcode").getSelectedRow();
|
|
var barprojectdata = { "code_name": barcode.code_name, "bar_code_maintain_id": barcode.id, "project": data.project_name, "exam_project_maintain_id": data.project_id, "project_code": data.project_id };
|
|
$.ajax({
|
|
type: "post", cache: "false", async: true, dataType: "json",
|
|
url: "@Url.Action("addBarCodeProjectMaintain")",
|
|
data: barprojectdata ,
|
|
success: function (result) {
|
|
|
|
var bardata = liger.get("barcode").getSelectedRow();
|
|
getproject(bardata);
|
|
$.ligerDialog.closeWaitting();
|
|
},
|
|
error: function (msg) {
|
|
return;
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在保存请稍后……");
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
});
|
|
</script>
|
|
}
|
|
|
|
|
|
|
|
|