Browse Source

卫健批量审核++

sugangqiang 1 year ago
parent
commit
56ee73eecb

+ 14 - 6
app/admin/controller/Talent.php

@@ -193,7 +193,7 @@ class Talent extends AdminController {
                 TalentLogApi::write(1, $id, TalentState::FST_VERIFY_FAIL, $msg, 1);
                 TalentModel::update($data);
                 $counts++;
-            } else if($ti["checkState"] == TalentState::FST_SAVE || $ti["checkState"] == TalentState::SCND_SAVE) {
+            } else if ($ti["checkState"] == TalentState::FST_SAVE || $ti["checkState"] == TalentState::SCND_SAVE) {
                 $data["checkState"] = TalentState::FST_VERIFY_FAIL;
                 $data['delete'] = 1;
                 TalentLogApi::write(1, $id, TalentState::FST_VERIFY_FAIL, $msg, 1);
@@ -216,6 +216,14 @@ class Talent extends AdminController {
         return json(VerifyApi::getList($params));
     }
 
+    /**
+     * 等初审列表
+     */
+    public function find_fst_list() {
+        $params = $this->request->param();
+        return new \app\common\api\Response(\app\common\api\Response::SUCCESS, "", VerifyApi::getFstList($params));
+    }
+
     public function base_reverify() {
         $enterprises = EnterpriseApi::getSimpleList();
         return view("", ["enterprises" => $enterprises]);
@@ -313,7 +321,7 @@ class Talent extends AdminController {
      * @auth {{/talentInfo/gotoIndex/4}}
      */
     public function pre_list() {
-        switch ($this->user["type"]){
+        switch ($this->user["type"]) {
             case 1:
                 $message = [
                     "typeName" => "晋江市现代产业体系人才认定", "address" => "聚才网/人才晋江微信公众号", "dep" => "中共晋江市委人才办、晋江市纪委监委驻市人力资源和社会保障局纪检监察组或晋江市公共就业和人才服务中心",
@@ -487,7 +495,7 @@ class Talent extends AdminController {
             }
         }
         if ($rows) {
-            switch ($this->user["type"]){
+            switch ($this->user["type"]) {
                 case 1:
                     $filename = "现代产业体系人才公示预览导出";
                     break;
@@ -536,7 +544,7 @@ class Talent extends AdminController {
             $i++;
         }
         if ($rows) {
-            switch ($this->user["type"]){
+            switch ($this->user["type"]) {
                 case 1:
                     $filename = "现代产业体系人才公示预览导出";
                     break;
@@ -711,7 +719,7 @@ class Talent extends AdminController {
             }
         }
         $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "认定人才层次", "审核状态", "备注"];
-        switch ($this->user["type"]){
+        switch ($this->user["type"]) {
             case 1:
                 $filename = "现代产业体系人才" . date("Ym") . "公布预览名单导出(公示批次-" . $list[0]["publicBatch"] . ")";
                 break;
@@ -760,7 +768,7 @@ class Talent extends AdminController {
         }
 
         $columns = ["序号", "批次", "姓名", "性别", "工作单位", "本人具备的认定条件", "认定人才层次", "审核状态", "备注"];
-        switch ($this->user["type"]){
+        switch ($this->user["type"]) {
             case 1:
                 $filename = "现代产业体系人才" . date("Ym") . "公布名单导出(公示批次-" . $list[0]["publicBatch"] . ")";
                 break;

+ 77 - 0
app/admin/view/talent/hospital/fst_verify.html

@@ -250,6 +250,11 @@
                                 <i class="fa fa-check"></i>&nbsp;审核
                             </button>
                             {/if}
+                            {if condition="chkCommission('/admin/talent/fst_batch_check','/talentInfo/firstBatchCheck')"}
+                            <!--<button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.openBatchCheckModal()" id="">
+                                <i class="fa fa-check-circle-o"></i>&nbsp;批量审核
+                            </button>-->
+                            {/if}
                             {if condition="chkCommission('/admin/talent/fstVerifyListExport','/talentInfo/firstExport')"}
                             <button type="button" class="btn btn-sm btn-primary " onclick="TalentInfo.showExportModal(1)" id="">
                                 <i class="fa fa-file-excel-o"></i>&nbsp;导出
@@ -294,6 +299,78 @@
         </div>
     </div>
 </div>
+<!--批量审核-->
+<div class="modal fade " id="batchCheckModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel2">
+    <div class="modal-dialog modal-lg" role="document" style="min-width: 1200px;">
+        <div class="modal-content animated flipInY">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
+                <h4 class="modal-title" id="batchCheckModalLable">批量审核</h4>
+            </div>
+            <div class="modal-body">
+                <form class="form-horizontal" style="padding-bottom: 5px;">
+                    <div class="form-group-sm">
+                        <div class="row">
+                            <div class="rowGroup">
+                                <label class="col-sm-1 control-label">申报年度</label>
+                                <div class="col-sm-3 spacing">
+                                    <input type="text" class="form-control input-sm"  id="bc_apply_year" name="apply_year" >
+                                </div>
+                            </div>
+                            <div class="rowGroup">
+                                <label class="col-sm-1 control-label">姓名</label>
+                                <div class="col-sm-3 spacing">
+                                    <input type="text" class="form-control input-sm"  id="bc_name" name="name" >
+                                </div>
+                            </div>
+                            <div class="rowGroup">
+                                <label class="col-sm-1 control-label">医院名称</label>
+                                <div class="col-sm-3 spacing">
+                                    <select  class="form-control input-sm"  id="bc_enterprise_id" name="enterprise_id" >    
+                                        <option value="">请选择</option>
+                                        {volist name="enterprises" id="item"}
+                                        <option value="{$item.id}">{$item.name}</option>
+                                        {/volist}
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="rowGroup">
+                                <label class="col-sm-1 control-label">医共体</label>
+                                <div class="col-sm-3 spacing">
+                                    <select  class="form-control input-sm"  id="bc_medicalCommunityId" name="medicalCommunityId" >
+                                        <option value="">请选择</option>
+                                        {volist name="medicalCommunities" id="item"}
+                                        <option value="{$item.id}">{$item.name}</option>
+                                        {/volist}
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="rowGroup">
+                                <label class="col-sm-1 control-label">人才层次</label>
+                                <div class="col-sm-3 spacing">
+                                    <select  class="form-control input-sm"  id="bc_talent_arrange" name="talent_arrange" >
+                                        <option value="">请选择</option>
+                                    </select>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+                <div class="toolbar" style="padding-bottom: 5px;text-align: center">
+                    <button type="button" class="btn btn-sm btn-info" onclick="TalentInfo.bcSearch()"><i class="fa fa-search"></i>搜索</button>
+                    <button type="button" class="btn btn-sm btn-danger" onclick="TalentInfo.bcReset()"><i class="fa fa-trash"></i>重置</button>
+                    <button id="checkAllBatch" class="btn btn-secondary btn-sm btn-success"><i class="fa fa-check-square-o"></i>全选</button>
+                    <button id="uncheckAllBatch" class="btn btn-secondary btn-sm btn-danger"><i class="fa fa-ban"></i>取消全选</button>
+                </div>
+                <table id="batchCheckTable" class="table-condensed table-sm" style="font-size: 12px;"></table>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" id="batchCheckButton" onclick="TalentInfo.batchCheck()">批量审核</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
 <!--导出模态框-->
 <div class="modal fade " id="commonExportModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
     <div class="modal-dialog modal-lg" role="document" style="min-width: 1000px">

+ 40 - 0
app/common/api/VerifyApi.php

@@ -16,6 +16,46 @@ use app\common\model\TalentCondition;
  */
 class VerifyApi {
 
+    public static function getFstList($params) {
+        $where = [];
+        $order = $params["order"] ?: "desc";
+        $offset = $params["offset"] ?: 0;
+        $limit = $params["limit"] ?: 10;
+        $type = session("user")["type"];
+        if ($params["name"]) {
+            $where[] = ["ti.name", "like", "%{$params["name"]}%"];
+        }
+        if ($params["apply_year"]) {
+            $where[] = ["ti.apply_year", "like", "{$params["apply_year"]}%"];
+        }
+        if ($params["enterprise_id"]) {
+            $where[] = ["ti.enterprise_id", "=", $params["enterprise_id"]];
+        }
+        if ($params["medicalCommunityId"]) {
+            $where[] = ["e.medicalCommunityId", "=", $params["medicalCommunityId"]];
+        }
+        if ($params["talent_arrange"]) {
+            $where[] = ["ti.talent_arrange", "=", $params["talent_arrange"]];
+        }
+        $where[] = ["e.type", "=", $type];
+        $where[] = ["ti.checkState", "=", TalentState::SCND_SUBMIT];
+        $where[] = ["ti.delete", "=", 0];
+        $count = Talent::alias("ti")
+                        ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
+                        ->where($where)->count();
+        $list = Talent::alias("ti")
+                        ->leftJoin("un_enterprise e", "e.id=ti.enterprise_id")
+                        ->where($where)->limit($offset, $limit)->order("ti.createTime " . $order)->field("ti.*,e.name as enterpriseName,e.isGeneral,e.medicalCommunityId")->select()->toArray();
+
+        $talent_arrange_kvs = DictApi::selectByParentCode("talent_arrange");
+        $medicalCommunity_kvs = Nhc::getMedicalCommunityMap();
+        foreach ($list as &$item) {
+            $item["talentArrangeName"] = $talent_arrange_kvs[$item["talent_arrange"]];
+            $item["medicalCommunityName"] = $item["medicalCommunityId"] ? $medicalCommunity_kvs[$item["medicalCommunityId"]] : null;
+        }unset($item);
+        return ["total" => $count, "rows" => $list];
+    }
+
     public static function getTalentInfoById($id, $isAdmin = false) {//添加admin只为区别导入数据管理端的显示差异
         $info = self::getOne($id);
         if ($info) {

+ 160 - 0
public/static/modular/talentIdentify/talentInfo/hospital/talentInfo_base.js

@@ -253,6 +253,143 @@ TalentInfo.openCheckTalentInfo = function () {
 }
 
 
+TalentInfo.commonColumns = function () {
+    return [
+        {field: "selectItem", checkbox: true},
+        {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: "10%"},
+        {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "15%"},
+        {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', width: "15%"},
+        {title: '人才层次', field: 'talentArrangeName', visible: true, align: 'center', valign: 'middle', width: "15%"},
+        {title: '医院名称', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "30%",
+            formatter: function (value, row, index) {
+                return value + (row.isGeneral == 1 ? "(总院)" : "");
+            }
+        },
+        {title: '所属医共体', field: 'medicalCommunityName', visible: true, align: 'center', valign: 'middle', width: "15%"}
+    ];
+}
+
+TalentInfo.openBatchCheckModal = function (type) {
+    var columns = TalentInfo.commonColumns();
+    $('#batchCheckTable').bootstrapTable('destroy');
+    $('#batchCheckTable').bootstrapTable({
+        url: Feng.ctxPath + "/admin/talent/find_fst_list",
+        method: 'POST',
+        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+        search: true, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
+        showRefresh: false, // 是否显示刷新按钮
+        clickToSelect: true, // 是否启用点击选中行
+        singleSelect: false, // 设置True 将禁止多选
+        striped: true, // 是否显示行间隔色
+        pagination: true, // 设置为 true 会在表格底部显示分页条
+        paginationHAlign: "left",
+        paginationDetailHAlign: "right",
+        sidePagination: "client", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
+        pageNumber: 1, //初始化加载第一页,默认第一页
+        pageSize: 10, //每页的记录行数(*)
+        pageList: [10, 25, 50, 100, 500, 1000, 1500], //可供选择的每页的行数(*)
+        maintainSelected: true, //全表全选需要开启
+        showColumns: false,
+        responseHandler: function (res) {
+            $(".time").each(function () {
+                laydate.render({
+                    elem: "#" + $(this).attr("id")
+                    , type: 'date'
+                    , format: 'yyyy年MM月dd日'
+                });
+            });
+            $("#batchCheckModal").modal("show");
+            return res.obj.rows;
+        },
+        columns: columns
+    });
+}
+
+/**
+ * 刷新检索
+ */
+TalentInfo.bcSearch = function () {
+    var apply_year = $("#bc_apply_year").val();
+    var name = $("#bc_name").val();
+    var enterprise_id = $("#bc_enterprise_id").val();
+    var medicalCommunityId = $("#medicalCommunityId").val();
+    var talent_arrange = $("#bc_talent_arrange").val();
+    $('#batchCheckTable').bootstrapTable("refresh", {"query": {"name": name, "enterprise_id": enterprise_id, "talent_arrange": talent_arrange, "apply_year": apply_year, "medicalCommunityId": medicalCommunityId}});
+}
+
+/**
+ * 重置
+ */
+TalentInfo.bcReset = function () {
+    $("#bc_apply_year").val("");
+    $("#bc_name").val("");
+    $("#bc_enterprise_id").val("");
+    $("#medicalCommunityId").val("");
+    $("#bc_talent_arrange").val("");
+}
+
+$('#checkAllBatch').click(function () {
+    $("#batchCheckTable").bootstrapTable('togglePagination').bootstrapTable('checkAll').bootstrapTable('togglePagination');
+})
+$('#uncheckAllBatch').click(function () {
+    $("#batchCheckTable").bootstrapTable('togglePagination').bootstrapTable('uncheckAll').bootstrapTable('togglePagination')
+})
+
+
+TalentInfo.batchCheck = function () {
+    var selected = $('#batchCheckModal').bootstrapTable('getSelections');
+    if (!selected || selected.length < 1) {
+        Feng.info("请至少选择一行数据!");
+        return;
+    }
+    var ids = "";
+    var count = 0;
+    for (var i = 0; i < selected.length; i++) {
+        count++;
+        ids = ids + selected[i].id + ",";
+    }
+    var operation = function () {
+        var index = layer.open({
+            type: 1,
+            title: '批量审核',
+            area: ['300px', '220px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: TalentInfo.creatBatchCheckModal(),
+            btn: ['<i class="fa fa-save layui-bg-green"></i>&nbsp;&nbsp;提交审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+            btnAlign: 'c',
+            success: function () {
+
+            },
+            yes: function (index, layero) {
+                var allowanceType = $("input[name=batchAllowanceType]:checked").val();
+                if (Feng.isEmptyStr(allowanceType) || typeof allowanceType == "undefined") {
+                    Feng.info("请选择补贴类型");
+                    return;
+                }
+                layer.close(index);
+                var allowanceTypeStr = allowanceType == 1 ? "工作津贴" : "一次性交通补贴";
+                Feng.confirm("已选<span style='color:#ff0000;'>" + count + "</span>人,确定要批量申请<span style='color:#ff0000;'>" + allowanceTypeStr + "</span>吗?<br><span style='color:#ff0000;'>*此方法不能撤销,请谨慎操作</span>", function () {
+                    var ajax = new $ax("/admin/talent/fst_batch_check", function (data) {
+                        if (data.code == 200) {
+                            Feng.success(data.msg);
+                            TalentInfo.table.refresh();
+                            $("#batchApplyModal").modal("hide");
+                        } else {
+                            Feng.error(data.msg);
+                        }
+                    }, function (data) {
+                        Feng.error("公示失败!" + data.responseJSON.message + "!");
+                    });
+                    ajax.set("ids", ids);
+                    ajax.set("allowanceType", allowanceType);
+                    ajax.start();
+                });
+            }
+        });
+    }
+    Feng.confirm("确定进入下一步选择补贴类型吗?", operation);
+}
 
 /**
  * 打开查看人才认定-初级审核详情
@@ -483,6 +620,29 @@ TalentInfo.setNotPass = function () {
 
 }
 
+TalentInfo.creatBatchCheckModal = function () {
+    return '<form id="firstCheckForm">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <div >\n' +
+            '                        <label for="checkMsg" class="control-label" >审核意见</label>\n' +
+            '                        <textarea class="form-control" id="checkMsg" placeholder="审核状态属“审核通过”的,仅代表此步骤已操作完成,不代表用户提交的信息符合认定条件。若不符合认定条件的,请写明不符合原因。" rows="6"></textarea>\n' +
+            '                            <label for="checkMsg" class="control-label">可修改字段</label>\n' +
+            '                            <div id="field_info">\n' +
+            '                                <ul>\n' +
+            '                                </ul>\n' +
+            '                            </div>\n' +
+            '                            <label for="checkMsg" class="control-label">可修改附件</label>\n' +
+            '                            <div id="field_file">\n' +
+            '                            </div>\n' +
+            '                            <div class="form-group" style="text-align: center">\n' +
+            '                                <button type="button" class="btn btn-primary" onclick="TalentInfo.checkAll()">全选</button>\n' +
+            '                                <button type="button" class="btn btn-success" onclick="TalentInfo.unCheckAll()">反选</button>\n' +
+            '                            </div>\n' +
+            '                        </div>\n' +
+            '                    </div>\n' +
+            '                </form>';
+}
+
 
 TalentInfo.creatFieldCheckModal = function () {
     return '<form id="firstCheckForm">\n' +

+ 3 - 0
public/static/modular/talentIdentify/talentInfo/talentInfo_common.js

@@ -221,6 +221,9 @@ TalentInfo.init = function () {
         {"name": "source", "code": "source"},
         {"name": "street", "code": "street"},
         {"name": "enterprise_tag", "code": "enterprise_tag"}, ];
+    if($("#bc_talent_arrange").length > 0){
+        arr.push({"name": "bc_talent_arrange", "code": "talent_arrange"});
+    }
     Feng.findChildDictBatch(JSON.stringify(arr));
     //TalentInfo.getIdentifyCondition();
     TalentInfo.getProvince();