From 3b029fb510aeca89d31812bde7542ee55a8ddc1a Mon Sep 17 00:00:00 2001 From: PC-201906131823\Administrator <zyyao> Date: 星期一, 08 十一月 2021 17:02:50 +0800 Subject: [PATCH] 增加合计 --- zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml b/zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml index b8f850e..2fc2601 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;"> @@ -90,10 +90,17 @@ <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" 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="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> + <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" id="Yufagongziheji" name="Yufagongziheji" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Yufagongziheji" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="CheckNum(this);"> </div> </div> + </div> </div> </div> @@ -226,6 +233,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