| | |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:jkcabinet:create', 'business:jkcabinet:delete']"> |
| | | <li><el-button type="primary" @click="$refs.operaJkCabinetWindow.open('新建设备')" icon="el-icon-plus" v-permissions="['business:jkcabinet:create']">新建</el-button></li> |
| | | <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:jkcabinet:delete']">删除</el-button></li> |
| | | <li><el-button type="warning" @click="$refs.alcoholTest.open('新建酒精检测配置', form)">酒精检测配置</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | :height="tableHeightNew" |
| | |
| | | </el-table-column> |
| | | <el-table-column label="运行状态" min-width="100px"> |
| | | <template slot-scope="{row}"> |
| | | <el-link type="success" v-if="row.runStatus === 0">在线</el-link> |
| | | <el-link type="danger" v-if="row.runStatus === 1">离线</el-link> |
| | | <el-link type="success" :underline="false" v-if="row.runStatus === 0">在线</el-link> |
| | | <el-link type="danger" :underline="false" v-if="row.runStatus === 1">离线</el-link> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="状态" min-width="100px"> |
| | |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <el-button type="text">日志</el-button> |
| | | <el-button type="text">绑定钥匙</el-button> |
| | | <el-button type="text" @click="$refs.cabinetDetails.open(row.name + '-柜格信息', row.id)">绑定钥匙</el-button> |
| | | <el-button type="text" @click="$refs.operaJkCabinetWindow.open('编辑钥匙柜基本信息表', row)" v-permissions="['business:jkcabinet:update']">编辑</el-button> |
| | | <el-button type="text" @click="deleteById(row)" v-permissions="['business:jkcabinet:delete']">删除</el-button> |
| | | </template> |
| | |
| | | <OperaJkCabinetWindow ref="operaJkCabinetWindow" @success="handlePageChange"/> |
| | | <!-- 柜子详情 --> |
| | | <CabinetDetails ref="cabinetDetails" /> |
| | | <!-- 新增酒精检测 --> |
| | | <AlcoholTest ref="alcoholTest" @success="GetCabinetConfig" /> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaJkCabinetWindow from '@/components/business/OperaJkCabinetWindow' |
| | | import CabinetDetails from '@/components/business/cabinetDetails' |
| | | import { updateStatusById } from '@/api/business/jkCabinet' |
| | | import AlcoholTest from '@/components/business/alcoholTest' |
| | | import { updateStatusById, getCabinetConfig } from '@/api/business/jkCabinet' |
| | | export default { |
| | | name: 'JkCabinet', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails }, |
| | | components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails, AlcoholTest}, |
| | | data () { |
| | | return { |
| | | // 搜索 |
| | |
| | | name: '', |
| | | status: '', |
| | | rumStatus: '' |
| | | } |
| | | }, |
| | | form: null |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | 'field.main': 'id' |
| | | }) |
| | | this.search() |
| | | this.GetCabinetConfig() |
| | | }, |
| | | methods: { |
| | | changeStatus(status, id) { |
| | |
| | | .then(res => { |
| | | this.search() |
| | | }) |
| | | }, |
| | | GetCabinetConfig() { |
| | | getCabinetConfig() |
| | | .then(res => { |
| | | this.form = res |
| | | }) |
| | | } |
| | | } |
| | | } |