sugangqiang 2 lat temu
rodzic
commit
b398d74219

+ 14 - 0
app/admin/controller/IntegralVerify.php

@@ -114,6 +114,20 @@ class IntegralVerify extends AdminController {
         return view("", ["enterprises" => $enterprises]);
     }
 
+    /**
+     * 历史积分
+     */
+    public function integralLog() {
+        $cardType = $this->request["cardType"];
+        $cardNumber = $this->request["cardNumber"];
+        $where[] = ["card_type", "=", $cardType];
+        $where[] = ["card_number", "=", $cardNumber];
+        $where[] = ["checkState", "=", IntegralState::SUCCESS];
+        $enterprise_ids = IntegralRecord::where($where)->column("enterprise_id");
+        $enterprises = EnterpriseApi::getSimpleList([["id", "in", $enterprise_ids]]);
+        return view("", ["enterprises" => $enterprises, "cardType" => $cardType, "cardNumber" => $cardNumber]);
+    }
+
     public function selectNeedCheckData() {
         $params = $this->request->param();
         return json(["code" => 200, "obj" => IntegralRecordApi::getPublicList($params)]);

+ 148 - 0
app/admin/view/integral_verify/integral_log.html

@@ -0,0 +1,148 @@
+{extend name="layout/content"}
+{block name="content"}
+<style type="text/css">
+    .layui-layer-btn .layui-layer-btn1 {
+        border-color: #009688;
+        background-color: #009688;
+        color: #fff;
+    }
+    ul li{
+        list-style: none;
+        display:inline-block;
+        margin-bottom: 5px;
+    }
+    #field ul li input{
+        vertical-align:middle;
+        margin-top:1px;
+    }
+</style>
+<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">
+                            <input type="hidden" id="type" value="{$type}">
+                            <input type="hidden" id="process" value="5">
+                            <input type="hidden" id="card_type" value="{$cardType}">
+                            <input type="hidden" id="card_number" value="{$cardNumber}">
+                            <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="apply_year" 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>
+                                    <select class="form-control" id="enterprise_id">
+                                        {volist name="enterprises" id="item"}
+                                        <option value="{$item.id}">{$item.name}</option>
+                                        {/volist}
+                                    </select>
+                                </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>
+                                    <select class="form-control" id="shareholder">
+                                        <option value="">---请选择---</option>
+                                        <option value="1">是</option>
+                                        <option value="2">否</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralVerify.search()" id="">
+                                    <i class="fa fa-search"></i>&nbsp;搜索
+                                </button>
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralVerify.reset()" id="">
+                                    <i class="fa fa-trash"></i>&nbsp;重置
+                                </button>
+                            </div>
+                        </div>
+                        <div class="hidden-xs" id="IntegralLogTableToolbar" role="group">
+                            <button type="button" class="btn btn-sm btn-primary " onclick="IntegralVerify.openCheckIntegralVerify()" id="">
+                                <i class="fa fa-check"></i>&nbsp;查看
+                            </button>
+                            <button type="button" class="btn btn-sm btn-primary " onclick="IntegralVerify.showExportModal(1)" id="">
+                                <i class="fa fa-file-excel-o"></i>&nbsp;导出
+                            </button>
+                            <button type="button" class="btn btn-sm btn-primary " onclick="IntegralVerify.download()" id="">
+                                <i class="fa fa-download"></i>&nbsp;下载
+                            </button>
+                        </div>
+                        <table id="IntegralLogTable" 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><!--导出模态框-->
+<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">
+        <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="firstModalLabel">导出</h4>
+            </div>
+            <div class="modal-body">
+                <form id="exportForm" action="/talentInfoExport/publicExport" target="hiddenIframe" class="form-horizontal">
+                    <div class="form-group" id="field">
+                        <div id="field_info">
+                            <ul>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="name"><span>姓名</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="card_type"><span>证件类型</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="card_number"><span>证件号码</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="phone"><span>手机号码</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="email"><span>电子邮箱</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="enterpriseName"><span>单位名称</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="street"><span>所属镇街</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="shareholder"><span>是否股东</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="year"><span>申报年度</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="project"><span>申报项目</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="checkState"><span>审核状态</span></li>
+                                <li style="width:24%"><input type="checkbox" name="export[]" value="checkMsg"><span>审核意见</span></li>
+                            </ul>
+                        </div>
+                        <div class="form-group" style="text-align: center">
+                            <button type="button" class="btn btn-primary" onclick="IntegralVerify.checkAll()">全选</button>
+                            <button type="button" class="btn btn-success" onclick="IntegralVerify.unCheckAll()">反选</button>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" onclick="IntegralVerify.export(5)">导出</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/talentIdentify/integralMgr/IntegralLog.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/common/config.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 4 - 1
app/common/api/EnterpriseApi.php

