| | |
| | | <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 prop="createDate" label="创建时间" min-width="100px"></el-table-column> |
| | | <el-table-column prop="status" label="状态" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch |
| | | v-model="row.status" |
| | | :active-value="1" |
| | | :inactive-value="0" |
| | | active-color="#13ce66" |
| | | inactive-color="#ff4949" |
| | | @change="statusChange(row)" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:productlabel:update', 'business:productlabel:delete'])" |
| | | label="操作" |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | statusChange (row) { |
| | | this.api.updateById({ id: row.id, status: row.status }) |
| | | .then(() => { |
| | | this.$message.success('操作成功') |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error('操作成功') |
| | | }) |
| | | .then(() => { |
| | | this.handlePageChange() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |