| | |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故原因" prop="accidentCause"> |
| | | <el-select v-model="ruleForm.accidentCause" :disabled="disabled" class="w100" placeholder="请选择"> |
| | | <el-option label="人的不安全行为" value="1"></el-option> |
| | | <el-option label="物的不安全状态" value="2"></el-option> |
| | | <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="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="是否有伤亡" prop="casualties"> |
| | | <!-- <el-radio-group v-model="ruleForm.casualties" :disabled="disabled" @change="typeChang">--> |
| | | <!-- <el-radio :label="true">是</el-radio>--> |
| | | <!-- <el-radio :label="false">否</el-radio>--> |
| | | <!-- </el-radio-group>--> |
| | | <el-radio-group v-model="ruleForm.casualties" :disabled="disabled" @change="typeChang"> |
| | | <el-radio :label="true">是</el-radio> |
| | | <el-radio :label="false">否</el-radio> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | <el-button v-if="ruleForm.casualties" type="primary" style="margin-left: 20px" |
| | | :icon="Edit" @click="openDai(ruleFormRef)" round plain /> |
| | |
| | | emergencyPrecautions: '', |
| | | accidentCausesPreliminaryAnalysis: '', |
| | | accidentBriefProcess: '', |
| | | casualties: '', |
| | | accidentCause: '', |
| | | casualties: null, |
| | | accidentCause: null, |
| | | occurrenceTime: '', |
| | | occurrencePlace: '', |
| | | accidentDepartmentId: '', |
| | | accidentName: '', |
| | | fileList: [], |
| | | id: '', |
| | | id: null, |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ruleForm.value = res.data.data; |
| | | if(res.data.data.casualties == true){ruleForm.value.casualties = 1} |
| | | if(res.data.data.casualties == false){ruleForm.value.casualties = 0} |
| | | fileList.value = (res.data.data.fileList?res.data.data.fileList:[]) |
| | | initFileListData() |
| | | } |
| | |
| | | if(!ruleForm.value.fileList){ |
| | | ruleForm.value.fileList = [] |
| | | } |
| | | // ruleForm.value.casualties = false |
| | | if (title == '新建事故快报') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | if(ruleForm.value.id==null||ruleForm.value.id==''){ |
| | | ruleForm.value.id = null; |
| | | accidentManagementSystemApi() |
| | |
| | | emit('myAdd', true); |
| | | } |
| | | formEl.resetFields(); |
| | | isShowDialog.value = false; |
| | | }); |
| | | }else { |
| | | ElMessage({ |
| | |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | isShowDialog.value = false; |
| | | } |
| | | |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | |
| | | }; |
| | | const closeDialog = (formEl: FormInstance | undefined) => { |
| | | formEl.resetFields(); |
| | | ruleForm.value = { |
| | | emergencyPrecautions: '', |
| | | accidentCausesPreliminaryAnalysis: '', |
| | | accidentBriefProcess: '', |
| | | casualties: null, |
| | | accidentCause: '', |
| | | occurrenceTime: '', |
| | | occurrencePlace: '', |
| | | accidentDepartmentId: '', |
| | | accidentName: '', |
| | | fileList: [], |
| | | id: null, |
| | | } |
| | | fileList.value = [] |
| | | console.log(ruleForm); |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 是否有伤亡弹窗 |
| | | const typeChang = () => { |
| | | console.log('tag', ruleForm); |
| | | console.log('tag', ruleForm.value); |
| | | }; |
| | | const ShowUser = ref(); |
| | | const openDai = async (formEl: FormInstance | undefined) => { |