Selaa lähdekoodia

增加企业信息审核

sandm 2 vuotta sitten
vanhempi
commit
7bc95e9e66

+ 162 - 0
app/admin/controller/Enterprise.php

@@ -3,7 +3,13 @@
 namespace app\admin\controller;
 
 use app\admin\common\AdminController;
+use app\common\api\ChuanglanSmsApi;
+use app\common\api\DictApi;
 use app\common\api\EnterpriseApi;
+use app\common\model\MessageRecord;
+use app\common\model\TalentChecklog;
+use app\common\api\TalentState;
+use app\common\api\CompanyApi;
 
 class Enterprise extends AdminController {
 
@@ -13,9 +19,165 @@ class Enterprise extends AdminController {
 
         return view("", []);
     }
+
     public function findEnterpriseByPage(){
         $res = EnterpriseApi::getList($this->request);
 
         return json($res);
     }
+
+    public function gotoEnterpriseDetailPage(){
+        $id = trim($this->request['id']);
+        $ep = EnterpriseApi::getOne($id);
+        if(!$ep){
+            return "无此企业";
+        }
+        //--------设置 审核状态---------------------------------------------------
+        switch ($ep['checkState']){
+            case 1:
+                $ep['checkStateName'] = "待审核";
+                break;
+            case 2:
+                $ep['checkStateName'] = "审核驳回";
+                break;
+            case 3:
+                $ep['checkStateName'] = "审核通过";
+                break;
+            case 4:
+                $ep['checkStateName'] = "重新提交";
+                break;
+        }
+        //-------设置账号状态----------------------------------------------------
+        switch ($ep['active']){
+            case 1:
+                $ep['activeName'] = "账号有效";
+                break;
+            case 2:
+                $ep['activeName'] = "冻结/拉黑";
+                break;
+        }
+        //---------设置 街道-----------------------------------------------------
+        if (\StrUtil::isNotEmpAndNull($ep['street'])) {
+            $street_info = DictApi::findByParentCodeAndCode('street',$ep['street']);
+    		if ($street_info != null) {
+                $ep['streetName'] = $street_info['name'];
+            }
+		}
+        //---------设置产业领域 --------------------------------------------------
+        if(\StrUtil::isNotEmpAndNull($ep['industryFieldNew'])){
+            $industryFieldNew = DictApi::findByParentCodeAndCode('industry_field',$ep['industryFieldNew']);
+			if($industryFieldNew != null){
+                $ep['industryFieldNewName'] = $industryFieldNew['name'];
+            }
+		}
+
+        return view("", ['ep' => $ep]);
+    }
+
+    public function gotoExaminePage(){
+
+        $id = trim($this->request['id']);
+        $ep = EnterpriseApi::getOne($id);
+        if(!$ep){
+            return "无此企业";
+        }
+        //---------设置产业领域 --------------------------------------------------
+        if(\StrUtil::isNotEmpAndNull($ep['industryFieldNew'])){
+            $industryFieldNew = DictApi::findByParentCodeAndCode('industry_field',$ep['industryFieldNew']);
+            if($industryFieldNew != null){
+                $ep['industryFieldNewName'] = $industryFieldNew['name'];
+            }
+        }
+
+
+
+
+        return view("", ['ep' => $ep, 'checkUser' => session('user')['name']]);
+    }
+
+    public function doExamine(){
+        $id = trim($this->request['id']);
+        if(!$id){
+            return json(["msg" => 'ID不能为空!']);
+        }
+        $ep = EnterpriseApi::getOne($id);
+        if(!$ep){
+            return json(["msg" => '无此企业!']);
+        }
+        $checkState = $this->request['checkState'];
+        if($checkState == null || ($checkState != 2 && $checkState != 3)){
+            return json(["msg" => '请选择审核状态!']);
+        }
+        if($checkState == 2){
+            $checkMsg = \StrUtil::isEmpOrNull($this->request['checkMsg']);
+            if ($checkMsg) {
+                return json(["msg" => '请填写审核意见!']);
+            }
+
+            if (strlen($checkMsg) > 200) {
+                return json(["msg" => '审核意见最多200个字符!']);
+            }
+        }
+        try {
+            $checkData = [
+                'id' => $id,
+                'checkState' => $checkState,
+                'checkMsg' => $checkMsg,
+                'checkUser' => session('user')['name'],
+                'updateUser' => session('user')['uid'],
+                'updateTime' => date("y-m-d H:i:s")
+            ];
+            $res = EnterpriseApi::updateById($checkData);
+
+            //短信入库数据
+            $record_data = [
+                'id' => getStringId(),
+                'bizId' => getStringId(),
+                'userId' => $id,
+                'type' => 2,
+                'smsType' => 2,
+                'name' => $ep['name'],
+                'phone' => $ep['agentPhone'],
+                'params' => '机构注册信息',
+                'state' => 1,
+                'sendingDate' => date("Y-m-d H:i:s",time()),
+                'createTime' => date("Y-m-d H:i:s",time())
+            ];
+
+            if($checkState == 2){
+                $record_data['templateCode'] = "【晋江市人才服务平台】您好!您提交申请的优秀人才机构注册信息因信息填写错误或上传不完整已被退回,请及时登录申报系统查看审核意见并重新提交。";
+            }
+            if($checkState == 3){
+                $record_data['templateCode'] = "【晋江市人才服务平台】您好!您提交申请的优秀人才机构注册信息已审核通过,可登录申报系统做相关事宜申报。";
+            }
+
+            $smsapi = new ChuanglanSmsApi();
+
+            $result = $smsapi->sendSMS($ep['agentPhone'],$record_data['templateCode']);
+
+            MessageRecord::create($record_data);
+
+            $company = CompanyApi::getOne(session('user')['companyId']);
+
+            TalentChecklog::create([
+                'id' => getStringId(),
+                'mainId' => $id,
+                'type' => 10,
+                'typeField' => null,
+                'active' => 1,
+                'state' => $checkState,
+                'step' => 101,
+                'stateChange' => TalentState::stateEnum($checkState),
+                'description' => $checkMsg,
+                'createTime' => date("Y-m-d H:i:s",time()),
+                'createUser' => session('user')['name']."({$company['name']})"
+            ]);
+
+            return json(["msg" => '操作成功!',"code" => 200]);
+
+        } catch (\Exception $e){
+            return json(["msg" => $e->getMessage()]);
+        }
+
+    }
 }

