| | |
| | | <el-table-column property="rfid" label="关联RFID"/> |
| | | <el-table-column property="norm" label="巡检指标"/> |
| | | <el-table-column property="reference" label="数据参考值"/> |
| | | <el-table-column fixed="right" label="操作" align="center" width="80"> |
| | | <el-table-column fixed="right" label="操作" align="center" width="100"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" size="small" :icon="Edit" @click="editInspection(index,scope.$index ,scope.row)">修改</el-button> |
| | | <el-button link type="danger" size="small" :icon="Delete" @click="deleteInspection(index,scope.$index)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogAddInspection" title="新增巡检点" @close="closeAddInspection"> |
| | | <el-form :model="addInspection" label-width="120px" ref="addInspectionRef" :rules="addInspectionRules"> |
| | | <el-form-item label="输入巡检点排序" prop="sort"> |
| | | <el-input-number v-model="addInspection.sort" :min="1" :max="999" placeholder="巡检点排序"/> |
| | | </el-form-item> |
| | | <el-form-item label="选择巡检点" prop="name"> |
| | | <el-select v-model="addInspection.name"> |
| | | <el-option label="73011" value="73011" /> |
| | |
| | | <el-option label="73013" value="73013" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="输入巡检点排序" prop="sort"> |
| | | <el-input-number v-model="addInspection.sort" :min="1" :max="999" placeholder="请输入用于确定该巡检点位置的序号"/> |
| | | <el-form-item label="选择巡检指标" prop="norm"> |
| | | <el-select v-model="addInspection.norm"> |
| | | <el-option label="风机声音" value="风机声音" /> |
| | | <el-option label="设备温度" value="设备温度" /> |
| | | <el-option label="压力" value="压力" /> |
| | | <el-option label="震动" value="震动" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="warning" @click="dialogAddInspection = false" size="default" plain>取消</el-button> |
| | |
| | | }) |
| | | const addInspectionRules = reactive<FormRules>({ |
| | | name:[{required: true, message: '该内容不能为空',trigger:'blur'}], |
| | | norm:[{required: true, message: '该内容不能为空',trigger:'blur'}], |
| | | sort:[{required: true, message: '该内容不能为空',trigger:'blur'}] |
| | | }) |
| | | const dialogDetails = ref(false) |
| | |
| | | }) |
| | | return |
| | | }else{ |
| | | if(addRecord.value.type == '固定班'){delete addRecord.value.shiftSteps} |
| | | console.log(addRecord.value,'addRecord') |
| | | tableData[chosenIndex.value] = addRecord.value |
| | | } |
| | | } |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | if(addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData){ |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.unshift(addInspection.value) |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.sort(compare('sort')) |
| | | if(chosenInspectionIndex.value == -1){ |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.unshift(addInspection.value) |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.sort(compare('sort')) |
| | | }else{ |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData[chosenInspectionIndex.value] = addInspection.value |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.sort(compare('sort')) |
| | | } |
| | | }else{ |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData = [] |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.unshift(addInspection.value) |
| | |
| | | chosenShiftIndex.value = i |
| | | chosenInspectionIndex.value = index |
| | | deleteInspectionDialog.value = true |
| | | console.log(chosenShiftIndex.value,chosenInspectionIndex.value) |
| | | } |
| | | const editInspection =(i,index, row)=>{ |
| | | chosenShiftIndex.value = i |
| | | chosenInspectionIndex.value = index |
| | | dialogAddInspection.value = true |
| | | addInspection.value = JSON.parse(JSON.stringify(row)) |
| | | } |
| | | const conFirmInspectionDelete=()=>{ |
| | | addRecord.value.shiftSteps[chosenShiftIndex.value].inspectorData.splice( chosenInspectionIndex.value,1) |