| | |
| | | <el-dialog :title="title" v-model="isShowCtfDialog" width="769px" @close="restForm"> |
| | | <el-form :model="ctfForm" size="default" ref="ctfRef" :rules="ctfFormRules" label-width="120px"> |
| | | <el-row :gutter="35"> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="关联角色" prop="roleId"> |
| | | <el-select v-model="ctfForm.roleId" placeholder="请选择" clearable class="w100" :disabled="disabled"> |
| | | <el-option v-for="item in roleData" :key="item.roleId" :label="item.roleName" :value="item.roleId"> </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">--> |
| | | <!-- <el-form-item label="关联角色" prop="roleId">--> |
| | | <!-- <el-select v-model="ctfForm.roleId" placeholder="请选择" clearable class="w100" :disabled="disabled">--> |
| | | <!-- <el-option v-for="item in roleData" :key="item.roleId" :label="item.roleName" :value="item.roleId"> </el-option>--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> |
| | | <el-form-item label="证书编号" prop="certNo"> |
| | | <el-input v-model.trim="ctfForm.certNo" :disabled="disabled" placeholder="" clearable></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="作业类型" prop="workType"> |
| | | <el-select v-model="ctfForm.workType" placeholder="请选择作业类型" :disabled="disabled"> |
| | | <el-form-item label="证书类型" prop="certTypeId"> |
| | | <el-select v-model="ctfForm.certTypeId" placeholder="请选择证书类型" :disabled="disabled"> |
| | | <el-option |
| | | v-for="item in workTypeList" |
| | | v-for="item in certTypeIdList" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | |
| | | import {workApplyApi} from "/@/api/specialWorkSystem/workApply"; |
| | | import axios from "axios"; |
| | | import {useUserInfo} from "/@/stores/userInfo"; |
| | | import {certApi} from "/@/api/systemManage/certificate"; |
| | | |
| | | // 定义接口来定义对象的类型 |
| | | interface DeptData {} |
| | |
| | | dialogImg: boolean |
| | | ctfForm: { |
| | | userCertId?: string |
| | | roleId: number| null |
| | | certNo: string |
| | | certExpiredAt: string |
| | | workType: number| null |
| | | certTypeId: number| null |
| | | certUrl: string |
| | | uid: string | null |
| | | }; |
| | |
| | | fileList: Array<file> |
| | | delList: Array<any> |
| | | uploadUrl: string |
| | | workTypeList: Array<any> |
| | | certTypeIdList: Array<any> |
| | | } |
| | | interface file { |
| | | url: string; |
| | |
| | | dialogImg: false, |
| | | ctfForm: { |
| | | userCertId: '', |
| | | roleId: null, |
| | | certNo: '', |
| | | certExpiredAt: '', |
| | | workType: null, |
| | | certTypeId: null, |
| | | certUrl: '', |
| | | uid: '' |
| | | }, |
| | | ctfFormRules:{ |
| | | roleId: [{ required: true, message: '请选择证书相关角色', trigger: 'blur' }], |
| | | certNo: [{ required: true, message: '请输入证书编号', trigger: 'blur' }], |
| | | certExpiredAt: [{ required: true, message: '请选择证书到期时间', trigger: 'change' }], |
| | | workType: [{ required: true, message: '请选择作业类型', trigger: 'blur' }], |
| | | certTypeId: [{ required: true, message: '请选择证书类型', trigger: 'blur' }], |
| | | certUrl: [{ required: true, message: '请上传证书', trigger: 'change' }], |
| | | }, |
| | | dialogImageUrl: null, |
| | | fileList: [], |
| | | delList: [], |
| | | uploadUrl: '', |
| | | workTypeList: [ |
| | | { id: 1, name: '动火作业' }, |
| | | { id: 2, name: '受限空间作业' }, |
| | | { id: 3, name: '吊装作业' }, |
| | | { id: 4, name: '动土作业' }, |
| | | { id: 5, name: '断路作业' }, |
| | | { id: 6, name: '高处作业' }, |
| | | { id: 7, name: '临时用电作业' }, |
| | | { id: 8, name: '盲板抽堵作业' } |
| | | ] |
| | | certTypeIdList: [] |
| | | }); |
| | | |
| | | // 打开弹窗 |
| | | const openDialog = (type: string, value: any, uid: string) => { |
| | | state.isShowCtfDialog = true; |
| | | state.isShowCtfDialog = true |
| | | getCerttypeList() |
| | | state.fileList = [] |
| | | if (type === 'add') { |
| | | state.disabled = false |
| | | state.title = '新增证书'; |
| | | state.ctfForm = { |
| | | roleId: null, |
| | | certNo: '', |
| | | certExpiredAt: '', |
| | | workType: null, |
| | | certTypeId: null, |
| | | certUrl: '', |
| | | uid: uid |
| | | }; |
| | |
| | | if(type === 'edit'){ |
| | | state.disabled = false |
| | | state.title = '修改证书'; |
| | | console.log(state.ctfForm,'555') |
| | | }else{ |
| | | state.disabled = true |
| | | state.title = '查看'; |
| | |
| | | const isValidKey =(key: string | number | symbol, data:object): key is keyof typeof data => { |
| | | return key in data |
| | | } |
| | | |
| | | const getCerttypeList = async () => { |
| | | let res = await certApi().getCerttypeList({pageIndex: 1, pageSize: 99, searchParams: {name:''}}); |
| | | if (res.data.code === '200') { |
| | | state.certTypeIdList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.data.msg |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | // 新增修改 |
| | | const onSubmit = async () => { |
| | |
| | | const restForm = ()=>{ |
| | | state.ctfForm = { |
| | | userCertId: '', |
| | | roleId: null, |
| | | certNo: '', |
| | | certExpiredAt: '', |
| | | workType: null, |
| | | certTypeId: null, |
| | | certUrl: '', |
| | | uid: '' |
| | | } |