| | |
| | | <el-radio :label="false">否</el-radio> |
| | | </el-radio-group> |
| | | <el-button v-if="ruleForm.casualties" type="primary" style="margin-left: 20px" |
| | | :icon="Edit" @click="openDai" round plain /> |
| | | :icon="Edit" @click="openDai(ruleFormRef)" round plain /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | |
| | | import { reactive, ref, defineComponent, defineEmits, onMounted } from 'vue'; |
| | | |
| | | import type { UploadUserFile, FormInstance, FormRules } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { ElMessage,ElMessageBox, } from 'element-plus'; |
| | | import { Search, FullScreen, Edit } from '@element-plus/icons-vue'; |
| | | import NumberOfCasualties from '/@/views/accidentManagementSystem/accidentExpress/component/numberOfCasualties.vue'; |
| | | import UserSelections from '/@/components/userSelections/index.vue'; |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | ruleForm.value.id = null; |
| | | accidentManagementSystemApi() |
| | | .accidentAdd(ruleForm.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | emit('myAdd', true); |
| | | } |
| | | formEl.resetFields(); |
| | | if(ruleForm.value.id==null||ruleForm.value.id==''){ |
| | | ruleForm.value.id = null; |
| | | accidentManagementSystemApi() |
| | | .accidentAdd(ruleForm.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | emit('myAdd', true); |
| | | } |
| | | formEl.resetFields(); |
| | | }); |
| | | }else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '添加成功', |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | } |
| | | |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | |
| | | console.log('tag', ruleForm); |
| | | }; |
| | | const ShowUser = ref(); |
| | | const openDai = () => { |
| | | const openDai = async (formEl: FormInstance | undefined) => { |
| | | if(ruleForm.value.id==null||ruleForm.value.id==''){ |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '请先添加事故快报', |
| | | type: 'info', |
| | | }); |
| | | if(!ruleForm.value.fileList){ |
| | | ruleForm.value.fileList = [] |
| | | } |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | // isShowDialog.value = false; |
| | | ElMessageBox.confirm('确认添加此事故快报?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }) |
| | | .then(() => { |
| | | accidentManagementSystemApi() |
| | | .accidentAdd(ruleForm.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'success', |
| | | }); |
| | | ruleForm.value.id = res.data.data.id |
| | | ShowUser.value.openDialog(ruleForm.value.id, disabled.value); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | } |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | // ElMessage({ |
| | | // showClose: true, |
| | | // message: '请先添加事故快报', |
| | | // type: 'info', |
| | | // }); |
| | | }else { |
| | | ShowUser.value.openDialog(ruleForm.value.id, disabled.value); |
| | | } |