From 5f1d52d9607b1acde8076b24776b12c139b6ffb3 Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Thu, 28 Oct 2021 13:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B6=E5=AE=83=E5=87=BA=E5=BA=93=20?= =?UTF-8?q?=E5=AF=BC=E5=85=A5execl=20=20sxm=202021-10-28?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/common/excelUpload.vue | 22 +- .../finishedProductWarehouse/otherOut.vue | 487 ++++++++---------- src/views/modules/job/schedule.vue | 2 +- 3 files changed, 224 insertions(+), 287 deletions(-) diff --git a/src/views/modules/common/excelUpload.vue b/src/views/modules/common/excelUpload.vue index 3778ceb..d60c703 100644 --- a/src/views/modules/common/excelUpload.vue +++ b/src/views/modules/common/excelUpload.vue @@ -20,38 +20,34 @@ url: '', num: 0, successNum: 0, - fileList: [] + fileList: [], + rollList: {} } }, methods: { init (id) { - this.url = this.$http.adornUrl(`/excel/file/upload?token=${this.$cookie.get('token')}&folder=`+this.folder) - console.log(this.url) + this.url = this.$http.adornUrl(`/file/excel/upload?token=${this.$cookie.get('token')}`) this.visible = true }, // 上传之前 beforeUploadHandle (file) { - // if (file.type !== 'image/jpg' && file.type !== 'image/jpeg' && file.type !== 'image/png' && file.type !== 'image/gif') { - // this.$message.error('只支持jpg、png、gif格式的图片!') - // return false - // } + if (file.type !== "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" && file.type !== "application/vnd.ms-excel" ) { + this.$message.error('只支持xls、xlsx、格式的文件!') + return false + } this.num++ }, // 上传成功 successHandle (response, file, fileList) { - this.fileList = fileList.map(item => { - return item.response.ossEntity - }) - this.successNum++ if (response && response.code === 0) { + this.rollList = response this.childClick() } else { this.$message.error(response.msg) } }, childClick () { - // childByValue是在父组件on监听的方法 - this.$emit('childByValue', this.fileList) + this.$emit('excelUploadChild', this.rollList) } }, created() { diff --git a/src/views/modules/finishedProductWarehouse/otherOut.vue b/src/views/modules/finishedProductWarehouse/otherOut.vue index a1c5b36..90b3f53 100644 --- a/src/views/modules/finishedProductWarehouse/otherOut.vue +++ b/src/views/modules/finishedProductWarehouse/otherOut.vue @@ -2,29 +2,12 @@
- +
- {{buttons.search}} - {{buttons.defaultTable}} - - {{ buttons.settingTable}} - - - - - - - - - - - - - - + - {{ buttons.search }} + @@ -52,281 +35,239 @@ - +