Bläddra i källkod

装集客项目更新

lijiangwei 4 år sedan
förälder
incheckning
f7b310ca0a

+ 1 - 1
uis/views/agent/edit.html

@@ -92,7 +92,7 @@
         form.on('submit(component-form-element)', function (data) {
             if (id) {
                 var url = '/agent/agent/' + id + '/';
-                var type = 'post';
+                var type = 'put';
             } else {
                 url = '/agent/agent/';
                 type = 'post'

+ 21 - 21
uis/views/agent/index.html

@@ -6,7 +6,7 @@
     <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">
+          content="width=agent-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">
@@ -58,13 +58,13 @@
                 <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
+                            <button class="layui-btn" id="agent_add"><i
                                     class="layui-icon layui-icon-add-circle"></i>添加
                             </button>
-                            <button class="layui-nav">
+                            <!--<button class="layui-nav">
                                 <div class="layui-nav-item">
                                     <a href="javascript:;" style="color:#fff;">导入</a>
-                                    <dl class="layui-nav-child"> <!-- 二级菜单 -->
+                                    <dl class="layui-nav-child">
                                         <dd><a href="#" id="btn_import">执行导入</a></dd>
                                         <dd><a href="#" id="btn_download">下载模板</a></dd>
                                     </dl>
@@ -72,7 +72,7 @@
                             </button>
                             <button class="layui-btn" id="btn_export"><i
                                     class="layui-icon layui-icon-download-circle"></i>导出
-                            </button>
+                            </button>-->
                         </div>
                         <form class="layui-form" lay-filter="query-form-element1">
                             <div class="seach_items">
@@ -87,15 +87,15 @@
                         </form>
                         <div style="clear: both;"></div>
                     </div>
-                    <table class="layui-hide" id="customer_datagrid" lay-filter="customer-operate"></table>
+                    <table class="layui-hide" id="agent_datagrid" lay-filter="agent-operate"></table>
 
-                    <script type="text/html" id="customer-operate-bar">
+                    <script type="text/html" id="agent-operate-bar">
                         <div class="layui-btn-group">
-                            <a class="layui-btn layui-btn-xs" lay-event="customer_edit"
+                            <a class="layui-btn layui-btn-xs" lay-event="agent_edit"
                             >修改</a>
                         </div>
                         <div class="layui-btn-group">
-                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="customer_del"
+                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="agent_del"
                             >删除</a>
                         </div>
                     </script>
@@ -118,7 +118,7 @@
             , admin = layui.admin;
 
         table.render({
-            elem: '#customer_datagrid'
+            elem: '#agent_datagrid'
             , url: '/agent/agent/'
             , cols: [[
                 {field: 'name', title: '名称', width: 150}
@@ -127,7 +127,7 @@
                 , {field: 'address', title: '地址', width: 200}
                 , {field: 'create_user', title: '添加人', width: 100}
                 , {field: 'create_time', title: '添加时间', width: 150}
-                , {width: 150, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
+                , {width: 150, align: 'center', fixed: 'right', toolbar: '#agent-operate-bar'}
             ]]
             , page: true
             , height: 'full-108'
@@ -152,14 +152,14 @@
         });
         upload.render({
             elem: '#btn_import'
-            , url: '/tenant/customer/import/'
+            , url: '/tenant/agent/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', {});
+                    table.reload('agent_datagrid', {});
                 } else {
                     layer.msg(res.msg);
                 }
@@ -171,20 +171,20 @@
 
 
         //监听工具条
-        table.on('tool(customer-operate)', function (obj) {
+        table.on('tool(agent-operate)', function (obj) {
             var data = obj.data;
-            if (obj.event === 'customer_del') {
+            if (obj.event === 'agent_del') {
                 layer.confirm('确定要删除吗?', function (index) {
                     layer.close(index);
                     admin.req({
                         url: '/agent/agent/' + data.id + '/'
                         , type: 'delete'
                         , done: function (res) {
-                            table.reload('customer_datagrid', {});
+                            table.reload('agent_datagrid', {});
                         }
                     });
                 });
-            } else if (obj.event === 'customer_edit') {
+            } else if (obj.event === 'agent_edit') {
                 table.editdata = data;
                 layer.open({
                     type: 2,
@@ -195,7 +195,7 @@
                     yes: function (index, dom) {
                         layui.onSubmitChild = function (data) {
                             layer.close(index);
-                            table.reload('customer_datagrid', {});
+                            table.reload('agent_datagrid', {});
                         };
                         layui.submitChild();
                     },
@@ -208,7 +208,7 @@
         });
 
         form.on('submit(query-form-element1)', function (data) {
-            table.reload('customer_datagrid', {
+            table.reload('agent_datagrid', {
                 where: data.field
                 , page: {curr: 1}
             });
@@ -216,7 +216,7 @@
             return false
         });
 
-        $('#customer_add').on('click', function () {
+        $('#agent_add').on('click', function () {
             layer.open({
                 type: 2,
                 title: '添加',
@@ -225,7 +225,7 @@
                 yes: function (index, dom) {
                     layui.onSubmitChild = function (data) {
                         layer.close(index);
-                        table.reload('customer_datagrid', {});
+                        table.reload('agent_datagrid', {});
                     };
                     layui.submitChild();
                 },

+ 2 - 2
uis/views/customer/edit.html

@@ -134,7 +134,7 @@
                 var data_project = res.data.project;
                 let tempData = [];
                 if(data_project && data_project.length > 0){
-                    tempData =  data_project.map(item=>{
+                    tempData = data_project.map(item=>{
                         if(id && editdata['project']){
                            if(typeof editdata['project'] === 'number'){
                                editdata['project'] = [editdata['project']]
@@ -172,7 +172,7 @@
             submitData.project = JSON.stringify(project);
             admin.req({
                 url: url
-                , data: data.field
+                , data: submitData
                 , type: type
                 , done: function (res) {
                     parent.layui.onSubmitChild(res.data);

+ 2 - 1
uis/views/dashboard/home.html

@@ -15,7 +15,8 @@
 
   <div class="layui-fluid">
     <div class="layui-row layui-col-space15">
-
+        首页
+    </div>
   </div>
 
   <script src="../../layuiadmin/layui/layui.js?t=1"></script>

+ 11 - 1
uis/views/index.html

@@ -98,6 +98,11 @@
                                 <a lay-href="customer/index.html">客户报备</a>
                             </dd>
                         </dl>
+                        <dl class="layui-nav-child">
+                            <dd data-name="nav" data-permission="option.browse_option">
+                                <a lay-href="report_check/index.html">报备审核</a>
+                            </dd>
+                        </dl>
                     </li>
                 </ul>
             </div>
@@ -150,6 +155,11 @@
       var name = layui.data(layui.setter.tableName)['name'];
       $('#id_username').html(name);
 
+      if (!name) {
+            location.href = '/views/account/login.html'; //没有用户,跳转到登录
+        }
+
+
       var permissions = layui.data(layui.setter.tableName)['permissions'];
       $('#LAY-system-side-muen .layui-nav-child dd').each(function () {
           var perm = $(this).data("permission");
@@ -175,7 +185,7 @@
           var is_has = false;
 
           for (var i in perms) {
-              if (permissions.indexOf(perms[i]) != -1) {
+              if (permissions.indexOf(perms[i]) !== -1) {
                   is_has = true;
                   break;
               }

+ 137 - 0
uis/views/report_check/divide.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">
+                                <select lay-verify="required" name="source" id="id_source">
+                                    <option value="">请选择人员</option>
+                                    <option value="1">小红</option>
+                                    <option value="2">小芳</option>
+                                    <option value="3">小绿</option>
+                                </select>
+                            </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'], function () {
+        var $ = layui.$
+            , admin = layui.admin
+            , formSelects = layui.formSelects
+            , form = layui.form
+        var id = layui.view.getParameterByName('id');
+        console.log(id, "oppppp");
+
+        // 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>");
+        //         }
+        //         var data_project = res.data.project;
+        //         let tempData = [];
+        //         if(data_project && data_project.length > 0){
+        //             tempData =  data_project.map(item=>{
+        //                 if(id && editdata['project']){
+        //                    if(typeof editdata['project'] === 'number'){
+        //                        editdata['project'] = [editdata['project']]
+        //                    }
+        //                    editdata['project'].forEach(item1=>{
+        //                        if(item.id === item1){
+        //                            item.selected = 'selected'
+        //                        }else{
+        //                            item.selected = ''
+        //                        }
+        //                    })
+        //                 }
+        //                 return {value: item.id, name: item.name, selected: item.selected }
+        //             });
+        //         }
+        //         formSelects.data('selectProject', 'local', {
+        //             arr: tempData
+        //         });
+        //         form.val("component-form-element", editdata);
+        //     }
+        // });
+
+        //form.render(null, 'component-form-element');
+
+        form.on('submit(component-form-element)', function (data) {
+            // if (id) {
+            //     var url = '/customer/report_customer/' + id + '/';
+            //     var type = 'put';
+            // } else {
+            //     url = '/customer/report_customer/';
+            //     type = 'post'
+            // }
+            var submitData = data.field;
+            // admin.req({
+            //     url: url
+            //     , data: data.field
+            //     , type: type
+            //     , done: function (res) {
+            parent.layui.onSubmitChild();
+            //     }
+            // });
+
+
+            return false;
+        });
+
+        parent.layui.submitChild = function () {
+            $("#id_save").click();
+        };
+    });
+</script>
+</body>
+</html>

+ 207 - 0
uis/views/report_check/index.html

@@ -0,0 +1,207 @@
+<!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=report_check-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="report_check_divide"><i
+                                    class="layui-icon layui-icon-auz"></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">
+                                <input type="text" name="name" autocomplete="off" class="layui-input"
+                                       placeholder="姓名"/>
+                            </div>
+                        </form>
+                        <div style="clear: both;"></div>
+                    </div>
+                    <table class="layui-hide" id="report_check_datagrid" lay-filter="report_check-operate"></table>
+
+                    <script type="text/html" id="report_check-operate-bar">
+                        <div class="layui-btn-group">
+                            <a class="layui-btn layui-btn-default layui-btn-xs" lay-event="report_check_search"
+                            >查看跟踪记录</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: '#report_check_datagrid'
+            , url: '/api/report_check.json'
+            , cols: [[
+                {type:'checkbox'}
+                , {field: 'name', title: '姓名', width: 200}
+                , {field: 'gender_text', title: "性别", width: 70}
+                , {field: 'tel', title: '电话', width: 150}
+                , {field: 'project_text', title: '项目', width: 200}
+                , {field: 'report_time', title: '报备时间', width: 150}
+                , {field: 'report_user', title: '报备人', width: 100}
+                , {field: 'hitBill_customer', title: '撞单客户', width: 100}
+                , {field: 'hitBill_project_text', title: '撞单项目', width: 100}
+                , {field: 'stalk_user', title: '撞单跟踪人', width: 100}
+                , {field: 'stalk_process', title: '撞单进度', width: 100}
+                , {field: 'last_stalk', title: '最后跟踪', width: 200}
+                , {width: 120, align: 'center', fixed: 'right', toolbar: '#report_check-operate-bar'}
+            ]]
+            , page: true
+            , height: 'full-108'
+        });
+
+        // admin.req({
+        //     url: '/report_check/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(report_check-operate)', function (obj) {
+            var data = obj.data;
+            //查看跟踪记录
+            if (obj.event === 'report_check_search') {
+
+            }
+        });
+
+        form.on('submit(query-form-element1)', function (data) {
+            table.reload('report_check_datagrid', {
+                where: data.field
+                , page: {curr: 1}
+            });
+            layer.closeAll();
+            return false
+        });
+
+        $('#report_check_divide').on('click', function () {
+            var checkStatus = table.checkStatus('report_check_datagrid');
+            if(checkStatus.data.length === 0){
+                layer.msg('请至少选择一条记录');
+                return
+            };
+            let divide_id = checkStatus.data.map(item=>{ return item.id }).join(",");
+            layer.open({
+                type: 2,
+                title: '分配客户',
+                area: ['35%', '40%'],
+                btn: ['保存', '取消'],
+                yes: function (index, dom) {
+                    layui.onSubmitChild = function (data) {
+                        layer.close(index);
+                        if(!data){
+                            layer.open({
+                            type: 1,
+                            title: '操作',
+                            area: ['25%', '20%'],
+                            btn: ['标记为撞单客户', '重新分配'],
+                            yes: function (index, dom) {
+                                layui.onSubmitChild = function (data) {
+                                    layer.close(index);
+                                };
+                            },
+                            btn2: function (index, layero) {
+                                layer.close(index);
+                            },
+                            content: '<p style="text-align: center; padding-top: 10px">和“某店”客户撞单,请选择后续操作。<p>'
+                        });
+                        }
+                        table.reload('report_check_datagrid', {});
+                    };
+                    layui.submitChild();
+                },
+                btn2: function (index, layero) {
+                    layer.close(index);//关闭当前按钮
+                },
+                content: 'divide.html?id=' + divide_id
+            });
+        });
+    });
+
+</script>
+</body>
+</html>