| | |
| | | /> |
| | | </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" |
| | |
| | | </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"> |
| | |
| | | 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 titles = ref(); |
| | | const disabled = ref(); |
| | | const statusDisabled = ref(true) |
| | | // 上传附件 |
| | | const fileList = ref([]); |
| | | // 打开弹窗 |
| | | const openDialog = (title: string, id: number, type: boolean,statusDisabledFlag:string) => { |
| | | isShowDialog.value = true; |
| | |
| | | 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) => { |
| | | resetForm(formEl); |
| | | }; |
| | | //日期选择器 |
| | | const value1 = ref(''); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]); |
| | | |
| | | // 可选择树 |
| | | const treeSelect = ref(); |
| | | //定义树形下拉框 |
| | |
| | | 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) |
| | |
| | | }; |
| | | } |
| | | }; |
| | | |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | // ruleForm.value.accidentExpressId = item[0].id |
| | | ruleForm.value = {} |
| | | fileList.value = [] |
| | | accidentName.value = '' |
| | | accidentDepartmentId.value = '' |
| | | occurrencePlace.value = '' |
| | |
| | | accidentDepartmentId, |
| | | occurrencePlace, |
| | | occurrenceTime, |
| | | accidentName |
| | | accidentName, |
| | | successUploader, |
| | | initFileListData |
| | | }; |
| | | }, |
| | | }); |