ComplianceServer/oldcode/Core.Web/Views/HGManager/HG.cshtml

115 lines
4.1 KiB
Plaintext

@{
ViewBag.Title = "Audit";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using CRM.Core.Model.Map
<style>
.mnas li {
margin-top: 5px;
}
.layui-input-block {
margin-left: 20px;
}
.hiddenDiv {
display: none;
}
</style>
<div class="x-body">
<div class="layui-form">
@{
var hgtype = ViewBag.HgType as List<Hg_Type>;
}
<table class="layui-table">
<tbody>
<tr>
<td>已选ID</td>
<td>@ViewBag.ids</td>
</tr>
<tr>
<td>大类</td>
<td>
<select name="hgtype" id="hgtype" lay-filter="hgtype">
@foreach (var item in hgtype)
{
<option value="@item.name">@item.title</option>
}
</select>
</td>
</tr>
<tr>
<td>小类:</td>
<td class="allHGtype">
@{ int i = 0; }
@foreach (var item in hgtype)
{
<div class="allHGtypeCl" id="hgtypediv_@item.name">
<select name="hgtype" id="hgtype_@item.name">
@foreach (var citem in item.detail)
{
<option value="@citem.name" bigtype="@item.name">@citem.title</option>
}
</select>
</div>
i++;
}
</td>
</tr>
<tr>
<td>违规细则:</td>
<td><textarea class="layui-textarea" name="hgdetail" id="hgdetail"></textarea></td>
</tr>
<tr>
<td>处理结果:</td>
<td><textarea class="layui-textarea" name="hgresult" id="hgresult"></textarea></td>
</tr>
</tbody>
</table>
<button class="layui-btn" id="save">确定</button>
<button class="layui-btn layui-bg-orange" id="reject" onclick="parent.Closed();">取消</button>
</div>
</div>
<script>
$(function () {
ShowSelect();
layui.use(['layer', 'form'], function () {
var layer = layui.layer;
var form = layui.form;
$("#save").click(function () {
var hgtype = $("#hgtype").val();
$.r_post('HGSave', {
ids: "@ViewBag.ids",
hgdetail: $("#hgdetail").val(),
hgresult: $("#hgresult").val(),
hgtype: hgtype,
hgsubtype: $("#hgtype_" + hgtype).val(),
msgtype:'@ViewBag.MsgType'
}, function (result) {
if (result.result) {
layer.msg('操作成功!', { icon: 1 }, function () {
parent.layer.closeAll();
parent.$(".layui-laypage-refresh")[0].click();
});
//layer.msg('操作成功!', { icon: 1 }, function () { window.location.reload();});
} else {
layer.msg('操作失败!' + result.retmsg, { icon: 2 });
}
});
});
form.on('select(hgtype)', function (data) {
//alert(data.value);
ShowSelect();
//form.render('select');
});
});
});
function ShowSelect() {
var bighgtype = $("#hgtype").val();
console.log($(".allHGtype .allHGtypeCl").not("#hgtypediv_" + bighgtype));
$(".hiddenDiv").removeClass("hiddenDiv");
$(".allHGtype .allHGtypeCl").not("#hgtypediv_" + bighgtype).addClass("hiddenDiv");
}
</script>