Showing
1 changed file
with
39 additions
and
35 deletions
| ... | @@ -100,13 +100,13 @@ export default { | ... | @@ -100,13 +100,13 @@ export default { |
| 100 | trigger: "change", | 100 | trigger: "change", |
| 101 | }, | 101 | }, |
| 102 | ], | 102 | ], |
| 103 | - file: [ | 103 | + // file: [ |
| 104 | - { | 104 | + // { |
| 105 | - required: true, | 105 | + // required: true, |
| 106 | - message: "文件不能为空", | 106 | + // message: "文件不能为空", |
| 107 | - trigger: "change", | 107 | + // trigger: "change", |
| 108 | - }, | 108 | + // }, |
| 109 | - ] | 109 | + // ] |
| 110 | }, | 110 | }, |
| 111 | fileList: [], | 111 | fileList: [], |
| 112 | errorData: [], | 112 | errorData: [], |
| ... | @@ -176,37 +176,41 @@ export default { | ... | @@ -176,37 +176,41 @@ export default { |
| 176 | }, | 176 | }, |
| 177 | //导入Excel | 177 | //导入Excel |
| 178 | upload() { | 178 | upload() { |
| 179 | - this.$refs['addForm'].validate(val => { | 179 | + if (this.formData.file != null && this.formData.file != '') { |
| 180 | - if (val) { | 180 | + this.$refs['addForm'].validate(val => { |
| 181 | - const file = this.formData.file; | 181 | + if (val) { |
| 182 | - let goodsStation = this.formData.uploadGoodsStation | 182 | + const file = this.formData.file; |
| 183 | - this.loading = true; | 183 | + let goodsStation = this.formData.uploadGoodsStation |
| 184 | - uploadGoodsExcel(file, goodsStation).then((res) => { | 184 | + this.loading = true; |
| 185 | - this.loading = false; | 185 | + uploadGoodsExcel(file, goodsStation).then((res) => { |
| 186 | - if (res.code != 200) { | 186 | + this.loading = false; |
| 187 | - if (res.code == 603) { | 187 | + if (res.code != 200) { |
| 188 | - this.$alert(res.msg, "提示", { | 188 | + if (res.code == 603) { |
| 189 | - confirmButtonText: "确定", | 189 | + this.$alert(res.msg, "提示", { |
| 190 | - type: "warning", | 190 | + confirmButtonText: "确定", |
| 191 | - }); | 191 | + type: "warning", |
| 192 | - } else if (res.code === 201) { | 192 | + }); |
| 193 | - this.$message.warning(res.msg); | 193 | + } else if (res.code === 201) { |
| 194 | - if (res.data) { | 194 | + this.$message.warning(res.msg); |
| 195 | - this.errorData = res.data; | 195 | + if (res.data) { |
| 196 | - this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } }) | 196 | + this.errorData = res.data; |
| 197 | + this.$router.push({ name: 'UpDateResult', params: { data: this.errorData, from: 'FlightInformationImport' } }) | ||
| 198 | + } | ||
| 199 | + } else { | ||
| 200 | + this.$message.warning(res.msg); | ||
| 197 | } | 201 | } |
| 198 | } else { | 202 | } else { |
| 199 | - this.$message.warning(res.msg); | 203 | + this.$message.success(res.msg); |
| 200 | } | 204 | } |
| 201 | - } else { | 205 | + setTimeout(() => { |
| 202 | - this.$message.success(res.msg); | 206 | + this.close() |
| 203 | - } | 207 | + }, 1000); |
| 204 | - setTimeout(() => { | 208 | + }); |
| 205 | - this.close() | 209 | + } |
| 206 | - }, 1000); | 210 | + }) |
| 207 | - }); | 211 | + } else { |
| 208 | - } | 212 | + this.msgWarning('请选择文件后再导入!') |
| 209 | - }) | 213 | + } |
| 210 | }, | 214 | }, |
| 211 | //导出Excel | 215 | //导出Excel |
| 212 | download() { | 216 | download() { | ... | ... |
-
Please register or login to post a comment