| | |
| | | <div style="margin-bottom: 20px;" v-if="!form.deptId"> |
| | | <el-alert title="请先选择部门信息" type="warning" /> |
| | | </div> |
| | | <el-form :model="form" ref="formRef" :rules="rules" label-width="70px"> |
| | | <el-form :model="form" ref="formRef" :rules="rules" label-width="70px" v-loading="isLoading" |
| | | element-loading-text="数据加载中,请稍后。。。"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="部门" prop="deptId"> |
| | |
| | | <el-col :span="12"> |
| | | <el-form-item label="候选人" prop="userId"> |
| | | <el-select v-model="form.userId" placeholder="请选择候选人" |
| | | :disabled="userSelectOption.length > 0 ? false : true" @change="userSelectChange" |
| | | :disabled="isLoading || userSelectOption.length > 0 ? false : true" @change="userSelectChange" |
| | | style="width: 100%;"> |
| | | <el-option v-for="item in userSelectOption" :label="item.name" :key="item.id" |
| | | :value="item.id" /> |
| | | <div class="loading-more" @click="loadMore">{{ loadingMoreText }}</div> |
| | | <div v-loading="isLoading" element-loading-text="数据加载中,请稍后。。。"> |
| | | <el-option v-for="item in userSelectOption" :label="item.name" :key="item.id" |
| | | :value="item.id" /> |
| | | <div class="loading-more" @click="loadMore">{{ loadingMoreText }}</div> |
| | | </div> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | </el-form> |
| | | <template #footer> |
| | | <el-button @click="() => props.params.visible = false">取消</el-button> |
| | | <el-button type="primary" @click="submit">确定</el-button> |
| | | <el-button type="primary" @click="submit" :loading="isLoading">确定</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | |
| | | }) |
| | | |
| | | const emits = defineEmits(['refresh']) |
| | | |
| | | const isLoading = ref(true) |
| | | |
| | | const curType = ref() |
| | | |
| | |
| | | // 初始化部门数据 |
| | | const initDept = async (parentId) => { |
| | | const deptResult = await getDeptLazyTree(parentId) |
| | | isLoading.value = false |
| | | return deptResult.data.data |
| | | } |
| | | |
| | | // 初始化用户列表 |
| | | const initUserList = (deptId) => { |
| | | isLoading.value = true |
| | | return getList( |
| | | page.current, |
| | | page.size, |
| | |
| | | deptId, |
| | | ).then(res => { |
| | | page.total = res.data.data.total |
| | | isLoading.value = false |
| | | return res.data.data.records |
| | | }) |
| | | } |
| | |
| | | const deptChange = async (value) => { |
| | | const id = value[value.length - 1] |
| | | currentDeptId.value = id |
| | | form.userId = '' |
| | | page.current = 1 |
| | | const userList = await initUserList(id) |
| | | userSelectOption.value = userList |
| | | if (userList.length <= 0) ElMessage.warning('当前部门人员为空,请选择其他部门!!') |
| | | } |
| | | |
| | | // 级联配置 |
| | |
| | | if (!val) return |
| | | const { id } = props.params.data |
| | | requestParams.evaluateTaskCategoryId = id |
| | | |
| | | |
| | | }, { |
| | | deep: true |
| | | }) |