diff --git a/src/views/modules/plugins/point/icpointnucleicmonitoring-add-or-update.vue b/src/views/modules/plugins/point/icpointnucleicmonitoring-add-or-update.vue index dcf0a84a..98ae2884 100644 --- a/src/views/modules/plugins/point/icpointnucleicmonitoring-add-or-update.vue +++ b/src/views/modules/plugins/point/icpointnucleicmonitoring-add-or-update.vue @@ -11,10 +11,11 @@ @@ -201,7 +202,7 @@ export default { }; }, }, - mounted() { + created() { this.getFormInfo(); this.initMap(); }, @@ -333,7 +334,7 @@ export default { } }); }, - + // 获取信息 getInfo() { console.log(111111); diff --git a/src/views/modules/plugins/point/icpointnucleicmonitoring.vue b/src/views/modules/plugins/point/icpointnucleicmonitoring.vue index 9871c6c5..eb39591a 100644 --- a/src/views/modules/plugins/point/icpointnucleicmonitoring.vue +++ b/src/views/modules/plugins/point/icpointnucleicmonitoring.vue @@ -17,11 +17,11 @@ $t("add") }} - - {{ - $t("deleteBatch") - }} - + + + + + @@ -37,7 +37,7 @@ { + window.app.ajax.post2(url,fileFormData,(data, rspMsg) => { if (data.code === 0 && data.msg == "success") { // this.$message.success('导入成功') } else { @@ -255,16 +271,10 @@ export default { // }) // this.$message.error(rspMsg) } - this.$emit("refreshTree"); this.loadTable(); - // this.showMessage(rspMsg) - this.importRoomLoading = false; - }, - (rspMsg, data) => { - this.importRoomLoading = false; - // this.$message.error(rspMsg) }, + (rspMsg, data) => {}, { headers: { "Content-Type": "multipart/form-data" } } ); }, diff --git a/src/views/modules/plugins/point/icpointvaccinesinoculation.vue b/src/views/modules/plugins/point/icpointvaccinesinoculation.vue index d2ba6ee7..9668e34f 100644 --- a/src/views/modules/plugins/point/icpointvaccinesinoculation.vue +++ b/src/views/modules/plugins/point/icpointvaccinesinoculation.vue @@ -17,11 +17,11 @@ $t("add") }} - - {{ - $t("deleteBatch") - }} - + + + + +
@@ -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" } } + ); + } }, };