feat(员工信息): 添加转正和在情况筛选功能并增强员工信息管理
refactor(员工信息): 重构员工转正页面,增加更多查询条件和信息展示 feat(报表): 为合并报表添加规格计算功能
This commit is contained in:
@@ -1,22 +1,44 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="转正时间" prop="changeTime">
|
||||
<el-date-picker clearable v-model="queryParams.changeTime" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择转正时间">
|
||||
</el-date-picker>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<el-select v-model="queryParams.dept" placeholder="请选择部门" clearable @keyup.enter.native="handleQuery">
|
||||
<el-option v-for="item in deptList" :value="item.deptName" :label="item.deptName" :key="item.deptId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="异动原因" prop="changeReason">
|
||||
<el-input
|
||||
v-model="queryParams.changeReason"
|
||||
placeholder="请输入异动原因"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="负责人" prop="changeHandler">
|
||||
<el-input v-model="queryParams.changeHandler" placeholder="请输入负责人" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="queryParams.age" placeholder="请输入年龄" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="queryParams.gender" placeholder="请选择性别" clearable @change="handleQuery">
|
||||
<el-option label="男" value="男" />
|
||||
<el-option label="女" value="女" />
|
||||
</el-select>
|
||||
<!-- <el-input v-model="queryParams.gender" placeholder="请输入性别" clearable @keyup.enter.native="handleQuery" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="学历" prop="education">
|
||||
<el-select v-model="queryParams.education" placeholder="请选择学历" clearable @change="handleQuery">
|
||||
<el-option v-for="item in dict.type.hrm_employee_education" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="转正情况" prop="isRegular">
|
||||
<el-select v-model="queryParams.isRegular" placeholder="请选择转正情况" clearable @change="handleQuery">
|
||||
<el-option label="已转正" value="1" />
|
||||
<el-option label="未转正" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在职情况" prop="isLeave">
|
||||
<el-select v-model="queryParams.isLeave" placeholder="请选择在职情况" clearable @change="handleQuery">
|
||||
<el-option label="已离职" value="1" />
|
||||
<el-option label="在职" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@@ -25,9 +47,9 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-edit" size="mini" @click="handleSupplement">转正</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">入职</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
@@ -42,24 +64,47 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="employeeEntryList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="employeeInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="异动记录主键ID" align="center" prop="changeId" v-if="true"/> -->
|
||||
<el-table-column label="员工姓名" align="center" prop="wmsEmployeeInfo.name" />
|
||||
<el-table-column label="岗位工种" align="center" prop="wmsEmployeeInfo.jobType" />
|
||||
<el-table-column label="转正时间" align="center" prop="changeTime" width="180">
|
||||
<el-table-column label="主键ID" align="center" prop="infoId" v-if="false" />
|
||||
<el-table-column label="部门" align="center" prop="dept" />
|
||||
<el-table-column label="岗位工种" align="center" prop="jobType" />
|
||||
<el-table-column label="姓名" align="center" prop="name" />
|
||||
<el-table-column label="身份证号" align="center" prop="idCard" />
|
||||
<el-table-column label="年龄" align="center" prop="age" />
|
||||
<el-table-column label="性别" align="center" prop="gender" />
|
||||
<el-table-column label="学历" align="center" prop="education" />
|
||||
<el-table-column label="家庭住址" align="center" prop="homeAddress" />
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="入职时间" align="center" prop="entryTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.changeTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.entryTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="转正原因" align="center" prop="changeReason" />
|
||||
<el-table-column label="负责人" align="center" prop="changeHandler" />
|
||||
<!-- <el-table-column label="附件" align="center" prop="attachment" /> -->
|
||||
<el-table-column label="在职天数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getRegularStatus(scope.row.entryTime, scope.row.isRegular).type">
|
||||
{{ getRegularStatus(scope.row.entryTime, scope.row.isRegular).days }}天
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
|
||||
<el-table-column label="关系" align="center" prop="relationship" />
|
||||
<el-table-column label="紧急联系电话" align="center" prop="emergencyContactPhone" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="在职状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.isLeave === 0 ? 'success' : 'danger'">
|
||||
{{ scope.row.isLeave === 0 ? '在职' : '已离职' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button v-if="scope.row.isLeave === 0 && scope.row.isRegular === 0" size="mini" type="text" icon="el-icon-check"
|
||||
@click="handleResignation(scope.row)">转正</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -67,48 +112,189 @@
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 员工转正记录对话框 -->
|
||||
<el-dialog :title="supplementTitle" :visible.sync="supplementOpen" width="500px" append-to-body>
|
||||
<el-form ref="supplementForm" :model="supplementForm" :rules="supplementRules" label-width="80px">
|
||||
<el-form-item label="转正员工" prop="infoId">
|
||||
<EmployeeSelector v-model="supplementForm.infoId" keyField="infoId" placeholder="请选择转正员工" />
|
||||
<!-- 添加或修改员工信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<!-- 公司内信息 -->
|
||||
<el-card class="mb-4" shadow="never">
|
||||
<template slot="header">
|
||||
<div class="card-header">
|
||||
<span>在职信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门" prop="dept">
|
||||
<!-- <el-input v-model="form.dept" placeholder="请输入部门" /> -->
|
||||
<el-select v-model="form.dept" placeholder="请选择部门">
|
||||
<el-option v-for="item in deptList" :value="item.deptName" :label="item.deptName"
|
||||
:key="item.deptId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位工种" prop="jobType">
|
||||
<el-input v-model="form.jobType" placeholder="请输入岗位工种" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职时间" prop="entryTime">
|
||||
<el-date-picker clearable v-model="form.entryTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择入职时间" style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.infoRemark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 员工个人信息 -->
|
||||
<el-card class="mb-4" shadow="never">
|
||||
<template slot="header">
|
||||
<div class="card-header">
|
||||
<span>员工信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="form.age" placeholder="请输入年龄" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<!-- <el-input v-model="form.gender" placeholder="请输入性别" /> -->
|
||||
<el-radio-group v-model="form.gender" size="small" mode="button">
|
||||
<el-radio label="男">男</el-radio>
|
||||
<el-radio label="女">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="education">
|
||||
<!-- <el-input v-model="form.education" placeholder="请输入学历" /> -->
|
||||
<el-select v-model="form.education" placeholder="请选择学历">
|
||||
<el-option v-for="item in dict.type.hrm_employee_education" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="家庭住址" prop="homeAddress">
|
||||
<el-input v-model="form.homeAddress" placeholder="请输入家庭住址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 紧急联系信息 -->
|
||||
<el-card class="mb-4" shadow="never">
|
||||
<template slot="header">
|
||||
<div class="card-header">
|
||||
<span>紧急联系信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="紧急联系人" prop="emergencyContact">
|
||||
<el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="关系" prop="relationship">
|
||||
<el-input v-model="form.relationship" placeholder="请输入关系" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="紧急联系电话" prop="emergencyContactPhone">
|
||||
<el-input v-model="form.emergencyContactPhone" placeholder="请输入紧急联系人电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注和附件 -->
|
||||
<el-card class="mb-4" shadow="hover">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="!form.infoId">
|
||||
<el-form-item label="附件" prop="attachment">
|
||||
<file-upload v-model="attachment"></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 员工转正对话框 -->
|
||||
<el-dialog :title="resignationTitle" :visible.sync="resignationOpen" width="500px" append-to-body>
|
||||
<el-form ref="resignationForm" :model="resignationForm" :rules="resignationRules" label-width="80px">
|
||||
<el-form-item label="员工姓名" prop="name">
|
||||
<el-input v-model="resignationForm.name" disabled />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="异动类型" prop="changeType">
|
||||
<el-input v-model="resignationForm.changeType" disabled />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="转正时间" prop="changeTime">
|
||||
<el-date-picker clearable v-model="supplementForm.changeTime" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择转正时间">
|
||||
</el-date-picker>
|
||||
<el-date-picker clearable v-model="resignationForm.changeTime" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择转正时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="转正原因" prop="changeReason">
|
||||
<el-input v-model="supplementForm.changeReason" placeholder="请输入转正原因" />
|
||||
<el-form-item label="转正原因" prop="changeReason" required>
|
||||
<el-input v-model="resignationForm.changeReason" type="textarea" placeholder="请输入转正原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="changeHandler">
|
||||
<el-input v-model="supplementForm.changeHandler" placeholder="请输入负责人" disabled />
|
||||
<el-input v-model="resignationForm.changeHandler" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="attachment">
|
||||
<file-upload v-model="supplementAttachment" />
|
||||
<file-upload v-model="resignationAttachment"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="supplementForm.remark" placeholder="请输入备注" />
|
||||
<el-input v-model="resignationForm.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitSupplementForm">确 定</el-button>
|
||||
<el-button @click="cancelSupplement">取 消</el-button>
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitResignation">确 定</el-button>
|
||||
<el-button @click="cancelResignation">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listEmployeeChange, getEmployeeChange, delEmployeeChange, updateEmployeeChange, employeeRegular } from "@/api/wms/employeeChange";
|
||||
import { listEmployeeInfo, getEmployeeInfo, delEmployeeInfo, updateEmployeeInfo } from "@/api/wms/employeeInfo";
|
||||
import { listDept } from "@/api/wms/dept";
|
||||
import EmployeeSelector from "@/components/EmployeeSelector";
|
||||
import { employeeEntry, employeeLeave, employeeRegular } from '@/api/wms/employeeChange'
|
||||
|
||||
export default {
|
||||
name: "employeeRegular",
|
||||
components: {
|
||||
EmployeeSelector
|
||||
},
|
||||
name: "EmployeeInfo",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
@@ -125,8 +311,8 @@ export default {
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 员工转正表格数据
|
||||
employeeEntryList: [],
|
||||
// 员工信息表格数据
|
||||
employeeInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -135,12 +321,13 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
infoId: undefined,
|
||||
changeType: 2,
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
dept: undefined,
|
||||
jobType: undefined,
|
||||
name: undefined,
|
||||
idCard: undefined,
|
||||
age: undefined,
|
||||
gender: undefined,
|
||||
education: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -151,22 +338,28 @@ export default {
|
||||
attachment: undefined,
|
||||
// 部门列表
|
||||
deptList: [],
|
||||
// 补录对话框相关
|
||||
supplementTitle: "补录员工转正记录",
|
||||
supplementOpen: false,
|
||||
supplementForm: {
|
||||
changeId: undefined,
|
||||
// 转正对话框相关
|
||||
resignationTitle: "员工转正",
|
||||
resignationOpen: false,
|
||||
resignationForm: {
|
||||
infoId: undefined,
|
||||
changeType: 2,
|
||||
name: undefined,
|
||||
changeType: "2",
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
supplementRules: {
|
||||
resignationRules: {
|
||||
changeTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择转正时间",
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
},
|
||||
supplementAttachment: undefined
|
||||
resignationAttachment: undefined
|
||||
};
|
||||
},
|
||||
dicts: ['hrm_employee_education'],
|
||||
@@ -175,11 +368,11 @@ export default {
|
||||
this.getDeptList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询员工转正记录列表 */
|
||||
/** 查询员工信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listEmployeeChange(this.queryParams).then(response => {
|
||||
this.employeeEntryList = response.rows;
|
||||
listEmployeeInfo(this.queryParams).then(response => {
|
||||
this.employeeInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@@ -194,11 +387,6 @@ export default {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 取消补录按钮操作
|
||||
cancelSupplement() {
|
||||
this.supplementOpen = false;
|
||||
this.resetSupplementForm();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
@@ -222,26 +410,9 @@ export default {
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
infoRemark: undefined
|
||||
};
|
||||
this.attachment = undefined;
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 补录表单重置
|
||||
resetSupplementForm() {
|
||||
this.supplementForm = {
|
||||
changeId: undefined,
|
||||
infoId: undefined,
|
||||
changeType: 2,
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.supplementAttachment = undefined;
|
||||
this.resetForm("supplementForm");
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@@ -255,62 +426,51 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.changeId)
|
||||
this.ids = selection.map(item => item.infoId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.changeHandler = this.$store.getters.nickName;
|
||||
this.open = true;
|
||||
this.title = "员工转正";
|
||||
this.title = "员工入职";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.resetSupplementForm();
|
||||
const changeId = row.changeId || this.ids
|
||||
getEmployeeChange(changeId).then(response => {
|
||||
this.reset();
|
||||
const infoId = row.infoId || this.ids
|
||||
getEmployeeInfo(infoId).then(response => {
|
||||
this.loading = false;
|
||||
this.supplementForm = response.data;
|
||||
this.supplementAttachment = response.data.attachment;
|
||||
this.supplementOpen = true;
|
||||
this.supplementTitle = "修改员工转正记录";
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改员工信息";
|
||||
});
|
||||
},
|
||||
/** 补录按钮操作 */
|
||||
handleSupplement() {
|
||||
this.resetSupplementForm();
|
||||
this.supplementForm.changeHandler = this.$store.getters.nickName;
|
||||
this.supplementOpen = true;
|
||||
this.supplementTitle = "补录员工转正记录";
|
||||
},
|
||||
/** 提交补录表单 */
|
||||
submitSupplementForm() {
|
||||
this.$refs["supplementForm"].validate(valid => {
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.supplementForm.changeId != null) {
|
||||
updateEmployeeChange(this.supplementForm).then(response => {
|
||||
if (this.form.infoId != null) {
|
||||
updateEmployeeInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.supplementOpen = false;
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
employeeRegular({
|
||||
changeType: 2,
|
||||
infoId: this.supplementForm.infoId,
|
||||
changeTime: this.supplementForm.changeTime,
|
||||
changeHandler: this.supplementForm.changeHandler,
|
||||
changeReason: this.supplementForm.changeReason,
|
||||
attachment: this.supplementAttachment,
|
||||
remark: this.supplementForm.remark
|
||||
employeeEntry({
|
||||
changeType: 0,
|
||||
changeTime: this.form.entryTime,
|
||||
changeHandler: this.$store.getters.nickName,
|
||||
attachment: this.attachment,
|
||||
...this.form
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("员工转正记录补录成功");
|
||||
this.supplementOpen = false;
|
||||
this.$modal.msgSuccess("员工入职成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
@@ -321,10 +481,10 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const changeIds = row.changeId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工转正记录编号为"' + changeIds + '"的数据项?').then(() => {
|
||||
const infoIds = row.infoId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工信息编号为"' + infoIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delEmployeeChange(changeIds);
|
||||
return delEmployeeInfo(infoIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
@@ -336,9 +496,98 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/employeeChange/export', {
|
||||
this.download('wms/employeeInfo/export', {
|
||||
...this.queryParams
|
||||
}, `employeeChange_${new Date().getTime()}.xlsx`)
|
||||
}, `employeeInfo_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 转正按钮操作 */
|
||||
handleResignation(row) {
|
||||
// 获取北京时间(UTC+8)
|
||||
const now = new Date();
|
||||
const formattedDate = this.parseTime(now, '{y}-{m}-{d} {h}:{i}:{s}')
|
||||
|
||||
this.resignationForm = {
|
||||
infoId: row.infoId,
|
||||
name: row.name,
|
||||
changeType: "2",
|
||||
changeTime: formattedDate,
|
||||
changeReason: undefined,
|
||||
changeHandler: this.$store.getters.nickName,
|
||||
remark: undefined
|
||||
};
|
||||
this.resignationAttachment = undefined;
|
||||
this.resignationOpen = true;
|
||||
},
|
||||
/** 取消转正按钮操作 */
|
||||
cancelResignation() {
|
||||
this.resignationOpen = false;
|
||||
this.resignationForm = {
|
||||
infoId: undefined,
|
||||
name: undefined,
|
||||
changeType: "2",
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resignationAttachment = undefined;
|
||||
this.resetForm("resignationForm");
|
||||
},
|
||||
/** 提交转正表单 */
|
||||
submitResignation() {
|
||||
this.$refs["resignationForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.$modal.confirm('是否确认提交员工转正申请?').then(() => {
|
||||
this.buttonLoading = true;
|
||||
employeeRegular({
|
||||
changeType: 2,
|
||||
changeTime: this.resignationForm.changeTime,
|
||||
changeReason: this.resignationForm.changeReason,
|
||||
changeHandler: this.resignationForm.changeHandler,
|
||||
attachment: this.resignationAttachment,
|
||||
remark: this.resignationForm.remark,
|
||||
infoId: this.resignationForm.infoId
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("员工转正成功");
|
||||
this.resignationOpen = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 计算入职天数和转正状态 */
|
||||
getRegularStatus(entryTime, isRegular) {
|
||||
if (!entryTime) return { days: 0, type: '', status: 0 };
|
||||
|
||||
const entryDate = new Date(entryTime);
|
||||
const now = new Date();
|
||||
const diffTime = now - entryDate;
|
||||
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
let type = '';
|
||||
let status = isRegular || 0;
|
||||
|
||||
if (status === 0) {
|
||||
// 未转正
|
||||
if (diffDays < 60) {
|
||||
// 2个月内未转正
|
||||
type = 'warning';
|
||||
} else if (diffDays < 90) {
|
||||
// 3个月内未转正
|
||||
type = 'info';
|
||||
} else if (diffDays >= 90) {
|
||||
// 3个月以上未转正
|
||||
type = 'warning';
|
||||
}
|
||||
} else {
|
||||
// 已转正
|
||||
type = 'success';
|
||||
}
|
||||
|
||||
return { days: diffDays, type, status };
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,6 +28,18 @@
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="转正情况" prop="isRegular">
|
||||
<el-select v-model="queryParams.isRegular" placeholder="请选择转正情况" clearable @change="handleQuery">
|
||||
<el-option label="已转正" value="1" />
|
||||
<el-option label="未转正" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在职情况" prop="isLeave">
|
||||
<el-select v-model="queryParams.isLeave" placeholder="请选择在职情况" clearable @change="handleQuery">
|
||||
<el-option label="已离职" value="1" />
|
||||
<el-option label="在职" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
||||
@@ -271,8 +271,24 @@ export default {
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '' }),
|
||||
]);
|
||||
this.lossList = lossRes.rows;
|
||||
this.outList = outRes.rows;
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
});
|
||||
this.outList = outRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
// 导出
|
||||
|
||||
Reference in New Issue
Block a user