| | |
| | | import Pagination from '@/components/Pagination' |
| | | import Treeselect from '@riophae/vue-treeselect' |
| | | import '@riophae/vue-treeselect/dist/vue-treeselect.css' |
| | | import { calculateSeniority, toCardGetUserInfo } from '@/utils/myUtil' |
| | | import { calculateSeniority, toCardGetUserInfo, dateToString } from '@/utils/myUtil' |
| | | import ArchivesEdit from './archivesEdit' |
| | | import { pages } from '@/settings' |
| | | |
| | |
| | | birthdate: '', |
| | | politics: '13', |
| | | entryDate: '', |
| | | education: '61', |
| | | education: '17', |
| | | seniority: '', |
| | | nativePlace: '', |
| | | nativePlaceName: '', |
| | |
| | | changeTypeOptions: [], |
| | | dimissionTypeOptions: [], |
| | | ageStrOptions: [], |
| | | sexOptions: [] |
| | | sexOptions: [], |
| | | openArchivesForm: {} |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | this.empBaseInfoImageUrl = '' |
| | | }, |
| | | editEmpBase(row) { |
| | | console.log(row) |
| | | this.isAdd = false |
| | | this.empBaseInfoForm.empId = row.empId |
| | | this.empBaseInfoForm.customerId = row.customerId |
| | |
| | | putEmpBase(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | if (this.isAdd) { |
| | | this.$post('hr/empBaseInfo', { ...this.empBaseInfoForm }).then((r) => { |
| | | r.data |
| | | this.buttonLoading = false |
| | | this.$message({ |
| | | message: this.$t('tips.createSuccess'), |
| | | type: 'success' |
| | | }) |
| | | this.cleanEmpBase() |
| | | }) |
| | | } else { |
| | | this.$put('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => { |
| | | this.$message({ |
| | | message: this.$t('tips.updateSuccess'), |
| | | type: 'success' |
| | | }) |
| | | this.$emit('success') |
| | | this.cleanEmpBase() |
| | | }) |
| | | } |
| | | this.submitEmpInfo() |
| | | // if (this.isAdd) { |
| | | // this.$post('hr/empBaseInfo/addInEmp', { ...this.empBaseInfoForm }).then((r) => { |
| | | // if (r.data != null) { |
| | | // if (r.data.data.empStatus === '0') { |
| | | // this.$confirm('该员工已存在,是否修改?', '提示', { |
| | | // confirmButtonText: '确定', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning' |
| | | // }).then(() => { |
| | | // this.editEmpBase(r.data.data) |
| | | // }) |
| | | // } else { |
| | | // this.$confirm('该员工已离职,是否重新打开档案?', '提示', { |
| | | // confirmButtonText: '确定', |
| | | // cancelButtonText: '取消', |
| | | // type: 'warning' |
| | | // }).then(() => { |
| | | // this.openArchivesForm = { |
| | | // empId: r.data.data.empId, |
| | | // empName: r.data.data.empName, |
| | | // certificateNumb: r.data.data.certificateNumb, |
| | | // openType: 2, |
| | | // openDate: this.getDateString(), |
| | | // remark: '' |
| | | // } |
| | | // this.$post('hr/empOpenArchives', { ...this.openArchivesForm }).then(() => { |
| | | // this.$message({ |
| | | // message: this.$t('员工档案打开成功'), |
| | | // type: 'success' |
| | | // }) |
| | | // }) |
| | | // }) |
| | | // } |
| | | // } |
| | | // }) |
| | | // } else { |
| | | // this.$put('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => { |
| | | // this.$message({ |
| | | // message: this.$t('tips.updateSuccess'), |
| | | // type: 'success' |
| | | // }) |
| | | // this.$emit('success') |
| | | // this.cleanEmpBase() |
| | | // }) |
| | | // } |
| | | this.fetch({ |
| | | ...this.queryParams, |
| | | ...this.sort |
| | |
| | | putEmpBaseContinue(formName) { |
| | | this.$refs[formName].validate((valid) => { |
| | | if (valid) { |
| | | if (this.isAdd) { |
| | | this.$post('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => { |
| | | this.buttonLoading = false |
| | | this.$message({ |
| | | message: this.$t('tips.createSuccess'), |
| | | type: 'success' |
| | | }) |
| | | this.cleanEmpBase() |
| | | }) |
| | | } |
| | | this.submitEmpInfo() |
| | | // if (this.isAdd) { |
| | | // this.$post('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => { |
| | | // this.buttonLoading = false |
| | | // this.$message({ |
| | | // message: this.$t('tips.createSuccess'), |
| | | // type: 'success' |
| | | // }) |
| | | // this.cleanEmpBase() |
| | | // }) |
| | | // } |
| | | this.cleanEmpBase() |
| | | this.fetch({ |
| | | ...this.queryParams, |
| | |
| | | }, |
| | | showXzyg(val) { |
| | | if (val === 0) { |
| | | // this.cleanEmpBase() |
| | | this.isAdd = true |
| | | } |
| | | if (!this.dialogShowXzyg) { |
| | |
| | | } else { |
| | | return null |
| | | } |
| | | }, |
| | | getDateString() { |
| | | return dateToString(new Date()) |
| | | }, |
| | | submitEmpInfo() { |
| | | if (this.isAdd) { |
| | | this.$post('hr/empBaseInfo/addInEmp', { ...this.empBaseInfoForm }).then((r) => { |
| | | if (r.data != null) { |
| | | if (r.data.data.empStatus === '0') { |
| | | this.$confirm('该员工已存在,是否修改?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.editEmpBase(r.data.data) |
| | | }) |
| | | } else { |
| | | this.$confirm('该员工已离职,是否重新打开档案?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.openArchivesForm = { |
| | | empId: r.data.data.empId, |
| | | empName: r.data.data.empName, |
| | | certificateNumb: r.data.data.certificateNumb, |
| | | openType: 2, |
| | | openDate: this.getDateString(), |
| | | remark: '' |
| | | } |
| | | this.$post('hr/empOpenArchives', { ...this.openArchivesForm }).then(() => { |
| | | this.$message({ |
| | | message: this.$t('员工档案打开成功'), |
| | | type: 'success' |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } else { |
| | | this.$put('hr/empBaseInfo', { ...this.empBaseInfoForm }).then(() => { |
| | | this.$message({ |
| | | message: this.$t('tips.updateSuccess'), |
| | | type: 'success' |
| | | }) |
| | | this.$emit('success') |
| | | this.cleanEmpBase() |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | } |