From 3041a7d6dba13e237c4f21d3e46b88c35d376bf3 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期五, 08 九月 2023 10:14:47 +0800
Subject: [PATCH] #

---
 src/main/webapp/views/companyTarget/personTarget.html                       |  102 +++++++++
 src/main/java/com/zy/crm/manager/service/CompanyTargetService.java          |    4 
 src/main/java/com/zy/crm/manager/controller/DashboardController.java        |    2 
 src/main/java/com/zy/crm/manager/service/impl/CompanyTargetServiceImpl.java |    9 
 src/main/java/com/zy/crm/manager/mapper/CompanyTargetMapper.java            |    4 
 src/main/webapp/static/js/companyTarget/personTarget.js                     |  260 +++++++++++++++++++++++
 src/main/resources/mapper/CompanyTargetMapper.xml                           |   13 +
 src/main/java/com/zy/crm/manager/controller/CompanyTargetController.java    |   52 ++++
 src/main/java/com/zy/crm/manager/entity/CompanyTarget.java                  |   11 +
 src/main/webapp/static/js/companyTarget/companyTarget.js                    |  169 ---------------
 src/main/webapp/views/companyTarget/companyTarget.html                      |    4 
 11 files changed, 454 insertions(+), 176 deletions(-)

diff --git a/src/main/java/com/zy/crm/manager/controller/CompanyTargetController.java b/src/main/java/com/zy/crm/manager/controller/CompanyTargetController.java
index fdbbeec..c830af7 100644
--- a/src/main/java/com/zy/crm/manager/controller/CompanyTargetController.java
+++ b/src/main/java/com/zy/crm/manager/controller/CompanyTargetController.java
@@ -31,7 +31,7 @@
         Date date = new Date();
         SimpleDateFormat format = new SimpleDateFormat("yyyy");
         String year = format.format(date);
-        return R.ok(companyTargetService.selectByYear(year));
+        return R.ok(companyTargetService.selectCompanyByYear(year));
     }
 
     @RequestMapping(value = "/companyTarget/{id}/auth")
@@ -51,6 +51,24 @@
         EntityWrapper<CompanyTarget> wrapper = new EntityWrapper<>();
         excludeTrash(param);
         convert(param, wrapper);
