From 6769be9bc24d950c6f8739bf7adab69a5e54f9db Mon Sep 17 00:00:00 2001 From: jiangyy Date: Tue, 29 Mar 2022 10:39:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B8=E9=85=B8=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/epidemic/natInfo/natForm.vue | 15 +++-- .../modules/base/epidemic/natInfo/natList.vue | 30 +++++---- .../base/epidemic/veroFocus/veroFocusAdd.vue | 41 ++++++------- .../base/epidemic/veroFocus/veroFocusEdit.vue | 2 +- .../base/epidemic/veroFocus/veroFocusList.vue | 61 +++++++++++-------- .../base/epidemic/veroFocus/vfNoticeList.vue | 2 +- .../base/epidemic/veroFocus/vfSendNotice.vue | 2 +- 7 files changed, 81 insertions(+), 72 deletions(-) diff --git a/src/views/modules/base/epidemic/natInfo/natForm.vue b/src/views/modules/base/epidemic/natInfo/natForm.vue index f332062a..3f381f9e 100644 --- a/src/views/modules/base/epidemic/natInfo/natForm.vue +++ b/src/views/modules/base/epidemic/natInfo/natForm.vue @@ -149,8 +149,10 @@ :before-upload="beforeUpload" :on-change="handleEditChange" :file-list="fileList"> - -
+
请选择1张图片,只能上传jpg、png、gif格式
@@ -261,7 +263,6 @@ export default { async mounted () { const { user } = this.$store.state this.agencyId = user.agencyId - this.formData.agencyId = user.agencyId //获取网格下拉框数据 await this.loadGrid() }, @@ -269,7 +270,9 @@ export default { methods: { async initForm (type, icNatId) { - this.startLoading() + + this.formData.agencyId = this.agencyId + this.$refs['ref_form'].resetFields(); this.formType = type @@ -280,7 +283,7 @@ export default { this.isFromResi = false await this.loadFormData() } - this.endLoading() + }, @@ -469,7 +472,7 @@ export default { // if (!isLt1M) { // this.$message.error('上传文件大小不能超过 5MB!') // } - return isLt1M + // return isLt1M }, diff --git a/src/views/modules/base/epidemic/natInfo/natList.vue b/src/views/modules/base/epidemic/natInfo/natList.vue index 5057e6a4..f81b2305 100644 --- a/src/views/modules/base/epidemic/natInfo/natList.vue +++ b/src/views/modules/base/epidemic/natInfo/natList.vue @@ -94,7 +94,7 @@ :show-file-list='false' :before-upload="beforeUpload" action="" - accept=".xls,.xlsx" + accept=".xlsx" :limit="1" :on-exceed="handleExceed" :http-request="uploadFile"> @@ -512,7 +512,8 @@ export default { this.formData, (data, rspMsg) => { - this.download(data, title + '.xls') + + this.download(data, title + '.xlsx') }, (rspMsg, data) => { this.$message.error(rspMsg); @@ -558,7 +559,7 @@ export default { params, (data, rspMsg) => { - this.download(data, title + '.xls') + this.download(data, title + '.xlsx') }, (rspMsg, data) => { this.$message.error(rspMsg); @@ -568,15 +569,15 @@ export default { // 上传文件之前的钩子 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('请选择正确格式的文件') + const array = file.name.split('.') + const extension = array[array.length - 1] + // const isLt1M = (file.size / 1024 / 1024) < 5 + if (extension !== 'xlsx') { + this.$message.error('只能上传xlsx文件!') return false } else { + this.files = file; this.fileName = file.name; return true } @@ -607,8 +608,6 @@ export default { let fileFormData = new FormData(); fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 - - this.importRoomLoading = true window.app.ajax.post2(url, fileFormData, (data, rspMsg) => { @@ -623,18 +622,17 @@ export default { // }) // this.$message.error(rspMsg) } - this.$emit('refreshTree') - this.loadTable() - this.importRoomLoading = false + + // this.loadTable() + }, (rspMsg, data) => { - this.importRoomLoading = false + }, { headers: { 'Content-Type': 'multipart/form-data' } }) }, - // 开启加载动画 startLoading () { loading = Loading.service({ diff --git a/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue b/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue index 8fdcfb3e..33c3e417 100644 --- a/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue +++ b/src/views/modules/base/epidemic/veroFocus/veroFocusAdd.vue @@ -1,5 +1,5 @@