| | |
| | | <template> |
| | | <el-dialog :fullscreen="full" v-model="dialogVisible" draggable :title="titles" width="60%"> |
| | | <el-dialog :fullscreen="full" v-model="dialogVisible" draggable :title="titles" width="60%" @close="resetForm(ruleFormRef)" > |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form :model="form" label-width="130px" :disabled="disabled"> |
| | | <el-form :model="form" ref="ruleFormRef" label-width="130px" :rules="rules" :disabled="disabled"> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="类型/类别外键" size="default"> |
| | | <el-input v-model="form.equipmentTypeId" placeholder="请选择"> |
| | | <el-form-item label="类型/类别外键" size="default" prop="equipmentTypeId"> |
| | | <el-input v-model="form.equipmentTypeName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="opencategory"></el-button> |
| | | </template> |
| | |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="装置/部位名称" size="default"> |
| | | <el-input v-model="form.name" placeholder="请选择" /> |
| | | <el-input v-model="form.name" placeholder="请填写装置/部位名称" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="联系人" size="default"> |
| | | <el-form-item label="联系人" size="default" prop="connectPersonName"> |
| | | <el-input v-model="form.connectPersonName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser(0)"></el-button> |
| | | <el-button :icon="Search" @click="openUser(1)"></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="录入人" size="default"> |
| | | <el-form-item label="录入人" size="default" prop="inputPersonName"> |
| | | <el-input v-model="form.inputPersonName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser(1)"></el-button> |
| | | <el-button :icon="Search" @click="openUser(2)"></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="责任人" size="default"> |
| | | <el-form-item label="责任人" size="default" prop="responsibilityPersonName"> |
| | | <el-input v-model="form.responsibilityPersonName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser(2)"></el-button> |
| | | <el-button :icon="Search" @click="openUser(3)"></el-button> |
| | | </template> |
| | | </el-input> |
| | | </el-form-item> |
| | |
| | | <el-col :span="11"> |
| | | <el-form-item label="装置部位分类" size="default"> |
| | | <el-select v-model="form.partType" placeholder="请选择" style="width: 100%"> |
| | | <el-option label="关键装置" value="关键装置" /> |
| | | <el-option label="重点部位" value="重点部位" /> |
| | | <el-option label="关键装置" value="1" /> |
| | | <el-option label="重点部位" value="2" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="检查周期" size="default"> |
| | | <el-input v-model="form.checkCycle" placeholder="请选择检查周期" /> |
| | | <el-input v-model="form.checkCycle" placeholder="请填写检查周期" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="相关应急预案" size="default"> |
| | | <el-input v-model="form.emergencePlanId" placeholder="请选择"> |
| | | <el-input v-model="form.emergencePlanName" placeholder="请选择"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openPlan"></el-button> |
| | | </template> |
| | |
| | | </el-col> |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="主要危险有害因素" size="default"> |
| | | <el-input v-model="form.dangerousElement" placeholder="请选择" /> |
| | | <el-input v-model="form.dangerousElement" placeholder="请填写主要危险有害因素" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="易导致风险" size="default"> |
| | | <el-input v-model="form.toDangerous" placeholder="请选择易导致风险" /> |
| | | <el-input v-model="form.toDangerous" placeholder="请填写易导致风险" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="11" :offset="2"> |
| | | <el-form-item label="应急处置措施" size="default"> |
| | | <el-input v-model="form.treatment" placeholder="请选择应急处置措施" /> |
| | | <el-input v-model="form.treatment" placeholder="请填写应急处置措施" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="11"> |
| | | <el-form-item label="备注信息" size="default"> <el-input v-model="form.name" placeholder="请选择应急处置措施" /> </el-form-item> |
| | | <el-form-item label="备注信息" size="default"> <el-input v-model="form.memo" placeholder="请填写备注信息" /> </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <el-tabs v-model="activeName" class="demo-tabs"> |
| | | <el-tab-pane label="设备保养" name="first"> |
| | | <el-button type="primary" size="default" @click="openMaintenance('新增', '')">新增</el-button> |
| | | <el-button type="primary" size="default" @click="openMaintenance('新增', '')" :disabled="disabled">新增</el-button> |
| | | <el-table :data="form.takecareDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="takecareMemo" label="保养情况" /> |
| | | <el-table-column align="center" prop="leadingPersonId" label="保养负责人" /> |
| | | <el-table-column align="center" prop="leadingPersonName" label="保养负责人" /> |
| | | <el-table-column align="center" prop="takecareDate" :formatter="timeDate" label="保养日期" /> |
| | | <el-table-column align="center" prop="leadingPersonDepartmentId" label="保养负责人单位" /> |
| | | <el-table-column align="center" prop="leadingPersonDepartmentName" label="保养负责人单位" /> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openMaintenance('查看', scope.row)" size="small">查看</el-button> |
| | | <el-button link type="primary" @click="openMaintenance('修改', scope.row)" size="small">修改</el-button> |
| | | <el-button link type="primary" @click="deleteA(scope.row)" size="small">删除</el-button> |
| | | <el-button link type="primary" @click="openMaintenance('查看', scope.row)" size="small" :disabled="disabled">查看</el-button> |
| | | <el-button link type="primary" @click="openMaintenance('修改', scope.row)" size="small" :disabled="disabled">修改</el-button> |
| | | <el-button link type="primary" @click="deleteA(scope.row)" size="small" :disabled="disabled">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设备检测" name="second"> |
| | | <el-button type="primary" size="default" @click="openDetect('新增', '')">新增</el-button> |
| | | <el-table :data="form.testDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="testPersonId" label="检测人" /> |
| | | <el-button type="primary" size="default" @click="openDetect('新增', '')" :disabled="disabled">新增</el-button> |
| | | <el-table :data="form.checkDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="testPersonName" label="检测人" /> |
| | | <el-table-column align="center" prop="testDate" :formatter="timeDate" label="检测日期" /> |
| | | <el-table-column align="center" prop="testPersonDepartmentId" label="检测人单位" /> |
| | | <el-table-column align="center" prop="testPersonDepartmentName" label="检测人单位" /> |
| | | <el-table-column align="center" prop="testMemo" label="检测内容" /> |
| | | <el-table-column align="center" prop="testResult" label="检测结果" /> |
| | | <el-table-column align="center" prop="testResult" label="检测结果" > |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.testResult == 1">成功</span> |
| | | <span v-if="scope.row.testResult == 2">失败</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="testStatus" label="检测状态" /> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openDetect('查看', scope.row)" size="small">查看</el-button> |
| | | <el-button link type="primary" @click="openDetect('修改', scope.row)" size="small">修改</el-button> |
| | | <el-button link type="primary" @click="deleteB(scope.row)" size="small">删除</el-button> |
| | | <el-button link type="primary" @click="openDetect('查看', scope.row)" size="small" :disabled="disabled">查看</el-button> |
| | | <el-button link type="primary" @click="openDetect('修改', scope.row)" size="small" :disabled="disabled">修改</el-button> |
| | | <el-button link type="primary" @click="deleteB(scope.row)" size="small" :disabled="disabled">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="设备维修" name="third"> |
| | | <el-button type="primary" size="default" @click="openRepair('新增', '')">新增</el-button> |
| | | <el-button type="primary" size="default" @click="openRepair('新增', '')" :disabled="disabled">新增</el-button> |
| | | <el-table :data="form.repaireDetailList" style="width: 100%"> |
| | | <el-table-column align="center" prop="exceptionInfo" label="设施异常项" /> |
| | | <el-table-column align="center" prop="repairStatus" label="维修状态" /> |
| | | <el-table-column align="center" prop="repairStatus" label="维修状态" > |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.repairStatus == 1">维修中</span> |
| | | <span v-if="scope.row.repairStatus == 2">已维修</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column align="center" prop="repairMemo" label="维修情况" /> |
| | | <el-table-column align="center" prop="repairPersonId" label="维修负责人" /> |
| | | <el-table-column align="center" prop="repairPersonDepartmentId" label="维修负责人单位" /> |
| | | <el-table-column align="center" prop="repairPersonName" label="维修负责人" /> |
| | | <el-table-column align="center" prop="repairPersonDepartmentName" label="维修负责人单位" /> |
| | | <el-table-column align="center" prop="repairStartDate" :formatter="timeDate" label="维修开始日期" /> |
| | | <el-table-column align="center" prop="repairEndDate" :formatter="timeDate" label="维修结束日期" /> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openRepair('查看', scope.row)" size="small">查看</el-button> |
| | | <el-button link type="primary" @click="openRepair('修改', scope.row)" size="small">修改</el-button> |
| | | <el-button link type="primary" @click="deleteC(scope.row)" size="small">删除</el-button> |
| | | <el-button link type="primary" @click="openRepair('查看', scope.row)" size="small" :disabled="disabled">查看</el-button> |
| | | <el-button link type="primary" @click="openRepair('修改', scope.row)" size="small" :disabled="disabled">修改</el-button> |
| | | <el-button link type="primary" @click="deleteC(scope.row)" size="small" :disabled="disabled">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-tab-pane> |
| | | <el-tab-pane label="检查标准设置" name="fourth"> |
| | | <el-button type="primary" size="default" @click="openStandard('新增', '')">新增</el-button> |
| | | <el-button type="primary" size="default" @click="openStandard('新增', '')" :disabled="disabled">新增</el-button> |
| | | <el-table :data="form.checkStandardeDetailList" style="width: 100%"> |
| | | <el-table-column align="center" type="indexNum" label="序号" width="75" /> |
| | | <el-table-column align="center" prop="indexNum" label="序号" width="75" /> |
| | | <el-table-column align="center" prop="checkContent" label="检查内容" /> |
| | | <el-table-column align="center" prop="checkTarget" label="检查指标" /> |
| | | <el-table-column align="center" prop="unit" label="单位" /> |
| | |
| | | <el-table-column align="center" prop="rate" label="频次" /> |
| | | <el-table-column align="center" label="操作"> |
| | | <template #default="scope"> |
| | | <el-button link type="primary" @click="openStandard('查看', scope.row)" size="small">查看</el-button> |
| | | <el-button link type="primary" @click="openStandard('修改', scope.row)" size="small">修改</el-button> |
| | | <el-button link type="primary" @click="deleteD(scope.row)" size="small">删除</el-button> |
| | | <el-button link type="primary" @click="openStandard('查看', scope.row)" size="small" :disabled="disabled">查看</el-button> |
| | | <el-button link type="primary" @click="openStandard('修改', scope.row)" size="small" :disabled="disabled">修改</el-button> |
| | | <el-button link type="primary" @click="deleteD(scope.row)" size="small" :disabled="disabled">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="resetForm">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm">确定</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)">关闭</el-button> |
| | | <el-button type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <categoryDailog ref="categoryShow"></categoryDailog> |
| | | <categoryDailog ref="categoryShow" @typeId="Tid"></categoryDailog> |
| | | <RegionsDialog ref="planShow" @SearchUser="onUser"></RegionsDialog> |
| | | <DailogSearchUser ref="UserOneShow" @SearchUser="userId"></DailogSearchUser> |
| | | <!-- <DailogSearchUser ref="UserTwoShow" @SearchUser="userId"></DailogSearchUser>--> |
| | | <!-- <DailogSearchUser ref="UserThreeShow" @SearchUser="userId"></DailogSearchUser>--> |
| | | <DailogSearchUser ref="UserShow" @SearchUser="userId"></DailogSearchUser> |
| | | <maintenanceDailog ref="maintenanceShow" @onMain="main"></maintenanceDailog> |
| | | <detectDailog ref="detectShow" @onDelect="delect"></detectDailog> |
| | | <repairDailog ref="repairShow" @onRepair="Repair"></repairDailog> |
| | | <standardDailog ref="standardShow" @onStand="Stand"></standardDailog> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref } from 'vue'; |
| | | import { defineComponent, ref ,reactive} from 'vue'; |
| | | import { Search, Plus, FullScreen } from '@element-plus/icons-vue'; |
| | | import { timeDate } from '/@/assets/index.ts'; |
| | | import categoryDailog from './categoryDailog.vue'; |
| | |
| | | import repairDailog from './repairDailog.vue'; |
| | | import standardDailog from './standardDailog.vue'; |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import { ElMessage, ElMessageBox } from 'element-plus'; |
| | | import { ElMessage, ElMessageBox ,FormInstance ,FormRules,} from 'element-plus'; |
| | | import type { UploadProps, UploadUserFile } from 'element-plus'; |
| | | import { facilityManagementApi } from '/@/api/facilityManagement'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | import {deepClone} from '/@/utils/other' |
| | | export default defineComponent({ |
| | | components: { categoryDailog, RegionsDialog, DailogSearchUser, maintenanceDailog, detectDailog, repairDailog, standardDailog }, |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref(false); |
| | | const form = ref({ |
| | | equipmentTypeId: '', |
| | | |
| | | equipmentTypeId: 1, |
| | | equipmentTypeName:"", |
| | | treatment: '', |
| | | |
| | | inputPersonId: '', |
| | | inputPersonName:'', |
| | | inputPersonName: '', |
| | | departmentId: '', |
| | | |
| | | delRepaireDetailList: [], |
| | | // delRepaireDetailList: [], |
| | | |
| | | delTestDetailList: [], |
| | | // delTestDetailList: [], |
| | | |
| | | takecareDetailList: [], |
| | | checkDetailList: [], |
| | | |
| | | responsibilityPersonId: '', |
| | | responsibilityPersonName:'', |
| | | delTakecareStardardeDetailList: [], |
| | | responsibilityPersonName: '', |
| | | // delTakecareStardardeDetailList: [], |
| | | |
| | | connectPersonId: '', |
| | | connectPersonName:'', |
| | | connectPersonName: '', |
| | | |
| | | scenePic: '', |
| | | |
| | |
| | | toDangerous: '', |
| | | |
| | | dangerousElement: '', |
| | | memo:'', |
| | | |
| | | takecareStardardeDetailList: [ |
| | | { |
| | |
| | | testDetailList: [], |
| | | checkCycle: '', |
| | | repaireDetailList: [], |
| | | delCheckStandardeDetailList: [], |
| | | // delCheckStandardeDetailList: [], |
| | | |
| | | leadingPersonName: '', |
| | | |
| | | name: '', |
| | | |
| | | delTakecareDetailList: [], |
| | | // delTakecareDetailList: [], |
| | | |
| | | position: '', |
| | | |
| | | emergencePlanId: '', |
| | | emergencePlanId: '', |
| | | emergencePlanName:'', |
| | | |
| | | checkStandardeDetailList: [], |
| | | infoTpe: '', |
| | |
| | | |
| | | delTestDetails: '', |
| | | }); |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const titles = ref(); |
| | | const titleT = ref(); |
| | | const disabled = ref(false); |
| | | const Dailogtype = ref(false); |
| | | const openDailog = (title: string, type: boolean, id: number, num: any) => { |
| | | dialogVisible.value = true; |
| | | titleT.value = title; |
| | | department(); |
| | | Dailogtype.value = type; |
| | | if (num == 0) { |
| | |
| | | form.value.delRepaireDetails = deleteCId.value.toString(); |
| | | form.value.delCheckStandardeDetails = deleteDId.value.toString(); |
| | | dialogVisible.value = false; |
| | | if (titleT.value == '新建') { |
| | | delete form.value.id; |
| | | delete form.value.infoTpe |
| | | } |
| | | facilityManagementApi() |
| | | .getkeypointEquipmentInfoAddOrUpdate(form.value) |
| | | .then((res) => { |
| | |
| | | // form.value = null; |
| | | }; |
| | | // 取消 |
| | | const resetForm = () => { |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | dialogVisible.value = false; |
| | | form.value={} |
| | | }; |
| | | const activeName = ref('first'); |
| | | const index = ref<any>(); |
| | |
| | | }; |
| | | const onUser = (e: any) => { |
| | | form.value.emergencePlanId = e.id; |
| | | form.value.emergencePlanName=e.name |
| | | }; |
| | | |
| | | const UserOneShow = ref(); |
| | | // const UserTwoShow = ref(); |
| | | // const UserThreeShow = ref(); |
| | | const openUser = (type: number) => { |
| | | // if (type == 0) { |
| | | // UserOneShow.value.openDailog(); |
| | | // } else if (type == 1) { |
| | | // UserTwoShow.value.openDailog(); |
| | | // } else if (type == 2) { |
| | | // UserThreeShow.value.openDailog(); |
| | | // } |
| | | UserOneShow.value.openDailog(); |
| | | const UserShow = ref(); |
| | | const openUser = (type: any) => { |
| | | UserShow.value.openDailog(type); |
| | | }; |
| | | const userId = ( type: number,val: any) => { |
| | | if (type == 0) { |
| | | form.value.connectPersonId = val.uid; |
| | | form.value.connectPersonName = val.realName; |
| | | } else if (type == 1) { |
| | | form.value.inputPersonId = val.uid; |
| | | form.value.inputPersonName = val.username; |
| | | const userId = (val: any, type: number) => { |
| | | if (type == 1) { |
| | | form.value.connectPersonId = val.uid; |
| | | form.value.connectPersonName = val.realName; |
| | | } else if (type == 2) { |
| | | form.value.responsibilityPersonId = val.id; |
| | | form.value.responsibilityPersonName = val.username; |
| | | form.value.inputPersonId = val.uid; |
| | | form.value.inputPersonName = val.realName; |
| | | } else if (type == 3) { |
| | | form.value.responsibilityPersonId = val.id; |
| | | form.value.responsibilityPersonName = val.realName; |
| | | } |
| | | }; |
| | | const Tid=(data:any)=>{ |
| | | form.value.equipmentTypeId=data.id |
| | | form.value.equipmentTypeName=data.typeName |
| | | } |
| | | const maintenanceShow = ref(); |
| | | const openMaintenance = (title: string, data: any) => { |
| | | index.value = form.value.takecareDetailList.indexOf(data); |
| | |
| | | deleteDId.value.push(tag.id); |
| | | }; |
| | | // 回传 |
| | | const main = (val: any) => { |
| | | const main = (data: any) => { |
| | | let val=deepClone(data) |
| | | if (index.value == -1) { |
| | | form.value.takecareDetailList.push(val); |
| | | } else { |
| | | form.value.takecareDetailList[index.value] = val; |
| | | } |
| | | }; |
| | | const delect = (val: any) => { |
| | | const delect = (data: any) => { |
| | | let val=deepClone(data) |
| | | if (index.value == -1) { |
| | | form.value.testDetailList.push(val); |
| | | } else { |
| | | form.value.testDetailList[index.value] = val; |
| | | } |
| | | }; |
| | | const Repair = (val: any) => { |
| | | const Repair = (data: any) => { |
| | | let val=deepClone(data) |
| | | if (index.value == -1) { |
| | | form.value.repaireDetailList.push(val); |
| | | } else { |
| | | form.value.repaireDetailList[index.value] = val; |
| | | } |
| | | }; |
| | | const Stand = (val: any) => { |
| | | const Stand = (data: any) => { |
| | | let val=deepClone(data) |
| | | if (index.value == -1) { |
| | | form.value.checkStandardeDetailList.push(val); |
| | | } else { |
| | | form.value.checkStandardeDetailList[index.value] = val; |
| | | } |
| | | }; |
| | | |
| | | const rules = reactive<FormRules>({ |
| | | equipmentTypeId: [], |
| | | equipmentTypeName:[], |
| | | }) |
| | | //图片提交 |
| | | const imageUrl = ref(''); |
| | | |
| | |
| | | delect, |
| | | Repair, |
| | | Stand, |
| | | ruleFormRef, |
| | | index, |
| | | activeName, |
| | | categoryShow, |
| | |
| | | planShow, |
| | | onUser, |
| | | openPlan, |
| | | UserOneShow, |
| | | // UserTwoShow, |
| | | // UserThreeShow, |
| | | UserShow, |
| | | openUser, |
| | | rules, |
| | | maintenanceShow, |
| | | openMaintenance, |
| | | detectShow, |
| | |
| | | full, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | Tid, |
| | | resetForm, |
| | | deleteAId, |
| | | deleteBId, |
| | |
| | | deleteC, |
| | | deleteD, |
| | | timeDate, |
| | | titleT, |
| | | }; |
| | | }, |
| | | }); |