Pārlūkot izejas kodu

积分申报项目及标准

sugangqiang 2 gadi atpakaļ
vecāks
revīzija
1d5bb815cf

+ 15 - 7
app/admin/controller/IntegralMgr.php

@@ -56,6 +56,20 @@ class IntegralMgr extends AdminController {
         if (!$params["projectType"]) {
             return json(["msg" => "请选择项目类别"]);
         }
+        if (!$params["limit"]) {
+            return json(["msg" => "请选择是否上限"]);
+        }
+        if ($params["limit"] == 1) {
+            if (!$params["yearly"]) {
+                return json(["msg" => "请选择上限方案"]);
+            }
+            if (!$params["max"]) {
+                return json(["msg" => "请填写积分上限"]);
+            }
+            if (!is_numeric($params["max"]) || $params["max"] < 1 || $params["max"] != floor($params["max"])) {
+                return json(["msg" => "积分上限必需是大于0的整数"]);
+            }
+        }
         if (!$params["active"]) {
             return json(["msg" => "请设置启用状态"]);
         }
@@ -81,7 +95,7 @@ class IntegralMgr extends AdminController {
     }
 
     public function items() {
-        return view(["items"]);
+        return view("items");
     }
 
     public function itemList() {
@@ -131,12 +145,6 @@ class IntegralMgr extends AdminController {
             if (!$params["stepGainPoints"]) {
                 return json(["msg" => "请输入每新增获得积分"]);
             }
-            if (!$params["maxGainPoints"]) {
-                return json(["msg" => "请输入积分上限"]);
-            }
-            if (!$params["yearly"]) {
-                return json(["msg" => "请选择累计积分方案"]);
-            }
         }
         if (IntegralItemApi::chkExist($params["name"], $params["projectId"], $params["id"]))
             return json(["msg" => "名称已经被使用"]);

+ 11 - 11
app/admin/view/integral_mgr/items.html

@@ -28,7 +28,7 @@
                             <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 data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button">标准名称
                                         </button>
                                     </div>
                                     <input type="text" class="form-control" id="name" placeholder="">
@@ -65,33 +65,33 @@
                                 </div>
                             </div>
                             <div class="col-sm-3">
-                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.search()">
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralItemMgr.search()">
                                     <i class="fa fa-search"></i>&nbsp;搜索
                                 </button>
-                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.reset()">
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralItemMgr.reset()">
                                     <i class="fa fa-trash"></i>&nbsp;重置
                                 </button>
 
                             </div>
                         </div>
                         <div class="hidden-xs" id="IntegralMgrTableToolbar" role="group">
-                            {if condition="chkCommission('/admin/integral_mgr/add','')"}
-                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.openAddIntegralProject()">
+                            {if condition="chkCommission('/admin/integral_mgr/addItem','')"}
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralItemMgr.openAddIntegralItem()">
                                     <i class="fa fa-plus"></i>&nbsp;添加
                                 </button>
                             {/if}
-                            {if condition="chkCommission('/admin/integral_mgr/edit','')"}
-                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.openEditIntegralProject()">
+                            {if condition="chkCommission('/admin/integral_mgr/editItem','')"}
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralItemMgr.openEditIntegralItem()">
                                     <i class="fa fa-edit"></i>&nbsp;修改
                                 </button>
                             {/if}
-                            {if condition="chkCommission('/admin/integral_mgr/delete','')"}
-                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.delete()">
+                            {if condition="chkCommission('/admin/integral_mgr/deleteItem','')"}
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralItemMgr.delete()">
                                     <i class="fa fa-remove"></i>&nbsp;删除
                                 </button>
                             {/if}
                         </div>
-                        <table id="IntegralMgrTable" class="table-condensed" style="font-size: 10px;table-layout: fixed!important;" data-mobile-responsive="true" data-click-to-select="true">
+                        <table id="IntegralItemMgrTable" 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>
@@ -107,6 +107,6 @@
 <iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
 
 <script type="text/javascript">
-    document.write('<script src="/static/modular/talentIdentify/integralMgr/IntegralItemMgr.js?v=' + (new Date()).getTime() + '"><\/script>');
+    document.write('<script src="/static/modular/talentIdentify/integralMgr/integralItemMgr.js?v=' + (new Date()).getTime() + '"><\/script>');
 </script>
 {/block}

+ 30 - 1
app/admin/view/integral_mgr/save.html

@@ -40,6 +40,29 @@
                                     <option value="3">资历分</option>
                                 </select>
                             </div>
+                            <label class="col-sm-2 control-label spacing">是否上限</label>
+                            <div class="col-sm-4 spacing">
+                                <select class="form-control" id="limit" name="limit" selectVal="{$row.limit}" onchange="IntegralMgrInfo.onLimitChange();">
+                                    <option value="1">开启</option>
+                                    <option value="2">关闭</option>
+                                </select>
+                            </div>
+                        </div>
+                        <div class="rowGroup limit-setting" style="display:none;">
+                            <label class="col-sm-2 control-label spacing">上限方案</label>
+                            <div class="col-sm-4 spacing">
+                                <select class="form-control" id="yearly" name="yearly" selectVal="{$row.yearly}">
+                                    <option value="">请选择</option>
+                                    <option value="1">年度重置</option>
+                                    <option value="2">不重置</option>
+                                </select>
+                            </div>
+                            <label class="col-sm-2 control-label spacing">积分上限</label>
+                            <div class="col-sm-4 spacing">
+                                <input class="form-control" id="max" name="max" value="{$row.max}">
+                            </div>
+                        </div>
+                        <div class="rowGroup">
                             <label class="col-sm-2 control-label spacing">启用状态</label>
                             <div class="col-sm-4 spacing">
                                 <select class="form-control" id="active" name="active" selectVal="{$row.active}">
@@ -52,10 +75,16 @@
                 </form>
             </div>
             <div class="row btn-group-m-t">
-                <div class="col-sm-12" style="text-align: center;">
+                <div class="col-sm-12" style="text-align: center;">                    
+                    {if condition="$row['id'] gt 0"}
+                    <button type="button" class="btn btn-sm btn-info " onclick="IntegralMgrInfo.editSubmit()" id="ensure">
+                        <i class="fa fa-check"></i>&nbsp;修改
+                    </button>
+                    {else/}
                     <button type="button" class="btn btn-sm btn-info " onclick="IntegralMgrInfo.addSubmit()" id="ensure">
                         <i class="fa fa-check"></i>&nbsp;提交
                     </button>
+                    {/if}
                     <button type="button" class="btn btn-sm btn-danger " onclick="IntegralMgrInfo.close()" id="cancel">
                         <i class="fa fa-eraser"></i>&nbsp;取消
                     </button>

+ 6 - 14
app/admin/view/integral_mgr/save_item.html

@@ -79,20 +79,6 @@
                                 <input class="form-control" id="stepGainPoints" name="stepGainPoints" value="{$row.stepGainPoints}">
                             </div>
                         </div>
-                        <div class="rowGroup planb" style="display:none;">
-                            <label class="col-sm-2 control-label spacing">积分上限</label>
-                            <div class="col-sm-4 spacing">
-                                <input class="form-control" id="maxGainPoints" name="maxGainPoints" value="{$row.maxGainPoints}">
-                            </div>
-                            <label class="col-sm-2 control-label spacing">累计积分方案</label>
-                            <div class="col-sm-4 spacing">
-                                <select class="form-control" id="yearly" name="yearly" selectVal="{$row.yearly}" onchange="IntegralItemMgrInfo.onAccumulationPlanChange();">
-                                    <option value="">请选择</option>
-                                    <option value="1">每年度重置积分上限</option>
-                                    <option value="2">达上限即止</option>
-                                </select>
-                            </div>
-                        </div>
                         <div class="rowGroup">
                             <label class="col-sm-2 control-label spacing">证明材料</label>
                             <div class="col-sm-4 spacing">
@@ -109,9 +95,15 @@
             </div>
             <div class="row btn-group-m-t">
                 <div class="col-sm-12" style="text-align: center;">
+                    {if condition="$row['id'] gt 0"}
+                    <button type="button" class="btn btn-sm btn-info " onclick="IntegralItemMgrInfo.editSubmit()" id="ensure">
+                        <i class="fa fa-check"></i>&nbsp;修改
+                    </button>
+                    {else/}
                     <button type="button" class="btn btn-sm btn-info " onclick="IntegralItemMgrInfo.addSubmit()" id="ensure">
                         <i class="fa fa-check"></i>&nbsp;提交
                     </button>
+                    {/if}
                     <button type="button" class="btn btn-sm btn-danger " onclick="IntegralItemMgrInfo.close()" id="cancel">
                         <i class="fa fa-eraser"></i>&nbsp;取消
                     </button>

+ 15 - 11
app/common/api/IntegralItemApi.php

@@ -7,22 +7,30 @@ use app\common\model\IntegralItem;
 class IntegralItemApi {
 
     public static function getOne($id) {
-        return IntegralItem::alias("i")->leftJoin("new_integral_project p", "p.id=i.projectId")->field("i.*,p.type,if(yearly > 0,yearly,0) as plan")->findOrEmpty($id);
+        return IntegralItem::alias("i")->leftJoin("new_integral_project p", "p.id=i.projectId")->field("i.*,p.type,if(stepNeedAmount > 0,2,1) as plan")->findOrEmpty($id);
     }
 
     public static function getList($params) {
         $order = $params["order"] ?: "desc";
         $offset = $params["offset"] ?: 0;
         $limit = $params["limit"] ?: 10;
-        $where[] = ["delete", "=", 0];
+        $where[] = ["i.delete", "=", 0];
+        if ($params["type"]) {
+            $where[] = ["p.type", "=", $params["type"]];
+        }
+        if ($params["name"]) {
+            $where[] = ["i.name", "like", "%{$params["name"]}%"];
+        }
         if ($params["projectType"]) {
-            $where[] = ["projectType", "=", $params["projectType"]];
+            $where[] = ["p.projectType", "=", $params["projectType"]];
         }
         if ($params["active"]) {
-            $where[] = ["active", "=", $params["active"]];
+            $where[] = ["i.active", "=", $params["active"]];
         }
-        $count = IntegralItem::where($where)->count();
-        $list = IntegralItem::where($where)->limit($offset, $limit)->order("updateTime desc,createTime desc")->select()->toArray();
+        $count = IntegralItem::alias("i")->leftJoin("new_integral_project p", "p.id=i.projectId")->where($where)->count();
+        $list = IntegralItem::alias("i")->leftJoin("new_integral_project p", "p.id=i.projectId")->where($where)
+                        ->field("i.*,p.type,p.name as projectName,p.projectType")
+                        ->limit($offset, $limit)->order("i.updateTime desc,i.createTime desc")->select()->toArray();
         return ["total" => $count, "rows" => $list];
     }
 
@@ -38,18 +46,14 @@ class IntegralItemApi {
         $data["unit"] = $params["unit"];
         $data["fstNeedAmount"] = $params["fstNeedAmount"];
         $data["fstGainPoints"] = $params["fstGainPoints"];
-        $data["fileTypeId"] = implode(",", $params["fileTypeId"]);
+        $data["fileTypeId"] = $params["fileTypeId"] ? implode(",", $params["fileTypeId"]) : null;
         $data["active"] = $params["active"];
         if ($params["plan"] == 2) {
             $data["stepNeedAmount"] = $params["stepNeedAmount"];
             $data["stepGainPoints"] = $params["stepGainPoints"];
-            $data["maxGainPoints"] = $params["maxGainPoints"];
-            $data["yearly"] = $params["yearly"];
         } else {
             $data["stepNeedAmount"] = 0;
             $data["stepGainPoints"] = 0;
-            $data["maxGainPoints"] = 0;
-            $data["yearly"] = 0;
         }
         if ($params["id"]) {
             $data["id"] = $params["id"];

+ 9 - 1
app/common/api/IntegralProjectApi.php

@@ -28,7 +28,7 @@ class IntegralProjectApi {
             $where[] = ["active", "=", $params["active"]];
         }
         $count = IntegralProject::where($where)->count();
-        $list = IntegralProject::where($where)->limit($offset, $limit)->order("updateTime desc,createTime desc")->select()->toArray();
+        $list = IntegralProject::where($where)->field("*,if(updateTime is null,createTime,updateTime) as orderTime")->limit($offset, $limit)->order("orderTime desc")->select()->toArray();
         return ["total" => $count, "rows" => $list];
     }
 
@@ -43,6 +43,14 @@ class IntegralProjectApi {
         $data["name"] = $params["name"];
         $data["projectType"] = $params["projectType"];
         $data["active"] = $params["active"];
+        $data["limit"] = $params["limit"];
+        if ($data["limit"] == 1) {
+            $data["yearly"] = $params["yearly"];
+            $data["max"] = $params["max"];
+        } else {
+            $data["yearly"] = 0;
+            $data["max"] = 0;
+        }
         if ($params["id"]) {
             $data["id"] = $params["id"];
             $data["updateTime"] = date("Y-m-d H:i:s");

+ 1 - 0
app/common/api/NoticeApi.php

@@ -46,6 +46,7 @@ class NoticeApi {
         } else {
             $data["createtime"] = date("Y-m-d H:i:s");
             $data["creater"] = session("user")["uid"];
+            $data["isTop"] = 2;
             return Notice::insert($data);
         }
     }

+ 14 - 32
public/static/modular/talentIdentify/integralMgr/IntegralItemMgr_info.js

@@ -2,7 +2,7 @@
  * 初始化认定条件管理详情对话框
  */
 var IntegralItemMgrInfo = {
-    integralMgrInfoData: {},
+    integralItemMgrInfoData: {},
     validateFields: {
         projectId: {
             validators: {
@@ -66,20 +66,6 @@ var IntegralItemMgrInfo = {
                     message: '请输入每新增获得积分'
                 }
             }
-        },
-        maxGainPoints: {
-            validators: {
-                notEmpty: {
-                    message: '请输入积分上限'
-                }
-            }
-        },
-        yearly: {
-            validators: {
-                notEmpty: {
-                    message: '请选择累计积分方案'
-                }
-            }
         }
     }
 };
@@ -88,7 +74,7 @@ var IntegralItemMgrInfo = {
  * 清除数据
  */
 IntegralItemMgrInfo.clearData = function () {
-    this.integralMgrInfoData = {};
+    this.integralItemMgrInfoData = {};
 }
 
 /**
@@ -98,7 +84,7 @@ IntegralItemMgrInfo.clearData = function () {
  * @param val 数据的具体值
  */
 IntegralItemMgrInfo.set = function (key, val) {
-    this.integralMgrInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
+    this.integralItemMgrInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
     return this;
 }
 
@@ -116,7 +102,7 @@ IntegralItemMgrInfo.get = function (key) {
  * 关闭此对话框
  */
 IntegralItemMgrInfo.close = function () {
-    parent.layer.close(window.parent.IntegralMgr.layerIndex);
+    parent.layer.close(window.parent.IntegralItemMgr.layerIndex);
 }
 
 /**
@@ -134,8 +120,6 @@ IntegralItemMgrInfo.collectData = function () {
             .set('fstGainPoints')
             .set('stepNeedAmount')
             .set('stepGainPoints')
-            .set('maxGainPoints')
-            .set('yearly')
             .set('fileTypeId')
             .set('active');
 }
@@ -169,15 +153,11 @@ IntegralItemMgrInfo.onIntegralPlanChange = function () {
             $(".planb").css("display", "none");
             $('#integraMgrInfoForm').bootstrapValidator('removeField', "stepNeedAmount");
             $('#integraMgrInfoForm').bootstrapValidator('removeField', "stepGainPoints");
-            $('#integraMgrInfoForm').bootstrapValidator('removeField', "maxGainPoints");
-            $('#integraMgrInfoForm').bootstrapValidator('removeField', "yearly");
             break;
         case "2":
             $(".planb").css("display", "block");
             $('#integraMgrInfoForm').bootstrapValidator('addField', "stepNeedAmount", {validators: {notEmpty: {message: '请填写每新增量'}}});
             $('#integraMgrInfoForm').bootstrapValidator('addField', "stepGainPoints", {validators: {notEmpty: {message: '请填写每新增获得积分'}}});
-            $('#integraMgrInfoForm').bootstrapValidator('addField', "maxGainPoints", {validators: {notEmpty: {message: '请填写积分上限'}}});
-            $('#integraMgrInfoForm').bootstrapValidator('addField', "yearly", {validators: {notEmpty: {message: '请选择累计积分方案'}}});
             break;
     }
 }
@@ -195,7 +175,7 @@ IntegralItemMgrInfo.addSubmit = function () {
     var ajax = new $ax("/admin/integral_mgr/addItem", function (data) {
         if (data.code == "200") {
             Feng.success(data.msg);
-            window.parent.IntegralMgr.table.refresh();
+            window.parent.IntegralItemMgr.table.refresh();
             IntegralItemMgrInfo.close();
         } else {
             Feng.error(data.msg);
@@ -203,7 +183,7 @@ IntegralItemMgrInfo.addSubmit = function () {
     }, function (data) {
         Feng.error("添加失败!" + data.responseJSON.message + "!");
     });
-    ajax.set(this.integralMgrInfoData);
+    ajax.set(this.integralItemMgrInfoData);
     ajax.start();
 }
 
@@ -219,7 +199,7 @@ IntegralItemMgrInfo.editSubmit = function () {
     var ajax = new $ax(Feng.ctxPath + "/admin/integral_mgr/editItem", function (data) {
         if (data.code == "200") {
             Feng.success(data.msg);
-            window.parent.IntegralMgr.table.refresh();
+            window.parent.IntegralItemMgr.table.refresh();
             IntegralItemMgrInfo.close();
         } else {
             Feng.error(data.msg);
@@ -227,7 +207,7 @@ IntegralItemMgrInfo.editSubmit = function () {
     }, function (data) {
         Feng.error("修改失败!" + data.responseJSON.message + "!");
     });
-    ajax.set(this.integralMgrInfoData);
+    ajax.set(this.integralItemMgrInfoData);
     ajax.start();
 }
 
@@ -248,13 +228,15 @@ $(function () {
     });
     IntegralItemMgrInfo.onTypeChange();
     IntegralItemMgrInfo.onIntegralPlanChange();
-    
+
     $("#fileTypeId").chosen({
         no_results_text: "没有找到结果!",
-        width:'100%',
-        search_contains:true,       //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
+        width: '100%',
+        search_contains: true,       //关键字模糊搜索。设置为true,只要选项包含搜索词就会显示;设置为false,则要求从选项开头开始匹配
         disable_search: false,
         enable_split_word_search: true,
-        rtl:true
+        rtl: true
     });
+    var fileTypeIds = $("#fileTypeId").attr("selectVal")
+    $("#fileTypeId").val(fileTypeIds.split(",")).trigger("chosen:updated");
 });

+ 25 - 0
public/static/modular/talentIdentify/integralMgr/IntegralMgr_info.js

@@ -25,6 +25,13 @@ var IntegralMgrInfo = {
                 }
             }
         },
+        limit: {
+            validators: {
+                notEmpty: {
+                    message: '请选择是否上限'
+                }
+            }
+        },
         active: {
             validators: {
                 notEmpty: {
@@ -79,9 +86,27 @@ IntegralMgrInfo.collectData = function () {
             .set('type')
             .set('name')
             .set('projectType')
+            .set('limit')
+            .set('yearly')
+            .set('max')
             .set('active');
 }
 
+IntegralMgrInfo.onLimitChange = function () {
+    var limit = $("#limit").val();
+    switch (limit) {
+        case "1":
+            $('#integraMgrInfoForm').bootstrapValidator('addField', "yearly", {validators: {notEmpty: {message: '请选择上限方案'}}});
+            $('#integraMgrInfoForm').bootstrapValidator('addField', "max", {validators: {notEmpty: {message: '请填写积分上限'}}});
+            $(".limit-setting").css("display", "block");
+            break;
+        default:
+            $('#integraMgrInfoForm').bootstrapValidator('removeField', "yearly");
+            $('#integraMgrInfoForm').bootstrapValidator('removeField', "max");
+            $(".limit-setting").css("display", "none");
+    }
+}
+
 /**
  * 提交添加
  */

+ 20 - 6
public/static/modular/talentIdentify/integralMgr/integralItemMgr.js

@@ -24,7 +24,8 @@ IntegralItemMgr.initColumn = function () {
                 }
             }
         },
-        {title: '项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '标准名称', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '所属项目', field: 'projectName', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
         {title: '项目类别', field: 'projectType', visible: true, align: 'center', valign: 'middle',
             formatter: function (value, row, index) {
                 switch (value) {
@@ -37,7 +38,20 @@ IntegralItemMgr.initColumn = function () {
                 }
             }
         },
-        {title: '标准名称', field: 'name', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip'},
+        {title: '首次积分规则', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                return "首次达成" + row.fstNeedAmount + row.unit + "可获得" + row.fstGainPoints + "积分";
+            }
+        },
+        {title: '增量积分规则', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip',
+            formatter: function (value, row, index) {
+                if (row.stepNeedAmount > 0) {
+                    return "每新增" + row.stepNeedAmount + row.unit + "可获得" + row.stepGainPoints + "积分";
+                } else {
+                    return "未设置";
+                }
+            }
+        },
         {title: '是否启用', field: 'active', visible: true, align: 'center', valign: 'middle',
             formatter: function (value, row, index) {
                 if (value == 1) {
@@ -68,10 +82,10 @@ IntegralItemMgr.check = function () {
 /**
  * 点击添加积分项目
  */
-IntegralItemMgr.openAddIntegralProject = function () {
+IntegralItemMgr.openAddIntegralItem = function () {
     var index = layer.open({
         type: 2,
-        title: '添加积分项目',
+        title: '添加积分标准',
         area: ['1126px', '420px'], //宽高
         fix: false, //不固定
         maxmin: true,
@@ -83,11 +97,11 @@ IntegralItemMgr.openAddIntegralProject = function () {
 /**
  * 打开编辑积分项目
  */
-IntegralItemMgr.openEditIntegralProject = function () {
+IntegralItemMgr.openEditIntegralItem = function () {
     if (this.check()) {
         var index = layer.open({
             type: 2,
-            title: '编辑积分项目',
+            title: '编辑积分标准',
             area: ['1126px', '420px'], //宽高
             fix: false, //不固定
             maxmin: true,

+ 19 - 0
public/static/modular/talentIdentify/integralMgr/integralMgr.js

@@ -37,6 +37,25 @@ IntegralMgr.initColumn = function () {
                 }
             }
         },
+        {title: '上限设置', field: 'limit', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index) {
+                switch (value) {
+                    case 1:
+                        var limitStr = "上限" + row.max;
+                        switch (row.yearly) {
+                            case 1:
+                                limitStr += "(年度重置)";
+                                break;
+                            case 2:
+                                limitStr += "(不重置)";
+                                break;
+                        }
+                        return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">" + limitStr + "</button>";
+                    default:
+                        return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">关闭</button>";
+                }
+            }
+        },
         {title: '是否启用', field: 'active', visible: true, align: 'center', valign: 'middle',
             formatter: function (value, row, index) {
                 if (value == 1) {