|  |  | 
 |  |  |   <TableLayout :permissions="['business:jkcabinet:query']"> | 
 |  |  |     <!-- 搜索表单 --> | 
 |  |  |     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
 |  |  |       <el-form-item label="主键" prop="id"> | 
 |  |  |         <el-input v-model="searchForm.id" placeholder="请输入主键" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="创建人编码" prop="creator"> | 
 |  |  |         <el-input v-model="searchForm.creator" placeholder="请输入创建人编码" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="创建时间" prop="createDate"> | 
 |  |  |         <el-date-picker v-model="searchForm.createDate" value-format="yyyy-MM-dd" placeholder="请输入创建时间" @change="search"/> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="更新人编码" prop="editor"> | 
 |  |  |         <el-input v-model="searchForm.editor" placeholder="请输入更新人编码" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="更新时间" prop="editDate"> | 
 |  |  |         <el-date-picker v-model="searchForm.editDate" value-format="yyyy-MM-dd" placeholder="请输入更新时间" @change="search"/> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="是否删除0否 1是" prop="isdeleted"> | 
 |  |  |         <el-input v-model="searchForm.isdeleted" placeholder="请输入是否删除0否 1是" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="备注" prop="info"> | 
 |  |  |         <el-input v-model="searchForm.info" placeholder="请输入备注" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="设备编号" prop="code"> | 
 |  |  |         <el-input v-model="searchForm.code" placeholder="请输入设备编号" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="设备名称" prop="name"> | 
 |  |  |         <el-input v-model="searchForm.name" placeholder="请输入设备名称" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="设备ID" prop="devId"> | 
 |  |  |         <el-input v-model="searchForm.devId" placeholder="请输入设备ID" @keypress.enter.native="search"></el-input> | 
 |  |  |       <el-form-item label="运行状态" prop="rumStatus"> | 
 |  |  |         <el-select v-model="searchForm.rumStatus" placeholder="请选择" @change="search"> | 
 |  |  |           <el-option label="全部" value=""></el-option> | 
 |  |  |           <el-option label="在线" :value="0"></el-option> | 
 |  |  |           <el-option label="离线" :value="1"></el-option> | 
 |  |  |         </el-select> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="序列号" prop="serialNo"> | 
 |  |  |         <el-input v-model="searchForm.serialNo" placeholder="请输入序列号" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="通讯地址" prop="linkAddr"> | 
 |  |  |         <el-input v-model="searchForm.linkAddr" placeholder="请输入通讯地址" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="状态 0未绑定 1在位 2借出" prop="status"> | 
 |  |  |         <el-input v-model="searchForm.status" placeholder="请输入状态 0未绑定 1在位 2借出" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="端口" prop="port"> | 
 |  |  |         <el-input v-model="searchForm.port" placeholder="请输入端口" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="设备管理员编码(关联member)" prop="managerId"> | 
 |  |  |         <el-input v-model="searchForm.managerId" placeholder="请输入设备管理员编码(关联member)" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="使用时长(秒)" prop="useTime"> | 
 |  |  |         <el-input v-model="searchForm.useTime" placeholder="请输入使用时长(秒)" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="是否双重验证 0否 1是" prop="doubleAuth"> | 
 |  |  |         <el-input v-model="searchForm.doubleAuth" placeholder="请输入是否双重验证 0否 1是" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="验证人编码(关联member)" prop="authMemberId"> | 
 |  |  |         <el-input v-model="searchForm.authMemberId" placeholder="请输入验证人编码(关联member)" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="排数" prop="rowNum"> | 
 |  |  |         <el-input v-model="searchForm.rowNum" placeholder="请输入排数" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="列数" prop="columnNum"> | 
 |  |  |         <el-input v-model="searchForm.columnNum" placeholder="请输入列数" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="最后通讯时间" prop="haertTime"> | 
 |  |  |         <el-date-picker v-model="searchForm.haertTime" value-format="yyyy-MM-dd" placeholder="请输入最后通讯时间" @change="search"/> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="所在位置" prop="lacation"> | 
 |  |  |         <el-input v-model="searchForm.lacation" placeholder="请输入所在位置" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="经度" prop="longitude"> | 
 |  |  |         <el-input v-model="searchForm.longitude" placeholder="请输入经度" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="维度" prop="latitude"> | 
 |  |  |         <el-input v-model="searchForm.latitude" placeholder="请输入维度" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="编码方式 0自动编码 1手动编码" prop="noType"> | 
 |  |  |         <el-input v-model="searchForm.noType" placeholder="请输入编码方式 0自动编码 1手动编码" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="编码前缀" prop="noPrefix"> | 
 |  |  |         <el-input v-model="searchForm.noPrefix" placeholder="请输入编码前缀" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="编码位数" prop="noLength"> | 
 |  |  |         <el-input v-model="searchForm.noLength" placeholder="请输入编码位数" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="起始编码" prop="noIndex"> | 
 |  |  |         <el-input v-model="searchForm.noIndex" placeholder="请输入起始编码" @keypress.enter.native="search"></el-input> | 
 |  |  |       <el-form-item label="状态" prop="status"> | 
 |  |  |         <el-select v-model="searchForm.status" placeholder="请选择" @change="search"> | 
 |  |  |           <el-option label="全部" value=""></el-option> | 
 |  |  |           <el-option label="启用" :value="1"></el-option> | 
 |  |  |           <el-option label="禁用" :value="0"></el-option> | 
 |  |  |         </el-select> | 
 |  |  |       </el-form-item> | 
 |  |  |       <section> | 
 |  |  |         <el-button type="primary" @click="search">搜索</el-button> | 
 |  |  |         <el-button type="primary" :loading="isWorking.export" v-permissions="['business:jkcabinet:exportExcel']" @click="exportExcel">导出</el-button> | 
 |  |  |         <el-button @click="reset">重置</el-button> | 
 |  |  |       </section> | 
 |  |  |     </el-form> | 
 |  |  |     <!-- 表格和分页 --> | 
 |  |  |     <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="primary" @click="$refs.operaJkCabinetWindow.open('新建设备')" icon="el-icon-plus" v-permissions="['business:jkcabinet:create']">新建</el-button></li> | 
 |  |  |         <li><el-button type="warning" @click="$refs.alcoholTest.open('新建酒精检测配置', form)">酒精检测配置</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="id" label="主键" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="creator" label="创建人编码" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="createDate" label="创建时间" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="editor" label="更新人编码" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="editDate" label="更新时间" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="isdeleted" label="是否删除0否 1是" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="info" label="备注" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="code" label="设备编号" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="name" label="设备名称" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="devId" label="设备ID" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="serialNo" label="序列号" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="linkAddr" label="通讯地址" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="status" label="状态 0未绑定 1在位 2借出" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="port" label="端口" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="managerId" label="设备管理员编码(关联member)" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="useTime" label="使用时长(秒)" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="doubleAuth" label="是否双重验证 0否 1是" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="authMemberId" label="验证人编码(关联member)" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="rowNum" label="排数" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="columnNum" label="列数" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="haertTime" label="最后通讯时间" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="port" label="端口号" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="lacation" label="所在位置" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="longitude" label="经度" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="latitude" label="维度" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="noType" label="编码方式 0自动编码 1手动编码" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="noPrefix" label="编码前缀" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="noLength" label="编码位数" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column prop="noIndex" label="起始编码" min-width="100px"></el-table-column> | 
 |  |  |         <el-table-column label="柜格数量" min-width="100px"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-button @click="$refs.cabinetDetails.open(row.name + '-柜格信息', row.id)">{{row.gridNum}}</el-button> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column label="运行状态" min-width="100px"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <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"> | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-switch | 
 |  |  |               v-model="row.status" | 
 |  |  |               @change="changeStatus($event, row.id)" | 
 |  |  |               active-color="#13ce66" | 
 |  |  |               inactive-color="#ff4949" | 
 |  |  |               :active-value="0" | 
 |  |  |               :inactive-value="1"> | 
 |  |  |             </el-switch> | 
 |  |  |           </template> | 
 |  |  |         </el-table-column> | 
 |  |  |         <el-table-column | 
 |  |  |           v-if="containPermissions(['business:jkcabinet:update', 'business:jkcabinet:delete'])" | 
 |  |  |           label="操作" | 
 |  |  |           min-width="120" | 
 |  |  |           min-width="200" | 
 |  |  |           fixed="right" | 
 |  |  |         > | 
 |  |  |           <template slot-scope="{row}"> | 
 |  |  |             <el-button type="text" @click="$refs.operaJkCabinetWindow.open('编辑钥匙柜基本信息表', row)" icon="el-icon-edit" v-permissions="['business:jkcabinet:update']">编辑</el-button> | 
 |  |  |             <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:jkcabinet:delete']">删除</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> | 
 |  |  |         </el-table-column> | 
 |  |  |       </el-table> | 
 |  |  | 
 |  |  |     </template> | 
 |  |  |     <!-- 新建/修改 --> | 
 |  |  |     <OperaJkCabinetWindow ref="operaJkCabinetWindow" @success="handlePageChange"/> | 
 |  |  |     <!-- 柜子详情 --> | 
 |  |  |     <CabinetDetails ref="cabinetDetails" /> | 
 |  |  |     <!-- 新增酒精检测 --> | 
 |  |  |     <AlcoholTest ref="alcoholTest" @success="GetCabinetConfig" /> | 
 |  |  |   </TableLayout> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | 
 |  |  | import TableLayout from '@/layouts/TableLayout' | 
 |  |  | import Pagination from '@/components/common/Pagination' | 
 |  |  | import OperaJkCabinetWindow from '@/components/business/OperaJkCabinetWindow' | 
 |  |  | import CabinetDetails from '@/components/business/cabinetDetails' | 
 |  |  | import AlcoholTest from '@/components/business/alcoholTest' | 
 |  |  | import { updateStatusById, getCabinetConfig } from '@/api/business/jkCabinet' | 
 |  |  | export default { | 
 |  |  |   name: 'JkCabinet', | 
 |  |  |   extends: BaseTable, | 
 |  |  |   components: { TableLayout, Pagination, OperaJkCabinetWindow }, | 
 |  |  |   components: { TableLayout, Pagination, OperaJkCabinetWindow, CabinetDetails, AlcoholTest}, | 
 |  |  |   data () { | 
 |  |  |     return { | 
 |  |  |       // 搜索 | 
 |  |  |       searchForm: { | 
 |  |  |         id: '', | 
 |  |  |         creator: '', | 
 |  |  |         createDate: '', | 
 |  |  |         editor: '', | 
 |  |  |         editDate: '', | 
 |  |  |         isdeleted: '', | 
 |  |  |         info: '', | 
 |  |  |         code: '', | 
 |  |  |         name: '', | 
 |  |  |         devId: '', | 
 |  |  |         serialNo: '', | 
 |  |  |         linkAddr: '', | 
 |  |  |         status: '', | 
 |  |  |         port: '', | 
 |  |  |         managerId: '', | 
 |  |  |         useTime: '', | 
 |  |  |         doubleAuth: '', | 
 |  |  |         authMemberId: '', | 
 |  |  |         rowNum: '', | 
 |  |  |         columnNum: '', | 
 |  |  |         haertTime: '', | 
 |  |  |         lacation: '', | 
 |  |  |         longitude: '', | 
 |  |  |         latitude: '', | 
 |  |  |         noType: '', | 
 |  |  |         noPrefix: '', | 
 |  |  |         noLength: '', | 
 |  |  |         noIndex: '' | 
 |  |  |       } | 
 |  |  |         rumStatus: '' | 
 |  |  |       }, | 
 |  |  |       form: null | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  |   created () { | 
 |  |  | 
 |  |  |       'field.main': 'id' | 
 |  |  |     }) | 
 |  |  |     this.search() | 
 |  |  |     this.GetCabinetConfig() | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     changeStatus(status, id) { | 
 |  |  |       updateStatusById({ id, status }) | 
 |  |  |         .then(res => { | 
 |  |  |           this.search() | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     GetCabinetConfig() { | 
 |  |  |       getCabinetConfig() | 
 |  |  |         .then(res => { | 
 |  |  |           this.form = res | 
 |  |  |         }) | 
 |  |  |     } | 
 |  |  |   } | 
 |  |  | } | 
 |  |  | </script> |