<template>
|
<div style="background-color: #fff;height: 100%;">
|
<el-container>
|
<el-header :height="headerHeight">
|
<el-row style="margin-bottom: 10px;">
|
<el-col :span="15">
|
<h3 class="bu-tian-jia-title">在职员工</h3>
|
</el-col>
|
<el-col :span="9" style="margin-top: 15px;">
|
<el-input v-model="queryParams.baseKey" placeholder="请输入内容" style="width:300px" />
|
<span class="search-btn" @click="vagueSearch">查询</span>
|
<span class="sup-search-btn" @click="advancedQueryShow = !advancedQueryShow">高级查询</span>
|
</el-col>
|
</el-row>
|
<advanced-query
|
v-show="advancedQueryShow"
|
:query-params.sync="queryParams"
|
@search="search"
|
@reset="resetSearch"
|
/>
|
</el-header>
|
<el-main style="height: 85%;">
|
<el-row style="margin: 10px 0 10px 0;">
|
<el-col :span="24">
|
<el-button type="danger" class="hr-but-all" @click="showXzyg(0)">新增员工</el-button>
|
<el-button type="primary" style="background-color: #409EFF" @click="delEmp">删除员工</el-button>
|
<el-button type="danger" class="hr-but-all" @click="showYgdg(0)">员工调岗</el-button>
|
<!-- <el-button type="danger" class="hr-but-all" @click="showDryg(0)">导入员工</el-button> -->
|
<el-button type="danger" class="hr-but-all" @click="dialogShowDcyg = true">导出EXCEL</el-button>
|
<el-button type="primary" style="background-color: #409EFF" @click="showGbda(0)">关闭档案</el-button>
|
</el-col>
|
</el-row>
|
<el-table
|
ref="multipleTable"
|
:data="tableData"
|
:cell-style="{padding:'7px 0','text-align':'center'}"
|
:header-cell-style="{'height':'5.3vh','background-color':'#e6e6e6','text-align':'center'}"
|
stripe
|
border
|
style="width: 100%;color: #000;"
|
@sort-change="changeSort"
|
>
|
<el-table-column type="selection" width="55" />
|
<el-table-column label="操作" width="130">
|
<template slot-scope="scope">
|
<span
|
style="color: #a00515;display: inline-block;width: 40%;cursor: pointer"
|
@click="editArchives(scope.row)"
|
>档案</span>
|
<span
|
style="color: #a00515;display: inline-block;width: 40%;cursor: pointer"
|
@click="editEmpBase(scope.row)"
|
>编辑</span>
|
</template>
|
</el-table-column>
|
<el-table-column
|
show-overflow-tooltip
|
prop="empNumb"
|
label="编号"
|
width="100"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
/>
|
<el-table-column
|
show-overflow-tooltip
|
prop="allDeptName"
|
label="部门(护卫点)"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
/>
|
<el-table-column show-overflow-tooltip prop="jobName" label="岗位" width="120" />
|
<el-table-column
|
show-overflow-tooltip
|
prop="empName"
|
label="姓名"
|
width="100"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
/>
|
<el-table-column show-overflow-tooltip prop="certificateNumb" label="身份证号码" width="160" />
|
<el-table-column show-overflow-tooltip prop="sex" label="性别" width="60" :formatter="sexFormat" />
|
<el-table-column
|
show-overflow-tooltip
|
prop="age"
|
label="年龄"
|
width="80"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
/>
|
<el-table-column
|
show-overflow-tooltip
|
prop="education"
|
label="学历"
|
width="80"
|
:formatter="educationFormat"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
/>
|
<el-table-column
|
show-overflow-tooltip
|
prop="nativePlace"
|
label="籍贯"
|
width="70"
|
:formatter="nativePlaceFormat"
|
/>
|
<el-table-column show-overflow-tooltip prop="telePhone" label="联系电话" width="110" />
|
<el-table-column show-overflow-tooltip prop="empTypeName" label="员工类型" width="80" />
|
<el-table-column
|
show-overflow-tooltip
|
prop="entryDate"
|
label="入职日期"
|
width="110"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
/>
|
<el-table-column show-overflow-tooltip prop="empStatus" label="员工状态" width="80">
|
<template slot-scope="{row}">
|
{{ transEmpStatus(row.empStatus) }}
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="entryType"
|
label="入职类型"
|
width="120"
|
sortable="custom"
|
:sort-orders="['ascending', 'descending']"
|
>
|
<template slot-scope="{row}">
|
{{ transEntryType(row.entryType) }}
|
</template>
|
</el-table-column>
|
<el-table-column show-overflow-tooltip prop="annualLeave" label="年假天数" width="110" />
|
</el-table>
|
<pagination
|
v-show="total>0"
|
style="text-align: right;width: 98%;"
|
:total="total"
|
:page.sync="pagination.num"
|
:limit.sync="pagination.size"
|
@pagination="search"
|
/>
|
</el-main>
|
</el-container>
|
<emp-base-edit
|
ref="empBaseEdit"
|
:dialog-visible="dialogShowXzyg"
|
:is-add="isAdd"
|
:employee-data="currentEmployeeData"
|
:depts="depts"
|
@success="handleEmpSaveSuccess"
|
@close="dialogShowXzyg = false"
|
@employee-exists="handleEmployeeExists"
|
@need-open-archives="handleNeedOpenArchives"
|
/>
|
<job-change-dialog
|
:visible.sync="dialogShowYgdg"
|
:employees="selectedEmployees"
|
:depts="depts"
|
:change-type-options="changeTypeOptions"
|
@success="handleJobChangeSuccess"
|
@close="handleJobChangeClose"
|
/>
|
<el-dialog title="导入员工信息" :visible.sync="dialogShowDryg" width="50%">
|
<el-form :model="baseicInformationForm" label-position="right" label-width="120px">
|
<el-row>
|
<el-col span="24">
|
<el-form-item label="员工模板下载" prop="region">
|
<a href="/员工信息.xls" target="_blank" style="color: #3A8EE6;">员工信息.xlxs</a>
|
<span style="margin-left: 100px;">点击下载</span>
|
</el-form-item>
|
<el-form-item label="导入员工">
|
<el-upload
|
ref="upload"
|
class="upload-demo"
|
action="http://127.0.0.1:8301/hr/empBaseInfo/importEmp"
|
accept=".xls, .xlsx, .excel"
|
:headers="headers()"
|
:file-list="fileList"
|
:auto-upload="false"
|
>
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
</el-upload>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="showDryg(1)">取 消</el-button>
|
<el-button type="primary" @click="showDryg(2)">确 定</el-button>
|
</div>
|
</el-dialog>
|
<close-archives-dialog
|
:visible.sync="dialogShowGbda"
|
:employees="selectedCloseEmployees"
|
:dimission-type-options="dimissionTypeOptions"
|
@success="handleCloseArchivesSuccess"
|
@close="handleCloseArchivesClose"
|
/>
|
<export-dialog
|
:visible.sync="dialogShowDcyg"
|
@confirm="handleExportConfirm"
|
/>
|
<archives-edit
|
ref="article"
|
:dialog-visible="dialog.isVisible"
|
:title="dialog.title"
|
:type="dialog.type"
|
@success="editSuccess"
|
@close="editClose"
|
/>
|
<el-dialog title="打开档案" :visible.sync="dialogShowDkda" width="50%">
|
<el-form
|
ref="openArchivesForm"
|
:model="openArchivesForm"
|
rules="openArchivesRules"
|
label-position="right"
|
label-width="120px"
|
>
|
<el-row>
|
<el-col span="24">
|
<el-form-item label="打开类型" prop="region">
|
<el-radio-group v-model="openArchivesForm.openType">
|
<el-radio :label="21">重新入职</el-radio>
|
<el-radio :label="22">返聘</el-radio>
|
</el-radio-group>
|
(主要对已退休员工返聘)
|
</el-form-item>
|
<el-form-item label="打开日期">
|
<el-date-picker
|
v-model="openArchivesForm.openDate"
|
value-format="yyyy-MM-dd"
|
type="date"
|
placeholder="选择打开日期"
|
/>
|
</el-form-item>
|
<el-form-item label="备注说明">
|
<el-input v-model="openArchivesForm.remark" type="textarea" :rows="4" />
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="showDkda(1, '')">取 消</el-button>
|
<el-button type="primary" @click="showDkda(2, 'openArchivesForm')">确 定</el-button>
|
</div>
|
</el-dialog>
|
|
<!-- 上传方式选择弹窗 -->
|
<el-dialog
|
title="选择上传方式"
|
:visible.sync="uploadChoiceDialogVisible"
|
width="400px"
|
:close-on-click-modal="false"
|
>
|
<div class="upload-choice-container">
|
<div class="upload-choice-item" @click="choiceCamera">
|
<i class="el-icon-camera" />
|
<span>拍照上传</span>
|
</div>
|
<div class="upload-choice-item" @click="choiceFile">
|
<i class="el-icon-folder-opened" />
|
<span>文件上传</span>
|
</div>
|
</div>
|
</el-dialog>
|
|
<!-- 摄像头拍照弹窗 -->
|
<el-dialog
|
title="拍照上传"
|
:visible.sync="cameraDialogVisible"
|
width="640px"
|
:close-on-click-modal="false"
|
@close="closeCamera"
|
>
|
<div class="camera-container">
|
<!-- 视频预览 -->
|
<video
|
v-show="!capturedImage"
|
ref="video"
|
class="camera-video"
|
autoplay
|
playsinline
|
/>
|
<!-- 画布(用于拍照) -->
|
<canvas ref="canvas" style="display: none;" />
|
|
<!-- 拍照结果预览 -->
|
<img
|
v-if="capturedImage"
|
:src="capturedImage"
|
class="captured-image"
|
>
|
</div>
|
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="closeCamera">取消</el-button>
|
<el-button
|
v-if="!capturedImage"
|
type="primary"
|
@click="takePhoto"
|
>
|
拍照
|
</el-button>
|
<el-button
|
v-if="capturedImage"
|
@click="retakePhoto"
|
>
|
重拍
|
</el-button>
|
<el-button
|
v-if="capturedImage"
|
type="primary"
|
@click="confirmPhoto"
|
>
|
确认使用
|
</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
|
import { getToken } from '@/utils/auth'
|
import Pagination from '@/components/Pagination'
|
import Treeselect from '@riophae/vue-treeselect'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import { dateToString } from '@/utils/myUtil'
|
import ArchivesEdit from './archivesEdit'
|
import EmpBaseEdit from './components/EmpBaseEdit'
|
import JobChangeDialog from './components/JobChangeDialog.vue'
|
import CloseArchivesDialog from './components/CloseArchivesDialog.vue'
|
import AdvancedQuery from './components/AdvancedQuery.vue'
|
import ExportDialog from '@/components/ExportEmpBase.vue'
|
import dictMixin from '../../utils/dictMixin'
|
|
export default {
|
components: {
|
EmpBaseEdit,
|
ArchivesEdit,
|
Pagination,
|
Treeselect,
|
JobChangeDialog,
|
CloseArchivesDialog,
|
AdvancedQuery,
|
ExportDialog
|
},
|
mixins: [dictMixin],
|
data() {
|
return {
|
dialog: {
|
isVisible: false,
|
title: '',
|
type: ''
|
},
|
total: 0, // 总数量
|
queryParams: {
|
baseKey: '',
|
empNumb: '',
|
vague: '',
|
sex: [],
|
education: [],
|
politics: [],
|
ageStr: [],
|
archivesStatus: [],
|
insuranceType: [],
|
empStatus: [],
|
empCardStatus: [],
|
handbookStatus: [],
|
entryType: [],
|
empType: [],
|
certificateList: []
|
}, // 查询参数
|
sort: {}, // 排序
|
pagination: { // 分页参数
|
size: 15,
|
num: 1
|
},
|
baseicInformationForm: {},
|
isAdd: false,
|
currentEmployeeData: {},
|
selectedEmployees: [],
|
selectedCloseEmployees: [],
|
depts: [],
|
fileList: [],
|
restaurJob: [],
|
headerHeight: '30px',
|
advancedQueryShow: false,
|
dialogTableVisible: false,
|
dialogShowDcyg: false,
|
dialogShowXzyg: false,
|
dialogShowYgdg: false,
|
dialogShowDryg: false,
|
dialogShowGbda: false,
|
dialogShowDkda: false,
|
tableData: [],
|
inTypeOptions: [],
|
openArchivesForm: {}
|
}
|
},
|
computed: {
|
// 字典选项计算属性
|
statusOptions() {
|
return this.getDictOptions('PLITICAL')
|
},
|
|
nationOptions() {
|
return this.getDictOptions('NATION')
|
},
|
marriageOptions() {
|
return this.getDictOptions('MARRIAGE')
|
},
|
educationOptions() {
|
return this.getDictOptions('EDUCATION')
|
},
|
nativePlaceOptions() {
|
return this.getDictOptions('NATIVEPLACE')
|
},
|
|
insuranceTypeOptions() {
|
return this.getDictOptions('INSURANCETYPE')
|
},
|
|
physicalExamTypeOptions() {
|
return this.getDictOptions('PHYSICALEXAMTYPE')
|
},
|
ecgOptions() {
|
return this.getDictOptions('ECG')
|
},
|
contractStatusOptions() {
|
return this.getDictOptions('CONTRACTSTATUS')
|
},
|
leaveTypeOptions() {
|
return this.getDictOptions('LEAVETYPE')
|
},
|
insuranceGaersOptions() {
|
return this.getDictOptions('INSURANCETYPE')
|
},
|
applayStatusOptions() {
|
return this.getDictOptions('applayStatus')
|
},
|
reportStatusOptions() {
|
return this.getDictOptions('reportStatus')
|
},
|
hospitalizatioFlagOptions() {
|
return this.getDictOptions('hospitalizatioFlag')
|
},
|
settleStatusOptions() {
|
return this.getDictOptions('settleStatus')
|
},
|
arbitrationTypeOptions() {
|
return this.getDictOptions('ZCTYPE')
|
},
|
changeTypeOptions() {
|
return this.getDictOptions('changeType')
|
},
|
dimissionTypeOptions() {
|
return this.getDictOptions('LZTYPE')
|
},
|
sexOptions() {
|
return this.getDictOptions('sex')
|
}
|
},
|
watch: {
|
advancedQueryShow(val) {
|
this.headerHeight = val ? 'auto' : '30px'
|
}
|
},
|
mounted() {
|
this.fetch()
|
this.initDept()
|
// 字典数据已在登录时预加载,直接从 Vuex 获取
|
this.initDictTypes(['PLITICAL', 'sex', 'NATION', 'MARRIAGE', 'EDUCATION', 'NATIVEPLACE', 'INSURANCETYPE', 'PHYSICALEXAMTYPE', 'ECG', 'CONTRACTSTATUS', 'LEAVETYPE', 'applayStatus', 'reportStatus', 'hospitalizatioFlag', 'settleStatus', 'ZCTYPE', 'changeType', 'LZTYPE'])
|
this.initJob()
|
},
|
methods: {
|
exportExcel() {
|
this.queryParams.baseKey = this.queryParams.vague
|
this.queryParams.delFlag = 0
|
this.queryParams.empStatus = 0
|
var params = this.queryParams
|
this.$download('hr/empBaseInfo/exportEmpAll', { ...params }, `基本信息_${new Date().getTime()}.xls`).then(() => {
|
this.$message({
|
message: '下载成功!',
|
type: 'success'
|
})
|
})
|
},
|
editArchives(row) {
|
this.$refs.article.setArchives(row)
|
this.dialog.title = row.empName + '员工档案'
|
this.dialog.isVisible = true
|
},
|
editClose() {
|
this.dialog.isVisible = false
|
},
|
resetSearch() {
|
this.queryParams = {
|
empNumb: '',
|
vague: '',
|
sex: [],
|
education: [],
|
politics: [],
|
ageStr: [],
|
archivesStatus: [],
|
insuranceType: [],
|
empStatus: [],
|
empCardStatus: [],
|
handbookStatus: [],
|
baseKey: '',
|
empType: [],
|
entryType: [],
|
certificateList: []
|
}
|
this.search()
|
},
|
initJob() {
|
this.$get('system/position/dicJob').then((r) => {
|
this.restaurJob = r.data.data
|
})
|
},
|
// 翻页方法
|
search() {
|
this.queryParams.baseKey = ''
|
this.fetch({
|
...this.queryParams,
|
...this.sort
|
})
|
},
|
fetch(params = {}) {
|
var that = this
|
params.pageSize = this.pagination.size
|
params.pageNum = this.pagination.num
|
params.delFlag = 0
|
params.empStatus = 0
|
this.$get('hr/empBaseInfo/zslist', {
|
...params
|
}).then((r) => {
|
const data = r.data.data
|
that.total = data.total
|
that.tableData = data.rows
|
})
|
},
|
vagueSearch() {
|
this.fetch({
|
baseKey: this.queryParams.baseKey
|
})
|
},
|
transEmpStatus(empStatus) {
|
switch (empStatus) {
|
case '0':
|
return '在职'
|
case '1':
|
return '离职'
|
case '2':
|
return '退休'
|
}
|
},
|
transEntryType(entryType) {
|
switch (entryType) {
|
case '20':
|
return '新入职'
|
case '21':
|
return '重新入职'
|
case '22':
|
return '返聘入职'
|
}
|
},
|
typeFormat(row, column) {
|
return this.selectDictLabel(this.physicalExamTypeOptions, row.physicalExamType)
|
},
|
empTypeFormat(row, column) {
|
return this.selectDictLabel(this.empTypeOptions, row.empType)
|
},
|
sexFormat(row, column) {
|
return this.selectDictLabel(this.sexOptions, row.sex)
|
},
|
nationFormat(row, column) {
|
return this.selectDictLabel(this.nationOptions, row.nation)
|
},
|
marriageFormat(row, column) {
|
return this.selectDictLabel(this.marriageOptions, row.marriage)
|
},
|
politicsFormat(row, column) {
|
return this.selectDictLabel(this.statusOptions, row.politics)
|
},
|
educationFormat(row, column) {
|
return this.selectDictLabel(this.educationOptions, row.education)
|
},
|
nativePlaceFormat(row, column) {
|
return this.selectDictLabel(this.nativePlaceOptions, row.nativePlace)
|
},
|
insuranceTypeFormat(row, column) {
|
return this.selectDictLabel(this.insuranceTypeOptions, row.insuranceType)
|
},
|
ecgNameFormat(row, column) {
|
return this.selectDictLabel(this.ecgOptions, row.ecg)
|
},
|
contractStatusFormat(row, column) {
|
return this.selectDictLabel(this.contractStatusOptions, row.contractStatus)
|
},
|
changeTypeFormat(row, column) {
|
return this.selectDictLabel(this.changeTypeOptions, row.changeType)
|
},
|
leaveTypeFormat(row, column) {
|
return this.selectDictLabel(this.leaveTypeOptions, row.leaveType)
|
},
|
dimissionTypeFormat(row, column) {
|
return this.selectDictLabel(this.dimissionTypeOptions, row.dimissionType)
|
},
|
insuranceGaersFormat(row, column) {
|
return this.selectDictLabel(this.insuranceGaersOptions, row.insuranceGaers)
|
},
|
reportStatusFormat(row, column) {
|
return this.selectDictLabel(this.reportStatusOptions, row.reportStatus)
|
},
|
applayStatusFormat(row, column) {
|
return this.selectDictLabel(this.applayStatusOptions, row.applayStatus)
|
},
|
hospitalizatioFlagFormat(row, column) {
|
return this.selectDictLabel(this.hospitalizatioFlagOptions, row.hospitalizatioFlag)
|
},
|
arbitrationTypeFormat(row, column) {
|
return this.selectDictLabel(this.arbitrationTypeOptions, row.arbitrationType)
|
},
|
arbitrationStatusFormat(row, column) {
|
return this.selectDictLabel(this.settleStatusOptions, row.arbitrationStatus)
|
},
|
initDept() {
|
this.$get('system/dept').then((r) => {
|
this.depts = r.data.data.rows
|
this.deptTree = this.depts
|
}).catch((error) => {
|
console.error(error)
|
this.$message({
|
message: this.$t('tips.getDataFail'),
|
type: 'error'
|
})
|
})
|
},
|
|
editEmpBase(row) {
|
console.log(row)
|
this.isAdd = false
|
this.currentEmployeeData = { ...row }
|
this.dialogShowXzyg = true
|
},
|
delEmp() {
|
var selection = this.$refs.multipleTable.store.states.selection
|
if (selection.length === 0) {
|
this.$message({
|
message: '请先选中需要删除的数据',
|
type: 'error'
|
})
|
} else {
|
this.$confirm('您确认删除该员工么?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
var empIds = []
|
for (var i = 0; i < selection.length; i++) {
|
var data = selection[i]
|
empIds.push(data.empId)
|
}
|
this.$delete(`hr/empBaseInfo/` + empIds.join(',')).then(() => {
|
this.$message({
|
message: this.$t('tips.deleteSuccess'),
|
type: 'success'
|
})
|
this.search()
|
})
|
})
|
}
|
},
|
showEmpInfo() {
|
this.dialogTableVisible = true
|
},
|
showXzyg(val) {
|
if (val === 0) {
|
this.isAdd = true
|
this.currentEmployeeData = {}
|
}
|
if (!this.dialogShowXzyg) {
|
this.dialogShowXzyg = true
|
} else {
|
this.dialogShowXzyg = false
|
}
|
this.fetch({
|
...this.queryParams,
|
...this.sort
|
})
|
},
|
handleEmpSaveSuccess() {
|
this.search()
|
},
|
handleEmployeeExists(data) {
|
this.$confirm('该员工已存在,是否修改?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.editEmpBase(data)
|
})
|
},
|
handleNeedOpenArchives(data) {
|
const tempName = this.selectDictLabel(this.dimissionTypeOptions, data.dimissionType)
|
var msg = '该员工已存在,' + tempName + '状态!\n\r'
|
msg += data.remark + '\n\r'
|
msg += '由于' + data.empName + '已离职,是否重新打开档案?'
|
this.$confirm(msg, '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
this.openArchivesForm = {
|
empId: data.empId,
|
empName: data.empName,
|
certificateNumb: data.certificateNumb,
|
openType: 21,
|
openDate: this.getDateString(),
|
remark: ''
|
}
|
this.dialogShowDkda = true
|
})
|
},
|
handleExportConfirm(selectedFields) {
|
var params = { ...this.queryParams }
|
params.empStatus = '0'
|
params.exportField = selectedFields.join(',')
|
this.$download('hr/empBaseInfo/exportWithField', { ...params }, '在职员工列表.xls').then(() => {
|
this.$message({
|
message: '下载成功!',
|
type: 'success'
|
})
|
})
|
},
|
editSuccess() {
|
this.search()
|
},
|
showYgdg(operate) {
|
if (operate === 0) {
|
const selection = this.$refs.multipleTable.store.states.selection
|
if (selection.length === 0) {
|
this.$message({
|
message: '请先选中需要调岗的人员',
|
type: 'error'
|
})
|
} else {
|
this.selectedEmployees = selection
|
this.dialogShowYgdg = true
|
}
|
}
|
},
|
handleJobChangeSuccess() {
|
this.search()
|
},
|
handleJobChangeClose() {
|
this.selectedEmployees = []
|
},
|
showDryg(operate) {
|
switch (operate) {
|
case 0:
|
this.dialogShowDryg = true
|
break
|
case 1:
|
this.dialogShowDryg = false
|
break
|
case 2:
|
this.$refs.upload.submit()
|
break
|
}
|
},
|
showGbda(operate) {
|
if (operate === 0) {
|
const selection = this.$refs.multipleTable.store.states.selection
|
if (selection.length === 0) {
|
this.$message({
|
message: '请先选中需要关闭档案的人员',
|
type: 'error'
|
})
|
} else {
|
this.selectedCloseEmployees = selection
|
this.dialogShowGbda = true
|
}
|
}
|
},
|
handleCloseArchivesSuccess() {
|
this.search()
|
},
|
handleCloseArchivesClose() {
|
this.selectedCloseEmployees = []
|
},
|
doDcda() {
|
this.$confirm('是否确定要导出档案,请耐心等待?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(() => {
|
var params = this.queryParams
|
this.$post('hr/pdf/exportWithField', {
|
...params
|
}).then((r) => {
|
const data = r.data.data
|
for (let i = 0; i < data.length; i++) {
|
this.$download('hr/pdf/contract', {
|
empNumb: data[i].empNumb
|
}, `${data[i].empName}.pdf`)
|
}
|
})
|
}).catch(() => {
|
this.$message({
|
type: 'info',
|
message: '已取消'
|
})
|
})
|
},
|
|
headers() {
|
const token = getToken()
|
if (token) {
|
return {
|
Authorization: 'bearer ' + token
|
}
|
} else {
|
return null
|
}
|
},
|
getDateString() {
|
return dateToString(new Date())
|
},
|
changeSort(val) {
|
this.sort.field = val.prop
|
this.sort.order = val.order
|
this.search()
|
},
|
showDkda(operate, formName) {
|
switch (operate) {
|
// case 0:
|
// var selection = this.$refs.multipleTable.store.states.selection
|
// if (selection.length === 1) {
|
// var id = selection[0].empId
|
// var name = selection[0].empName
|
// var number = selection[0].certificateNumb
|
// const nowDate = new Date()
|
// const year = nowDate.getFullYear()
|
// const month = nowDate.getMonth() + 1
|
// const day = nowDate.getDate()
|
// this.baseicInformationForm = {
|
// empId: id,
|
// empName: name,
|
// certificateNumb: number,
|
// openType: 2,
|
// openDate: year + '-' + month + '-' + day,
|
// remark: ''
|
// }
|
// this.dialogShowDkda = true
|
// } else {
|
// this.$message({
|
// message: '请选中一个要打开档案的人员',
|
// type: 'error'
|
// })
|
// }
|
// break
|
case 1:
|
this.dialogShowDkda = false
|
break
|
case 2:
|
this.$refs[formName].validate((valid) => {
|
if (valid) {
|
this.$post('hr/empOpenArchives', { ...this.openArchivesForm }).then(() => {
|
this.dialogShowDkda = false
|
this.$message({
|
message: this.$t('员工档案打开成功'),
|
type: 'success'
|
})
|
this.fetch({
|
...this.queryParams,
|
...this.sort
|
})
|
})
|
}
|
})
|
break
|
}
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
@import '@/styles/inemployees-global.scss';
|
</style>
|
<style lang="scss" scoped>
|
@import '@/styles/inemployees-scoped.scss';
|
</style>
|