|  |  |  | 
|---|
|  |  |  | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> | 
|---|
|  |  |  | <li><el-button type="primary" @click="handleEdit()" icon="el-icon-plus" | 
|---|
|  |  |  | v-permissions="['business:category:create']">新建</el-button></li> | 
|---|
|  |  |  | <li v-permissions="['business:category:exportExcel']"><el-button type="primary" | 
|---|
|  |  |  | @click="exportExcel">导出</el-button></li> | 
|---|
|  |  |  | </ul> | 
|---|
|  |  |  | <el-table row-key="id" :tree-props="{children: 'childCategoryList'}" v-loading="isWorking.search" :data="dataList" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table row-key="id" :tree-props="{ children: 'childCategoryList' }" v-loading="isWorking.search" | 
|---|
|  |  |  | :data="dataList" stripe @selection-change="handleSelectionChange"> | 
|---|
|  |  |  | <el-table-column prop="name" label="分类名称" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="remark" label="备注" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <!-- <el-table-column prop="status" label="状态" min-width="100px"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <span v-if="row.status === 0">启用</span> | 
|---|
|  |  |  | <span v-if="row.status === 1">禁用</span> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> --> | 
|---|
|  |  |  | </el-table-column> --> | 
|---|
|  |  |  | <el-table-column prop="createDate" label="创建时间" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column v-if="containPermissions(['business:category:update', 'business:category:delete'])" | 
|---|
|  |  |  | label="操作" min-width="120" fixed="right"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | </el-table-column> | 
|---|
|  |  |  | </el-table> | 
|---|
|  |  |  | <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="tableData.pagination"> | 
|---|
|  |  |  | <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="pagination"> | 
|---|
|  |  |  | </pagination> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <!-- 新建/修改 --> | 
|---|
|  |  |  | <OperaCategoryWindow v-if="isShowEdit" @close="isShowEdit = false" ref="operaCategoryWindow" @success="getList" /> | 
|---|
|  |  |  | <OperaCategoryWindow v-if="isShowEdit" @close="isShowEdit = false" ref="operaCategoryWindow" | 
|---|
|  |  |  | @success="getList" /> | 
|---|
|  |  |  | </TableLayout> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: '车辆信息表', | 
|---|
|  |  |  | api: '/business/category', | 
|---|
|  |  |  | 'field.id': 'id', | 
|---|
|  |  |  | 'field.main': 'id' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.operaCategoryWindow.open(str) | 
|---|
|  |  |  | this.$refs.operaCategoryWindow.getList() | 
|---|
|  |  |  | if(row && row.id){ | 
|---|
|  |  |  | if (row && row.id) { | 
|---|
|  |  |  | this.$refs.operaCategoryWindow.getDetail(row.id) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getList() { | 
|---|
|  |  |  | getList(page) { | 
|---|
|  |  |  | const { pagination, filters } = this | 
|---|
|  |  |  | if (page) { | 
|---|
|  |  |  | pagination.page = page | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | fetchList({ | 
|---|
|  |  |  | model: { ...filters }, | 
|---|
|  |  |  | 
|---|
|  |  |  | this.loading = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleSizeChange(val){ | 
|---|
|  |  |  | this.pagination.pageSize = val | 
|---|
|  |  |  | this.getList() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|