Bladeren bron

1、交通补贴试算金额修复
2、高教津补贴初审可以修改补贴类型

sugangqiang 9 maanden geleden
bovenliggende
commit
3782d7d31a

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

@@ -154,6 +154,22 @@ class TalentAllowance extends AdminController {
         return view("select", ["row" => $obj, "process" => $process, "postTypes" => $postTypes, "institutions" => $institutions]);
     }
 
+    public function save() {
+        $id = $this->request["id"];
+        $allowanceType = $this->request["allowanceType"];
+        $old = TalentAllowanceApi::getInfoById($id);
+        if ($old["checkState"] != AllowanceStateEnum::NEED_CHECK && $old["checkState"] != AllowanceStateEnum::REJECT_TO_FIRST) {
+            return new Response(Response::ERROR, "不在审核范围内");
+        }
+        if ($allowanceType == $old["allowanceType"]) {
+            return new Response(Response::ERROR, "没有更改不需要保存");
+        }
+        $upd["id"] = $id;
+        $upd["allowanceType"] = $allowanceType;
+        TaModel::update($upd);
+        return new Response(Response::SUCCESS, "保存成功");
+    }
+
     /**
      * 审核保存
      */
@@ -1386,7 +1402,7 @@ class TalentAllowance extends AdminController {
                 $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["recommendAllowanceMsg"] = $info["recommendAllowanceMsg"] . "\n" . "扣除其它补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为" . number_format($jtMoney - $info["otherEnjoyedMoney"], 2) . "元";
                 }
                 $info["recommendMoneyDesc"] = $info["otherEnjoyedMoney"] != 0 ? sprintf("-%s(其它补贴金额)", number_format($info["otherEnjoyedMoney"], 2)) : "";
                 break;

+ 3 - 3
app/admin/view/talent_allowance/info.html

@@ -74,7 +74,7 @@
                                             <input type="hidden" name="checkState" id="checkState" value="{$row.checkState}">
                                             <input type="hidden" name="process" id="process" value="{$process}">
                                             <input type="hidden" name="companyId" id="companyId" value="{$row.companyId}">
-                                            <input type="hidden" name="allowanceType" id="allowanceType" value="{$row.allowanceType}">
+                                            {if condition="$process eq 1 and $row['type'] eq 6"}{else/}<input type="hidden" name="allowanceType" id="allowanceType" value="{$row.allowanceType}">{/if}                                            
                                             <input type="hidden" name="recommendAllowanceType" id="recommendAllowanceType" value="{$row.recommendAllowanceType}">
                                             <div class="row">
                                                 <div class="rowGroup">
@@ -82,11 +82,11 @@
                                                     <div class="col-sm-2 spacing">
                                                         <input type="text" class="form-control" readonly="readonly" id="name" name="name" value="{$row.name}" >
                                                     </div>
-                                                </div>
+                                                </div>                                                
                                                 <div class="rowGroup">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>津补贴类型</label>
                                                     <div class="col-sm-2 spacing">
-                                                        <select type="text" class="form-control" id="allowanceType" name="allowanceType" value="{$row.allowanceType}" disabled="disabled">
+                                                        <select type="text" class="form-control" id="allowanceType" name="allowanceType" value="{$row.allowanceType}" {if condition="$process eq 1 and $row['type'] eq 6"}{else/}disabled="disabled"{/if}>
                                                             <option>请选择</option>
                                                             <option value="1">工作津贴</option>
                                                             <option value="2">一次性交通补贴</option>

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

@@ -427,10 +427,10 @@ class TalentAllowanceApi {
                 $info["recommendTalentArrange"] = $talentArrange;
                 $updAllowance["id"] = $info["id"];
                 $updAllowance["virtualAmount"] = $jtMoney;
-                $finnalMoney = $jobMoney;
+                $finnalMoney = $jtMoney;
                 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["recommendAllowanceMsg"][] = "扣除其它已享受补贴金额" . $info["otherEnjoyedMoney"] . "元,最终可享受人才津贴为<span style='color:red;font-weight:bold;'>" . number_format($jtMoney - $info["otherEnjoyedMoney"], 2) . "</span>;";
                 }
                 $info["finnalMoney"] = $finnalMoney;
                 TaModel::update($updAllowance);

+ 54 - 22
public/static/modular/talentAllowance/talentAllowanceInfo.js