+ 175 - 0
app/admin/view/enterprise/goto_enterprise_detail_page.html

@@ -0,0 +1,175 @@
+{extend name="layout/content"}
+{block name="content"}
+<style type="text/css">
+  .spacing {
+    margin-bottom: 10px;
+    padding-right:4px;
+    padding-left: 4px;
+  }
+</style>
+<script type="text/javascript">
+  $(function(){
+    Feng.addAjaxSelect({
+      "id": "enterpriseTag",
+      "displayCode": "code",
+      "displayName": "name",
+      "type": "GET",
+      "url": Feng.ctxPath + "/admin/dict/findChildDictByCode?code=enterprise_tag"
+    });
+    $("select").each(function () {
+      $(this).val($(this).attr("value"));
+    });
+    var type = $("#type").val();
+    if(type==1){
+      $("#enterpriseTag,#industryFieldNewName").parent().parent().attr("style","display:block");
+    }else{
+      $("#enterpriseTag,#industryFieldNewName").parent().parent().attr("style","display:none");
+    }
+    var photoImg = $("#yyzz").attr("src");
+    var oldSn = photoImg.lastIndexOf(".");
+    var oldSuffix = photoImg.substring(oldSn+1,photoImg.length);
+    if(oldSuffix == 'pdf' || oldSuffix == 'PDF'){
+      $("#yyzz").attr("src", Feng.ctxPath + "/static/img/Pdf.png");
+      // $("#yyzz").attr("onclick", Feng.showPdf(photoImg,"pdf","预览"));
+      $("#yyzz").removeAttr("onclick").unbind("click").click(function () {
+        Feng.showPdf(photoImg,"pdf","预览")
+      });
+    }
+  });
+
+</script>
+<div class="ibox float-e-margins">
+  <div class="ibox-content" style="height: 550px;">
+    <form id="enter_form" class="form-horizontal">
+      <input type="text" class="form-control" id="id" name="id" value="{$ep.id}" style="display: none;" />
+      <div class="col-sm-12 form-group-sm">
+        <div class="row">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">单位名称</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="name" name="name" value="{$ep.name}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">社会信用代码</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="idCard" name="idCard" value="{$ep.idCard}"  />
+            </div>
+          </div>
+          <div class="rowGroup" style="display: none">
+            <label class="col-sm-2 control-label spacing"><span class="text-danger">*</span>产业领域</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="industryFieldNewName" name="industryFieldNewName" value="{$ep.industryFieldNewName}">
+            </div>
+          </div>
+          <div class="rowGroup" >
+            <label class="col-sm-2 control-label spacing"><span class="text-danger">*</span>申报类型</label>
+            <div class="col-sm-4 spacing">
+              <select class="form-control" id="type" disabled="disabled" name="type" value="{$ep.type}">
+                <option value="">请选择</option>
+                <option value="1">晋江市优秀人才</option>
+                <option value="2">集成电路优秀人才</option>
+                <option value="3">海峡计划团队</option>
+              </select>
+            </div>
+          </div>
+          <div class="rowGroup"  style="display: none">
+            <label class="col-sm-2 control-label spacing"><span class="text-danger">*</span>单位标签</label>
+            <div class="col-sm-4 spacing">
+              <select class="form-control" disabled="disabled" id="enterpriseTag" name="enterpriseTag" value="{$ep.enterpriseTag}">
+              </select>
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">所属街道</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="street" name="street" value="{$ep.streetName}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">单位地址</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="address" name="address" value="{$ep.address}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">法人代表</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="legal" name="legal" value="{$ep.legal}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">单位电话</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="ephone" name="ephone" value="{$ep.ephone}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">经办人</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="agentName" name="agentName" value="{$ep.agentName}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">经办人电话</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="agentPhone" name="agentPhone" value="{$ep.agentPhone}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">经办人邮箱</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="agentEmail" name="agentEmail" value="{$ep.agentEmail}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">审核状态</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="checkState" name="checkState" value="{$ep.checkStateName}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">审核意见</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="checkMsg" name="checkMsg" value="{$ep.checkMsg}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">审核人</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="checkUser" name="checkUser" value="{$ep.checkUser}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">账号状态</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="active" name="active" value="{$ep.activeName}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">拉黑/冻结原因</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="activeMsg" name="activeMsg" value="{$ep.activeMsg}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">备注</label>
+            <div class="col-sm-4 spacing">
+              <input type="text" class="form-control" readonly="readonly" id="description" name="description" value="{$ep.description}"  />
+            </div>
+          </div>
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label spacing">营业执照</label>
+            <div class="col-sm-4 spacing">
+              <img onclick="Feng.showImg(this)" id="yyzz" alt="营业执照" src="{$ep.imgurl}" style="max-width: 100px;">
+            </div>
+          </div>
+        </div>
+      </div>
+    </form>
+  </div>
+</div>
+<div style="display: none" id="canvas">
+  <canvas id="the-canvas"></canvas>
+</div>
+{/block}

