| | |
| | | break |
| | | case 2: |
| | | // 导入 Excel |
| | | let arrFileHandle = await window.showOpenFilePicker() |
| | | let file = await arrFileHandle[0].getFile(); |
| | | upload(file); |
| | | $("#importExcel").trigger("click"); |
| | | // let arrFileHandle = await window.showOpenFilePicker() |
| | | // let file = await arrFileHandle[0].getFile(); |
| | | // upload(file); |
| | | break |
| | | case 3: |
| | | // 导出 Excel |
| | |
| | | {type: 'checkbox'} |
| | | // ,{field: 'id', align: 'center',title: 'ID'} |
| | | // ,{field: 'hostId$', align: 'center',title: '所属商户'} |
| | | ,{field: 'name', align: 'left',title: '客户名称', style: 'color: #1890ff;cursor:pointer', event: 'more'} |
| | | ,{field: 'name', align: 'left',title: '客户名称', style: 'color: #1890ff;cursor:pointer', event: 'more', width: 350} |
| | | ,{field: 'uuid', align: 'left',title: '客户代号'} |
| | | ,{field: 'addr', align: 'left',title: '详细地址', templet:function(d){return emptyShow(d.addr)}} |
| | | ,{field: 'tel', align: 'left',title: '电话', templet:function(d){return emptyShow(d.tel)}} |
| | |
| | | } |
| | | } |
| | | |
| | | function upload(file){ |
| | | if(!file) { |
| | | function upload(obj){ |
| | | if(!obj.files) { |
| | | return; |
| | | } |
| | | var file = obj.files[0]; |
| | | admin.confirm('确认同步 [' + file.name +'] 文件吗?', function (index) { |
| | | layer.load(1, {shade: [0.1,'#fff']}); |
| | | var url = baseUrl + "/cstmr/excel/import/auth"; |
| | |
| | | let res = JSON.parse(evt.target.responseText); |
| | | if(res.code === 200) { |
| | | layer.msg(res.msg, {icon: 1}); |
| | | tableIns.refresh(); |
| | | tableReload(); |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | alert(res.msg); |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | function uploadFailed(evt) { |
| | | let res = JSON.parse(evt.target.responseText); |
| | | layer.msg(res.msg, {icon: 2}); |
| | | alert(res.msg); |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | } |