| | |
| | | <el-col :span="11"> |
| | | <el-form-item label="所属机构:" prop="agencyId" v-if="state.title !== '修改密码'"> |
| | | <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-select v-model="state.form.agencyName" @change="selectValue" 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" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :value="item.name" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | console.log("attribute", attribute.value) |
| | | |
| | | } else { |
| | | getAgency() |
| | | getAgency('open') |
| | | } |
| | | } |
| | | |
| | |
| | | const res = await getUserById(param); |
| | | if(res.code == 200){ |
| | | state.form = res.data |
| | | // debugger |
| | | state.form.agencyName = res.data.agency.name |
| | | state.socialList = res.data.socialAttach.map(url => { |
| | | return { |
| | | url: import.meta.env.VITE_APP_BASE_API +'/'+url.path, |
| | |
| | | }) |
| | | } |
| | | state.form.majorShow = arr; |
| | | console.log(state.form.majorShow,'certificateList') |
| | | console.log(state.form,'certificateList') |
| | | } |
| | | |
| | | }else{ |
| | |
| | | } |
| | | |
| | | const handlePhotoRemove = async (file) => { |
| | | if (file && file.status == 'success') { |
| | | // state.form.idPhoto = '' |
| | | |
| | | let path = "" |
| | | if(file.response && file.response.data){ |
| | | if (file.response && file.response.data) { |
| | | path = file.response.data.path |
| | | }else { |
| | | } else { |
| | | const base = import.meta.env.VITE_APP_BASE_API |
| | | path = file.url.substring(base.length+1,file.url.length ) |
| | | path = file.url.substring(base.length + 1, file.url.length) |
| | | } |
| | | await delPic({path: path}).then(res => { |
| | | if(res.code == 200){ |
| | | if (res.code == 200) { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件已删除' |
| | | // }) |
| | | state.form.idPhoto = '' |
| | | }else{ |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | |
| | | }).catch(() => { |
| | | state.form.idPhoto = '' |
| | | }); |
| | | } |
| | | |
| | | |
| | | // const res = await delPic({path: path}) |
| | |
| | | |
| | | |
| | | const handleRemove = async (file, uploadFiles,type) => { |
| | | if(file && file.status == 'success') { |
| | | |
| | | let path = "" |
| | | if(state.title === '编辑') { |
| | | const base = import.meta.env.VITE_APP_BASE_API |
| | | path = file.url.substring(base.length+1,file.url.length ) |
| | | }else { |
| | | path = file.response.data.path |
| | | if (state.title === '编辑') { |
| | | const base = import.meta.env.VITE_APP_BASE_API |
| | | path = file.url.substring(base.length + 1, file.url.length) |
| | | } else { |
| | | path = file.response.data.path |
| | | } |
| | | |
| | | await delPic({path: path}).then(res => { |
| | | if(res.code == 200){ |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件已删除' |
| | | // }) |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | await delPic({path: path}).then(res => { |
| | | if (res.code == 200) { |
| | | // ElMessage({ |
| | | // type: 'success', |
| | | // message: '文件已删除' |
| | | // }) |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.message |
| | | }) |
| | | } |
| | | }).catch(() => { |
| | | if(type === 1){ |
| | | state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path) |
| | | }else if(type === 2){ |
| | | state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path) |
| | | }else { |
| | | state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path) |
| | | } |
| | | if (type === 1) { |
| | | state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path) |
| | | } else if (type === 2) { |
| | | state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path) |
| | | } else { |
| | | state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path) |
| | | } |
| | | }); |
| | | |
| | | if(type === 1){ |
| | | state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path) |
| | | }else if(type === 2){ |
| | | state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path) |
| | | }else { |
| | | state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path) |
| | | if (type === 1) { |
| | | state.form.socialAttach = state.form.socialAttach.filter(item => item.path !== path) |
| | | } else if (type === 2) { |
| | | state.form.medicalAttach = state.form.medicalAttach.filter(item => item.path !== path) |
| | | } else { |
| | | state.form.salaryAttach = state.form.salaryAttach.filter(item => item.path !== path) |
| | | } |
| | | } |
| | | } |
| | | const finshed = ref(false) |
| | | const getAgency = async () => { |
| | | const getAgency = async (type) => { |
| | | if (type === 'open' && state.pageNum !== 1) { |
| | | |
| | | } else { |
| | | const queryParams = { |
| | | pageNum: state.pageNum, |
| | | pageSize: state.pageSize, |
| | | pageNum: state.pageNum, |
| | | pageSize: state.pageSize, |
| | | } |
| | | const res = await getInsitutionList(queryParams) |
| | | if(res.code == 200){ |
| | | if(res.data.pageNum === state.pageNum){ |
| | | finshed.value = false; |
| | | if(state.pageNum == 1){ |
| | | state.agencyList = res.data.list |
| | | }else { |
| | | state.agencyList =state.agencyList .concat(res.data.list) |
| | | } |
| | | }else { |
| | | finshed.value = true; |
| | | if (res.code == 200) { |
| | | if (res.data.pageNum === state.pageNum) { |
| | | finshed.value = false; |
| | | if (state.pageNum == 1) { |
| | | state.agencyList = res.data.list |
| | | } else { |
| | | state.agencyList = state.agencyList.concat(res.data.list) |
| | | } |
| | | } else { |
| | | finshed.value = true; |
| | | } |
| | | |
| | | }else{ |
| | | ElMessage.warning(res.message) |
| | | } else { |
| | | ElMessage.warning(res.message) |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | setTimeout(() => { |
| | | if (finshed.value) return //值为true,则代表没有数据了 |
| | | state.pageNum += 1 |
| | | getAgency() |
| | | getAgency('') |
| | | }, 500) |
| | | } |
| | | |
| | |
| | | // state.form.selectMajorList= val; |
| | | console.log('选中的xxxx',val) |
| | | } |
| | | const selectValue = (val) => { |
| | | state.agencyList.forEach(item => { |
| | | if(item.name === val){ |
| | | state.form.agencyId = item.id |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | defineExpose({ |
| | | openDialog |