| | |
| | | // 事故报告删除 |
| | | deleteAccidentReport: (params:object) => { |
| | | return request({ |
| | | url: `/accidentReport/batchDelete/${params}`, |
| | | method: 'get', |
| | | url: `/accidentReport/batchDelete`, |
| | | method: 'post', |
| | | data:params |
| | | }); |
| | | }, |
| | | |
| | |
| | | } |
| | | }; |
| | | const submitForm = () => { |
| | | let obj = JSON.parse(JSON.stringify(dynamicTags.value)); |
| | | emit('SearchUser', obj[0],types.value); |
| | | emit('SearchUser', dynamicTags.value); |
| | | dialogVisible.value = false; |
| | | }; |
| | | return { |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故部门" placeholder="请选择" prop="accidentDepartmentId"> |
| | | <el-tree-select v-model="ruleForm.accidentDepartmentId" :disabled="disabled" |
| | | :props="propse" :data="newTreeList" class="w100" placeholder="请选择" /> |
| | | <el-tree-select |
| | | v-model="ruleForm.accidentDepartmentId" |
| | | :disabled="disabled" |
| | | :props="propse" |
| | | :data="newTreeList" |
| | | class="w100" |
| | | placeholder="请选择" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | |
| | | <el-radio :label="true">是</el-radio> |
| | | <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 /> |
| | | <el-button v-if="ruleForm.casualties" type="primary" style="margin-left: 20px" :icon="Edit" @click="openDai" round plain /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故简要经过" prop="accidentBriefProcess"> |
| | | <el-input v-model="ruleForm.accidentBriefProcess" :disabled="disabled" |
| | | type="textarea" placeholder="请填写事故简要经过" maxlength="150"></el-input> |
| | | <el-input |
| | | v-model="ruleForm.accidentBriefProcess" |
| | | :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-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="应急防范措施" prop="emergencyPrecautions"> |
| | | <el-input v-model="ruleForm.emergencyPrecautions" :disabled="disabled" |
| | | type="textarea" placeholder="请填写应急防范措施" maxlength="150"></el-input> |
| | | <el-input |
| | | v-model="ruleForm.emergencyPrecautions" |
| | | :disabled="disabled" |
| | | 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"> |
| | |
| | | UserSelections, |
| | | RegionsDialog, |
| | | NumberOfCasualties, |
| | | uploaderImg |
| | | uploaderImg, |
| | | }, |
| | | setup(props, { emit }) { |
| | | const isShowDialog = ref(false); |
| | |
| | | accidentDepartmentId: '', |
| | | accidentName: '', |
| | | fileList: [], |
| | | id:'' |
| | | id: '', |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | |
| | | name: 'food.jpeg', |
| | | url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100', |
| | | }, |
| | | ]) |
| | | ]); |
| | | // 可选择树 |
| | | const treeSelect = ref(); |
| | | |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref(); |
| | | const data = [ |
| | | ]; |
| | | const data = []; |
| | | //el-tree-select回显 |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children' |
| | | children: 'children', |
| | | }; |
| | | const newTreeList = [] |
| | | const newTreeList = []; |
| | | //得到部门树 |
| | | const department = async() => { |
| | | await goalManagementApi() |
| | |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | getTreeList(res.data.data,newTreeList) |
| | | getTreeList(res.data.data, newTreeList); |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | |
| | | }; |
| | | // 递归树状数据且修改字段名 |
| | | const getTreeList = (treeList,newTreeList) => { |
| | | treeList.map(c=>{ |
| | | treeList.map((c) => { |
| | | let tempData={ |
| | | depName:c.depName, |
| | | value:c.depId, |
| | | children:[] |
| | | } |
| | | children: [], |
| | | }; |
| | | if(c.children && c.children.length>0){ |
| | | tempData.children=[] |
| | | getTreeList(c.children,tempData.children) |
| | | tempData.children = []; |
| | | getTreeList(c.children, tempData.children); |
| | | } |
| | | newTreeList.push(tempData) |
| | | }) |
| | | } |
| | | newTreeList.push(tempData); |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | department() |
| | | department(); |
| | | }); |
| | | // 必填项提示 |
| | | const rules = reactive<FormRules>({ |
| | |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | ruleForm.value.id = null |
| | | ruleForm.value.id = null; |
| | | accidentManagementSystemApi() |
| | | .accidentAdd(ruleForm.value) |
| | | .then((res) => { |
| | |
| | | }; |
| | | const closeDialog = (formEl: FormInstance | undefined) => { |
| | | formEl.resetFields(); |
| | | console.log(ruleForm) |
| | | isShowDialog.value = false |
| | | } |
| | | console.log(ruleForm); |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 是否有伤亡弹窗 |
| | | const typeChang = () => { |
| | | console.log('tag', ruleForm); |
| | |
| | | getTreeList, |
| | | newTreeList, |
| | | closeDialog, |
| | | fileListDemo |
| | | fileListDemo, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog |
| | | :title="titles" |
| | | v-model="isShowDialog" |
| | | width="800px" |
| | | draggable |
| | | :fullscreen="full" |
| | | > |
| | | <el-dialog :title="titles" v-model="isShowDialog" width="800px" draggable :fullscreen="full" @close="closeDialog(ruleFormRef)"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :model="ruleForm" |
| | | size="default" |
| | | :rules="rules" |
| | | label-width="130px" |
| | | :disabled="disabled" |
| | | > |
| | | <el-form ref="ruleFormRef" :model="ruleForm" size="default" :rules="rules" label-width="140px" :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="accidentExpressId"> |
| | | <el-input |
| | | v-model="ruleForm.accidentExpressId" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <el-form-item label="事故快报" prop="accidentName"> |
| | | <el-input v-model="ruleForm.accidentName" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="daiInpt"/> |
| | | </template> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="事故部门" placeholder="请选择" prop="accidentDepartmentId"> |
| | | <el-tree-select v-model="ruleForm.accidentDepartmentId" :data="data" class="w100" placeholder="请选择" /> |
| | | <!--<el-input v-model="ruleForm.accidentDepartmentName" class="input-with-select" />--> |
| | | <el-tree-select v-model="ruleForm.accidentDepartmentId" :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> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="发生时间" prop="occurrenceTime"> |
| | | <el-date-picker v-model="ruleForm.occurrenceTime" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" class="w100" placeholder="选择日期时间" /> |
| | | <el-date-picker |
| | | v-model="ruleForm.occurrenceTime" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | type="datetime" |
| | | class="w100" |
| | | placeholder="选择日期时间" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="原因综合分析(直接分析)" prop="comprehensiveAnalysisDirect"> |
| | | <el-input v-model="ruleForm.comprehensiveAnalysisDirect" type="textarea" placeholder="请填写原因综合分析(直接分析)" maxlength="150"></el-input> |
| | | <el-input |
| | | v-model="ruleForm.comprehensiveAnalysisDirect" |
| | | 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="comprehensiveAnalysisIndirect"> |
| | | <el-input v-model="ruleForm.comprehensiveAnalysisIndirect" type="textarea" placeholder="请填写原因综合分析(间接分析)" maxlength="150"></el-input> |
| | | <el-input |
| | | v-model="ruleForm.comprehensiveAnalysisIndirect" |
| | | 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="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="填写人" prop="fillInUserUid"> |
| | | <el-input |
| | | v-model="ruleForm.fillInUserUid" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <el-form-item label="填写人" prop="fillInUserName"> |
| | | <el-input v-model="ruleForm.fillInUserName" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser"/> |
| | | </template> |
| | |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="相关人员笔录"> |
| | | <el-form-item label="相关人员笔录" prop="relevantPersonnelRecords"> |
| | | <el-input v-model="ruleForm.relevantPersonnelRecords" 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="事故分析会议纪要"> |
| | | <el-upload |
| | | v-model:file-list="fileList" |
| | | class="upload-demo" |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | :on-change="handleChange" |
| | | > |
| | | <el-button type="primary" |
| | | >点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | 添加相关附件 |
| | | </div> |
| | | </template> |
| | | </el-upload> |
| | | <el-form-item label="事故分析会议纪要" prop="fileList"> |
| | | <uploaderImg :fileList="fileList"></uploaderImg> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="其他材料"> |
| | | <el-form-item label="其他材料" prop="otherMaterials"> |
| | | <el-input v-model="ruleForm.otherMaterials" type="textarea" placeholder="请填写其他材料" maxlength="150"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <AccidentName ref="Shows"/> |
| | | <DailogSearchUser ref="userRef" @SearchUser="onUser"/> |
| | | <AccidentName @selectItem="onSelectItem" ref="Shows" /> |
| | | <DailogSearchUser @SearchUser="onUser" ref="userRef" /> |
| | | <RegionsDialog ref="openRef"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { |
| | | reactive, |
| | | ref, |
| | | defineComponent |
| | | } from 'vue'; |
| | | import { reactive, ref, defineComponent,onMounted } from 'vue'; |
| | | |
| | | import type { |
| | | UploadUserFile, |
| | | FormInstance, |
| | | FormRules, |
| | | } from 'element-plus' |
| | | import type { UploadUserFile, FormInstance, FormRules } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { |
| | | Search, |
| | | FullScreen |
| | | } from '@element-plus/icons-vue' |
| | | import DailogSearchUser from "/@/components/DailogSearchUser/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"; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import DailogSearchUser from '/@/components/DailogSearchUser/index.vue'; |
| | | import AccidentName from '/@/views/accidentManagementSystem/workInjuryDeclaration/component/accidentName.vue'; |
| | | import RegionsDialog from '/@/components/regionsDialog/index.vue'; |
| | | import uploaderImg from '/@/components/uploaderImg/index.vue'; |
| | | import { emergencySuppliesApi } from '/@/api/emergencyResources'; |
| | | import { accidentManagementSystemApi } from '/@/api/workInjuryDeclaration'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'openAdd', |
| | |
| | | AccidentName, |
| | | DailogSearchUser, |
| | | RegionsDialog, |
| | | uploaderImg |
| | | }, |
| | | setup(props, { emit }) { |
| | | const isShowDialog = ref(false) |
| | | const isShowDialog = ref(false); |
| | | |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | //定义表单 |
| | | const ruleForm = ref ({ |
| | | accidentExpressId: '', |
| | | accidentExpressName:'', |
| | | accidentDepartmentId:'', |
| | | accidentDepartmentName:'', |
| | | occurrencePlace:'', |
| | | occurrenceTime:'', |
| | | |
| | | |
| | | |
| | | accidentType: '', |
| | | accidentGrade: '', |
| | | economicLoss: '', |
| | |
| | | rectificationMeasures: '', |
| | | accidentHandling: '', |
| | | fillInUserUid: '', |
| | | fillInUserName:'', |
| | | fillInTime: '', |
| | | relevantPersonnelRecords: '', |
| | | otherMaterials: '', |
| | | fileList: [ |
| | | { |
| | | fileUrl: '', |
| | | fileName: '', |
| | | } |
| | | ], |
| | | fileList: [], |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | |
| | | } |
| | | }; |
| | | // 关闭弹窗 |
| | | const closeDialog = () => { |
| | | const closeDialog = (formEl: FormInstance | undefined) => { |
| | | formEl.resetFields(); |
| | | console.log(ruleForm) |
| | | isShowDialog.value = false; |
| | | }; |
| | | // 取消 |
| | | const onCancel = () => { |
| | | closeDialog(); |
| | | const onCancel = (formEl: FormInstance | undefined) => { |
| | | closeDialog(formEl); |
| | | }; |
| | | //日期选择器 |
| | | const value1 = ref('') |
| | | const value1 = ref(''); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]) |
| | | const fileList = ref<UploadUserFile[]>([]); |
| | | // 可选择树 |
| | | const treeSelect = ref() |
| | | const tree = [ |
| | | { |
| | | value: '1', |
| | | label: 'Level one 1', |
| | | children: [ |
| | | { |
| | | value: '11', |
| | | label: 'Level two 1-1', |
| | | children: [ |
| | | { |
| | | value: '111', |
| | | label: 'Level three 1-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: 'Level one 2', |
| | | children: [ |
| | | { |
| | | value: '21', |
| | | label: 'Level two 2-1', |
| | | children: [ |
| | | { |
| | | value: '211', |
| | | label: 'Level three 2-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '22', |
| | | label: 'Level two 2-2', |
| | | children: [ |
| | | { |
| | | value: '221', |
| | | label: 'Level three 2-2-1', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '3', |
| | | label: 'Level one 3', |
| | | children: [ |
| | | { |
| | | value: '31', |
| | | label: 'Level two 3-1', |
| | | children: [ |
| | | { |
| | | value: '311', |
| | | label: 'Level three 3-1-1', |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '32', |
| | | label: 'Level two 3-2', |
| | | children: [ |
| | | { |
| | | value: '321', |
| | | label: 'Level three 3-2-1', |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | const treeSelect = ref(); |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref() |
| | | const responsibleDepartment = ref(); |
| | | const data = [ |
| | | { |
| | | value: '1', |
| | | label: '广汇能源综合物流发展有限责任公司', |
| | | children: [ |
| | | { |
| | | value: '11', |
| | | label: '经营班子', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '生产运行部', |
| | | children: [ |
| | | { |
| | | value: '21', |
| | | label: '灌装一班', |
| | | children: [] |
| | | }, |
| | | { |
| | | value: '22', |
| | | label: '工艺四班', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | value: '3', |
| | | label: '设备部', |
| | | children: [ |
| | | { |
| | | value: '31', |
| | | label: '仪表班', |
| | | children: [], |
| | | }, |
| | | { |
| | | value: '32', |
| | | label: '机修班', |
| | | children: [], |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | ]; |
| | | // 必填项提示 |
| | | const rules = reactive<FormRules>({ |
| | | accidentDepartmentId: [ |
| | |
| | | { |
| | | required: true, |
| | | message: '发生时间不能为空', |
| | | trigger: 'change', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | accidentType: [ |
| | |
| | | { |
| | | required: true, |
| | | message: '要求报告完成期限不能为空', |
| | | trigger: 'change', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | accidentLevel: [ |
| | |
| | | type: 'date', |
| | | required: true, |
| | | message: '填写日期不能为空', |
| | | trigger: 'change', |
| | | trigger: 'blur', |
| | | }, |
| | | ], |
| | | }) |
| | | }); |
| | | //事故快报回填 |
| | | const onSelectItem = (item: any) => { |
| | | console.log('item', item[0]); |
| | | ruleForm.value.accidentExpressId = item[0].id |
| | | ruleForm.value.accidentName = item[0].accidentName |
| | | ruleForm.value.accidentDepartmentId = item[0].accidentDepartmentId |
| | | ruleForm.value.accidentDepartmentName = item[0].deptName |
| | | ruleForm.value.occurrencePlace = item[0].occurrencePlace |
| | | ruleForm.value.occurrenceTime = item[0].occurrenceTime |
| | | }; |
| | | // 表单提交验证必填项 |
| | | const submitForm = async (title: string, formEl: FormInstance | undefined) => { |
| | | if (title == '新建事故报告') { |
| | |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | } |
| | | else if (title == '修改事故报告') { |
| | | } else if (title == '修改事故报告') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | //TODO 上传组件待定 |
| | | ruleForm.value.fileList = [] |
| | | isShowDialog.value = false; |
| | | accidentManagementSystemApi() |
| | | .editAccidentReport(ruleForm.value) |
| | |
| | | formEl.resetFields(); |
| | | ruleForm.value = { |
| | | accidentExpressId: '', |
| | | accidentExpressName:'', |
| | | accidentDepartmentId:'', |
| | | accidentDepartmentName:'', |
| | | occurrencePlace:'', |
| | | occurrenceTime:'', |
| | | |
| | | |
| | | |
| | | accidentType: '', |
| | | accidentGrade: '', |
| | | economicLoss: '', |
| | |
| | | rectificationMeasures: '', |
| | | accidentHandling: '', |
| | | fillInUserUid: '', |
| | | fillInUserName:'', |
| | | fillInTime: '', |
| | | relevantPersonnelRecords: '', |
| | | otherMaterials: '', |
| | | fileList: [ |
| | | { |
| | | fileUrl: '', |
| | | fileName: '', |
| | | fileList: [], |
| | | }; |
| | | } |
| | | ], |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | }; |
| | | const handleChange = (val: number) => { |
| | | console.log(val) |
| | | console.log(val); |
| | | }; |
| | | // 应急队伍弹窗 |
| | | const Shows=ref() |
| | | const Shows = ref(); |
| | | const daiInpt=()=>{ |
| | | Shows.value.openDailog() |
| | | } |
| | | Shows.value.openDailog(); |
| | | }; |
| | | // 选择区域弹窗 |
| | | const openRef=ref() |
| | | const openRef = ref(); |
| | | const regionsDialog=()=>{ |
| | | openRef.value.openDailog() |
| | | } |
| | | openRef.value.openDailog(); |
| | | }; |
| | | // 打开用户选择弹窗 |
| | | const userRef = ref(); |
| | | const openUser = () => { |
| | | userRef.value.openDailog(); |
| | | }; |
| | | const onUser = (e:any) => { |
| | | ruleForm.value.fillInUserUid=e.id |
| | | const onUser = (userItem: any) => { |
| | | ruleForm.value.fillInUserUid = userItem[0].uid; |
| | | ruleForm.value.fillInUserName = userItem[0].realName; |
| | | }; |
| | | //el-tree-select回显 |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children', |
| | | }; |
| | | const newTreeList = []; |
| | | //得到部门树 |
| | | 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); |
| | | } |
| | | }); |
| | | }; |
| | | // 递归树状数据且修改字段名 |
| | | const getTreeList = (treeList, newTreeList) => { |
| | | treeList.map((c) => { |
| | | let tempData = { |
| | | depName: c.depName, |
| | | value: c.depId, |
| | | children: [], |
| | | }; |
| | | if (c.children && c.children.length > 0) { |
| | | tempData.children = []; |
| | | getTreeList(c.children, tempData.children); |
| | | } |
| | | newTreeList.push(tempData); |
| | | }); |
| | | }; |
| | | onMounted(() => { |
| | | department(); |
| | | }); |
| | | //全屏 |
| | | const full = ref(false); |
| | | const toggleFullscreen = () => { |
| | |
| | | ruleForm, |
| | | value1, |
| | | treeSelect, |
| | | tree, |
| | | daiInpt, |
| | | Shows, |
| | | ruleFormRef, |
| | |
| | | titles, |
| | | disabled, |
| | | emit, |
| | | handleChange |
| | | handleChange, |
| | | onSelectItem, |
| | | newTreeList, |
| | | department, |
| | | getTreeList, |
| | | propse |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | type="selection" |
| | | width="55" |
| | | /> |
| | | <el-table-column prop="accidentExpressId" label="事故名称" show-overflow-tooltip sortable></el-table-column> |
| | | <el-table-column prop="accidentDepartmentId" label="事故部门" show-overflow-tooltip sortable></el-table-column> |
| | | <el-table-column prop="accidentName" label="事故名称" show-overflow-tooltip sortable></el-table-column> |
| | | <el-table-column prop="deptName" label="事故部门" show-overflow-tooltip sortable></el-table-column> |
| | | <el-table-column prop="accidentType" label="事故类别" show-overflow-tooltip sortable></el-table-column> |
| | | <el-table-column prop="accidentGrade" label="事故等级" show-overflow-tooltip sortable></el-table-column> |
| | | <el-table-column prop="occurrencePlace" label="发生地点" show-overflow-tooltip sortable></el-table-column> |
| | |
| | | for (let i = 0; i < valId.length; i++) { |
| | | arr.push(valId[i].id); |
| | | } |
| | | deletAll.value = arr.toString(); |
| | | deletAll.value = arr; |
| | | // console.log(deletAll.value); |
| | | if (val.length == 1) { |
| | | warning.value = false; |
| | |
| | | // } |
| | | // 删除用户 |
| | | const onRowDel = (data: any) => { |
| | | var deleteList = [data] |
| | | ElMessageBox.confirm('确定删除所选项吗?', '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | |
| | | }) |
| | | .then(() => { |
| | | accidentManagementSystemApi() |
| | | .deleteAccidentReport(data) |
| | | .deleteAccidentReport(deleteList) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ElMessage({ |
| | |
| | | <template> |
| | | <el-dialog |
| | | v-model="dialogVisible" |
| | | title="选择事故名称" |
| | | width="900px" |
| | | draggable |
| | | :fullscreen="full" |
| | | > |
| | | <div> |
| | | <el-dialog v-model="dialogVisible" title="选择事故名称" width="900px" draggable :fullscreen="full"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-row> |
| | | <el-col :span="18"> |
| | | <el-row> |
| | | <el-form ref="ruleFormRef" :model="ruleForm" :inline="true" status-icon> |
| | | <!--<el-form-item>--> |
| | | <!--<el-input size="default" v-model="listQuery.searchParams.id" placeholder="id" style="min-width: 215px;"/>--> |
| | | <!--</el-form-item>--> |
| | | <el-form-item> |
| | | <el-input size="default" v-model="ruleForm.pass" placeholder="id" style="min-width: 215px;"/> |
| | | <el-input size="default" v-model="listQuery.searchParams.accidentName" placeholder="事故名称" style="min-width: 215px" /> |
| | | </el-form-item> |
| | | <!--<el-form-item>--> |
| | | <!--<el-input size="default" v-model="listQuery.searchParams.deptName" placeholder="事故部门" style="min-width: 215px;"/>--> |
| | | <!--</el-form-item>--> |
| | | <!--<el-form-item>--> |
| | | <!--<el-input size="default" v-model="listQuery.searchParams.occurrencePlace" placeholder="发生地点" style="min-width: 215px;"/>--> |
| | | <!--</el-form-item>--> |
| | | <!--<el-form-item>--> |
| | | <!--<el-input size="default" v-model="listQuery.searchParams.occurrenceTime" placeholder="发生时间" style="min-width: 215px;"/>--> |
| | | <!--</el-form-item>--> |
| | | <el-form-item> |
| | | <el-input size="default" v-model="ruleForm.pass" placeholder="事故名称" style="min-width: 215px;"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input size="default" v-model="ruleForm.pass" placeholder="事故部门" style="min-width: 215px;"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input size="default" v-model="ruleForm.pass" placeholder="发生地点" style="min-width: 215px;"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-input size="default" v-model="ruleForm.pass" placeholder="发生时间" style="min-width: 215px;"/> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button size="default" type="primary" @click="submitForm(ruleFormRef)">查询</el-button> |
| | | <el-button size="default" @click="resetForm(ruleFormRef)">重置</el-button> |
| | | <el-button size="default" :icon="Delete">清除选择</el-button> |
| | | <el-button size="default" type="primary" @click="listApi">查询</el-button> |
| | | <el-button size="default" @click="submitReset">重置</el-button> |
| | | <el-button size="default" :icon="Delete" @click="handleClose">清除选择</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | </el-row> |
| | |
| | | <!--@current-change="handleCurrentChange"--> |
| | | <!--/>--> |
| | | <!--</div>--> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | ref="multipleTableRef" |
| | | > |
| | | <el-table :data="tableData" style="width: 100%" ref="multipleTableRef"> |
| | | <el-table-column align="center"> |
| | | <template #default="scope"> |
| | | <el-radio-group v-model="radio1"> |
| | | <el-radio :label="scope.row.id" size="large">{{ null }}</el-radio> |
| | | <el-radio :label="scope.row.id" size="large" @click="checkedItem(scope.row)">{{ null }}</el-radio> |
| | | </el-radio-group> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="accidentExpressId" label="事故名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="accidentDepartmentId" label="事故部门" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="accidentType" label="事故类别" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="accidentGrade" label="事故等级" show-overflow-tooltip></el-table-column> |
| | | <!--<el-table-column prop="id" label="id" show-overflow-tooltip></el-table-column>--> |
| | | <el-table-column prop="accidentName" label="事故名称" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="deptName" label="事故部门" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="occurrencePlace" label="发生地点" show-overflow-tooltip></el-table-column> |
| | | <el-table-column prop="occurrenceTime" label="发生时间" show-overflow-tooltip></el-table-column> |
| | | </el-table> |
| | |
| | | :page-sizes="[10, 20, 30]" |
| | | :pager-count="5" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="40" |
| | | :total="total" |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | /> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin:5px" closable :disable-transitions="false" @close="handleClose(tag)"> |
| | | {{ tag }} |
| | | <el-tag v-for="tag in dynamicTags" :key="tag" class="mx-1" style="margin: 5px" closable :disable-transitions="false" @close="handleClose()"> |
| | | {{ tag.accidentName }} |
| | | </el-tag> |
| | | </el-col> |
| | | </el-row> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="dialogVisible = false" size="default">关闭</el-button> |
| | | <el-button type="primary" @click="dialogVisible = false" size="default">确定</el-button> |
| | | <el-button type="primary" @click="submitForm" size="default">确定</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { |
| | | defineComponent, |
| | | reactive, |
| | | ref, |
| | | onMounted |
| | | } from 'vue'; |
| | | import { |
| | | Delete, |
| | | FullScreen |
| | | } from '@element-plus/icons-vue'; |
| | | import { defineComponent, reactive, ref } from 'vue'; |
| | | import { Delete, FullScreen } from '@element-plus/icons-vue'; |
| | | import { |
| | | // ElTable, |
| | | ElMessage, |
| | | } from 'element-plus'; |
| | | import {accidentManagementSystemApi} from "/@/api/workInjuryDeclaration"; |
| | | import { accidentManagementSystemApi } from '/@/api/workInjuryDeclaration'; |
| | | export default defineComponent({ |
| | | setup() { |
| | | setup(props, { emit }) { |
| | | const dialogVisible = ref<boolean>(false); |
| | | const openDailog = () => { |
| | | dialogVisible.value = true; |
| | | listApi(); |
| | | }; |
| | | // 搜索条件 |
| | | const ruleForm = reactive({ |
| | |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | searchParams: { |
| | | name: '', |
| | | accidentName: '', |
| | | }, |
| | | }); |
| | | //单选按钮 |
| | |
| | | const handleCurrentChange = (val: number) => { |
| | | listQuery.pageIndex = val; |
| | | }; |
| | | const checkedItem = (row: object) => { |
| | | dynamicTags.value = [row]; |
| | | }; |
| | | // 重置 |
| | | const submitReset = () => { |
| | | listQuery.searchParams = {}; |
| | | listApi(); |
| | | }; |
| | | const submitForm = () => { |
| | | emit('selectItem', dynamicTags.value); |
| | | dialogVisible.value = false; |
| | | }; |
| | | //查询list数据 |
| | | const listApi = async () => { |
| | | let res = await accidentManagementSystemApi().getAccidentReportList(listQuery); |
| | | let res = await accidentManagementSystemApi().accidentList(listQuery); |
| | | if (res.data.code == 200) { |
| | | tableData.value = res.data.data; |
| | | pageIndex.value = res.data.pageIndex; |
| | |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | listApi(); |
| | | }); |
| | | // 右方点击添加后显示标签 |
| | | const dynamicTags = ref(['应急救援组', '工艺抢险组', '后勤保障组']); |
| | | const handleClose = (tag: string) => { |
| | | dynamicTags.value.splice(dynamicTags.value.indexOf(tag), 1); |
| | | const dynamicTags = ref([]); |
| | | const handleClose = () => { |
| | | dynamicTags.value = []; |
| | | radio1.value = ''; |
| | | }; |
| | | //全屏 |
| | | const full = ref(false); |
| | |
| | | total, |
| | | listApi, |
| | | listQuery, |
| | | radio1 |
| | | radio1, |
| | | checkedItem, |
| | | submitReset, |
| | | submitForm, |
| | | }; |
| | | }, |
| | | }); |
| | |
| | | <template> |
| | | <div class="system-edit-user-container"> |
| | | <el-dialog |
| | | :title="titles" |
| | | v-model="isShowDialog" |
| | | width="769px" |
| | | draggable |
| | | :fullscreen="full" |
| | | > |
| | | <el-dialog :title="titles" v-model="isShowDialog" width="769px" draggable :fullscreen="full"> |
| | | <el-button @click="toggleFullscreen" size="small" class="pot" :icon="FullScreen"></el-button> |
| | | <el-form |
| | | ref="ruleFormRef" |
| | | :model="ruleForm" |
| | | size="default" |
| | | label-width="120px" |
| | | :disabled="disabled" |
| | | > |
| | | <el-form ref="ruleFormRef" :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="declareUserName"> |
| | |
| | | </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.declareDepartmentId" |
| | | :data="data" class="w100" |
| | | placeholder="请选择"/> |
| | | <el-tree-select 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="accidentExpressId"> |
| | | <el-input |
| | | v-model="ruleForm.accidentExpressId" |
| | | placeholder="请选择" |
| | | class="input-with-select" |
| | | > |
| | | <el-input v-model="ruleForm.accidentExpressId" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="daiInpt"/> |
| | | </template> |
| | |
| | | action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15" |
| | | :on-change="handleChange" |
| | | > |
| | | <el-button type="primary" |
| | | >点击上传</el-button> |
| | | <el-button type="primary">点击上传</el-button> |
| | | <template #tip> |
| | | <div class="el-upload__tip"> |
| | | 添加相关附件 |
| | | </div> |
| | | <div class="el-upload__tip">添加相关附件</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <AccidentName ref="showRef"/> |
| | | <AccidentName @selectItem="onSelectItem" ref="showRef" /> |
| | | <userSelections ref="userRef"/> |
| | | <RegionsDialog ref="openRef"/> |
| | | </div> |
| | |
| | | import { |
| | | // reactive, |
| | | ref, |
| | | defineComponent |
| | | defineComponent, |
| | | } from 'vue'; |
| | | |
| | | import type { |
| | | UploadUserFile, |
| | | FormInstance, |
| | | } from 'element-plus' |
| | | import type { UploadUserFile, FormInstance } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { |
| | | Search, |
| | | FullScreen |
| | | } from '@element-plus/icons-vue' |
| | | 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"; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | 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', |
| | |
| | | RegionsDialog, |
| | | }, |
| | | setup(props, { emit }) { |
| | | const isShowDialog = ref(false) |
| | | const isShowDialog = ref(false); |
| | | |
| | | const ruleFormRef = ref<FormInstance>() |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | //定义表单 |
| | | const ruleForm = ref ({ |
| | | declareUserName: '', |
| | |
| | | { |
| | | fileName: '', |
| | | fileUrl: '', |
| | | } |
| | | }, |
| | | ], |
| | | }); |
| | | const titles = ref(); |
| | |
| | | } |
| | | }; |
| | | //日期选择器 |
| | | const value1 = ref('') |
| | | const value1 = ref(''); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]) |
| | | const fileList = ref<UploadUserFile[]>([]); |
| | | // 可选择树 |
| | | const treeSelect = ref() |
| | | const treeSelect = ref(); |
| | | const tree = [ |
| | | { |
| | | value: '1', |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | ]; |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref() |
| | | const responsibleDepartment = ref(); |
| | | const data = [ |
| | | { |
| | | value: '1', |
| | |
| | | { |
| | | value: '21', |
| | | label: '灌装一班', |
| | | children: [] |
| | | children: [], |
| | | }, |
| | | { |
| | | value: '22', |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | ] |
| | | ]; |
| | | // 必填项提示 |
| | | // const rules = reactive<FormRules>({ |
| | | // teamName: [ |
| | |
| | | // }) |
| | | |
| | | // 事故名称弹窗 |
| | | const showRef=ref() |
| | | const showRef = ref(); |
| | | const daiInpt=()=>{ |
| | | showRef.value.openDailog() |
| | | } |
| | | showRef.value.openDailog(); |
| | | }; |
| | | //事故快报回填 |
| | | const onSelectItem = (item: any) => { |
| | | alert(1); |
| | | console.log('item', item); |
| | | }; |
| | | // 表单提交验证必填项 |
| | | const submitForm = async (title: string, formEl: FormInstance | undefined) => { |
| | | if (title == '新建工伤申报') { |
| | |
| | | console.log('error submit!', fields); |
| | | } |
| | | }); |
| | | } |
| | | else if (title == '修改工伤申报') { |
| | | } else if (title == '修改工伤申报') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | |
| | | { |
| | | fileName: '', |
| | | fileUrl: '', |
| | | } |
| | | }, |
| | | ], |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | }; |
| | | // 选择区域弹窗 |
| | | const openRef=ref() |
| | | const openRef = ref(); |
| | | const regionsDialog=()=>{ |
| | | openRef.value.openDailog() |
| | | } |
| | | openRef.value.openDailog(); |
| | | }; |
| | | // 打开用户选择弹窗 |
| | | const userRef = ref(); |
| | | const openUser = () => { |
| | |
| | | titles, |
| | | disabled, |
| | | emit, |
| | | onSelectItem, |
| | | }; |
| | | }, |
| | | }); |