Преглед изворни кода

Signed-off-by: sugangqiang <sugangqiang@foxmail.com>

sugangqiang пре 2 година
родитељ
комит
1b0a03904b

+ 74 - 0
app/admin/controller/FileType.php

@@ -0,0 +1,74 @@
+<?php
+
+namespace app\admin\controller;
+
+use app\admin\common\AdminController;
+use app\common\api\FileTypeApi;
+
+/**
+ * Description of FileType
+ *
+ * @author sgq
+ */
+class FileType extends AdminController {
+
+    /**
+     * @auth {{/commonFile/}}
+     * @return type
+     */
+    function index() {
+        return view();
+    }
+
+    /**
+     * @auth {{/unCommonFiletype}}
+     * @return type
+     */
+    function list() {
+        $result = FileTypeApi::getList($this->request->param());
+        return json($result);
+    }
+
+    /**
+     * @auth {{/unCommonFiletype/add}}
+     * @return type
+     */
+    function add() {
+        if ($this->request->isPost()) {
+            FileTypeApi::edit($this->request);
+            $res = ["code" => 200, "msg" => "添加附件类型成功"];
+            echo sprintf("<script>parent.UnCommonFiletypeInfoDlg.callBack(%s);</script>", json_encode($res));
+            exit();
+        }
+        $declare_types = \app\common\api\DictApi::findChildDictByCode("declare_type");
+        return view("", ["declare_types" => $declare_types]);
+    }
+
+    /**
+     * @auth {{/unCommonFiletype/update}}
+     * @return type
+     */
+    function edit() {
+        if ($this->request->isPost()) {
+            FileTypeApi::edit($this->request);
+            $res = ["code" => 200, "msg" => "编辑附件类型成功"];
+            echo sprintf("<script>parent.UnCommonFiletypeInfoDlg.callBack(%s);</script>", json_encode($res));
+            exit();
+        }
+        $id = $this->request->param("id");
+        $info = FileTypeApi::getOne($id);
+        $declare_types = \app\common\api\DictApi::findChildDictByCode("declare_type");
+        return view("", ["info" => $info, "declare_types" => $declare_types]);
+    }
+
+    /**
+     * @auth {{/unCommonFiletype/delete}}
+     * @return type
+     */
+    function delete() {
+        $id = $this->request->param("id");
+        FileTypeApi::delete($id);
+        return json(["code" => 200, "msg" => "删除成功"]);
+    }
+
+}

+ 132 - 0
app/admin/view/filetype/add.html

@@ -0,0 +1,132 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <form id="unCommonFiletypeForm" action="/admin/filetype/add" method="post" enctype="multipart/form-data" target="hiddenIframe">
+            <div class="form-horizontal">
+                <div class="row">
+                    <input id="id" name="id" type="hidden" value="{$info.id}" underline="false"/>
+                    <div class="col-sm-6">
+                        <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" name="type" selectVal="{$info.type}">
+                                <option value="">---请选择---</option>
+                                <option value="1">晋江市优秀人才</option>
+                                <option value="2">集成电路优秀人才</option>
+                            </select>
+                        </div>
+                        <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="step" name="step" selectVal="{$info.step}">
+                                <option value="">---请选择---</option>
+                            </select>
+                        </div>
+                        <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="must" name="must" selectVal="{$info.must}">
+                                <option value="">---请选择---</option>
+                                <option value="1">是</option>
+                                <option value="2">否</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">附件类型名称</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="name" name="name" type="text" value="{$info.name}">
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">备注</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="description" name="description" type="text" value="{$info.description}">
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">附件类型api</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="api" name="api" type="text" value="{$info.api}">
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-sm-6">
+                        <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="project" name="project" selectVal="{$info.project}" onchange="UnCommonFiletypeInfoDlg.typeChange(this)">
+                                <option value="">---请选择---</option>
+                                {volist name="declare_types" id="item"}
+                                <option value="{$item.code}">{$item.name}</option>
+                                {/volist}
+                            </select>
+                        </div>
+                        <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="isConditionFile" name="isConditionFile" selectVal="{$info.isConditionFile}">
+                                <option value="">---请选择---</option>
+                                <option value="2">否(不与人才层级条件联动)</option>
+                                <option value="1">是(与人才层级条件联动)</option>
+                            </select>
+                        </div>
+                        <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" name="active" selectVal="{$info.active}">
+                                <option value="">---请选择---</option>
+                                <option value="1">是</option>
+                                <option value="2">否</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">排序</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="sn" name="sn" type="text" value="{$info.sn}">
+                            </div>
+                        </div>
+                        <input type="file" name="templateFile" id="templateFile" onchange="UnCommonFiletypeInfoDlg.fileChange(this)" style="display: none">
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">附件模板</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="templateUrl" name="templateUrl" type="text" value="{$info.templateUrl}" onclick="$('#templateFile').click();">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-12" align="center">
+                        <button type="button" class="btn btn-sm btn-info " onclick="UnCommonFiletypeInfoDlg.addSubmit()" id="ensure">
+                            <i class="fa fa-check"></i>&nbsp;提交
+                        </button>
+                        <button type="button" class="btn btn-sm btn-danger " onclick="UnCommonFiletypeInfoDlg.close()" id="cancel">
+                            <i class="fa fa-eraser"></i>&nbsp;取消
+                        </button>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js"></script>
+{/block}