+        wrapper.isNull("staff");
+        allLike(CompanyTarget.class, param.keySet(), wrapper, condition);
+        if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
+        return R.ok(companyTargetService.selectPage(new Page<>(curr, limit), wrapper));
+    }
+
+    @RequestMapping(value = "/companyTarget/person/list/auth")
+    @ManagerAuth
+    public R personList(@RequestParam(defaultValue = "1")Integer curr,
+                  @RequestParam(defaultValue = "10")Integer limit,
+                  @RequestParam(required = false)String orderByField,
+                  @RequestParam(required = false)String orderByType,
+                  @RequestParam(required = false)String condition,
+                  @RequestParam Map<String, Object> param){
+        EntityWrapper<CompanyTarget> wrapper = new EntityWrapper<>();
+        excludeTrash(param);
+        convert(param, wrapper);
+        wrapper.eq("staff", getUserId());
         allLike(CompanyTarget.class, param.keySet(), wrapper, condition);
         if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
         return R.ok(companyTargetService.selectPage(new Page<>(curr, limit), wrapper));
@@ -72,6 +90,11 @@
     @RequestMapping(value = "/companyTarget/add/auth")
     @ManagerAuth(memo = "娣诲姞骞村害鐩爣")
     public R add(CompanyTarget companyTarget) {
+        CompanyTarget target = companyTargetService.selectCompanyByYear(companyTarget.getYear());
+        if (target != null) {
+            return R.error("宸插瓨鍦ㄥ勾搴︾洰鏍�");
+        }
+
         companyTarget.setCreateTime(new Date());
         companyTarget.setUserId(getUserId());
         companyTargetService.insert(companyTarget);
@@ -99,6 +122,33 @@
         return R.ok();
     }
 
+    @RequestMapping(value = "/companyTarget/person/add/auth")
+    @ManagerAuth(memo = "娣诲姞涓汉骞村害鐩爣")
+    public R addPerson(CompanyTarget companyTarget) {
+        CompanyTarget target = companyTargetService.selectPersonByYear(companyTarget.getYear(), getUserId());
+        if (target != null) {
+            return R.error("宸插瓨鍦ㄥ勾搴︾洰鏍�");
+        }
+
+        companyTarget.setCreateTime(new Date());
+        companyTarget.setUserId(getUserId());
+        companyTarget.setStaff(getUserId());
+        companyTargetService.insert(companyTarget);
+        return R.ok();
+    }
+
+    @RequestMapping(value = "/companyTarget/person/update/auth")
+    @ManagerAuth(memo = "鏇存柊涓汉骞村害鐩爣")
+    public R updatePerson(CompanyTarget companyTarget){
+        if (Cools.isEmpty(companyTarget) || null==companyTarget.getId()){
+            return R.error();
+        }
+        companyTarget.setUpdateTime(new Date());
+        companyTarget.setUpdateUserId(getUserId());
+        companyTargetService.updateById(companyTarget);
+        return R.ok();
+    }
+
     @RequestMapping(value = "/companyTarget/export/auth")
     @ManagerAuth
     public R export(@RequestBody JSONObject param){
diff --git a/src/main/java/com/zy/crm/manager/controller/DashboardController.java b/src/main/java/com/zy/crm/manager/controller/DashboardController.java
index 2a46997..891f151 100644
--- a/src/main/java/com/zy/crm/manager/controller/DashboardController.java
+++ b/src/main/java/com/zy/crm/manager/controller/DashboardController.java
@@ -39,7 +39,7 @@
         Date date = new Date();
         SimpleDateFormat format = new SimpleDateFormat("yyyy");
         String year = format.format(date);
-        CompanyTarget companyTarget = companyTargetService.selectByYear(year);//鑾峰彇鍏徃鍏ㄥ勾鐩爣鏁版嵁
+        CompanyTarget companyTarget = companyTargetService.selectCompanyByYear(year);//鑾峰彇鍏徃鍏ㄥ勾鐩爣鏁版嵁
         if (companyTarget == null) {
             return R.error();
         }
diff --git a/src/main/java/com/zy/crm/manager/entity/CompanyTarget.java b/src/main/java/com/zy/crm/manager/entity/CompanyTarget.java
index 0a7bef1..7b6ebb8 100644
--- a/src/main/java/com/zy/crm/manager/entity/CompanyTarget.java
+++ b/src/main/java/com/zy/crm/manager/entity/CompanyTarget.java
@@ -55,6 +55,17 @@
     @TableField("update_user_id")
     private Long updateUserId;
 
+    @ApiModelProperty(value= "鍛樺伐ID,null琛ㄧず鏁版嵁灞炰簬鍏徃")
+    @TableField("staff")
+    private Long staff;
+
+    /**
+     * 瀹屾垚鎯呭喌,棰勭暀瀛楁
+     */
+    @ApiModelProperty(value= "瀹屾垚鎯呭喌,棰勭暀瀛楁")
+    @TableField("complete")
+    private String complete;
+
     public CompanyTarget() {}
 
     public CompanyTarget(String year,String target,Date createTime,Long userId,Date updateTime,Long updateUserId) {
diff --git a/src/main/java/com/zy/crm/manager/mapper/CompanyTargetMapper.java b/src/main/java/com/zy/crm/manager/mapper/CompanyTargetMapper.java
index e7dc1bc..77aad53 100644
--- a/src/main/java/com/zy/crm/manager/mapper/CompanyTargetMapper.java
+++ b/src/main/java/com/zy/crm/manager/mapper/CompanyTargetMapper.java
@@ -9,6 +9,8 @@
 @Repository
 public interface CompanyTargetMapper extends BaseMapper<CompanyTarget> {
 
-    CompanyTarget selectByYear(String year);
+    CompanyTarget selectCompanyByYear(String year);
+
+    CompanyTarget selectPersonByYear(String year, Long staff);
 
 }
diff --git a/src/main/java/com/zy/crm/manager/service/CompanyTargetService.java b/src/main/java/com/zy/crm/manager/service/CompanyTargetService.java
index dc63c2b..0744e88 100644
--- a/src/main/java/com/zy/crm/manager/service/CompanyTargetService.java
+++ b/src/main/java/com/zy/crm/manager/service/CompanyTargetService.java
@@ -5,6 +5,8 @@
 
 public interface CompanyTargetService extends IService<CompanyTarget> {
 
-    CompanyTarget selectByYear(String year);
+    CompanyTarget selectCompanyByYear(String year);
+
+    CompanyTarget selectPersonByYear(String year, Long staff);
 
 }
diff --git a/src/main/java/com/zy/crm/manager/service/impl/CompanyTargetServiceImpl.java b/src/main/java/com/zy/crm/manager/service/impl/CompanyTargetServiceImpl.java
index ed744ac..ac01a0b 100644
--- a/src/main/java/com/zy/crm/manager/service/impl/CompanyTargetServiceImpl.java
+++ b/src/main/java/com/zy/crm/manager/service/impl/CompanyTargetServiceImpl.java
@@ -10,7 +10,12 @@
 public class CompanyTargetServiceImpl extends ServiceImpl<CompanyTargetMapper, CompanyTarget> implements CompanyTargetService {
 
     @Override
-    public CompanyTarget selectByYear(String year) {
-        return this.baseMapper.selectByYear(year);
+    public CompanyTarget selectCompanyByYear(String year) {
+        return this.baseMapper.selectCompanyByYear(year);
+    }
+
+    @Override
+    public CompanyTarget selectPersonByYear(String year, Long staff) {
+        return this.baseMapper.selectPersonByYear(year, staff);
     }
 }
diff --git a/src/main/resources/mapper/CompanyTargetMapper.xml b/src/main/resources/mapper/CompanyTargetMapper.xml
index 0788f04..2629bba 100644
--- a/src/main/resources/mapper/CompanyTargetMapper.xml
+++ b/src/main/resources/mapper/CompanyTargetMapper.xml
@@ -11,12 +11,21 @@
         <result column="user_id" property="userId" />
         <result column="update_time" property="updateTime" />
         <result column="update_user_id" property="updateUserId" />
+        <result column="staff" property="staff" />
+        <result column="complete" property="complete" />
 
     </resultMap>
 
-    <select id="selectByYear" resultMap="BaseResultMap">
-        select * from man_company_target
+    <select id="selectCompanyByYear" resultMap="BaseResultMap">
+        select top 1 * from man_company_target
         where year = #{year}
+        and staff is null
+    </select>
+
+    <select id="selectPersonByYear" resultMap="BaseResultMap">
+        select top 1 * from man_company_target
+        where year = #{year}
+        and staff = #{staff}
     </select>
 
 </mapper>
diff --git a/src/main/webapp/static/js/companyTarget/companyTarget.js b/src/main/webapp/static/js/companyTarget/companyTarget.js
index a4bdb5a..4cedee4 100644
--- a/src/main/webapp/static/js/companyTarget/companyTarget.js
+++ b/src/main/webapp/static/js/companyTarget/companyTarget.js
@@ -26,7 +26,7 @@
             {type: 'checkbox'}
             // ,{field: 'id', align: 'center',title: '#ID'}
             , {field: 'year', align: 'center', title: '骞村害'}
-            , {field: 'target', align: 'center', title: '鐩爣'}
+            , {field: 'target', align: 'center', title: '鐩爣',templet: '#targetTmp'}
 
             , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 400}
         ]],
@@ -135,22 +135,6 @@
             case "del":
                 del([data.id]);
                 break;
-            case "generate":
-                //鐢熸垚鍚堝悓
-                generate(data)
-                break
-            case "sales":
-                //鍚堝悓鏄庣粏
-                sales(data);
-                break
-            case "upload":
-                //涓婁紶鍚堝悓
-                upload(data)
-                break
-            case "download":
-                //涓嬭浇鍚堝悓
-                download(data)
-                break
         }
     });
 
