Browse Source

高教审核端显示并可提交其它金额其它金额说明

sugangqiang 9 months ago
parent
commit
a00a41ec3a

+ 43 - 25
app/admin/controller/TalentAllowance.php

@@ -182,6 +182,13 @@ class TalentAllowance extends AdminController {
                 $fileList = array_filter(explode(",", $obj["files"]));
                 $newObj["files"] = implode(",", $fileList);
             }
+            if ($obj["process"] == 1 && $oldObj["type"] == CommonConst::ENTERPRISE_GJ && $obj["checkState"] == 3) {
+                $newObj["otherEnjoyedMoney"] = $obj["otherEnjoyedMoney"];
+                $newObj["otherEnjoyedDescription"] = $obj["otherEnjoyedDescription"];
+            } else {
+                $newObj["otherEnjoyedMoney"] = 0.00;
+                $newObj["otherEnjoyedDescription"] = null;
+            }
             //if (Const.RSJ.equals(checkCompany.getCode())) {
             $newObj["concats"] = $obj["concats"];
             $newObj["fields"] = $obj["fields"];
@@ -697,7 +704,7 @@ class TalentAllowance extends AdminController {
             ];
             return new Response(Response::SUCCESS, "计算成功", $res);
         } catch (\think\Exception $e) {
-            return new Response(Response::ERROR, "系统异常,请联系管理员");
+            return new Response(Response::ERROR, "系统异常,请联系管理员" . $e->getMessage());
         }
     }
 
