|
|
@@ -79,7 +79,8 @@
|
|
|
type="warning"
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
- @click="handleExport"
|
|
|
+ @click="handleExport()"
|
|
|
+ :loading="exportLoading"
|
|
|
>导出</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
@@ -306,6 +307,8 @@
|
|
|
import DialogMoveTo from './DialogMoveTo.vue';
|
|
|
import tabMixins from '@/mixins/tableColumnsMixin';
|
|
|
import { produceTypeList } from '@/enum/dict.js';
|
|
|
+ import request from '@/utils/request';
|
|
|
+ import { download } from '@/utils/file';
|
|
|
const attributeList = [
|
|
|
{
|
|
|
label: '总装',
|
|
|
@@ -377,6 +380,7 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ exportLoading: false,
|
|
|
moudleName: 'mainCategory',
|
|
|
|
|
|
errorData: [],
|
|
|
@@ -844,8 +848,29 @@
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- exportFile(this.whereData);
|
|
|
- console.log(this.whereData, 'whereForm');
|
|
|
+ debugger;
|
|
|
+ const data = this.whereData;
|
|
|
+ if (!data || data === {} || !data.categoryLevelId) {
|
|
|
+ this.$message.warning('请选择物品类别');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.exportLoading = true;
|
|
|
+ request
|
|
|
+ .post('/main/category/export', data, {
|
|
|
+ responseType: 'blob'
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ debugger;
|
|
|
+ download(res.data, '产品/物品数据.xlsx');
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ console.error(e);
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.exportLoading = false;
|
|
|
+ });
|
|
|
+ /*exportFile(this.whereData);
|
|
|
+ console.log(this.whereData, 'whereForm');*/
|
|
|
},
|
|
|
/** 下载模板操作 */
|
|
|
importTemplate() {
|