From c6ccf789e98cd240f4e74ee457696c45641e750b Mon Sep 17 00:00:00 2001
From: 123456 <17862666717>
Date: Tue, 21 Jun 2022 16:49:24 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=85=A5?=
=?UTF-8?q?=E5=AF=BC=E5=87=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../point/icpointnucleicmonitoring.vue | 117 ++++++++++++++++++
.../point/icpointvaccinesinoculation.vue | 117 ++++++++++++++++++
2 files changed, 234 insertions(+)
diff --git a/src/views/modules/plugins/point/icpointnucleicmonitoring.vue b/src/views/modules/plugins/point/icpointnucleicmonitoring.vue
index 82ef3193..ae024080 100644
--- a/src/views/modules/plugins/point/icpointnucleicmonitoring.vue
+++ b/src/views/modules/plugins/point/icpointnucleicmonitoring.vue
@@ -23,6 +23,25 @@
}}
+
+ 下载核酸检测点模板
+
+
+ 导入核酸监测点数据
+
+
{
+
+ this.download(data, title + '.xls')
+ },
+ (rspMsg, data) => {
+ this.$message.error(rspMsg);
+ }
+ );
+ },
+ // 上传文件之前的钩子
+ beforeUpload (file) {
+ this.files = file;
+
+ const isText = file.type === 'application/vnd.ms-excel'
+ const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+
+ if (!isText && !isTextComputer) {
+ this.$message.error('请选择正确格式的文件')
+ this.files = null
+ this.fileName = ''
+ return false
+ } else {
+ this.fileName = file.name;
+ return true
+ }
+
+ },
+ async uploadFile () {
+
+ if (this.fileName == "") {
+ this.$message.warning('请选择要上传的文件!')
+ return false
+ }
+
+ this.$message({
+ showClose: true,
+ message: '导入中,请到系统管理-导入记录中查看进度',
+ duration: 0
+ })
+
+
+ //清空上传列表
+ 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是要传的文件名
+
+ this.$refs['upload_room'].clearFiles()
+ url = '/icPointNucleicMonitoring/pointNucleicMonitoringImport'
+ this.importRoomLoading = true
+
+ 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)
+
+ this.importRoomLoading = false
+ },
+ (rspMsg, data) => {
+ this.importRoomLoading = false
+ // this.$message.error(rspMsg)
+ }, { 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 cb5c716e..bfd6fb9d 100644
--- a/src/views/modules/plugins/point/icpointvaccinesinoculation.vue
+++ b/src/views/modules/plugins/point/icpointvaccinesinoculation.vue
@@ -23,6 +23,25 @@
}}
+
+ 下载疫苗接种点模板
+
+
+ 导入疫苗接种点数据
+
+
{
+
+ this.download(data, title + '.xls')
+ },
+ (rspMsg, data) => {
+ this.$message.error(rspMsg);
+ }
+ );
+ },
+ // 上传文件之前的钩子
+ beforeUpload (file) {
+ this.files = file;
+
+ const isText = file.type === 'application/vnd.ms-excel'
+ const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+
+ if (!isText && !isTextComputer) {
+ this.$message.error('请选择正确格式的文件')
+ this.files = null
+ this.fileName = ''
+ return false
+ } else {
+ this.fileName = file.name;
+ return true
+ }
+
+ },
+ async uploadFile () {
+
+ if (this.fileName == "") {
+ this.$message.warning('请选择要上传的文件!')
+ return false
+ }
+
+ this.$message({
+ showClose: true,
+ message: '导入中,请到系统管理-导入记录中查看进度',
+ duration: 0
+ })
+
+
+ //清空上传列表
+ 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是要传的文件名
+
+ this.$refs['upload_room'].clearFiles()
+ url = '/icPointNucleicMonitoring/pointNucleicMonitoringImport'
+ this.importRoomLoading = true
+
+ 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)
+
+ this.importRoomLoading = false
+ },
+ (rspMsg, data) => {
+ this.importRoomLoading = false
+ // this.$message.error(rspMsg)
+ }, { headers: { 'Content-Type': 'multipart/form-data' } })
+
+
+ },
+ }
};
+