| | |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | | <el-button icon="Edit" @click="openSetDate">一键设置有效期</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-table v-loading="loading" :data="expertList" :border="true"> |
| | | <el-table-column type="index" width="55" align="center" /> |
| | | <el-table v-loading="loading" ref="multipleTableRef" :data="expertList" :border="true" @selection-change="handleSelectionChange" :row-key="(row) => { return row.id }"> |
| | | <el-table-column type="selection" width="55" :reserve-selection="true"/> |
| | | <el-table-column type="index" width="55" align="center" label="序号"/> |
| | | <el-table-column label="姓名" align="center" prop="name" /> |
| | | <el-table-column label="身份证号" align="center" prop="idCard" /> |
| | | <el-table-column label="出生日期" align="center" prop="birthday"> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button type="primary" link @click="openDialog('edit',scope.row)">编辑</el-button> |
| | | <el-button type="primary" link @click="openDialog('view',scope.row)">查看</el-button> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | v-model:limit="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | <el-dialog |
| | | v-model="assessDialog" |
| | | title="修改有效期" |
| | | width="50%" |
| | | :before-close="closeAssess" |
| | | > |
| | | <el-form :model="assessForm" :rules="assessRules" ref="assessFormRef" label-width="200px"> |
| | | <el-form-item label="专家聘用期限" prop="employTime"> |
| | | <el-date-picker |
| | | v-model="assessForm.employTime" |
| | | type="daterange" |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | value-format="YYYY-MM-DD" |
| | | /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="closeAssess" size="default">取 消</el-button> |
| | | <el-button type="primary" @click="assessSubmit(assessFormRef)" size="default" v-preReClick>确认</el-button> |
| | | </span> |
| | | </template> |
| | | </el-dialog> |
| | | <expert-form ref="expertFormRef" @getList="getList"></expert-form> |
| | | </div> |
| | | </template> |
| | |
| | | import {getCurrentInstance, onMounted, onUnmounted, reactive, ref, toRefs} from "vue"; |
| | | import {ElMessage, ElMessageBox} from "element-plus"; |
| | | import ExpertForm from "../applyRecords/components/expertForm"; |
| | | import {delExpert, getExpertsList, getExpertTypes} from "../../../../api/form"; |
| | | import {changeApprove, changeEmploymentDate, delExpert, getExpertsList, getExpertTypes} from "../../../../api/form"; |
| | | import {useRouter} from "vue-router"; |
| | | const router = useRouter(); |
| | | const loading = ref(false); |
| | | const loading = ref(false) |
| | | |
| | | const data = reactive({ |
| | | showSearch: true, |
| | | total: 0, |
| | |
| | | label: '其他' |
| | | } |
| | | ], |
| | | multipleSelection: [], |
| | | assessDialog: false, |
| | | assessForm: { |
| | | employTime: [] |
| | | }, |
| | | assessRules: { |
| | | employTime:[{ required: true, message: '请选择有效期', trigger: 'blur' }], |
| | | } |
| | | }); |
| | | |
| | | const { showSearch,total, expertTypes,expertList,queryParams,classiFy,searchTime} = toRefs(data); |
| | | const { showSearch,total, expertTypes,expertList,queryParams,searchTime,assessForm,assessDialog,assessRules,multipleSelection} = toRefs(data); |
| | | const expertFormRef = ref() |
| | | const assessFormRef = ref() |
| | | const multipleTableRef = ref() |
| | | onMounted(()=>{ |
| | | getList() |
| | | getTypes() |
| | |
| | | onUnmounted(()=>{ |
| | | |
| | | }) |
| | | |
| | | const handleSelectionChange = (val) => { |
| | | data.multipleSelection = val |
| | | } |
| | | |
| | | const getTypes = async()=> { |
| | | const res = await getExpertTypes() |
| | |
| | | expertFormRef.value.openDialog(type, value); |
| | | } |
| | | |
| | | const openSetDate = ()=>{ |
| | | if(data.multipleSelection.length>0){ |
| | | data.assessDialog = true |
| | | }else{ |
| | | ElMessage.warning('请选择要设置的人员') |
| | | } |
| | | } |
| | | |
| | | const assessSubmit = async (formEl)=> { |
| | | if (!formEl) return |
| | | await formEl.validate(async (valid, fields) => { |
| | | if (valid) { |
| | | let params = { |
| | | id: data.multipleSelection.map(i=>i.id), |
| | | employmentDateStart: data.assessForm.employTime[0], |
| | | employmentDateEnd: data.assessForm.employTime[1] |
| | | } |
| | | const res = await changeEmploymentDate(params) |
| | | if(res.code == 200){ |
| | | ElMessage({ |
| | | type: 'success', |
| | | message: '修改成功' |
| | | }) |
| | | data.multipleSelection = [] |
| | | multipleTableRef.value.clearSelection() |
| | | await getList() |
| | | data.assessDialog = false |
| | | }else{ |
| | | ElMessage({ |
| | | type: 'warning', |
| | | message: res.msg |
| | | }); |
| | | } |
| | | }else { |
| | | ElMessage.warning('请完善必填信息') |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const closeAssess = ()=>{ |
| | | assessFormRef.value.clearValidate() |
| | | data.assessForm = { |
| | | employTime: [] |
| | | } |
| | | data.assessDialog = false; |
| | | } |
| | | const resetQuery=()=> { |
| | | data.queryParams = { |
| | | name: '', |