| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog :title="titles" v-model="isShowDialog" width="800px" draggable :fullscreen="full" @close="closeDialog(ruleFormRef)"> |
| | | <el-dialog :title="titles" v-model="isShowDialog" width="800px" draggable :fullscreen="full" @close="resetForm(ruleFormRef)"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form ref="ruleFormRef" :model="ruleForm" size="default" :rules="rules" label-width="140px" :disabled="disabled"> |
| | | <el-form ref="ruleFormRef" :model="ruleForm" size="default" :rules="rules" label-width="140px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故快报" prop="accidentName"> |
| | | <el-input v-model="ruleForm.accidentName" placeholder="请选择" class="input-with-select"> |
| | | <el-form-item label="事故快报" prop="accidentExpressId"> |
| | | <el-input v-model="accidentName" :disabled="true" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="daiInpt" /> |
| | | </template> |
| | |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故部门" placeholder="请选择" prop="accidentDepartmentId"> |
| | | <!--<el-input v-model="ruleForm.accidentDepartmentName" class="input-with-select" />--> |
| | | <el-tree-select v-model="ruleForm.accidentDepartmentId" :data="newTreeList" :props="propse" class="w100" placeholder="请选择" /> |
| | | <el-tree-select v-model="accidentDepartmentId" :disabled="true" :data="newTreeList" |
| | | :props="propse" class="w100" placeholder="请选择" /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故发生地点" prop="occurrencePlace"> |
| | | <el-input v-model="ruleForm.occurrencePlace" placeholder="请填写发生地点"></el-input> |
| | | <el-input v-model="occurrencePlace" :disabled="true" placeholder="请填写发生地点"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="发生时间" prop="occurrenceTime"> |
| | | <el-date-picker |
| | | v-model="ruleForm.occurrenceTime" |
| | | v-model="occurrenceTime" |
| | | :disabled="true" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="datetime" |
| | | class="w100" |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故类别" prop="accidentType"> |
| | | <el-select v-model="ruleForm.accidentType" class="w100" placeholder="请选择"> |
| | | <el-select v-model="ruleForm.accidentType" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="人员伤亡事故" value="人员伤亡事故"></el-option> |
| | | <el-option label="火灾爆炸事故" value="火灾爆炸事故"></el-option> |
| | | <el-option label="危险品泄露事故" value="危险品泄露事故"></el-option> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故等级" prop="accidentGrade"> |
| | | <el-select v-model="ruleForm.accidentGrade" class="w100" placeholder="请选择"> |
| | | <el-select v-model="ruleForm.accidentGrade" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="特别重大" value="人员伤亡事故"></el-option> |
| | | <el-option label="重大" value="重大"></el-option> |
| | | <el-option label="较大" value="较大"></el-option> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="经济损失" prop="economicLoss"> |
| | | <el-input v-model="ruleForm.economicLoss" placeholder="请填写经济损失"></el-input> |
| | | <el-input v-model="ruleForm.economicLoss" :disabled="disabled" placeholder="请填写经济损失"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="轻伤人数" prop="minorInjuryNum"> |
| | | <el-input v-model="ruleForm.minorInjuryNum" placeholder="请填写轻伤人数"></el-input> |
| | | <el-input v-model="ruleForm.minorInjuryNum" :disabled="disabled" placeholder="请填写轻伤人数"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="重伤人数" prop="seriousInjuryNum"> |
| | | <el-input v-model="ruleForm.seriousInjuryNum" placeholder="请填写重伤人数"></el-input> |
| | | <el-input v-model="ruleForm.seriousInjuryNum" :disabled="disabled" placeholder="请填写重伤人数"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="死亡人数" prop="deathNum"> |
| | | <el-input v-model="ruleForm.deathNum" placeholder="请填写死亡人数"></el-input> |
| | | <el-input v-model="ruleForm.deathNum" :disabled="disabled" placeholder="请填写死亡人数"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故原因" prop="accidentCause"> |
| | | <el-input v-model="ruleForm.accidentCause" placeholder="请填写事故原因"></el-input> |
| | | <el-input v-model="ruleForm.accidentCause" :disabled="disabled" placeholder="请填写事故原因"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="要求报告完成期限" prop="reportDeadline"> |
| | | <el-date-picker |
| | | v-model="ruleForm.reportDeadline" |
| | | :disabled="disabled" |
| | | type="datetime" |
| | | class="w100" |
| | | placeholder="选择日期时间" |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故级别" prop="accidentLevel"> |
| | | <el-select v-model="ruleForm.accidentLevel" class="w100" placeholder="请选择"> |
| | | <el-select v-model="ruleForm.accidentLevel" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="特大事故" value="特大事故"></el-option> |
| | | <el-option label="重大事故" value="重大事故"></el-option> |
| | | <el-option label="较大事故" value="较大事故"></el-option> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故延期申请" prop="accidentDelayApply"> |
| | | <el-input v-model="ruleForm.accidentDelayApply" placeholder="请填写事故延期申请"></el-input> |
| | | <el-input v-model="ruleForm.accidentDelayApply" :disabled="disabled" placeholder="请填写事故延期申请"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="原因综合分析(直接分析)" prop="comprehensiveAnalysisDirect"> |
| | | <el-input |
| | | v-model="ruleForm.comprehensiveAnalysisDirect" |
| | | :disabled="disabled" |
| | | type="textarea" |
| | | placeholder="请填写原因综合分析(直接分析)" |
| | | maxlength="150" |
| | |
| | | <el-form-item label="原因综合分析(间接分析)" prop="comprehensiveAnalysisIndirect"> |
| | | <el-input |
| | | v-model="ruleForm.comprehensiveAnalysisIndirect" |
| | | :disabled="disabled" |
| | | type="textarea" |
| | | placeholder="请填写原因综合分析(间接分析)" |
| | | maxlength="150" |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="整改措施" prop="rectificationMeasures"> |
| | | <el-input v-model="ruleForm.rectificationMeasures" type="textarea" placeholder="请填写整改措施" maxlength="150"></el-input> |
| | | <el-input v-model="ruleForm.rectificationMeasures" :disabled="disabled" |
| | | type="textarea" placeholder="请填写整改措施" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故处理" prop="accidentHandling"> |
| | | <el-input v-model="ruleForm.accidentHandling" type="textarea" placeholder="请填写事故处理" maxlength="150"></el-input> |
| | | <el-input v-model="ruleForm.accidentHandling" :disabled="disabled" |
| | | type="textarea" placeholder="请填写事故处理" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="填写人" prop="fillInUserName"> |
| | | <el-input v-model="ruleForm.fillInUserName" placeholder="请选择" class="input-with-select"> |
| | | <el-input v-model="ruleForm.fillInUserName" :disabled="true" |
| | | placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser" /> |
| | | </template> |
| | |
| | | <el-form-item label="填写日期" prop="fillInTime"> |
| | | <el-date-picker |
| | | v-model="ruleForm.fillInTime" |
| | | :disabled="disabled" |
| | | type="datetime" |
| | | class="w100" |
| | | placeholder="选择日期时间" |
| | |
| | | <!-- </el-col>--> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="相关人员笔录" prop="relevantPersonnelRecords"> |
| | | <el-input v-model="ruleForm.relevantPersonnelRecords" type="textarea" placeholder="请填写相关人员笔录" maxlength="150"></el-input> |
| | | <el-input v-model="ruleForm.relevantPersonnelRecords" :disabled="disabled" |
| | | type="textarea" placeholder="请填写相关人员笔录" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故状态" prop="status"> |
| | | <el-select v-model="ruleForm.status" :disabled="statusDisabled" class="w100" placeholder="请选择"> |
| | | <el-option label="处理中" :value="1"></el-option> |
| | | <el-option label="已处理" :value="2"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="事故分析会议纪要" prop="fileList"> |
| | | <uploaderImg :fileList="fileList"></uploaderImg> |
| | | <uploaderImg :fileList="fileList" :disabled="disabled"></uploaderImg> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="其他材料" prop="otherMaterials"> |
| | | <el-input v-model="ruleForm.otherMaterials" type="textarea" placeholder="请填写其他材料" maxlength="150"></el-input> |
| | | <el-input v-model="ruleForm.otherMaterials" :disabled="disabled" |
| | | type="textarea" placeholder="请填写其他材料" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | </template> |
| | | </el-dialog> |
| | | <AccidentName @selectItem="onSelectItem" ref="Shows" /> |
| | | <DailogSearchUser @SearchUser="onUser" ref="userRef" /> |
| | | <DailogSearchUserManger @SearchUser="onUser" ref="userRef" /> |
| | | <RegionsDialog ref="openRef" /> |
| | | </div> |
| | | </template> |
| | |
| | | import type { UploadUserFile, FormInstance, FormRules } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import DailogSearchUserManger from '/@/components/DailogSearchUserManger/index.vue'; |
| | | import AccidentName from '/@/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue'; |
| | | import RegionsDialog from '/@/components/regionsDialog/index.vue'; |
| | | import uploaderImg from '/@/components/uploaderImg/index.vue'; |
| | | import { emergencySuppliesApi } from '/@/api/emergencyResources'; |
| | | import { emergencySuppliesApi } from '/@/api/contingencyManagement/emergencyResources'; |
| | | import { accidentManagementSystemApi } from '/@/api/workInjuryDeclaration'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | |
| | |
| | | name: 'openAdd', |
| | | components: { |
| | | AccidentName, |
| | | DailogSearchUser, |
| | | DailogSearchUserManger, |
| | | RegionsDialog, |
| | | uploaderImg |
| | | }, |
| | |
| | | //定义表单 |
| | | const ruleForm = ref({ |
| | | accidentExpressId:'', |
| | | accidentExpressName:'', |
| | | accidentDepartmentId:'', |
| | | accidentDepartmentName:'', |
| | | occurrencePlace:'', |
| | | occurrenceTime:'', |
| | | |
| | | |
| | | |
| | | accidentType: '', |
| | | accidentGrade: '', |
| | |
| | | relevantPersonnelRecords: '', |
| | | otherMaterials: '', |
| | | fileList: [], |
| | | status:'' |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | | const statusDisabled = ref(true) |
| | | // 打开弹窗 |
| | | const openDialog = (title: string, id: number, type: boolean) => { |
| | | const openDialog = (title: string, id: number, type: boolean,statusDisabledFlag:string) => { |
| | | isShowDialog.value = true; |
| | | titles.value = title; |
| | | disabled.value = type; |
| | | if(statusDisabledFlag.value=='first'){ |
| | | ruleForm.value.status = 1 |
| | | }else if(statusDisabledFlag.value=='second'){ |
| | | ruleForm.value.status = 2 |
| | | } |
| | | if (title == '修改事故报告') { |
| | | statusDisabled.value = false |
| | | }else { |
| | | statusDisabled.value = true |
| | | } |
| | | if (title == '查看事故报告' || title == '修改事故报告') { |
| | | accidentManagementSystemApi() |
| | | .seeAccidentReport(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ruleForm.value = res.data.data; |
| | | accidentName.value = res.data.data.accidentName |
| | | accidentDepartmentId.value = res.data.data.accidentDepartmentId |
| | | occurrencePlace.value = res.data.data.occurrencePlace |
| | | occurrenceTime.value = res.data.data.occurrenceTime |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = (formEl: FormInstance | undefined) => { |
| | | formEl.resetFields(); |
| | | console.log(ruleForm) |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = (formEl: FormInstance | undefined) => { |
| | | closeDialog(formEl); |
| | | resetForm(formEl); |
| | | }; |
| | | //日期选择器 |
| | | const value1 = ref(''); |
| | |
| | | ]; |
| | | // 必填项提示 |
| | | const rules = reactive<FormRules>({ |
| | | accidentDepartmentId: [ |
| | | accidentExpressId: [ |
| | | { |
| | | required: true, |
| | | message: '事故部门不能为空', |
| | | message: '快报不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | occurrenceTime: [ |
| | | { |
| | | required: true, |
| | | message: '发生时间不能为空', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | accidentType: [ |
| | |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | fillInUserUid: [ |
| | | fillInUserName: [ |
| | | { |
| | | required: true, |
| | | message: '填写人不能为空', |
| | |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | status: [ |
| | | { |
| | | required: true, |
| | | message: '事故状态不能为空', |
| | | trigger: 'change', |
| | | }, |
| | | ], |
| | | }); |
| | | const accidentDepartmentId = ref() |
| | | const occurrencePlace = ref() |
| | | const occurrenceTime = ref() |
| | | const accidentName = ref() |
| | | //事故快报回填 |
| | | const onSelectItem = (item: any) => { |
| | | console.log('item', item[0]); |
| | | ruleForm.value.accidentExpressId = item[0].id |
| | | ruleForm.value.accidentName = item[0].accidentName |
| | | ruleForm.value.accidentDepartmentId = item[0].accidentDepartmentId |
| | | ruleForm.value.accidentDepartmentName = item[0].deptName |
| | | ruleForm.value.occurrencePlace = item[0].occurrencePlace |
| | | ruleForm.value.occurrenceTime = item[0].occurrenceTime |
| | | accidentName.value = item[0].accidentName |
| | | accidentDepartmentId.value = item[0].accidentDepartmentId |
| | | occurrencePlace.value = item[0].occurrencePlace |
| | | occurrenceTime.value = item[0].occurrenceTime |
| | | }; |
| | | // 表单提交验证必填项 |
| | | const submitForm = async (title: string, formEl: FormInstance | undefined) => { |
| | | delete ruleForm.value.accidentName |
| | | delete ruleForm.value.accidentDepartmentId |
| | | delete ruleForm.value.occurrencePlace |
| | | delete ruleForm.value.occurrenceTime |
| | | |
| | | if (title == '新建事故报告') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | |
| | | formEl.resetFields(); |
| | | ruleForm.value = { |
| | | accidentExpressId:'', |
| | | accidentExpressName:'', |
| | | accidentDepartmentId:'', |
| | | accidentDepartmentName:'', |
| | | occurrencePlace:'', |
| | | occurrenceTime:'', |
| | | |
| | | |
| | | |
| | | accidentType: '', |
| | | accidentGrade: '', |
| | |
| | | relevantPersonnelRecords: '', |
| | | otherMaterials: '', |
| | | fileList: [], |
| | | status:'' |
| | | }; |
| | | } |
| | | }; |
| | |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | // ruleForm.value.accidentExpressId = item[0].id |
| | | accidentName.value = '' |
| | | accidentDepartmentId.value = '' |
| | | occurrencePlace.value = '' |
| | | occurrenceTime.value = '' |
| | | }; |
| | | const handleChange = (val: number) => { |
| | | console.log(val); |
| | |
| | | }; |
| | | return { |
| | | openDialog, |
| | | closeDialog, |
| | | isShowDialog, |
| | | onCancel, |
| | | fileList, |
| | |
| | | newTreeList, |
| | | department, |
| | | getTreeList, |
| | | propse |
| | | propse, |
| | | statusDisabled, |
| | | accidentDepartmentId, |
| | | occurrencePlace, |
| | | occurrenceTime, |
| | | accidentName |
| | | }; |
| | | }, |
| | | }); |