Преглед на файлове

更新政策填报说明

sandm преди 2 години
родител
ревизия
27658f766c

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

@@ -3,6 +3,7 @@
 namespace app\admin\controller;
 
 use app\admin\common\AdminController;
+use app\common\api\EnterpriseApi;
 
 class Enterprise extends AdminController {
 
@@ -13,6 +14,8 @@ class Enterprise extends AdminController {
         return view("", []);
     }
     public function findEnterpriseByPage(){
+        $res = EnterpriseApi::getList($this->request);
 
+        return json($res);
     }
 }

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

@@ -0,0 +1,47 @@
+<?php
+
+namespace app\common\api;
+
+use app\common\api\CompanyApi;
+use think\facade\Db;
+use app\admin\model\Enterprise;
+
+class EnterpriseApi {
+
+    public static function getList($request) {
+        $companyId = session('user')['companyId'];
+        $company_info = CompanyApi::getOne($companyId);
+        $where = [];
+        if($company_info['code'] != 'super'){
+            $where[] = ['type','=',session('user')['type']];
+            if(session('user')['type'] == 1){
+                $list = Db::table('sys_enterprisetype_properties')->where('companyIds','like',$companyId)->select()->toArray();
+                $talentType = [];
+                foreach ($list as $k => $v){
+                    array_push($talentType,$v['talentType']);
+                }
+                $where[] = ['enterpriseTag','in',$talentType];
+            }
+        }
+        $offset = trim($request->param("offset")) ?: 0;
+        $limit = trim($request->param("limit")) ?: 10;
+
+        $count = Enterprise::where($where)->count();
+        if($count > 0){
+            $talentTypeList = DictApi::selectByParentCode("enterprise_tag");
+            $industryFieldNewList = DictApi::selectByParentCode("industry_field");
+            $industryFieldOldList = DictApi::selectByParentCode("industry_field");
+            //dd($talentTypeList);
+            $list = Enterprise::where($where)->limit($offset, $limit)->order("createTime", 'desc')->select()->toArray();
+            foreach ($list as $k => &$v){
+                unset($v['password']);
+                $v['enterpriseTagName'] = $talentTypeList[$v['enterpriseTag']];//此处旧字段为talentType,新字段为enterpriseTag,为防止数据污染与丢失,因而这样写
+                $v['industryFieldNewName'] = $industryFieldNewList[$v['industryFieldNew']];
+                $v['industryFieldNewName'] = $industryFieldNewList[$v['industryFieldNew']];
+            }
+        }else{
+            $list = [];
+        }
+        return ["total" => $count, "rows" => $list];
+    }
+}

+ 2 - 1
app/common/api/UserApi.php

@@ -131,7 +131,8 @@ class UserApi {
                     "avatar" => $user["avatar"],
                     "sex" => $user["sex"],
                     "rolename" => $this->getRole()["name"],
-                    "usertype" => $this->usertype
+                    "usertype" => $this->usertype,
+                    "type" => $user['type']
                 ]);
                 break;
             case 2:

+ 1 - 0
app/index/controller/Auth.php

@@ -125,6 +125,7 @@ class Auth extends BaseController {
             }
             $item = [
                 'id' => $v['id'],
+                'tag' => $v['tag'],
                 'policy' => $v['policy_name'],
                 'checks' => $check,
                 'condition' => $condition

+ 4 - 1
app/index/view/auth/policy.html

@@ -27,7 +27,10 @@
             </el-form-item>
         </el-form>
         <el-table :data="list" v-loading="loading">
-            <el-table-column label="政策说明" prop="policy">
+            <el-table-column label="人才认定标准" prop="policy">
+
+            </el-table-column>
+            <el-table-column label="标签" prop="tag">
 
             </el-table-column>
             <el-table-column label="并审部门">

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

@@ -17,7 +17,7 @@ Enterprise.initColumn = function(){
         {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: 'industryFieldName',visible: isShow, 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){
@@ -28,7 +28,7 @@ Enterprise.initColumn = function(){
                 }
             }
         },
-        {title: '企业标签', field: 'talentTypeName', visible: isShow,align: 'center', width:120, valign: 'middle', 'class': 'uitd_showTip'},
+        {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'},