From 15eb82df2d6ec539e9d4245bfe08d531e8eb6379 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期日, 27 四月 2025 14:33:26 +0800
Subject: [PATCH] 修改培训订单占多个座位
---
zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml | 121 +++++++++++++++++++++++++++++++++++++--
1 files changed, 113 insertions(+), 8 deletions(-)
diff --git a/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml b/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
index 76f8d28..f193e86 100644
--- a/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
+++ b/zhengcaioa/zhengcaioa/Views/ExpertTestTopic/EditPeizhi.cshtml
@@ -124,7 +124,7 @@
<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="border:none;width:30px;height:30px;" label="鏁伴噺" name="Fenshuszong" labtype="txt" addvisible="true" editvisible="true" reg="" maxlength="50" ismust="true" type="text" value="@expertTestTopicpeizhiDTOs[i].zongFenshu" readonly="readonly">
+ <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>
@@ -135,15 +135,15 @@
}
- @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" />
@@ -239,7 +239,7 @@
- var checknum = function (Topictype) {
+ var checknum = function (Topictype,obj) {
var Topictypeszong = document.getElementsByName("Topictypeszong");
var Fenshuszongs = document.getElementsByName("Fenshuszong");
@@ -262,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;
}
}
@@ -299,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