sugangqiang 2 năm trước cách đây
mục cha
commit
6adf29b9a6
2 tập tin đã thay đổi với 191 bổ sung169 xóa
  1. 22 1
      app/common/controller/Api.php
  2. 169 168
      public/static/modular/enterprise/enterprise_list.js

+ 22 - 1
app/common/controller/Api.php

@@ -85,13 +85,34 @@ class Api extends BaseController {
     public function getCheckLog() {
         $params = $this->request->param();
         $mainId = $params["mainId"];
+        $enterpriseId = $params["enterpriseId"];
         $type = $params["type"];
         /* $talentInfo = TalentApi::getOne($mainId);
           $condition = TalentConditionApi::getOne($talentInfo["talent_condition"]);
           $needDeptVerify = false;
           if ($condition["companyIds"] && $talentInfo["pass_dept_check"] != 1)
           $needDeptVerify = true; */
-        $list = TalentLogApi::getList($type, $mainId);
+        $list = [];
+        switch ($type) {
+            case 1:
+                $list = TalentLogApi::getList($type, $mainId);
+                break;
+            case 10:
+                if ($enterpriseId) {
+                    $where[] = ["mainId", "=", $enterpriseId];
+                    $ids = \app\enterprise\model\EnterpriseRecord::where($where)->column("id");
+                    if ($ids) {
+                        $where = [];
+                        $where[] = ["type", "=", $type];
+                        $where[] = ["active", "=", 1];
+                        $where[] = ["mainId", "in", $ids];
+                        $list = TalentChecklog::where($where)->order("createTime desc")->select();
+                    }
+                } else {
+                    $list = TalentLogApi::getList($type, $mainId);
+                }
+                break;
+        }
         $new_list = [];
         foreach ($list as $key => $item) {
             switch ($item['category']) {

+ 169 - 168
public/static/modular/enterprise/enterprise_list.js

@@ -1,100 +1,101 @@
 var Enterprise = {
-    id: "table",	                                                                //表格id
-    seItem: null,		                                                            //选中的条目
+    id: "table", //表格id
+    seItem: null, //选中的条目
     table: null,
     layerIndex: -1
 };
 
-Enterprise.initColumn = function(){
+Enterprise.initColumn = function () {
     var type = $("#type").val();
     var isShow = true;
-    if(type==2){
+    if (type == 2) {
         isShow = false;
-    };
-	return [
-		{field: 'selectItem', radio: true},
+    }
+    ;
+    return [
+        {field: 'selectItem', radio: true},
         {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'},
-        {title: '账号', field: 'username',visible: true, align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '机构名称', field: 'name',visible: true, align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '统一社会信用代码', field: 'idCard',visible: true, align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '产业领域', field: 'industryFieldNewName',visible: isShow, align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '机构类型', field: 'type', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip',
-            formatter : function(value,row,index){
-                if(value==1){
+        {title: '账号', field: 'username', visible: true, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '机构名称', field: 'name', visible: true, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '统一社会信用代码', field: 'idCard', visible: true, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '产业领域', field: 'industryFieldNewName', visible: isShow, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '机构类型', field: 'type', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                if (value == 1) {
                     return "晋江市现代产业体系人才";
                 }
-                if(value==2){
+                if (value == 2) {
                     return "集成电路优秀人才";
                 }
             }
         },
-        {title: '单位标签', field: 'enterpriseTagName', visible: isShow,align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '法人代表', field: 'legal', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '单位电话', field: 'ephone', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '人才联络员', field: 'agentName', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '人才联络员电话', field: 'agentPhone', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
-        {title: '审核状态', field: 'checkState', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip',
-        	formatter: function (value, row, index){
-                if (value==null || value==''){
+        {title: '单位标签', field: 'enterpriseTagName', visible: isShow, align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '法人代表', field: 'legal', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '单位电话', field: 'ephone', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '人才联络员', field: 'agentName', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '人才联络员电话', field: 'agentPhone', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '审核状态', field: 'checkState', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                if (value == null || value == '') {
                     return "";
-                } else if (value == 1){
+                } else if (value == 1) {
                     return "未审核";
-                }else if(value == 2){
+                } else if (value == 2) {
                     return "审核驳回";
-                }else if(value == 3){
+                } else if (value == 3) {
                     return "审核通过";
-                }else if(value == 4){
+                } else if (value == 4) {
                     return "重新提交";
                 }
             },
-            cellStyle: function(value, row, index) {
-            	if (value==null || value===''){
-            		return {css:{}};
-                } else if (value === 1){
-                	return {css:{"background-color":"LightGrey"}};
-                }else if(value === 3){
-                	return {css:{'background-color':'LightGreen'}};
-                } else if(value === 2){
-                	return {css:{"background-color":"Orange"}};
+            cellStyle: function (value, row, index) {
+                if (value == null || value === '') {
+                    return {css: {}};
+                } else if (value === 1) {
+                    return {css: {"background-color": "LightGrey"}};
+                } else if (value === 3) {
+                    return {css: {'background-color': 'LightGreen'}};
+                } else if (value === 2) {
+                    return {css: {"background-color": "Orange"}};
                 } else {
-                	return {css:{}};
+                    return {css: {}};
                 }
             }
         },
-        {title: '账号状态', field: 'active', align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip',
-        	formatter: function (value, row, index){
-                if (value==null || value==''){
+        {title: '账号状态', field: 'active', align: 'center', width: 120, valign: 'middle', 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                if (value == null || value == '') {
                     return "";
-                } else if (value == 1){
+                } else if (value == 1) {
                     return "账号有效";
-                }else if(value == 2){
+                } else if (value == 2) {
                     return "拉黑/冻结";
                 }
             },
-            cellStyle: function(value, row, index) {
-            	if (value==null || value===''){
-            		return {css:{}};
-                } else if(value === 1){
-                	return {css:{'background-color':'LightGreen'}};
-                } else if(value === 2){
-                	return {css:{"background-color":"Orange"}};
+            cellStyle: function (value, row, index) {
+                if (value == null || value === '') {
+                    return {css: {}};
+                } else if (value === 1) {
+                    return {css: {'background-color': 'LightGreen'}};
+                } else if (value === 2) {
+                    return {css: {"background-color": "Orange"}};
                 } else {
-                	return {css:{}};
+                    return {css: {}};
                 }
             }
         },
-        {title: '注册时间', field: 'createTime', align: 'center', width:120, valign: 'middle', '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=\"Enterprise.showLog('"+value+"')\" >" +
-                    "<i class=\"fa fa-book\"></i>日志" +
-                    "</span>";
+        {title: '注册时间', field: 'createTime', align: 'center', width: 120, valign: 'middle', '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=\"Enterprise.showLog('" + value + "')\" >" +
+                        "<i class=\"fa fa-book\"></i>日志" +
+                        "</span>";
             }
         }
-	];
+    ];
 };
 
-Enterprise.formParam = function(){
+Enterprise.formParam = function () {
     var queryData = {};
     queryData['name'] = $("#name").val();
     queryData['idCard'] = $("#idCard").val();
@@ -110,36 +111,36 @@ Enterprise.formParam = function(){
     return queryData;
 }
 
-Enterprise.search = function() {
-	Enterprise.table.refresh({"query": Enterprise.formParam()});
+Enterprise.search = function () {
+    Enterprise.table.refresh({"query": Enterprise.formParam()});
 };
 
-Enterprise.reset = function() {
-	$("#name").val("");
-	$("#idCard").val("");
-	$("#legal").val("");
-	$("#ephone").val("");
-	$("#agentName").val("");
-	$("#agentPhone").val("");
-	$("#checkState").val("");
-	$("#active").val("");
-	$("#street").val("");
-	$("#talentType").val("");
-	$("#industryField").val("");
+Enterprise.reset = function () {
+    $("#name").val("");
+    $("#idCard").val("");
+    $("#legal").val("");
+    $("#ephone").val("");
+    $("#agentName").val("");
+    $("#agentPhone").val("");
+    $("#checkState").val("");
+    $("#active").val("");
+    $("#street").val("");
+    $("#talentType").val("");
+    $("#industryField").val("");
 };
 
-Enterprise.gotoEnterpriseDetailPage = function() {
-	if (!Enterprise.check()) {
-		return;
-	}
+Enterprise.gotoEnterpriseDetailPage = function () {
+    if (!Enterprise.check()) {
+        return;
+    }
     var index = layer.open({
         type: 2,
         title: '查看详情',
         area: ['830px', '450px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/admin/enterprise/gotoEnterpriseDetailPage?id='+Enterprise.seItem.id,
-        btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;审核','<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
+        content: Feng.ctxPath + '/admin/enterprise/gotoEnterpriseDetailPage?id=' + Enterprise.seItem.id,
+        btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;审核', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;关闭'],
         btnAlign: 'c',
         yes: function (index, layero) {
             Enterprise.doExamine();
@@ -149,131 +150,131 @@ Enterprise.gotoEnterpriseDetailPage = function() {
     Enterprise.layerIndex = index;
 };
 
-Enterprise.setActive = function() {
-	if (!Enterprise.check()) {
-		return;
-	}
+Enterprise.setActive = function () {
+    if (!Enterprise.check()) {
+        return;
+    }
     var index = layer.open({
         type: 2,
         title: '设置冻结',
         area: ['830px', '500px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/admin/enterprise/gotoActivePage?id='+Enterprise.seItem.id,
-        btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交','<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
+        content: Feng.ctxPath + '/admin/enterprise/gotoActivePage?id=' + Enterprise.seItem.id,
+        btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
         btnAlign: 'c',
         yes: function (index, layero) {
-        	//按钮【按钮一】的回调
-        	var iframeWin = window[layero.find('iframe')[0]['name']];
-        	iframeWin.EpActive.addSubmit();
+            //按钮【按钮一】的回调
+            var iframeWin = window[layero.find('iframe')[0]['name']];
+            iframeWin.EpActive.addSubmit();
         }
     });
 //    layer.full(index);
     Enterprise.layerIndex = index;
 };
 
-Enterprise.doExamine = function() {
-	if (!Enterprise.check()) {
-		return;
-	}
+Enterprise.doExamine = function () {
+    if (!Enterprise.check()) {
+        return;
+    }
     var index = layer.open({
         type: 2,
         title: '审核',
         area: ['830px', '500px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/admin/enterprise/gotoExaminePage?id='+Enterprise.seItem.id,
+        content: Feng.ctxPath + '/admin/enterprise/gotoExaminePage?id=' + Enterprise.seItem.id,
         btn: ['<i class="fa fa-check"></i>&nbsp;&nbsp;提交', '<i class="fa fa-eraser"></i>&nbsp;&nbsp;取消'],
         btnAlign: 'c',
         yes: function (index, layero) {
-        	//按钮【按钮一】的回调
-        	var iframeWin = window[layero.find('iframe')[0]['name']];
-        	iframeWin.EpExam.addSubmit();
+            //按钮【按钮一】的回调
+            var iframeWin = window[layero.find('iframe')[0]['name']];
+            iframeWin.EpExam.addSubmit();
         }
     });
 //    layer.full(index);
 };
 
-Enterprise.delEnterprise = function() {
-	if (!Enterprise.check()) {
-		return;
-	}
-	if (!Enterprise.check()) {
-		return;
-	}
-	Feng.confirm(
-        "确定删除吗?",
-        function(){
-        	var ajax = new $ax(Feng.ctxPath + "/enterprise/delEnterprise?id="+Enterprise.seItem.id, function(data){
-                Feng.info(data.msg);
-                if(data.code == 200){
-                	Enterprise.table.refresh();
-                }
-            },function(data){
-                Feng.error("操作失败!");
-            });
-            ajax.set(null);
-            ajax.start();
-        }
-	);
+Enterprise.delEnterprise = function () {
+    if (!Enterprise.check()) {
+        return;
+    }
+    if (!Enterprise.check()) {
+        return;
+    }
+    Feng.confirm(
+            "确定删除吗?",
+            function () {
+                var ajax = new $ax(Feng.ctxPath + "/enterprise/delEnterprise?id=" + Enterprise.seItem.id, function (data) {
+                    Feng.info(data.msg);
+                    if (data.code == 200) {
+                        Enterprise.table.refresh();
+                    }
+                }, function (data) {
+                    Feng.error("操作失败!");
+                });
+                ajax.set(null);
+                ajax.start();
+            }
+    );
 };
 
-Enterprise.resetPassword = function() {
-	if (!Enterprise.check()) {
-		return;
-	}
-	Feng.confirm(
-        "确定要重置密码吗?",
-        function(){
-        	var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/resetPassword?id="+Enterprise.seItem.id, function(data){
-                Feng.info(data.msg);
+Enterprise.resetPassword = function () {
+    if (!Enterprise.check()) {
+        return;
+    }
+    Feng.confirm(
+            "确定要重置密码吗?",
+            function () {
+                var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/resetPassword?id=" + Enterprise.seItem.id, function (data) {
+                    Feng.info(data.msg);
 //                if(data.code == 200){
 //                	Enterprise.table.refresh();
 //                }
-            },function(data){
-                Feng.error("操作失败!");
-            });
-            ajax.set(null);
-            ajax.start();
-        }
-	);
+                }, function (data) {
+                    Feng.error("操作失败!");
+                });
+                ajax.set(null);
+                ajax.start();
+            }
+    );
 };
 
-Enterprise.doExport = function() {
-	var name = $("#name").val();
-	var idCard = $("#idCard").val();
-	var legal = $("#legal").val();
-	var ephone = $("#ephone").val();
-	var agentName = $("#agentName").val();
-	var agentPhone = $("#agentPhone").val();
-	var checkState = $("#checkState").val();
-	var active = $("#active").val();
-	var street = $("#street").val();
-	var talentType = $("#talentType").val();
-	var industryField = $("#industryField").val();
-	var arr = {"name":name, "idCard":idCard, "legal":legal, "ephone":ephone, "agentName":agentName,
-			"agentPhone":agentPhone, "checkState":checkState, "active":active,"street":street,"talentType":talentType,"industryField":industryField};
-	window.location.href = Feng.setUrlParam(Feng.ctxPath + "/admin/enterprise/export", arr);
+Enterprise.doExport = function () {
+    var name = $("#name").val();
+    var idCard = $("#idCard").val();
+    var legal = $("#legal").val();
+    var ephone = $("#ephone").val();
+    var agentName = $("#agentName").val();
+    var agentPhone = $("#agentPhone").val();
+    var checkState = $("#checkState").val();
+    var active = $("#active").val();
+    var street = $("#street").val();
+    var talentType = $("#talentType").val();
+    var industryField = $("#industryField").val();
+    var arr = {"name": name, "idCard": idCard, "legal": legal, "ephone": ephone, "agentName": agentName,
+        "agentPhone": agentPhone, "checkState": checkState, "active": active, "street": street, "talentType": talentType, "industryField": industryField};
+    window.location.href = Feng.setUrlParam(Feng.ctxPath + "/admin/enterprise/export", arr);
 }
 
 /**
  * 批量获取人才联络员手机号码
  */
-Enterprise.getPhones = function(){
-    var ajax = new $ax(Feng.ctxPath + "/enterprise/getPhones", function(data){
-        if(data.code == 200){
+Enterprise.getPhones = function () {
+    var ajax = new $ax(Feng.ctxPath + "/enterprise/getPhones", function (data) {
+        if (data.code == 200) {
             layer.open({
                 type: 1,
-                title:"手机号码",
+                title: "手机号码",
                 area: ['830px', '500px'], //宽高
                 fix: false, //不固定
                 maxmin: true,
-                content: "<span style='word-break:break-all'>"+data.obj+"</span>"
+                content: "<span style='word-break:break-all'>" + data.obj + "</span>"
             });
-        }else{
+        } else {
             Feng.info(data.msg);
         }
-    },function(data){
+    }, function (data) {
         Feng.error("操作失败!");
     });
     ajax.setData(Enterprise.formParam());
@@ -282,25 +283,25 @@ Enterprise.getPhones = function(){
 
 Enterprise.check = function () {
     var selected = $('#' + Enterprise.id).bootstrapTable('getSelections');
-    if(selected.length == 0){
+    if (selected.length == 0) {
         Feng.info("请先选中表格中的某一记录!");
         return false;
-    }else{
-    	Enterprise.seItem = selected[0];
+    } else {
+        Enterprise.seItem = selected[0];
         return true;
     }
 };
 
-Enterprise.showLog = function(id){
+Enterprise.showLog = function (id) {
     layer.open({
         type: 1,
-        title:"日志",
-        fixed:false,
-        content: '<table id="'+id+'"></table>',
+        title: "日志",
+        fixed: false,
+        content: '<table id="' + id + '"></table>',
         area: ['80%', '80%'],
         maxmin: true,
-        success :function (layero, index) {
-            Feng.getCheckLog(id,{"type":10,"mainId":id,"typeFileId":"","active":1})
+        success: function (layero, index) {
+            Feng.getCheckLog(id, {"type": 10, "enterpriseId": id, "typeFileId": "", "active": 1})
         }
     });
 }
@@ -311,10 +312,10 @@ $(function () {
     table.setPaginationType("server");
     Enterprise.table = table.init();
     var arr = [
-        {"name":"street","code":"street"},
-        {"name":"enterpriseTag","code":"enterprise_tag"},
-        {"name":"industryFieldNew","code":"industry_field"},
-        {"name":"enterpriseType","code":"enterprise_type"}];
+        {"name": "street", "code": "street"},
+        {"name": "enterpriseTag", "code": "enterprise_tag"},
+        {"name": "industryFieldNew", "code": "industry_field"},
+        {"name": "enterpriseType", "code": "enterprise_type"}];
     Feng.findChildDictBatch(JSON.stringify(arr));
     // Feng.addAjaxSelect({
     //     "id": "street",