Răsfoiți Sursa

Merge branch 'master' of http://59.57.98.130:3000/jjhc/report

sugangqiang 1 an în urmă
părinte
comite
9f96af6569

+ 1 - 0
app/common/api/MenuApi.php

@@ -232,6 +232,7 @@ class MenuApi {
         $menus[] = ["type" => [1, 2, 5, 6], "code" => "yhzhbg", "pcode" => "rcrd", "name" => "银行账号变更", "url" => "/enterprise/talent_bank_change/index", "icon" => "fa-thumbs-up", "status" => 1];
         $menus[] = ["type" => [1, 2, 5, 6], "code" => "rcccbg", "pcode" => "rcrd", "name" => "人才层次变更", "url" => "/enterprise/talent_type_change/index", "icon" => "fa-thumbs-up", "status" => 1];
         $menus[] = ["type" => [1, 2, 5, 6], "code" => "jcxxbg", "pcode" => "rcrd", "name" => "基础信息变更", "url" => "/enterprise/talent_basic_change/index", "icon" => "fa-thumbs-up", "status" => 1];
+        $menus[] = ["type" => [2], "code" => "htbg", "pcode" => "rcrd", "name" => "合同到期待变更", "url" => "/enterprise/talent_basic_change/htindex", "icon" => "fa-thumbs-up", "status" => 1];
         $menus[] = ["type" => [2, 5, 6], "code" => "jbtmanage", "pcode" => "0", "name" => "津补贴申报", "url" => "", "icon" => "fa-money", "status" => 1];
         $menus[] = ["type" => [2, 5, 6], "code" => "jbtsb", "pcode" => "jbtmanage", "name" => "津补贴申报", "url" => "/enterprise/talentAllowance/index", "icon" => "fa-thumbs-up", "status" => 1];
         $menus[] = ["type" => [1, 2, 5, 6], "code" => "gfbt", "pcode" => "0", "name" => "购房补贴", "url" => "", "icon" => "fa-university", "status" => 0];

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

@@ -639,6 +639,7 @@ class Api extends BaseController {
 
         if (!TalentApi::checkIsEditable($file["mainId"]))
             return json(["msg" => "当前状态不能删除或者文件已删除,请刷新重试。"]);
+
         if ($this->chkIsFileOwner($file["mainId"], $file["type"])) {
             if (!empty($file["url"])) {
                 $filepath = "storage/" . $file["url"];
@@ -883,6 +884,14 @@ class Api extends BaseController {
                         return true;
                 }
                 break;
+            case ProjectState::BASICCHANGE:
+                if ($this->user["usertype"] == 2) {
+                    $user_id = $this->user["uid"];
+                    $record = Db::table("un_talent_basic_change")->findOrEmpty($mainId);
+                    if ($user_id == $record["enterpriseId"])
+                        return true;
+                }
+                break;
         }
         return false;
     }

+ 41 - 0
app/enterprise/controller/TalentBasicChange.php

@@ -2,11 +2,14 @@
 
 namespace app\enterprise\controller;
 
+use app\common\api\TalentState;
+use app\enterprise\api\TalentApi;
 use app\enterprise\common\EnterpriseController;
 use app\common\model\TalentBasicChange as TbcModel;
 use app\common\api\TalentLogApi;
 use app\common\state\ProjectState;
 use app\common\model\TalentLog;
+use app\enterprise\model\Talent;
 use think\facade\Db;
 use app\common\api\EnterpriseApi;
 
@@ -74,6 +77,7 @@ class TalentBasicChange extends EnterpriseController {
     public function apply() {
         $request = $this->request;
         $id = isset($request["id"]) ? $request["id"] : 0;
+        $talent_id = isset($request["talent_id"]) ? $request["talent_id"] : 0;
         $info = TbcModel::where("id", $id)->find();
         if ($this->request->isPost()) {
             $response = new \stdClass();
@@ -142,6 +146,7 @@ class TalentBasicChange extends EnterpriseController {
         }
         $assigns["type"] = $this->user["type"];
         $assigns["row"] = $info;
+        $assigns['talent_id'] = $talent_id;
         return view("", $assigns);
     }
 
@@ -317,4 +322,40 @@ class TalentBasicChange extends EnterpriseController {
         return $response;
     }
 
+    public function htindex(){
+        return view("", ["type" => $this->user["type"]]);
+    }
+
+    public function htEndList(){
+        $offset = trim($this->request->param("offset")) ?: 0;
+        $limit = trim($this->request->param("limit")) ?: 10;
+        $name = trim($this->request->param("name"));
+        $idCard = trim($this->request->param("card_number"));
+        $where = [];
+        $where[] = ["ti.delete", "=", 0];
+        $where[] = ["ti.active", "=", 1];
+        $where[] = ["ti.checkState", "=", TalentState::CERTIFICATED];
+        if (session("user")["usertype"] == 2) {
+            $where[] = ["ti.enterprise_id", "=", session("user")["uid"]];
+        }
+
+        if ($name) {
+            $where[] = ["ti.name", "like", "%" . $name . "%"];
+        }
+        if ($idCard) {
+            $where[] = ["ti.card_number", "like", "%" . $idCard . "%"];
+        }
+        //dump($where);die;
+
+        $now = date("Y-m-d",time());
+        //$where[] = ["trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3))", "<", $now];
+
+
+        $count = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->count();
+        $list = Talent::alias("ti")->field("ti.id,ti.name,ti.card_number,ti.labor_contract_rangetime")->leftJoin("un_talent_basic_change tbc","ti.id = tbc.talentId")->where($where)->whereRaw("trim(SUBSTRING_INDEX(ti.labor_contract_rangetime,'-',-3)) < '{$now}' and tbc.id is null")->limit($offset, $limit)->select()->toArray();
+        //echo Talent::getLastSql();die;
+
+        return json(["total" => $count, "rows" => $list]);
+    }
+
 }

+ 1 - 0
app/enterprise/view/talent_basic_change/apply.html

@@ -49,6 +49,7 @@
                                                 <input type="hidden" name="enterpriseId" id="enterpriseId" value="{$row.enterpriseId}">
                                                 <input type="hidden" name="type" id="type" value="{$row.type}">
                                                 <input type="hidden" name="checkState" id="checkState" value="{$row.checkState}">
+                                                <input type="hidden" name="talent_id" id="talent_id" value="{$talent_id}">
                                                 {if condition="$row['id']"}<input type="hidden" name="talentId" id="talentId" value="{$row.talentId}">{/if}
                                                 <div class="row">
                                                     <div class="col-sm-12">

+ 55 - 0
app/enterprise/view/talent_basic_change/htindex.html

@@ -0,0 +1,55 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>合同管理</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">姓名</button>
+                                    </div>
+                                    <input type="text" class="form-control" id="name" placeholder="" />
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <div class="input-group input-group-sm">
+                                    <div class="input-group-btn">
+                                        <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">证件号码</button>
+                                    </div>
+                                    <input type="text" class="form-control" id="idCard" placeholder="" />
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentHetongChange.search()">
+                                    <i class="fa fa-search"></i>&nbsp;搜索
+                                </button>
+                                <button type="button" class="btn btn-sm btn-primary" onclick="TalentHetongChange.reset()">
+                                    <i class="fa fa-trash"></i>&nbsp;重置
+                                </button>
+                            </div>
+                        </div>
+                        <table id="TalentHetongChangeTable" 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>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/gate/talentLibrary/talentBasicChange/talentHetongChange.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/common/config.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 6 - 0
public/static/modular/gate/talentLibrary/talentBasicChange/talentBasicChange_info.js

@@ -87,7 +87,11 @@ TalentBasicChangeInfoDlg.collectData = function () {
 
 TalentBasicChangeInfoDlg.nameChange = function () {
     var talentId = $("#talentId").val();
+    if(Feng.isEmptyStr(talentId)){
+        talentId = $("#talent_id").val();
+    }
     if (Feng.isNotEmptyStr(talentId)) {
+        $("#talentId").val(talentId)
         var ajax = new $ax(Feng.ctxPath + "/enterprise/talent/getTalentBasicById/id/" + talentId, function (data) {
             var talentInfo = data;
             $("#oldBirthday").val(talentInfo.birthday);
@@ -291,4 +295,6 @@ $(function () {
             rtl: true
         });
     }
+
+    TalentBasicChangeInfoDlg.nameChange();
 });

+ 176 - 0
public/static/modular/gate/talentLibrary/talentBasicChange/talentHetongChange.js

@@ -0,0 +1,176 @@
+/**
+ * 合同信息变更管理初始化
+ */
+var TalentHetongChange = {
+    id: "TalentHetongChangeTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+TalentHetongChange.initColumn = function () {
+    return [
+        {field: 'selectItem', radio: true},
+        {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
+        {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: "150px", 'class': 'uitd_showTip'},
+        {title: '劳动合同时间', field: 'labor_contract_rangetime', visible: true, align: 'center', valign: 'middle', width: "100px", 'class': 'uitd_showTip'},
+
+        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
+            formatter: function (value, row, index) {
+                return "<span class='label label-success' onclick=\"TalentHetongChange.openAddTalentHetongChange('" + value + "')\" >" +
+                    "<i class=\"fa fa-book\"></i>更新合同" +
+                    "</span>";
+            }
+        }
+    ];
+};
+
+/**
+ * 检查是否选中
+ */
+TalentHetongChange.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if (selected.length == 0) {
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    } else {
+        TalentHetongChange.seItem = selected[0];
+        return true;
+    }
+};
+
+/**
+ * 点击添加人才基础信息变更
+ */
+TalentHetongChange.openAddTalentHetongChange = function (id=0) {
+    var index = layer.open({
+        type: 2,
+        title: '添加人才基础信息变更',
+        area: ['800px', '420px'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: Feng.ctxPath + '/enterprise/talent_basic_change/apply?talent_id='+id,
+        btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check 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.TalentBasicChangeInfoDlg.addSubmit();
+        }, btn2: function (index, layero) {
+            var obj = layero.find("iframe")[0].contentWindow;
+            obj.TalentBasicChangeInfoDlg.submitToCheck();
+            return false;
+        },
+        success: function (layero, index) {
+            layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
+        },
+        end: function () {
+            layer.closeAll('tips');
+        }
+    });
+    TalentHetongChange.layerIndex = index;
+    layer.full(index);
+};
+
+/**
+ * 打开查看人才基础信息变更详情
+ */
+TalentHetongChange.openTalentHetongChangeDetail = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '人才基础信息变更详情',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/enterprise/talent_basic_change/apply/id/' + TalentHetongChange.seItem.id,
+            btn: ['<i class="fa fa-eye"></i>&nbsp;&nbsp;保存未提交', '<i class="fa fa-check 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.TalentHetongChangeInfoDlg.addSubmit();
+            }, btn2: function (index, layero) {
+                var obj = layero.find("iframe")[0].contentWindow;
+                obj.TalentHetongChangeInfoDlg.submitToCheck();
+                return false;
+            },
+            success: function (layero, index) {
+                layer.tips('添加基本信息并上传附件后点击', '.layui-layer-btn1', {tips: [1, "#78BA32"], time: 0, closeBtn: 2});
+            },
+            end: function () {
+                layer.closeAll('tips');
+            }
+        });
+        TalentHetongChange.layerIndex = index;
+        layer.full(index);
+    }
+};
+
+TalentHetongChange.openTalentHetongChangeSelect = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '人才基础信息变更详情',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/enterprise/talent_basic_change/view/id/' + TalentHetongChange.seItem.id
+        });
+        TalentHetongChange.layerIndex = index;
+        layer.full(index);
+    }
+}
+
+/**
+ * 删除人才基础信息变更
+ */
+TalentHetongChange.delete = function () {
+    if (this.check()) {
+        var ajax = new $ax(Feng.ctxPath + "/enterprise/talent_basic_change/delete", function (data) {
+            Feng.success("删除成功!");
+            TalentHetongChange.table.refresh();
+        }, function (data) {
+            Feng.error("删除失败!" + data.responseJSON.message + "!");
+        });
+        ajax.set("id", this.seItem.id);
+        ajax.start();
+    }
+};
+
+TalentHetongChange.formParams = function () {
+    var queryData = {};
+    queryData['name'] = $("#name").val();
+    queryData['card_number'] = $("#idCard").val();
+    return queryData;
+}
+
+/**
+ * 查询人才基础信息变更列表
+ */
+TalentHetongChange.search = function () {
+    TalentHetongChange.table.refresh({query: TalentHetongChange.formParams()});
+};
+
+TalentHetongChange.reset = function () {
+    $("#oldName").val("");
+    $("#oldCardType").val("");
+    $("#oldIdCard").val("");
+    $("#newName").val("");
+    $("#newCardType").val("");
+    $("#newIdCard").val("");
+    $("#checkState").val("");
+}
+
+$(function () {
+    var defaultColunms = TalentHetongChange.initColumn();
+    var table = new BSTable(TalentHetongChange.id, "/enterprise/talent_basic_change/htEndList", defaultColunms);
+    table.setPaginationType("server");
+    TalentHetongChange.table = table.init();
+    var arr = [
+        {"name": "oldCardType", "code": "card_type"},
+        {"name": "newCardType", "code": "card_type"}
+    ];
+    Feng.findChildDictBatch(JSON.stringify(arr));
+});