...
|
...
|
@@ -49,7 +49,9 @@ |
|
|
:on-progress="onProgress">
|
|
|
<Button type="ghost">浏览</Button>
|
|
|
</XlsxUpload>
|
|
|
<a @click="download">下载 Excel 模板</a>
|
|
|
</FilterItem>
|
|
|
|
|
|
<FilterItem>
|
|
|
<Button type="primary" @click="upload">开始上传</Button>
|
|
|
</FilterItem>
|
...
|
...
|
@@ -59,6 +61,7 @@ |
|
|
|
|
|
<script>
|
|
|
import {SelectCategory, SelectBrand} from 'components/select';
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
export default {
|
|
|
data() {
|
...
|
...
|
@@ -134,13 +137,25 @@ |
|
|
upload() {
|
|
|
this.$refs.xlsxUpload.upload({brandId: this.brandId});
|
|
|
},
|
|
|
onSuccess() {
|
|
|
onSuccess(data) {
|
|
|
if (data.code === 200) {
|
|
|
if (_.has(data.data, 'failFileReason')) {
|
|
|
this.$Message.error('部分导入成功');
|
|
|
} else {
|
|
|
this.$Message.info('全部导入成功');
|
|
|
}
|
|
|
} else {
|
|
|
this.$Message.error('导入失败');
|
|
|
}
|
|
|
},
|
|
|
onError() {
|
|
|
|
|
|
},
|
|
|
onProgress() {
|
|
|
|
|
|
},
|
|
|
download() {
|
|
|
window.open('/Api/platform/downloadFile', '_blank');
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
|