|
@@ -37,22 +37,21 @@
|
|
|
>
|
|
>
|
|
|
删除
|
|
删除
|
|
|
</el-button>
|
|
</el-button>
|
|
|
- <!-- <el-button
|
|
|
|
|
- size="small"
|
|
|
|
|
- type="primary"
|
|
|
|
|
- icon="el-icon-upload2"
|
|
|
|
|
- class="ele-btn-icon"
|
|
|
|
|
- @click="exportProfession"
|
|
|
|
|
- plain
|
|
|
|
|
- >
|
|
|
|
|
- 导出
|
|
|
|
|
- </el-button>-->
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ icon="el-icon-upload2"
|
|
|
|
|
+ class="ele-btn-icon"
|
|
|
|
|
+ @click="exportProfession"
|
|
|
|
|
+ plain
|
|
|
|
|
+ >
|
|
|
|
|
+ 导出
|
|
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
<el-button
|
|
|
size="small"
|
|
size="small"
|
|
|
type="primary"
|
|
type="primary"
|
|
|
icon="el-icon-download"
|
|
icon="el-icon-download"
|
|
|
class="ele-btn-icon"
|
|
class="ele-btn-icon"
|
|
|
- v-if="$hasPermission('main:profession:update')"
|
|
|
|
|
@click="importProfession"
|
|
@click="importProfession"
|
|
|
plain
|
|
plain
|
|
|
>
|
|
>
|
|
@@ -127,6 +126,8 @@
|
|
|
import control from '@/api/technology/control';
|
|
import control from '@/api/technology/control';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import importDialog from '@/components/upload/import-dialogNew.vue';
|
|
import importDialog from '@/components/upload/import-dialogNew.vue';
|
|
|
|
|
+ import request from '@/utils/request';
|
|
|
|
|
+ import { download } from '@/utils/file';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'technologyProduction',
|
|
name: 'technologyProduction',
|
|
@@ -138,6 +139,7 @@
|
|
|
mixins: [dictMixins, tabMixins],
|
|
mixins: [dictMixins, tabMixins],
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ searchParams: {},
|
|
|
moduleName: 'mainProfession',
|
|
moduleName: 'mainProfession',
|
|
|
levelOptions: [
|
|
levelOptions: [
|
|
|
{
|
|
{
|
|
@@ -267,6 +269,27 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ exportProfession() {
|
|
|
|
|
+ /*const data = th;
|
|
|
|
|
+ if (!data || data === {} || !data.categoryLevelId) {
|
|
|
|
|
+ this.$message.warning('请选择物品类别');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }*/
|
|
|
|
|
+ this.exportLoading = true;
|
|
|
|
|
+ request
|
|
|
|
|
+ .post('/main/profession/export', this.searchParams, {
|
|
|
|
|
+ responseType: 'blob'
|
|
|
|
|
+ })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ download(res.data, '工种数据.xlsx');
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ console.error(e);
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.exportLoading = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
importProfession() {
|
|
importProfession() {
|
|
|
debugger;
|
|
debugger;
|
|
|
this.$refs.importDialogRef.open();
|
|
this.$refs.importDialogRef.open();
|
|
@@ -290,6 +313,7 @@
|
|
|
|
|
|
|
|
/* 刷新表格 */
|
|
/* 刷新表格 */
|
|
|
reload(where) {
|
|
reload(where) {
|
|
|
|
|
+ this.searchParams = where;
|
|
|
this.$refs.table.reload({ page: 1, where: where });
|
|
this.$refs.table.reload({ page: 1, where: where });
|
|
|
},
|
|
},
|
|
|
/* 打开编辑弹窗 */
|
|
/* 打开编辑弹窗 */
|