sugangqiang 2 年之前
父節點
當前提交
ec1dffa5b8

+ 115 - 0
app/admin/controller/IntegralMgr.php

@@ -0,0 +1,115 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\common\AdminController;
+
+/**
+ * Description of IntegralMgr
+ * 积分管理
+ * @author sgq
+ */
+class IntegralMgr extends AdminController {
+
+    public function index() {
+        return view();
+    }
+
+    public function list() {
+        return json(EnterpriseVerifyMgrApi::getList($this->request->param()));
+    }
+
+    /**
+     * 添加积分项目
+     * @return type
+     */
+    public function add() {
+        if ($this->request->isPost()) {
+            $params = $this->request->param();
+            if (!$params["name"]) {
+                return json(["msg" => "请选择审核单位"]);
+            }
+            if (!$params["enterpriseTag"] && !$params["uniCode"]) {
+                return json(["msg" => "请选择单位标签或填写例外企业统一信用代码,可同时设置"]);
+            }
+            if (EnterpriseVerifyMgrApi::chkExist($params["enterpriseTag"]) && $params["enterpriseTag"])
+                return json(["msg" => "该标签已经存在审核配置,不需要重复配置"]);
+            if (EnterpriseVerifyMgrApi::chkUnicodeExist($params["uniCode"]) && $params["uniCode"])
+                return json(["msg" => "输入的例外企业统一信用代码中包含已经被其它单位设置过的企业,不能重复设置"]);
+            if (EnterpriseVerifyMgrApi::edit($params))
+                return json(["code" => 200, "msg" => "添加单位标签审核配置成功"]);
+            return json(["msg" => "添加单位标签审核配置失败"]);
+        }
+        return view("save");
+    }
+
+    /**
+     * 编辑积分项目
+     * @return type
+     */
+    public function edit() {
+        $params = $this->request->param();
+        if ($this->request->isPost()) {
+            return $this->doSave($params);
+        }
+        return view("save");
+    }
+
+    private function doSave($params) {
+        if (!$params["id"])
+            return json(["msg" => "没有对应的积分项目,无法编辑"]);
+        if (!$params["type"]) {
+            return json(["msg" => "请选择审核单位"]);
+        }
+        if (!$params["projectType"]) {
+            return json(["msg" => "请选择审核单位"]);
+        }
+        if (!$params["type"]) {
+            return json(["msg" => "请选择审核单位"]);
+        }
+        if (!$params["enterpriseTag"] && !$params["uniCode"]) {
+            return json(["msg" => "请选择单位标签或填写例外企业统一信用代码,可同时设置"]);
+        }
+        if (EnterpriseVerifyMgrApi::chkExist($params["enterpriseTag"], $params["id"]) && $params["enterpriseTag"])
+            return json(["msg" => "该标签已经存在审核配置,不需要重复配置"]);
+        if (EnterpriseVerifyMgrApi::chkUnicodeExist($params["uniCode"], $params["id"]) && $params["uniCode"])
+            return json(["msg" => "输入的例外企业统一信用代码中包含已经被其它单位设置过的企业,不能重复设置"]);
+        if (EnterpriseVerifyMgrApi::edit($params))
+            return json(["code" => 200, "msg" => "编辑单位标签审核配置成功"]);
+        return json(["msg" => "编辑单位标签审核配置失败"]);
+    }
+
+    /**
+     * 删除积分项目
+     * @return type
+     */
+    public function delete() {
+        if ($this->request->isPost()) {
+            $id = $this->request->param("id");
+            if (EnterpriseVerifyMgrApi::delete($id))
+                return json(["code" => 200, "msg" => "删除单位标签审核配置成功"]);
+            return json(["msg" => "删除单位标签审核配置失败"]);
+        }
+    }
+
+    public function items() {
+        return view(["items"]);
+    }
+
+    public function itemList() {
+        return json([]);
+    }
+
+    public function addItem() {
+        return view("save_item");
+    }
+
+    public function editItem() {
+        return view("save_item");
+    }
+
+    public function deleteItem() {
+        
+    }
+
+}

+ 112 - 0
app/admin/view/integral_mgr/index.html

