|
|
@@ -1,10 +1,6 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <user-search
|
|
|
- ref="searchRef"
|
|
|
- @search="reload"
|
|
|
- :isConsumer="isConsumer"
|
|
|
- >
|
|
|
+ <user-search ref="searchRef" @search="reload" :isConsumer="isConsumer">
|
|
|
</user-search>
|
|
|
<!-- 数据表格 -->
|
|
|
<ele-pro-table
|
|
|
@@ -18,16 +14,16 @@
|
|
|
>
|
|
|
<!-- 表头工具栏 -->
|
|
|
<template v-slot:toolbar>
|
|
|
- <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
|
|
|
- <el-button
|
|
|
- size="small"
|
|
|
- type="primary"
|
|
|
- icon="el-icon-download"
|
|
|
- class="ele-btn-icon"
|
|
|
- @click="btnExport"
|
|
|
- >
|
|
|
- 导出
|
|
|
- </el-button>
|
|
|
+ <el-checkbox v-model="isConsumer">显示已消耗</el-checkbox>
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ icon="el-icon-download"
|
|
|
+ class="ele-btn-icon"
|
|
|
+ @click="btnExport"
|
|
|
+ >
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
|
|
|
<!-- 编码列 -->
|
|
|
@@ -71,18 +67,23 @@
|
|
|
|
|
|
<script>
|
|
|
import UserSearch from './user-search.vue';
|
|
|
- import {
|
|
|
- getAssetList,
|
|
|
- downloadAsset
|
|
|
- } from '@/api/ledgerAssets';
|
|
|
+ import { getAssetList, downloadAsset } from '@/api/ledgerAssets';
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
+ import axios from 'axios';
|
|
|
+ import {
|
|
|
+ API_BASE_URL,
|
|
|
+ TOKEN_HEADER_NAME,
|
|
|
+ LAYOUT_PATH
|
|
|
+ } from '@/config/setting';
|
|
|
+ import { download } from '@/utils/file';
|
|
|
+ import { getToken, setToken } from '@/utils/token-util';
|
|
|
export default {
|
|
|
components: { UserSearch },
|
|
|
mixins: [dictMixins],
|
|
|
props: {
|
|
|
// 类别id
|
|
|
categoryId: [Number, String],
|
|
|
- rootId: [Number, String],
|
|
|
+ rootId: [Number, String]
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -129,14 +130,14 @@
|
|
|
label: '牌号',
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110,
|
|
|
- slot:'brandNum'
|
|
|
+ slot: 'brandNum'
|
|
|
},
|
|
|
{
|
|
|
prop: 'modelType',
|
|
|
label: '型号',
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110,
|
|
|
- slot:'modelType'
|
|
|
+ slot: 'modelType'
|
|
|
},
|
|
|
{
|
|
|
prop: 'categoryLevelPath',
|
|
|
@@ -157,7 +158,7 @@
|
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110,
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
- return this.getDictValue('生命周期', _row.position[0].type)
|
|
|
+ return this.getDictValue('生命周期', _row.position[0].type);
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
@@ -171,10 +172,10 @@
|
|
|
fixed: 'right'
|
|
|
}
|
|
|
],
|
|
|
- isConsumer:false
|
|
|
+ isConsumer: false
|
|
|
};
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.requestDict('生命周期');
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -195,35 +196,45 @@
|
|
|
},
|
|
|
|
|
|
// 跳转到详情页
|
|
|
- details ({ id }) {
|
|
|
+ details({ id }) {
|
|
|
this.$router.push({
|
|
|
path: '/ledgerAssets/mould/detail',
|
|
|
query: {
|
|
|
id
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 跳转到编辑页
|
|
|
- goEdit ({ id }) {
|
|
|
+ goEdit({ id }) {
|
|
|
this.$router.push({
|
|
|
path: '/ledgerAssets/mould/edit',
|
|
|
query: {
|
|
|
id
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
// 导出
|
|
|
btnExport() {
|
|
|
let params = {
|
|
|
...this.$refs.searchRef.where,
|
|
|
- exportType:3,
|
|
|
+ exportType: 3,
|
|
|
categoryLevelId: this.categoryId,
|
|
|
- rootCategoryLevelId:this.rootId
|
|
|
- }
|
|
|
- downloadAsset(params, '模具台账导出数据');
|
|
|
- },
|
|
|
-
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
+ };
|
|
|
+ // downloadAsset(params, '模具台账导出数据');
|
|
|
+ axios({
|
|
|
+ url: `${API_BASE_URL}/main/asset/page/export`,
|
|
|
+ method: 'post',
|
|
|
+ responseType: 'blob',
|
|
|
+ headers: {
|
|
|
+ Authorization: getToken()
|
|
|
+ },
|
|
|
+ data: params
|
|
|
+ }).then((res) => {
|
|
|
+ download(res.data, '仪表计量台账导出数据');
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
// 监听类别id变化
|
|
|
@@ -234,7 +245,7 @@
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- .ele-btn-icon{
|
|
|
- margin-left: 20px;
|
|
|
- }
|
|
|
+ .ele-btn-icon {
|
|
|
+ margin-left: 20px;
|
|
|
+ }
|
|
|
</style>
|