Kaynağa Gözat

离职表单金额校验

jzh 1 yıl önce
ebeveyn
işleme
7005b3ff8c

+ 7 - 7
zjugis-business/src/main/resources/templates/Resign/index.ftl

@@ -577,7 +577,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                             培训费用:
                                             <div class="z-comp-input" name="createReqVO$clfscb15"
                                                  style="width: 60px; display: inline-block; margin: 10px;">
-                                                <input type="text" value="${formEntity.clfscb15!}">
+                                                <input type="number" value="${formEntity.clfscb15!}">
                                             </div>
                                         </div>
@@ -586,7 +586,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                             职称费用:
                                             <div class="z-comp-input" name="createReqVO$clfscb16"
                                                  style="width: 60px; display: inline-block; margin: 10px;">
-                                                <input type="text" value="${formEntity.clfscb16!}">
+                                                <input type="number" value="${formEntity.clfscb16!}">
                                             </div>
                                         </div>
@@ -604,7 +604,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                         本月出勤考勤:
                                         <div class="z-comp-input" name="createReqVO$clfscb17"
                                              style="width: 60px; display: inline-block; margin: 10px;">
-                                            <input type="text" value="${formEntity.clfscb17!}">
+                                            <input type="number" value="${formEntity.clfscb17!}">
                                         </div>
                                     </div>
@@ -612,7 +612,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                         本月餐补考勤:
                                         <div class="z-comp-input" name="createReqVO$clfscb18"
                                              style="width: 60px; display: inline-block; margin: 10px;">
-                                            <input type="text" value="${formEntity.clfscb18!}">
+                                            <input type="number" value="${formEntity.clfscb18!}">
                                         </div>
                                     </div>
@@ -637,7 +637,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                         未发放当月工资:
                                         <div class="z-comp-input" name="createReqVO$clfscb19"
                                              style="width: 60px; display: inline-block; margin: 10px;">
-                                            <input type="text" value="${formEntity.clfscb19!}">
+                                            <input type="number" value="${formEntity.clfscb19!}">
                                         </div>
                                     </div>
@@ -646,7 +646,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                         借款金额:
                                         <div class="z-comp-input" name="createReqVO$clfscb20"
                                              style="width: 60px; display: inline-block; margin: 10px;">
-                                            <input type="text" value="${formEntity.clfscb20!}">
+                                            <input type="number" value="${formEntity.clfscb20!}">
                                         </div>
                                         元;
                                     </div>
@@ -655,7 +655,7 @@ styles=[ '/flow/css/formCommon.css', '/OwCommon/OwCommon.css','/timeSelector/Tim
                                         已结清:
                                         <div class="z-comp-input" name="createReqVO$clfscb21"
                                              style="width: 60px;  display: inline-block; margin: 10px;">
-                                            <input type="text" value="${formEntity.clfscb21!}">
+                                            <input type="number" value="${formEntity.clfscb21!}">
                                         </div>
                                     </div>

+ 66 - 0
zjugis-business/src/main/resources/templates/Resign/js/index.js

@@ -8,11 +8,77 @@
     window.onload = function (ex) {
         addDataUnFinished = $("#addDataUnfinished")
         addDataFinished = $("#addDataFinished")
+        initData();
         unfinishedWork();//未完成工作移交
         finishedWork();//已完成工作成果
         bindEvents();
     }
 
+
+    function initData() {
+
+        let inps1 = $("[name='createReqVO$clfscb7']")[0].children[0]; //社保月底
+        let inps2 = $("[name='createReqVO$clfscb8']")[0].children[0]; //社保月初
+        let inps3 = $("[name='createReqVO$clfscb9']")[0].children[0]; //公积金月底
+        let inps4 = $("[name='createReqVO$clfscb10']")[0].children[0]; //公积金月初
+
+
+        inps1.addEventListener("blur", e => {
+            let event = e || window.event;
+            let inputInfo = event.target.value;
+            if (!(inputInfo > 0)) {
+                z.ui.alertWarning(`月份必须大于0`)
+                inps1.value = ''
+            } else if (inputInfo > 12) {
+                z.ui.alertWarning(`月份不能大于12`)
+                inps1.value = ''
+            } else {
+                z.ui.input("[name='createReqVO$clfscb7']").setValue(inputInfo);
+            }
+        });
+
+        inps2.addEventListener("blur", e => {
+            let event = e || window.event;
+            let inputInfo = event.target.value;
+            if (!(inputInfo > 0)) {
+                z.ui.alertWarning(`月份必须大于0`)
+                inps2.value = ''
+            } else if (inputInfo > 12) {
+                z.ui.alertWarning(`月份不能大于12`)
+                inps2.value = ''
+            } else {
+                z.ui.input("[name='createReqVO$clfscb8']").setValue(inputInfo);
+            }
+        });
+        inps3.addEventListener("blur", e => {
+            let event = e || window.event;
+            let inputInfo = event.target.value;
+            if (!(inputInfo > 0)) {
+                z.ui.alertWarning(`月份必须大于0`)
+                inps3.value = ''
+            } else if (inputInfo > 12) {
+                z.ui.alertWarning(`月份不能大于12`)
+                inps3.value = ''
+            } else {
+                z.ui.input("[name='createReqVO$clfscb9']").setValue(inputInfo);
+            }
+        });
+        inps4.addEventListener("blur", e => {
+            let event = e || window.event;
+            let inputInfo = event.target.value;
+            if (!(inputInfo >= 0)) {
+                z.ui.alertWarning(`月份必须大于0`)
+                inps4.value = ''
+            } else if (inputInfo > 12) {
+                z.ui.alertWarning(`月份不能大于12`)
+                inps4.value = ''
+            } else {
+                z.ui.input("[name='createReqVO$clfscb10']").setValue(inputInfo);
+            }
+        });
+    }
+
+
     function finishedWork() {
         //未完成工作按钮
         let un = document.querySelector('#finished')

+ 19 - 0
zjugis-business/src/main/resources/templates/Staff/js/index.js

@@ -1,6 +1,7 @@
 (function () {
     window.onload = function (ex) {
 
+        initData();
         initDept();//所有部门列表查询
         initCompany();//公司列表查询
         initUser();//员工列表查询
@@ -14,6 +15,24 @@
         z.workflow.saveBtn.addListener("onSaveClick", saveForm);
     }
 
+
+    function initData() {
+
+        let inps1 = $("[name='createReqVO$cssl']")[0].children[0]; //初始司龄
+
+        inps1.addEventListener("blur", e => {
+            let event = e || window.event;
+            let inputInfo = event.target.value;
+            if (!(inputInfo >= 0)) {
+                z.ui.alertWarning(`初始司龄不能为负数`)
+                inps1.value = ''
+            } else {
+                z.ui.input("[name='createReqVO$cssl']").setValue(inputInfo);
+            }
+        });
+
+    }
+
     //部门列表查询
     function initDept() {
         z.ui.ajax({