Browse Source

直认样式

sugangqiang 2 years ago
parent
commit
d9239b8dc6

+ 11 - 2
app/admin/controller/IntegralVerify.php

@@ -39,8 +39,17 @@ class IntegralVerify extends AdminController {
         $request = $this->request;
         $params = $request->param();
         $id = $params["id"];
-        $info = IntegralRecordApi::getOne($id);
-        return view("", ["info" => $info]);
+        $row = IntegralRecordApi::getOne($id);
+        foreach ($row["items"] as $key => $item) {
+            $redis = \app\common\Redis::instance(\think\facade\Config::get("cache.stores.redis.select"));
+            $integralItem = json_decode($redis->hGet("IntegralItem", $item["item_id"]), true);
+            $integralProject = json_decode($redis->hGet("IntegralProject", $integralItem["projectId"]), true);
+            $row["items"][$key]["itemName"] = $integralItem["name"];
+            $row["items"][$key]["unit"] = $integralItem["unit"];
+            $row["items"][$key]["projectName"] = $integralProject["name"];
+            $row["items"][$key]["projectType"] = $integralProject["projectType"];
+        }
+        return view("", ["row" => $row]);
     }
 
     public function cancel_verify() {

+ 42 - 0
app/admin/controller/System.php

@@ -0,0 +1,42 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\common\AdminController;
+
+/**
+ * Description of System
+ *
+ * @author sgq
+ */
+class System extends AdminController {
+
+    /**
+     * 生成缓存
+     * @return type
+     */
+    public function cache() {
+        $step = $this->request->param("step");
+        if ($step) {
+            $cache_kvs = [
+                ["func" => "\app\common\model\IntegralProject::cache", "stepName" => "积分项目"],
+                ["func" => "\app\common\model\IntegralItem::cache", "stepName" => "积分标准"]
+            ];
+            $cache = $cache_kvs[$step - 1];
+            if ($cache) {
+                $time1 = microtime(true);
+                $cache["func"]();
+                $time2 = microtime(true);
+                $runtime = round($time2 - $time1, 2);
+                $step++;
+                echo '<script>window.parent.setText("<span class=\"highlight\">' . $cache["stepName"] . '</span>缓存成功![用时 ' . $runtime . 's]");</script>';
+                echo '<script>window.location.href="/admin/system/cache/step/' . $step . '";</script>';
+            } else {
+                echo '<script>window.parent.setText("缓存创建结束!");</script>';
+            }
+        } else {
+            return view();
+        }
+    }
+
+}

+ 10 - 31
app/admin/view/integral_verify/detail.html

@@ -124,12 +124,6 @@
                                                         <input type="text" class="form-control" id="email" name="email"  value="{$row.email}"/>
                                                     </div>
                                                 </td>
-                                                <td>
-                                                    <div class="rowGroup">
-                                                        <label class="control-label spacing td-label"><span style="color: red">*</span>单位标签</label>
-                                                        <div class="form-control" style="border: none">{$row.enterprise.enterpristTagName}</div>
-                                                    </div>
-                                                </td>
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>单位名称</label>
@@ -153,42 +147,35 @@
                                         {volist name="row.items" id="item"}                                 
                                         <table style="width:100%;border-collapse: collapse;" class="table table-bordered">
                                             <tr>
-                                                <td style="width:40px;">
-                                                    <div class="rowGroup">
-                                                        <label class=" control-label spacing td-label">选择</label>
-                                                        <input type="checkbox" name="chk[]" class="form-control"/>
-                                                    </div>
-                                                </td>
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>项目类别</label>
-                                                        <select class="form-control" name="projectType[]" value="{$item.item_id|getCacheById='IntegralItem',###,'projectId'|getCacheById='IntegralProject',###,'projectType'}" onchange="IntegralInfoDlg.onProjectTypeChange(this);">
-                                                            <option value="">请选择</option>
-                                                            <option value="1">基础分</option>
-                                                            <option value="2">贡献分</option>
-                                                            <option value="3">资历分</option>
+                                                        <select class="form-control" name="projectType[]">
+                                                            <eq name="item.projectType" value="1"><option value="1">基础分</option></eq>
+                                                            <eq name="item.projectType" value="2"><option value="2">贡献分</option></eq>
+                                                            <eq name="item.projectType" value="3"><option value="3">资历分</option></eq>
                                                         </select>
                                                     </div>
                                                 </td>
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>积分项目</label>
-                                                        <select class="form-control" name="projectId[]" value="{$item.item_id|getCacheById='IntegralItem',###,'projectId'}" onchange="IntegralInfoDlg.onProjectChange(this);">
-                                                            <option value="">请选择</option>
+                                                        <select class="form-control" name="projectId[]">
+                                                            <option value="">{$item.projectName}</option>
                                                         </select>
                                                     </div>
                                                 </td>
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>积分标准</label>
-                                                        <select class="form-control" name="item_id[]" value="{$item.item_id}" onchange="IntegralInfoDlg.onItemChange(this);">
-                                                            <option value="">请选择</option>
+                                                        <select class="form-control" name="item_id[]" value="{$item.item_id}">
+                                                            <option value="">{$item.itemName}</option>
                                                         </select>
                                                     </div>
                                                 </td>
                                                 <td>
                                                     <div class="rowGroup">
-                                                        <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit"></span></label>
+                                                        <label class="control-label spacing td-label"><span style="color: red">*</span>数额<span class="unit">({$item.unit})</span></label>
                                                         <input type="text" class="form-control" name="amount[]" value="{$item.amount}"/>
                                                     </div>
                                                 </td>
@@ -250,14 +237,6 @@
                                             </tr>
                                         </table>
                                         {/if}
-                                        <div id="toolbar" style="text-align:center;">
-                                            <button type="button" class="btn btn-sm btn-info " onclick="IntegralInfoDlg.addItem()" id="">
-                                                <i class="fa fa-plus"></i>&nbsp;增加项目
-                                            </button>
-                                            <button type="button" class="btn btn-sm btn-warning " onclick="IntegralInfoDlg.deleteItem()" id="">
-                                                <i class="fa fa-remove"></i>&nbsp;移除项目
-                                            </button>
-                                        </div>
                                     </div>
                                 </div>
                             </form>
@@ -284,7 +263,7 @@
 </div>
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
 <script type="text/javascript">
-    document.write('<script src="/static/modular/gate/integral/integralInfo.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/talentIdentify/integralMgr/IntegralVerify_info.js?v=' + (new Date()).getTime() + '"><\/script>');
     document.write('<script src="/static/modular/common/config.js?v=' + (new Date()).getTime() + '"><\/script>');
 </script>
 {/block}

+ 23 - 0
app/admin/view/system/cache.html

@@ -0,0 +1,23 @@
+{extend name="layout/content"}
+{block name="content"}
+<style type="text/css">
+    .highlight{color:#00ff00;}
+</style>
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <button class="btn btn-info" type="button" id="start">生成缓存</button>
+        <ul id="result"></ul>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;" data-src="/admin/system/cache/step/1"></iframe>
+<script>
+    $("#start").click(function () {
+        $("#result").html("<li>开始生成缓存</li>");
+        var src = $("iframe").data("src");
+        $("iframe").prop("src", src);
+    })
+    function setText(msg) {
+        $("#result").append("<li>" + msg + "</li>")
+    }
+</script>
+{/block}

+ 2 - 0
app/common/api/IntegralRecordApi.php

@@ -17,6 +17,8 @@ class IntegralRecordApi {
 
     public static function getOne($id) {
         $result = IntegralRecord::where("id", "=", $id)->find();
+        $result["enterprise"] = EnterpriseApi::getOne($result["enterprise_id"]);
+        $result["enterprise"]["streetName"] = DictApi::findDictByCode($result["enterprise"]["street"])["name"];
         if ($result) {
             $result["items"] = $result->detail;
         }

+ 4 - 0
app/common/controller/Api.php

@@ -116,6 +116,10 @@ class Api extends BaseController {
         $new_list = [];
         foreach ($list as $key => $item) {
             switch ($item['type']) {
+                case 20:
+                    $new_item["stepName"] = \app\common\state\IntegralState::getLogStepName($item["state"]);
+                    $new_item["stateName"] = \app\common\state\IntegralState::getLogStateName($item["state"]);
+                    break;
                 case 10:
                     if ($item["category"] == "enterprise_change") {
                         switch ($item['step']) {

+ 16 - 0
app/common/model/RedisBaseModel.php

@@ -29,4 +29,20 @@ class RedisBaseModel extends Model {
         }
     }
 
+    public static function cache($id = 0) {
+        $redis = Redis::instance(Config::get("cache.stores.redis.select"));
+        if ($id) {
+            $data = self::select($id);
+            $name = $data->name;
+            $redis->hSet($name, $id, json_encode($data));
+        } else {
+            $list = self::select();
+            $name = $list[0]->name;
+            $redis->del($name);
+            foreach ($list as $data) {
+                $redis->hSet($name, $data["id"], json_encode($data));
+            }
+        }
+    }
+
 }

+ 50 - 0
app/common/state/IntegralState.php

@@ -21,4 +21,54 @@ class IntegralState {
     public const PUBLISH_FAIL = 27; //公布不通过
     public const SUCCESS = 28; //积分兑现成功
 
+    public static function getLogStepName($state) {
+        switch ($state) {
+            case 3:
+            case 4:
+            case 5:
+                return '<span class="label label-primary">初级审核</span>';
+            case 6:
+            case 7:
+            case 8:
+                return '<span class="label label-info">复核</span>';
+            case 21:
+            case 22:
+                return '<span class="label label-info">核查征信</span>';
+            case 23:
+            case 24:
+            case 25:
+                return '<span class="label label-info">公示</span>';
+            case 26:
+            case 27:
+                return '<span class="label label-info">公布</span>';
+            case 28:
+                return '<span class="label label-inverse">发放人才码</span>';
+            default:
+                return "<span class='label'>用户操作</span>";
+        }
+    }
+
+    public static function getLogStateName($state) {
+        switch ($state) {
+            case 1:
+                return '<span class="label">用户保存</span>';
+            case 2:
+                return '<span class="label">用户提交</span>';
+            case 3:
+                return '<span class="label">用户提交</span>';
+            case 4:
+                return '<span class="label">用户提交</span>';
+            case 5:
+                return '<span class="label">用户提交</span>';
+            case 6:
+                return '<span class="label">用户提交</span>';
+            case 7:
+                return '<span class="label">用户提交</span>';
+            case 8:
+                return '<span class="label">用户提交</span>';
+            default:
+                return '<span class="label">添加附件</span>';
+        }
+    }
+
 }

+ 0 - 6
app/enterprise/view/integral/apply.html

@@ -124,12 +124,6 @@
                                                         <input type="text" class="form-control" id="email" name="email"  value="{$row.email}"/>
                                                     </div>
                                                 </td>
-                                                <td>
-                                                    <div class="rowGroup">
-                                                        <label class="control-label spacing td-label"><span style="color: red">*</span>单位标签</label>
-                                                        <div class="form-control" style="border: none">{$row.enterprise.enterpristTagName}</div>
-                                                    </div>
-                                                </td>
                                                 <td>
                                                     <div class="rowGroup">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>单位名称</label>

+ 8 - 5
app/enterprise/view/talent/apply.html

@@ -68,7 +68,8 @@
         border-left:1px solid #ddd;
     }
     #annual_salary{padding-right:32px;}
-    .zhiren{background-image:linear-gradient(#1f0077,#af68ea);color:#fff;}
+    .zhiren-left{width:20px;text-align:center;font-size:12px;line-height:16px;float:left;font-weight:bold;color:#337ab7;}
+    .zhiren-right{margin-left:20px;}
 </style>
 <div class="ibox float-e-margins">
     <div class="ibox-content">
@@ -500,10 +501,12 @@
                                                 <td colspan="4">
                                                     {if condition="$row['isImport']"}
                                                     <div class="rowGroup col-sm-3 zhiren word-wrap-no-width">
-                                                        <label class="control-label spacing td-label"><span style="color: red">*</span>是否符合直认条件</label>
-                                                        人才直认选项
-                                                        <input type="radio" name="isMatchZhiren" value="1" {eq name="row.isMatchZhiren" value="1"}checked{/eq} onchange="TalentInfoInfoDlg.isMatchZhirenChange();"/>是&nbsp;&nbsp;
-                                                        <input type="radio" name="isMatchZhiren" value="0" {if condition="!$row['isMatchZhiren']"}checked{/if} onchange="TalentInfoInfoDlg.isMatchZhirenChange();"/>否
+                                                        <div class="zhiren-left">人才直认</div>
+                                                        <div class="zhiren-right">
+                                                            <label class="control-label spacing td-label"><span style="color: red">*</span>是否符合直认条件</label>
+                                                            <input type="radio" name="isMatchZhiren" value="1" {eq name="row.isMatchZhiren" value="1"}checked{/eq} onchange="TalentInfoInfoDlg.isMatchZhirenChange();"/>是&nbsp;&nbsp;
+                                                            <input type="radio" name="isMatchZhiren" value="0" {if condition="!$row['isMatchZhiren']"}checked{/if} onchange="TalentInfoInfoDlg.isMatchZhirenChange();"/>否
+                                                        </div>
                                                     </div>
                                                     <div class="rowGroup col-sm-6">
                                                         <label class=" control-label spacing td-label"><span style="color: red">*</span>申报来源</label>

+ 1 - 5
public/static/modular/talentIdentify/integralMgr/IntegralVerify_info.js

@@ -630,13 +630,9 @@ $(function () {
     $("input,textarea").not("#checkMsg,#checkMsgFirst").each(function () {
         $(this).attr("readonly", "readonly");
     });
-    IntegralVerifyInfoDlg.typeChange();
-    IntegralVerifyInfoDlg.sourceChange();
     $('[data-toggle="tooltip"]').tooltip();
     var type = $("#type").val();
-    if (type == 1) {
-        IntegralVerifyInfoDlg.initFileTable();
-    }
+    IntegralVerifyInfoDlg.initFileTable();
 
     Feng.getCheckLog("logTable", {"type": CONFIG.project_integral_apply, "mainId": $("#id").val(), "typeFileId": "", "active": 1})
 });