+ 138 - 0
app/admin/view/filetype/edit.html

@@ -0,0 +1,138 @@
+{extend name="layout/content"}
+{block name="content"}
+<div class="ibox float-e-margins">
+    <div class="ibox-content">
+        <form id="unCommonFiletypeForm" action="/admin/filetype/edit" method="post" enctype="multipart/form-data" target="hiddenIframe">
+            <div class="form-horizontal">
+                <div class="row">
+                    <input id="id" name="id" type="hidden" value="{$info.id}" underline="false"/>
+                    <div class="col-sm-6">
+                        <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" name="type" selectVal="{$info.type}">
+                                <option value="">---请选择---</option>
+                                <option value="1">晋江市优秀人才</option>
+                                <option value="2">集成电路优秀人才</option>
+                            </select>
+                        </div>
+                        <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="step" name="step" selectVal="{$info.step}">
+                                {eq name="info.type" value="1"}
+                                <option value="">---请选择---</option>
+                                <option value="1">一、基础资料填报阶段</option>
+                                <option value="2">二、补充认定材料阶段</option>
+                                {else/}
+                                <option value="">---请选择---</option>
+                                {/eq}
+                            </select>
+                        </div>
+                        <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="must" name="must" selectVal="{$info.must}">
+                                <option value="">---请选择---</option>
+                                <option value="1">是</option>
+                                <option value="2">否</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">附件类型名称</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="name" name="name" type="text" value="{$info.name}">
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">备注</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="description" name="description" type="text" value="{$info.description}">
+                            </div>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">附件类型api</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="api" name="api" type="text" value="{$info.api}">
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-sm-6">
+                        <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="project" name="project" selectVal="{$info.project}" onchange="UnCommonFiletypeInfoDlg.typeChange(this)">
+                                <option value="">---请选择---</option>
+                                {volist name="declare_types" id="item"}
+                                <option value="{$item.code}">{$item.name}</option>
+                                {/volist}
+                            </select>
+                        </div>
+                        <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="isConditionFile" name="isConditionFile" selectVal="{$info.isConditionFile}">
+                                <option value="">---请选择---</option>
+                                <option value="2">否(不与人才层级条件联动)</option>
+                                <option value="1">是(与人才层级条件联动)</option>
+                            </select>
+                        </div>
+                        <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" name="active" selectVal="{$info.active}">
+                                <option value="">---请选择---</option>
+                                <option value="1">是</option>
+                                <option value="2">否</option>
+                            </select>
+                        </div>
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">排序</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="sn" name="sn" type="text" value="{$info.sn}">
+                            </div>
+                        </div>
+                        <input type="file" name="templateFile" id="templateFile" onchange="UnCommonFiletypeInfoDlg.fileChange(this)" style="display: none">
+                        <div class="form-group">
+                            <label class="col-sm-2 control-label">附件模板</label>
+                            <div class="col-sm-8">
+                                <input class="form-control" id="templateUrl" name="templateUrl" type="text" value="{$info.templateUrl}" onclick="$('#templateFile').click();">
+                            </div>
+                        </div>
+                    </div>
+                </div>
+                <div class="row btn-group-m-t">
+                    <div class="col-sm-12" align="center">
+                        <button type="button" class="btn btn-sm btn-info " onclick="UnCommonFiletypeInfoDlg.editSubmit()" id="ensure">
+                            <i class="fa fa-check"></i>&nbsp;提交
+                        </button>
+                        <button type="button" class="btn btn-sm btn-danger " onclick="UnCommonFiletypeInfoDlg.close()" id="cancel">
+                            <i class="fa fa-eraser"></i>&nbsp;取消
+                        </button>
+                    </div>
+                </div>
+            </div>
+        </form>
+    </div>
+</div>
+<iframe id="hiddenIframe" name="hiddenIframe" style="display: none;"></iframe>
+<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js"></script>
+{/block}

