|
|
@@ -1,144 +1,139 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
- <dryArea-search
|
|
|
- @search="reload"
|
|
|
- ref="searchRef"
|
|
|
- >
|
|
|
+ <dryArea-search @search="reload" ref="searchRef">
|
|
|
</dryArea-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"
|
|
|
- >
|
|
|
+ <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 size="small" type="primary" icon="el-icon-plus" class="ele-btn-icon" @click="openEdit()">
|
|
|
+ 新增
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<!-- 编码列 -->
|
|
|
- <template v-slot:code="{ row }">
|
|
|
- <el-link @click="details(row)" type="primary" :underline="false">
|
|
|
- {{ row.code }}
|
|
|
- </el-link>
|
|
|
+ <template v-slot:status="{ row }">
|
|
|
+ <!-- 0空闲1占用 -->
|
|
|
+ {{ row.status == 0 ? '空闲' : row.status == 1 ? '占用' : '' }}
|
|
|
</template>
|
|
|
</ele-pro-table>
|
|
|
+
|
|
|
+ <user-edit :visible.sync="showEdit" :data="current" @done="reload" ref="userEdit" />
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import dryAreaSearch from './dryArea-search.vue';
|
|
|
- import { getBoatList } from '@/api/ledgerAssets';
|
|
|
- import dictMixins from '@/mixins/dictMixins';
|
|
|
- export default {
|
|
|
- mixins: [dictMixins],
|
|
|
- components: { dryAreaSearch },
|
|
|
- props: {
|
|
|
- // 类别id
|
|
|
- categoryId: [Number, String],
|
|
|
- rootId: [Number, String],
|
|
|
+import dryAreaSearch from './dryArea-search.vue';
|
|
|
+import { getList } from '@/api/ledgerAssets/dryArea';
|
|
|
+import dictMixins from '@/mixins/dictMixins';
|
|
|
+import UserEdit from './user-edit.vue';
|
|
|
+
|
|
|
+export default {
|
|
|
+ mixins: [dictMixins],
|
|
|
+ components: { dryAreaSearch, UserEdit },
|
|
|
+ props: {
|
|
|
+ // 类别id
|
|
|
+ categoryId: [Number, String],
|
|
|
+ rootId: [Number, String],
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+
|
|
|
+
|
|
|
+ // 当前编辑数据
|
|
|
+ current: null,
|
|
|
+ // 是否显示编辑弹窗
|
|
|
+ showEdit: false,
|
|
|
+
|
|
|
+
|
|
|
+ // 表格列配置
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ type: 'index',
|
|
|
+ label: '序号',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ fixed: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'code',
|
|
|
+ label: '干燥区编码',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'name',
|
|
|
+ label: '干燥区名称',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'specification',
|
|
|
+ label: '规格',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'region',
|
|
|
+ label: '位置',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'status',
|
|
|
+ label: '状态',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110,
|
|
|
+ slot: 'status',
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ]
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.requestDict('角度');
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource({ page, limit, where }) {
|
|
|
+ return getList({
|
|
|
+ ...where,
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ categoryLevelId: this.categoryId,
|
|
|
+ rootCategoryLevelId: this.rootId
|
|
|
+ });
|
|
|
},
|
|
|
- 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: 'specification',
|
|
|
- label: '规格',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- {
|
|
|
- prop: 'region',
|
|
|
- label: '位置',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
- {
|
|
|
- prop: 'status',
|
|
|
- label: '状态',
|
|
|
- showOverflowTooltip: true,
|
|
|
- minWidth: 110
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- ]
|
|
|
- };
|
|
|
+ /* 刷新表格 */
|
|
|
+ reload(where) {
|
|
|
+ this.$refs.table.reload({ pageNum: 1, where: where });
|
|
|
},
|
|
|
- created () {
|
|
|
- this.requestDict('角度');
|
|
|
+
|
|
|
+ /* 打开编辑弹窗 */
|
|
|
+ openEdit(row) {
|
|
|
+ this.current = row;
|
|
|
+ this.showEdit = true;
|
|
|
+ this.$refs.userEdit.$refs.form &&
|
|
|
+ this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
},
|
|
|
- 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
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
|
|
|
|
|
|
- },
|
|
|
- watch: {
|
|
|
- // 监听类别id变化
|
|
|
- categoryId() {
|
|
|
- this.reload();
|
|
|
- }
|
|
|
+
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // 监听类别id变化
|
|
|
+ categoryId() {
|
|
|
+ this.reload();
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|