Selaa lähdekoodia

装集客项目更新

lijiangwei 4 vuotta sitten
vanhempi
sitoutus
93ddeb3e08

+ 0 - 1
uis/views/account/login.html

@@ -61,7 +61,6 @@
         ,data: {token: layui.data(setter.tableName)[setter.request.tokenName].substr(4)}
         ,type: 'post'
         ,done: function(res){
-            console.log(11111111111,res)
 
           //请求成功后,写入 access_token
           layui.data(setter.tableName, {

+ 137 - 0
uis/views/customer/add_report.html

@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<html>
+<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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
+    <link rel="stylesheet" type="text/css" href="../../layuiadmin/style/formSelects-v4.css"/>
+    <style>
+        .input {
+            border-radius: 2px;
+            height: 38px;
+            border-width: 1px;
+            border-color: lightgray;
+            border-style: solid;
+            background-color: white;
+            padding-left: 3px;
+        }
+    </style>
+</head>
+<body>
+
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-card">
+
+            <div class="layui-card-body" pad15>
+                <form class="layui-form" action="" lay-filter="component-form-element">
+                    <div class="layui-row layui-col-space10 layui-form-item">
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>回访情况:</label>
+                            <div class="layui-input-block">
+                                <textarea type="text" name="follow_status" lay-verify="required" class="layui-textarea" placeholder="请填写回访情况"/></textarea>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label">申请支援:</label>
+                            <div class="layui-input-block">
+                                <textarea type="text" name="apply_help" class="layui-textarea" placeholder="如需支援请填写申请内容"/></textarea>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label">是否进店:</label>
+                            <div class="layui-input-block">
+                                <input type="radio" name="isEnter" value="1" title="是">
+                                <input type="radio" name="isEnter" value="2" title="否">
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label">修改级别:</label>
+                            <div class="layui-input-block">
+                                <select name="visit_status" id="id_rank">
+                                    <option value="">请选择回访后的客户级别</option>
+                                    <option value="1">有意</option>
+                                    <option value="2">有需</option>
+                                    <option value="3">将成</option>
+                                </select>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>下次回访:</label>
+                            <div class="layui-input-block">
+                                 <input type="text" name="next_visit" class="layui-input" id="test1" placeholder="修改下次回访日期">
+                            </div>
+                        </div>
+
+                        <button id="id_save" class="layui-btn" lay-submit lay-filter="component-form-element"
+                                style="display: none">保存
+                        </button>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="../../layuiadmin/layui/layui.js"></script>
+<script>
+    layui.link('../../../layuiadmin/style/autocomplete.css');
+    layui.config({
+        base: '../../../layuiadmin/' //静态资源所在路径
+        , autocomplete: 'autocomplete'
+    }).extend({
+        index: 'lib/index',
+        formSelects: 'formSelects-v4'
+    }).use(['index', 'form', 'autocomplete', 'formSelects', 'laydate'], function () {
+        var $ = layui.$
+            , admin = layui.admin
+            , laydate = layui.laydate
+            , formSelects = layui.formSelects
+            , form = layui.form;
+        laydate.render({
+            elem: '#test1'
+        });
+
+        admin.req({
+            url: '/customer/dict/',
+            done: function (res) {
+                // var data_source = res.data.source;
+                // var source_node = $('#id_source');
+                // for (var i in data_source) {
+                //     var pid = data_source[i].id;
+                //     var name = data_source[i].name;
+                //     source_node.append("<option value='" + pid + "'>" + name + "</option>");
+                // }
+                form.val("component-form-element", {});
+            }
+        });
+
+        //form.render(null, 'component-form-element');
+
+        form.on('submit(component-form-element)', function (data) {
+            var url = '/customer/report_customer/';
+            var type = 'post';
+            var submitData = data.field;
+            admin.req({
+                url: url
+                , data: submitData
+                , type: type
+                , done: function (res) {
+                    parent.layui.onSubmitChild(res);
+                }
+            });
+
+            return false;
+        });
+
+        parent.layui.submitChild = function () {
+            $("#id_save").click();
+        };
+    });
+</script>
+</body>
+</html>

+ 107 - 0
uis/views/customer/detail.html

@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html>
+<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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
+    <link rel="stylesheet" type="text/css" href="../../layuiadmin/style/formSelects-v4.css"/>
+    <style>
+        .input {
+            border-radius: 2px;
+            height: 38px;
+            border-width: 1px;
+            border-color: lightgray;
+            border-style: solid;
+            background-color: white;
+            padding-left: 3px;
+        }
+    </style>
+</head>
+<body>
+
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-card">
+            <div class="layui-card-body" pad15>
+                <div id="tableDom"></div>
+                <h3 style="margin: 40px 0 10px 0">潜客跟踪报告</h3>
+                <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
+            </div>
+        </div>
+    </div>
+</div>
+<script id="demo" type="text/html">
+    <table class="layui-table">
+          <tbody>
+            <tr>
+              <td style="background: #f8f8f8; width: 70px">姓名:</td>
+              <td>{{ d.name }}</td>
+              <td style="background: #f8f8f8; width: 70px">性别:</td>
+              <td>{{ d.gender_text }}</td>
+            </tr>
+            <tr>
+              <td style="background: #f8f8f8; width: 70px">电话:</td>
+              <td>{{ d.tel }}</td>
+              <td style="background: #f8f8f8; width: 70px">地址:</td>
+              <td>{{ d.address }}</td>
+            </tr>
+            <tr>
+              <td style="background: #f8f8f8; width: 70px">小区:</td>
+              <td>{{ d.village }}</td>
+              <td style="background: #f8f8f8; width: 70px">来源:</td>
+              <td>{{ d.source_text }}</td>
+            </tr>
+            <tr>
+              <td style="background: #f8f8f8; width: 70px">备注:</td>
+              <td colspan="3">{{ d.notes }}</td>
+            </tr>
+          </tbody>
+        </table>
+</script>
+<script src="../../layuiadmin/layui/layui.js"></script>
+<script>
+    layui.link('../../../layuiadmin/style/autocomplete.css');
+    layui.config({
+        base: '../../../layuiadmin/' //静态资源所在路径
+        , autocomplete: 'autocomplete'
+    }).extend({
+        index: 'lib/index',
+        formSelects: 'formSelects-v4'
+    }).use(['index', 'table', 'form', 'autocomplete', 'formSelects', 'laytpl' ], function () {
+        var $ = layui.$
+            , table = layui.table
+            , admin = layui.admin
+            , laytpl = layui.laytpl
+            , formSelects = layui.formSelects
+            , form = layui.form;
+
+        editdata = JSON.parse(JSON.stringify(parent.layui.table.editdata)); // 框架有Bug所以这么转换
+        var data = editdata;
+        var getTpl = demo.innerHTML
+        ,tableDom = document.getElementById('tableDom');
+        laytpl(getTpl).render(data, function(html){
+          tableDom.innerHTML = html;
+        });
+        table.render({
+            elem: '#customer_datagrid'
+            , url: '/api/dataTable.json'
+            , cols: [[
+                {field: 'follow_user', title: '跟踪人', width: 100}
+                , {field: 'follow_time', title: "跟踪时间", width: 110}
+                , {field: 'connect_status', title: '沟通情况', width: 100}
+                , {field: 'rank', title: '客户级别', width: 100}
+                , {field: 'application', title: '申请事项', width: 200}
+                , {field: 'check_status', title: '审核状态', width: 100}
+            ]]
+            , page: true
+        });
+
+    });
+</script>
+</body>
+</html>

+ 134 - 72
uis/views/customer/index.html

@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="utf-8">
-    <title>客户报备</title>
+    <title>潜客跟踪</title>
     <meta name="renderer" content="webkit">
     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport"
@@ -46,6 +46,21 @@
             background-color: #f2f2f2;
             color: #000;
         }
+
+        .tableContent{
+            width: 100%;
+            display: flex;
+            justify-content: space-between;
+            flex-direction: row;
+        }
+        .demo-class .layui-layer-btn0{
+            background-color: #009688 !important;
+            color: #fff;
+        }
+        .demo-class .layui-layer-btn1{
+            background-color: red;
+            color: #fff;
+        }
     </style>
 
 </head>
@@ -59,28 +74,30 @@
                     <div class="LAY-btns" style="margin-bottom: 10px;">
                         <div style="float: left">
                             <button class="layui-btn" id="customer_add"><i
-                                    class="layui-icon layui-icon-add-circle"></i>添加
+                                    class="layui-icon layui-icon-add-circle"></i>跟踪报告
                             </button>
-                            <!--<button class="layui-nav">
+                            <button class="layui-btn" id="customer_order"><i
+                                    class="layui-icon layui-icon-add-circle"></i>预约量房
+                            </button>
+                            <button class="layui-nav">
                                 <div class="layui-nav-item">
-                                    <a href="javascript:;" style="color:#fff;">导入</a>
+                                    <a href="javascript:;" style="color:#fff;">导</a>
                                     <dl class="layui-nav-child">
-                                        <dd><a href="#" id="btn_import">执行导入</a></dd>
-                                        <dd><a href="#" id="btn_download">下载模板</a></dd>
+                                        <dd><a href="#" id="btn_list">列表</a></dd>
+                                        <dd><a href="#" id="btn_detail">明细</a></dd>
                                     </dl>
                                 </div>
-                            </button>-->
+                            </button>
                         </div>
-                        <form class="layui-form" lay-filter="query-form-element1">
+                        <form class="layui-form" lay-filter="query-form-element">
                             <div class="seach_items">
-                                <button class="layui-btn" lay-submit lay-filter="query-form-element1"><i
+                                <button class="layui-btn" lay-submit lay-filter="query-form-element"><i
                                         class="layui-icon layui-icon-search"></i>查询
                                 </button>
                             </div>
                             <div class="seach_items">
-                                <select name="source" id="id_source" style="width: 40px;">
-                                    <option value="">请选择来源</option>
-                                </select>
+                                <input type="text" name="tel" autocomplete="off" class="layui-input"
+                                       placeholder="电话"/>
                             </div>
                             <div class="seach_items">
                                 <input type="text" name="name" autocomplete="off" class="layui-input"
@@ -89,16 +106,20 @@
                         </form>
                         <div style="clear: both;"></div>
                     </div>
-                    <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
 
-                    <script type="text/html" id="customer-operate-bar">
-                        <div class="layui-btn-group">
-                            <a class="layui-btn layui-btn-xs" lay-event="customer_edit"
-                            >修改</a>
+                    <div class="tableContent">
+                        <div style="width: 405px">
+                            <table class="layui-hide" id="customer_log" lay-filter="customer-operate-log"></table>
                         </div>
+                        <div style="width: calc(100% - 450px)">
+                            <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
+                        </div>
+                    </div>
+
+                    <script type="text/html" id="customer-operate-bar">
                         <div class="layui-btn-group">
-                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="customer_del"
-                            >删除</a>
+                            <a class="layui-btn layui-btn-xs" lay-event="customer_search"
+                            >查看</a>
                         </div>
                     </script>
                 </div>
@@ -119,22 +140,39 @@
             , upload = layui.upload
             , admin = layui.admin;
 
+        table.render({
+            elem: '#customer_log'
+            , url: '/api/customer.json'
+            , cols: [[
+                {field: 'stage', title: '阶段', width: 100}
+                , {field: 'total_count', title: "总人数", width: 100, sort: true}
+                , {field: 'today_count', title: '今日', width: 100, sort: true}
+                , {field: 'exceed_count', title: '逾期', width: 100, sort: true}
+            ]]
+        });
+
         table.render({
             elem: '#customer_datagrid'
-            , url: '/customer/report_customer/'
+            , url: '/api/dataTable.json'
             , cols: [[
-                {field: 'name', title: '姓名', width: 200}
+                {field: 'name', title: '姓名', width: 110}
                 , {field: 'gender_text', title: "性别", width: 70}
                 , {field: 'tel', title: '电话', width: 150}
                 , {field: 'village', title: '小区', width: 200}
                 , {field: 'address', title: '地址', width: 200}
                 , {field: 'source_text', title: '来源', width: 100}
-                , {field: 'project_text', title: '项目', width: 200}
                 , {field: 'notes', title: '备注', width: 200}
-                , {field: 'report_status_text', title: '报备状态', width: 200}
-                , {field: 'check_user', title: '审核人', width: 100}
-                , {field: 'check_time', title: '审核时间', width: 150}
-                , {width: 150, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
+                , {field: 'follow_user', title: '跟踪人', width: 100}
+                , {field: 'last_follow', title: '最后跟踪', width: 150}
+                , {field: 'follow_status', title: '跟踪情况', width: 200}
+                , {field: 'follow_count', title: '跟踪次数', width: 100}
+                , {field: 'enter_count', title: '进店次数', width: 100}
+                , {field: 'last_enter', title: '最后进店时间', width: 150}
+                , {field: 'rank', title: '级别', width: 100}
+                , {field: 'status', title: '状态', width: 100}
+                , {field: 'create_time', title: '建档时间', width: 150}
+                , {field: 'create_user', title: '建档人', width: 150}
+                , {width: 80, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
             ]]
             , page: true
             , height: 'full-108'
@@ -157,15 +195,35 @@
         $('#btn_download').on('click', function () {
             layui.view.download("/static/xls/设备信息导入模板.xlsx");
         });
+        //导出列表
+        upload.render({
+            elem: '#btn_list'
+            , url: '/tenant/customer/import/'
+            , accept: 'file'
+            , acceptMime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+            , exts: 'xlsx'
+            , field: 'excel_file'
+            , done: function (res) {
+                if (res.code === 0) {
+                    table.reload('customer_datagrid', {});
+                } else {
+                    layer.msg(res.msg);
+                }
+            }
+            , error: function () {
+                layer.msg('导入失败');
+            }
+        });
+        //导出明细
         upload.render({
-            elem: '#btn_import'
+            elem: '#btn_detail'
             , url: '/tenant/customer/import/'
             , accept: 'file'
             , acceptMime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
             , exts: 'xlsx'
             , field: 'excel_file'
             , done: function (res) {
-                if (res.code == 0) {
+                if (res.code === 0) {
                     table.reload('customer_datagrid', {});
                 } else {
                     layer.msg(res.msg);
@@ -178,51 +236,32 @@
         //监听工具条
         table.on('tool(customer-operate)', function (obj) {
             var data = obj.data;
-            if (obj.event === 'customer_del') {
-                layer.confirm('确定要删除吗?', function (index) {
+            if (obj.event === 'customer_search') {
+               table.editdata = data;
+               layer.open({
+                skin: 'demo-class',
+                type: 2,
+                title: '查看客户详情',
+                area: ['45%', '90%'],
+                btn: ['跟踪报告', '更新进度', '取消'],
+                yes: function (index, dom) {
+                    //跟踪报告
                     layer.close(index);
-                    admin.req({
-                        url: '/customer/report_customer/' + data.id + '/'
-                        , type: 'delete'
-                        , done: function (res) {
-                            if(res.code === 0){
-                                layer.msg('删除成功!', {icon: 1})
-                             }
-                            table.reload('customer_datagrid', {});
-                        }
-                    });
-                });
-            } else if (obj.event === 'customer_edit') {
-                if(data.report_status !== 0){
-                    layer.msg("只有待审核才允许修改");
-                    return
-                }
-                table.editdata = data;
-                layer.open({
-                    type: 2,
-                    title: '修改',
-                    shadeClose: false,
-                    area: ['45%', '80%'],
-                    btn: ['保存', '取消'],
-                    yes: function (index, dom) {
-                        layui.onSubmitChild = function (res) {
-                            if(res.code === 0){
-                                layer.msg('修改成功!', {icon: 1})
-                             }
-                            layer.close(index);
-                            table.reload('customer_datagrid', {});
-                        };
-                        layui.submitChild();
-                    },
-                    btn2: function (index, layero) {
-                        layer.close(index);//关闭当前按钮
-                    },
-                    content: 'edit.html?id=' + data.id
-                });
+                },
+                btn2: function (index, layero) {
+                    //更新进度
+                    layer.close(index);//关闭当前按钮
+                },
+                btn3: function (index, layero) {
+                    //取消
+                    layer.close(index);//关闭当前按钮
+                },
+                content: 'detail.html'
+            });
             }
         });
 
-        form.on('submit(query-form-element1)', function (data) {
+        form.on('submit(query-form-element)', function (data) {
             table.reload('customer_datagrid', {
                 where: data.field
                 , page: {curr: 1}
@@ -234,8 +273,31 @@
         $('#customer_add').on('click', function () {
             layer.open({
                 type: 2,
-                title: '添加',
-                area: ['45%', '80%'],
+                title: '添加跟踪报告',
+                area: ['45%', '70%'],
+                btn: ['保存', '取消'],
+                yes: function (index, dom) {
+                    layui.onSubmitChild = function (res) {
+                        if(res.code === 0){
+                            layer.msg('添加成功!', {icon: 1})
+                         }
+                        layer.close(index);
+                        table.reload('customer_datagrid', {});
+                    };
+                    layui.submitChild();
+                },
+                btn2: function (index, layero) {
+                    layer.close(index);//关闭当前按钮
+                },
+                content: 'add_report.html'
+            });
+        });
+
+        $('#customer_order').on('click', function () {
+            layer.open({
+                type: 2,
+                title: '预约量房',
+                area: ['45%', '65%'],
                 btn: ['保存', '取消'],
                 yes: function (index, dom) {
                     layui.onSubmitChild = function (res) {
@@ -250,7 +312,7 @@
                 btn2: function (index, layero) {
                     layer.close(index);//关闭当前按钮
                 },
-                content: 'edit.html'
+                content: 'order.html'
             });
         });
     });

+ 153 - 0
uis/views/customer/order.html

@@ -0,0 +1,153 @@
+<!DOCTYPE html>
+<html>
+<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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
+    <link rel="stylesheet" type="text/css" href="../../layuiadmin/style/formSelects-v4.css"/>
+    <style>
+        .input {
+            border-radius: 2px;
+            height: 38px;
+            border-width: 1px;
+            border-color: lightgray;
+            border-style: solid;
+            background-color: white;
+            padding-left: 3px;
+        }
+    </style>
+</head>
+<body>
+
+<div class="layui-fluid">
+    <div class="layui-row layui-col-space15">
+        <div class="layui-card">
+
+            <div class="layui-card-body" pad15>
+                <form class="layui-form" action="" lay-filter="component-form-element">
+                    <div class="layui-row layui-col-space10 layui-form-item">
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>客户姓名:</label>
+                            <div class="layui-input-block">
+                                <input type="text" name="name" class="layui-input" placeholder="请输入客户姓名"
+                                       autocomplete="off" lay-verify="required"/>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>客户电话:</label>
+                            <div class="layui-input-block">
+                                <input type="text" name="tel" class="layui-input" placeholder="请输入客户电话"
+                                       autocomplete="off" lay-verify="required"/>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>客户地址:</label>
+                            <div class="layui-input-block">
+                                <input type="text" name="address" class="layui-input" placeholder="请输入客户地址"
+                                       autocomplete="off" lay-verify="required"/>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>预约时间:</label>
+                            <div class="layui-input-block">
+                                 <input type="text" name="order_time" class="layui-input" id="test1" placeholder="修改预约时间">
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label"><font color='red' size="4">*</font>项目:</label>
+                            <div class="layui-input-block">
+                                 <select lay-verify="required" name="project" xm-select="selectProject" xm-select-skin="primary">
+                                     <option value="">请选择客户订单项目</option>
+                                 </select>
+                            </div>
+                        </div>
+                        <div>
+                            <label class="layui-form-label">备注:</label>
+                            <div class="layui-input-block">
+                                <textarea type="text" name="notes" class="layui-textarea" placeholder="请输入备注"/></textarea>
+                            </div>
+                        </div>
+
+                        <button id="id_save" class="layui-btn" lay-submit lay-filter="component-form-element"
+                                style="display: none">保存
+                        </button>
+                    </div>
+                </form>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="../../layuiadmin/layui/layui.js"></script>
+<script>
+    layui.link('../../../layuiadmin/style/autocomplete.css');
+    layui.config({
+        base: '../../../layuiadmin/' //静态资源所在路径
+        , autocomplete: 'autocomplete'
+    }).extend({
+        index: 'lib/index',
+        formSelects: 'formSelects-v4'
+    }).use(['index', 'form', 'autocomplete', 'formSelects', 'laydate'], function () {
+        var $ = layui.$
+            , admin = layui.admin
+            , laydate = layui.laydate
+            , formSelects = layui.formSelects
+            , form = layui.form;
+        laydate.render({
+            elem: '#test1'
+            ,type: 'datetime'
+        });
+
+        formSelects.data('selectProject', 'local', {
+            arr: [
+                {value: 1, name: "壁纸"},
+                {value: 2, name: "壁布"}
+            ]
+        });
+        form.val("component-form-element", {});
+
+        admin.req({
+            url: '/customer/dict/',
+            done: function (res) {
+                // var data_source = res.data.source;
+                // var source_node = $('#id_source');
+                // for (var i in data_source) {
+                //     var pid = data_source[i].id;
+                //     var name = data_source[i].name;
+                //     source_node.append("<option value='" + pid + "'>" + name + "</option>");
+                // }
+                form.val("component-form-element", {});
+            }
+        });
+
+        //form.render(null, 'component-form-element');
+
+        form.on('submit(component-form-element)', function (data) {
+            var url = '/customer/report_customer/';
+            var type = 'post';
+            var submitData = data.field;
+            var project = formSelects.value('selectProject', 'val');
+            submitData.project = JSON.stringify(project);
+            admin.req({
+                url: url
+                , data: submitData
+                , type: type
+                , done: function (res) {
+                    parent.layui.onSubmitChild(res);
+                }
+            });
+
+            return false;
+        });
+
+        parent.layui.submitChild = function () {
+            $("#id_save").click();
+        };
+    });
+</script>
+</body>
+</html>

+ 6 - 1
uis/views/index.html

@@ -92,7 +92,7 @@
                         </a>
                         <dl class="layui-nav-child">
                             <dd data-name="nav" data-permission="option.browse_option">
-                                <a lay-href="customer/index.html">客户报备</a>
+                                <a lay-href="new_customer/index.html">客户报备</a>
                             </dd>
                         </dl>
                         <dl class="layui-nav-child">
@@ -100,6 +100,11 @@
                                 <a lay-href="report_check/index.html">报备审核</a>
                             </dd>
                         </dl>
+                        <dl class="layui-nav-child">
+                            <dd data-name="nav" data-permission="option.browse_option">
+                                <a lay-href="customer/index.html">潜客跟踪</a>
+                            </dd>
+                        </dl>
                     </li>
                 </ul>
             </div>

+ 1 - 1
uis/views/customer/edit.html → uis/views/new_customer/edit.html

@@ -41,7 +41,7 @@
                         <div>
                             <label class="layui-form-label"><font color='red' size="4">*</font>性别:</label>
                             <div class="layui-input-block">
-                                <input type="radio" name="gender" value="2" title="男" checked>
+                                <input type="radio" name="gender" value="2" title="男">
                                 <input type="radio" name="gender" value="1" title="女">
                             </div>
                         </div>

+ 233 - 0
uis/views/new_customer/index.html

@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<html>
+<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=customer-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
+    <style type="text/css">
+        .seach_items {
+            float: right;
+            margin-left: 10px;
+        }
+    </style>
+    <style type="text/css">
+        .LAY-btns .layui-nav {
+            padding-left: 0;
+            padding-right: 10px;
+            top: -4px;
+            margin: 0 10px;
+            border: 0;
+            background-color: #009688;
+        }
+
+        .LAY-btns .layui-nav .layui-nav-item {
+            line-height: 40px;
+        }
+
+        .LAY-btns .layui-nav .layui-nav-child {
+            top: 34px;
+        }
+
+        .LAY-btns .layui-nav .layui-nav-bar {
+            display: none;
+        }
+
+        .LAY-btns .layui-nav .layui-nav-child dd.layui-this a {
+            color: #333;
+            background-color: #fff;
+        }
+
+        .LAY-btns .layui-nav .layui-nav-child dd.layui-this a:hover {
+            background-color: #f2f2f2;
+            color: #000;
+        }
+    </style>
+
+</head>
+<body>
+
+<div class="layui-fluid">
+    <div class="layui-card">
+        <div class="layui-card-body" pad15>
+            <div class="layui-row layui-col-space15">
+                <div class="layui-col-md12">
+                    <div class="LAY-btns" style="margin-bottom: 10px;">
+                        <div style="float: left">
+                            <button class="layui-btn" id="customer_add"><i
+                                    class="layui-icon layui-icon-add-circle"></i>添加
+                            </button>
+                        </div>
+                        <form class="layui-form" lay-filter="query-form-element1">
+                            <div class="seach_items">
+                                <button class="layui-btn" lay-submit lay-filter="query-form-element1"><i
+                                        class="layui-icon layui-icon-search"></i>查询
+                                </button>
+                            </div>
+                            <div class="seach_items">
+                                <select name="source" id="id_source" style="width: 40px;">
+                                    <option value="">请选择来源</option>
+                                </select>
+                            </div>
+                            <div class="seach_items">
+                                <input type="text" name="name" autocomplete="off" class="layui-input"
+                                       placeholder="姓名"/>
+                            </div>
+                        </form>
+                        <div style="clear: both;"></div>
+                    </div>
+                    <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
+
+                    <script type="text/html" id="customer-operate-bar">
+                        <div class="layui-btn-group">
+                            <a class="layui-btn layui-btn-xs" lay-event="customer_edit"
+                            >修改</a>
+                        </div>
+                        <div class="layui-btn-group">
+                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="customer_del"
+                            >删除</a>
+                        </div>
+                    </script>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script src="../../layuiadmin/layui/layui.js?t=1"></script>
+<script>
+    layui.config({
+        base: '../../../layuiadmin/' //静态资源所在路径
+    }).extend({
+        index: 'lib/index' //主入口模块
+    }).use(['index', 'table', 'form', 'upload'], function () {
+        var $ = layui.$;
+        var table = layui.table
+            , form = layui.form
+            , upload = layui.upload
+            , admin = layui.admin;
+
+        table.render({
+            elem: '#customer_datagrid'
+            , url: '/customer/report_customer/'
+            , cols: [[
+                {field: 'name', title: '姓名', width: 200}
+                , {field: 'gender_text', title: "性别", width: 70}
+                , {field: 'tel', title: '电话', width: 150}
+                , {field: 'village', title: '小区', width: 200}
+                , {field: 'address', title: '地址', width: 200}
+                , {field: 'source_text', title: '来源', width: 100}
+                , {field: 'project_text', title: '项目', width: 200}
+                , {field: 'notes', title: '备注', width: 200}
+                , {field: 'report_status_text', title: '报备状态', width: 200}
+                , {field: 'check_user', title: '审核人', width: 100}
+                , {field: 'check_time', title: '审核时间', width: 150}
+                , {width: 150, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
+            ]]
+            , page: true
+            , height: 'full-108'
+        });
+
+        admin.req({
+            url: '/customer/dict/',
+            done: function (res) {
+                var data = res.data.source;
+                var source_node = $('#id_source');
+                for (var i in data) {
+                    var pid = data[i].id;
+                    var name = data[i].name;
+                    source_node.append("<option value='" + pid + "'>" + name + "</option>");
+                }
+                form.render('select');
+            }
+        });
+
+        // $('#btn_download').on('click', function () {
+        //     layui.view.download("/static/xls/设备信息导入模板.xlsx");
+        // });
+        //监听工具条
+        table.on('tool(customer-operate)', function (obj) {
+            var data = obj.data;
+            if (obj.event === 'customer_del') {
+                layer.confirm('确定要删除吗?', function (index) {
+                    layer.close(index);
+                    admin.req({
+                        url: '/customer/report_customer/' + data.id + '/'
+                        , type: 'delete'
+                        , done: function (res) {
+                            if(res.code === 0){
+                                layer.msg('删除成功!', {icon: 1})
+                             }
+                            table.reload('customer_datagrid', {});
+                        }
+                    });
+                });
+            } else if (obj.event === 'customer_edit') {
+                if(data.report_status !== 0){
+                    layer.msg("只有待审核才允许修改");
+                    return
+                }
+                table.editdata = data;
+                layer.open({
+                    type: 2,
+                    title: '修改',
+                    shadeClose: false,
+                    area: ['45%', '80%'],
+                    btn: ['保存', '取消'],
+                    yes: function (index, dom) {
+                        layui.onSubmitChild = function (res) {
+                            if(res.code === 0){
+                                layer.msg('修改成功!', {icon: 1})
+                             }
+                            layer.close(index);
+                            table.reload('customer_datagrid', {});
+                        };
+                        layui.submitChild();
+                    },
+                    btn2: function (index, layero) {
+                        layer.close(index);//关闭当前按钮
+                    },
+                    content: 'edit.html?id=' + data.id
+                });
+            }
+        });
+
+        form.on('submit(query-form-element1)', function (data) {
+            table.reload('customer_datagrid', {
+                where: data.field
+                , page: {curr: 1}
+            });
+            layer.closeAll();
+            return false
+        });
+
+        $('#customer_add').on('click', function () {
+            layer.open({
+                type: 2,
+                title: '添加',
+                area: ['45%', '80%'],
+                btn: ['保存', '取消'],
+                yes: function (index, dom) {
+                    layui.onSubmitChild = function (res) {
+                        if(res.code === 0){
+                            layer.msg('添加成功!', {icon: 1})
+                         }
+                        layer.close(index);
+                        table.reload('customer_datagrid', {});
+                    };
+                    layui.submitChild();
+                },
+                btn2: function (index, layero) {
+                    layer.close(index);//关闭当前按钮
+                },
+                content: 'edit.html'
+            });
+        });
+    });
+
+</script>
+</body>
+</html>

+ 0 - 1
uis/views/report_check/divide.html

@@ -66,7 +66,6 @@
             , formSelects = layui.formSelects
             , form = layui.form
         var id = layui.view.getParameterByName('id');
-        console.log(id, "oppppp");
 
         // admin.req({
         //     url: '/customer/dict/',