| | |
| | | page: true, |
| | | limit: 15, |
| | | limits: [15, 30, 50, 100, 200, 500], |
| | | toolbar: '#toolbar', |
| | | cellMinWidth: 50, |
| | | cellMinWidth: 100, |
| | | height: 'full-120', |
| | | size: 'sm', |
| | | skin: 'nob', |
| | | cols: [[ |
| | | {type: 'checkbox'} |
| | | ,{field: 'id', align: 'center',title: 'ID'} |
| | | ,{field: 'hostId$', align: 'center',title: '所属商户'} |
| | | ,{field: 'deptId$', align: 'center',title: '所属部门'} |
| | | // ,{field: 'id', align: 'center',title: 'ID'} |
| | | // ,{field: 'hostId$', align: 'center',title: '所属商户'} |
| | | ,{field: 'deptId$', align: 'center',title: '所属部门', hide: true} |
| | | ,{field: 'userId$', align: 'center',title: '所属人员'} |
| | | ,{field: 'cstmrType$', align: 'center',title: '客户类别'} |
| | | ,{field: 'uuid', align: 'center',title: '客户代号'} |
| | | ,{field: 'name', align: 'center',title: '客户名称'} |
| | | ,{field: 'simple', align: 'center',title: '客户简称'} |
| | | ,{field: 'simple', align: 'center',title: '客户简称', hide: true} |
| | | ,{field: 'rela', align: 'center',title: '客户关系'} |
| | | ,{field: 'tel', align: 'center',title: '电话'} |
| | | ,{field: 'contacts', align: 'center',title: '客户联系人'} |
| | | ,{field: 'remarks', align: 'center',title: '备注'} |
| | | ,{field: 'remarks', align: 'center',title: '备注', hide: true} |
| | | ,{field: 'director$', align: 'center',title: '负责人'} |
| | | ,{field: 'province', align: 'center',title: '省'} |
| | | ,{field: 'city', align: 'center',title: '市'} |
| | | ,{field: 'district', align: 'center',title: '县'} |
| | | ,{field: 'town', align: 'center',title: '镇'} |
| | | ,{field: 'province', align: 'center',title: '省', hide: true} |
| | | ,{field: 'city', align: 'center',title: '市', hide: true} |
| | | ,{field: 'district', align: 'center',title: '县', hide: true} |
| | | ,{field: 'town', align: 'center',title: '镇', hide: true} |
| | | ,{field: 'addr', align: 'center',title: '详细地址'} |
| | | ,{field: 'type$', align: 'center',title: '区分'} |
| | | ,{field: 'files', align: 'center',title: '附件'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | ,{field: 'createBy$', align: 'center',title: '添加人员'} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间'} |
| | | ,{field: 'files', align: 'center',title: '附件', hide: true} |
| | | ,{field: 'status$', align: 'center',title: '状态', hide: true} |
| | | ,{field: 'createBy$', align: 'center',title: '添加人员', hide: true} |
| | | ,{field: 'createTime$', align: 'center',title: '添加时间', hide: true} |
| | | ,{field: 'updateBy$', align: 'center',title: '修改人员'} |
| | | ,{field: 'updateTime$', align: 'center',title: '修改时间'} |
| | | ,{field: 'memo', align: 'center',title: '注释'} |
| | | ,{field: 'memo', align: 'center',title: '注释', hide: true} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:120} |
| | | ]], |
| | |
| | | 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 = { |
| | | 'cstmr': exportData, |
| | | 'fields': fields |
| | | }; |
| | | $.ajax({ |
| | | url: baseUrl+"/cstmr/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; |
| | | } |
| | | }); |
| | | |
| | |
| | | // 搜索 |
| | | form.on('submit(search)', function (data) { |
| | | pageCurr = 1; |
| | | tableReload(false); |
| | | }); |
| | | |
| | | // 重置 |
| | | form.on('submit(reset)', function (data) { |
| | | pageCurr = 1; |
| | | clearFormVal($('#search-box')); |
| | | tableReload(false); |
| | | }); |
| | | |