|
@@ -12,13 +12,6 @@
|
|
|
size="small"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="zgType" label-width="80px">
|
|
|
- <el-select v-model="queryParams.status" placeholder="请选择" clearable size="small">
|
|
|
- <el-option label="全部" value="" />
|
|
|
- <el-option label="在线" value="0" />
|
|
|
- <el-option label="异常" value="1" />
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
<el-form-item>
|
|
|
<p class="inquire-button-one" @click="handleQuery">查询</p>
|
|
|
<p class="reset-button-one" @click="resetQuery">重置</p>
|
|
@@ -37,12 +30,15 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table border v-loading="loading" :data="tableData">
|
|
|
- <el-table-column label="设备编号" align="left" prop="userName"/>
|
|
|
- <el-table-column label="设备地址" align="left" prop="userNumber"></el-table-column>
|
|
|
- <el-table-column label="关联实验室" align="left" prop="userTelephone"></el-table-column>
|
|
|
- <el-table-column label="状态" align="left" prop="deptName">
|
|
|
+ <el-table-column label="设备名称" align="left" prop="deviceName"/>
|
|
|
+ <el-table-column label="继电器编号" align="left" prop="deviceCode"/>
|
|
|
+ <el-table-column label="设备地址" align="left" prop="deviceUrl"></el-table-column>
|
|
|
+ <el-table-column label="关联实验室" align="left" prop="subjectName"></el-table-column>
|
|
|
+ <el-table-column label="状态" align="left" prop="deviceStatus">
|
|
|
<template slot-scope="scope">
|
|
|
- <span>{{scope.row.deptName==1?'已授权':(scope.row.deptName==2?'已失效':'')}}</span>
|
|
|
+ <span v-if="scope.row.deviceStatus==1">离线</span>
|
|
|
+ <span v-if="scope.row.deviceStatus==2">在线</span>
|
|
|
+ <span v-if="scope.row.deviceStatus==3">异常</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="180">
|
|
@@ -63,31 +59,44 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<!--弹框-->
|
|
|
- <el-dialog title='新增准入实验室' @close="handleClose" :visible.sync="dialogVisible" width="600px">
|
|
|
- <el-form :model="dialogForm" ref="dialogForm" :inline="true" label-width="140px">
|
|
|
- <el-form-item label="设备名称:" prop="name" >
|
|
|
+ <el-dialog title='新增准入实验室' @close="handleClose" :visible.sync="dialogVisible" width="600px">
|
|
|
+ <el-form :model="dialogForm" ref="dialogForm" :rules="rules" :inline="true" label-width="140px">
|
|
|
+ <el-form-item label="设备名称:" prop="deviceName" >
|
|
|
<el-input
|
|
|
style="width: 400px"
|
|
|
- v-model="dialogForm.name"
|
|
|
+ v-model="dialogForm.deviceName"
|
|
|
placeholder="请输入设备名称"
|
|
|
+ maxLength="20"
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="继电器编号:" prop="relayCode" >
|
|
|
+ <el-input
|
|
|
+ style="width: 400px"
|
|
|
+ v-model="dialogForm.relayCode"
|
|
|
+ placeholder="请输入继电器编号"
|
|
|
+ maxLength="20"
|
|
|
clearable
|
|
|
size="small"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="设备编号:" prop="name" >
|
|
|
+ <el-form-item label="采集器编号:" prop="deviceCode" >
|
|
|
<el-input
|
|
|
style="width: 400px"
|
|
|
- v-model="dialogForm.name"
|
|
|
- placeholder="请输入设备编号"
|
|
|
+ v-model="dialogForm.deviceCode"
|
|
|
+ placeholder="请输入采集器编号"
|
|
|
+ maxLength="20"
|
|
|
clearable
|
|
|
size="small"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="设备地址:" prop="name" >
|
|
|
+ <el-form-item label="设备地址:" prop="deviceUrl" >
|
|
|
<el-input
|
|
|
style="width: 400px"
|
|
|
- v-model="dialogForm.name"
|
|
|
+ v-model="dialogForm.deviceUrl"
|
|
|
placeholder="请输入设备地址"
|
|
|
+ maxLength="300"
|
|
|
clearable
|
|
|
size="small"
|
|
|
/>
|
|
@@ -113,11 +122,13 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="灭火倒计时:" prop="name" >
|
|
|
+ <el-form-item label="灭火倒计时:" prop="deviceCountDown" >
|
|
|
<el-input
|
|
|
+ :min="0"
|
|
|
+ oninput="if(value<0 || value>30)value=0"
|
|
|
style="width: 400px"
|
|
|
- v-model="dialogForm.name"
|
|
|
- placeholder="请输入倒计时秒数"
|
|
|
+ v-model="dialogForm.deviceCountDown"
|
|
|
+ placeholder="请输入倒计时秒数,仅能输入0-30之间的数字"
|
|
|
clearable
|
|
|
size="small"
|
|
|
>
|
|
@@ -135,13 +146,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {
|
|
|
- RFIDtagAdd,
|
|
|
- listDepartments,
|
|
|
- labCenterPersonList,
|
|
|
- labCenterPersonDelete, subjectList, recognizerAnew, recognizerAdd
|
|
|
-} from '@/api/gasManage3_0/gasManage'
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
+import { subjectList, } from '@/api/gasManage3_0/gasManage'
|
|
|
+import { firedeviceAdd, firedeviceDle, firedeviceEdit, firedeviceList } from '@/api/laboratory/subject'
|
|
|
export default {
|
|
|
name: "Approval",
|
|
|
components: {
|
|
@@ -159,14 +165,35 @@ export default {
|
|
|
pageSize:20,
|
|
|
searchValue:'',
|
|
|
},
|
|
|
- form:{
|
|
|
- tagCode:'',
|
|
|
- },
|
|
|
total:0,
|
|
|
tableData:[],
|
|
|
- deptOptions:[],
|
|
|
- dialogForm:{},
|
|
|
+ dialogForm:{
|
|
|
+
|
|
|
+ },
|
|
|
laboratoryOptions:[],
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+
|
|
|
+ deviceName: [
|
|
|
+ { required: true, message: "请输入设备名称", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ relayCode: [
|
|
|
+ { required: true, message: "请输入继电器编号", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ deviceCode: [
|
|
|
+ { required: true, message: "请输入采集器编号", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ deviceUrl: [
|
|
|
+ { required: true, message: "请输入设备地址", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ deviceCountDown: [
|
|
|
+ { required: true, message: "请输入倒计时秒数", trigger: "blur" }
|
|
|
+ ],
|
|
|
+ subjectId: [
|
|
|
+ { required: true, message: "请选择实验地点", trigger: "blur" }
|
|
|
+ ],
|
|
|
+
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -184,7 +211,7 @@ export default {
|
|
|
let self = this;
|
|
|
for(let i=0;i<self.laboratoryOptions.length;i++){
|
|
|
if(self.laboratoryOptions[i].id == e){
|
|
|
- this.$set(this.dialogForm,"subject",self.laboratoryOptions[i]);
|
|
|
+ //this.$set(this.dialogForm,"subject",self.laboratoryOptions[i]);
|
|
|
this.$set(this.dialogForm,"location",self.laboratoryOptions[i].name);
|
|
|
}
|
|
|
}
|
|
@@ -199,29 +226,32 @@ export default {
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.dialogVisible = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
-
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
},
|
|
|
handleClick(index,row,doType){
|
|
|
|
|
|
let _this=this;
|
|
|
if(doType=='add'){//添加
|
|
|
_this.dialogVisible=true;
|
|
|
+ _this.dialogForm={}
|
|
|
+ _this.dialogForm.deviceCountDown=30
|
|
|
}else if(doType=='edit'){//编辑
|
|
|
_this.dialogVisible=true;
|
|
|
+ _this.dialogForm.id=row.id;
|
|
|
+ _this.dialogForm.deviceName=row.deviceName;
|
|
|
+ _this.dialogForm.deviceCode=row.deviceCode;
|
|
|
+ _this.dialogForm.relayCode=row.relayCode;
|
|
|
+ _this.dialogForm.deviceUrl=row.deviceUrl
|
|
|
+ _this.dialogForm.deviceCountDown=row.deviceCountDown;
|
|
|
+ _this.dialogForm.subjectId=row.subjectId;
|
|
|
+ _this.dialogForm.location=row.subjectName;
|
|
|
+
|
|
|
}else if(doType=='delete'){//删除
|
|
|
this.$confirm('是否确认删除当前数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(function() {
|
|
|
- labCenterPersonDelete(row.id).then( response => {
|
|
|
+ firedeviceDle(row.id).then( response => {
|
|
|
if(response.code==200){
|
|
|
_this.getList();
|
|
|
_this.msgSuccess("删除成功");
|
|
@@ -241,34 +271,57 @@ export default {
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.queryParams.searchValue = "";
|
|
|
- this.queryParams.deptIds = "";
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
getList(){
|
|
|
let _this=this;
|
|
|
- labCenterPersonList(_this.queryParams).then( response => {
|
|
|
+ firedeviceList(_this.queryParams).then( response => {
|
|
|
let res=response.rows;
|
|
|
_this.tableData=res;
|
|
|
_this.total=response.total;
|
|
|
});
|
|
|
|
|
|
- },
|
|
|
- submitForm(){
|
|
|
- let _this = this;
|
|
|
- RFIDtagAdd(_this.form).then(res => {
|
|
|
- this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功!',
|
|
|
- duration:2000,
|
|
|
- onClose:function(){
|
|
|
- _this.backPage();
|
|
|
- _this.loading = false;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
+ },
|
|
|
+ //提交
|
|
|
+ submitForm(){
|
|
|
+ let _this = this;
|
|
|
+ this.$refs['dialogForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ _this.dialogForm.deviceUrl=Number( _this.dialogForm.deviceUrl)
|
|
|
+ _this.dialogForm.deviceCountDown=Number( _this.dialogForm.deviceCountDown)
|
|
|
+ if(!this.dialogForm.id){//新增
|
|
|
+ firedeviceAdd(_this.dialogForm).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功!',
|
|
|
+ duration:2000,
|
|
|
+ onClose:function(){
|
|
|
+ _this.getList();
|
|
|
+ _this.loading = false;
|
|
|
+ _this.dialogVisible = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }else{//编辑
|
|
|
+ firedeviceEdit(_this.dialogForm).then(res => {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: '操作成功!',
|
|
|
+ duration:2000,
|
|
|
+ onClose:function(){
|
|
|
+ _this.getList();
|
|
|
+ _this.loading = false;
|
|
|
+ _this.dialogVisible = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getList();
|