@@ -18,9 +18,12 @@ class EnterpriseApi {
         return $ep;
     }
 
-    public static function getSimpleList() {
+    public static function getSimpleList($extra = array()) {
         $where[] = ["active", "=", 1];
         $where[] = ["delete", "=", 0];
+        if ($extra) {
+            $where = array_merge($where, $extra);
+        }
         return $list = Enterprise::where($where)->order("name", 'asc')->field("name,id")->select()->toArray();
     }
 

+ 4 - 1
app/common/api/IntegralRecordApi.php

@@ -201,6 +201,9 @@ class IntegralRecordApi {
                 break;
             case 4:
                 return self::getLibraryList($params);
+            case 5:
+                $where[] = ["ir.checkState", "=", IntegralState::SUCCESS];
+                break;
         }
         $where[] = ["ir.delete", "=", 0];
         if ($params["apply_year"]) {
@@ -233,7 +236,7 @@ class IntegralRecordApi {
                         ->leftJoin("sys_batch b", "b.id=ir.batch_id")
                         ->leftJoin("un_enterprise e", "e.id=ir.enterprise_id")
                         ->leftJoin("(select description,mainId,last_state,new_state,state,createTime from new_talent_checklog where md5(concat(createTime,mainId,`type`)) in (select md5(concat(max(createTime),mainId,`type`)) from `new_talent_checklog` where `type`=20 and `step` is null and active=1 and typeFileId is null group by mainId,`type`)) tl", "`tl`.`mainId`=ir.id")
-                        ->field("ir.*,e.name as enterpriseName,b.batch as apply_year,tl.state as real_state,tl.last_state,if(ir.updateTime is not null,ir.updateTime,ir.createTime) as orderTime")->limit($offset, $limit)->order("orderTime " . $order)->select();
+                        ->field("ir.*,e.name as enterpriseName,b.batch as apply_year,tl.state as real_state,tl.last_state")->limit($offset, $limit)->order("tl.createTime " . $order)->select();
         foreach ($list as $key => $item) {
             $tmp_items = [];
             foreach ($item["detail"] as $_item) {

+ 240 - 0
public/static/modular/talentIdentify/integralMgr/IntegralLog.js

@@ -0,0 +1,240 @@
+/**
+ * 积分记录
+ */
+var IntegralVerify = {
+    id: "IntegralLogTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+IntegralVerify.formParams = function () {
+    var queryData = {};
+    queryData['card_type'] = $("#card_type").val();
+    queryData['card_number'] = $("#card_number").val();
+    queryData['apply_year'] = $("#apply_year").val();
+    queryData['enterprise_id'] = $("#enterprise_id").val();
+    queryData['shareholder'] = $("#shareholder").val();
+    return queryData;
+}
+
+/**
+ * 初始化表格的列
+ */
+IntegralVerify.initColumn = function () {
+    var type = $("#type").val();
+    return [
+        {field: 'selectItem', radio: true},
+        {title: '申报年度', field: 'apply_year', visible: true, align: 'center', valign: 'middle', width: '80px'},
+        {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle', width: "100px",
+            formatter: function (value, row, index) {
+                if (row.sex == 1) {
+                    return value + '<span style="color:#6495ED">【男】</span>';
+                } else if (row.sex == 2) {
+                    return value + '<span style="color:#FF82AB">【女】</span>';
+                } else {
+                    return value;
+                }
+            }
+        },
+        {title: '证件号码', field: 'card_number', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
+        {title: '所属单位', field: 'enterpriseName', visible: true, align: 'center', valign: 'middle', width: "100px"},
+        {title: '是否股东', field: 'shareholder', visible: true, align: 'center', valign: 'middle', width: "100px",
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return '是';
+                }
+                if (value == 2) {
+                    return '否';
+                }
+            }
+        },
+        {title: '申报标准', field: 'details', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "120px"},
+        {title: '首次提交时间', field: 'first_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
+        {title: '最新提交时间', field: 'new_submit_time', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: "100px"},
+        {title: '增加积分', field: 'totalPoints', visible: true, align: 'center', valign: 'middle', width: "100px",
+            formatter: function (value, row, index) {
+                return value;
+            }
+        },
+        {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: "80px",
+            formatter: function (value, row, index) {
+                return "<span class='label label-success' onclick=\"IntegralVerify.showLog('" + value + "')\" >" +
+                        "<i class=\"fa fa-book\"></i>日志" +
+                        "</span>";
+            }
+        }
+    ];
+};
+/**
+ * 检查是否选中
+ */
+IntegralVerify.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if (selected.length != 1) {
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    } else {
+        IntegralVerify.seItem = selected[0];
+        return true;
+    }
+};
+
+
+/**
+ * 查询人才认定申报列表
+ */
+IntegralVerify.search = function () {
+    IntegralVerify.table.refresh({query: IntegralVerify.formParams()});
+};
+
+/**
+ * 重置
+ */
+IntegralVerify.reset = function () {
+    $("#name").val("");
+    $("#card_number").val("");
+    $("#phone").val("");
+    $("#email").val("");
+    $("#checkState").val("");
+    $("#apply_year").val("");
+    $("#enterprise_id").val("").trigger("chosen:updated");
+    $("#shareholder").val("");
+}
+/**
+ * 显示导出模态框
+ */
+IntegralVerify.showExportModal = function () {
+    $("#exportForm")[0].reset();
+    $("#commonExportModal").modal("show");
+}
+
+/**
+ * 导出提交
+ */
+IntegralVerify.export = function (process) {
+    var names = '';
+    var values = '';
+    var commonExport = "";
+    $("#field_info li input").each(function (index) {
+        if ($(this).is(":checked")) {
+            values = values + $(this).val() + ",";
+            names = names + $(this).next().text() + ",";
+        }
+    });
+    var queryData = IntegralVerify.formParams();
+    commonExport = "integralLogListExport";
+    $("#commonExportModal").modal('hide');
+    var params = $("#exportForm").serialize();
+    var url = "/admin/integralVerify/" + commonExport + "?" + params;
+    window.location.href = url;
+}
+/**
+ * 下载
+ */
+IntegralVerify.download = function () {
+    if (this.check()) {
+        window.location.href = encodeURI(encodeURI(Feng.ctxPath + "/common/api/downloadZip?type=20&id=" + IntegralVerify.seItem.id));
+    }
+}
+
+
+IntegralVerify.openCheckIntegralVerify = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '积分申报记录',
+            area: ['800px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: '/admin/integralVerify/detail/id/' + IntegralVerify.seItem.id + '/1',
+            btn: ['<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+            btnAlign: 'c'
+        });
+        layer.full(index);
+        IntegralVerify.layerIndex = index;
+    }
+}
+
+/**
+ * 显示审核日志
+ */
+IntegralVerify.showLog = function (id) {
+    layer.open({
+        type: 1,
+        title: "日志",
+        fixed: false,
+        content: '<table id="' + id + '"></table>',
+        area: ['80%', '80%'],
+        maxmin: true,
+        success: function (layero, index) {
+            Feng.getCheckLog(id, {"type": CONFIG.project_integral_apply, "mainId": id, "typeFileId": "", "active": 1})
+        }
+    });
+}
+
+IntegralVerify.creatFieldCheckModal = function () {
+    return '<form id="firstCheckForm">\n' +
+            '                    <div class="form-group" style="margin: 10px;">\n' +
+            '                        <div >\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="IntegralVerify.checkAll()">全选</button>\n' +
+            '                                <button type="button" class="btn btn-success" onclick="IntegralVerify.unCheckAll()">反选</button>\n' +
+            '                            </div>\n' +
+            '                        </div>\n' +
+            '                    </div>\n' +
+            '                </form>';
+}
+
+/**
+ * 全选
+ */
+IntegralVerify.checkAll = function () {
+    $("#field_info input").each(function () {
+        this.checked = true;
+    })
+}
+/**
+ * 反选
+ */
+IntegralVerify.unCheckAll = function () {
+    $("#field_info input").each(function () {
+        if (this.checked) {
+            this.checked = false;
+        } else {
+            this.checked = true;
+        }
+    })
+}
+
+$(function () {
+    var defaultColunms = IntegralVerify.initColumn();
+    var process = $("#process").val();
+    var card_type = $("#card_type").val();
+    var card_number = $("#card_number").val();
+    var table = new BSTable(IntegralVerify.id, "/admin/integralVerify/list/process/" + process + "/card_type/" + card_type + "/card_number/" + card_number, defaultColunms);
+    table.setPaginationType("server");
+    table.setSingleSelect(false);
+    table.setOnDblClickRow(function () {
+        IntegralVerify.openCheckIntegralVerify();
+    });
+    IntegralVerify.table = table.init();
+    $("#enterprise_id").on('chosen:ready', function (e, params) {
+        $(".chosen-container-single .chosen-single").css("padding", "4px 0px 0px 4px");
+    });
+    $("#enterprise_id").val("");
+    $("#enterprise_id").trigger('chosen:updated');
+    $("#enterprise_id").chosen({
+        search_contains: true,       //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        disable_search: false,
+        width: "100%",
+        enable_split_word_search: true
+    });
+});

+ 6 - 62
public/static/modular/talentIdentify/integralMgr/IntegralVerify_library.js

@@ -50,7 +50,7 @@ IntegralInfo.initColumn = function () {
         {title: '操作', field: 'id', visible: true, align: 'center', valign: 'middle', width: '80px',
             formatter: function (value, row, index) {
                 return "<span class='label label-success' onclick=\"IntegralInfo.showIntegralLog('" + row.card_type + "','" + row.card_number + "')\" >" +
-                        "<i class=\"fa fa-book\"></i>日志" +
+                        "<i class=\"fa fa-history\"></i> 积分记录" +
                         "</span>";
             }
         }
@@ -62,72 +62,16 @@ IntegralInfo.initColumn = function () {
  */
 IntegralInfo.showIntegralLog = function (card_type, card_number) {
     layer.open({
-        type: 1,
-        title: "日志",
+        type: 2,
+        title: "积分记录",
         fixed: false,
-        content: '<table id="' + card_type + "_" + card_number + '"></table>',
+        content: '/admin/integralVerify/integralLog/cardType/' + card_type + '/cardNumber/' + card_number,
         area: ['80%', '80%'],
-        maxmin: true,
-        success: function (layero, index) {
-            IntegralInfo.getIntegralLog(card_type + "_" + card_number, {"card_type": card_type, "card_number": card_number})
-        }
+        fix: false, //不固定
+        maxmin: true
     });
 }
 
-IntegralInfo.getIntegralLog = function (id, data) {
-    //初始化日志
-    $('#' + id).bootstrapTable({
-        url: Feng.ctxPath + "/admin/integralVerify/getIntegralLog",
-        method: 'POST',
-        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-        search: false, // 是否显示表格搜索,此搜索是客户端搜索,不会进服务端
-        showRefresh: false, // 是否显示刷新按钮
-        clickToSelect: true, // 是否启用点击选中行
-        singleSelect: true, // 设置True 将禁止多选
-        striped: true, // 是否显示行间隔色
-        pagination: false, // 设置为 true 会在表格底部显示分页条
-        paginationHAlign: "left",
-        paginationDetailHAlign: "right",
-        sidePagination: "server", // 设置在哪里进行分页,可选值为 'client' 或者 'server'
-        showColumns: false,
-        queryParams: function (params) {
-            return data;
-        },
-        rowStyle: function (row, index) {
-            return {
-                css: {
-                    "word-break": "break-word",
-                    "white-space": "inherit"
-                }
-            }
-        },
-        columns:
-                [
-                    {title: '步骤', field: 'stepName', visible: true, align: 'center', valign: 'middle', width: "10%", 'class': 'uitd_showTip',
-                        formatter: function (value, row, index) {
-                            return "" + value;
-                        }
-                    },
-                    {title: '审核状态', field: 'stateName', visible: true, align: 'center', valign: 'middle', width: "10%", 'class': 'uitd_showTip'},
-                    {title: '状态变更', field: 'stateChange', visible: true, align: 'center', valign: 'middle', width: "20%", 'class': 'uitd_showTip'},
-                    {title: '审核意见/备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: "30%", 'class': 'uitd_showTip',
-                        formatter: function (value, row, index) {
-                            return '<span data-toggle="tooltip" title="' + value + '">"' + value + '"</span>';
-                        }
-                    },
-                    {title: '操作人', field: 'createUser', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
-                    {title: '操作时间', field: 'createTime', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
-                ]
-        ,
-        onPostBody: function () {
-            $('#' + id + "td.uitd_showTip").bind("mouseover", function () {
-                var htm = $(this).html();
-                $(this).webuiPopover({title: '详情', content: htm, trigger: 'hover'}).webuiPopover('show');
-            });
-        }
-    });
-
-};
 /**
  * 检查是否选中
  */