@@ -188,157 +172,6 @@
                 });
                 $(layero).children('.layui-layer-content').css('overflow', 'visible');
                 layui.form.render('select');
-            }
-        });
-    }
-
-    /* 鐢熸垚鍚堝悓 */
-    function generate(mData) {
-        admin.open({
-            type: 1,
-            area: '600px',
-            title: '鐢熸垚鍚堝悓',
-            content: $('#generateDialog').html(),
-            success: function (layero, dIndex) {
-                layDateRender(mData);
-                form.val('detail', mData);
-                form.on('submit(generateSubmit)', function (data) {
-                    var loadIndex = layer.load(2);
-                    $.ajax({
-                        url: baseUrl + "/companyTarget/generate/auth",
-                        headers: {'token': localStorage.getItem('token')},
-                        data: data.field,
-                        method: 'GET',
-                        xhrFields: {
-                            responseType: "blob" // 璁剧疆鍝嶅簲绫诲瀷涓轰簩杩涘埗鏁版嵁
-                        },
-                        success: function (res) {
-                            // 鍒涘缓涓�涓复鏃剁殑涓嬭浇閾炬帴
-                            const url = window.URL.createObjectURL(res);
-                            // 鍒涘缓涓�涓殣钘忕殑 <a> 鍏冪礌骞惰缃笅杞介摼鎺�
-                            const a = document.createElement("a");
-                            a.style.display = "none";
-                            a.href = url;
-                            a.download = data.field.name + ".docx"; // 鎸囧畾涓嬭浇鐨勬枃浠跺悕
-                            document.body.appendChild(a);
-
-                            // 瑙﹀彂鐐瑰嚮浜嬩欢浠ュ紑濮嬩笅杞�
-                            a.click();
-
-                            // 娓呯悊涓存椂璧勬簮
-                            setTimeout(function () {
-                                window.URL.revokeObjectURL(url);
-                                document.body.removeChild(a);
-                            }, 100);
-
-                            layer.close(loadIndex);
-                            layer.close(dIndex);
-                        }
-                    })
-                    return false;
-                });
-                $(layero).children('.layui-layer-content').css('overflow', 'visible');
-                layui.form.render('select');
-            }
-        });
-    }
-
-    /* 鍚堝悓鏄庣粏 */
-    function sales(mData) {
-        layer.open({
-            type: 2,
-            title: '鍚堝悓鏄庣粏',
-            maxmin: true,
-            area: [top.detailWidth, top.detailHeight],
-            shadeClose: false,
-            content: '../companyTargetSales/companyTargetSales.html?companyTargetId=' + mData.id,
-            success: function (layero, index) {
-            }
-        });
-    }
-
-    //涓婁紶鍚堝悓
-    function upload(data) {
-        if (data.filepath == '' || data.filepath == null) {
-            layer.confirm('鏄惁涓婁紶鍚堝悓?', function () {
-                $("#uploadQuote").click()
-            });
-        } else {
-            layer.confirm('宸蹭笂浼犲悎鍚岋紝鏄惁缁х画瑕嗙洊涓婁紶?', function () {
-                $("#uploadQuote").click()
-            });
-        }
-
-        $("#uploadQuote").on("change", (evt) => {
-            var files = evt.target.files;
-            if (files == null || files.length == 0) {
-                alert("No files wait for import");
-                return;
-            }
-
-            let name = files[0].name;
-            let suffixArr = name.split("."), suffix = suffixArr[suffixArr.length - 1];
-            // if(suffix!="xlsx"){
-            //     alert("Currently only supports the import of xlsx files");
-            //     return;
-            // }
-
-            let formData = new FormData($("#uploadFile")[0]);
-            formData.append("id", data.id);
-            $.ajax({
-                url: baseUrl + "/companyTarget/upload/auth",
-                headers: {'token': localStorage.getItem('token')},
-                data: formData,
-                method: 'POST',
-                cache: false,
-                processData: false,
-                contentType: false,
-                success: function (res) {
-                    if (res.code == 200) {
-                        layer.msg('涓婁紶鎴愬姛', {time: 1000}, () => {
-                            parent.location.reload()
-                        })
-                    } else {
-                        layer.msg(res.msg, {time: 1000}, () => {
-                            parent.location.reload()
-                        })
-                    }
-                }
-            })
-        })
-    }
-
-    //涓嬭浇鍚堝悓
-    function download(data) {
-        $.ajax({
-            url: baseUrl + "/companyTarget/download/auth",
-            headers: {'token': localStorage.getItem('token')},
-            data: data,
-            method: 'GET',
-            xhrFields: {
-                responseType: "blob" // 璁剧疆鍝嶅簲绫诲瀷涓轰簩杩涘埗鏁版嵁
-            },
-            success: function (res) {
-                // 鍒涘缓涓�涓复鏃剁殑涓嬭浇閾炬帴
-                const url = window.URL.createObjectURL(res);
-                // 鍒涘缓涓�涓殣钘忕殑 <a> 鍏冪礌骞惰缃笅杞介摼鎺�
-                const a = document.createElement("a");
-                a.style.display = "none";
-                a.href = url;
-
-                let list = data.filepath.split(".")
-                let suffix = "." + list[list.length - 1]//鑾峰彇鍚庣紑鍚�
-                a.download = data.name + suffix; // 鎸囧畾涓嬭浇鐨勬枃浠跺悕
-                document.body.appendChild(a);
-
-                // 瑙﹀彂鐐瑰嚮浜嬩欢浠ュ紑濮嬩笅杞�
-                a.click();
-
-                // 娓呯悊涓存椂璧勬簮
-                setTimeout(function () {
-                    window.URL.revokeObjectURL(url);
-                    document.body.removeChild(a);
-                }, 100);
             }
         });
     }
