|
|
@ -17,11 +17,11 @@ |
|
|
|
$t("add") |
|
|
|
}}</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="danger" @click="deleteHandle()">{{ |
|
|
|
$t("deleteBatch") |
|
|
|
}}</el-button> |
|
|
|
</el-form-item> |
|
|
|
<!--<el-form-item>--> |
|
|
|
<!--<el-button type="danger" @click="deleteHandle()">{{--> |
|
|
|
<!--$t("deleteBatch")--> |
|
|
|
<!--}}</el-button>--> |
|
|
|
<!--</el-form-item>--> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<div class="div_table"> |
|
|
@ -220,7 +220,7 @@ export default { |
|
|
|
methods: { |
|
|
|
handleExportModule() { |
|
|
|
let title = "疫苗接种点模板"; |
|
|
|
let url = "/epmetuser/icPointNucleicMonitoring/exporttemplate"; |
|
|
|
let url = "/epmetuser/icPointVaccinesInoculation/exporttemplate"; |
|
|
|
|
|
|
|
let params = {}; |
|
|
|
|
|
|
@ -235,6 +235,31 @@ export default { |
|
|
|
} |
|
|
|
); |
|
|
|
}, |
|
|
|
// 下载文件 |
|
|
|
download (data, fileName) { |
|
|
|
if (!data) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
var csvData = new Blob([data]) |
|
|
|
|
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|
|
|
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
|
|
|
} |
|
|
|
// for Non-IE (chrome, firefox etc.) |
|
|
|
else { |
|
|
|
var a = document.createElement('a'); |
|
|
|
document.body.appendChild(a); |
|
|
|
a.style = 'display: none'; |
|
|
|
var url = window.URL.createObjectURL(csvData); |
|
|
|
a.href = url; |
|
|
|
a.download = fileName; |
|
|
|
a.click(); |
|
|
|
a.remove(); |
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 上传文件之前的钩子 |
|
|
|
beforeUpload(file) { |
|
|
|
this.files = file; |
|
|
@ -254,61 +279,46 @@ export default { |
|
|
|
return true; |
|
|
|
} |
|
|
|
}, |
|
|
|
async uploadFile() { |
|
|
|
if (this.fileName == "") { |
|
|
|
this.$message.warning("请选择要上传的文件!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
async uploadFile() { |
|
|
|
if (this.fileName == "") { |
|
|
|
this.$message.warning("请选择要上传的文件!"); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: "导入中,请到系统管理-导入记录中查看进度", |
|
|
|
duration: 0, |
|
|
|
}); |
|
|
|
this.$message({ |
|
|
|
showClose: true, |
|
|
|
message: "导入中,请到系统管理-导入记录中查看进度", |
|
|
|
duration: 0, |
|
|
|
}); |
|
|
|
|
|
|
|
//清空上传列表 |
|
|
|
let url = ""; |
|
|
|
//清空上传列表 |
|
|
|
this.$refs['upload'].clearFiles(); |
|
|
|
let url = ""; |
|
|
|
|
|
|
|
let fileFormData = new FormData(); |
|
|
|
fileFormData.append("file", this.files); //filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
fileFormData.append("orgId", this.agencyObj.id); //filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
fileFormData.append( |
|
|
|
"orgType", |
|
|
|
this.agencyObj.level === "grid" ? "grid" : "agency" |
|
|
|
); //filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
let fileFormData = new FormData(); |
|
|
|
fileFormData.append("file", this.files); //filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
|
|
this.$refs["upload_room"].clearFiles(); |
|
|
|
url = "/epmetuser/icPointNucleicMonitoring/pointNucleicMonitoringImport"; |
|
|
|
this.importRoomLoading = true; |
|
|
|
url = "/epmetuser/icPointVaccinesInoculation/pointNucleicMonitoringImport"; |
|
|
|
|
|
|
|
window.app.ajax.post2( |
|
|
|
url, |
|
|
|
fileFormData, |
|
|
|
(data, rspMsg) => { |
|
|
|
if (data.code === 0 && data.msg == "success") { |
|
|
|
// this.$message.success('导入成功') |
|
|
|
} else { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// message: rspMsg, |
|
|
|
// duration: 0, |
|
|
|
// type: "error" |
|
|
|
// }) |
|
|
|
// this.$message.error(rspMsg) |
|
|
|
} |
|
|
|
this.$emit("refreshTree"); |
|
|
|
this.loadTable(); |
|
|
|
// this.showMessage(rspMsg) |
|
|
|
window.app.ajax.post2(url,fileFormData,(data, rspMsg) => { |
|
|
|
if (data.code === 0 && data.msg == "success") { |
|
|
|
// this.$message.success('导入成功') |
|
|
|
} else { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
|
// message: rspMsg, |
|
|
|
// duration: 0, |
|
|
|
// type: "error" |
|
|
|
// }) |
|
|
|
// this.$message.error(rspMsg) |
|
|
|
} |
|
|
|
this.loadTable(); |
|
|
|
|
|
|
|
this.importRoomLoading = false; |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.importRoomLoading = false; |
|
|
|
// this.$message.error(rspMsg) |
|
|
|
}, |
|
|
|
{ headers: { "Content-Type": "multipart/form-data" } } |
|
|
|
); |
|
|
|
}, |
|
|
|
}, |
|
|
|
(rspMsg, data) => {}, |
|
|
|
{ headers: { "Content-Type": "multipart/form-data" } } |
|
|
|
); |
|
|
|
} |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|