YNICTE/BO/Views/Shared/Partial/NCSBox.cshtml

75 lines
3.6 KiB
Plaintext
Raw Normal View History

2020-10-12 14:39:23 +09:00
@model String
<input type="hidden" id="ncsboxncstype" value="@Model.Split(';')[2]" />
<div id="ncsbox" class="findbox" style="width: 700px;">
<h4><i class="fa fa-bars"></i> @Model.Split(';')[1]<a href="#" class="btn btn-default btn-xs f-r" onclick="hidencsbox()">닫기</a></h4>
<br />
<input type="text" class="form-control search disp-init" placeholder="@(Model.Split(';')[2] == "3" ? "세분류(직무)명을" : "") 입력하세요." id="findboxncs" style="width: 250px" /><a href="#" class="btn btn-find btn-info btn-sm" onclick="findncs()">검색</a>
<br /><br />
<section class="panel panel-default" style="max-height: 300px; overflow: auto; min-height: 67px;">
<div class="table-responsive" id="excel1">
<table class="table table-striped b-t b-light" style="table-layout: fixed; white-space: nowrap;">
<thead>
<tr>
<th width="50"><input type="checkbox" onclick="javascript: checkall('excel1', this);" /></th>
<th>대분류</th>
@Html.Raw(Convert.ToInt32(Model.Split(';')[2]) > 0 ? "<th>중분류</th>" : "")
@Html.Raw(Convert.ToInt32(Model.Split(';')[2]) > 1 ? "<th>소분류</th>" : "")
@Html.Raw(Convert.ToInt32(Model.Split(';')[2]) > 2 ? "<th>세분류(직무)명</th>" : "")
</tr>
</thead>
<tbody class="data" id="ncslistbox"></tbody>
</table>
</div>
</section>
<div><a href="#" class="btn btn-primary btn-xs" onclick="selectncs()">선택</a></div>
</div>
<script>
function selectncs() {
if ($("#ncslistbox tr td input.autocheck:checked").length < 1) {
msg2("과정을 선택해주세요.");
}
else {
var v = "";
$.each($("#ncslistbox tr td input.autocheck:checked"), function (i, c) {
v += ";" + $(c).val();
});
$("#ncslistbox tr").remove();
hidencsbox();
eval("@(Model.Split(';')[0])" + "('" + v.substr(1) + "')");
}
}
function ncsboxviewregbox() {
if ($('#ncsboxregbox:visible').length < 1) {
$('#ncsboxregbox').show();
}
else {
$('#ncsboxregbox').hide();
}
}
function findncsshow() {
bglayer();
$("#ncsbox").slideDown("fast");
focus("findboxncs");
}
function findncs() {
$("#ncslistbox").html("");
//if (val("findboxncs") == "") {
// alert("이름을 입력해주세요.");
//}
capp("/acommon/ncsfind", { ncsdepth: val("ncsboxncstype"), ncsname: val("findboxncs") }, "cbfindncs", null, null, true, true);
}
function cbfindncs() {
if (capResult.code == 1000) {
$.each($(capResult.obj), function (i, r) {
$("#ncslistbox").append("<tr><td><input type=\"checkbox\" class=\"autocheck\" value=\"" + r.ncsno + ":" + r.ncsname.replace(/:/gi, '|').replace(/;/gi, '|') + ":" + r.acode + "\" /></td>" + "<td>" + r.tcode + "." + r.tname + "</td>" +
(getint('@Model.Split(';')[2]') > 0 ? ("<td>" + r.mcode + "." + r.mname + "</td>") : "") +
(getint('@Model.Split(';')[2]') > 1 ? ("<td>" + r.bcode + "." + r.bname + "</td>") : "") +
(getint('@Model.Split(';')[2]') > 2 ? ("<td>" + r.dcode + "." + r.dname + "</td>") : "") +
"</tr>");
});
}
}
function hidencsbox() {
$('#ncsbox').slideUp('fast'); $('#bglayer').hide();
}
</script>