瀏覽代碼

津补贴申请中考勤天数如果为空,由于之前转变了一下类型,空值变变成非数字,提交就会变成NaN,现在在后面再增加判断如果isNaN(days)则也为0

sugangqiang 1 年之前
父節點
當前提交
df53d09805

+ 1 - 1
app/admin/controller/TalentAllowance.php

@@ -1416,7 +1416,7 @@ class TalentAllowance extends AdminController {
             for ($i = 0; $i < count($monthAndDayList); $i++) {
                 $obj = explode("=", $monthAndDayList[$i]);
                 $month = $obj[0];
-                $day = $obj[1];
+                $day = is_numeric($obj[1]) ? $obj[1] : 0;
                 $count = $map[$month];
                 if ($count == 0) {
                     $map[$month] = $day;

+ 1 - 1
app/common/api/TalentAllowanceApi.php

@@ -412,7 +412,7 @@ class TalentAllowanceApi {
             for ($i = 0; $i < count($monthAndDayList); $i++) {
                 $obj = explode("=", $monthAndDayList[$i]);
                 $month = $obj[0];
-                $day = $obj[1];
+                $day = is_numeric($obj[1]) ? $obj[1] : 0;
                 $count = $map[$month];
                 if ($count == 0) {
                     $map[$month] = $day;

+ 1 - 1
public/static/modular/gate/talentAllowance/common/talentAllowance_info.js

@@ -371,7 +371,7 @@ TalentAllowanceInfoDlg.saveProjectData = function (id, project, allowanceType) {
                     error = error + num + "月的考勤天数不在范围内(1-" + max + ");";
                 }
             }
-            if (days == null || days == '') {
+            if (days == null || days == '' || isNaN(days)) {
                 days = 0;
             }
             months.push(num + "=" + days);