| | |
| | | })
|
| | | }
|
| | |
|
| | | export function findPostOptions(query) {
|
| | | return request({
|
| | | url: '/system/post/optionselect',
|
| | | method: 'get',
|
| | | params: query
|
| | | })
|
| | | }
|
| | |
|
| | |
|
| | | // 查询岗位详细
|
| | | export function getPost(postId) {
|
| | | return request({
|
| | |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="岗位:"> |
| | | {{ form.postJob || '-' }} |
| | | {{ form.postName || '-' }} |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | staffName: "", |
| | | sex: "", |
| | | nativePlace: "", |
| | | postJob: "", |
| | | postName: "", |
| | | sysPostId: 0, |
| | | adress: "", |
| | | firstStudy: "", |
| | | profession: "", |
| | |
| | | if (form.value.dimissionReason !== 'other') { |
| | | form.value.dimissionRemark = '' |
| | | } |
| | | if (!form.value.sysPostId) { |
| | | form.value.sysPostId = 0; |
| | | } |
| | | proxy.$refs["formRef"].validate(valid => { |
| | | if (valid) { |
| | | if (operationType.value === "add") { |
| | |
| | | staffName: "", |
| | | sex: "", |
| | | nativePlace: "", |
| | | postJob: "", |
| | | postName: "", |
| | | sysPostId: 0, |
| | | adress: "", |
| | | firstStudy: "", |
| | | profession: "", |
| | |
| | | phone, |
| | | staffNo, |
| | | nativePlace, |
| | | postJob, |
| | | postName, |
| | | sysPostId, |
| | | adress, |
| | | firstStudy, |
| | | profession, |
| | |
| | | phone, |
| | | staffNo, |
| | | nativePlace, |
| | | postJob, |
| | | postName, |
| | | sysPostId, |
| | | adress, |
| | | firstStudy, |
| | | profession, |
| | |
| | | }, |
| | | { |
| | | label: "岗位", |
| | | prop: "postJob", |
| | | prop: "postName", |
| | | }, |
| | | { |
| | | label: "现住址", |
| | |
| | | </el-row> |
| | | <el-row :gutter="30"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="岗位:" prop="postJob"> |
| | | <el-input v-model="form.postJob" placeholder="请输入" clearable/> |
| | | <el-form-item label="岗位:" prop="sysPostId"> |
| | | <el-select v-model="form.sysPostId" placeholder="请选择岗位" clearable> |
| | | <el-option |
| | | v-for="item in postOptions" |
| | | :key="item.postId" |
| | | :label="item.postName" |
| | | :value="item.postId" |
| | | :disabled="item.status === '1'" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {ref, onMounted} from "vue"; |
| | | import {getStaffJoinInfo, staffJoinAdd, staffJoinUpdate} from "@/api/personnelManagement/onboarding.js"; |
| | | import {findPostOptions} from "@/api/system/post.js"; |
| | | const { proxy } = getCurrentInstance() |
| | | const emit = defineEmits(['close']) |
| | | |
| | |
| | | contractStartTime: "", |
| | | contractEndTime: "", |
| | | staffState: "", |
| | | sysPostId: undefined, |
| | | }, |
| | | rules: { |
| | | staffNo: [{ required: true, message: "请输入", trigger: "blur" },], |
| | |
| | | contractStartTime: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | contractEndTime: [{ required: true, message: "请输入", trigger: "blur" }], |
| | | }, |
| | | postOptions: [], // 岗位选项 |
| | | }); |
| | | const { form, rules } = toRefs(data); |
| | | const { form, rules, postOptions } = toRefs(data); |
| | | |
| | | // 打开弹框 |
| | | const openDialog = (type, row) => { |
| | |
| | | if (operationType.value === 'edit') { |
| | | getStaffJoinInfo(row.id).then(res => { |
| | | form.value = {...res.data} |
| | | if (form.value.sysPostId === 0) { |
| | | form.value.sysPostId = undefined |
| | | } |
| | | // 编辑时也计算一次合同年限 |
| | | calculateContractTerm(); |
| | | }) |
| | | } else { |
| | | form.value.id = '' |
| | | } |
| | | |
| | | } |
| | | onMounted(() => { |
| | | fetchPostOptions() |
| | | }) |
| | | |
| | | const fetchPostOptions = () => { |
| | | findPostOptions().then(res => { |
| | | postOptions.value = res.data |
| | | }) |
| | | } |
| | | // 提交产品表单 |
| | | const submitForm = () => { |
| | | if (!form.value.sysPostId) { |
| | | form.value.sysPostId = 0; |
| | | } |
| | | proxy.$refs.formRef.validate(valid => { |
| | | if (valid) { |
| | | form.value.staffState = 1 |
| | |
| | | }, |
| | | { |
| | | label: "岗位", |
| | | prop: "postJob", |
| | | prop: "postName", |
| | | }, |
| | | { |
| | | label: "现住址", |