From 6e2b929cf381e2320ba6e7dec56c0371124d2b51 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期六, 27 八月 2022 15:03:00 +0800
Subject: [PATCH] 提交

---
 zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml |  134 +++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 118 insertions(+), 16 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml b/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
index 0807a9e..f193e86 100644
--- a/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
@@ -122,31 +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>
-                                            
-                                            <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;width:5%;">棰�  鍒嗗�硷細</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" style="width:5%;">
-                                            <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" />
@@ -242,7 +239,7 @@
 
 
 
-        var checknum = function (Topictype) {
+        var checknum = function (Topictype,obj) {
 
             var Topictypeszong = document.getElementsByName("Topictypeszong");
             var Fenshuszongs = document.getElementsByName("Fenshuszong");
@@ -265,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;
                         }
 
             }
@@ -302,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",

--
Gitblit v1.9.1