|
@@ -58,18 +58,9 @@
|
|
|
<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>
|
|
|
- <!--<button class="layui-nav">
|
|
|
- <div class="layui-nav-item">
|
|
|
- <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>
|
|
|
- </dl>
|
|
|
- </div>
|
|
|
- </button>-->
|
|
|
</div>
|
|
|
<form class="layui-form" lay-filter="query-form-element1">
|
|
|
<div class="seach_items">
|
|
@@ -94,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>
|
|
@@ -123,18 +116,18 @@
|
|
|
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: 'report_status_text', title: '报备状态', width: 100}
|
|
|
, {field: 'check_user', title: '审核人', width: 100}
|
|
|
, {field: 'check_time', title: '审核时间', width: 150}
|
|
|
- , {width: 150, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
|
|
|
+ , {width: 130, align: 'center', fixed: 'right', toolbar: '#customer-operate-bar'}
|
|
|
]]
|
|
|
, page: true
|
|
|
, height: 'full-108'
|
|
@@ -154,31 +147,14 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- $('#btn_download').on('click', function () {
|
|
|
- layui.view.download("/static/xls/设备信息导入模板.xlsx");
|
|
|
- });
|
|
|
- upload.render({
|
|
|
- elem: '#btn_import'
|
|
|
- , 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('导入失败');
|
|
|
- }
|
|
|
- });
|
|
|
//监听工具条
|
|
|
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({
|