| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <template>
- <div>
- <boat-search @search="reload" ref="searchRef"> </boat-search>
- <!-- 数据表格 -->
- <ele-pro-table
- ref="table"
- :columns="columns"
- :datasource="datasource"
- height="calc(100vh - 265px)"
- full-height="calc(100vh - 116px)"
- tool-class="ele-toolbar-form"
- cache-key="systemOrgUserTable"
- >
- <!-- 表头工具栏 -->
- <template v-slot:toolbar>
- <el-button
- size="small"
- type="primary"
- icon="el-icon-download"
- class="ele-btn-icon"
- @click="btnExport"
- >
- 导出
- </el-button>
- </template>
- <!-- 编码列 -->
- <template v-slot:code="{ row }">
- <el-link @click="details(row)" type="primary" :underline="false">
- {{ row.code }}
- </el-link>
- </template>
- </ele-pro-table>
- </div>
- </template>
- <script>
- import BoatSearch from './boat-search.vue';
- import { getBoatList, downloadCategory } from '@/api/ledgerAssets';
- // import { downloadAction } from '@/api/flowable/manage';
- import dictMixins from '@/mixins/dictMixins';
- export default {
- mixins: [dictMixins],
- components: { BoatSearch },
- props: {
- // 类别id
- categoryId: [Number, String],
- rootId: [Number, String]
- },
- data() {
- return {
- // 表格列配置
- columns: [
- {
- columnKey: 'index',
- type: 'index',
- label: '序号',
- width: 55,
- align: 'center',
- showOverflowTooltip: true,
- fixed: 'left'
- },
- {
- prop: 'code',
- label: '类别编码',
- showOverflowTooltip: true,
- minWidth: 110,
- slot: 'code'
- },
- {
- prop: 'name',
- label: '类别名称',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'module',
- label: '型号',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'specification',
- label: '规格',
- showOverflowTooltip: true,
- minWidth: 110
- },
- // {
- // prop: 'angle',
- // label: '角度',
- // showOverflowTooltip: true,
- // minWidth: 110,
- // formatter: (row) => {
- // return this.getDictValue('角度', row.detail.angle);
- // }
- // },
- // {
- // prop: 'width',
- // label: '长*宽*高',
- // showOverflowTooltip: true,
- // minWidth: 200,
- // formatter: (row) => {
- // return (
- // row.detail.palletLen +
- // ' * ' +
- // row.detail.wilde +
- // ' * ' +
- // row.detail.hight
- // );
- // }
- // },
- {
- prop: 'categoryLevelPath',
- label: '分类',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'inUseSum',
- label: '在用',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'inLibrarySum',
- label: '在库',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'consumeSum',
- label: '消耗',
- showOverflowTooltip: true,
- minWidth: 110
- },
- {
- prop: 'totalSum',
- label: '总数量',
- showOverflowTooltip: true,
- minWidth: 110
- }
- ]
- };
- },
- created() {
- this.requestDict('角度');
- },
- methods: {
- /* 表格数据源 */
- datasource({ page, limit, where, order }) {
- return getBoatList({
- ...where,
- ...order,
- pageNum: page,
- size: limit,
- categoryLevelId: this.categoryId,
- rootCategoryLevelId: this.rootId
- });
- },
- /* 刷新表格 */
- reload(where) {
- this.$refs.table.reload({ pageNum: 1, where: where });
- },
- // 跳转到详情页
- details({ id }) {
- this.$router.push({
- path: '/ledgerAssets/boat/detail',
- query: {
- id
- }
- });
- },
- // 导出
- btnExport() {
- let params = {
- ...this.$refs.searchRef.where,
- exportType: 1,
- categoryLevelId: this.categoryId,
- rootCategoryLevelId: this.rootId
- };
- downloadCategory(params, '舟皿台账导出数据');
- }
- },
- watch: {
- // 监听类别id变化
- categoryId() {
- this.reload();
- }
- }
- };
- </script>
|