|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <TableLayout> | 
|---|
|  |  |  | <template v-slot:table-wrap> | 
|---|
|  |  |  | <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 class="toolbar"> | 
|---|
|  |  |  | <li><el-button type="primary" @click="handleEdit()" icon="el-icon-plus">新建</el-button></li> | 
|---|
|  |  |  | <!--        <li><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-column prop="name" label="设备分类" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <!-- <el-table-column prop="parentName" label="所属分类" min-width="100px"></el-table-column> --> | 
|---|
|  |  |  | <el-table-column prop="name" label="物料分类" min-width="100px"></el-table-column> | 
|---|
|  |  |  | <el-table-column prop="sortnum" 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"> | 
|---|
|  |  |  | 
|---|
|  |  |  | filters: { | 
|---|
|  |  |  | parentId: '' | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | type: 7 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | isShowEdit: false, | 
|---|
|  |  |  | loading: false, | 
|---|
|  |  |  | pagination: { | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | created() { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: '车辆信息表', | 
|---|
|  |  |  | module: '分类信息表', | 
|---|
|  |  |  | api: '/business/category', | 
|---|
|  |  |  | 'field.id': 'id', | 
|---|
|  |  |  | 'field.main': 'id' | 
|---|
|  |  |  | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | handleEdit(row) { | 
|---|
|  |  |  | this.isShowEdit = true | 
|---|
|  |  |  | let str = row && row.id ? '编辑设备分类' : '新建设备分类' | 
|---|
|  |  |  | let str = row && row.id ? '编辑物料分类' : '新建物料分类' | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.CateEditRef.open(str) | 
|---|
|  |  |  | this.$refs.CateEditRef.getList() | 
|---|
|  |  |  | 
|---|
|  |  |  | const { pagination, filters } = this | 
|---|
|  |  |  | this.loading = true | 
|---|
|  |  |  | fetchList({ | 
|---|
|  |  |  | model: { ...filters, type: 5 }, | 
|---|
|  |  |  | model: { ...filters, type: 7 }, | 
|---|
|  |  |  | capacity: pagination.pageSize, | 
|---|
|  |  |  | page: pagination.page, | 
|---|
|  |  |  | }).then(res => { | 
|---|