From 2cad2bc5be736c12d08d1eaaa89dbdd656ce1fa3 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.com> Date: Thu, 4 Nov 2021 16:12:08 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E6=B5=8B=E7=AE=A1=E7=90=86=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/epidemic/persontesting.vue | 97 +++++++++++++++----- 1 file changed, 73 insertions(+), 24 deletions(-) diff --git a/src/views/modules/epidemic/persontesting.vue b/src/views/modules/epidemic/persontesting.vue index dbde422..16b3a13 100644 --- a/src/views/modules/epidemic/persontesting.vue +++ b/src/views/modules/epidemic/persontesting.vue @@ -37,6 +37,21 @@ 核酸检测登记 + + 导出模板 + + + 信息导入 + + + {{ $t('add') }} @@ -45,31 +60,17 @@ - - - - - - - - - - - - - - @@ -100,7 +121,7 @@ import mixinViewModule from '@/mixins/view-module' import AddOrUpdate from './persontesting-add-or-update' import PersonLook from './persontesting-look' import reader from './reader' -import Cookies from "js-cookie"; +import Cookies from 'js-cookie' export default { mixins: [mixinViewModule], data () { @@ -110,11 +131,14 @@ export default { getDataListIsPage: true, deleteURL: '/custom/persontesting/v2', deleteIsBatch: true, - exportURL: '/custom/persontesting/v2/export' + exportURL: '/custom/persontesting/v2/export', + exportMoudle: '/custom/persontesting/v2/exportMoudle' }, dataForm: { id: '' }, + faultDataVisible: false, + errordataList: [], deptIdList: [], lookVisible: false @@ -127,6 +151,7 @@ export default { }, created: function () { this.getOptions() + this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/custom/persontesting/v2/importExcel?token=${Cookies.get('token')}` }, watch: { 'deptIdList': function (val) { @@ -165,15 +190,39 @@ export default { }, getOptions () { this.$http - .get(`/sys/user/deptOptions/getByLoginUser`) - .then(({ data: res }) => { - if (res.code !== 0) { - return this.$message.error(res.msg) - } - this.options = res.data.options - }) - .catch(() => { }) + .get(`/sys/user/deptOptions/getByLoginUser`) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg) + } + this.options = res.data.options + }) + .catch(() => { }) }, + upLoadFile () { + // 触发upload组件内部点击事件,弹出文件选择框 + this.$refs['upload'].$refs['upload-inner'].handleClick() + }, + errorExceed (file, fileList) { + this.$message.error('上传失败请重试') + }, + uploadSuccess (response, file, fileList) { + this.$refs.upload.clearFiles() + console.log(response) + if (response.data !== null && response.data.length > 0) { + this.faultDataVisible = true + this.errordataList = response.data + return + } + this.$message({ + message: this.$t('prompt.success'), + type: 'success', + duration: 500, + onClose: () => { + this.getDataList() + } + }) + } } }