|
|
@@ -148,7 +148,7 @@
|
|
|
:http-request="uploadFile"
|
|
|
:before-upload="beforeUpload"
|
|
|
:on-change="handleChange"
|
|
|
- ref="uploadFile"
|
|
|
+ ref="uploadFile"
|
|
|
>
|
|
|
<el-button type="warning">批量导入</el-button>
|
|
|
</el-upload>
|
|
|
@@ -181,6 +181,7 @@
|
|
|
import { importFile } from '@/api/saleOrder';
|
|
|
import fileUrl from '@/assets/file/销售订单导入模板.xls';
|
|
|
import { pullSalesOrder, deleteOrder } from '@/api/saleOrder';
|
|
|
+ import { data } from 'ele-admin/lib/ele-pro-table';
|
|
|
export default {
|
|
|
props: {
|
|
|
selection: Array,
|
|
|
@@ -347,10 +348,16 @@
|
|
|
this.fileList.forEach((item) => {
|
|
|
fd.append('importExcel', item.raw);
|
|
|
});
|
|
|
- importFile(fd).then((res) => {
|
|
|
- this.$emit('search', this.where);
|
|
|
- this.$refs.uploadFile.clearFiles()
|
|
|
- });
|
|
|
+ importFile(fd)
|
|
|
+ .then((res) => {
|
|
|
+ this.$emit('search', this.where);
|
|
|
+ this.$refs.uploadFile.clearFiles();
|
|
|
+ })
|
|
|
+ .catch((data) => {
|
|
|
+ if (data.code != -1) {
|
|
|
+ this.$message.error(data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|