+ 84 - 0
app/admin/view/enterprise/goto_examine_page.html

@@ -0,0 +1,84 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="ibox float-e-margins">
+  <div class="ibox-content">
+    <form id="ep_active" class="form-horizontal">
+      <input type="text" id="id" value="{$ep.id}" style="display: none;" />
+      <div class="row">
+        <div class="col-sm-12">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label">单位名称</label>
+            <div class="col-sm-10">
+              <input type="text" class="form-control" readonly="readonly" id="name" name="name" value="{$ep.name}"  />
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="hr-line-dashed"></div>
+      <div class="row">
+        <div class="col-sm-12">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label">社会信用代码</label>
+            <div class="col-sm-10">
+              <input type="text" class="form-control" readonly="readonly" id="idCard" name="idCard" value="{$ep.idCard}"  />
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="hr-line-dashed"></div>
+      <div class="row">
+        <div class="col-sm-12">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label">注册时间</label>
+            <div class="col-sm-10">
+              <input type="text" class="form-control" readonly="readonly" id="createTime" name="createTime" value="{$ep.createTime}"/>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="hr-line-dashed"></div>
+      <div class="row">
+        <div class="col-sm-12">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label">审核人</label>
+            <div class="col-sm-10">
+              <input type="text" class="form-control" readonly="readonly" id="checkUser" name="checkUser" value="{$checkUser}"/>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="hr-line-dashed"></div>
+      <div class="row">
+        <div class="col-sm-12">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label"><span class="text-danger">*</span>审核状态</label>
+            <div class="col-sm-10">
+              <select class="form-control" id="checkState" name="checkState" onchange="EpExam.toggleField()">
+                <option value="">--- 请选择 ---</option>
+                <option value="2">审核驳回</option>
+                <option value="3">审核通过</option>
+              </select>
+            </div>
+          </div>
+        </div>
+      </div>
+      <div class="hr-line-dashed"></div>
+      <div class="row">
+        <div class="col-sm-12">
+          <div class="rowGroup"  style="margin-bottom: 0px;">
+            <label class="col-sm-2 control-label">审核意见</label>
+            <div class="col-sm-10">
+              <textarea class="form-control" rows="3" id="checkMsg" name="checkMsg">{$ep.checkMsg}</textarea>
+            </div>
+          </div>
+        </div>
+      </div>
+    </form>
+  </div>
+</div>
+<input type="text" id="checkStateTemp" value="{$ep.checkState}" style="display: none;" />
+<!--<script src="${ctxPath}/static/modular/enterprise/enterprise_examine.js"></script>-->
+<script type="text/javascript">
+  document.write('<script src="/static/modular/enterprise/enterprise_examine.js?v='+(new Date()).getTime()+'"><\/script>');
+</script>
+{/block}