diff --git a/src/main/webapp/static/js/companyTarget/personTarget.js b/src/main/webapp/static/js/companyTarget/personTarget.js
new file mode 100644
index 0000000..16526fb
--- /dev/null
+++ b/src/main/webapp/static/js/companyTarget/personTarget.js
@@ -0,0 +1,260 @@
+var pageCurr;
+layui.config({
+    base: baseUrl + "/static/layui/lay/modules/"
+}).use(['table', 'laydate', 'form', 'admin', 'tree', 'dropdown'], function () {
+    var table = layui.table;
+    var $ = layui.jquery;
+    var layer = layui.layer;
+    var layDate = layui.laydate;
+    var form = layui.form;
+    var admin = layui.admin;
+    var dropdown = layui.dropdown;
+    var tree = layui.tree;
+
+    // 鏁版嵁娓叉煋
+    tableIns = table.render({
+        elem: '#companyTarget',
+        headers: {token: localStorage.getItem('token')},
+        url: baseUrl + '/companyTarget/person/list/auth',
+        page: true,
+        limit: 15,
+        limits: [15, 30, 50, 100, 200, 500],
+        toolbar: '#toolbar',
+        cellMinWidth: 50,
+        height: 'full-120',
+        cols: [[
+            {type: 'checkbox'}
+            // ,{field: 'id', align: 'center',title: '#ID'}
+            , {field: 'year', align: 'center', title: '骞村害'}
+            , {field: 'target', align: 'center', title: '鐩爣',templet: '#targetTmp'}
+
+            , {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 400}
+        ]],
+        request: {
+            pageName: 'curr',
+            pageSize: 'limit'
+        },
+        parseData: function (res) {
+            return {
+                'code': res.code,
+                'msg': res.msg,
+                'count': res.data.total,
+                'data': res.data.records
+            }
+        },
+        response: {
+            statusCode: 200
+        },
+        done: function (res, curr, count) {
+            if (res.code === 403) {
+                top.location.href = baseUrl + "/";
+            }
+            pageCurr = curr;
+            limit();
+        }
+    });
+
+    // 鐩戝惉鎺掑簭浜嬩欢
+    table.on('sort(companyTarget)', function (obj) {
+        var searchData = {};
+        $.each($('#search-box [name]').serializeArray(), function () {
+            searchData[this.name] = this.value;
+        });
+        searchData['orderByField'] = obj.field;
+        searchData['orderByType'] = obj.type;
+        tableIns.reload({
+            where: searchData,
+            page: {curr: 1}
+        });
+    });
+
+    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
+    table.on('toolbar(companyTarget)', function (obj) {
+        var checkStatus = table.checkStatus(obj.config.id).data;
+        switch (obj.event) {
+            case 'addData':
+                showEditModel();
+                break;
+            case 'deleteData':
+                if (checkStatus.length === 0) {
+                    layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+                    return;
+                }
+                del(checkStatus.map(function (d) {
+                    return d.id;
+                }));
+                break;
+            case 'exportData':
+                admin.confirm('纭畾瀵煎嚭Excel鍚�', {shadeClose: true}, function () {
+                    var titles = [];
+                    var fields = [];
+                    obj.config.cols[0].map(function (col) {
+                        if (col.type === 'normal' && col.hide === false && col.toolbar == null) {
+                            titles.push(col.title);
+                            fields.push(col.field);
+                        }
+                    });
+                    var exportData = {};
+                    $.each($('#search-box [name]').serializeArray(), function () {
+                        exportData[this.name] = this.value;
+                    });
+                    var param = {
+                        'companyTarget': exportData,
+                        'fields': fields
+                    };
+                    $.ajax({
+                        url: baseUrl + "/companyTarget/export/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: JSON.stringify(param),
+                        dataType: 'json',
+                        contentType: 'application/json;charset=UTF-8',
+                        method: 'POST',
+                        success: function (res) {
+                            layer.closeAll();
+                            if (res.code === 200) {
+                                table.exportFile(titles, res.data, 'xls');
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl + "/";
+                            } else {
+                                layer.msg(res.msg, {icon: 2})
+                            }
+                        }
+                    });
+                });
+                break;
+        }
+    });
+
+    // 鐩戝惉琛屽伐鍏蜂簨浠�
+    table.on('tool(companyTarget)', function (obj) {
+        var data = obj.data;
+        switch (obj.event) {
+            case 'edit':
+                showEditModel(data);
+                break;
+            case "del":
+                del([data.id]);
+                break;
+        }
+    });
+
+    /* 寮圭獥 - 鏂板銆佷慨鏀� */
+    function showEditModel(mData) {
+        admin.open({
+            type: 1,
+            area: '800px',
+            title: (mData ? '淇敼' : '娣诲姞') + '鐩爣',
+            content: $('#editDialog').html(),
+            success: function (layero, dIndex) {
+                layDateRender(mData);
+                form.val('detail', mData);
+                form.on('submit(editSubmit)', function (data) {
+                    var loadIndex = layer.load(2);
+                    $.ajax({
+                        url: baseUrl + "/companyTarget/person/" + (mData ? 'update' : 'add') + "/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: data.field,
+                        method: 'POST',
+                        success: function (res) {
+                            layer.close(loadIndex);
+                            if (res.code === 200) {
+                                layer.close(dIndex);
+                                layer.msg(res.msg, {icon: 1});
+                                tableReload();
+                            } else if (res.code === 403) {
+                                top.location.href = baseUrl + "/";
+                            } else {
+                                layer.msg(res.msg, {icon: 2});
+                            }
+                        }
+                    })
+                    return false;
+                });
+                $(layero).children('.layui-layer-content').css('overflow', 'visible');
+                layui.form.render('select');
+            }
+        });
+    }
+
+    /* 鍒犻櫎 */
+    function del(ids) {
+        layer.confirm('纭畾瑕佸垹闄ら�変腑鏁版嵁鍚楋紵', {
+            skin: 'layui-layer-admin',
+            shade: .1
+        }, function (i) {
+            layer.close(i);
+            var loadIndex = layer.load(2);
+            $.ajax({
+                url: baseUrl + "/companyTarget/delete/auth",
+                headers: {'token': localStorage.getItem('token')},
+                data: {ids: ids},
+                method: 'POST',
+                success: function (res) {
+                    layer.close(loadIndex);
+                    if (res.code === 200) {
+                        layer.msg(res.msg, {icon: 1});
+                        tableReload();
+                    } else if (res.code === 403) {
+                        top.location.href = baseUrl + "/";
+                    } else {
+                        layer.msg(res.msg, {icon: 2});
+                    }
+                }
+            })
+        });
+    }
+
+    // 鎼滅储
+    form.on('submit(search)', function (data) {
+        pageCurr = 1;
+        tableReload(false);
+    });
+
+    // 閲嶇疆
+    form.on('submit(reset)', function (data) {
+        pageCurr = 1;
+        clearFormVal($('#search-box'));
+        tableReload(false);
+    });
+
+    // 鏃堕棿閫夋嫨鍣�
+    function layDateRender(data) {
+        setTimeout(function () {
+            layDate.render({
+                elem: '.layui-laydate-range'
+                , type: 'datetime'
+                , range: true
+            });
+            layDate.render({
+                elem: '#createTime\\$',
+                type: 'datetime',
+                value: data !== undefined ? data['createTime\\$'] : null
+            });
+            layDate.render({
+                elem: '#updateTime\\$',
+                type: 'datetime',
+                value: data !== undefined ? data['updateTime\\$'] : null
+            });
+
+        }, 300);
+    }
+
+    layDateRender();
+
+});
+
+// 鍏抽棴鍔ㄤ綔
+$(document).on('click','#data-detail-close', function () {
+    parent.layer.closeAll();
+});
+
+function tableReload(child) {
+    var searchData = {};
+    $.each($('#search-box [name]').serializeArray(), function() {
+        searchData[this.name] = this.value;
+    });
+    tableIns.reload({
+        where: searchData,
+        page: {curr: pageCurr}
+    });
+}
diff --git a/src/main/webapp/views/companyTarget/companyTarget.html b/src/main/webapp/views/companyTarget/companyTarget.html
index 891e7eb..bfc2813 100644
--- a/src/main/webapp/views/companyTarget/companyTarget.html
+++ b/src/main/webapp/views/companyTarget/companyTarget.html
@@ -60,6 +60,10 @@
     <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
 </script>
 
