Bladeren bron

报备客户

wushaodong 4 jaren geleden
bovenliggende
commit
4d757242dc
1 gewijzigde bestanden met toevoegingen van 15 en 13 verwijderingen
  1. 15 13
      uis/views/new_customer/index.html

+ 15 - 13
uis/views/new_customer/index.html

@@ -58,7 +58,7 @@
                 <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="customer_add" data-permission="customer.add_report_customer"><i
                                     class="layui-icon layui-icon-add-circle"></i>添加
                             </button>
                         </div>
@@ -85,10 +85,12 @@
                     <script type="text/html" id="customer-operate-bar">
                         <div class="layui-btn-group">
                             <a class="layui-btn layui-btn-xs" lay-event="customer_edit"
+                               data-permission="customer.add_report_customer"
                             >修改</a>
                         </div>
                         <div class="layui-btn-group">
                             <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="customer_del"
+                               data-permission="customer.delete_report_customer"
                             >删除</a>
                         </div>
                     </script>
@@ -103,29 +105,28 @@
         base: '../../../layuiadmin/' //静态资源所在路径
     }).extend({
         index: 'lib/index' //主入口模块
-    }).use(['index', 'table', 'form', 'upload'], function () {
+    }).use(['index', 'table', 'form',], 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: 'name', title: '姓名', width: 120}
                 , {field: 'gender_text', title: "性别", width: 70}
-                , {field: 'tel', title: '电话', width: 150}
-                , {field: 'village', title: '小区', width: 200}
+                , {field: 'tel', title: '电话', width: 120}
+                , {field: 'village', title: '小区', width: 150}
                 , {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: 'report_status_text', title: '报备状态', width: 100}
+                , {field: 'check_user_text', title: '审核人', width: 100}
+                , {field: 'check_time', title: '审核时间', width: 160}
+                , {width: 130, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
             ]]
             , page: true
             , height: 'full-108'
@@ -145,13 +146,14 @@
             }
         });
 
-        // $('#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') {
+                if(data.report_status !== 0){
+                    layer.msg("只有待审核才允许删除");
+                    return
+                }
                 layer.confirm('确定要删除吗?', function (index) {
                     layer.close(index);
                     admin.req({