| | |
| | | ENV = 'development' |
| | | |
| | | # 规财安评管理系统/开发环境 |
| | | VUE_APP_BASE_API = 'http://106.15.95.149:7006' |
| | | VUE_APP_BASE_API = 'http://192.168.0.70:8080' |
| | | #VUE_APP_BASE_API = 'http://106.15.95.149:7006' |
| | | |
| | | # 路由懒加载F |
| | | VUE_CLI_BABEL_TRANSPILE_MODULES = true |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | // 获取专家类型 |
| | | export function expertsTree() { |
| | | // 获取专家列表 |
| | | export function getExpertsList(data) { |
| | | return request({ |
| | | url: '/expert/classify/tree', |
| | | method: 'post', |
| | | url: '/expert/info/page/list', |
| | | method: 'get', |
| | | params: data |
| | | }) |
| | | } |
| | | |
| | | // 获取专家列表 |
| | | export function delExpert(id) { |
| | | return request({ |
| | | url: '/expert/info/del/'+id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 分页获取专家类型 |
| | | export function getExpertTypes(data) { |
| | | return request({ |
| | | url: '/expert/classify/tree', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 添加专家类型 |
| | | export function addType(data) { |
| | | return request({ |
| | | url: '/expert/classify/add', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 修改专家类型 |
| | | export function updateType(data) { |
| | | return request({ |
| | | url: '/expert/classify/mod', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // 删除专家类型 |
| | | export function delExpertType(id) { |
| | | return request({ |
| | | url: '/expert/classify/del/'+id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | // 根据id获取专家信息 |
| | | export function getInfo(id) { |
| | | return request({ |
| | | url: '/expert/info/detail/'+id, |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | const first = matched[0] |
| | | |
| | | if (!this.isDashboard(first)) { |
| | | matched = [{ path: '/index', meta: { title: '首页' }}].concat(matched) |
| | | matched = [{ path: '/index', meta: { title: '专家申报表格' }}].concat(matched) |
| | | } |
| | | |
| | | this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
| | | }, |
| | | isDashboard(route) { |
| | |
| | | |
| | | <div class="right-menu"> |
| | | <template v-if="device!=='mobile'"> |
| | | <search id="header-search" class="right-menu-item" /> |
| | | <!-- <search id="header-search" class="right-menu-item" />--> |
| | | <!-- --> |
| | | <!-- <el-tooltip content="源码地址" effect="dark" placement="bottom">--> |
| | | <!-- <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | |
| | | <el-tooltip content="源码地址" effect="dark" placement="bottom"> |
| | | <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> |
| | | |
| | | <el-tooltip content="文档地址" effect="dark" placement="bottom"> |
| | | <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> |
| | | <!-- <el-tooltip content="文档地址" effect="dark" placement="bottom">--> |
| | | <!-- <ruo-yi-doc id="ruoyi-doc" class="right-menu-item hover-effect" />--> |
| | | <!-- </el-tooltip>--> |
| | | |
| | | <screenfull id="screenfull" class="right-menu-item hover-effect" /> |
| | | |
| | |
| | | <i class="el-icon-caret-bottom" /> |
| | | </div> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <router-link to="/user/profile"> |
| | | <el-dropdown-item>个人中心</el-dropdown-item> |
| | | </router-link> |
| | | <!-- <router-link to="/user/profile">--> |
| | | <!-- <el-dropdown-item>个人中心</el-dropdown-item>--> |
| | | <!-- </router-link>--> |
| | | <el-dropdown-item @click.native="setting = true"> |
| | | <span>布局设置</span> |
| | | </el-dropdown-item> |
| | |
| | | <img v-if="logo" :src="logo" class="sidebar-logo" /> |
| | | <h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> |
| | | </router-link> |
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/"> |
| | | <router-link v-else key="expand" class="sidebar-logo-link" to="/main/index"> |
| | | <img v-if="logo" :src="logo" class="sidebar-logo" /> |
| | | <h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1> |
| | | </router-link> |
| | |
| | | }, |
| | | isCollapse() { |
| | | return !this.sidebar.opened; |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | { |
| | | path: '', |
| | | component: Layout, |
| | | redirect: 'index', |
| | | redirect: '/main', |
| | | hidden: true, |
| | | children: [ |
| | | { |
| | | path: 'index', |
| | | component: () => import('@/views/index'), |
| | | name: 'Index', |
| | | meta: { title: '首页', icon: 'dashboard', affix: true } |
| | | } |
| | | // { |
| | | // path: 'main', |
| | | // component: () => import('@/views/main/index'), |
| | | // name: 'Index', |
| | | // meta: { title: '专家信息', icon: 'dashboard', affix: true } |
| | | // } |
| | | ] |
| | | }, |
| | | { |
| | |
| | | } |
| | | return Array.isArray(arg) |
| | | } |
| | | |
| | | // 简单校验手机号(十一位数字则通过) |
| | | export function verifySimplePhone(val) { |
| | | var regex = /^\d{11}$/; // 正则表达式,\d 匹配数字,{11} 表示匹配11次 |
| | | return regex.test(val); |
| | | } |
| | | |
| | | export function verifyIdCard(val) { |
| | | var regex = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; |
| | | return regex.test(val) |
| | | } |
对比新文件 |
| | |
| | | <template> |
| | | <el-dialog title="专家信息" :visible.sync="open" width="75%" append-to-body> |
| | | <div class="main_form"> |
| | | <el-form :model="form" :rules="rules" ref="ruleForm" label-width="200px" :label-position="labelPosition"> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="专业类别" prop="profession"> |
| | | <el-cascader |
| | | style="width: 100%" |
| | | v-model="form.profession" |
| | | :options="expertsType" |
| | | :disabled="disabled" |
| | | :props="{ expandTrigger: 'hover',value: 'id',label: 'label' }" |
| | | @change="professionChange"></el-cascader> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row>--> |
| | | <!-- <el-col :span="20">--> |
| | | <!-- <el-form-item label="填报日期" prop="date">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- style="width: 100%"--> |
| | | <!-- v-model="form.date"--> |
| | | <!-- type="date"--> |
| | | <!-- placeholder="选择日期">--> |
| | | <!-- </el-date-picker>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="姓名" prop="name"> |
| | | <el-input v-model="form.name" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-radio-group v-model="form.sex" :disabled="disabled"> |
| | | <el-radio :label="0">男</el-radio> |
| | | <el-radio :label="1">女</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="出生日期" prop="birthday"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | | :disabled="disabled" |
| | | v-model="form.birthday" |
| | | value-format="yyyy-MM-dd" |
| | | type="date" |
| | | placeholder="选择日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="联系电话" prop="phone"> |
| | | <el-input v-model="form.phone" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="职称" prop="title"> |
| | | <!-- <el-select v-model="form.title" placeholder="请选择" style="width: 100%">--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in professionalList"--> |
| | | <!-- :key="item.value"--> |
| | | <!-- :label="item.label"--> |
| | | <!-- :value="item.value">--> |
| | | <!-- </el-option>--> |
| | | <!-- </el-select>--> |
| | | <el-input v-model="form.title" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="证件照" prop="electronicPhoto"> |
| | | <!-- <el-upload--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- action=""--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- :limit="1"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- :file-list="fileList"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-change="avatorChange"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-exceed="overLimit"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" @click="downloadFile(form.electronicPhoto)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="身份证号" prop="idCard"> |
| | | <el-input v-model="form.idCard" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="在岗情况" prop="dutyStatus"> |
| | | <el-radio-group v-model="form.dutyStatus" :disabled="disabled"> |
| | | <el-radio :label="0">在岗</el-radio> |
| | | <el-radio :label="1">退休</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="单位全称" prop="companyName"> |
| | | <el-input v-model="form.companyName" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="单位地址"> |
| | | <el-input v-model="form.companyAddress" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="所在部门"> |
| | | <el-input v-model="form.deptName" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="职务"> |
| | | <el-input v-model="form.job" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="单位电话"> |
| | | <el-input v-model="form.companyTelephone" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="传真号码"> |
| | | <el-input v-model="form.faxNum" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="电子邮箱"> |
| | | <el-input v-model="form.email" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="毕业学校"> |
| | | <el-input v-model="form.graduationSchool" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="最高学历" prop="degree"> |
| | | <el-input v-model="form.degree" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="所学专业"> |
| | | <el-input v-model="form.speciality" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="现从事的专业及方向"> |
| | | <el-input v-model="form.currentProfession" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="支撑方向_安全生产" prop="supportDirectionSafety"> |
| | | <el-checkbox-group v-model="form.supportDirectionSafety" :disabled="disabled"> |
| | | <el-checkbox v-for="item in directionList" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="支撑方向_防灾减灾救灾" prop="supportDirectionPrevention"> |
| | | <el-checkbox-group v-model="form.supportDirectionPrevention" :disabled="disabled"> |
| | | <el-checkbox v-for="item in directionList" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="支撑方向_应急救援" prop="supportDirectionEmergency"> |
| | | <el-checkbox-group v-model="form.supportDirectionEmergency" :disabled="disabled"> |
| | | <el-checkbox v-for="item in directionList" :label="item.value" :key="item.value">{{ item.label }}</el-checkbox> |
| | | </el-checkbox-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.resume.length>0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="工作简历"> |
| | | <!-- <el-upload--> |
| | | <!-- action="#"--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- :file-list="resumeList"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-change="resumeChange"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" v-for="(item,index) in form.resume" :key="index" @click="downloadFile(item)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.paperSituation.length>0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="发明、著作、学术论文情况(何时、何地出版或发表)"> |
| | | <!-- <el-upload--> |
| | | <!-- action=""--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :file-list="inventionList"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-change="inventChange"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" v-for="(item,index) in form.paperSituation" :key="index" @click="downloadFile(item)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.reward.length>0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="受过何种奖励"> |
| | | <!-- <el-upload--> |
| | | <!-- action=""--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :file-list="rewardList"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-change="rewardChange"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" v-for="(item,index) in form.reward" :key="index" @click="downloadFile(item)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.achievement.length>0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="应急管理相关工作主要业绩及研究成果"> |
| | | <!-- <el-upload--> |
| | | <!-- action=""--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :file-list="achievementList"--> |
| | | <!-- :on-change="achieveChange"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" v-for="(item,index) in form.achievement" :key="index" @click="downloadFile(item)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.personalOpinion.length>0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="专家本人意见"> |
| | | <!-- <el-upload--> |
| | | <!-- action=""--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :file-list="proAdviceList"--> |
| | | <!-- :on-change="proChange"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" v-for="(item,index) in form.personalOpinion" :key="index" @click="downloadFile(item)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row v-if="form.recommendUnitOpinion.length>0"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="推荐单位意见"> |
| | | <!-- <el-upload--> |
| | | <!-- action=""--> |
| | | <!-- :disabled="disabled"--> |
| | | <!-- :auto-upload="false"--> |
| | | <!-- accept="image/*,.pdf"--> |
| | | <!-- list-type="picture-card"--> |
| | | <!-- :file-list="adviceList"--> |
| | | <!-- :on-change="adviceChange"--> |
| | | <!-- :before-upload="beforeAvatarUpload"--> |
| | | <!-- :on-preview="handlePreview"--> |
| | | <!-- :on-remove="handleRemove">--> |
| | | <!-- <i class="el-icon-plus"></i>--> |
| | | <!-- </el-upload>--> |
| | | <el-link type="primary" style="margin-right: 20px" v-for="(item,index) in form.recommendUnitOpinion" :key="index" @click="downloadFile(item)" target="_blank">点击查看</el-link> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="20"> |
| | | <el-form-item label="补充说明"> |
| | | <el-input v-model="form.remark" type="textarea" :autosize="{ minRows: 2}" :readonly="disabled"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div v-if="!disabled" style="width: 100%;padding-bottom: 30px;display: flex;justify-content: center"> |
| | | <el-button type="primary" @click="submit()">提交</el-button> |
| | | </div> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="dialogImageUrl" alt=""> |
| | | </el-dialog> |
| | | </div> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getExpertTypes,addExpertInfo,uploadFile} from '@/api/system/form' |
| | | import {getToken} from "@/utils/auth"; |
| | | import axios from "axios"; |
| | | export default { |
| | | name: "Index", |
| | | data() { |
| | | var validatePass = (rule, value, callback) => { |
| | | if (this.fileList.length == 0) { |
| | | callback(new Error('请上传证件照')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | return { |
| | | disabled: true, |
| | | labelPosition: 'right', |
| | | open: false, |
| | | form:{ |
| | | name:'', |
| | | sex:'', |
| | | profession: [], |
| | | bigClassify:null, |
| | | smallClassify: null, |
| | | birthday: '', |
| | | phone:'', |
| | | title: '', |
| | | electronicPhoto: '', |
| | | idCard: '', |
| | | dutyStatus: null, |
| | | companyName: '', |
| | | companyAddress: '', |
| | | deptName: '', |
| | | job: '', |
| | | companyTelephone: '', |
| | | faxNum: '', |
| | | email: '', |
| | | graduationSchool: '', |
| | | degree: '', |
| | | speciality: '', |
| | | currentProfession: '', |
| | | supportDirectionSafety: [], |
| | | supportDirectionPrevention: [], |
| | | supportDirectionEmergency: [], |
| | | resumeKey: '', |
| | | paperSituationKey: '', |
| | | rewardKey: '', |
| | | achievementKey: '', |
| | | personalOpinionKey: '', |
| | | recommendUnitOpinionKey: '', |
| | | remark: '', |
| | | resume: [], |
| | | paperSituation: [], |
| | | reward: [], |
| | | achievement: [], |
| | | personalOpinion: [], |
| | | recommendUnitOpinion: [] |
| | | }, |
| | | expertsType: [], |
| | | directionList: [ |
| | | { |
| | | value: 1, |
| | | label: '现场检查' |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: '调查评估' |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: '咨询服务' |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: '教育培训' |
| | | }, |
| | | { |
| | | value: 5, |
| | | label: '其他' |
| | | } |
| | | ], |
| | | fileList: [], |
| | | resumeList: [], |
| | | inventionList: [], |
| | | rewardList: [], |
| | | achievementList: [], |
| | | proAdviceList: [], |
| | | adviceList: [], |
| | | dialogImageUrl: '', |
| | | dialogVisible: false, |
| | | rules:{ |
| | | name:[{ required: true, message: '请填写姓名', trigger: 'blur' }], |
| | | sex:[{ required: true, message: '请选择性别', trigger: 'blur' }], |
| | | profession: [{ required: true, message: '请选择专业类别', trigger: 'blur' }], |
| | | birthday: [{ required: true, message: '请选择出生日期', trigger: 'blur' }], |
| | | phone:[{ required: true, message: '请填写联系电话', trigger: 'blur' }], |
| | | title: [{ required: true, message: '请填写职称', trigger: 'blur' }], |
| | | electronicPhoto: [{ required: true,validator: validatePass, trigger: 'blur' }], |
| | | idCard: [{ required: true, message: '请填写身份证号', trigger: 'blur' }], |
| | | dutyStatus: [{ required: true, message: '请选择在岗情况', trigger: 'blur' }], |
| | | companyName: [{ required: true, message: '请填写单位全称', trigger: 'blur' }], |
| | | degree: [{ required: true, message: '请填写最高学历', trigger: 'blur' }], |
| | | supportDirectionSafety: [{ required: true, message: '请选择支撑方向', trigger: 'blur' }], |
| | | supportDirectionPrevention: [{ required: true, message: '请选择支撑方向', trigger: 'blur' }], |
| | | supportDirectionEmergency: [{ required: true, message: '请选择支撑方向', trigger: 'blur' }] |
| | | }, |
| | | electronicPhoto: [], |
| | | resumePhoto: [], |
| | | paperSituationPhoto: [], |
| | | rewardPhoto: [], |
| | | achievementPhoto: [], |
| | | personalOpinionPhoto: [], |
| | | recommendUnitOpinionPhoto: [], |
| | | }; |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | openDialog(val){ |
| | | const width = document.documentElement.clientWidth |
| | | if(width < 750){this.labelPosition = 'top'} |
| | | this.getExpertsType() |
| | | for(let i in val){ |
| | | if(this.isValidKey(i,this.form)){ |
| | | this.form[i] = val[i] |
| | | } |
| | | } |
| | | this.form.profession[0] = val.bigClassify |
| | | this.form.profession[1] = val.smallClassify |
| | | this.form.supportDirectionSafety = val.supportDirectionSafety.split(',').map(i=>Number(i)) |
| | | this.form.supportDirectionPrevention = val.supportDirectionPrevention.split(',').map(i=>Number(i)) |
| | | this.form.supportDirectionEmergency = val.supportDirectionEmergency.split(',').map(i=>Number(i)) |
| | | this.electronicPhoto.push(this.form.electronicPhoto) |
| | | console.log(this.form,'form') |
| | | this.open = true |
| | | }, |
| | | isValidKey(key,obj){ |
| | | return key in obj |
| | | }, |
| | | |
| | | async getExpertsType(){ |
| | | const res = await getExpertTypes() |
| | | if(res.code == 200){ |
| | | this.expertsType = res.data |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }, |
| | | // downloadFile(type){ |
| | | // if(type == 'ele'){ |
| | | // axios.get(process.env.VUE_APP_BASE_API + this.form.electronicPhoto.fileUrl,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{ |
| | | // if (res) { |
| | | // let blob = new Blob([res.data],{type: res.data.type}) |
| | | // this.electronicPhoto = URL.createObjectURL(blob) |
| | | // } else { |
| | | // this.$message.error('获取文件失败') |
| | | // } |
| | | // }) |
| | | // } |
| | | // if(type == 'resume'){ |
| | | // if(this.form.resume.length>0){ |
| | | // for(let i in this.form.resume){ |
| | | // axios.get(process.env.VUE_APP_BASE_API + this.form.resume[i].fileUrl,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{ |
| | | // if (res) { |
| | | // let blob = new Blob([res.data],{type: res.data.type}) |
| | | // this.resumePhoto[i] = URL.createObjectURL(blob) |
| | | // } else { |
| | | // this.$message.error('获取文件失败') |
| | | // } |
| | | // }) |
| | | // } |
| | | // } |
| | | // console.log(this.resumePhoto.map(i=>i.substring(5)),'photo') |
| | | // } |
| | | // }, |
| | | |
| | | downloadFile(file){ |
| | | const t = this |
| | | axios.get(process.env.VUE_APP_BASE_API + file.fileUrl,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{ |
| | | if (res) { |
| | | const link = document.createElement('a') |
| | | let blob = new Blob([res.data],{type: res.data.type}) |
| | | link.style.display = "none"; |
| | | link.href = URL.createObjectURL(blob); // 创建URL |
| | | window.open(link.href) |
| | | // link.setAttribute("download", file.name); |
| | | // document.body.appendChild(link); |
| | | // link.click(); |
| | | // document.body.removeChild(link); |
| | | } else { |
| | | this.$message.error('获取文件失败') |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | professionChange(value) { |
| | | console.log(value,'val') |
| | | }, |
| | | avatorChange(file, fileList) { |
| | | this.fileList = fileList; |
| | | }, |
| | | resumeChange(file, fileList) { |
| | | this.resumeList = fileList; |
| | | }, |
| | | inventChange(file, fileList){ |
| | | this.inventionList = fileList; |
| | | }, |
| | | rewardChange(file, fileList){ |
| | | this.rewardList= fileList; |
| | | }, |
| | | achieveChange(file, fileList){ |
| | | this.achievementList= fileList; |
| | | }, |
| | | proChange(file, fileList){ |
| | | this.proAdviceList= fileList; |
| | | }, |
| | | adviceChange(file, fileList){ |
| | | this.adviceList= fileList; |
| | | }, |
| | | overLimit(){ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: '超出文件上传数量' |
| | | }); |
| | | }, |
| | | handlePreview(file) { |
| | | this.dialogImageUrl = file.url; |
| | | this.dialogVisible = true; |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt5M = file.size / 1024 / 1024 < 5; |
| | | if (!isLt5M) { |
| | | this.$message.error('上传头像图片大小不能超过 5MB!'); |
| | | } |
| | | return isLt5M; |
| | | }, |
| | | async submitUpload() { |
| | | const t = this; |
| | | // 创建一个数组来存储所有上传操作的 Promise |
| | | const uploadPromises = []; |
| | | // 定义一个函数来上传文件并将结果存入 resumeLink 数组 |
| | | async function uploadAndCollect(fileList, type) { |
| | | if (fileList.length > 0) { |
| | | const resumeLink = []; |
| | | for (const file of fileList) { |
| | | const formData = new FormData(); |
| | | formData.append("file", file.raw); |
| | | formData.append("module", 'expertPath'); |
| | | |
| | | const res = await uploadFile(formData); |
| | | if (res.code === 200) { |
| | | resumeLink.push(res.data[0].fileKey); |
| | | } else { |
| | | this.$message.error('图片上传出错!'); |
| | | } |
| | | } |
| | | // 将收集到的文件链接设置到 this.form 中 |
| | | if (type == '证件照') { t.form.electronicPhoto = resumeLink.join(',')} |
| | | if (type == '工作简历') { t.form.resumeKey = resumeLink.join(',')} |
| | | if (type == '发明著作') { t.form.paperSituationKey = resumeLink.join(',')} |
| | | if (type == '奖励') { t.form.rewardKey = resumeLink.join(',') } |
| | | if (type == '成果') { t.form.achievementKey = resumeLink.join(',')} |
| | | if (type == '专家意见') { t.form.personalOpinionKey = resumeLink.join(',') } |
| | | if (type == '推荐意见') { t.form.recommendUnitOpinionKey = resumeLink.join(',') } |
| | | return resumeLink; |
| | | } |
| | | return []; |
| | | } |
| | | // 依次执行上传操作并等待完成 |
| | | uploadPromises.push(uploadAndCollect(t.fileList, '证件照')); |
| | | uploadPromises.push(uploadAndCollect(t.resumeList, '工作简历')); |
| | | uploadPromises.push(uploadAndCollect(t.inventionList,'发明著作')); |
| | | uploadPromises.push(uploadAndCollect(t.rewardList,'奖励')); |
| | | uploadPromises.push(uploadAndCollect(t.achievementList,'成果')); |
| | | uploadPromises.push(uploadAndCollect(t.proAdviceList,'专家意见')); |
| | | uploadPromises.push(uploadAndCollect(t.adviceList,'推荐意见')); |
| | | // 等待所有上传操作完成 |
| | | await Promise.all(uploadPromises); |
| | | // 打印已更新的 this.form |
| | | console.log(t.form, 'form1'); |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | console.log(file, fileList); |
| | | }, |
| | | async submit(){ |
| | | this.$refs["ruleForm"].validate(async(valid) =>{ |
| | | if(valid) { |
| | | await this.submitUpload() |
| | | let data = this.form |
| | | data.supportDirectionSafety = data.supportDirectionSafety.join(',') |
| | | data.supportDirectionPrevention = data.supportDirectionPrevention.join(',') |
| | | data.supportDirectionEmergency = data.supportDirectionEmergency.join(',') |
| | | data.bigClassify = data.profession[0] |
| | | data.smallClassify = data.profession[1] |
| | | delete data.profession |
| | | const res= await addExpertInfo(data) |
| | | console.log(res,'res') |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type:'success', |
| | | message: res.msg |
| | | }) |
| | | this.$refs.ruleForm.resetFields() |
| | | this.fileList = [] |
| | | this.resumeList = [] |
| | | this.inventionList = [] |
| | | this.rewardList = [] |
| | | this.achievementList = [] |
| | | this.proAdviceList = [] |
| | | this.adviceList = [] |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message: res.msg |
| | | }) |
| | | } |
| | | }else{ |
| | | this.$message({ |
| | | type:'warning', |
| | | message:'请完善必填信息' |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home { |
| | | blockquote { |
| | | padding: 10px 20px; |
| | | margin: 0 0 20px; |
| | | font-size: 17.5px; |
| | | border-left: 5px solid #eee; |
| | | } |
| | | hr { |
| | | margin-top: 20px; |
| | | margin-bottom: 20px; |
| | | border: 0; |
| | | border-top: 1px solid #eee; |
| | | } |
| | | .col-item { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | ul { |
| | | padding: 0; |
| | | margin: 0; |
| | | } |
| | | |
| | | font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; |
| | | font-size: 13px; |
| | | color: #676a6c; |
| | | overflow-x: hidden; |
| | | |
| | | ul { |
| | | list-style-type: none; |
| | | } |
| | | |
| | | h4 { |
| | | margin-top: 0px; |
| | | } |
| | | |
| | | h2 { |
| | | margin-top: 10px; |
| | | font-size: 26px; |
| | | font-weight: 100; |
| | | } |
| | | |
| | | p { |
| | | margin-top: 10px; |
| | | |
| | | b { |
| | | font-weight: 700; |
| | | } |
| | | } |
| | | |
| | | .update-log { |
| | | ol { |
| | | display: block; |
| | | list-style-type: decimal; |
| | | margin-block-start: 1em; |
| | | margin-block-end: 1em; |
| | | margin-inline-start: 0; |
| | | margin-inline-end: 0; |
| | | padding-inline-start: 40px; |
| | | } |
| | | } |
| | | } |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | overflow: hidden; |
| | | } |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 178px; |
| | | height: 178px; |
| | | line-height: 178px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 178px; |
| | | height: 178px; |
| | | display: block; |
| | | } |
| | | </style> |
| | | |
| | |
| | | <template> |
| | | <div class="app-container home"> |
| | | <div class="main-title">专家信息录入</div> |
| | | <!-- <el-divider>专家信息录入</el-divider>--> |
| | | <div class="main_form"> |
| | | <el-form :model="form" :rules="rules" ref="ruleForm" label-width="200px"> |
| | | <el-form :model="form" :rules="rules" ref="ruleForm" label-width="200px" :label-position="labelPosition"> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="专业类别" prop="profession"> |
| | | <el-cascader |
| | | style="width: 100%" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row>--> |
| | | <!-- <el-col :span="16">--> |
| | | <!-- <el-col :span="20">--> |
| | | <!-- <el-form-item label="填报日期" prop="date">--> |
| | | <!-- <el-date-picker--> |
| | | <!-- style="width: 100%"--> |
| | |
| | | <!-- </el-col>--> |
| | | <!-- </el-row>--> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="姓名" prop="name"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="性别" prop="sex"> |
| | | <el-radio-group v-model="form.sex"> |
| | | <el-radio :label="0">男</el-radio> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="出生日期" prop="birthday"> |
| | | <el-date-picker |
| | | style="width: 100%" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="联系电话" prop="phone"> |
| | | <el-input v-model="form.phone"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="职称" prop="title"> |
| | | <!-- <el-select v-model="form.title" placeholder="请选择" style="width: 100%">--> |
| | | <!-- <el-option--> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="证件照" prop="electronicPhoto"> |
| | | <el-upload |
| | | action="" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="身份证号" prop="idCard"> |
| | | <el-input v-model="form.idCard"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="在岗情况" prop="dutyStatus"> |
| | | <el-radio-group v-model="form.dutyStatus"> |
| | | <el-radio :label="0">在岗</el-radio> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="单位全称" prop="companyName"> |
| | | <el-input v-model="form.companyName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="单位地址"> |
| | | <el-input v-model="form.companyAddress"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="所在部门"> |
| | | <el-input v-model="form.deptName"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="职务"> |
| | | <el-input v-model="form.job"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="单位电话"> |
| | | <el-input v-model="form.companyTelephone"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="传真号码"> |
| | | <el-input v-model="form.faxNum"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="电子邮箱"> |
| | | <el-input v-model="form.email"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="毕业学校"> |
| | | <el-input v-model="form.graduationSchool"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="最高学历" prop="degree"> |
| | | <el-input v-model="form.degree"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="所学专业"> |
| | | <el-input v-model="form.speciality"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="现从事的专业及方向"> |
| | | <el-input v-model="form.currentProfession"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="支撑方向_安全生产" prop="supportDirectionSafety"> |
| | | <!-- <el-radio-group v-model="form.supportDirectionSafety">--> |
| | | <!-- <el-radio v-for="item in directionList" :label="item.value" :key="item.value">{{ item.label }}</el-radio>--> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="支撑方向_防灾减灾救灾" prop="supportDirectionPrevention"> |
| | | <!-- <el-radio-group v-model="form.supportDirectionPrevention">--> |
| | | <!-- <el-radio v-for="item in directionList" :label="item.value" :key="item.value">{{ item.label }}</el-radio>--> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="支撑方向_应急救援" prop="supportDirectionEmergency"> |
| | | <!-- <el-radio-group v-model="form.supportDirectionEmergency">--> |
| | | <!-- <el-radio v-for="item in directionList" :label="item.value" :key="item.value">{{ item.label }}</el-radio>--> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="工作简历"> |
| | | <el-upload |
| | | action="#" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="发明、著作、学术论文情况(何时、何地出版或发表)"> |
| | | <el-upload |
| | | action="" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="受过何种奖励"> |
| | | <el-upload |
| | | action="" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="应急管理相关工作主要业绩及研究成果"> |
| | | <el-upload |
| | | action="" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="专家本人意见"> |
| | | <el-upload |
| | | action="" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="推荐单位意见"> |
| | | <el-upload |
| | | action="" |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="16"> |
| | | <el-col :span="20"> |
| | | <el-form-item label="补充说明"> |
| | | <el-input v-model="form.remark" type="textarea" :autosize="{ minRows: 2}"></el-input> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {expertsTree,addExpertInfo,uploadFile} from '@/api/system/form' |
| | | import {getExpertTypes,addExpertInfo,uploadFile} from '@/api/system/form' |
| | | import { verifySimplePhone, verifyIdCard } from "@/utils/validate"; |
| | | export default { |
| | | name: "Index", |
| | | data() { |
| | | var validatePass = (rule, value, callback) => { |
| | | console.log(this.form,this.fileList,'校验') |
| | | if (this.fileList.length == 0) { |
| | | callback(new Error('请上传证件照')); |
| | | } else { |
| | | callback(); |
| | | } |
| | | }; |
| | | } |
| | | let validatePhone = (rule, value, callback)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入手机号')) |
| | | }else{ |
| | | if(!verifySimplePhone(value)){ |
| | | callback(new Error('手机号格式有误')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | let verifyId = (rule, value, callback)=>{ |
| | | if(value === ''){ |
| | | callback(new Error('请输入身份证号')) |
| | | }else{ |
| | | if(!verifyIdCard(value)){ |
| | | callback(new Error('身份证号格式有误')) |
| | | }else{ |
| | | callback() |
| | | } |
| | | } |
| | | } |
| | | return { |
| | | labelPosition: 'right', |
| | | form:{ |
| | | name:'', |
| | | sex:'', |
| | |
| | | achievementKey: '', |
| | | personalOpinionKey: '', |
| | | recommendUnitOpinionKey: '', |
| | | remark: '' |
| | | remark: '', |
| | | source: 1 |
| | | }, |
| | | expertsType: [], |
| | | directionList: [ |
| | |
| | | sex:[{ required: true, message: '请选择性别', trigger: 'blur' }], |
| | | profession: [{ required: true, message: '请选择专业类别', trigger: 'blur' }], |
| | | birthday: [{ required: true, message: '请选择出生日期', trigger: 'blur' }], |
| | | phone:[{ required: true, message: '请填写联系电话', trigger: 'blur' }], |
| | | phone:[{ required: true, validator: validatePhone, trigger: 'blur' }], |
| | | title: [{ required: true, message: '请填写职称', trigger: 'blur' }], |
| | | electronicPhoto: [{ required: true,validator: validatePass, trigger: 'blur' }], |
| | | idCard: [{ required: true, message: '请填写身份证号', trigger: 'blur' }], |
| | | idCard: [{ required: true, validator: verifyId, trigger: 'blur' }], |
| | | dutyStatus: [{ required: true, message: '请选择在岗情况', trigger: 'blur' }], |
| | | companyName: [{ required: true, message: '请填写单位全称', trigger: 'blur' }], |
| | | degree: [{ required: true, message: '请填写最高学历', trigger: 'blur' }], |
| | |
| | | }, |
| | | created() { |
| | | const t = this |
| | | const width = document.documentElement.clientWidth |
| | | if(width < 750){t.labelPosition = 'top'} |
| | | t.getExpertsType() |
| | | }, |
| | | methods: { |
| | | async getExpertsType(){ |
| | | const res = await expertsTree() |
| | | console.log(res) |
| | | const res = await getExpertTypes() |
| | | if(res.code == 200){ |
| | | this.expertsType = res.data |
| | | }else{ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | changeSource(num){ |
| | | this.form.source = num |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home { |
| | | .main-title{ |
| | | font-size: 24px; |
| | | font-weight: bolder; |
| | | text-align: center; |
| | | margin-bottom: 20px; |
| | | color: #333; |
| | | } |
| | | blockquote { |
| | | padding: 10px 20px; |
| | | margin: 0 0 20px; |
| | |
| | | <template> |
| | | <div class="app-container home"> |
| | | <el-row :gutter="20"> |
| | | 666 |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="专业类别"> |
| | | <el-cascader |
| | | v-model="classiFy" |
| | | :options="expertTypes" |
| | | :props="{ expandTrigger: 'hover', value: 'id',label: 'label'}" |
| | | @change="handleChange"></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="在岗情况" prop="dutyStatus"> |
| | | <el-select v-model="queryParams.dutyStatus" placeholder="岗位状态" clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.expert_dudy_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="时间范围" prop="searchTime"> |
| | | <el-date-picker |
| | | v-model="searchTime" |
| | | @change="changeTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | value-format="yyyy-MM-dd" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:experts:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="warning"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-download"--> |
| | | <!-- size="mini"--> |
| | | <!-- @click="handleExport"--> |
| | | <!-- v-hasPermi="['system:experts:export']"--> |
| | | <!-- >导出</el-button>--> |
| | | <!-- </el-col>--> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <el-table v-loading="loading" :data="expertList"> |
| | | <el-table-column type="index" width="55" align="center" /> |
| | | <el-table-column label="姓名" align="center" prop="name" /> |
| | | <el-table-column label="出生日期" align="center" prop="birthday" /> |
| | | <el-table-column label="学历" align="center" prop="degree" /> |
| | | <el-table-column label="职称/职业资格/职务" align="center" prop="job" /> |
| | | <el-table-column label="专业" align="center" prop="speciality" /> |
| | | <el-table-column label="推荐类别组别" align="center"> |
| | | <template #default="scope"> |
| | | {{findNodeById(expertTypes,scope.row.bigClassify)}}/{{findNodeById(expertTypes,scope.row.smallClassify)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="联系电话" align="center" prop="phone"/> |
| | | <el-table-column label="申请时间" align="center" prop="createTime"> |
| | | <template #default="scope"> |
| | | {{scope.row.createTime.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleUpdate(scope.row)" |
| | | >查看</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:experts:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageIndex" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <form-dialog ref="formDialog"></form-dialog> |
| | | <el-dialog title="新增信息" :visible.sync="addForm" width="75%" append-to-body> |
| | | <form-fill ref="formFill"></form-fill> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getExpertsList, getExpertTypes, delExpert, getInfo} from "@/api/system/form"; |
| | | import formDialog from './components/formDialog' |
| | | import formFill from './form' |
| | | export default { |
| | | name: "Index", |
| | | name: "Experts", |
| | | dicts: ['expert_dudy_status'], |
| | | components: {formDialog,formFill}, |
| | | data() { |
| | | return { |
| | | // 版本号 |
| | | version: "3.8.6" |
| | | loading: true, |
| | | single: true, |
| | | multiple: true, |
| | | showSearch: true, |
| | | addForm: false, |
| | | total: 0, |
| | | expertTypes: [], |
| | | expertList: [], |
| | | queryParams: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | bigClassify: null, |
| | | smallClassify: null, |
| | | dutyStatus: null, |
| | | startTime: '', |
| | | endTime: '' |
| | | }, |
| | | classiFy: [], |
| | | searchTime: [], |
| | | form: {}, |
| | | rules: { |
| | | classifyName: [ |
| | | { required: true, message: "分类名称不能为空", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getTypes() |
| | | }, |
| | | methods: { |
| | | async getList() { |
| | | this.loading = true; |
| | | const res = await getExpertsList(this.queryParams) |
| | | if(res.code == 200){ |
| | | this.expertList = res.rows |
| | | this.total = res.total |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | |
| | | async getTypes() { |
| | | const res = await getExpertTypes() |
| | | if(res.code == 200){ |
| | | this.expertTypes = res.data |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | handleChange(value) { |
| | | console.log(value); |
| | | }, |
| | | changeTime(value){ |
| | | console.log(value); |
| | | }, |
| | | // 根据id查对象 |
| | | findNodeById(data,value) { |
| | | for (const node of data) { |
| | | if (node.id === value) { |
| | | return node.label; |
| | | } |
| | | if (node.children) { |
| | | const foundNode = this.findNodeById(node.children, value); |
| | | if (foundNode) { |
| | | return foundNode; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | }, |
| | | handleQuery() { |
| | | this.queryParams.pageIndex = 1 |
| | | if(this.classiFy.length>0){ |
| | | this.queryParams.bigClassify = this.classiFy[0] |
| | | this.queryParams.smallClassify = this.classiFy[1] |
| | | } |
| | | if(this.searchTime.length>0){ |
| | | this.queryParams.startTime = this.searchTime[0] |
| | | this.queryParams.endTime = this.searchTime[1] |
| | | } |
| | | this.getList(); |
| | | }, |
| | | resetQuery() { |
| | | const t = this |
| | | t.resetForm("queryForm"); |
| | | t.classiFy = [] |
| | | t.searchTime = [] |
| | | t.handleQuery(); |
| | | }, |
| | | |
| | | // 表单重置 |
| | | reset() { |
| | | this.queryParams = { |
| | | parentId: 0, |
| | | classifyId: null, |
| | | classifyName: '' |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | |
| | | handleExport() { |
| | | this.download('system/experts/export', { |
| | | ...this.queryParams |
| | | }, `post_${new Date().getTime()}.xlsx`) |
| | | }, |
| | | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.addForm = true |
| | | setTimeout(()=>{ |
| | | this.$refs.formFill.changeSource(2) |
| | | },1000) |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | getInfo(row.expertId).then((res)=>{ |
| | | if(res.code == 200){ |
| | | this.$refs.formDialog.openDialog(res.data) |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.title == '修改分类') { |
| | | updateType(this.form).then(res => { |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改成功' |
| | | }); |
| | | this.open = false; |
| | | this.getList(); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | const {classifyId,...data} = this.form |
| | | addType(data).then(res => { |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '添加成功' |
| | | }); |
| | | this.open = false; |
| | | this.getList(); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | console.log(row,'row') |
| | | this.$modal.confirm('是否确认删除姓名为"' + row.name + '"的数据项?').then(function() { |
| | | return delExpert(row.expertId); |
| | | }).then((res) => { |
| | | if(res.code == 200){ |
| | | this.getList(); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | .home { |
| | | blockquote { |
| | | padding: 10px 20px; |
| | | margin: 0 0 20px; |
| | | font-size: 17.5px; |
| | | border-left: 5px solid #eee; |
| | | } |
| | | hr { |
| | | margin-top: 20px; |
| | | margin-bottom: 20px; |
| | | border: 0; |
| | | border-top: 1px solid #eee; |
| | | } |
| | | .col-item { |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | ul { |
| | | padding: 0; |
| | | margin: 0; |
| | | } |
| | | |
| | | font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; |
| | | font-size: 13px; |
| | | color: #676a6c; |
| | | overflow-x: hidden; |
| | | |
| | | ul { |
| | | list-style-type: none; |
| | | } |
| | | |
| | | h4 { |
| | | margin-top: 0px; |
| | | } |
| | | |
| | | h2 { |
| | | margin-top: 10px; |
| | | font-size: 26px; |
| | | font-weight: 100; |
| | | } |
| | | |
| | | p { |
| | | margin-top: 10px; |
| | | |
| | | b { |
| | | font-weight: 700; |
| | | } |
| | | } |
| | | |
| | | .update-log { |
| | | ol { |
| | | display: block; |
| | | list-style-type: decimal; |
| | | margin-block-start: 1em; |
| | | margin-block-end: 1em; |
| | | margin-inline-start: 0; |
| | | margin-inline-end: 0; |
| | | padding-inline-start: 40px; |
| | | } |
| | | } |
| | | } |
| | | </style> |
| | | |
| | |
| | | </el-form> |
| | | <!-- 底部 --> |
| | | <div class="el-login-footer"> |
| | | <span>Copyright © 2018-2023 ruoyi.vip All Rights Reserved.</span> |
| | | <span>技术支持:中国科学院</span> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | return { |
| | | codeUrl: "", |
| | | loginForm: { |
| | | username: "admin", |
| | | password: "admin123", |
| | | username: "", |
| | | password: "", |
| | | rememberMe: false, |
| | | code: "", |
| | | uuid: "" |
| | |
| | | watch: { |
| | | $route: { |
| | | handler: function(route) { |
| | | this.redirect = route.query && route.query.redirect; |
| | | // this.redirect = route.query && route.query.redirect; |
| | | this.redirect = '/main/index'; |
| | | }, |
| | | immediate: true |
| | | } |
对比新文件 |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="专业类别"> |
| | | <el-cascader |
| | | v-model="classiFy" |
| | | :options="expertTypes" |
| | | :props="{ expandTrigger: 'hover', value: 'id',label: 'label'}" |
| | | @change="handleChange"></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="在岗情况" prop="dutyStatus"> |
| | | <el-select v-model="queryParams.dutyStatus" placeholder="岗位状态" clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.expert_dudy_status" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="时间范围" prop="searchTime"> |
| | | <el-date-picker |
| | | v-model="searchTime" |
| | | @change="changeTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | value-format="yyyy-MM-dd" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期"> |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:experts:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="warning"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-download"--> |
| | | <!-- size="mini"--> |
| | | <!-- @click="handleExport"--> |
| | | <!-- v-hasPermi="['system:experts:export']"--> |
| | | <!-- >导出</el-button>--> |
| | | <!-- </el-col>--> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | <el-table v-loading="loading" :data="expertList"> |
| | | <el-table-column type="index" width="55" align="center" /> |
| | | <el-table-column label="姓名" align="center" prop="name" /> |
| | | <el-table-column label="出生日期" align="center" prop="birthday" /> |
| | | <el-table-column label="学历" align="center" prop="degree" /> |
| | | <el-table-column label="职称/职业资格/职务" align="center" prop="job" /> |
| | | <el-table-column label="专业" align="center" prop="speciality" /> |
| | | <el-table-column label="推荐类别组别" align="center"> |
| | | <template #default="scope"> |
| | | {{findNodeById(expertTypes,scope.row.bigClassify)}}/{{findNodeById(expertTypes,scope.row.smallClassify)}} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="联系电话" align="center" prop="phone"/> |
| | | <el-table-column label="申请时间" align="center" prop="createTime"> |
| | | <template #default="scope"> |
| | | {{scope.row.createTime.substring(0,10)}} |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleUpdate(scope.row)" |
| | | >查看</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:experts:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageIndex" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <form-dialog ref="formDialog"></form-dialog> |
| | | <el-dialog title="新增信息" :visible.sync="addForm" width="75%" append-to-body> |
| | | <form-fill ref="formFill"></form-fill> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import {getExpertsList, getExpertTypes, delExpert, getInfo} from "@/api/system/form"; |
| | | import formDialog from '../components/formDialog' |
| | | import formFill from '../form' |
| | | export default { |
| | | name: "Experts", |
| | | dicts: ['expert_dudy_status'], |
| | | components: {formDialog,formFill}, |
| | | data() { |
| | | return { |
| | | loading: true, |
| | | single: true, |
| | | multiple: true, |
| | | showSearch: true, |
| | | addForm: false, |
| | | total: 0, |
| | | expertTypes: [], |
| | | expertList: [], |
| | | queryParams: { |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | bigClassify: null, |
| | | smallClassify: null, |
| | | dutyStatus: null, |
| | | startTime: '', |
| | | endTime: '' |
| | | }, |
| | | classiFy: [], |
| | | searchTime: [], |
| | | form: {}, |
| | | rules: { |
| | | classifyName: [ |
| | | { required: true, message: "分类名称不能为空", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | this.getTypes() |
| | | }, |
| | | methods: { |
| | | async getList() { |
| | | this.loading = true; |
| | | const res = await getExpertsList(this.queryParams) |
| | | if(res.code == 200){ |
| | | this.expertList = res.rows |
| | | this.total = res.total |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | |
| | | async getTypes() { |
| | | const res = await getExpertTypes() |
| | | if(res.code == 200){ |
| | | this.expertTypes = res.data |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | handleChange(value) { |
| | | console.log(value); |
| | | }, |
| | | changeTime(value){ |
| | | console.log(value); |
| | | }, |
| | | // 根据id查对象 |
| | | findNodeById(data,value) { |
| | | for (const node of data) { |
| | | if (node.id === value) { |
| | | return node.label; |
| | | } |
| | | if (node.children) { |
| | | const foundNode = this.findNodeById(node.children, value); |
| | | if (foundNode) { |
| | | return foundNode; |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | }, |
| | | handleQuery() { |
| | | this.queryParams.pageIndex = 1 |
| | | if(this.classiFy.length>0){ |
| | | this.queryParams.bigClassify = this.classiFy[0] |
| | | this.queryParams.smallClassify = this.classiFy[1] |
| | | } |
| | | if(this.searchTime.length>0){ |
| | | this.queryParams.startTime = this.searchTime[0] |
| | | this.queryParams.endTime = this.searchTime[1] |
| | | } |
| | | this.getList(); |
| | | }, |
| | | resetQuery() { |
| | | const t = this |
| | | t.resetForm("queryForm"); |
| | | t.classiFy = [] |
| | | t.searchTime = [] |
| | | t.handleQuery(); |
| | | }, |
| | | |
| | | // 表单重置 |
| | | reset() { |
| | | this.queryParams = { |
| | | parentId: 0, |
| | | classifyId: null, |
| | | classifyName: '' |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | |
| | | handleExport() { |
| | | this.download('system/experts/export', { |
| | | ...this.queryParams |
| | | }, `post_${new Date().getTime()}.xlsx`) |
| | | }, |
| | | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.addForm = true |
| | | setTimeout(()=>{ |
| | | this.$refs.formFill.changeSource(2) |
| | | },1000) |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | getInfo(row.expertId).then((res)=>{ |
| | | if(res.code == 200){ |
| | | this.$refs.formDialog.openDialog(res.data) |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.title == '修改分类') { |
| | | updateType(this.form).then(res => { |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改成功' |
| | | }); |
| | | this.open = false; |
| | | this.getList(); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | const {classifyId,...data} = this.form |
| | | addType(data).then(res => { |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '添加成功' |
| | | }); |
| | | this.open = false; |
| | | this.getList(); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const expertId = row.expertId; |
| | | this.$modal.confirm('是否确认删除姓名为"' + row.name + '"的数据项?').then(function() { |
| | | return delExpert(expertId); |
| | | }).then((res) => { |
| | | if(res.code == 200){ |
| | | this.getList(); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }).catch(() => {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| | | <el-form-item label="岗位编码" prop="postCode"> |
| | | <el-input |
| | | v-model="queryParams.postCode" |
| | | placeholder="请输入岗位编码" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="岗位名称" prop="postName"> |
| | | <el-input |
| | | v-model="queryParams.postName" |
| | | placeholder="请输入岗位名称" |
| | | clearable |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="岗位状态" clearable> |
| | | <el-option |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.label" |
| | | :value="dict.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | v-hasPermi="['system:post:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="mini" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:post:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="mini" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:post:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="mini" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:post:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="success"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-edit"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="single"--> |
| | | <!-- @click="handleUpdate"--> |
| | | <!-- v-hasPermi="['system:post:edit']"--> |
| | | <!-- >修改</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="danger"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-delete"--> |
| | | <!-- size="mini"--> |
| | | <!-- :disabled="multiple"--> |
| | | <!-- @click="handleDelete"--> |
| | | <!-- v-hasPermi="['system:post:remove']"--> |
| | | <!-- >删除</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button--> |
| | | <!-- type="warning"--> |
| | | <!-- plain--> |
| | | <!-- icon="el-icon-download"--> |
| | | <!-- size="mini"--> |
| | | <!-- @click="handleExport"--> |
| | | <!-- v-hasPermi="['system:post:export']"--> |
| | | <!-- >导出</el-button>--> |
| | | <!-- </el-col>--> |
| | | <!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>--> |
| | | </el-row> |
| | | |
| | | <el-table v-loading="loading" :data="postList" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column label="岗位编号" align="center" prop="postId" /> |
| | | <el-table-column label="岗位编码" align="center" prop="postCode" /> |
| | | <el-table-column label="岗位名称" align="center" prop="postName" /> |
| | | <el-table-column label="岗位排序" align="center" prop="postSort" /> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table v-loading="loading" :data="expertList" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
| | | <el-table-column label="分类名称" align="center" prop="label" /> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:post:edit']" |
| | | v-hasPermi="['system:experts:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:post:remove']" |
| | | v-hasPermi="['system:experts:remove']" |
| | | >删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total>0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | |
| | | <!-- 添加或修改岗位对话框 --> |
| | | <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="80px"> |
| | | <el-form-item label="岗位名称" prop="postName"> |
| | | <el-input v-model="form.postName" placeholder="请输入岗位名称" /> |
| | | <el-form-item label="父级" v-if="title == '添加分类'" prop="parentId"> |
| | | <el-cascader |
| | | v-model="form.parentId" |
| | | :options="expertList" |
| | | :props="{ expandTrigger: 'hover', value: 'id',label: 'label',emitPath: false,checkStrictly: true }" |
| | | @change="handleChange"></el-cascader> |
| | | </el-form-item> |
| | | <el-form-item label="岗位编码" prop="postCode"> |
| | | <el-input v-model="form.postCode" placeholder="请输入编码名称" /> |
| | | </el-form-item> |
| | | <el-form-item label="岗位顺序" prop="postSort"> |
| | | <el-input-number v-model="form.postSort" controls-position="right" :min="0" /> |
| | | </el-form-item> |
| | | <el-form-item label="岗位状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio |
| | | v-for="dict in dict.type.sys_normal_disable" |
| | | :key="dict.value" |
| | | :label="dict.value" |
| | | >{{dict.label}}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> |
| | | <el-form-item label="分类名称" prop="classifyName"> |
| | | <el-input v-model="form.classifyName" placeholder="请输入分类名称" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post"; |
| | | import {getExpertTypes, delExpertType, addType, updateType} from "@/api/system/form"; |
| | | |
| | | export default { |
| | | name: "Post", |
| | | name: "Experts", |
| | | dicts: ['sys_normal_disable'], |
| | | data() { |
| | | return { |
| | | // 遮罩层 |
| | | loading: true, |
| | | // 选中数组 |
| | | ids: [], |
| | | // 非单个禁用 |
| | | single: true, |
| | | // 非多个禁用 |
| | |
| | | // 总条数 |
| | | total: 0, |
| | | // 岗位表格数据 |
| | | postList: [], |
| | | expertList: [], |
| | | // 弹出层标题 |
| | | title: "", |
| | | // 是否显示弹出层 |
| | | open: false, |
| | | // 查询参数 |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | postCode: undefined, |
| | | postName: undefined, |
| | | status: undefined |
| | | }, |
| | | // 表单参数 |
| | | form: {}, |
| | | // 表单校验 |
| | | rules: { |
| | | postName: [ |
| | | { required: true, message: "岗位名称不能为空", trigger: "blur" } |
| | | ], |
| | | postCode: [ |
| | | { required: true, message: "岗位编码不能为空", trigger: "blur" } |
| | | ], |
| | | postSort: [ |
| | | { required: true, message: "岗位顺序不能为空", trigger: "blur" } |
| | | classifyName: [ |
| | | { required: true, message: "分类名称不能为空", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | |
| | | }, |
| | | methods: { |
| | | /** 查询岗位列表 */ |
| | | getList() { |
| | | async getList() { |
| | | this.loading = true; |
| | | listPost(this.queryParams).then(response => { |
| | | this.postList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | const res = await getExpertTypes() |
| | | if(res.code == 200){ |
| | | this.expertList = res.data |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | this.loading = false; |
| | | }, |
| | | // 取消按钮 |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | handleChange(value) { |
| | | console.log(value); |
| | | }, |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = { |
| | | postId: undefined, |
| | | postCode: undefined, |
| | | postName: undefined, |
| | | postSort: 0, |
| | | status: "0", |
| | | remark: undefined |
| | | parentId: 0, |
| | | classifyId: null, |
| | | classifyName: '' |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** 搜索按钮操作 */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** 重置按钮操作 */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // 多选框选中数据 |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.postId) |
| | | this.single = selection.length!=1 |
| | | this.multiple = !selection.length |
| | | }, |
| | | |
| | | /** 新增按钮操作 */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "添加岗位"; |
| | | this.title = "添加分类"; |
| | | }, |
| | | /** 修改按钮操作 */ |
| | | handleUpdate(row) { |
| | | console.log(row,'row') |
| | | this.reset(); |
| | | const postId = row.postId || this.ids |
| | | getPost(postId).then(response => { |
| | | this.form = response.data; |
| | | this.form.classifyId = row.id; |
| | | this.form.classifyName = row.label; |
| | | this.form.parentId = this.findParentNodeById(this.expertList,row.id) |
| | | this.open = true; |
| | | this.title = "修改岗位"; |
| | | }); |
| | | this.title = "修改分类"; |
| | | }, |
| | | /** 提交按钮 */ |
| | | submitForm: function() { |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | if (this.form.postId != undefined) { |
| | | updatePost(this.form).then(response => { |
| | | this.$modal.msgSuccess("修改成功"); |
| | | if (this.title == '修改分类') { |
| | | updateType(this.form).then(res => { |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '修改成功' |
| | | }); |
| | | this.open = false; |
| | | this.getList(); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }); |
| | | } else { |
| | | addPost(this.form).then(response => { |
| | | this.$modal.msgSuccess("新增成功"); |
| | | const {classifyId,...data} = this.form |
| | | addType(data).then(res => { |
| | | if(res.code == 200){ |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '添加成功' |
| | | }); |
| | | this.open = false; |
| | | this.getList(); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | |
| | | }, |
| | | /** 删除按钮操作 */ |
| | | handleDelete(row) { |
| | | const postIds = row.postId || this.ids; |
| | | this.$modal.confirm('是否确认删除岗位编号为"' + postIds + '"的数据项?').then(function() { |
| | | return delPost(postIds); |
| | | }).then(() => { |
| | | const classifyId = row.id; |
| | | this.$modal.confirm('是否确认删除分类为"' + row.label + '"的数据项?').then(function() { |
| | | return delExpertType(classifyId); |
| | | }).then((res) => { |
| | | if(res.code == 200){ |
| | | this.getList(); |
| | | this.$modal.msgSuccess("删除成功"); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功' |
| | | }); |
| | | }else{ |
| | | this.$message({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }).catch(() => {}); |
| | | }, |
| | | /** 导出按钮操作 */ |
| | | handleExport() { |
| | | this.download('system/post/export', { |
| | | ...this.queryParams |
| | | }, `post_${new Date().getTime()}.xlsx`) |
| | | |
| | | // 获取父级ID |
| | | findParentNodeById(data, value) { |
| | | for (const node of data) { |
| | | if (node.id === value) { |
| | | return null; // 已经是根节点,没有父级节点 |
| | | } |
| | | if (node.children) { |
| | | for (const child of node.children) { |
| | | if (child.id === value) { |
| | | return node.id; // 返回当前节点的ID作为父级ID |
| | | } |
| | | } |
| | | const foundNode = this.findParentNodeById(node.children, value); |
| | | if (foundNode !== null) { |
| | | return foundNode; // 返回找到的父级ID |
| | | } |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | }; |