| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog |
| | | title="新建事故快报" |
| | | :title="titles" |
| | | v-model="isShowDialog" |
| | | width="769px" |
| | | draggable |
| | |
| | | :model="ruleForm" |
| | | size="default" |
| | | label-width="120px" |
| | | :disabled="disabled" |
| | | > |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="申报人姓名" prop="teamName"> |
| | | <el-input v-model="ruleForm.teamName" placeholder="请填写申报人姓名"></el-input> |
| | | <el-form-item label="申报人姓名" prop="declareUserName"> |
| | | <el-input v-model="ruleForm.declareUserName" 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="申报人性别"> |
| | | <el-radio-group v-model="ruleForm.resource"> |
| | | <el-radio label="男" /> |
| | | <el-radio label="女" /> |
| | | <el-radio-group v-model="ruleForm.declareUserGender"> |
| | | <el-radio :label="false">男</el-radio> |
| | | <el-radio :label="true">女</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="申报人部门" placeholder="请选择"> |
| | | <el-tree-select |
| | | v-model="ruleForm.responsibleDepartment" |
| | | v-model="ruleForm.declareDepartmentId" |
| | | :data="data" 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="teamLeader"> |
| | | <el-form-item label="事故名称" prop="accidentExpressId"> |
| | | <el-input |
| | | v-model="ruleForm.teamLeader" |
| | | v-model="ruleForm.accidentExpressId" |
| | | placeholder="请选择" |
| | | class="input-with-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="telephone"> |
| | | <el-form-item label="事故发生时间" prop="occurrenceTime"> |
| | | <el-date-picker |
| | | v-model="value1" |
| | | v-model="ruleForm.occurrenceTime" |
| | | type="datetime" |
| | | class="w100" |
| | | placeholder="选择日期时间" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="工伤类型" prop="teamLevel"> |
| | | <el-select v-model="ruleForm.teamLevel" class="w100" placeholder="请选择"> |
| | | <el-option label="轻微伤" value="admin"></el-option> |
| | | <el-option label="轻伤" value="common"></el-option> |
| | | <el-form-item label="工伤类型" prop="workInjuryType"> |
| | | <el-select v-model="ruleForm.workInjuryType" class="w100" placeholder="请选择"> |
| | | <el-option label="轻微伤" value="轻微伤"></el-option> |
| | | <el-option label="轻伤" value="轻伤"></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="申报日期"> |
| | | <el-date-picker |
| | | v-model="value1" |
| | | v-model="ruleForm.declareDate" |
| | | type="datetime" |
| | | class="w100" |
| | | placeholder="选择日期时间" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="损失工时" prop="teamName"> |
| | | <el-input v-model="ruleForm.teamName" placeholder="请填写损失工时"></el-input> |
| | | <el-form-item label="损失工时" prop="lostTime"> |
| | | <el-input v-model="ruleForm.lostTime" 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="teamName"> |
| | | <el-input v-model="ruleForm.teamName" placeholder="请填写就诊医院"></el-input> |
| | | <el-form-item label="就诊医院" prop="visitHospital"> |
| | | <el-input v-model="ruleForm.visitHospital" 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="teamName"> |
| | | <el-input v-model="ruleForm.teamName" placeholder="请填写就诊结果"></el-input> |
| | | <el-form-item label="就诊结果" prop="visitResult"> |
| | | <el-input v-model="ruleForm.visitResult" placeholder="请填写就诊结果"></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="相关附件"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | v-model:file-list="ruleForm.fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | :on-change="handleChange" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="注意事项" prop="teamName"> |
| | | <el-input v-model="ruleForm.teamName" placeholder="请填写注意事项"></el-input> |
| | | <el-form-item label="注意事项" prop="mattersNeedingAttention"> |
| | | <el-input v-model="ruleForm.mattersNeedingAttention" 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="材料是否齐全"> |
| | | <el-radio-group v-model="ruleForm.resource"> |
| | | <el-radio label="是" /> |
| | | <el-radio label="否" /> |
| | | <el-radio-group v-model="ruleForm.completeMaterials"> |
| | | <el-radio :label="false">否</el-radio> |
| | | <el-radio :label="true">是</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="ruleForm.describe" type="textarea" placeholder="请填写备注" maxlength="150"></el-input> |
| | | <el-input v-model="ruleForm.remark" type="textarea" placeholder="请填写备注" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="onCancel" size="default">关闭</el-button> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">确定</el-button> |
| | | <el-button @click="resetForm(ruleFormRef)" size="default">关闭</el-button> |
| | | <el-button size="default" type="primary" v-if="disabled == true ? false : true" @click="submitForm(titles, ruleFormRef)">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | |
| | | <script lang="ts"> |
| | | import { |
| | | reactive, |
| | | // reactive, |
| | | ref, |
| | | defineComponent |
| | | } from 'vue'; |
| | |
| | | UploadUserFile, |
| | | FormInstance, |
| | | } from 'element-plus' |
| | | |
| | | import { ElMessage } from 'element-plus'; |
| | | import { |
| | | Search, |
| | | FullScreen |
| | |
| | | import UserSelections from "/@/components/userSelections/index.vue" |
| | | import AccidentName from '/@/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue' |
| | | import RegionsDialog from '/@/components/regionsDialog/index.vue' |
| | | import {emergencySuppliesApi} from "/@/api/emergencyResources"; |
| | | import {accidentManagementSystemApi} from "/@/api/workInjuryDeclaration"; |
| | | |
| | | export default defineComponent({ |
| | | name: 'openAdd', |
| | |
| | | UserSelections, |
| | | RegionsDialog, |
| | | }, |
| | | setup() { |
| | | setup(props, { emit }) { |
| | | const isShowDialog = ref(false) |
| | | |
| | | const ruleFormRef = ref<FormInstance>() |
| | | //定义表单 |
| | | const ruleForm = reactive({ |
| | | teamName: '', // 队伍名称 |
| | | teamLeader: '', //队伍负责人 |
| | | department: [], // 负责人部门 |
| | | phone: '', // 负责人手机 |
| | | telephone: '', // 固定电话 |
| | | const ruleForm = ref ({ |
| | | declareUserName: '', |
| | | declareUserGender: '', |
| | | declareDepartmentId: '', |
| | | accidentExpressId: '', |
| | | workInjuryType: '', |
| | | declareDate: '', |
| | | lostTime: '', |
| | | visitHospital: '', |
| | | visitResult: '', |
| | | mattersNeedingAttention: '', |
| | | completeMaterials: '', |
| | | remark: '', |
| | | fileList: [ |
| | | { |
| | | fileName: '', |
| | | fileUrl: '', |
| | | } |
| | | ], |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | | // 打开弹窗 |
| | | const openDialog = () => { |
| | | // state.ruleForm = row; |
| | | const openDialog = (title: string, id: number, type: boolean) => { |
| | | isShowDialog.value = true; |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | titles.value = title; |
| | | disabled.value = type; |
| | | if (title == '查看工伤申报' || title == '修改工伤申报') { |
| | | accidentManagementSystemApi() |
| | | .seeAccidentManagementSystem(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ruleForm.value = res.data.data; |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | //日期选择器 |
| | | const value1 = ref('') |
| | |
| | | label: 'Level one 1', |
| | | children: [ |
| | | { |
| | | value: '1-1', |
| | | value: '11', |
| | | label: 'Level two 1-1', |
| | | children: [ |
| | | { |
| | | value: '1-1-1', |
| | | value: '111', |
| | | label: 'Level three 1-1-1', |
| | | }, |
| | | ], |
| | |
| | | label: 'Level one 2', |
| | | children: [ |
| | | { |
| | | value: '2-1', |
| | | value: '21', |
| | | label: 'Level two 2-1', |
| | | children: [ |
| | | { |
| | | value: '2-1-1', |
| | | value: '211', |
| | | label: 'Level three 2-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '2-2', |
| | | value: '22', |
| | | label: 'Level two 2-2', |
| | | children: [ |
| | | { |
| | | value: '2-2-1', |
| | | value: '221', |
| | | label: 'Level three 2-2-1', |
| | | }, |
| | | ], |
| | |
| | | label: 'Level one 3', |
| | | children: [ |
| | | { |
| | | value: '3-1', |
| | | value: '31', |
| | | label: 'Level two 3-1', |
| | | children: [ |
| | | { |
| | | value: '3-1-1', |
| | | value: '311', |
| | | label: 'Level three 3-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '3-2', |
| | | value: '32', |
| | | label: 'Level two 3-2', |
| | | children: [ |
| | | { |
| | | value: '3-2-1', |
| | | value: '321', |
| | | label: 'Level three 3-2-1', |
| | | }, |
| | | ], |
| | |
| | | label: '广汇能源综合物流发展有限责任公司', |
| | | children: [ |
| | | { |
| | | value: '1-1', |
| | | value: '11', |
| | | label: '经营班子', |
| | | children: [], |
| | | }, |
| | |
| | | label: '生产运行部', |
| | | children: [ |
| | | { |
| | | value: '2-1', |
| | | value: '21', |
| | | label: '灌装一班', |
| | | children: [] |
| | | }, |
| | | { |
| | | value: '2-2', |
| | | value: '22', |
| | | label: '工艺四班', |
| | | children: [], |
| | | }, |
| | |
| | | label: '设备部', |
| | | children: [ |
| | | { |
| | | value: '3-1', |
| | | value: '31', |
| | | label: '仪表班', |
| | | children: [], |
| | | }, |
| | | { |
| | | value: '3-2', |
| | | value: '32', |
| | | label: '机修班', |
| | | children: [], |
| | | }, |
| | |
| | | // }, |
| | | // ], |
| | | // }) |
| | | |
| | | // 事故名称弹窗 |
| | | const showRef=ref() |
| | | const daiInpt=()=>{ |
| | | showRef.value.openDailog() |
| | | } |
| | | // 表单提交验证必填项 |
| | | const submitForm = async (formEl: FormInstance | undefined) => { |
| | | if (!formEl) return |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | console.log('submit!') |
| | | } else { |
| | | console.log('error submit!', fields) |
| | | const submitForm = async (title: string, formEl: FormInstance | undefined) => { |
| | | if (title == '新建工伤申报') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | accidentManagementSystemApi() |
| | | .workAdd(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 { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | } |
| | | else if (title == '修改工伤申报') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | accidentManagementSystemApi() |
| | | .workView(ruleForm.value) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: '修改成功', |
| | | type: 'success', |
| | | }); |
| | | emit('myAdd', true); |
| | | } else { |
| | | ElMessage({ |
| | | showClose: true, |
| | | message: res.data.msg, |
| | | type: 'error', |
| | | }); |
| | | emit('myAdd', true); |
| | | } |
| | | formEl.resetFields(); |
| | | }); |
| | | } else { |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | formEl.resetFields(); |
| | | ruleForm.value = { |
| | | declareUserName: '', |
| | | declareUserGender: '', |
| | | declareDepartmentId: '', |
| | | accidentExpressId: '', |
| | | workInjuryType: '', |
| | | declareDate: '', |
| | | lostTime: '', |
| | | visitHospital: '', |
| | | visitResult: '', |
| | | mattersNeedingAttention: '', |
| | | completeMaterials: '', |
| | | remark: '', |
| | | fileList: [ |
| | | { |
| | | fileName: '', |
| | | fileUrl: '', |
| | | } |
| | | ], |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | }; |
| | | // 选择区域弹窗 |
| | | const openRef=ref() |
| | | const regionsDialog=()=>{ |
| | |
| | | return { |
| | | daiInpt, |
| | | openDialog, |
| | | closeDialog, |
| | | isShowDialog, |
| | | onCancel, |
| | | fileList, |
| | | responsibleDepartment, |
| | | data, |
| | |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | full, |
| | | resetForm, |
| | | titles, |
| | | disabled, |
| | | emit, |
| | | }; |
| | | }, |
| | | }); |