| | |
| | | <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="name"> |
| | | <el-input v-model="ruleForm.name" placeholder="请填写队伍名称"></el-input> |
| | | <el-form-item label="审批名称" prop="name"> |
| | | <el-input v-model="ruleForm.workName" 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="title"> |
| | | <el-input v-model="ruleForm.title" 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="responsibleDepartment"> |
| | | <el-tree-select |
| | | v-model="ruleForm.treeSelect" |
| | | :data="data" |
| | | multiple |
| | | :render-after-expand="true" |
| | | :props="propse" |
| | | show-checkbox |
| | | clearable |
| | | check-strictly |
| | | /> |
| | | <el-divider /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="预案类型" prop="type"> |
| | | <el-select v-model="ruleForm.type" class="w100" placeholder="请选择"> |
| | | <el-option label="综合应急预案" value="综合应急预案"></el-option> |
| | | <el-option label="现场处置方案" value="现场处置方案"></el-option> |
| | | <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="危险源关联" prop="associatedDanger"> |
| | | <el-select v-model="ruleForm.associatedDanger" class="w100" placeholder="请选择"> |
| | | <el-option label="是" :value="false"></el-option> |
| | | <el-option label="否" :value="true"></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="level"> |
| | | <el-select v-model="ruleForm.level" class="w100" placeholder="请选择"> |
| | | <el-option label="公司级" value="公司级"></el-option> |
| | | <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="编写人" prop="authorUid"> |
| | | <el-input v-model="ruleForm.authorName" placeholder="请选择" class="input-with-select"> |
| | | <el-form-item label="审批人" prop="approvePersonId"> |
| | | <el-input v-model="ruleForm.approvePersonName" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser" /> |
| | | </template> |
| | | </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="authorDeptId"> |
| | | <el-tree-select |
| | | v-model="ruleForm.authorDeptId" |
| | | check-strictly |
| | | :data="data" |
| | | class="w100" |
| | | :props="propse" |
| | | clearable |
| | | :render-after-expand="false" |
| | | 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="releaseDate"> |
| | | <el-date-picker |
| | | v-model="ruleForm.releaseDate" |
| | | 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="emergencyTeam"> |
| | | <el-input v-model="ruleForm.emergencyTeam" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="daiInpt" /> |
| | | </template> |
| | | </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> |
| | | </el-col> |
| | | <!-- <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">--> |
| | | <!-- <el-form-item label="区域名称" prop="areaName">--> |
| | | <!-- <el-input--> |
| | | <!-- v-model="ruleForm.areaName"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- class="input-with-select"--> |
| | | <!-- >--> |
| | | <!-- <template #append>--> |
| | | <!-- <el-button :icon="Search" @click="regionsDialog"/>--> |
| | | <!-- </template>--> |
| | | <!-- </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="authorUid"> |
| | | <el-radio-group v-model="ruleForm.resource"> |
| | | <el-radio label="不通过" /> |
| | | <el-radio label="通过" /> |
| | | <el-radio-group v-model="ruleForm.approveResult"> |
| | | <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="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="审批意见" prop="authorUid"> |
| | | <el-input v-model="ruleForm.name" type="textarea" placeholder="请填写审批意见"></el-input> |
| | | <el-form-item label="审批意见" prop="approveMemo"> |
| | | <el-input v-model="ruleForm.approveMemo" type="textarea" placeholder="请填写审批意见"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="ruleForm.complete" :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="审批名称" prop="workName"> |
| | | <el-input v-model="ruleForm.workName" placeholder="请填写队伍名称"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="ruleForm.complete" :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="审批标题" prop="title"> |
| | | <el-input v-model="ruleForm.title" placeholder="请填写审批名称"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col v-if="ruleForm.complete" :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> |
| | | <el-form-item label="审批人" prop="authorUid"> |
| | | <el-input v-model="ruleForm.authorName" placeholder="请选择" class="input-with-select"> |
| | | <el-input v-model="ruleForm.approvePersonName" placeholder="请选择" class="input-with-select"> |
| | | <template #append> |
| | | <el-button :icon="Search" @click="openUser" /> |
| | | </template> |
| | |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <CheckTemplate ref="Shows" /> |
| | | <DailogSearchUserManger ref="userRef" @SearchUser="onUser" /> |
| | | <RegionsDialog ref="openRef" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script lang="ts"> |
| | | import { ref, defineComponent, onMounted } from 'vue'; |
| | | import { ref, defineComponent } from 'vue'; |
| | | |
| | | import type { UploadUserFile, FormInstance } from 'element-plus'; |
| | | import type { FormInstance } from 'element-plus'; |
| | | import { ElMessage } from 'element-plus'; |
| | | import { Search, FullScreen } from '@element-plus/icons-vue'; |
| | | import DailogSearchUserManger from '/@/components/DailogSearchUserManger/index.vue'; |
| | | import CheckTemplate from '/@/components/checkTemplate/index.vue'; |
| | | import RegionsDialog from '/@/components/regionsDialog/index.vue'; |
| | | import { emergencyPlanApi } from '/@/api/emergencyPlan'; |
| | | import { goalManagementApi } from '/@/api/goalManagement'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'openAdd', |
| | | components: { |
| | | CheckTemplate, |
| | | DailogSearchUserManger, |
| | | RegionsDialog, |
| | | }, |
| | | setup(prop, { emit }) { |
| | | const isShowDialog = ref(false); |
| | | const ruleFormRef = ref<FormInstance>(); |
| | | const ruleForm = ref({ |
| | | name: '', // 预案名称 |
| | | type: '', //预案类型 |
| | | associatedDanger: '', // 危险源关联 |
| | | level: '', // 预案级别 |
| | | authorUid: '', // 编写人 |
| | | authorName: '', |
| | | authorDeptId: '', // 编写部门 |
| | | releaseDate: '', // 发布实施日期 |
| | | fileList: [ |
| | | { |
| | | fileUrl: 'url', |
| | | fileName: 'name', |
| | | }, |
| | | ], |
| | | emergencyTeam: '', //应急队伍 |
| | | areaList: [], //区域列表 |
| | | teamList: [], |
| | | deptList: [], |
| | | abolishStatus: false, |
| | | approveId: '', |
| | | workName: '', // 审批名称 |
| | | title: '', //审批标题 |
| | | approvePersonId: '', // |
| | | approvePersonName: '', // 审批人 |
| | | approveStatus: 2, |
| | | relateType: 1, |
| | | approveResult: false, |
| | | approveMemo: '', |
| | | relateId: '', |
| | | }); |
| | | const titles = ref(); |
| | | const disabled = ref(); |
| | |
| | | isShowDialog.value = true; |
| | | titles.value = title; |
| | | disabled.value = type; |
| | | if (title == '查看应急预案管理' || title == '修改应急预案管理') { |
| | | emergencyPlanApi() |
| | | .seeEmergencyTeam(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ruleForm.value = res.data.data; |
| | | } |
| | | }); |
| | | } |
| | | emergencyPlanApi() |
| | | .approvalProcessEmergencyPlan(id) |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | ruleForm.value = res.data.data; |
| | | } |
| | | }); |
| | | }; |
| | | //日期选择器 |
| | | const releaseDate = ref(''); |
| | | // 上传附件 |
| | | const fileList = ref<UploadUserFile[]>([]); |
| | | //部门树 |
| | | const department = () => { |
| | | goalManagementApi() |
| | | .getTreedepartment() |
| | | .then((res) => { |
| | | if (res.data.code == 200) { |
| | | data.value = res.data.data; |
| | | } else { |
| | | ElMessage.error(res.data.msg); |
| | | } |
| | | }); |
| | | const submitForm = async () => { |
| | | isShowDialog.value = false; |
| | | emergencyPlanApi() |
| | | .editApprovalEmergencyPlan(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); |
| | | } |
| | | }); |
| | | }; |
| | | const treeSelect = ref(); |
| | | // const trees = ref(); |
| | | const propse = { |
| | | label: 'depName', |
| | | children: 'children', |
| | | value: 'depId', |
| | | }; |
| | | onMounted(() => { |
| | | department(); |
| | | }); |
| | | //定义树形下拉框 |
| | | const responsibleDepartment = ref(); |
| | | const data = ref(); |
| | | |
| | | const submitForm = async (title: string, formEl: FormInstance | undefined) => { |
| | | if (title == '新建应急预案管理') { |
| | | if (!formEl) return; |
| | | await formEl.validate((valid, fields) => { |
| | | if (valid) { |
| | | isShowDialog.value = false; |
| | | emergencyPlanApi() |
| | | .addEmergencyPlan(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; |
| | | emergencyPlanApi() |
| | | .editEmergencyTeam(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 = { |
| | | name: '', // 预案名称 |
| | | type: '', //预案类型 |
| | | associatedDanger: '', // 危险源关联 |
| | | level: '', // 预案级别 |
| | | authorUid: '', // 编写人 |
| | | authorName: '', |
| | | authorDeptId: '', // 编写部门 |
| | | releaseDate: '', // 发布实施日期 |
| | | fileList: [ |
| | | { |
| | | fileUrl: 'url', |
| | | fileName: 'name', |
| | | }, |
| | | ], |
| | | emergencyTeam: '', //应急队伍 |
| | | areaList: [], //区域列表 |
| | | teamList: [], |
| | | deptList: [], |
| | | abolishStatus: false, |
| | | }; |
| | | } |
| | | }; |
| | | const resetForm = (formEl: FormInstance | undefined) => { |
| | | const resetForm = () => { |
| | | isShowDialog.value = false; |
| | | if (!formEl) return; |
| | | formEl.resetFields(); |
| | | }; |
| | | // 应急队伍弹窗 |
| | | const Shows = ref(); |
| | | const daiInpt = () => { |
| | | Shows.value.openDailog(); |
| | | }; |
| | | // 选择区域弹窗 |
| | | const openRef = ref(); |
| | | const regionsDialog = () => { |
| | | openRef.value.openDailog(); |
| | | }; |
| | | // 打开用户选择弹窗 |
| | | const userRef = ref(); |
| | |
| | | }; |
| | | //回显 |
| | | const onUser = (e: any) => { |
| | | ruleForm.value.authorUid = e[0].uid; |
| | | ruleForm.value.authorName = e[0].realName; |
| | | ruleForm.value.approvePersonId = e[0].uid; |
| | | ruleForm.value.approvePersonName = e[0].realName; |
| | | }; |
| | | const typeChang = () => { |
| | | console.log('tag', ruleForm); |
| | |
| | | }; |
| | | return { |
| | | openDialog, |
| | | fileList, |
| | | responsibleDepartment, |
| | | data, |
| | | Search, |
| | | releaseDate, |
| | | treeSelect, |
| | | // trees, |
| | | propse, |
| | | department, |
| | | daiInpt, |
| | | Shows, |
| | | submitForm, |
| | | openUser, |
| | | userRef, |
| | | regionsDialog, |
| | | openRef, |
| | | toggleFullscreen, |
| | | FullScreen, |
| | | full, |