+<script type="text/html" id="targetTmp">
+    {{d.target}}涓囧厓
+</script>
+
 <script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
 <script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
 <script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
diff --git a/src/main/webapp/views/companyTarget/personTarget.html b/src/main/webapp/views/companyTarget/personTarget.html
new file mode 100644
index 0000000..a1bda98
--- /dev/null
+++ b/src/main/webapp/views/companyTarget/personTarget.html
@@ -0,0 +1,102 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../static/css/admin.css?v=318" media="all">
+    <link rel="stylesheet" href="../../static/css/cool.css" media="all">
+</head>
+<body>
+
+<div class="layui-fluid">
+    <div class="layui-card">
+        <div class="layui-card-body">
+            <div class="layui-form toolbar" id="search-box">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="id" placeholder="缂栧彿" autocomplete="off">
+                        </div>
+                    </div>
+                     <div class="layui-inline" style="width: 300px">
+                        <div class="layui-input-inline">
+                            <input class="layui-input layui-laydate-range" name="create_time" type="text" placeholder="璧峰鏃堕棿 - 缁堟鏃堕棿" autocomplete="off" style="width: 300px">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="condition" placeholder="璇疯緭鍏�" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">&emsp;
+                        <button class="layui-btn icon-btn" lay-filter="search" lay-submit>
+                            <i class="layui-icon">&#xe615;</i>鎼滅储
+                        </button>
+                        <button class="layui-btn icon-btn" lay-filter="reset" lay-submit>
+                            <i class="layui-icon">&#xe666;</i>閲嶇疆
+                        </button>
+                    </div>
+                </div>
+            </div>
+            <table class="layui-hide" id="companyTarget" lay-filter="companyTarget"></table>
+        </div>
+    </div>
+</div>
+
+<script type="text/html" id="toolbar">
+    <div class="layui-btn-container">
+        <button class="layui-btn layui-btn-sm" id="btn-add" lay-event="addData">鏂板</button>
+        <button class="layui-btn layui-btn-sm layui-btn-danger" id="btn-delete" lay-event="deleteData">鍒犻櫎</button>
+        <button class="layui-btn layui-btn-primary layui-btn-sm" id="btn-export" lay-event="exportData" style="float: right">瀵煎嚭</button>
+    </div>
+</script>
+
+<script type="text/html" id="operate">
+    <a class="layui-btn layui-btn-primary layui-btn-xs btn-edit" lay-event="edit">淇敼</a>
+    <a class="layui-btn layui-btn-danger layui-btn-xs btn-edit" lay-event="del">鍒犻櫎</a>
+</script>
+
+<script type="text/html" id="targetTmp">
+    {{d.target}}涓囧厓
+</script>
+
+<script type="text/javascript" src="../../static/js/jquery/jquery-3.3.1.min.js"></script>
+<script type="text/javascript" src="../../static/layui/layui.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/common.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/cool.js" charset="utf-8"></script>
+<script type="text/javascript" src="../../static/js/companyTarget/personTarget.js" charset="utf-8"></script>
+</body>
+<!-- 琛ㄥ崟寮圭獥 -->
+<script type="text/html" id="editDialog">
+    <div id="detail" lay-filter="detail" class="layui-form admin-form model-form">
+        <input name="id" type="hidden">
+        <div class="layui-row">
+            <div class="layui-col-md12">
+                <div class="layui-form-item">
+                    <label class="layui-form-label">骞村害: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="year" placeholder="璇疯緭鍏ュ勾搴�">
+                    </div>
+                </div>
+                <div class="layui-form-item">
+                    <label class="layui-form-label">鐩爣浜ゆ槗棰�: </label>
+                    <div class="layui-input-block">
+                        <input class="layui-input" name="target" placeholder="璇疯緭鍏ョ洰鏍囦氦鏄撻">
+                    </div>
+                </div>
+
+             </div>
+        </div>
+        <hr class="layui-bg-gray">
+        <div class="layui-form-item text-right">
+            <button class="layui-btn" lay-filter="editSubmit" lay-submit="">淇濆瓨</button>
+            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">鍙栨秷</button>
+        </div>
+    </div>
+</script>
+</html>
+

--
Gitblit v1.9.1