| | |
| | | <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="accidentDepartmentId" :disabled="true" :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-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" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="人员伤亡事故" value="人员伤亡事故"></el-option> |
| | | <el-option label="火灾爆炸事故" value="火灾爆炸事故"></el-option> |
| | | <el-option label="危险品泄露事故" value="危险品泄露事故"></el-option> |
| | | <el-option label="设备事故" value="设备事故"></el-option> |
| | | <el-option label="工艺事故" value="工艺事故"></el-option> |
| | | <el-option label="人员伤亡事故" value="1"></el-option> |
| | | <el-option label="火灾爆炸事故" value="2"></el-option> |
| | | <el-option label="危险品泄露事故" value="3"></el-option> |
| | | <el-option label="设备事故" value="4"></el-option> |
| | | <el-option label="工艺事故" value="5"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </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" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="特别重大" value="人员伤亡事故"></el-option> |
| | | <el-option label="重大" value="重大"></el-option> |
| | | <el-option label="较大" value="较大"></el-option> |
| | | <el-option label="一般" value="一般"></el-option> |
| | | <el-option label="一级" value="1"></el-option> |
| | | <el-option label="二级" value="2"></el-option> |
| | | <el-option label="三级" value="3"></el-option> |
| | | <el-option label="四级" value="4"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </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" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="特大事故" value="特大事故"></el-option> |
| | | <el-option label="重大事故" value="重大事故"></el-option> |
| | | <el-option label="较大事故" value="较大事故"></el-option> |
| | | <el-option label="一般事故" value="一般事故"></el-option> |
| | | <el-option label="特大事故" value="1"></el-option> |
| | | <el-option label="重大事故" value="2"></el-option> |
| | | <el-option label="较大事故" value="3"></el-option> |
| | | <el-option label="一般事故" value="4"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </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" :disabled="disabled" |
| | | 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" :disabled="disabled" |
| | | 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" :disabled="true" |
| | | 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> |
| | | </el-col> |
| | | <!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">--> |
| | | <!-- <el-form-item label="事故照片">--> |
| | | <!-- <el-input v-model="ruleForm.describe" type="textarea" placeholder="请填写应急防范措施" maxlength="150"></el-input>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="事故照片"> |
| | | <uploaderImg :fileList="ruleForm.expressFileList" :disabled="true"></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="relevantPersonnelRecords"> |
| | | <el-input v-model="ruleForm.relevantPersonnelRecords" :disabled="disabled" |
| | | 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> |
| | | </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" :disabled="disabled"></uploaderImg> |
| | | <el-form-item label="事故分析会议纪要"> |
| | | <uploaderFile |
| | | :fileList="fileList" |
| | | :systemName="'INCIDENT_MANAGE'" |
| | | :disabled="disabled" |
| | | @successUploader="successUploader" |
| | | ></uploaderFile> |
| | | </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" :disabled="disabled" |
| | | 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" /> |
| | | <DailogSearchUserManger @SearchUser="onUser" ref="userRef" /> |
| | | <DailogSearchUserManger @SearchUser="onUser" ref="userRef" /> |
| | | <RegionsDialog ref="openRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { reactive, ref, defineComponent,onMounted } from 'vue'; |
| | | import { reactive, ref, defineComponent, onMounted } from 'vue'; |
| | | |
| | | import type { UploadUserFile, FormInstance, FormRules } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | |
| | | import AccidentName from '/@/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue'; |
| | | import RegionsDialog from '/@/components/regionsDialog/index.vue'; |
| | | import uploaderImg from '/@/components/uploaderImg/index.vue'; |
| | | import uploaderFile from '/@/components/uploaderFile/index.vue'; |
| | | import { emergencySuppliesApi } from '/@/api/contingencyManagement/emergencyResources'; |
| | | import { accidentManagementSystemApi } from '/@/api/workInjuryDeclaration'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | |
| | | AccidentName, |
| | | DailogSearchUserManger, |
| | | RegionsDialog, |
| | | uploaderImg |
| | | uploaderImg, |
| | | uploaderFile, |
| | | }, |
| | | setup(props, { emit }) { |
| | | const isShowDialog = ref(false); |
| | |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | //定义表单 |
| | | const ruleForm = ref({ |
| | | accidentExpressId:'', |
| | | accidentExpressId: '', |
| | | |
| | | accidentType: '', |
| | | accidentGrade: '', |
| | |
| | | rectificationMeasures: '', |
| | | accidentHandling: '', |
| | | fillInUserUid: '', |
| | | fillInUserName:'', |
| | | fillInUserName: '', |
| | | fillInTime: '', |
| | | relevantPersonnelRecords: '', |
| | | otherMaterials: '', |
| | | fileList: [], |
| | | status:'' |
| | | status: '', |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | | const statusDisabled = ref(true) |
| | | const statusDisabled = ref(true); |
| | | // 上传附件 |
| | | const fileList = ref([]); |
| | | // 打开弹窗 |
| | | const openDialog = (title: string, id: number, type: boolean,statusDisabledFlag:string) => { |
| | | 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 (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 |
| | | statusDisabled.value = false; |
| | | } else { |
| | | statusDisabled.value = true; |
| | | } |
| | | if (title == '查看事故报告' || title == '修改事故报告') { |
| | | accidentManagementSystemApi() |
| | |
| | | .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 |
| | | accidentName.value = res.data.data.accidentName; |
| | | accidentDepartmentId.value = res.data.data.accidentDepartmentId; |
| | | occurrencePlace.value = res.data.data.occurrencePlace; |
| | | occurrenceTime.value = res.data.data.occurrenceTime; |
| | | fileList.value = res.data.data.fileList ? res.data.data.fileList : []; |
| | | initFileListData(); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | const initFileListData = async () => { |
| | | //事故照片 |
| | | if (ruleForm.value.expressFileList) { |
| | | for (var a = 0; a < ruleForm.value.expressFileList.length; a++) { |
| | | await goalManagementApi() |
| | | .searchFile(ruleForm.value.expressFileList[a].fileName) |
| | | .then((res) => { |
| | | ruleForm.value.expressFileList[a].url = res.data; |
| | | console.log('ruleForm', ruleForm); |
| | | }); |
| | | } |
| | | } else { |
| | | ruleForm.value.expressFileList = []; |
| | | } |
| | | |
| | | // 事故分析会议纪要 |
| | | for (var a = 0; a < fileList.value.length; a++) { |
| | | fileList.value[a].name = fileList.value[a].fileName; |
| | | } |
| | | }; |
| | | // 上传成功组装数据 |
| | | const successUploader = (list) => { |
| | | fileList.value = list; |
| | | const formFileList = []; |
| | | for (var a = 0; a < fileList.value.length; a++) { |
| | | formFileList.push({ |
| | | fileName: fileList.value[a].fileName, |
| | | fileUrl: '', |
| | | }); |
| | | } |
| | | ruleForm.value.fileList = formFileList; |
| | | }; |
| | | // 取消 |
| | | const onCancel = (formEl: FormInstance | undefined) => { |
| | |
| | | }; |
| | | //日期选择器 |
| | | const value1 = ref(''); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]); |
| | | |
| | | // 可选择树 |
| | | const treeSelect = ref(); |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref(); |
| | | const data = [ |
| | | ]; |
| | | const data = []; |
| | | // 必填项提示 |
| | | const rules = reactive<FormRules>({ |
| | | accidentExpressId: [ |
| | |
| | | }, |
| | | ], |
| | | }); |
| | | const accidentDepartmentId = ref() |
| | | const occurrencePlace = ref() |
| | | const occurrenceTime = ref() |
| | | const accidentName = ref() |
| | | 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 |
| | | accidentName.value = item[0].accidentName |
| | | accidentDepartmentId.value = item[0].accidentDepartmentId |
| | | occurrencePlace.value = item[0].occurrencePlace |
| | | occurrenceTime.value = item[0].occurrenceTime |
| | | ruleForm.value.accidentExpressId = item[0].id; |
| | | 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 |
| | | |
| | | delete ruleForm.value.accidentName; |
| | | delete ruleForm.value.accidentDepartmentId; |
| | | delete ruleForm.value.occurrencePlace; |
| | | delete ruleForm.value.occurrenceTime; |
| | | if (!ruleForm.value.fileList) { |
| | | ruleForm.value.fileList = []; |
| | | } |
| | | if (title == '新建事故报告') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | //TODO 上传组件待定 |
| | | ruleForm.value.fileList = [] |
| | | isShowDialog.value = false; |
| | | accidentManagementSystemApi() |
| | | .editAccidentReport(ruleForm.value) |
| | |
| | | }); |
| | | formEl.resetFields(); |
| | | ruleForm.value = { |
| | | accidentExpressId:'', |
| | | accidentExpressId: '', |
| | | |
| | | accidentType: '', |
| | | accidentGrade: '', |
| | |
| | | rectificationMeasures: '', |
| | | accidentHandling: '', |
| | | fillInUserUid: '', |
| | | fillInUserName:'', |
| | | fillInUserName: '', |
| | | fillInTime: '', |
| | | relevantPersonnelRecords: '', |
| | | otherMaterials: '', |
| | | fileList: [], |
| | | status:'' |
| | | status: '', |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | // ruleForm.value.accidentExpressId = item[0].id |
| | | ruleForm.value = {} |
| | | accidentName.value = '' |
| | | accidentDepartmentId.value = '' |
| | | occurrencePlace.value = '' |
| | | occurrenceTime.value = '' |
| | | ruleForm.value = {}; |
| | | fileList.value = []; |
| | | accidentName.value = ''; |
| | | accidentDepartmentId.value = ''; |
| | | occurrencePlace.value = ''; |
| | | occurrenceTime.value = ''; |
| | | }; |
| | | const handleChange = (val: number) => { |
| | | console.log(val); |
| | |
| | | //得到部门树 |
| | | const department = async () => { |
| | | await goalManagementApi() |
| | | .getTreedepartment() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | getTreeList(res.data.data, newTreeList); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | .getTreedepartment() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | getTreeList(res.data.data, newTreeList); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | }; |
| | | // 递归树状数据且修改字段名 |
| | | const getTreeList = (treeList, newTreeList) => { |
| | |
| | | accidentDepartmentId, |
| | | occurrencePlace, |
| | | occurrenceTime, |
| | | accidentName |
| | | accidentName, |
| | | successUploader, |
| | | initFileListData, |
| | | }; |
| | | }, |
| | | }); |