@model DTO.ExpertTestTopicpeizhiDTO
|
@using DTO;
|
@using zhengcaioa.Models;
|
@{
|
|
|
List<SysCodeDtl> topictype = ViewData["topictype"] as List<SysCodeDtl>; //结论类型
|
|
List<SysCodeDtl> zhishitype = ViewData["zhishitype"] as List<SysCodeDtl>; //结论类型
|
|
List<ExpertTestTopicpeizhiDTO> expertTestTopicpeizhiDTOs = ViewBag.expertTestTopicpeizhiDTOs as List<ExpertTestTopicpeizhiDTO>; //数据
|
|
|
|
|
}
|
@{
|
Layout = null;
|
}
|
|
<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
|
<meta name="description" content="">
|
<meta name="author" content="ThemeBucket">
|
<title>@(SiteConfig.SiteName)</title>
|
<link href="~/css/bootstrap.min.css" rel="stylesheet">
|
<link href="~/css/font-awesome.min.css" rel="stylesheet">
|
<link href="~/css/animate.min.css" rel="stylesheet">
|
|
@*<link href="~/css/plugins/iCheck/custom.css" rel="stylesheet">*@
|
<link href="~/css/style.min.css" rel="stylesheet">
|
<link href="~/css/plugins/chosen/chosen.css" rel="stylesheet">
|
@*<link href="~/js/plugins/layer/skin/layer.css" rel="stylesheet">*@
|
@*<link href="~/css/plugins/datapicker/datepicker3.css" rel="stylesheet">*@
|
<link href="~/css/style.min.css" rel="stylesheet">
|
<link href="~/css/plugins/toastr/toastr.min.css" rel="stylesheet" />
|
<link href="~/css/plugins/webuploader/webuploader.css" rel="stylesheet" />
|
|
<style type="text/css">
|
.webuploader-pick {
|
position: relative;
|
display: inline-block;
|
cursor: pointer;
|
background: #00b7ee;
|
padding: 8px 14px 7px 14px;
|
color: #fff;
|
text-align: center;
|
border-radius: 3px;
|
overflow: hidden;
|
}
|
|
div.clearfix > label {
|
padding-top: 8px;
|
}
|
|
.chosen-container {
|
border-radius: 1px;
|
border: 1px solid #e5e6e7;
|
}
|
|
.col-md-1.control-label {
|
padding-right: 0px;
|
font-weight: 400;
|
}
|
</style>
|
|
<!-- jqgrid-->
|
@*<link href="~/css/plugins/jqgrid/ui.jqgrid.css" rel="stylesheet">*@
|
<script language="javascript" src="~/js/jquery.min.js" type="text/javascript"></script>
|
<script src="~/js/bootstrap.min.js"></script>
|
@*<script src="~/js/plugins/bootstro/bootstro.js"></script>*@
|
|
<!--容器-->
|
@*<script language="javascript" src="~/js/datehelper.js" type="text/javascript"></script>*@
|
@*<script language="javascript" src="~/js/plugins/query/jquery.query-object.js" type="text/javascript"></script>*@
|
@*<script language="javascript" src="~/js/plugins/iCheck/icheck.min.js" type="text/javascript"></script>*@
|
<script language="javascript" src="~/js/plugins/chosen/chosen.jquery.js" type="text/javascript"></script>
|
@*<script language="javascript" src="~/js/plugins/datapicker/bootstrap-datepicker.js" type="text/javascript"></script>*@
|
<script language="javascript" src="~/js/plugins/layer/layer.js" type="text/javascript"></script>
|
@*<script src="~/js/plugins/jqgrid/jquery.jqGrid.min.js" type="text/javascript"></script>*@
|
@*<script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js" type="text/javascript"></script>*@
|
<script src="~/js/plugins/toastr/toastr.min.js" type="text/javascript"></script>
|
<script src="~/js/plugins/webuploader/webuploader.min.js"></script>
|
|
<script language="javascript" src="~/js/common-layout.js" type="text/javascript"></script>
|
<script src="~/js/plugins/layer/laydate/laydate.js" type="text/javascript"></script>
|
@*<script src="~/js/plugins/iTexbox/itextbox.js" type="text/javascript"></script>*@
|
@*<script src="~/js/plugins/iuploader/iuploader.js"></script>*@
|
<script src="~/js/TUJS.js"></script>
|
</head>
|
<body class="gray-bg" style="overflow:auto">
|
<form id="formtest">
|
<div class="wrapper wrapper-content" id="ibox-content" style="padding:15px;">
|
<div class="row">
|
<div class="col-sm-12">
|
<div class="ibox float-e-margins">
|
<div class="ibox-title">
|
<h5> <i class="fa fa-list"></i> 基本信息</h5>
|
</div>
|
<div id="div_content" class="ibox-content" style="background-color:white;">
|
<div class="row">
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
|
|
|
|
|
|
|
|
|
|
|
@for (int i = 0; i < expertTestTopicpeizhiDTOs.Count; i++)
|
{
|
|
if (i == 0 || expertTestTopicpeizhiDTOs[i].Topictype != expertTestTopicpeizhiDTOs[i - 1].Topictype)
|
{
|
<h5>
|
|
<div class="clearfix layer-area" style="padding-top:15px;">
|
|
<div class="col-sm-12 col-md-12" @*style="width:5%;"*@>
|
<font>@expertTestTopicpeizhiDTOs[i].Topictype @expertTestTopicpeizhiDTOs[i].TopictypeName (数量:</font> <input style="width:30px;height:30px;border:0.5px solid #ccc;" label="数量" name="Fenshuszong" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicpeizhiDTOs[i].zongFenshu" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')" >
|
|
<font> 题 分值: </font> <input label="结论类型" name="Fenzhizong" style="width:30px;height:30px;border:0.5px solid #ccc;" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicpeizhiDTOs[i].zongFenzhi" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')"> <font>分) </font>
|
</div>
|
|
<input type="hidden" name="Topictypeszong" value="@expertTestTopicpeizhiDTOs[i].Topictype" />
|
</div>
|
</h5>
|
}
|
|
|
@if (i == 0 || expertTestTopicpeizhiDTOs[i].Topictype != expertTestTopicpeizhiDTOs[i - 1].Topictype)
|
{
|
@Html.Raw("<div class=\"clearfix layer - area\" >")
|
}
|
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:5%;">@expertTestTopicpeizhiDTOs[i].ZhishitypeName</label>
|
<div class="col-sm-2 col-md-2" style="width:5%;" >
|
<input style="width:30px;height:30px;border:0.5px solid #ccc;" label="@expertTestTopicpeizhiDTOs[i].ZhishitypeName" name="Fenshus" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicpeizhiDTOs[i].FenshuName" onkeyup="this.value=this.value.replace(/[^0-9]/g,'')" onafterpaste="this.value=this.value.replace(/[^0-9]/g,'')" onchange="checknum('@expertTestTopicpeizhiDTOs[i].Topictype',this);">
|
|
<input type="hidden" name="Topictypes" value="@expertTestTopicpeizhiDTOs[i].Topictype" />
|
<input type="hidden" name="Zhishitypes" value="@expertTestTopicpeizhiDTOs[i].Zhishitype" />
|
<input type="hidden" name="ShijianIds" value="@expertTestTopicpeizhiDTOs[i].ShijianId" />
|
<input type="hidden" name="Fenzhis" value="@expertTestTopicpeizhiDTOs[i].Fenzhi" />
|
</div>
|
|
|
|
|
|
@if (i != 0 && ( i == (expertTestTopicpeizhiDTOs.Count - 1) || expertTestTopicpeizhiDTOs[i].Topictype != expertTestTopicpeizhiDTOs[i + 1].Topictype))
|
{
|
|
@Html.Raw("</div>")
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="wrapper wrapper-content" style="margin-top:0px"></div>
|
<div class="ibox-content" id="top" style="z-index:100; position:fixed; height:50px; width:100%;bottom:0; text-align: right; padding-top:8px ">
|
<div class="" style="float:right;" data-bootstro-width="500px" data-bootstro-content="功能按钮:“保存”,“删除”">
|
|
|
<a class="btn btn-success" href="javascript:void(0)" onclick="savePosition();" style="margin-left:4px; border-radius:4px;">
|
<i class="glyphicon glyphicon-ok"></i> <span class="bold">提交</span>
|
</a>
|
|
|
</div>
|
</div>
|
|
</form>
|
|
<script type="text/javascript">
|
|
|
var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2;
|
$("#div_content").height(hh);
|
|
toastr.options = {
|
"closeButton": true,
|
"debug": false,
|
"progressBar": true,
|
"positionClass": "toast-bottom-right",
|
"onclick": null,
|
"showDuration": "300",
|
"hideDuration": "600",
|
"timeOut": "4500",
|
"extendedTimeOut": "600",
|
"showEasing": "swing",
|
"hideEasing": "linear",
|
"showMethod": "fadeIn",
|
"hideMethod": "fadeOut"
|
};
|
|
|
|
|
|
|
@*var id = '@Model.Id';*@
|
|
|
|
var checknum = function (Topictype,obj) {
|
|
var Topictypeszong = document.getElementsByName("Topictypeszong");
|
var Fenshuszongs = document.getElementsByName("Fenshuszong");
|
var Fenshus = document.getElementsByName("Fenshus");
|
var Topictypes = document.getElementsByName("Topictypes");
|
var Fenshuszong = 0;
|
for (var j = 0; j < Topictypes.length; j++) {
|
|
if (Topictypes[j].value == Topictype) {
|
|
if (Fenshus[j].value != "") {
|
Fenshuszong += parseInt(Fenshus[j].value);
|
}
|
|
}
|
}
|
|
|
|
for (var a = 0; a < Topictypeszong.length; a++) {
|
|
if (Topictype == Topictypeszong[a].value) {
|
if (Fenshuszongs[a].value == "") {
|
Fenshuszongs[a].value = 0;
|
}
|
if (Fenshuszong > parseInt(Fenshuszongs[a].value))
|
{
|
obj.value = "0";
|
toastr.warning("知识点题目数量不能大于总题目数量");
|
return;
|
}
|
//Fenshuszongs[a].value = Fenshuszong;
|
}
|
|
}
|
|
|
}
|
|
|
|
|
|
// 保存岗位信息
|
var savePosition = function () {
|
|
|
|
|
|
var sss = document.getElementsByName("Fenshus");
|
|
for (var j = 0; j < sss.length; j++) {
|
|
if ($.trim(sss[j].value)=="") {
|
toastr.warning("数量不能为空");
|
return;
|
}
|
}
|
var sss = document.getElementsByName("Fenzhizong");
|
|
for (var j = 0; j < sss.length; j++) {
|
|
if ($.trim(sss[j].value) == "") {
|
toastr.warning("分值不能为空");
|
return;
|
}
|
}
|
|
|
|
|
var Topictypeszong = document.getElementsByName("Topictypeszong");
|
var Fenshuszongs = document.getElementsByName("Fenshuszong");
|
var Fenshus = document.getElementsByName("Fenshus");
|
var Topictypes = document.getElementsByName("Topictypes");
|
|
var Fenshuszong = 0;
|
for (var j = 0; j < Topictypes.length; j++) {
|
|
if (Topictypes[j].value == "01") {
|
|
if (Fenshus[j].value != "") {
|
Fenshuszong += parseInt(Fenshus[j].value);
|
}
|
|
}
|
}
|
|
|
|
for (var a = 0; a < Topictypeszong.length; a++) {
|
|
if ("01" == Topictypeszong[a].value) {
|
if (Fenshuszongs[a].value == "" ) {
|
Fenshuszongs[a].value = 0;
|
}
|
if (Fenshuszong != parseInt(Fenshuszongs[a].value)) {
|
|
toastr.warning("单选题知识点题目数量必须等于总题目数量");
|
return;
|
}
|
//Fenshuszongs[a].value = Fenshuszong;
|
}
|
|
}
|
|
|
Fenshuszong = 0;
|
for (var j = 0; j < Topictypes.length; j++) {
|
|
if (Topictypes[j].value == "02") {
|
|
if (Fenshus[j].value != "") {
|
Fenshuszong += parseInt(Fenshus[j].value);
|
}
|
|
}
|
}
|
|
|
|
for (var a = 0; a < Topictypeszong.length; a++) {
|
|
if ("02" == Topictypeszong[a].value) {
|
if (Fenshuszongs[a].value == "") {
|
Fenshuszongs[a].value = 0;
|
}
|
if (Fenshuszong != parseInt(Fenshuszongs[a].value)) {
|
|
toastr.warning("多选题知识点题目数量必须等于总题目数量");
|
return;
|
}
|
//Fenshuszongs[a].value = Fenshuszong;
|
}
|
|
}
|
|
Fenshuszong = 0;
|
for (var j = 0; j < Topictypes.length; j++) {
|
|
if (Topictypes[j].value == "03") {
|
|
if (Fenshus[j].value != "") {
|
Fenshuszong += parseInt(Fenshus[j].value);
|
}
|
|
}
|
}
|
|
|
|
for (var a = 0; a < Topictypeszong.length; a++) {
|
|
if ("03" == Topictypeszong[a].value) {
|
if (Fenshuszongs[a].value == "") {
|
Fenshuszongs[a].value = 0;
|
}
|
if (Fenshuszong != parseInt(Fenshuszongs[a].value)) {
|
|
toastr.warning("判断题知识点题目数量必须等于总题目数量");
|
return;
|
}
|
//Fenshuszongs[a].value = Fenshuszong;
|
}
|
|
}
|
|
// var data = { id: $("#Id").val(), DocType: $("#DocType").val(), DocDept: $("#DocDept").val(), PublishTime: $("#PublishTime").val(), DocNo: $("#DocNo").val(), DocTitle: $("#DocTitle").val(), DocContent: ueue, DocZtc: $("#DocZtc").val(), Printtimes: $("#Printtimes").val(), DocCsdw: $("#DocCsdw").val(), PrintStatus: $("#PrintStatus").val()}
|
$.ajax({
|
type: "POST",
|
url: "/ExpertTestTopic/SavePeizhi",
|
dataType: "json",
|
global: false,
|
data: $('form').serializeArray(),
|
success: function (data) {
|
|
|
|
if (data.Result) {
|
// parent._afterSave(true);
|
parent.layer.msg('成功保存', { icon: 6 });
|
var Topictype = $("#Topictype").val();
|
var Zhishitype = $("#Zhishitype").val();
|
var Area = $("#Area").val();
|
|
window.location = "/ExpertTestTopic/EditPeizhi";
|
|
//try {
|
// _pageAutoClose();//自动关闭页面方法
|
//}
|
//catch (err) {
|
// parent._CloseTab1("/ExpertTestTopic/Edit/");
|
//}
|
|
}
|
else {
|
// toastr.error("失败");
|
parent.layer.msg(data.Message, { icon: 5 });
|
}
|
|
},
|
error: function () {
|
|
|
parent.layer.msg('失败', { icon: 5 });
|
}
|
});
|
}
|
|
|
|
|
function _pageAutoClose() {
|
parent.window._reloadPageData();
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.isRefresh = true;
|
parent.layer.closeAll('loading');
|
parent.layer.close(index);
|
return false;
|
}
|
|
|
</script>
|
</body>
|
</html>
|