| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="岗位:" prop="postJob"> |
| | | <el-input v-model="form.postJob" placeholder="请输入" clearable/> |
| | | <el-select v-model="form.postJob" filterable placeholder="请选择岗位" :loading="positionLoading" clearable> |
| | | <el-option v-for="p in positionOptions" :key="p.id" :label="p.name || p.label" :value="p.id" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {ref, reactive, toRefs, getCurrentInstance, onMounted} from "vue"; |
| | | import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js"; |
| | | import {deptPositionListPage} from "@/api/lavorissce/issue"; |
| | | |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | | const dialogFormVisible = ref(false); |
| | | const operationType = ref('') |
| | | const positionOptions = ref([]) |
| | | const positionLoading = ref(false) |
| | | |
| | | const data = reactive({ |
| | | form: { |
| | | staffNo: "", |
| | |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | |
| | | async function loadPositions() { |
| | | try { |
| | | positionLoading.value = true |
| | | const res = await deptPositionListPage({pageNum: 1, pageSize: 9999}) |
| | | positionOptions.value = res?.data?.records || res?.data || [] |
| | | } finally { |
| | | positionLoading.value = false |
| | | } |
| | | } |
| | | |
| | | // 打开弹框 |
| | | const openDialog = (type, row) => { |
| | | operationType.value = type; |
| | | dialogFormVisible.value = true; |
| | | loadPositions() |
| | | if (operationType.value === 'edit') { |
| | | getStaffJoinInfo(row.id).then(res => { |
| | | form.value = {...res.data} |
| | |
| | | form.value.id = '' |
| | | } |
| | | } |
| | | |
| | | // 提交产品表单 |
| | | const submitForm = () => { |
| | | proxy.$refs.formRef.validate(valid => { |