@@ -26,30 +26,62 @@ TalentAllowanceInfo.check = function () {
 TalentAllowanceInfo.openCheckTalentAllowanceInfo = function () {
     if (this.check()) {
         var index = null;
+        var type = $("#type").val();
         var process = $("#process").val();
         if (process == 1) {
-            index = layer.open({
-                type: 2,
-                title: '津补贴初级审核',
-                fix: false, //不固定
-                maxmin: true,
-                content: Feng.ctxPath + '/admin/talentAllowance/toCheckPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#process").val() + "/companyId/" + TalentAllowanceInfo.seItem.companyId,
-                btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
-                btnAlign: 'c',
-                btn1: function (index, layero) {
-                    var obj = layero.find("iframe")[0].contentWindow;
-                    obj.TalentAllowanceInfoDlg.showCheckModal();
-                },
-                btn2: function (index, layero) {
-                    var obj = layero.find("iframe")[0].contentWindow;
-                    obj.TalentAllowanceInfoDlg.submitCheck();
-                    return false;
-                },
-                end: function () {
-                    layer.closeAll('tips');
-                    TalentAllowanceInfo.table.refresh();
-                }
-            });
+            if (type == 6) {
+                index = layer.open({
+                    type: 2,
+                    title: '津补贴初级审核',
+                    fix: false, //不固定
+                    maxmin: true,
+                    content: Feng.ctxPath + '/admin/talentAllowance/toCheckPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#process").val() + "/companyId/" + TalentAllowanceInfo.seItem.companyId,
+                    btn: ['<i class="fa fa-save"></i>&nbsp;&nbsp;保存修改', '<i class="fa fa-eye"></i>&nbsp;&nbsp;保存审核', '<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+                    btnAlign: 'c',
+                    btn1: function (index, layero) {
+                        var obj = layero.find("iframe")[0].contentWindow;
+                        obj.TalentAllowanceInfoDlg.save();
+                        return false;
+                    },
+                    btn2: function (index, layero) {
+                        var obj = layero.find("iframe")[0].contentWindow;
+                        obj.TalentAllowanceInfoDlg.showCheckModal();
+                        return false;
+                    },
+                    btn3: function (index, layero) {
+                        var obj = layero.find("iframe")[0].contentWindow;
+                        obj.TalentAllowanceInfoDlg.submitCheck();
+                        return false;
+                    },
+                    end: function () {
+                        layer.closeAll('tips');
+                        TalentAllowanceInfo.table.refresh();
+                    }
+                });
+            } else {
+                index = layer.open({
+                    type: 2,
+                    title: '津补贴初级审核',
+                    fix: false, //不固定
+                    maxmin: true,
+                    content: Feng.ctxPath + '/admin/talentAllowance/toCheckPage/id/' + TalentAllowanceInfo.seItem.id + "/process/" + $("#process").val() + "/companyId/" + TalentAllowanceInfo.seItem.companyId,
+                    btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+                    btnAlign: 'c',
+                    btn1: function (index, layero) {
+                        var obj = layero.find("iframe")[0].contentWindow;
+                        obj.TalentAllowanceInfoDlg.showCheckModal();
+                    },
+                    btn2: function (index, layero) {
+                        var obj = layero.find("iframe")[0].contentWindow;
+                        obj.TalentAllowanceInfoDlg.submitCheck();
+                        return false;
+                    },
+                    end: function () {
+                        layer.closeAll('tips');
+                        TalentAllowanceInfo.table.refresh();
+                    }
+                });
+            }
         } else if (process == 2) {
             index = layer.open({
                 type: 2,

+ 29 - 0
public/static/modular/talentAllowance/talentAllowanceInfo_info.js

@@ -735,6 +735,35 @@ TalentAllowanceInfoDlg.toggleField = function () {
     }
 }
 
+TalentAllowanceInfoDlg.save = function () {
+    var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/validateIsCheck", function (data) {
+        if (data.code == 200) {
+            var ajax = new $ax(Feng.ctxPath + "/admin/talentAllowance/save", function (data) {
+                if (data.code == 200) {
+                    Feng.success(data.msg);
+                } else {
+                    Feng.error(data.msg);
+                }
+            }, function (data) {
+                Feng.error("提交审核失败!" + data.responseJSON.message + "!");
+            });
+            var id = $("#id").val();
+            var allowanceType = $("#allowanceType").val();
+            ajax.setData({"id": id, "allowanceType": allowanceType});
+            ajax.start();
+        } else {
+            Feng.info(data.msg);
+        }
+    }, function (data) {
+        Feng.error("校验失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set("id", $("#id").val());
+    ajax.set("type", 3);
+    ajax.set("process", $("#process").val())
+    ajax.set("companyId", $("#companyId").val())
+    ajax.start();
+}
+
 
 /**
  * 审核信息提交