username@email.com
2022-08-27 6e2b929cf381e2320ba6e7dec56c0371124d2b51
zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
@@ -122,34 +122,28 @@
                                    <h5>
                                        <div class="clearfix layer-area" style="padding-top:15px;">
                                            <label class="text-right col-sm-1 col-md-1 control-label" style="font-weight:bold;">@expertTestTopicpeizhiDTOs[i].Topictype @expertTestTopicpeizhiDTOs[i].TopictypeName</label>
                                            <label class="text-right col-sm-1 col-md-1 control-label" style="font-weight:bold;">
                                                (数量:
                                            </label>
                                            <div class="col-sm-2 col-md-2" style="width:5%;">
                                                <input class="form-control" style="border:none;" label="数量" name="Fenshuszong" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicpeizhiDTOs[i].zongFenshu" readonly="readonly">
                                            <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>
                                            <label class="text-left col-sm-1 col-md-1 control-label" style="font-weight:bold;">题</label>
                                            <label class="text-right col-sm-1 col-md-1 control-label" style="font-weight:bold;">分值:</label>
                                            <div class="col-sm-2 col-md-2" style="width:5%;">
                                                <input class="form-control" label="结论类型" name="Fenzhizong" 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,'')">
                                            </div>
                                            <label class="text-left col-sm-1 col-md-1 control-label" style="font-weight:bold;">分)</label>
                                            <input type="hidden" name="Topictypeszong" value="@expertTestTopicpeizhiDTOs[i].Topictype" />
                                        </div>
                                    </h5>
                                        }
                                        @if (i == 0 || (i + 1) % 4 == 0)
                                        @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">@expertTestTopicpeizhiDTOs[i].ZhishitypeName</label>
                                        <div class="col-sm-2 col-md-2">
                                            <input class="form-control" 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');">
                                        <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" />
@@ -245,7 +239,7 @@
        var checknum = function (Topictype) {
        var checknum = function (Topictype,obj) {
            var Topictypeszong = document.getElementsByName("Topictypeszong");
            var Fenshuszongs = document.getElementsByName("Fenshuszong");
@@ -268,7 +262,16 @@
            for (var a = 0; a < Topictypeszong.length; a++) {
                
                if (Topictype == Topictypeszong[a].value) {
                    Fenshuszongs[a].value = Fenshuszong;
                    if (Fenshuszongs[a].value == "") {
                        Fenshuszongs[a].value = 0;
                    }
                    if (Fenshuszong > parseInt(Fenshuszongs[a].value))
                    {
                        obj.value = "0";
                        toastr.warning("知识点题目数量不能大于总题目数量");
                        return;
                    }
                    //Fenshuszongs[a].value = Fenshuszong;
                        }
            }
@@ -305,10 +308,106 @@
                    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",