Browse Source

津补贴++

sugangqiang 1 year ago
parent
commit
df09dbef8d

+ 1 - 1
app/admin/view/talent_allowance/talentAllowanceInfo.html → app/admin/view/talent_allowance/index.html

@@ -200,7 +200,7 @@
                                     </div>
                                     <select class="form-control" id="recommendAllowanceType">
                                         <option value="">请选择</option>
-                                        <option value="1">人才津贴</option>
+                                        <option value="1">工作津贴</option>
                                         <option value="2">一次性交通补贴</option>
                                         <option value="3">不予兑现</option>
                                     </select>

+ 2 - 0
app/common/controller/Api.php

@@ -96,6 +96,7 @@ class Api extends BaseController {
             case 1:
                 $talentInfo = TalentApi::getOne($mainId);
                 $talent_condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
+            case 2:
             case 3:
             case 4:
             case 6:
@@ -127,6 +128,7 @@ class Api extends BaseController {
                 continue;
             $new_item["description"] = $item["description"];
             switch ($item['type']) {
+                case 2:
                 case 3:
                 case 4:
                 case 6:

+ 6 - 6
app/enterprise/controller/TalentAllowance.php

@@ -12,13 +12,13 @@ use app\enterprise\common\EnterpriseController;
 use app\common\state\CommonConst;
 use app\common\api\BatchApi;
 use app\common\api\TalentAllowanceApi;
-use app\common\api\EnterpriseApi;
 use app\common\state\ProjectState;
 use app\common\api\DictApi;
 use app\common\state\MainState;
 use app\common\model\TalentAllowance as TaModel;
 use app\common\state\AllowanceProjectEnum;
 use app\common\model\TalentChecklog;
+use think\facade\Db;
 
 /**
  * Description of TalentAllowance
@@ -124,7 +124,8 @@ class TalentAllowance extends EnterpriseController {
                 "createTime" => date("Y-m-d H:i:s"),
                 "createUser" => $user["uid"],
                 "id" => getStringId(),
-                "wage" => $param["wage"]
+                "wage" => $param["wage"],
+                "allowanceType" => $param["allowanceType"]
             ];
             /*             * 1.获取上一年度的人才层次 */
             $arrangeList = $this->getLastYearTalentType($data, $ti);
@@ -308,12 +309,13 @@ class TalentAllowance extends EnterpriseController {
      * @description 获取上一年度所在单位
      * */
     private function getConcatList($talentInfo, $info, $year) {
-        $totalMonth = \DateUtil::getMonthBetweenDates($year + "-01-01", $year + "-12-31");
+        $totalMonth = \DateUtil::getMonthBetweenDates($year . "-01-01", $year . "-12-31");
         /** 添加申报人才上一年度工作单位记录 */
         $where = [];
         $where[] = ["talentId", "=", $talentInfo["id"]];
         $where[] = ["checkState", "=", 3];
         $quitList = \app\common\model\TalentQuit::where($where)->field("enterpriseId,enterpriseName,talentType,identifyGetTime,starttime,endtime,entryTime,quitTime,post")->select()->toArray();
+
         /*         * * 将最新的人才数据转为工作变更记录(为了统一处理) */
         if ($talentInfo["active"] == 1) {
             $labor_contract_rangetime = explode(" - ", $talentInfo["labor_contract_rangetime"]);
@@ -331,12 +333,11 @@ class TalentAllowance extends EnterpriseController {
                 "post" => $talentInfo["position"]
             ];
         }
-        $count = 0;
         $list = [];
         foreach ($quitList as $quit) {
             $monthList = \DateUtil::getMonthBetweenDates($quit["entryTime"], \StrUtil::isEmpOrNull($quit["quitTime"]) ? $year . "-12-31" : $quit["quitTime"]);
             $monthList = array_intersect($monthList, $totalMonth);
-            if (!$monthList) {
+            if ($monthList) {
                 $list[] = [
                     "id" => getStringId(),
                     "mainId" => $info["id"],
@@ -352,7 +353,6 @@ class TalentAllowance extends EnterpriseController {
                     "isQuit" => \StrUtil::isEmpOrNull($quit["quitTime"]) ? 2 : 1,
                     "post" => $quit["post"]
                 ];
-                $count++;
             }
         }
         return $list;

+ 12 - 2
app/enterprise/view/talent_allowance/apply.html

@@ -73,6 +73,16 @@
                                                         {/if}
                                                     </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" onchange="TalentAllowanceInfoDlg.onAllowanceTypeChange(this.value);" value="{$row.allowanceType}">
+                                                            <option>请选择</option>
+                                                            <option value="1">工作津贴</option>
+                                                            <option value="2">一次性交通补贴</option>
+                                                        </select>
+                                                    </div>
+                                                </div>
                                                 <div class="rowGroup" id="talentTypeSpan">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>人才标签</label>
                                                     <div class="col-sm-2 spacing">
@@ -189,11 +199,11 @@
                                                         <input type="text" class="form-control" readonly="readonly" id="identifyGetTime" name="identifyGetTime" value="{$row.identifyGetTime}"/>
                                                     </div>
                                                 </div>
-                                                <div class="rowGroup" id="wageDiv" {neq name="row.active" value="2"}style="display: none"{/neq}>
+                                                <div class="rowGroup" id="wageDiv" style="display:none;">
                                                      <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>上一年度年薪(元)</label>
                                                     <div class="col-sm-2 spacing">
                                                         <input type="hidden" id="active" value="{$row.active}">
-                                                        <input type="text" class="form-control" id="wage" placeholder="正常工资薪金、一次性奖金收入(无需填写单位)" name="wage" value="{$row.wage}" {if condition="!$info['fields'] && $info['checkState']!=1"}readonly="readonly"{/if}/>
+                                                        <input type="text" class="form-control" id="wage" placeholder="正常工资薪金、一次性奖金收入(无需填写单位)" name="wage" value="{$row.wage}" {if condition="!$row['fields'] && $row['checkState']!=1 && $row['id']"}readonly="readonly"{/if}/>
                                                     </div>
                                                 </div>
 

+ 24 - 2
app/enterprise/view/talent_allowance/detail.html

@@ -72,6 +72,16 @@
                                                         <input type="text" class="form-control" readonly="readonly" id="name" name="name" value="{$row.name}" >
                                                     </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" disabled="disabled" class="form-control" id="allowanceType" name="allowanceType" value="{$row.allowanceType}">
+                                                            <option>请选择</option>
+                                                            <option value="1">工作津贴</option>
+                                                            <option value="2">一次性交通补贴</option>
+                                                        </select>
+                                                    </div>
+                                                </div>
                                                 <div class="rowGroup" id="talentTypeSpan">
                                                     <label class="col-sm-1 control-label spacing"><span style="color: red">*</span>人才标签</label>
                                                     <div class="col-sm-2 spacing">
@@ -214,7 +224,13 @@
                                     </h3>
                                 </div>
                                 <div class="panel-body">
-                                    <#table id="projectTable"/>
+                                    <table id="projectTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                                        <thead>
+                                            <tr>
+                                                <th data-field="selectItem" data-checkbox="true"></th>
+                                            </tr>
+                                        </thead>
+                                    </table>
                                 </div>
                             </div>
                             <div class="panel panel-default">
@@ -224,7 +240,13 @@
                                     </h3>
                                 </div>
                                 <div class="panel-body">
-                                    <#table id="fileTable"/>
+                                    <table id="fileTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                                        <thead>
+                                            <tr>
+                                                <th data-field="selectItem" data-checkbox="true"></th>
+                                            </tr>
+                                        </thead>
+                                    </table>
                                     <label style="padding-top: 15px;color: red">*请根据上传的附件材料,编辑好相应的文件夹名称</label><br>
                                     <label style="padding-top: 15px;color: red">声明:本人对输入材料的真实性负全部责任</label>
                                 </div>

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

@@ -15,7 +15,7 @@ TalentAllowanceInfoDlg.initFileTable = function (){
     queryData['project'] = CONFIG.project_jbt;
     queryData['type'] = $("#type").val();
     $("#fileTable").bootstrapTable({
-        url: Feng.ctxPath + "/api/talentInfo/findUnCommonFileType",
+        url: Feng.ctxPath + "/common/api/findUnCommonFileType",
         method: 'POST',
         contentType: "application/x-www-form-urlencoded; charset=UTF-8",
         search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
@@ -48,7 +48,7 @@ TalentAllowanceInfoDlg.initFileTable = function (){
             $("#fileTable").bootstrapTable('expandAllRows');
         },
         onExpandRow: function (index, row, $detail) {
-            var ajax = new $ax(Feng.ctxPath + "/api/talentInfo/listTalentFile", function (data) {
+            var ajax = new $ax(Feng.ctxPath + "/common/api/listTalentFile", function (data) {
                 if(data==null||data.length==0){
                     return;
                 }
@@ -94,7 +94,7 @@ TalentAllowanceInfoDlg.initFileTable = function (){
 TalentAllowanceInfoDlg.initContract = function(){
     $("#projectTable").bootstrapTable("destroy",{});
     $("#projectTable").bootstrapTable({
-        url: Feng.ctxPath + "/api/talentAllowance/findAllowanceContractDetail",
+        url: Feng.ctxPath + "/enterprise/talentAllowance/findAllowanceContractDetail",
         method: 'POST',
         contentType: "application/x-www-form-urlencoded; charset=UTF-8",
         search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
@@ -127,7 +127,7 @@ TalentAllowanceInfoDlg.initContract = function(){
             var cur_table = $detail.html('<table id="'+enterpriseId+'" class="mytable-hover"></table>').find('table');
             $(cur_table).bootstrapTable("destroy",{});
             $(cur_table).bootstrapTable({
-                url: Feng.ctxPath + "/api/talentAllowance/findAllowanceProject",
+                url: Feng.ctxPath + "/enterprise/talentAllowance/findAllowanceProject",
                 method: 'POST',
                 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                 search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
@@ -259,7 +259,7 @@ TalentAllowanceInfoDlg.showLog = function (id) {
         maxmin: true,
         success :function (layero, index) {
             $('#'+id).bootstrapTable({
-                url: Feng.ctxPath + "/api/talentChecklog/getJbtCheckLog",
+                url: Feng.ctxPath + "/common/api/getJbtCheckLog",
                 method: 'POST',
                 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
                 search: false,					// 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
@@ -307,7 +307,7 @@ TalentAllowanceInfoDlg.callBack = function (data){
     layer.close(data.obj);
     Feng.info(data.msg);
     if (data.code == 200) {
-        var ajax = new $ax(Feng.ctxPath + "/api/talentAllowance/updateSuppleState", function(data){
+        var ajax = new $ax(Feng.ctxPath + "/enterprise/talentAllowance/updateSuppleState", function(data){
             if(data.code == 200){
 
             }else{
@@ -336,11 +336,14 @@ $(function() {
         "displayCode": "id",
         "displayName": "name",
         "type": "GET",
-        "url": Feng.ctxPath + "/api/talentInfo/findTalentByEnterpriseInLibrary?type=1&year="+$("#year").val()
+        "url": Feng.ctxPath + "/enterprise/talent/findTalentByEnterpriseInLibrary?type=1&year="+$("#year").val()
     });
     if($("#type").val()==2){
         $("#bankNumberSpan,#talentTypeSpan,#introductionModeSpan,#firstInJJTimeSpan").attr("style","display:none");
     }
+    if ($("#allowanceType").val() == 1) {
+        $("#wageDiv").css("display", "block");
+    }
     //批量加载时间控件
     $(".date").each(function(){
         laydate.render({elem: "#"+$(this).attr("id"),type: 'date',trigger: 'click'});

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

@@ -4,7 +4,21 @@
 var TalentAllowanceInfoDlg = {
     talentAllowanceData: {},
     validateFields: {
-        talentId: {validators: {notEmpty: {message: '申报对象不能为空'}}}
+        talentId: {validators: {notEmpty: {message: '申报对象不能为空'}}},
+        allowanceType: {validators: {notEmpty: {message: '津补贴类型不能为空'}}},
+        wage: {
+            validators: {
+                callback: {
+                    message: "请填写上一年度年薪",
+                    callback: function (value, validator) {
+                        if ($("#allowanceType").val() == 1 && $("#wage").val().trim().length == 0) {
+                            return false;
+                        }
+                        return true;
+                    }
+                }
+            }
+        },
     }
 };
 
@@ -50,6 +64,7 @@ TalentAllowanceInfoDlg.collectData = function () {
     this.set('id')
             .set('talentId')
             .set('year')
+            .set('allowanceType')
             .set('wage');
 }
 /**
@@ -60,6 +75,14 @@ TalentAllowanceInfoDlg.validate = function () {
     $('#talentAllowanceForm').bootstrapValidator('validate');
     return $("#talentAllowanceForm").data('bootstrapValidator').isValid();
 }
+TalentAllowanceInfoDlg.onAllowanceTypeChange = function (allowanceType) {
+    $("#wageDiv").val("");
+    if (allowanceType == 1) {
+        $("#wageDiv").css("display", "block");
+    } else {
+        $("#wageDiv").css("display", "none");
+    }
+}
 
 /**
  * 选择申报对象初始化
@@ -68,13 +91,6 @@ TalentAllowanceInfoDlg.init = function () {
     var talentId = $("#name").val();
     if (Feng.isNotEmptyStr(talentId)) {
         var ajax = new $ax(Feng.ctxPath + "/enterprise/talent/getInfoById/id/" + talentId, function (data) {
-            if (data.active == 1) {
-                $("#wageDiv").css("display", "none");
-            } else if (data.active == 2) {
-                $("#wageDiv").css("display", "block").val("");
-            } else if (data.active == 3) {
-                Feng.info("上一年度不存在有效的单位");
-            }
             $("#active").val(data.active);
             $("#talentId").val(talentId);
             $("#talentTypeName").val(data.talentTypeName);
@@ -117,8 +133,8 @@ TalentAllowanceInfoDlg.addSubmit = function () {
         TalentAllowanceInfoDlg.editSubmit();
         return;
     }
-    var active = $("#active").val();
-    if (active == 2) {
+    var allowanceType = $("#allowanceType").val();
+    if (allowanceType == 1) {
         if (Feng.isEmptyStr(TalentAllowanceInfoDlg.talentAllowanceData.wage)) {
             Feng.info("请填写上一年度年薪");
             return;
@@ -751,6 +767,9 @@ $(function () {
     $("select").each(function () {
         $(this).val($(this).attr("value"));
     });
+    if ($("#allowanceType").val() == 1) {
+        $("#wageDiv").css("display", "block");
+    }
     TalentAllowanceInfoDlg.showAllLog();
     toastr.options = {
         "closeButton": true,

+ 10 - 5
public/static/modular/gate/talentAllowance/ic/talentAllowanceInfoIC.js

@@ -39,7 +39,7 @@ TalentAllowanceInfo.initColumn = function () {
                 if (value == null || value == "")
                     return "未判定";
                 if (value == 1)
-                    return "人才津贴";
+                    return "工作津贴";
                 if (value == 2)
                     return "一次性交通补贴";
                 if (value == 3)
@@ -56,7 +56,12 @@ TalentAllowanceInfo.initColumn = function () {
                     case 1:
                         html = "<span class='label'>待提交</span>"
                         break;
-                    case 5, 13, 15, 20, 25, 35:
+                    case 5:
+                    case 13:
+                    case 15:
+                    case 20:
+                    case 25:
+                    case 35:
                         html = "<span class='label label-success'>审核中</span>";
                         break;
                     case 10:
@@ -331,13 +336,13 @@ TalentAllowanceInfo.showLog = function (id) {
                                     return "" + value;
                                 }
                             },
-                            {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
-                            {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
                             {title: '描述', field: 'description', visible: true, align: 'center', valign: 'middle', width: "65%",
                                 formatter: function (value, row, index) {
                                     return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
                                 }
-                            }
+                            },
+                            {title: '操作人', field: 'createUser', visible: false, align: 'center', valign: 'middle', width: "15%"},
+                            {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "20%"},
                         ]
                 ,
                 onPostBody: function () {