@@ -768,7 +775,7 @@ class TalentAllowance extends AdminController {
                     $data["allowanceType"] = $old["recommendAllowanceType"];
                     $data["allowanceMsg"] = $old["recommendAllowanceMsg"];
                     $data["months"] = $old["recommendMonths"];
-                    $data["money"] = $old["recommendMoney"];
+                    $data["money"] = $old["recommendMoney"] - $old["otherEnjoyedMoney"];
                     $data["moneyDesc"] = $old["recommendMoneyDesc"];
                     $data["jtTalentArrange"] = $old["recommendTalentArrange"];
                     $data["workAllowanceMoney"] = $old["workAllowanceMoney"];
@@ -838,12 +845,12 @@ class TalentAllowance extends AdminController {
                 $upd["allowanceMsg"] = $obj["recommendAllowanceMsg"];
                 if ($upd["allowanceType"] == 1) {
                     $upd["months"] = $obj["recommendMonths"];
-                    $upd["money"] = $obj["recommendMoney"];
+                    $upd["money"] = $obj["recommendMoney"] - $obj["otherEnjoyedMoney"];
                     $upd["moneyDesc"] = $obj["recommendMoneyDesc"];
                 } else if ($upd["allowanceType"] == 2) {
                     $upd["months"] = "";
                     $upd["jtTalentArrange"] = $obj["recommendTalentArrange"];
-                    $upd["money"] = $obj["recommendMoney"];
+                    $upd["money"] = $obj["recommendMoney"] - $obj["otherEnjoyedMoney"];
                     $upd["moneyDesc"] = $obj["recommendMoneyDesc"];
                     $upd["workAllowanceMoney"] = null;
                     $upd["developAllowanceMoney"] = null;
@@ -1049,13 +1056,13 @@ class TalentAllowance extends AdminController {
         for ($m = 1; $m <= 12; $m++) {
             $months[] = $m . "月";
         }
-        $columns = [["年度", [1, 2]], ["所属镇街", [1, 2]], ["姓名", [1, 2]], ["性别", [1, 2]], ["证件号码", [1, 2]], ["人才层次", [1, 2]], ["认定条件", [1, 2]], ["认定条件取得时间", [1, 2]], ["认定条件名称", [1, 2]], ["公布入选月份", [1, 2]], ["拟认定津补贴类型", [1, 2]], ["拟兑现月份", [1, 2]], ["拟兑现金额", [1, 2]], ["拟兑现金额说明", [1, 2]], ["津补贴类型", [1, 2]], ["兑现月份", [1, 2]], ["兑现金额", [1, 2]], ["金额说明", [1, 2]], ["审核状态", [1, 2]], ["缴纳单位", [1, 2]]];
+        $columns = [["年度", [1, 2]], ["所属镇街", [1, 2]], ["姓名", [1, 2]], ["性别", [1, 2]], ["证件号码", [1, 2]], ["人才层次", [1, 2]], ["认定条件", [1, 2]], ["认定条件取得时间", [1, 2]], ["认定条件名称", [1, 2]], ["公布入选月份", [1, 2]], ["拟认定津补贴类型", [1, 2]], ["拟兑现月份", [1, 2]], ["拟兑现金额", [1, 2]], ["拟兑现金额说明", [1, 2]], ["其它补贴金额", [1, 2]], ["其它补贴说明", [1, 2]], ["津补贴类型", [1, 2]], ["兑现月份", [1, 2]], ["兑现金额", [1, 2]], ["金额说明", [1, 2]], ["审核状态", [1, 2]], ["缴纳单位", [1, 2]]];
         $infoCols = count($columns);
         for ($i = 0; $i < count($projects); $i++) {
             $columns[] = [AllowanceProjectEnum::getProjectName($projects[$i]), $months];
         }
         $list = \app\common\model\TalentAllowanceProject::alias("pro")
-                        ->field("ta.id,ta.year,ta.enterpriseId as curEnterpriseId,ta.address,ta.name,ta.sex,ta.idCard,ta.talentArrange,ta.identifyCondition,ta.identifyGetTime,ta.identifyConditionName,ta.identifyMonth,ta.recommendAllowanceType,ta.recommendMonths,ta.recommendMoney,ta.recommendMoneyDesc,ta.allowanceType,ta.months,ta.money,ta.moneyDesc,ta.checkState,ta.publicState,pro.project,pro.months as pre_months,con.enterpriseId,con.startTime,con.endTime,con.entryTime,con.quitTime,con.isQuit")
+                        ->field("ta.id,ta.year,ta.enterpriseId as curEnterpriseId,ta.address,ta.name,ta.sex,ta.idCard,ta.talentArrange,ta.identifyCondition,ta.identifyGetTime,ta.identifyConditionName,ta.identifyMonth,ta.recommendAllowanceType,ta.recommendMonths,ta.recommendMoney,ta.recommendMoneyDesc,ta.otherEnjoyedMoney,ta.otherEnjoyedDescription,ta.allowanceType,ta.months,ta.money,ta.moneyDesc,ta.checkState,ta.publicState,pro.project,pro.months as pre_months,con.enterpriseId,con.startTime,con.endTime,con.entryTime,con.quitTime,con.isQuit")
                         ->leftJoin("un_talent_allowance_info ta", "ta.id=pro.mainId")
                         ->leftJoin("un_talent_allowancecontract_detail con", "pro.baseId=con.id")
                         ->where($where)
@@ -1078,7 +1085,7 @@ class TalentAllowance extends AdminController {
                 $tmpList[$item["id"]]["curEnterpriseId"] = $item["curEnterpriseId"];
                 $tmpList[$item["id"]]["info"] = [$item["year"], $streetMap[$item["address"]], $item["name"], $item["sex"] == 1 ? "男" : "女", $item["idCard"], $levelMap[$item["talentArrange"]],
                     $icmap[$item["identifyCondition"]], $item["identifyGetTime"], $item["identifyConditionName"], $item["identifyMonth"], AllowanceTypeEnum::getTypeName($item["recommendAllowanceType"]), $item["recommendMonths"], $item["recommendMoney"],
-                    $item["recommendMoneyDesc"], AllowanceTypeEnum::getTypeName($item["allowanceType"]), $item["months"], $item["money"],
+                    $item["recommendMoneyDesc"], $item["otherEnjoyedMoney"], $item["otherEnjoyedDescription"] ?: "", AllowanceTypeEnum::getTypeName($item["allowanceType"]), $item["months"], $item["money"],
                     $item["moneyDesc"], $this->getCheckStateName($item["checkState"], $item["publicState"], $item["allowanceType"])];
             }
             if (!$tmpList[$item["id"]]["enterprise"][$item["enterpriseId"]]) {
@@ -1177,6 +1184,8 @@ class TalentAllowance extends AdminController {
         $info["backWork"] = $old["backWork"];
         $info["recommendAllowanceType"] = $old["allowanceType"];
         $info["recommendAllowanceMsg"] = "";
+        $info["otherEnjoyedMoney"] = $old["otherEnjoyedMoney"];
+        $info["otherEnjoyedDescription"] = $old["otherEnjoyedDescription"];
         $projectList = \app\common\model\TalentAllowanceProject::where("mainId", $info["id"])->select()->toArray();
         $set = $this->valideAllowanceType($info, $projectList, $monthMap, $monthAndDayMap);
         $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n综合以上所有判断得到最终补贴类型为:";
@@ -1215,35 +1224,35 @@ class TalentAllowance extends AdminController {
             $set = array_intersect($set, $contractSet);
             $set = array_intersect($set, $workdaySet);
             $checkSet = $set;
-            $set = array_intersect($set, $pensionSet);
-            $set = array_intersect($set, $taxSet);
+            //$set = array_intersect($set, $pensionSet);
+            //$set = array_intersect($set, $taxSet);
         } else if ($info["type"] == CommonConst::ENTERPRISE_GJ) {
             if ($info["backWork"] == 1) {
                 $str = "工资发放月份、个税缴交月份";
                 $set = array_intersect($set, $wageSet);
                 $set = array_intersect($set, $taxSet);
                 $checkSet = $set;
-                $set = array_intersect($set, $contractSet);
-                $set = array_intersect($set, $pensionSet);
-                $set = array_intersect($set, $workdaySet);
+                //$set = array_intersect($set, $contractSet);
+                //$set = array_intersect($set, $pensionSet);
+                //$set = array_intersect($set, $workdaySet);
             } else {
                 $str = "养老保险缴交月份、工资发放月份、个税缴交月份";
                 $set = array_intersect($set, $pensionSet);
                 $set = array_intersect($set, $wageSet);
                 $set = array_intersect($set, $taxSet);
                 $checkSet = $set;
-                $set = array_intersect($set, $contractSet);
-                $set = array_intersect($set, $workdaySet);
+                //$set = array_intersect($set, $contractSet);
+                //$set = array_intersect($set, $workdaySet);
             }
         } else {
             $set = array_intersect($set, $contractSet);
             $set = array_intersect($set, $workdaySet);
             $set = array_intersect($set, $wageSet);
             $checkSet = $set;
-            $set = array_intersect($set, $pensionSet);
-            $set = array_intersect($set, $unemploymentSet);
-            $set = array_intersect($set, $medicaSet);
-            $set = array_intersect($set, $taxSet);
+            //$set = array_intersect($set, $pensionSet);
+            //$set = array_intersect($set, $unemploymentSet);
+            //$set = array_intersect($set, $medicaSet);
+            //$set = array_intersect($set, $taxSet);
         }
         usort($set, function($a, $b) {
             return (int) $a - (int) $b;
@@ -1357,8 +1366,11 @@ class TalentAllowance extends AdminController {
                 }unset($arrange);
                 $info["recommendMonths"] = implode(",", $recommendMonths);
                 $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "通过与{$identifyExpiredName}取交集得到最终可享受月份:" . implode(",", $recommendMonths) . "\n经过计算:人才津贴为" . $jobMoney . ";";
+                if ($info["otherEnjoyedMoney"] != 0) {
+                    $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n" . "扣除其它补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为" . number_format($jobMoney - $info["otherEnjoyedMoney"], 2) . "元";
+                }
                 $info["recommendMoney"] = $jobMoney;
-                $info["recommendMoneyDesc"] = implode("+", $msgBulider);
+                $info["recommendMoneyDesc"] = implode("+", $msgBulider) . ($info["otherEnjoyedMoney"] != 0 ? sprintf("-%s(其它补贴金额)", number_format($info["otherEnjoyedMoney"], 2)) : "");
 
                 break;
             case 2:
@@ -1372,6 +1384,10 @@ class TalentAllowance extends AdminController {
                 $info["workAllowanceMoney"] = 0.00;
                 $info["developAllowanceMoney"] = 0.00;
                 $info["recommendTalentArrange"] = $talentArrange;
+                if ($info["otherEnjoyedMoney"] != 0) {
+                    $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n" . "扣除其它补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为" . number_format($jobMoney - $info["otherEnjoyedMoney"], 2) . "元";
+                }
+                $info["recommendMoneyDesc"] = $info["otherEnjoyedMoney"] != 0 ? sprintf("-%s(其它补贴金额)", number_format($info["otherEnjoyedMoney"], 2)) : "";
                 break;
             case 3:
                 $info["recommendMoney"] = 0.00;
@@ -1409,6 +1425,13 @@ class TalentAllowance extends AdminController {
         if ($info["type"] == CommonConst::ENTERPRISE_WJ) {
             $preCheckProjects = ["①", "②"];
         }
+        if ($info["type"] == CommonConst::ENTERPRISE_GJ) {
+            if ($info["backWork"] == 1) {
+                $preCheckProjects = ["③", "⑦"];
+            } else {
+                $preCheckProjects = ["③", "④", "⑦"];
+            }
+        }
         if ($info["recommendAllowanceType"] == 1 && (!$set || count($set) < 6) && in_array($sort, $preCheckProjects)) {
             $info["recommendAllowanceType"] = 3;
             $info["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . $sort . $name . "不足6个月,无法享受工作津贴(×)";
@@ -1598,12 +1621,7 @@ class TalentAllowance extends AdminController {
             $res["files"] = $filetypes;
             $res["projects"] = $projectList;
             $res["concats"] = $detailList;
-            if ($process == 1) {
-                $standard = \app\common\api\AmountStandardApi::getStandard($info["type"], $info["allowanceType"], $info["talentArrange"]);
-
-                $res["calResult"] = TalentAllowanceApi::validateAllowanceType($id);
-                $res["calResult"]["money"] = $standard ? $standard["money"] : 0;
-            }
+            $res["calResult"] = TalentAllowanceApi::validateAllowanceType($id);
         }
         return new Response(Response::SUCCESS, "不在审核范围内", $res);
     }

+ 10 - 0
app/admin/view/talent_allowance/public_check.html

@@ -340,6 +340,16 @@
                                             <div class="col-sm-5 spacing">
                                                 <input type="text" class="form-control" readonly="readonly" id="moneyDesc" name="moneyDesc" value="{$row.recommendMoneyDesc}"/>
                                             </div>
+                                            {if condition="$row['otherEnjoyedMoney'] neq 0"}                                            
+                                            <label class="col-sm-1 control-label spacing">其它补贴金额</label>
+                                            <div class="col-sm-5 spacing">
+                                                <input type="text" class="form-control" readonly="readonly" id="otherEnjoyedMoney" value="{$row.otherEnjoyedMoney}"/>
+                                            </div>
+                                            <label class="col-sm-1 control-label spacing">其它补贴说明</label>
+                                            <div class="col-sm-5 spacing">
+                                                <textarea class="form-control" readonly="readonly" id="otherEnjoyedDescription" name="otherEnjoyedDescription" rows="4" >{$row.otherEnjoyedDescription}</textarea>
+                                            </div>
+                                            {/if}
                                         </div>
                                     </div>
                                 </div>

+ 32 - 11
app/common/api/TalentAllowanceApi.php

@@ -193,6 +193,8 @@ class TalentAllowanceApi {
         $info["type"] = $old["type"];
         $info["backWork"] = $old["backWork"];
         $info["allowanceType"] = $old["allowanceType"];
+        $info["otherEnjoyedMoney"] = $old["otherEnjoyedMoney"];
+        $info["otherEnjoyedDescription"] = $old["otherEnjoyedDescription"];
         $enterpriseMap = \app\common\model\Enterprise::where("type", $old["type"])->column("name", "id");
         /*         * 查询工作单位记录 */
         $initDetailList = \app\common\model\TalentAllowancecontractDetail::where("mainId", $info["id"])->select()->toArray();
@@ -255,35 +257,35 @@ class TalentAllowanceApi {
             $set = array_intersect($set, $contractSet);
             $set = array_intersect($set, $workdaySet);
             $checkSet = $set;
-            $set = array_intersect($set, $pensionSet);
-            $set = array_intersect($set, $taxSet);
+            //$set = array_intersect($set, $pensionSet);
+            //$set = array_intersect($set, $taxSet);
         } else if ($info["type"] == CommonConst::ENTERPRISE_GJ) {
             if ($info["backWork"] == 1) {
                 $str = "工资发放月份、个税缴交月份";
                 $set = array_intersect($set, $wageSet);
                 $set = array_intersect($set, $taxSet);
                 $checkSet = $set;
-                $set = array_intersect($set, $contractSet);
-                $set = array_intersect($set, $pensionSet);
-                $set = array_intersect($set, $workdaySet);
+                //$set = array_intersect($set, $contractSet);
+                //$set = array_intersect($set, $pensionSet);
+                //$set = array_intersect($set, $workdaySet);
             } else {
                 $str = "养老保险缴交月份、工资发放月份、个税缴交月份";
                 $set = array_intersect($set, $pensionSet);
                 $set = array_intersect($set, $wageSet);
                 $set = array_intersect($set, $taxSet);
                 $checkSet = $set;
-                $set = array_intersect($set, $contractSet);
-                $set = array_intersect($set, $workdaySet);
+                //$set = array_intersect($set, $contractSet);
+                //$set = array_intersect($set, $workdaySet);
             }
         } else {
             $set = array_intersect($set, $contractSet);
             $set = array_intersect($set, $workdaySet);
             $set = array_intersect($set, $wageSet);
             $checkSet = $set;
-            $set = array_intersect($set, $pensionSet);
-            $set = array_intersect($set, $unemploymentSet);
-            $set = array_intersect($set, $medicaSet);
-            $set = array_intersect($set, $taxSet);
+            //$set = array_intersect($set, $pensionSet);
+            //$set = array_intersect($set, $unemploymentSet);
+            //$set = array_intersect($set, $medicaSet);
+            //$set = array_intersect($set, $taxSet);
         }
         usort($set, function($a, $b) {
             return (int) $a - (int) $b;
@@ -399,6 +401,12 @@ class TalentAllowanceApi {
                 $info["recommendAllowanceMsg"][] = "通过与{$identifyExpiredName}取交集得到最终可享受月份:";
                 $info["recommendAllowanceMsg"][] = "<span style='color:red;font-weight:bold;'>" . implode(",", $recommendMonths) . "</span>;";
                 $info["recommendAllowanceMsg"][] = "经过计算:兑现月份" . count($recommendMonths) . "个月,人才津贴为<span style='color:red;font-weight:bold;'>" . $jobMoney . "</span>;";
+                $finnalMoney = $jobMoney;
+                if ($info["otherEnjoyedMoney"] > 0) {
+                    $finnalMoney = number_format($jobMoney - $info["otherEnjoyedMoney"], 2);
+                    $info["recommendAllowanceMsg"][] = "扣除其它已享受补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为<span style='color:red;font-weight:bold;'>" . number_format($jobMoney - $info["otherEnjoyedMoney"], 2) . "</span>;";
+                }
+                $info["finnalMoney"] = $finnalMoney;
                 $info["recommendMoney"] = $jobMoney;
                 $info["recommendMoneyDesc"] = implode("+", $msgBulider);
                 $updAllowance["id"] = $info["id"];
@@ -419,6 +427,12 @@ class TalentAllowanceApi {
                 $info["recommendTalentArrange"] = $talentArrange;
                 $updAllowance["id"] = $info["id"];
                 $updAllowance["virtualAmount"] = $jtMoney;
+                $finnalMoney = $jobMoney;
+                if ($info["otherEnjoyedMoney"] > 0) {
+                    $finnalMoney = number_format($jobMoney - $info["otherEnjoyedMoney"], 2);
+                    $info["recommendAllowanceMsg"][] = "扣除其它已享受补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为<span style='color:red;font-weight:bold;'>" . number_format($jobMoney - $info["otherEnjoyedMoney"], 2) . "</span>;";
+                }
+                $info["finnalMoney"] = $finnalMoney;
                 TaModel::update($updAllowance);
                 break;
             case 3:
@@ -457,6 +471,13 @@ class TalentAllowanceApi {
         if ($info["type"] == CommonConst::ENTERPRISE_WJ) {
             $preCheckProjects = ["①", "②"];
         }
+        if ($info["type"] == CommonConst::ENTERPRISE_GJ) {
+            if ($info["backWork"] == 1) {
+                $preCheckProjects = ["③", "⑦"];
+            } else {
+                $preCheckProjects = ["③", "④", "⑦"];
+            }
+        }
         if ($info["recommendAllowanceType"] == 1 && (!$set || count($set) < 6) && in_array($sort, $preCheckProjects)) {
             $info["recommendAllowanceType"] = 3;
             $info["recommendAllowanceMsg"][] = $sort . $name . "不足6个月,无法享受工作津贴(×)";

+ 1 - 1
public/static/modular/gate/talentAllowance/check/talentAllowanceInfo_info.js

@@ -824,7 +824,7 @@ TalentAllowanceInfoDlg.calculator = function () {
     var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/calculator/id/" + id, function (data) {
         var message = data.recommendAllowanceMsg.join("<br>");
         if (data.recommendAllowanceType != 3) {
-            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.recommendMoney + "</span>";
+            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.finnalMoney + "</span>";
         }
         $("#cal-result").html(message);
     }, function (data) {

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

@@ -412,7 +412,7 @@ TalentAllowanceInfoDlg.calculator = function () {
     var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/calculator/id/" + id, function (data) {
         var message = data.recommendAllowanceMsg.join("<br>");
         if (data.recommendAllowanceType != 3) {
-            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.recommendMoney + "</span>";
+            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.finnalMoney + "</span>";
         }
         Feng.confirm(message, function () {});
     }, function (data) {

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

@@ -134,7 +134,7 @@ TalentAllowanceInfoDlg.calculator = function () {
     var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/calculator/id/" + id, function (data) {
         var message = data.recommendAllowanceMsg.join("<br>");
         if (data.recommendAllowanceType != 3) {
-            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.recommendMoney + "</span>";
+            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.finnalMoney + "</span>";
         }
         Feng.confirm(message, function () {});
     }, function (data) {

+ 43 - 2
public/static/modular/talentAllowance/talentAllowanceInfo_info.js

@@ -529,6 +529,7 @@ TalentAllowanceInfoDlg.showCheckModal = function () {
                     var concats = data.obj.info.concats;
                     var fields = data.obj.info.fields;
                     var info = data.obj.info;
+                    var calResult = typeof data.obj.calResult != "undefined" ? data.obj.calResult : {};
                     //初始化附件、核查项目、合同
                     if (projectList != null && projectList.length != 0) {
                         var html = '<ul>';
@@ -552,6 +553,21 @@ TalentAllowanceInfoDlg.showCheckModal = function () {
                         }
                         $("#field_concat").empty().append(html);
                     }
+                    if (calResult) {
+                        $("#otherEnjoyedMoney").data("money", calResult.recommendMoney);
+                        $("#finalMoney").val(calResult.recommendMoney);
+                        if (calResult.recommendAllowanceType == 1) {
+                            var text = "补贴类型:工作津贴\n满足条件的月份:" + calResult.recommendMonths;
+                            text += "\n可享受补贴(元):" + calResult.recommendMoney;
+                            $("#calResult").text(text);
+                        } else if (calResult.recommendAllowanceType == 2) {
+                            var text = "补贴类型:一次性交通补贴";
+                            text += "\n可享受补贴(元):" + calResult.recommendMoney;
+                            $("#calResult").text(text);
+                        } else {
+                            $("#calResult").text(calResult.recommendAllowanceMsg);
+                        }
+                    }
                     TalentAllowanceInfoDlg.initICheck();
                     //回显数据
                     $("#checkStateModal").val(info.checkState).trigger("change");
@@ -596,6 +612,11 @@ TalentAllowanceInfoDlg.showCheckModal = function () {
                             $(this).iCheck(isChecked);
                         })
                     })
+                    if (calResult) {
+                        $("#otherEnjoyedMoney").val(info.otherEnjoyedMoney);
+                        $("#otherEnjoyedDescription").val(info.otherEnjoyedDescription);
+                        TalentAllowanceInfoDlg.cal();
+                    }
                 },
                 yes: function (index, layero) {
                     TalentAllowanceInfoDlg.checkSubmit(index);
@@ -613,6 +634,12 @@ TalentAllowanceInfoDlg.showCheckModal = function () {
     ajax.set("companyId", $("#companyId").val())
     ajax.start();
 }
+TalentAllowanceInfoDlg.cal = function () {
+    var value = $("#otherEnjoyedMoney").val();
+    var totalMoney = $("#otherEnjoyedMoney").data("money");
+    var result = totalMoney - value;
+    $("#finalMoney").val(result);
+}
 
 /**
  * 显示/隐藏设置津补贴类型
@@ -686,11 +713,18 @@ TalentAllowanceInfoDlg.saveReviewCheck = function () {
 TalentAllowanceInfoDlg.toggleField = function () {
     var checkState = $("#checkStateModal").val();
     var process = $("#process").val();
+    var type = $("#type").val();
+    $("#otherEnjoyedMoney").val(0);
+    TalentAllowanceInfoDlg.cal();
+    $("#otherEnjoyed").css("display", "none");
     if (checkState == 2 || checkState == -2) {
         $("#toProcessDiv").css("display", process == 3 ? "block" : "none");
         $("#field").show();
     } else {
         if (checkState == 3) {
+            if (type == 6) {
+                $("#otherEnjoyed").css("display", "block");
+            }
             $("#checkMsg").val(process == 3 ? "复核通过,待核查征信" : "初审通过");
         }
         $("#field").hide();
@@ -707,11 +741,14 @@ TalentAllowanceInfoDlg.toggleField = function () {
  */
 TalentAllowanceInfoDlg.checkSubmit = function (index) {
     var id = $("#id").val();
+    var type = $("#type").val();
     var checkState = $("#checkStateModal").val();
     var checkMsg = $("#checkMsg").val();
     var process = $("#process").val();
     var companyCode = $("#companyCode").val();
     var companyCodes = "";
+    var otherEnjoyedMoney = $("#otherEnjoyedMoney").val();
+    var otherEnjoyedDescription = $("#otherEnjoyedDescription").val();
     if (Feng.isEmptyStr(checkState)) {
         Feng.info("请选择审核状态");
         return;
@@ -720,6 +757,10 @@ TalentAllowanceInfoDlg.checkSubmit = function (index) {
         Feng.info("请填写审核意见");
         return;
     }
+    if (type == 6 && process == 1 && checkState == 3 && otherEnjoyedMoney != 0 && Feng.isEmptyStr(otherEnjoyedDescription)) {
+        Feng.info("其它补贴金额不为0时需要填写其它补贴金额说明");
+        return;
+    }
     /*if (process == 3 && checkState == 2) {
      var toProcess = $("#toProcess").val();
      if (Feng.isEmptyStr(toProcess)) {
@@ -780,7 +821,7 @@ TalentAllowanceInfoDlg.checkSubmit = function (index) {
     }, function (data) {
         Feng.error("提交审核失败!" + data.responseJSON.message + "!");
     });
-    ajax.setData({"id": id, "checkState": checkState, "checkMsg": checkMsg, "process": $("#process").val(), "projects": projects, "files": files, "concats": concats, "fields": fields, "companyId": $("#companyId").val(), "toProcess": $("#toProcess").val(), "toDep": companyCodes});
+    ajax.setData({"id": id, "checkState": checkState, "checkMsg": checkMsg, "process": $("#process").val(), "projects": projects, "files": files, "concats": concats, "fields": fields, "companyId": $("#companyId").val(), "toProcess": $("#toProcess").val(), "toDep": companyCodes, otherEnjoyedMoney: otherEnjoyedMoney, otherEnjoyedDescription: otherEnjoyedDescription});
     ajax.start();
 }
 
@@ -847,7 +888,7 @@ TalentAllowanceInfoDlg.calculator = function () {
     var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/calculator/id/" + id, function (data) {
         var message = data.recommendAllowanceMsg.join("<br>");
         if (data.recommendAllowanceType != 3) {
-            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.recommendMoney + "</span>";
+            message += "<br>试算补贴金额:<span style='color:red;font-weight:bold;'>" + data.finnalMoney + "</span>";
         }
         $("#cal-result").html(message);
     }, function (data) {

+ 41 - 18
public/static/modular/talentAllowance/talentAllowanceInfo_info_supple.js

@@ -519,20 +519,6 @@ TalentAllowanceInfoDlg.createCheckHtml = function () {
     switch (process) {
         case '1':
             html = '<form id="checkForm">\n';
-            if (type == 6 && 1==2) {
-                html += '<div class="form-group" style="margin: 10px;">\n' +
-                        '<label for="checkState" class="control-label">计算公式</label>\n' +
-                        '<input type="text" class="form-control" id="result" readonly>\n' +
-                        '</div>\n' +
-                        '<div class="form-group" style="margin: 10px;">\n' +
-                        '<label for="checkState" class="control-label">扣除其它补贴</label>\n' +
-                        '<input type="text" class="form-control" id="otherEnjoyedMoney">\n' +
-                        '</div>\n' +
-                        '<div class="form-group" style="margin: 10px;">\n' +
-                        '<label for="checkMsg" class="control-label">审核意见</label>\n' +
-                        '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
-                        '</div>\n';
-            }
             html +=
                     '<div class="form-group" style="margin: 10px;">\n' +
                     '<label for="checkState" class="control-label">审核状态</label>\n' +
@@ -546,8 +532,26 @@ TalentAllowanceInfoDlg.createCheckHtml = function () {
                     '<div class="form-group" style="margin: 10px;">\n' +
                     '<label for="checkMsg" class="control-label">审核意见</label>\n' +
                     '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
-                    '</div>\n' +
-                    '<div class="form-group" id="field" style="display: none;margin: 10px">\n';
+                    '</div>\n';
+            if (type == 6) {
+                html += '<div id="otherEnjoyed" style="display:none;"><div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkState" class="control-label">试算结果</label>\n' +
+                        '<textarea type="text" class="form-control" id="calResult" rows="2" readonly></textarea>\n' +
+                        '</div>\n' +
+                        '<div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkState" class="control-label">扣除其它补贴</label>\n' +
+                        '<input type="text" class="form-control" id="otherEnjoyedMoney" data-money="0" value="0" onclick="$(this).select()" oninput=TalentAllowanceInfoDlg.cal();>\n' +
+                        '</div>\n' +
+                        '<div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkState" class="control-label">最终补贴</label>\n' +
+                        '<input type="text" class="form-control" id="finalMoney" readonly>\n' +
+                        '</div>\n' +
+                        '<div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkMsg" class="control-label">其它补贴说明</label>\n' +
+                        '<textarea class="form-control" id="otherEnjoyedDescription" rows="5"></textarea>\n' +
+                        '</div></div>\n';
+            }
+            html += '<div class="form-group" id="field" style="display: none;margin: 10px">\n';
 
             if ($("#type").val() == 6 && ($("#postType option").length > 0 || $("#institution option").length > 0)) {
                 html = html +
@@ -604,8 +608,27 @@ TalentAllowanceInfoDlg.createCheckHtml = function () {
                     '<div class="form-group" style="margin: 10px;">\n' +
                     '<label for="checkMsg" class="control-label">审核意见</label>\n' +
                     '<textarea class="form-control" id="checkMsg" rows="5"></textarea>\n' +
-                    '</div>\n' +
-                    '</form>';
+                    '</div>\n';
+
+            if (type == 6) {
+                html += '<div id="otherEnjoyed" style="display:none;"><div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkState" class="control-label">试算结果</label>\n' +
+                        '<textarea type="text" class="form-control" id="calResult" rows="2" readonly></textarea>\n' +
+                        '</div>\n' +
+                        '<div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkState" class="control-label">扣除其它补贴</label>\n' +
+                        '<input type="text" class="form-control" id="otherEnjoyedMoney" readonly data-money="0" value="0" onclick="$(this).select()" oninput=TalentAllowanceInfoDlg.cal();>\n' +
+                        '</div>\n' +
+                        '<div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkState" class="control-label">最终补贴</label>\n' +
+                        '<input type="text" class="form-control" id="finalMoney" readonly>\n' +
+                        '</div>\n' +
+                        '<div class="form-group" style="margin: 10px;">\n' +
+                        '<label for="checkMsg" class="control-label">其它补贴说明</label>\n' +
+                        '<textarea class="form-control" id="otherEnjoyedDescription" rows="5" readonly></textarea>\n' +
+                        '</div></div>\n';
+            }
+            html += '</form>';
             break;
     }
     return html;