From e649be7905be7e74f6e09d8d74a7bd7bcd3923b7 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期二, 27 七月 2021 16:17:35 +0800 Subject: [PATCH] 修改 --- zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml | 52 ++++++++++++++++++++++++++++++++-------------------- 1 files changed, 32 insertions(+), 20 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml index 0a08cf8..9b5d903 100644 --- a/zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml +++ b/zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml @@ -60,7 +60,7 @@ <label class="text-right col-sm-3 col-md-3 control-label">鍛樺伐濮撳悕</label> <div class="col-sm-9 col-md-9"> <input class="form-control" labtype="txt" addvisible="true" readonly="readonly" type="text" value="@Model.UserName"> - <input type="hidden" name="id" value="@Model.Id" /> + <input type="hidden" name="Id" value="@Model.Id" /> </div> </div> <div class="clearfix layer-area" style="padding-bottom:15px;"> @@ -72,25 +72,25 @@ <div class="clearfix layer-area" style="padding-bottom:15px;"> <label class="text-right col-sm-3 col-md-3 control-label">濂栭噾</label> <div class="col-sm-9 col-md-9"> - <input class="form-control" name="Jiangjin" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiangjin" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> + <input class="form-control" id="Jiangjin" name="Jiangjin" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiangjin" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> </div> </div> <div class="clearfix layer-area" style="padding-bottom:15px;"> <label class="text-right col-sm-3 col-md-3 control-label">琛ュ彂宸ヨ祫</label> <div class="col-sm-9 col-md-9"> - <input class="form-control" name="Bufagongzi" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Bufagongzi" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> + <input class="form-control" id="Bufagongzi" name="Bufagongzi" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Bufagongzi" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> </div> </div> <div class="clearfix layer-area" style="padding-bottom:15px;"> <label class="text-right col-sm-3 col-md-3 control-label">璧斿伩</label> <div class="col-sm-9 col-md-9"> - <input class="form-control" name="Peichang" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Peichang" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> + <input class="form-control" id="Peichang" name="Peichang" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Peichang" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> </div> </div> <div class="clearfix layer-area" style="padding-bottom:15px;"> <label class="text-right col-sm-3 col-md-3 control-label">绾犻敊</label> <div class="col-sm-9 col-md-9"> - <input class="form-control" label="钖祫寰呴亣" name="Jiucuo" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiucuo" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> + <input class="form-control" id="Jiucuo" name="Jiucuo" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiucuo" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="CheckNum(this);"> </div> </div> @@ -133,7 +133,7 @@ <a class="btn btn-success" href="javascript:void(0)" onclick="_pageAutoClose();" style="margin-left:4px; border-radius:4px;"> <i class="glyphicon glyphicon-remove"></i> <span class="bold">鍙栨秷</span> </a> - <a class="btn btn-success" href="javascript:void(0)" onclick="saveSimCost();" style="margin-left:4px; border-radius:4px;"> + <a class="btn btn-success" href="javascript:void(0)" onclick="saveCheck();" style="margin-left:4px; border-radius:4px;"> <i class="glyphicon glyphicon-ok"></i> <span class="bold">鎻愪氦</span> </a> </div> @@ -173,24 +173,29 @@ }; // 淇濆瓨 - function saveSimCost() { + function saveCheck() { - if ($("#cbbCard").val() == '') { - toastr.warning("鐢佃瘽鍗″彿涓嶈兘涓虹┖"); + if ($("#Jiangjin").val() == '') { + toastr.warning("濂栭噾涓嶈兘涓虹┖"); return; } - if ($("#billamount").val() == '') { - toastr.warning("瀹為檯鐢佃瘽璐圭敤涓嶈兘涓虹┖"); + if ($("#Bufagongzi").val() == '') { + toastr.warning("琛ュ彂宸ヨ祫涓嶈兘涓虹┖"); return; } - if ($("#acTime").val() == '') { - toastr.warning("璐圭敤璁拌处鏃ユ湡涓嶈兘涓虹┖"); + if ($("#Peichang").val() == '') { + toastr.warning("璧斿伩涓嶈兘涓虹┖"); return; } + if ($("#Jiucuo").val() == '') { + toastr.warning("绾犻敊涓嶈兘涓虹┖"); + return; + } + $.ajax({ type: "POST", - url: "/SimCost/SaveSimCost2", + url: "/SalaryCheck/SaveCheck", dataType: "json", global: false, data: $('#fm').serialize(), @@ -198,12 +203,7 @@ if (data.Result) { parent.layer.msg('璁剧疆鎴愬姛', { icon: 6 }); - try { - _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 - } - catch (err) { - parent._CloseTab1("/SimCost/Edit/"); - } + _pageAutoClose();//鑷姩鍏抽棴椤甸潰鏂规硶 } else { // toastr.error("澶辫触"); @@ -226,6 +226,18 @@ parent.layer.close(index); return false; } + + //鐢ㄦ埛鍙兘杈撳叆姝h礋鏁颁笌灏忔暟 + function CheckNum(obj) { + + if (isNaN(obj.value) && !/^-$/.test(obj.value)) { + obj.value = ""; + } + if (!/^[+-]?\d*\.{0,1}\d{0,1}$/.test(obj.value)) { + obj.value = obj.value.replace(/\.\d{2,}$/, obj.value.substr(obj.value.indexOf('.'), 3)); + } + + } </script> </body> </html> \ No newline at end of file -- Gitblit v1.9.1