| | |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºå类信æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºåç§é
ç½®',null,searchForm.type)" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="updateUser" label="æ´æ°äººç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="100px"></el-table-column> |
| | | <el-table-column type="selection" :selectable="isChangeSelected" width="55"></el-table-column> |
| | | <el-table-column prop="name" label="åä½åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column prop="isFixed" label="æ¯å¦åºå®è½¦è¾" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.isFixed ==1" >æ¯</span> |
| | | <span v-else >å¦</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | | <el-switch :disabled="row.isFixed ==1" @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="type" label="ç±»å:0=åç§é
ç½®ï¼1=车è¾ç±»åé
ç½®ï¼2=餿 é
ç½®ï¼3=æç»è´¹é
ç½®ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="detail" label="å
容ï¼è½¦è¾è§æ ¼ã餿 ãæç»è´¹æ¯ä¾ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 ï¼è½¦è¾ç±»å使ç¨ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="isFixed" label="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼" min-width="100px"> |
| | | </el-table-column> |
| | | <el-table-column prop="sortnum" label="æåºç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateUserName" label="æä½äºº" min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æè¿æä½æ¶é´" min-width="150px"></el-table-column> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:category:update', 'business:category:delete'])" |
| | | label="æä½" |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾å类信æ¯è¡¨', row)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | <el-button type="text" v-if="row.isFixed != 1" @click="$refs.operaCategoryWindow.open('ç¼è¾æ°å»ºåç§é
ç½®', row,searchForm.type)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" v-if="row.isFixed != 1" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | deleted: '', |
| | | status: '', |
| | | createUser: '', |
| | | createTime: '', |
| | | updateUser: '', |
| | | updateTime: '', |
| | | remark: '', |
| | | name: '', |
| | | type: '', |
| | | detail: '', |
| | | icon: '', |
| | | isFixed: '' |
| | | type: 1 |
| | | } |
| | | } |
| | | }, |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | isChangeSelected(row,index){ |
| | | if(row.isFixed ==1) { |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | changeStatus (e, row) { |
| | | this.working = true |
| | | this.api.updateStatus({ id: row.id, status: e }) |
| | | .then(res => { |
| | | this.$tip.apiSuccess(res || 'æä½æå') |
| | | this.search() |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.working = false |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:category:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="åç§°" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥åç§°" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:category:create', 'business:category:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaCategoryWindow.open('æ°å»ºå类信æ¯è¡¨')" icon="el-icon-plus" v-permissions="['business:category:create']">æ°å»º</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="updateUser" label="æ´æ°äººç¼ç " min-width="100px"></el-table-column> |
| | | <el-table-column prop="updateTime" label="æ´æ°æ¶é´" min-width="100px"></el-table-column> |
| | | <el-table-column prop="remark" label="夿³¨" min-width="100px"></el-table-column> |
| | | <el-table-column prop="name" label="åä½åç§°" min-width="100px"></el-table-column> |
| | | <el-table-column label="ç¶æ"> |
| | | <template slot-scope="{row}"> |
| | | <el-switch @change="changeStatus($event, row)" v-model="row.status" active-color="#13ce66" |
| | | inactive-color="#ff4949" :active-value="0" :inactive-value="1"> |
| | | </el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="type" label="ç±»å:0=åç§é
ç½®ï¼1=车è¾ç±»åé
ç½®ï¼2=餿 é
ç½®ï¼3=æç»è´¹é
ç½®ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="detail" label="å
容ï¼è½¦è¾è§æ ¼ã餿 ãæç»è´¹æ¯ä¾ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="icon" label="徿 ï¼è½¦è¾ç±»å使ç¨ï¼" min-width="100px"></el-table-column> |
| | | <el-table-column prop="isFixed" label="æ¯å¦åºå®è½¦è¾ï¼è½¦è¾ç±»å使ç¨ï¼:0=å¦ï¼1=æ¯ï¼" 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 slot-scope="{row}"> |
| | | <el-button type="text" @click="$refs.operaCategoryWindow.open('ç¼è¾å类信æ¯è¡¨', row)" icon="el-icon-edit" v-permissions="['business:category:update']">ç¼è¾</el-button> |
| | | <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:category:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaCategoryWindow ref="operaCategoryWindow" @success="handlePageChange"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaCategoryWindow from '@/components/business/OperaCategoryWindow' |
| | | export default { |
| | | name: 'Category', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaCategoryWindow }, |
| | | data () { |
| | | return { |
| | | // æç´¢ |
| | | searchForm: { |
| | | id: '', |
| | | deleted: '', |
| | | status: '', |
| | | createUser: '', |
| | | createTime: '', |
| | | updateUser: '', |
| | | updateTime: '', |
| | | remark: '', |
| | | name: '', |
| | | type: '', |
| | | detail: '', |
| | | icon: '', |
| | | isFixed: '' |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'å类信æ¯è¡¨', |
| | | api: '/business/category', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | } |
| | | } |
| | | </script> |