+ 8 - 0
app/common/api/DictApi.php

@@ -270,4 +270,12 @@ class DictApi {
         return $str;
     }
 
+    public static function findByParentCodeAndCode($parentCode, $code){
+        $parent_info = Dict::where('code',$parentCode)->findOrEmpty();
+        if($parent_info){
+            return Dict::where('pid',$parent_info['id'])->where('code',$code)->findOrEmpty();
+        }
+        return false;
+    }
+
 }

+ 8 - 0
app/common/api/EnterpriseApi.php

@@ -8,6 +8,10 @@ use app\admin\model\Enterprise;
 
 class EnterpriseApi {
 
+    public static function getOne($id){
+        return Enterprise::findOrEmpty($id);
+    }
+
     public static function getList($request) {
         $companyId = session('user')['companyId'];
         $company_info = CompanyApi::getOne($companyId);
@@ -44,4 +48,8 @@ class EnterpriseApi {
         }
         return ["total" => $count, "rows" => $list];
     }
+
+    public static function updateById($data){
+        return Enterprise::update($data);
+    }
 }

+ 35 - 0
app/common/api/TalentState.php

@@ -25,4 +25,39 @@ class TalentState {
     public const BASE_VERIFY_FAIL = -1; //条件验证失败
     public const FST_VERIFY_FAIL = -2; //初审失败
 
+    public static function stateEnum($code){
+        switch ($code){
+            case -2:
+                return "<span class='label label-success'>待提交</span>";
+                break;
+            case -1:
+                return "<span class='label label-success'>审核不通过</span>";
+                break;
+            case 1:
+                return "<span class='label label-success'>待审核</span>";
+                break;
+            case 2:
+                return "<span class='label label-danger'>审核驳回</span>";
+                break;
+            case 3:
+                return "<span class='label label-primary'>审核通过</span>";
+                break;
+            case 4:
+                return "<span class='label label-warm'>上级驳回</span>";
+                break;
+            case 8:
+                return "<span class='label label-primary'>提交审核</span>";
+                break;
+            case 9:
+                return "<span class='label label-primary'>重新提交</span>";
+                break;
+            case 10:
+                return "<span class='label label-default'>冻结</span>";
+                break;
+            case 11:
+                return "<span class='label label-primary'>撤销审核</span>";
+                break;
+        }
+    }
+
 }

+ 1 - 1
public/static/modular/enterprise/enterprise_examine.js

@@ -15,7 +15,7 @@ EpExam.addSubmit = function() {
 	}
 	var da = {"id":id, "checkState":checkState, "checkMsg":checkMsg};
 	var operation = function() {
-		var ajax = new $ax(Feng.ctxPath + "/enterprise/doExamine", function (data) {
+		var ajax = new $ax(Feng.ctxPath + "/admin/enterprise/doExamine", function (data) {
 			if (data.code == 200) {
 				window.parent.Enterprise.table.refresh();
 				parent.layer.closeAll();

+ 2 - 2
public/static/modular/enterprise/enterprise_list.js

@@ -138,7 +138,7 @@ Enterprise.gotoEnterpriseDetailPage = function() {
         area: ['830px', '450px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/enterprise/gotoEnterpriseDetailPage?id='+Enterprise.seItem.id,
+        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) {
@@ -182,7 +182,7 @@ Enterprise.doExamine = function() {
         area: ['830px', '500px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/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) {