@model DTO.ExpertTestTopicDTO
|
@using DTO;
|
@using zhengcaioa.Models;
|
@{
|
|
|
List<SysCodeDtl> topictype = ViewData["topictype"] as List<SysCodeDtl>; //题型
|
List<SysCodeDtl> zhishitype = ViewData["zhishitype"] as List<SysCodeDtl>; //知识点
|
List<SysCodeDtl> zhongdian = ViewData["zhongdian"] as List<SysCodeDtl>; //重点
|
List<SysCodeDtl> jiexi_status = ViewData["jiexi_status"] as List<SysCodeDtl>; //解析状态
|
List<SysCodeDtl> shenpi_status = ViewData["shenpi_status"] as List<SysCodeDtl>; //审批状态
|
List<AreaDTO> Area = ViewData["Area"] as List<AreaDTO>; //区域
|
|
List<ExpertTestTopicanwserDTO> expertTestTopicanwserDTOs = Model.expertTestTopicanwserDTOs;
|
|
List<ExpertTestTopicjiexiDTO> expertTestTopicjiexiDTOs = Model.expertTestTopicjiexiDTOs;
|
List<SysCodeDtl> Flag = ViewData["Flag"] as List<SysCodeDtl>; //解析状态
|
List<SysCodeDtl> falv = ViewData["falv"] as List<SysCodeDtl>; //审批状态
|
|
|
List<DTO.PageEntity> pageEntities = ViewData["pageEntities"] as List<DTO.PageEntity>; //问题类型
|
var shenhesto = pageEntities.Where(x => x.PageName == "审核").FirstOrDefault();
|
string shenhe = "";
|
if (shenhesto != null)
|
{
|
shenhe = shenhesto.PageName;
|
}
|
var tijiaobingshenhesto = pageEntities.Where(x => x.PageName == "提交并审核").FirstOrDefault();
|
string tijiaobingshenhe = "";
|
if (tijiaobingshenhesto != null)
|
{
|
tijiaobingshenhe = tijiaobingshenhesto.PageName;
|
}
|
|
}
|
@{
|
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;">
|
<label class="text-right col-sm-1 col-md-1 control-label">题型<i class="red">*</i></label>
|
<div class="col-sm-2 col-md-2">
|
<select id="Topictype" class="form-control" name="Topictype" data-placeholder="选择 序列 ...">
|
<option value="" hassubinfo="true">请选择</option>
|
@foreach (var item in topictype)
|
{
|
@if (!item.CodeSn.Equals(Model.Topictype))
|
{
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
}
|
else
|
{
|
<option value="@item.CodeSn" hassubinfo="true" selected="selected">
|
@item.Comments
|
</option>
|
}
|
|
}
|
|
</select>
|
<input type="hidden" id="Id" name="Id" value="@Model.Id" />
|
</div>
|
|
|
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label">知识点<i class="red">*</i></label>
|
<div class="col-sm-2 col-md-2">
|
<select id="Zhishitype" class="form-control" name="Zhishitype" data-placeholder="选择 序列 ...">
|
<option value="" hassubinfo="true">请选择</option>
|
@foreach (var item in zhishitype)
|
{
|
@if (!item.CodeSn.Equals(Model.Zhishitype))
|
{
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
}
|
else
|
{
|
<option value="@item.CodeSn" hassubinfo="true" selected="selected">
|
@item.Comments
|
</option>
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label">区域</label>
|
<div class="col-sm-2 col-md-2">
|
<select id="Area" class="form-control" name="Area" data-placeholder="选择 序列 ...">
|
<option value="" hassubinfo="true">请选择</option>
|
@foreach (var item in Area)
|
{
|
@if (!item.CodeId.Equals(Model.Area))
|
{
|
<option value="@item.CodeId" hassubinfo="true">
|
@item.Name
|
</option>
|
}
|
else
|
{
|
<option value="@item.CodeId" hassubinfo="true" selected="selected">
|
@item.Name
|
</option>
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
|
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
重点标注
|
</label>
|
<div class="col-sm-2 col-md-2" grouptype="Vdata">
|
@if ("A" == Model.Zhongdian)
|
{
|
<input type="checkbox" id="ZhongdianName" checked="checked" name="ZhongdianName" value="A" />
|
}
|
else
|
{
|
<input type="checkbox" id="ZhongdianName" name="ZhongdianName" value="A" />
|
}
|
<input type="hidden" id="Zhongdian" name="Zhongdian" value="" />
|
|
</div>
|
|
|
|
</div>
|
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
|
|
|
|
<label class="text-right col-sm-1 col-md-1 control-label">试题<i class="red">*</i></label>
|
<div class="col-sm-11 col-md-11">
|
<textarea class="form-control bt" id="Topic" name="Topic" title="试题" isempty="" maxlength="4000" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@Model.Topic</textarea>
|
|
</div>
|
|
|
</div>
|
|
<div id="addlist_3">
|
@if(Model.Topictype!="03"){
|
|
@for (int i = 0; i < expertTestTopicanwserDTOs.Count; i++)
|
{
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
@*<div class="col-sm-2 col-md-2" style="width:4%;">
|
<input class="form-control" style="text-align:left;border:none;" label="答案编号" name="anwserno" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicanwserDTOs[i].Anwserno" readonly="readonly">
|
</div>*@
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:15px;margin-left:15px;" name="Anwser1">@expertTestTopicanwserDTOs[i].Anwserno、</label>
|
<div class="col-sm-6 col-md-6" name="Anwser2">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="@expertTestTopicanwserDTOs[i].Anwser">
|
<input type="hidden" name="anwserno" value="@expertTestTopicanwserDTOs[i].Anwserno" />
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
是否答案
|
</label>
|
|
|
<div class="text-left col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
@if ("A" == expertTestTopicanwserDTOs[i].Shifouzhengqu)
|
{
|
<input type="checkbox" checked="checked" name="ShifouzhengquName" value="A" onclick="checkShifouzhengqu(this)" />
|
}
|
else
|
{
|
<input type="checkbox" name="ShifouzhengquName" value="D" onclick="checkShifouzhengqu(this)" />
|
}
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
@*<select class="form-control" name="Shifouzhengqu" data-placeholder="选择 序列 ...">
|
|
@foreach (var item in zhongdian)
|
{
|
@if (!item.CodeSn.Equals(expertTestTopicanwserDTOs[i].Shifouzhengqu))
|
{
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
}
|
else
|
{
|
<option value="@item.CodeSn" hassubinfo="true" selected="selected">
|
@item.Comments
|
</option>
|
}
|
|
}
|
|
</select>*@
|
|
</div>
|
|
|
|
@*@if (i == 0)
|
{
|
<div class="col-sm-1 col-md-1" style="width:80px;">
|
<button type="button" class="addBtn" onclick="addBtn(this)" data-type="3" style="width:32px">+</button>
|
<button type="button" class="delBtn" onclick="delBtn(this)" data-type="3" style="width:32px">-</button>
|
</div>
|
}*@
|
</div>
|
|
}
|
}else{
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
@for (int i = 0; i < expertTestTopicanwserDTOs.Count; i++)
|
{
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:3%;text-align:left;padding-left:15px;">
|
@if ("A" == expertTestTopicanwserDTOs[i].Shifouzhengqu)
|
{
|
<input type="checkbox" checked="checked" name="ShifouzhengquName" value="A" onclick="checkShifouzhengqu(this)" />
|
}
|
else
|
{
|
<input type="checkbox" name="ShifouzhengquName" value="D" onclick="checkShifouzhengqu(this)" />
|
}
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
<input type="hidden" name="anwserno" value="@expertTestTopicanwserDTOs[i].Anwserno" />
|
|
</div>
|
<label class="text-left col-sm-1 col-md-1 control-label">@expertTestTopicanwserDTOs[i].Anwserno</label>
|
@*<div class="col-sm-2 col-md-2" style="width:5%;">
|
<input class="form-control" style="border:none;" label="答案编号" name="anwserno" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicanwserDTOs[i].Anwserno" readonly="readonly">
|
</div>*@
|
|
<div class="col-sm-6 col-md-6" name="Anwser2" style="display:none;">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="@expertTestTopicanwserDTOs[i].Anwser">
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
</div>
|
|
}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div id="addlist_2">
|
@for (int i = 0; i < expertTestTopicjiexiDTOs.Count; i++)
|
{
|
<div class="fatiaomeirong">
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
法律
|
</label>
|
|
|
<div class="col-sm-5 col-md-5" grouptype="Vdata">
|
<select class="form-control" name="Falv" data-placeholder="选择 序列 ...">
|
<option value="" hassubinfo="true">请选择</option>
|
@foreach (var item in falv)
|
{
|
@if (!item.CodeSn.Equals(expertTestTopicjiexiDTOs[i].Falv))
|
{
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
}
|
else
|
{
|
<option value="@item.CodeSn" hassubinfo="true" selected="selected">
|
@item.Comments
|
</option>
|
}
|
|
}
|
|
</select>
|
|
</div>
|
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:30px;">法条</label>
|
<div class="col-sm-2 col-md-2">
|
<input class="form-control" label="法条" name="Fatiao" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="@expertTestTopicjiexiDTOs[i].Fatiao">
|
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
主解析
|
</label>
|
|
|
<div class="col-sm-2 col-md-2" grouptype="Vdata" style="width:5%;">
|
|
@if ("A" == expertTestTopicjiexiDTOs[i].Flag)
|
{
|
<input type="checkbox" checked="checked" name="FlagName" value="A" onclick="checkFlag(this)" />
|
}
|
else
|
{
|
<input type="checkbox" name="FlagName" value="D" onclick="checkFlag(this)" />
|
}
|
<input type="hidden" name="Flag" value="" />
|
|
|
|
</div>
|
|
|
|
@if (i == 0)
|
{
|
<div class="col-sm-1 col-md-1" style="width:80px;">
|
<button type="button" class="addBtn" onclick="addBtn(this)" data-type="2" style="width:32px">+</button>
|
<button type="button" class="delBtn" onclick="delBtn(this)" data-type="2" style="width:32px">-</button>
|
</div>
|
}
|
|
|
</div>
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label">法条内容</label>
|
<div class="col-sm-11 col-md-11">
|
<textarea class="form-control bt" name="Fatiaomingxi" title="法条内容" isempty="" maxlength="4000" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@expertTestTopicjiexiDTOs[i].Jiexi</textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
}
|
</div>
|
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
|
|
|
|
<label class="text-right col-sm-1 col-md-1 control-label">解析</label>
|
<div class="col-sm-11 col-md-11">
|
<textarea class="form-control bt" id="Jiexi" name="Jiexi" title="解析" isempty="" maxlength="4000" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'">@Model.Jiexi</textarea>
|
|
</div>
|
|
|
</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>
|
|
<a class="btn btn-success" id="shenhebtn" href="javascript:void(0)" onclick="shenhePosition();" style="margin-left:4px; border-radius:4px;">
|
<i class="glyphicon glyphicon-ok"></i> <span class="bold">审核</span>
|
</a>
|
|
<a class="btn btn-success" id="tijiaobingshenhebtn" href="javascript:void(0)" onclick="tijiaobingshenhePosition();" 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 Topic = document.getElementById("Topic");
|
|
Topic.style.height = Topic.scrollHeight + 'px';
|
|
var Jiexi = document.getElementById("Jiexi");
|
|
Jiexi.style.height = Jiexi.scrollHeight + 'px';
|
|
var Fatiaomingxi = document.getElementsByName("Fatiaomingxi");
|
for (var a = 0; a < Fatiaomingxi.length; a++) {
|
|
Fatiaomingxi[a].style.height = Fatiaomingxi[a].scrollHeight + 'px';
|
}
|
|
|
|
var Topictype11 = $("#Topictype").val();
|
if (Topictype11 == "03") {
|
var sss = $("div[name='Anwser2']");
|
sss.hide();
|
var ssss = $("label[name='Anwser1']");
|
ssss.hide();
|
|
}
|
|
Jiexi.style.height = Jiexi.scrollHeight + 'px';
|
var Topictype11 = $("#Topictype").val();
|
if (Topictype11 == "03") {
|
var sss = $("div[name='Anwser2']");
|
sss.hide();
|
var ssss = $("label[name='Anwser1']");
|
ssss.hide();
|
|
}
|
|
|
|
|
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"
|
};
|
|
$("#Topictype").chosen();
|
$("#Zhishitype").chosen();
|
$("#Area").chosen();
|
|
|
|
|
var id = '@Model.Id';
|
var Clientid = '@Model.ShenpiStatus';
|
var shenhe = '@shenhe';
|
var tijiaobingshenhe = '@tijiaobingshenhe';
|
if (id == null || id == '') {
|
$("#shenhebtn").hide();
|
} else if (shenhe == "" || Clientid == "A") {
|
$("#shenhebtn").hide();
|
} else {
|
$("#shenhebtn").show();
|
}
|
|
if (tijiaobingshenhe == "") {
|
$("#tijiaobingshenhebtn").hide();
|
} else {
|
$("#tijiaobingshenhebtn").show();
|
}
|
|
|
var shenhePosition = function () {
|
|
if (id == null || id == '') {
|
toastr.warning("请先保存");
|
return;
|
}
|
|
|
|
$.ajax({
|
type: "POST",
|
url: "/ExpertTestTopic/Shenhe",
|
dataType: "json",
|
global: false,
|
data: { Id: id },
|
success: function (data) {
|
|
|
if (data.Result) {
|
// parent._afterSave(true);
|
parent.layer.msg('审核成功', { icon: 6 });
|
_pageAutoClose();//自动关闭页面方法
|
}
|
else {
|
if ($.isNumber(imgLoad)) {
|
parent.layer.close(imgLoad);
|
}
|
// toastr.error("");
|
parent.layer.msg(data.Message, { icon: 5 });
|
}
|
|
},
|
error: function () {
|
if ($.isNumber(imgLoad)) {
|
parent.layer.close(imgLoad);
|
}
|
//toastr.error("保存失败");
|
|
parent.layer.msg('审核失败', { icon: 5 });
|
}
|
});
|
}
|
|
|
|
// 保存岗位信息
|
var tijiaobingshenhePosition = function () {
|
|
|
if ($("#Topictype").val() == '') {
|
toastr.warning("题型不能为空");
|
return;
|
}
|
if ($.trim($("#Zhishitype").val()) == '') {
|
toastr.warning("知识点不能为空");
|
return;
|
}
|
|
if ($.trim($("#Topic").val()) == '') {
|
toastr.warning("试题不能为空");
|
return;
|
}
|
|
|
if ($("#ZhongdianName").is(':checked')) {
|
$("#Zhongdian").val("A");
|
} else {
|
$("#Zhongdian").val("D");
|
}
|
var sss = document.getElementsByName("ShifouzhengquName");
|
var ssss = document.getElementsByName("Shifouzhengqu");
|
for (var j = 0; j < sss.length; j++) {
|
|
if (sss[j].checked) {
|
ssss[j].value = "A";
|
} else {
|
ssss[j].value = "D";
|
}
|
}
|
|
var sss = document.getElementsByName("FlagName");
|
var ssss = document.getElementsByName("Flag");
|
for (var j = 0; j < sss.length; j++) {
|
|
if (sss[j].checked) {
|
ssss[j].value = "A";
|
} else {
|
ssss[j].value = "D";
|
}
|
}
|
|
if ($("#Topictype").val() == "01" || $("#Topictype").val() == "03") {
|
var sss = document.getElementsByName("ShifouzhengquName");
|
var booll = 0;
|
for (var i = 0; i < sss.length; i++) {
|
if (sss[i].checked) {
|
booll += 1;
|
}
|
}
|
|
if (booll != 1) {
|
toastr.warning("单选和判断题只能有一个正确答案");
|
return;
|
}
|
} else {
|
var sss = document.getElementsByName("ShifouzhengquName");
|
var booll = 0;
|
for (var i = 0; i < sss.length; i++) {
|
if (sss[i].checked) {
|
booll += 1;
|
}
|
}
|
|
if (booll <= 1) {
|
toastr.warning("多单选至少有两个正确答案");
|
return;
|
}
|
}
|
|
|
var ssssss = document.getElementsByName("FlagName");
|
var booll11 = 0;
|
for (var i = 0; i < ssssss.length; i++) {
|
if (ssssss[i].checked) {
|
booll11 += 1;
|
}
|
}
|
if (booll11 != 1) {
|
toastr.warning("主解析只能有一个");
|
return;
|
}
|
|
|
imgLoad = parent.layer.load(2, { shade: [0.2, '#fff'] });
|
$.ajax({
|
type: "POST",
|
url: "/ExpertTestTopic/Tijiaobingshenhe",
|
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();
|
|
var falvs = document.getElementsByName("Falv");
|
|
var Falv = "";
|
|
for (var i = 0; i < falvs.length; i++) {
|
|
Falv += falvs[i].value + ",";
|
}
|
|
|
window.location = "/ExpertTestTopic/Edit?Topictype=" + Topictype + "&Zhishitype=" + Zhishitype + "&Area=" + Area + "&Falv=" + Falv + ""
|
if ($.isNumber(imgLoad)) {
|
parent.layer.close(imgLoad);
|
}
|
}
|
else {
|
if ($.isNumber(imgLoad)) {
|
parent.layer.close(imgLoad);
|
}
|
// toastr.error("");
|
parent.layer.msg(data.Message, { icon: 5 });
|
}
|
|
},
|
error: function () {
|
if ($.isNumber(imgLoad)) {
|
parent.layer.close(imgLoad);
|
}
|
//toastr.error("保存失败");
|
|
parent.layer.msg('保存失败', { icon: 5 });
|
}
|
});
|
}
|
|
|
// 保存岗位信息
|
var savePosition = function () {
|
|
|
|
if ($("#Topictype").val() == '') {
|
toastr.warning("题型不能为空");
|
return;
|
}
|
if ($.trim($("#Zhishitype").val()) == '') {
|
toastr.warning("知识点不能为空");
|
return;
|
}
|
|
if ($.trim($("#Topic").val()) == '') {
|
toastr.warning("试题不能为空");
|
return;
|
}
|
|
|
if ($("#ZhongdianName").is(':checked')) {
|
$("#Zhongdian").val("A");
|
} else {
|
$("#Zhongdian").val("D");
|
}
|
|
var sss = document.getElementsByName("ShifouzhengquName");
|
var ssss = document.getElementsByName("Shifouzhengqu");
|
for (var j = 0; j < sss.length; j++) {
|
|
if (sss[j].checked) {
|
ssss[j].value = "A";
|
} else {
|
ssss[j].value = "D";
|
}
|
}
|
|
var sss = document.getElementsByName("FlagName");
|
var ssss = document.getElementsByName("Flag");
|
for (var j = 0; j < sss.length; j++) {
|
|
if (sss[j].checked) {
|
ssss[j].value = "A";
|
} else {
|
ssss[j].value = "D";
|
}
|
}
|
|
|
if ($("#Topictype").val() == "01" || $("#Topictype").val() == "03") {
|
var sss = document.getElementsByName("ShifouzhengquName");
|
var booll = 0;
|
for (var i = 0; i < sss.length; i++) {
|
if (sss[i].checked) {
|
booll += 1;
|
}
|
}
|
|
if (booll != 1) {
|
toastr.warning("单选和判断题只能有一个正确答案");
|
return;
|
}
|
} else {
|
var sss = document.getElementsByName("ShifouzhengquName");
|
var booll = 0;
|
for (var i = 0; i < sss.length; i++) {
|
if (sss[i].checked) {
|
booll += 1;
|
}
|
}
|
|
if (booll <= 1) {
|
toastr.warning("多单选至少有两个正确答案");
|
return;
|
}
|
}
|
|
|
var ssssss = document.getElementsByName("FlagName");
|
var booll11 = 0;
|
for (var i = 0; i < ssssss.length; i++) {
|
if (ssssss[i].checked) {
|
booll11 += 1;
|
}
|
}
|
if (booll11 != 1) {
|
toastr.warning("主解析只能有一个");
|
return;
|
}
|
|
|
|
// 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/Save",
|
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();
|
|
var falvs = document.getElementsByName("Falv");
|
|
var Falv = "";
|
|
for (var i = 0; i < falvs.length; i++) {
|
|
Falv += falvs[i].value + ",";
|
}
|
|
|
window.location = "/ExpertTestTopic/Edit?Topictype=" + Topictype + "&Zhishitype=" + Zhishitype + "&Area=" + Area + "&Falv=" + Falv + ""
|
|
//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;
|
}
|
|
$(window).unload(function () {
|
_pageAutoClose();
|
|
});
|
|
|
function addBtn(obj) {
|
var oTr = document.createElement('div');
|
var num = $(obj).data().type;
|
console.log(num)
|
if (num == 3) {
|
$('#addlist_3').append(oTr);
|
$(oTr).html(` <div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label">答案编号</label>
|
<div class="col-sm-2 col-md-2" style="width:4%;">
|
<input class="form-control" style="text-align:left;border:none;" label="答案编号" name="anwserno" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="">
|
</div>
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:10px;" name="Anwser1" >、</label>
|
<div class="col-sm-6 col-md-6" name="Anwser2" >
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
是否正确
|
</label>
|
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
<select class="form-control" name="Shifouzhengqu" data-placeholder="选择 序列 ...">
|
|
@foreach (var item in zhongdian)
|
{
|
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
|
|
}
|
|
</select>
|
|
</div>
|
|
|
</div>`);
|
} else if (num == 2) {
|
$('#addlist_2').append(oTr);
|
$(oTr).html(` <div class="fatiaomeirong" >
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
法律
|
</label>
|
|
|
<div class="col-sm-5 col-md-5" grouptype="Vdata" >
|
|
<select class="form-control" name="Falv" data-placeholder="选择 序列 ...">
|
<option value="" hassubinfo="true">请选择</option>
|
@foreach (var item in falv)
|
{
|
|
<option value="@item.CodeSn" hassubinfo="true">
|
@item.Comments
|
</option>
|
|
|
}
|
|
</select>
|
|
</div>
|
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:30px;">法条</label>
|
<div class="col-sm-2 col-md-2" >
|
<input class="form-control" label="法条" name="Fatiao" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
主解析
|
</label>
|
|
|
<div class="col-sm-2 col-md-2" grouptype="Vdata" style="width:5%;">
|
|
|
|
<input type="checkbox" name="FlagName" value="D" onclick="checkFlag(this)" />
|
|
<input type="hidden" name="Flag" value="" />
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label">法条内容</label>
|
<div class="col-sm-11 col-md-11">
|
<textarea class="form-control bt" name="Fatiaomingxi" title="法条内容" isempty="" maxlength="4000" length="long" style="resize:none;overflow-y:hidden; min-height:60px;" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'"></textarea>
|
|
</div>
|
|
</div>
|
</div>
|
|
`);
|
}
|
}
|
|
function delBtn(obj) {
|
var num = $(obj).data().type;
|
console.log(num)
|
|
if (num == 3) {
|
if ($('#addlist_3').find('.clearfix').length > 1) {
|
$('#addlist_3').find('.clearfix:last').remove();
|
}
|
|
} else if (num == 2) {
|
if ($('#addlist_2').find('.fatiaomeirong').length > 1) {
|
$('#addlist_2').find('.fatiaomeirong:last').remove();
|
}
|
|
}
|
}
|
|
|
$("#Topictype").change(function () {
|
|
var Topictype = $("#Topictype").val();
|
if (Topictype == "03") {
|
|
|
$('#addlist_3').html(` <div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:3%;">
|
|
<input type="checkbox" name="ShifouzhengquName" value="A" onclick="checkShifouzhengqu(this)" />
|
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
<input type="hidden" name="anwserno" value="√" />
|
|
</div>
|
<label class="text-left col-sm-1 col-md-1 control-label">√</label>
|
|
|
|
<div class="col-sm-6 col-md-6" name="Anwser2" style="display:none;">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
|
</div>
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
|
<input type="checkbox" name="ShifouzhengquName" value="A" onclick="checkShifouzhengqu(this)" />
|
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
|
|
<input type="hidden" name="anwserno" value="×" />
|
|
</div>
|
<label class="text-left col-sm-1 col-md-1 control-label">×</label>
|
|
|
|
<div class="col-sm-6 col-md-6" name="Anwser2" style="display:none;">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
</div>`);
|
|
|
|
|
|
} else {
|
|
$('#addlist_3').html(`
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:15px;margin-left:15px;" name="Anwser1">A、</label>
|
<div class="col-sm-6 col-md-6" name="Anwser2">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
<input type="hidden" name="anwserno" value="A" />
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
是否答案
|
</label>
|
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
|
<input type="checkbox" name="ShifouzhengquName" value="D" onclick="checkShifouzhengqu(this)" />
|
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
</div>
|
</div>
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:15px;margin-left:15px;" name="Anwser1">B、</label>
|
<div class="col-sm-6 col-md-6" name="Anwser2">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
<input type="hidden" name="anwserno" value="B" />
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
是否答案
|
</label>
|
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
|
<input type="checkbox" name="ShifouzhengquName" value="D" onclick="checkShifouzhengqu(this)" />
|
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
</div>
|
</div>
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:15px;margin-left:15px;" name="Anwser1">C、</label>
|
<div class="col-sm-6 col-md-6" name="Anwser2">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
<input type="hidden" name="anwserno" value="C" />
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
是否答案
|
</label>
|
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
|
<input type="checkbox" name="ShifouzhengquName" value="D" onclick="checkShifouzhengqu(this)" />
|
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
</div>
|
</div>
|
|
<div class="clearfix layer-area" style="padding-bottom:15px;">
|
<label class="text-right col-sm-1 col-md-1 control-label"></label>
|
|
<label class="text-right col-sm-1 col-md-1 control-label" style="width:15px;margin-left:15px;" name="Anwser1">D、</label>
|
<div class="col-sm-6 col-md-6" name="Anwser2">
|
<input class="form-control" label="答案" name="Anwser" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="flase" type="text" value="">
|
<input type="hidden" name="anwserno" value="D" />
|
</div>
|
|
<label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">
|
是否答案
|
</label>
|
|
|
<div class="col-sm-1 col-md-1" grouptype="Vdata" style="width:5%;">
|
|
<input type="checkbox" name="ShifouzhengquName" value="D" onclick="checkShifouzhengqu(this)" />
|
|
<input type="hidden" name="Shifouzhengqu" value="" />
|
</div>
|
</div>
|
`);
|
}
|
});
|
|
|
function checkShifouzhengqu(vi) {
|
|
|
if (vi.checked) {
|
if ($("#Topictype").val() == "01" || $("#Topictype").val() == "03") {
|
var ssssss = document.getElementsByName("ShifouzhengquName");
|
for (var i = 0; i < ssssss.length; i++) {
|
ssssss[i].checked = false;
|
}
|
vi.checked = true;
|
}
|
}
|
}
|
function checkFlag(vi) {
|
//if ($("#Topictype").val() == "01" || $("#Topictype").val() == "03") {
|
if (vi.checked) {
|
var ssssss = document.getElementsByName("FlagName");
|
for (var i = 0; i < ssssss.length; i++) {
|
ssssss[i].checked = false;
|
}
|
vi.checked = true;
|
}
|
//}
|
}
|
|
</script>
|
</body>
|
</html>
|