| | |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:productlabel:create', 'business:productlabel:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaProductLabelWindow.open('新建商品标签信息表')" icon="el-icon-plus" v-permissions="['business:productlabel:create']">新建</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">删除</el-button></li> |
| | | <li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">删除</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | |
| | | <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="操作" |
| | |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaProductLabelWindow.open('编辑商品标签信息表', row)" icon="el-icon-edit" v-permissions="['business:productlabel:update']">编辑</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">删除</el-button> |
| | | <el-button type="text" style="color: red;" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:productlabel:delete']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaGoodsBrandWindow from '@/components/business/OperaGoodsBrandWindow' |
| | | import {updateStatusById} from "@/api/business/labels"; |
| | | export default { |
| | | name: 'ProductLabel', |
| | | extends: BaseTable, |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | statusChange (row) { |
| | | this.api.updateStatusById({ id: row.id, status: row.status }) |
| | | .then(() => { |
| | | this.$message.success('操作成功') |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error('操作成功') |
| | | }) |
| | | .then(() => { |
| | | this.handlePageChange() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |