jinhui.wang

白名单导入校验修改

...@@ -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,6 +176,7 @@ export default { ...@@ -176,6 +176,7 @@ export default {
176 }, 176 },
177 //导入Excel 177 //导入Excel
178 upload() { 178 upload() {
179 + if (this.formData.file != null && this.formData.file != '') {
179 this.$refs['addForm'].validate(val => { 180 this.$refs['addForm'].validate(val => {
180 if (val) { 181 if (val) {
181 const file = this.formData.file; 182 const file = this.formData.file;
...@@ -207,6 +208,9 @@ export default { ...@@ -207,6 +208,9 @@ export default {
207 }); 208 });
208 } 209 }
209 }) 210 })
211 + } else {
212 + this.msgWarning('请选择文件后再导入!')
213 + }
210 }, 214 },
211 //导出Excel 215 //导出Excel
212 download() { 216 download() {
......