+ 110 - 0
app/admin/view/filetype/index.html

@@ -0,0 +1,110 @@
+{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">
+                            <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>
+                                    <select class="form-control" id="project">
+                                        <option value="">---请选择---</option>
+                                        {volist name="declare_types" id="item"}
+                                        <option value="{$item.code}">{$item.name}</option>
+                                        {/volist}
+                                    </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="must">
+                                        <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>
+                                    <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="UnCommonFiletype.search()">
+                                    <i class="fa fa-search"></i>&nbsp;搜索
+                                </button>
+                                <button type="button" class="btn btn-sm btn-primary " onclick="UnCommonFiletype.reset()">
+                                    <i class="fa fa-trash"></i>&nbsp;重置
+                                </button>
+                            </div>
+                        </div>
+                        <div class="hidden-xs" id="UnCommonFiletypeTableToolbar" role="group">                            
+                            <if condition="chkCommission('/admin/filetype/add','/unCommonFiletype/add')">                                
+                                <button type="button" class="btn btn-sm btn-primary " onclick="UnCommonFiletype.openAddUnCommonFiletype()">
+                                    <i class="fa fa-plus"></i>添加
+                                </button>
+                            </if>                            
+                            <if condition="chkCommission('/admin/filetype/edit','/unCommonFiletype/update')">                                
+                                <button type="button" class="btn btn-sm btn-primary " onclick="UnCommonFiletype.openUnCommonFiletypeDetail()">
+                                    <i class="fa fa-edit"></i>修改
+                                </button>
+                            </if>                            
+                            <if condition="chkCommission('/admin/filetype/delete','/unCommonFiletype/delete')">                                
+                                <button type="button" class="btn btn-sm btn-primary " onclick="UnCommonFiletype.delete()">
+                                    <i class="fa fa-remove"></i>删除
+                                </button>
+                            </if>
+                        </div>
+                        <table id="UnCommonFiletypeTable" 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>
+<script src="/static/modular/filetype/unCommonFiletype/unCommonFiletype.js"></script>
+{/block}

+ 91 - 0
app/common/api/FileTypeApi.php

@@ -0,0 +1,91 @@
+<?php
+
+namespace app\common\api;
+
+use app\common\model\FileType;
+
+/**
+ * Description of FileTypeApi
+ *
+ * @author sgq
+ */
+class FileTypeApi {
+
+    public static function getList($params) {
+        $order = $params["order"] ?: "desc";
+        $limit = $params["limit"] ?: 10;
+        $offset = $params["offset"] ?: 0;
+        $where[] = ["delete", "=", 0];
+        if ($params["project"]) {
+            $where[] = ["project", "=", $params["project"]];
+        }
+        if ($param["type"]) {
+            $where[] = ["type", "=", $params["type"]];
+        }
+        if ($param["must"]) {
+            $where[] = ["must", "=", $params["must"]];
+        }
+        if ($param["active"]) {
+            $where[] = ["active", "=", $params["active"]];
+        }
+        $projectNameKvs = DictApi::selectByParentCode("declare_type");
+        $count = FileType::where($where)->count();
+        $list = FileType::where($where)->limit($offset, $limit)->order("createTime " . $order)->select()->toArray();
+        foreach ($list as &$item) {
+            $item["projectName"] = $projectNameKvs[$item["project"]];
+            if ($item["templateUrl"]) {
+                $item["templateUrl"] = "/storage/" . $item["templateUrl"];
+            }
+        }unset($item);
+        return ["total" => $count, "rows" => $list];
+    }
+
+    public static function getOne($id) {
+        return FileType::findOrEmpty($id)->toArray();
+    }
+
+    public static function edit($request) {
+        $params = $request->param();
+        $data["type"] = $params["type"];
+        $data["project"] = $params["project"];
+        $data["name"] = $params["name"];
+        $data["isConditionFile"] = $params["isConditionFile"];
+        $data["step"] = $params["step"];
+        $data["must"] = $params["must"];
+        $data["active"] = $params["active"];
+        $data["description"] = $params["description"];
+        $data["templateUrl"] = $params["templateUrl"];
+        $data["sn"] = $params["sn"];
+        $data["api"] = $params["api"];
+        if ($request->file()) {
+            $uploader = new UploadApi();
+            $res = $uploader->uploadOne($request->file("templateFile"), "file", "talent/filetype/template");
+            $data["templateUrl"] = $res->filepath;
+        }
+        if ($params["id"]) {
+            $data["id"] = $params["id"];
+            $data["updateUser"] = session("user")["uid"];
+            $data["updateTime"] = date("Y-m-d H:i:s");
+            $info = self::getOne($params["id"]);
+            if ($request->file() && $info["templateUrl"]) {
+                $path = "storage/" . $info["templateUrl"];
+                if (file_exists($path))
+                    @unlink($path);
+            }
+            return FileType::update($data);
+        } else {
+            $data["createUser"] = session("user")["uid"];
+            $data["createTime"] = date("Y-m-d H:i:s");
+            return FileType::insert($data);
+        }
+    }
+
+    public static function delete($id) {
+        $data["id"] = $id;
+        $data["delete"] = 1;
+        $data["updateUser"] = session("user")["uid"];
+        $data["updateTime"] = date("Y-m-d H:i:s");
+        return FileType::update($data);
+    }
+
+}

+ 10 - 4
app/common/api/TalentConditionApi.php

@@ -24,16 +24,22 @@ class TalentConditionApi {
     }
 
     public static function edit($params) {
-        if ($params["id"]) {
-            $data["id"] = $params["id"];
-        }
         $data["type"] = $params["type"];
         $data["talentLevel"] = $params["talentLevel"];
         $data["companyIds"] = $params["companyIds"];
         $data["bindFileTypes"] = $params["bindFileTypes"];
         $data["name"] = $params["name"];
         $data["active"] = $params["active"];
-        return TalentCondition::update($data);
+        if ($params["id"]) {
+            $data["id"] = $params["id"];
+            $data["updateUser"] = session("user")["uid"];
+            $data["updateTime"] = date("Y-m-d H:i:s");
+            return TalentCondition::update($data);
+        } else {
+            $data["createUser"] = session("user")["uid"];
+            $data["createTime"] = date("Y-m-d H:i:s");
+            return TalentCondition::insert($data);
+        }
     }
 
     public static function delete($id) {

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

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

+ 84 - 85
public/static/modular/filetype/unCommonFiletype/unCommonFiletype.js

@@ -2,8 +2,8 @@
  * commonFileType管理初始化
  */
 var UnCommonFiletype = {
-    id: "UnCommonFiletypeTable",	//表格id
-    seItem: null,		//选中的条目
+    id: "UnCommonFiletypeTable", //表格id
+    seItem: null, //选中的条目
     table: null,
     layerIndex: -1
 };
@@ -13,68 +13,68 @@ var UnCommonFiletype = {
  */
 UnCommonFiletype.initColumn = function () {
     return [
-            {field: 'selectItem', radio: true},
-            {title: '优秀人才类别', field: 'type', visible: true, align: 'center', valign: 'middle','class':'uitd_showTip',width: 100,
-                formatter: function (value, row, index){
-                    if (value==null || value==''){
-                        return "";
-                    } else if (value == 1){
-                        return "晋江市优秀人才";
-                    }else if(value==2){
-                        return "集成电路优秀人才";
-                    }else{
-                        return "";
-                    }
+        {field: 'selectItem', radio: true},
+        {title: '优秀人才类别', field: 'type', visible: true, align: 'center', valign: 'middle', 'class': 'uitd_showTip', width: 100,
+            formatter: function (value, row, index) {
+                if (value == null || value == '') {
+                    return "";
+                } else if (value == 1) {
+                    return "晋江市优秀人才";
+                } else if (value == 2) {
+                    return "集成电路优秀人才";
+                } else {
+                    return "";
                 }
-            },
-            {title: '申报项目', field: 'projectName', visible: true, align: 'center', valign: 'middle',width: 100},
-            {title: '附件名称', field: 'name', visible: true, align: 'center', valign: 'middle',width: 200,'class': 'uitd_showTip'},
-            {title: '附件类型api', field: 'api', visible: true, align: 'center', valign: 'middle',width: 100,'class': 'uitd_showTip'},
-            {title: '必传', field: 'must', visible: true, align: 'center', valign: 'middle',width: 80,
-                formatter: function (value, row, index){
-                    if (value==null || value==''){
-                        return "";
-                    } else if (value == 1){
-                        return "是";
-                    }else if(value==2){
-                        return "否";
-                    }else{
-                        return "";
-                    }
+            }
+        },
+        {title: '申报项目', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: 100},
+        {title: '附件名称', field: 'name', visible: true, align: 'center', valign: 'middle', width: 200, 'class': 'uitd_showTip'},
+        {title: '附件类型api', field: 'api', visible: true, align: 'center', valign: 'middle', width: 100, 'class': 'uitd_showTip'},
+        {title: '必传', field: 'must', visible: true, align: 'center', valign: 'middle', width: 80,
+            formatter: function (value, row, index) {
+                if (value == null || value == '') {
+                    return "";
+                } else if (value == 1) {
+                    return "是";
+                } else if (value == 2) {
+                    return "否";
+                } else {
+                    return "";
                 }
-            },
-            {title: '生效', field: 'active', visible: true, align: 'center', valign: 'middle',width: 80,
-                formatter: function (value, row, index){
-                    if (value==null || value==''){
-                        return "";
-                    } else if (value == 1){
-                        return "有效";
-                    }else if(value==2){
-                        return "无效";
-                    }else{
-                        return "";
-                    }
+            }
+        },
+        {title: '生效', field: 'active', visible: true, align: 'center', valign: 'middle', width: 80,
+            formatter: function (value, row, index) {
+                if (value == null || value == '') {
+                    return "";
+                } else if (value == 1) {
+                    return "有效";
+                } else if (value == 2) {
+                    return "无效";
+                } else {
+                    return "";
                 }
-            },
-            {
-                title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: 80,
-                formatter: function (value, row, index) {
-                    if(value==null||value==''){
-                        return "无";
-                    }
-                    var sn = value.lastIndexOf(".");
-                    var suffix = value.substring(sn+1,value.length);
-                    if(suffix=="pdf"||suffix=="PDF"){
-                        return "<button type='button'  onclick=\"Feng.showPdf('"+value+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
-                    }else if(suffix == "xlsx" || suffix=="XLSX" || suffix == 'xls' || suffix == 'XLS'){
-                        return "<button type='button'  onclick=\"Feng.showExcel('"+value+"')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
-                    }else{
-                        return '<img class=\"imgUrl\"  src=\"'+value+'\" style=\"width:25px;height:25px;\">';
-                    }
+            }
+        },
+        {
+            title: '模板', field: 'templateUrl', visible: true, align: 'center', valign: 'middle', width: 80,
+            formatter: function (value, row, index) {
+                if (value == null || value == '') {
+                    return "无";
                 }
-            },
-            {title: '排序', field: 'sn', visible: true, align: 'center', valign: 'middle',width: 80,},
-            {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle',width: 300,'class': 'uitd_showTip'}
+                var sn = value.lastIndexOf(".");
+                var suffix = value.substring(sn + 1, value.length);
+                if (suffix == "pdf" || suffix == "PDF") {
+                    return "<button type='button'  onclick=\"Feng.showPdf('" + value + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-pdf-o\" aria-hidden=\"true\"></i></button>";
+                } else if (suffix == "xlsx" || suffix == "XLSX" || suffix == 'xls' || suffix == 'XLS') {
+                    return "<button type='button'  onclick=\"Feng.showExcel('" + value + "')\" class=\"btn btn-xs btn-danger\"><i class=\"fa fa-file-excel-o\" aria-hidden=\"true\"></i></button>";
+                } else {
+                    return '<img class=\"imgUrl\"  src=\"' + value + '\" style=\"width:25px;height:25px;\">';
+                }
+            }
+        },
+        {title: '排序', field: 'sn', visible: true, align: 'center', valign: 'middle', width: 80, },
+        {title: '备注', field: 'description', visible: true, align: 'center', valign: 'middle', width: 300, 'class': 'uitd_showTip'}
     ];
 };
 
@@ -83,10 +83,10 @@ UnCommonFiletype.initColumn = function () {
  */
 UnCommonFiletype.check = function () {
     var selected = $('#' + this.id).bootstrapTable('getSelections');
-    if(selected.length == 0){
+    if (selected.length == 0) {
         Feng.info("请先选中表格中的某一记录!");
         return false;
-    }else{
+    } else {
         UnCommonFiletype.seItem = selected[0];
         return true;
     }
@@ -102,7 +102,7 @@ UnCommonFiletype.openAddUnCommonFiletype = function () {
         area: ['1200px', '500px'], //宽高
         fix: false, //不固定
         maxmin: true,
-        content: Feng.ctxPath + '/unCommonFiletype/unCommonFiletype_add'
+        content: '/admin/filetype/add'
     });
     UnCommonFiletype.layerIndex = index;
 };
@@ -118,7 +118,7 @@ UnCommonFiletype.openUnCommonFiletypeDetail = function () {
             area: ['1200px', '500px'], //宽高
             fix: false, //不固定
             maxmin: true,
-            content: Feng.ctxPath + '/unCommonFiletype/unCommonFiletype_update/' + UnCommonFiletype.seItem.id
+            content: '/admin/filetype/edit/id/' + UnCommonFiletype.seItem.id
         });
         this.layerIndex = index;
     }
@@ -129,18 +129,18 @@ UnCommonFiletype.openUnCommonFiletypeDetail = function () {
  */
 UnCommonFiletype.delete = function () {
     if (this.check()) {
-        var operation = function(){
-            var ajax = new $ax(Feng.ctxPath + "/unCommonFiletype/delete", function (data) {
-                if(data.code==200){
+        var operation = function () {
+            var ajax = new $ax("/admin/filetype/delete", function (data) {
+                if (data.code == 200) {
                     Feng.success(data.msg);
                     UnCommonFiletype.table.refresh();
-                }else{
+                } else {
                     Feng.error(data.msg);
                 }
             }, function (data) {
                 Feng.error("删除失败!" + data.responseJSON.message + "!");
             });
-            ajax.set("unCommonFiletypeId",UnCommonFiletype.seItem.id);
+            ajax.set("id", UnCommonFiletype.seItem.id);
             ajax.start();
         }
         Feng.confirm("是否刪除该附件类型?", operation);
@@ -160,7 +160,7 @@ UnCommonFiletype.search = function () {
     UnCommonFiletype.table.refresh({query: queryData});
 };
 
-UnCommonFiletype.reset = function(){
+UnCommonFiletype.reset = function () {
     $("#type").val("");
     $("#project").val("");
     $("#must").val("");
@@ -168,39 +168,38 @@ UnCommonFiletype.reset = function(){
 }
 
 $(function () {
-    showsmsselect();
     var defaultColunms = UnCommonFiletype.initColumn();
-    var table = new BSTable(UnCommonFiletype.id, "/unCommonFiletype/list", defaultColunms);
+    var table = new BSTable(UnCommonFiletype.id, "/admin/filetype/list", defaultColunms);
     table.setPaginationType("server");
-    table.setOnLoadSuccess(function(){
+    table.setOnLoadSuccess(function () {
         $(".imgUrl").viewer({
             // toolbar:false,
-            fullscreen:false
+            fullscreen: false
         });
     });
     UnCommonFiletype.table = table.init();
 });
 
 function showsmsselect() {
-    var ajax = new $ax(Feng.ctxPath + "/company/selectAll", function(data){
+    var ajax = new $ax(Feng.ctxPath + "/company/selectAll", function (data) {
         var h = "";
-        $.each(data, function(key, value) {
+        $.each(data, function (key, value) {
 
             h += "<option value='" + value.id + "'>" + value.shortName //下拉框序言的循环数据
-                + "</option>";
+                    + "</option>";
         });
         $("#checkCompany").append(h);//append 添加进去并展示
         $("#checkCompany").on(
-            "change",
-            function(a, b, c) {
-                $("#contentID").val(
-                    $("#checkCompany option:selected").val());
+                "change",
+                function (a, b, c) {
+                    $("#contentID").val(
+                            $("#checkCompany option:selected").val());
 
-                $("#contentName").val(
-                    $("#checkCompany option:selected").text());
+                    $("#contentName").val(
+                            $("#checkCompany option:selected").text());
 
-            })
-    },function(data){
+                })
+    }, function (data) {
         Feng.error("获取company数据失败!" + data.responseJSON.message + "!");
     });
     ajax.set(this.unCommonFiletypeInfoData);

+ 43 - 42
public/static/modular/filetype/unCommonFiletype/unCommonFiletype_info.js

@@ -2,7 +2,7 @@
  * 初始化commonFileType详情对话框
  */
 var UnCommonFiletypeInfoDlg = {
-    unCommonFiletypeInfoData : {},
+    unCommonFiletypeInfoData: {},
     validateFields: {
         type: {
             validators: {
@@ -11,13 +11,6 @@ var UnCommonFiletypeInfoDlg = {
                 }
             }
         },
-        source: {
-            validators: {
-                notEmpty: {
-                    message: '来源不能为空'
-                }
-            }
-        },
         project: {
             validators: {
                 notEmpty: {
@@ -25,10 +18,10 @@ var UnCommonFiletypeInfoDlg = {
                 }
             }
         },
-        name:{
-            validators:{
-                notEmpty:{
-                    message:'附件类型名称不能为空'
+        name: {
+            validators: {
+                notEmpty: {
+                    message: '附件类型名称不能为空'
                 }
             }
         },
@@ -39,7 +32,7 @@ var UnCommonFiletypeInfoDlg = {
                 }
             }
         },
-        active:{
+        active: {
             validators: {
                 notEmpty: {
                     message: '是否生效不能为空'
@@ -59,7 +52,7 @@ var UnCommonFiletypeInfoDlg = {
 /**
  * 清除数据
  */
-UnCommonFiletypeInfoDlg.clearData = function() {
+UnCommonFiletypeInfoDlg.clearData = function () {
     this.unCommonFiletypeInfoData = {};
 }
 
@@ -69,7 +62,7 @@ UnCommonFiletypeInfoDlg.clearData = function() {
  * @param key 数据的名称
  * @param val 数据的具体值
  */
-UnCommonFiletypeInfoDlg.set = function(key, val) {
+UnCommonFiletypeInfoDlg.set = function (key, val) {
     this.unCommonFiletypeInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val;
     return this;
 }
@@ -80,43 +73,43 @@ UnCommonFiletypeInfoDlg.set = function(key, val) {
  * @param key 数据的名称
  * @param val 数据的具体值
  */
-UnCommonFiletypeInfoDlg.get = function(key) {
+UnCommonFiletypeInfoDlg.get = function (key) {
     return $("#" + key).val();
 }
 
 /**
  * 关闭此对话框
  */
-UnCommonFiletypeInfoDlg.close = function() {
+UnCommonFiletypeInfoDlg.close = function () {
     parent.layer.close(window.parent.UnCommonFiletype.layerIndex);
 }
 
 /**
  * 收集数据
  */
-UnCommonFiletypeInfoDlg.collectData = function() {
+UnCommonFiletypeInfoDlg.collectData = function () {
     this
-    .set('id')
-    .set('type')
-    .set('source')
-    .set('project')
-    .set('name')
-    .set('api')
-    .set('must')
-    .set('active')
-    .set('checkCompany')
-    .set('sn')
-    .set('description')
-    .set('createUser')
-    .set('createTime')
-    .set('updateUser')
-    .set('updateTime');
+            .set('id')
+            .set('type')
+            .set('source')
+            .set('project')
+            .set('name')
+            .set('api')
+            .set('must')
+            .set('active')
+            .set('checkCompany')
+            .set('sn')
+            .set('description')
+            .set('createUser')
+            .set('createTime')
+            .set('updateUser')
+            .set('updateTime');
 }
 
 /**
  * 提交添加
  */
-UnCommonFiletypeInfoDlg.addSubmit = function() {
+UnCommonFiletypeInfoDlg.addSubmit = function () {
     this.clearData();
     this.collectData();
     if (!this.validate()) {
@@ -128,8 +121,7 @@ UnCommonFiletypeInfoDlg.addSubmit = function() {
 /**
  * 提交修改
  */
-UnCommonFiletypeInfoDlg.editSubmit = function() {
-
+UnCommonFiletypeInfoDlg.editSubmit = function () {
     this.clearData();
     this.collectData();
     if (!this.validate()) {
@@ -151,23 +143,32 @@ UnCommonFiletypeInfoDlg.validate = function () {
 //回调
 UnCommonFiletypeInfoDlg.callBack = function (data) {
     Feng.success(data.msg);
-    if(data.code=="200"){
+    if (data.code == "200") {
         window.parent.UnCommonFiletype.table.refresh();
         UnCommonFiletypeInfoDlg.close();
     }
 }
 
-UnCommonFiletypeInfoDlg.fileChange = function(context){
-    var file  = $(context).val();
+UnCommonFiletypeInfoDlg.typeChange = function (ctx) {
+    if ($(ctx).val() == 1) {
+        var options = '<option value="">---请选择---</option><option value="1">一、基础资料填报阶段</option><option value="2">二、补充认定材料阶段</option>';
+    } else {
+        var options = '<option value="">---请选择---</option>';
+    }
+    $("#step").html(options);
+}
+
+UnCommonFiletypeInfoDlg.fileChange = function (context) {
+    var file = $(context).val();
     var pos = file.lastIndexOf("\\");
-    $("#templateUrl").val(file.substring(pos+1));
+    $("#templateUrl").val(file.substring(pos + 1));
 }
 
 
-$(function() {
+$(function () {
     Feng.initValidator("unCommonFiletypeForm", UnCommonFiletypeInfoDlg.validateFields);
     $("select").each(function () {
-       $(this).val($(this).attr("selectVal"));
+        $(this).val($(this).attr("selectVal"));
     });
 });
 

BIN
public/storage/talent/filetype/template/20220831/025c85f2fdd54a67afd3e9be0686e33f.xlsx


BIN
public/storage/talent/filetype/template/20220831/6bbb43b9765b3bcdfb039ffd15532d74.xlsx