|
@@ -80,6 +80,8 @@
|
|
|
type="primary"
|
|
type="primary"
|
|
|
size="mini"
|
|
size="mini"
|
|
|
icon="el-icon-download"
|
|
icon="el-icon-download"
|
|
|
|
|
+ @click="exportFn"
|
|
|
|
|
+ :loading="exportLoading"
|
|
|
plain
|
|
plain
|
|
|
>导出</el-button
|
|
>导出</el-button
|
|
|
>
|
|
>
|
|
@@ -445,6 +447,8 @@
|
|
|
import workmanship from './components/workmanship.vue';
|
|
import workmanship from './components/workmanship.vue';
|
|
|
import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
|
|
|
import { mapGetters } from 'vuex';
|
|
import { mapGetters } from 'vuex';
|
|
|
|
|
+ import { download } from '@/utils/file';
|
|
|
|
|
+ import request from '@/utils/request';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'bomDetailsPop',
|
|
name: 'bomDetailsPop',
|
|
@@ -470,6 +474,7 @@
|
|
|
parentId: ''
|
|
parentId: ''
|
|
|
},
|
|
},
|
|
|
processSubmitDialogFlag: false,
|
|
processSubmitDialogFlag: false,
|
|
|
|
|
+ exportLoading: false,
|
|
|
current: {},
|
|
current: {},
|
|
|
treeList: [],
|
|
treeList: [],
|
|
|
versList: [],
|
|
versList: [],
|
|
@@ -639,6 +644,28 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ exportFn() {
|
|
|
|
|
+ this.exportLoading = true;
|
|
|
|
|
+ request
|
|
|
|
|
+ .post(
|
|
|
|
|
+ '/main/bomCategory/exportBOM',
|
|
|
|
|
+ { bomCategoryId: this.treeId },
|
|
|
|
|
+ {
|
|
|
|
|
+ responseType: 'blob'
|
|
|
|
|
+ }
|
|
|
|
|
+ )
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ debugger;
|
|
|
|
|
+ download(res.data, `${this.currentNodeData.name}_BOM数据.xlsx`);
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ console.error(e);
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.exportLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
async getTreeData() {
|
|
async getTreeData() {
|
|
|
try {
|
|
try {
|
|
|
this.treeLoading = true;
|
|
this.treeLoading = true;
|