|
@ -6,6 +6,31 @@
|
|
|
<link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
|
|
|
<link href="${ctx}/static/desizenMan/css/bootstrap-treeview.min.css" rel="stylesheet" />
|
|
|
<style type="text/css">
|
|
|
.flex{
|
|
|
display:-webkit-box;
|
|
|
display:-webkit-flex;
|
|
|
display:flex;
|
|
|
}
|
|
|
.flex-sp-b{
|
|
|
justify-content: space-between;
|
|
|
-webkit-justify-content: space-between;
|
|
|
}
|
|
|
.flex-sp-a{
|
|
|
justify-content: space-around;
|
|
|
-webkit-justify-content: space-around;
|
|
|
}
|
|
|
.flex-sp-c{
|
|
|
justify-content: center;
|
|
|
-webkit-justify-content: center;
|
|
|
}
|
|
|
.flex-sp-end{
|
|
|
justify-content: flex-end;
|
|
|
-webkit-justify-content: flex-end;
|
|
|
}
|
|
|
.flex-cz-c{
|
|
|
-webkit-align-items:center;
|
|
|
align-items:center;
|
|
|
}
|
|
|
.icon{width: 20px;height: 20px;vertical-align: sub;background-size: 100% 100%;background-repeat: no-repeat;display: inline-block;}
|
|
|
.icon15{width: 15px;height: 15px;}
|
|
|
.icon30{width: 30px;height: 30px;}
|
|
@ -61,9 +86,96 @@
|
|
|
.webuploader-pick{
|
|
|
display: initial;background-color: transparent;
|
|
|
}
|
|
|
.lay-box-3 .lay{
|
|
|
width: 420px!important;
|
|
|
height: 260px;
|
|
|
}
|
|
|
.lay-box-3 .lay .title{
|
|
|
width: 100%;
|
|
|
}
|
|
|
.lay-box-3 .lay .file{
|
|
|
width: 370px;height: 30px;margin: 20px auto;position: relative;
|
|
|
}
|
|
|
.lay-box-3 .lay .file span{
|
|
|
font-size: 12px;color: #333;
|
|
|
}
|
|
|
.lay-box-3 .lay .file input:nth-of-type(1){
|
|
|
width: 200px;height: 30px;border: solid 1px #d0d0d0;background-color: #fff!important;
|
|
|
}
|
|
|
.lay-box-3 .lay .file input:nth-of-type(2){
|
|
|
width: 90px;
|
|
|
height: 30px;
|
|
|
background-color: #2d9bd2;
|
|
|
border-radius: 2px;
|
|
|
font-size: 12px;
|
|
|
color: #fff;
|
|
|
opacity: 0;
|
|
|
z-index: 99;
|
|
|
}
|
|
|
.lay-box-3 .lay .file button{
|
|
|
width: 90px;
|
|
|
height: 30px;
|
|
|
background-color: #2d9bd2;
|
|
|
border: none;
|
|
|
border-radius: 2px;
|
|
|
font-size: 12px;
|
|
|
color: #fff;
|
|
|
position: absolute;
|
|
|
right: 0;
|
|
|
z-index: 1;
|
|
|
}
|
|
|
.lay-box-3 .lay a{
|
|
|
display: block;
|
|
|
margin-left: 87px;
|
|
|
font-size: 12px;color: #2d9bd2;
|
|
|
}
|
|
|
.lay-box-3 .lay p {
|
|
|
font-size: 12px;color: #eb4b3c;text-align: center;
|
|
|
}
|
|
|
.lay-box-3 .lay .lay-button{
|
|
|
text-align: center;margin-top: 40px;
|
|
|
}
|
|
|
.lay-box-3 .lay .lay-button button{
|
|
|
width: 99px;
|
|
|
height: 35px;
|
|
|
background-color: #2d9bd2;
|
|
|
border-radius: 2px;
|
|
|
border: none;
|
|
|
color:#fff;
|
|
|
font-size: 14px;
|
|
|
}
|
|
|
.lay-box-3 .lay .lay-button button:nth-of-type(2){
|
|
|
background-color: #b9c8d2;
|
|
|
}
|
|
|
.lay .title{
|
|
|
width: 680px;height: 40px;line-height: 40px;background-color: #fff;background-color: #2d9bd2;
|
|
|
font-size: 14px;color: #fff;padding-left: 20px;padding-right: 10px;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="lay-box-3-1" style="display:none">
|
|
|
<div class="lay-box-3">
|
|
|
<div class="lay">
|
|
|
<div class="title flex flex-sp-b flex-cz-c">
|
|
|
<span>批量导入</span>
|
|
|
<img class="closePage" src="${ctx}/static/specialty/images/Close_btn.png" alt="">
|
|
|
</div>
|
|
|
<div class="file flex flex-sp-b flex-cz-c">
|
|
|
<span>导入文件:</span>
|
|
|
<input type="text" class="fileName" disabled>
|
|
|
<input id="uploadfile" type="file" value="选择" onchange="auploadFile(event)">
|
|
|
<button>选择</button>
|
|
|
</div>
|
|
|
<a href="">模板下载</a>
|
|
|
<p>请核对导入数据,若导入项目信息已存在,将会更新项目表中的数据。</p>
|
|
|
<div class="lay-button">
|
|
|
<button onclick="submitFile()">确认</button>
|
|
|
<button>取消</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="operation-box clearfix">
|
|
|
<div class="pull-left">
|
|
|
<div class="form-inline">
|
|
@ -673,36 +785,57 @@
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
// 上传文件
|
|
|
var uploader = $("#btn_import").webupload({
|
|
|
server: ctx + "/admin/specialist/hospitalServiceItem/importData",
|
|
|
pick: {id: '#div_file_picker'},
|
|
|
accept: {
|
|
|
title: 'Excel',
|
|
|
extensions: 'xls',
|
|
|
mimeTypes: '.xls'
|
|
|
},
|
|
|
auto: true
|
|
|
});
|
|
|
uploader.on('beforeSend', function (file, data, headers) {
|
|
|
console.log(file, data, headers)
|
|
|
});
|
|
|
|
|
|
uploader.on('uploadProgress', function (file, percentage) {
|
|
|
console.log('正在保存中,请稍候...')
|
|
|
$.ligerDialog.waitting('正在保存中,请稍候...');
|
|
|
});
|
|
|
uploader.on('uploadError', function (file) {
|
|
|
console.log(file);
|
|
|
$.ligerDialog.closeWaitting();
|
|
|
$.Notice.error("上传失败!");
|
|
|
});
|
|
|
|
|
|
uploader.on('uploadSuccess', function (file, resp) {
|
|
|
console.log(file, resp)
|
|
|
$.ligerDialog.closeWaitting();
|
|
|
$.Notice.success("上传成功。");
|
|
|
});
|
|
|
// 选择上传文件
|
|
|
function auploadFile(e){
|
|
|
console.log(e);
|
|
|
var file = ''
|
|
|
var arr =e.target && e.target.files;
|
|
|
file= arr[0].name
|
|
|
console.log(file)
|
|
|
$('.fileName').val(file)
|
|
|
}
|
|
|
// 上传文件
|
|
|
function submitFile(){
|
|
|
debugger
|
|
|
var file = document.getElementById("uploadfile").files[0];
|
|
|
var _formData = new FormData()
|
|
|
_formData.append('file', file)
|
|
|
console.log(_formData)
|
|
|
$.ajax({
|
|
|
url: ctx + "/admin/specialist/hospitalServiceItem/importData",
|
|
|
method: "POST",
|
|
|
dataType: "json",
|
|
|
async: true,
|
|
|
contentType: false,
|
|
|
cache: false,
|
|
|
processData: false,
|
|
|
data: _formData,
|
|
|
success:function (res) {
|
|
|
console.log(res)
|
|
|
if (res.status == 200){
|
|
|
layer.alert('操作成功!', {
|
|
|
icon: 1,
|
|
|
},function () {
|
|
|
layer.closeAll();
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
$('#div_file_picker').on('click',function(){
|
|
|
layer.open({
|
|
|
offset: '240px',
|
|
|
type:1,
|
|
|
title:'',
|
|
|
closeBtn:false,
|
|
|
content: $('.lay-box-3-1').html(),
|
|
|
area: ['420px', '260px']
|
|
|
})
|
|
|
})
|
|
|
// 关闭弹窗
|
|
|
$(document).on('click','.closePage',function () {
|
|
|
layer.closeAll()
|
|
|
})
|
|
|
</script>
|
|
|
</body>
|
|
|
</html>
|