@@ -0,0 +1,112 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="row">
+    <div class="col-sm-12">
+        <div class="ibox float-e-margins">
+            <div class="ibox-title">
+                <h5>积分项目管理</h5>
+            </div>
+            <div class="ibox-content">
+                <div class="row row-lg">
+                    <div class="col-sm-12">
+                        <div class="row">
+                            <input type="hidden" id="userType" value="${user.type}">
+                            <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>
+                                    </div>
+                                    <select class="form-control" id="type">
+                                        <option value=""></option>
+                                        <option value="1">晋江市现代产业体系人才</option>
+                                        <option value="2">集成电路优秀人才</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <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>
+                                    </div>
+                                    <input type="text" class="form-control" id="name" placeholder="">
+                                </div>
+                            </div>
+                            <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>
+                                    </div>
+                                    <select class="form-control" id="projectType">
+                                        <option value=""></option>
+                                        <option value="1">基础分</option>
+                                        <option value="2">贡献分</option>
+                                        <option value="3">资历分</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <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>
+                                    </div>
+                                    <select class="form-control" id="active">
+                                        <option value=""></option>
+                                        <option value="1">启用</option>
+                                        <option value="2">停用</option>
+
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="col-sm-3">
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.search()">
+                                    <i class="fa fa-search"></i>&nbsp;搜索
+                                </button>
+                                <button type="button" class="btn btn-sm btn-primary " onclick="IntegralMgr.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()">
+                                    <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()">
+                                    <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()">
+                                    <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">
+                            <thead>
+                                <tr>
+                                    <th data-field="selectItem" data-checkbox="true"></th>
+                                </tr>
+                            </thead>
+                        </table>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+
+<script type="text/javascript">
+    document.write('<script src="/static/modular/talentIdentify/integralMgr/IntegralMgr.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 16 - 0
app/admin/view/integral_mgr/items.html

@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<!--
+To change this license header, choose License Headers in Project Properties.
+To change this template file, choose Tools | Templates
+and open the template in the editor.
+-->
+<html>
+    <head>
+        <title>TODO supply a title</title>
+        <meta charset="UTF-8">
+        <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    </head>
+    <body>
+        <div>TODO write content</div>
+    </body>
+</html>

+ 70 - 0
app/admin/view/integral_mgr/save.html

@@ -0,0 +1,70 @@
+{extend name="layout/content"}
+{block name="content"}
+<style type="text/css">
+    .spacing {
+        margin-bottom: 10px;
+        padding-right:4px;
+        padding-left: 4px;
+    }
+    .rowGroup{height:50px;}
+    .table td{border:1px solid #ddd;}
+</style>
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <div class="form-horizontal">
+            <div class="row">
+                <form id="integraMgrInfoForm">
+                    <div class="col-sm-12 ">
+                        <input id="id" name="id" type="hidden" value="{$row.id}"/>
+                        <div class="rowGroup">
+                            <label class="col-sm-2 control-label spacing">人才类别</label>
+                            <div class="col-sm-4 spacing">
+                                <select class="form-control" id="type" name="type" selectVal="{$row.type}">
+                                    <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="name" name="name" value="{$row.name}">
+                            </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="projectType" name="projectType" selectVal="{$row.type}">
+                                    <option value="">请选择</option>
+                                    <option value="1">基础分</option>
+                                    <option value="2">贡献分</option>
+                                    <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="active" name="active" selectVal="{$row.active}">
+                                    <option value="1">启用</option>
+                                    <option value="2">停用</option>
+                                </select>
+                            </div>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="row btn-group-m-t">
+                <div class="col-sm-12" style="text-align: center;">
+                    <button type="button" class="btn btn-sm btn-info " onclick="IntegralMgr.addSubmit()" id="ensure">
+                        <i class="fa fa-check"></i>&nbsp;提交
+                    </button>
+                    <button type="button" class="btn btn-sm btn-danger " onclick="IntegralMgr.close()" id="cancel">
+                        <i class="fa fa-eraser"></i>&nbsp;取消
+                    </button>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/talentIdentify/integralMgr/IntegralMgr_info.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

+ 57 - 0
app/admin/view/integral_mgr/save_item.html

@@ -0,0 +1,57 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <form id="enterpriseTypeInfoForm">
+            <div class="form-horizontal">
+                <div class="row">
+                    <div class="col-sm-6">
+                        <div class="form-group">
+                            <label class="col-sm-3 control-label"><span style="color: red">*</span>审核单位</label>
+                            <div class="col-sm-9">
+                                <select class="form-control" id="companyId" name="companyId" data-placeholder="请选择审核单位">
+                                </select>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-3 control-label spacing">例外设置</label>
+                            <div class="col-sm-9 spacing">
+                                <input class="form-control" id="uniCode" name="uniCode" placeholder="填写统一信用代码,多个用,分隔">
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-sm-6">
+                        <div class="form-group">
+                            <label class="col-sm-3 control-label spacing">单位标签</label>
+                            <div class="col-sm-9 spacing">
+                                <select class="form-control" id="enterpriseTag" name="enterpriseTag">
+                                </select>
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-3 control-label spacing">备注</label>
+                            <div class="col-sm-9 spacing">
+                                <input class="form-control" id="description" name="description">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-12" style="text-align: center;">
+                        <button type="button" class="btn btn-sm btn-info " onclick="EnterprisetypePropertiesInfoDlg.addSubmit()" id="ensure">
+                            <i class="fa fa-check"></i>&nbsp;提交
+                        </button>
+                        <button type="button" class="btn btn-sm btn-danger " onclick="EnterprisetypePropertiesInfoDlg.close()" id="cancel">
+                            <i class="fa fa-eraser"></i>&nbsp;取消
+                        </button>
+                    </div>
+                </div>
+            </div>
+        </form>
+
+    </div>
+</div>
+<script type="text/javascript">
+    document.write('<script src="/static/modular/system/enterprisetypeProperties/enterprisetypeProperties_info.js?v=' + (new Date()).getTime() + '"><\/script>');
+</script>
+{/block}

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

@@ -0,0 +1,16 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+/**
+ * Description of IntegralItem
+ *
+ * @author sgq
+ */
+class IntegralItem extends Model {
+
+    protected $table = "new_integral_item";
+
+}

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

@@ -0,0 +1,16 @@
+<?php
+
+namespace app\common\model;
+
+use think\Model;
+
+/**
+ * Description of IntegralProject
+ *
+ * @author sgq
+ */
+class IntegralProject extends Model {
+
+    protected $table = "new_integral_project";
+
+}

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

@@ -0,0 +1,149 @@
+/**
+ * 初始化认定条件管理详情对话框
+ */
+var IntegralMgrInfo = {
+    integralMgrInfoData: {},
+    validateFields: {
+        type: {
+            validators: {
+                notEmpty: {
+                    message: '请选择人才类型'
+                }
+            }
+        },
+        name: {
+            validators: {
+                notEmpty: {
+                    message: '请填写项目名称'
+                }
+            }
+        },
+        projectType: {
+            validators: {
+                notEmpty: {
+                    message: '请选择项目类别'
+                }
+            }
+        },
+        active: {
+            validators: {
+                notEmpty: {
+                    message: '请选择启用状态'
+                }
+            }
+        }
+    }
+};
+
+/**
+ * 清除数据
+ */
+IntegralMgrInfo.clearData = function () {
+    this.integralMgrInfoData = {};
+}
+
+/**
+ * 设置对话框中的数据
+ *
+ * @param key 数据的名称
+ * @param val 数据的具体值
+ */
+IntegralMgrInfo.set = function (key, val) {
+    this.integralMgrInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
+    return this;
+}
+
+/**
+ * 设置对话框中的数据
+ *
+ * @param key 数据的名称
+ * @param val 数据的具体值
+ */
+IntegralMgrInfo.get = function (key) {
+    return $("#" + key).val();
+}
+
+/**
+ * 关闭此对话框
+ */
+IntegralMgrInfo.close = function () {
+    parent.layer.close(window.parent.IntegralMgr.layerIndex);
+}
+
+/**
+ * 收集数据
+ */
+IntegralMgrInfo.collectData = function () {
+    this
+            .set('id')
+            .set('type')
+            .set('name')
+            .set('projectType')
+            .set('active');
+}
+
+/**
+ * 提交添加
+ */
+IntegralMgrInfo.addSubmit = function () {
+    this.clearData();
+    this.collectData();
+    if (!this.validate()) {
+        return;
+    }
+
+    var ajax = new $ax("/admin/integral_mgr/add", function (data) {
+        if (data.code == "200") {
+            Feng.success(data.msg);
+            window.parent.IntegraMgr.table.refresh();
+            IntegralMgrInfo.close();
+        } else {
+            Feng.error(data.msg);
+        }
+    }, function (data) {
+        Feng.error("添加失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set(this.integralMgrInfoData);
+    ajax.start();
+}
+
+/**
+ * 提交修改
+ */
+IntegralMgrInfo.editSubmit = function () {
+    this.clearData();
+    this.collectData();
+    if (!this.validate()) {
+        return;
+    }
+    var ajax = new $ax(Feng.ctxPath + "/admin/integral_mgr/edit", function (data) {
+        if (data.code == "200") {
+            Feng.success(data.msg);
+            window.parent.IntegraMgr.table.refresh();
+            IntegralMgrInfo.close();
+        } else {
+            Feng.error(data.msg);
+        }
+    }, function (data) {
+        Feng.error("修改失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set(this.integralMgrInfoData);
+    ajax.start();
+}
+
+/**
+ * 验证数据是否为空
+ */
+IdentifyConditionInfoDlg.validate = function () {
+    $('#integraMgrInfoForm').data("bootstrapValidator").resetForm();
+    $('#integraMgrInfoForm').bootstrapValidator('validate');
+    return $("#integraMgrInfoForm").data('bootstrapValidator').isValid();
+}
+
+$(function () {
+    Feng.initValidator("integraMgrInfoForm", IdentifyConditionInfoDlg.validateFields);
+    //下拉框数据回显
+    $("select").each(function () {
+        $(this).val($(this).attr("selectVal"));
+    });
+});

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

@@ -0,0 +1,163 @@
+/**
+ * 认定条件管理管理初始化
+ */
+var IntegralMgr = {
+    id: "IntegralMgrTable", //表格id
+    seItem: null, //选中的条目
+    table: null,
+    layerIndex: -1
+};
+
+/**
+ * 初始化表格的列
+ */
+IntegralMgr.initColumn = function () {
+    return [
+        {field: 'selectItem', radio: true},
+        {title: '人才类别', field: 'type', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return "晋江市现代产业体系人才";
+                }
+                if (value == 2) {
+                    return "集成电路优秀人才";
+                }
+            }
+        },
+        {title: '项目名称', field: 'name', 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) {
+                    case 1:
+                        return "基础分";
+                    case 2:
+                        return "贡献分"
+                    case 3:
+                        return "资历分";
+                }
+            }
+        },
+        {title: '是否启用', field: 'active', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row, index) {
+                if (value == 1) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-primary btn-xs\">启用</button>";
+                }
+                if (value == 2) {
+                    return "<button type=\"button\" style=\"line-height: 1.3\" class=\"btn btn-warning btn-xs\">停用</button>";
+                }
+            }
+        }
+    ];
+};
+
+/**
+ * 检查是否选中
+ */
+IntegralMgr.check = function () {
+    var selected = $('#' + this.id).bootstrapTable('getSelections');
+    if (selected.length == 0) {
+        Feng.info("请先选中表格中的某一记录!");
+        return false;
+    } else {
+        IntegralMgr.seItem = selected[0];
+        return true;
+    }
+};
+
+/**
+ * 点击添加积分项目
+ */
+IntegralMgr.openAddIntegralProject = function () {
+    var index = layer.open({
+        type: 2,
+        title: '添加积分项目',
+        area: ['1126px', '420px'], //宽高
+        fix: false, //不固定
+        maxmin: true,
+        content: Feng.ctxPath + '/admin/integral_mgr/add'
+    });
+    this.layerIndex = index;
+};
+
+/**
+ * 打开编辑积分项目
+ */
+IntegralMgr.openEditIntegralProject = function () {
+    if (this.check()) {
+        var index = layer.open({
+            type: 2,
+            title: '编辑积分项目',
+            area: ['1126px', '420px'], //宽高
+            fix: false, //不固定
+            maxmin: true,
+            content: Feng.ctxPath + '/admin/integral_mgr/edit/id/' + IntegralMgr.seItem.id
+        });
+        this.layerIndex = index;
+    }
+};
+
+/**
+ * 删除积分项目
+ */
+IntegralMgr.delete = function () {
+    if (this.check()) {
+        var operation = function () {
+            var ajax = new $ax(Feng.ctxPath + "/admin/integral_mgr/delete/id/", function (data) {
+                Feng.success("删除成功!");
+                IntegralMgr.table.refresh();
+            }, function (data) {
+                Feng.error("删除失败!" + data.responseJSON.message + "!");
+            });
+            ajax.set("id", IntegralMgr.seItem.id);
+            ajax.start();
+        }
+        Feng.confirm("是否刪除该积分项目(同时会删除其下包含的所有积分标准项)?", operation);
+    }
+};
+
+/**
+ * 查询表单提交参数对象
+ * @returns {{}}
+ */
+IntegralMgr.formParams = function () {
+    var queryData = {};
+    queryData['type'] = $("#type").val();
+    queryData['name'] = $("#name").val();
+    queryData['projectType'] = $("#projectType").val();
+    queryData['active'] = $("#active").val();
+    return queryData;
+}
+
+
+/**
+ * 查询认定条件管理列表
+ */
+IntegralMgr.search = function () {
+    IntegralMgr.table.refresh({query: IntegralMgr.formParams()});
+};
+
+/**
+ * 重置
+ */
+IntegralMgr.reset = function () {
+    $("#type").val("");
+    $("#name").val("");
+    $("#projectType").val("");
+    $("#active").val("");
+}
+
+//回调
+IntegralMgr.callBack = function (data) {
+    Feng.info(data.msg);
+    if (data.code == 200) {
+        $("#importModal").modal("hide");
+        IntegralMgr.table.refresh();
+    }
+}
+
+$(function () {
+    var defaultColunms = IntegralMgr.initColumn();
+    var table = new BSTable(IntegralMgr.id, "/admin/integral_mgr/list", defaultColunms);
+    table.setPaginationType("server");
+    IntegralMgr.table = table.init();
+});