| | |
| | | <el-row :gutter="22"> |
| | | <el-col :span="11"> |
| | | <el-form-item label="所属机构:" prop="agencyId" v-if="state.title !== '修改密码'"> |
| | | <el-select v-model="state.form.agencyId" style="width: 100%" v-loadMore="loadMore" class="m-2" placeholder="请选择机构" popper-class="more_select_dropdown" > |
| | | <el-input v-if="isAgency" v-model="state.agencyName" disabled></el-input> |
| | | <el-select v-model="state.form.agencyId" v-else style="width: 100%" v-loadMore="loadMore" class="m-2" placeholder="请选择机构" popper-class="more_select_dropdown" > |
| | | <el-option |
| | | v-for="item in state.agencyList" |
| | | :key="item.id" |
| | |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于5M</div> |
| | | </template> |
| | | </el-upload> |
| | | |
| | | </el-form-item> |
| | | <el-form-item prop="idPhoto" label="证件照:" v-if="state.title !== '修改密码'"> |
| | | <el-upload |
| | | accept="image/*" |
| | | :action="state.uploadUrl" |
| | | :headers="state.header" |
| | | method="post" |
| | | :on-change="handleChangePic" |
| | | :on-success="handlePhotoSuccess" |
| | | :on-preview="handlePictureCardPreview" |
| | | v-model:file-list="state.photoList" |
| | | list-type="picture-card" |
| | | :before-upload="picSize" |
| | | :on-remove="handlePhotoRemove" |
| | | :limit="2" |
| | | > |
| | | <el-icon><Plus /></el-icon> |
| | | <template #tip> |
| | | <div class="el-upload__tip">上传jpg/png图片尺寸小于5M</div> |
| | | </template> |
| | | </el-upload> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer > |
| | |
| | | import {resetUserPwd} from "../../../../../api/sysUsers"; |
| | | import {getToken} from "@/utils/auth"; |
| | | import {getInsitutionList} from "@/api/backManage/insitution"; |
| | | import {getDictList} from "@/api/backManage/evaluate"; |
| | | import Cookies from "js-cookie"; |
| | | |
| | | const emit = defineEmits(["getList"]); |
| | | const props = defineProps(['majorList','levelList','postList']) |
| | | const dialogVisible = ref(false) |
| | |
| | | socialAttach: [], |
| | | medicalAttach: [], |
| | | salaryAttach: [], |
| | | idPhoto: '', |
| | | post: '', |
| | | jobTitle: '', |
| | | level: '', |
| | |
| | | password: '', |
| | | confirmPassword: '', |
| | | }, |
| | | agencyName:'', |
| | | socialList: [], |
| | | medicalList: [], |
| | | salaryList: [], |
| | | photoList: [], |
| | | formRules:{ |
| | | name: [{ required: true, message: '请输入姓名', trigger: 'blur' }], |
| | | username: [{ required: true, validator: validateUsername, trigger: 'blur' }], |
| | |
| | | socialAttach: [{required: true, trigger: "blur", message: "请上传社保图片"}], |
| | | medicalAttach: [{required: true, trigger: "blur", message: "请上传医保图片"}], |
| | | salaryAttach: [{required: true, trigger: "blur", message: "请上传工资清单"}], |
| | | idPhoto: [{required: true, trigger: "blur", message: "请上传近期证件照"}], |
| | | }, |
| | | areaList: [], |
| | | agencyList: [], |
| | |
| | | pageSize: 10 |
| | | }) |
| | | |
| | | const isAgency = ref(false); |
| | | onMounted(()=>{ |
| | | getAgency() |
| | | const userInfo = JSON.parse(Cookies.get('userInfo')) |
| | | state.agencyName = userInfo.agentName; |
| | | state.form.agencyId = userInfo.agentId; |
| | | if(userInfo.identity === 1){ |
| | | isAgency.value = true; |
| | | } |
| | | console.log("userinfo",userInfo) |
| | | }) |
| | | |
| | | const openDialog = async (type, value) => { |
| | |
| | | name: url.name |
| | | } |
| | | }); |
| | | const arr = [] |
| | | const certificateList = JSON.parse(res.data.certificateNo) |
| | | for( let key in certificateList) { |
| | | arr.push( { |
| | | id: parseInt(key), |
| | | certificateNo: certificateList[key], |
| | | }) |
| | | arr.forEach((item,index) => { |
| | | item.label = res.data.majorNames[index] |
| | | }) |
| | | const obj = { |
| | | url: import.meta.env.VITE_APP_BASE_API +'/'+ res.data.idPhoto |
| | | } |
| | | state.form.majorShow = arr; |
| | | console.log(state.form.majorShow,'certificateList') |
| | | state.photoList.push(obj); |
| | | if(res.data.certificateNo){ |
| | | const arr = [] |
| | | const certificateList = JSON.parse(res.data.certificateNo) |
| | | for( let key in certificateList) { |
| | | arr.push( { |
| | | id: parseInt(key), |
| | | certificateNo: certificateList[key], |
| | | }) |
| | | arr.forEach((item,index) => { |
| | | item.label = res.data.majorNames[index] |
| | | }) |
| | | } |
| | | state.form.majorShow = arr; |
| | | console.log(state.form.majorShow,'certificateList') |
| | | } |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } |
| | |
| | | state.salaryList = []; |
| | | state.medicalList = []; |
| | | state.socialList = []; |
| | | state.photoList = []; |
| | | dialogVisible.value = false; |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | |
| | | socialAttach: [], |
| | | medicalAttach: [], |
| | | salaryAttach: [], |
| | | idPhoto: '', |
| | | post: '', |
| | | jobTitle: '', |
| | | level:'', |
| | |
| | | state.salaryList = []; |
| | | state.medicalList = []; |
| | | state.socialList = []; |
| | | state.photoList = []; |
| | | state.form.selectMajorList = []; |
| | | } |
| | | const picSize = async (rawFile) => { |
| | |
| | | } |
| | | } |
| | | |
| | | const handlePhotoSuccess = (res,file) => { |
| | | if(res.code == 200){ |
| | | state.form.idPhoto = res.data.path; |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: '文件上传失败' |
| | | }) |
| | | } |
| | | } |
| | | const handleChangePic = (file,fileList) => { |
| | | if (fileList.length > 1) { |
| | | state.photoList.splice(0, 1); |
| | | } |
| | | } |
| | | |
| | | const handlePhotoRemove = async (file) => { |
| | | console.log("fileD",file) |
| | | let path = "" |
| | | if(file.response && file.response.data){ |
| | | path = file.response.data.path |
| | | }else { |
| | | const base = import.meta.env.VITE_APP_BASE_API |
| | | path = file.url.substring(base.length+1,file.url.length ) |
| | | } |
| | | const res = await delPic({path: path}) |
| | | if(res.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '文件已删除' |
| | | }) |
| | | state.form.idPhoto = '' |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | } |
| | | |
| | | |
| | | |