Commit 3f637962 authored by 姬鋆屾's avatar 姬鋆屾

feat:黑名单,员工关怀及离职信息

parent 245fc21b
<template>
<!-- 弹出框表单 -->
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="员工姓名" prop="staffName" v-model="form.staffName" placeholder="请输入员工姓名"/>
<Field label="出生日期" prop="birthday" v-model="form.birthday" type="date" />
<Field label="所属部门" prop="deptId" v-model="form.deptId" placeholder="请输入所属部门"/>
<Field label="所属部门名称" prop="deptName" v-model="form.deptName" placeholder="请输入所属部门名称"/>
<Field label="职位ID" prop="jobId" v-model="form.jobId" placeholder="请输入职位ID"/>
<Field label="职位名称" prop="jobName" v-model="form.jobName" placeholder="请输入职位名称"/>
<Field label="入职时间" prop="entryDate" v-model="form.entryDate" type="date" />
<Field label="关怀类型" prop="careType" v-model="form.careType" type="select" :enumData="dict.careType" placeholder="请选择关怀类型"/>
<Field label="发送状态" prop="sendStatus" v-model="form.sendStatus" type="select" :enumData="dict.sendStatus" placeholder="请选择发送状态"/>
<Field label="关怀内容"><editor v-model="form.content" :min-height="256"/></Field>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import dialogShow from "./dialogshow";
import Editor from '@/components/Editor';
export default {
mixins: [form],
components: {
dialogShow ,
Editor,
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "员工关怀信息",
// 是否显示弹出层
open: false,
toString:[
"careType",
"sendStatus",
],
// 表单校验
rules: {
staffName: [
{required: true,message: "请输入员工姓名", trigger: "blur" },
{max: 64,message: "最多只能录入64个字符",trigger: "blur",},
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="staff/care/edit";
this.getData();
this.pageInfo.type="edit"
this.title = "修改员工关怀信息";
},
/** 新增 */
add(row) {
this.reset()
this.urls.currUrl = "staff/care/add";
this.getData();
this.pageInfo.type="add"
this.title = "新增员工关怀信息";
},
/** 查看*/
view(row) {
this.reset()
this.query = { id: row.id };
this.urls.currUrl ="staff/care/view";
this.getData();
this.pageInfo.type="view"
this.title = "员工关怀信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
staffId : null,
staffName : "",
birthday : null,
deptId : null,
deptName : "",
jobId : null,
jobName : "",
entryDate : null,
careType : 1,
sendStatus : 0,
content : "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field
label="员工姓名"
prop="staffId"
v-model="form.staffId"
type="select"
:enumData="dict.staffId"
placeholder="请输入员工姓名"
/>
<Field
label="出生日期"
prop="birthday"
v-model="form.birthday"
type="date"
/>
<Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
type="select"
:enumData="dict.deptId"
placeholder="请输入所属部门"
/>
<!-- <Field
label="职位ID"
prop="jobId"
v-model="form.jobId"
type="select"
:enumData="dict.jobId"
placeholder="请输入职位ID"
/> -->
<Field
label="入职时间"
prop="entryDate"
v-model="form.entryDate"
type="date"
/>
<Field
label="关怀类型"
prop="careType"
v-model="form.careType"
type="select"
:enumData="dict.careType"
placeholder="请选择关怀类型"
/>
<!-- <Field label="是否发送短信" prop="isSend">
<el-switch
v-model="form.isSend"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
>
</el-switch>
</Field> -->
<!-- <Field
label="关怀内容"
prop="content"
v-model="form.content"
type="textarea"
></Field> -->
</el-row>
<form-buttons @submit="submitForm" noCancelBtn />
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
name: "StaffCareDetail",
mixins: [form],
components: {},
created() {
this.changePath("staff/care");
},
data() {
return {
// 遮罩层
loading: true,
// 弹出层标题
title: "员工关怀信息",
// 是否显示弹出层
open: false,
direction: "rtl",
toDate: ["birthday", "entryDate"],
// 表单校验
rules: {
staffId: [
{ required: true, message: "请输入员工姓名", trigger: "blur" },
],
createTime: [{ required: true, message: "请选择创建时间" }],
},
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "staff/care/edit";
this.getData();
this.pageInfo.type = "edit";
this.title = "修改员工关怀信息";
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "staff/care/add";
this.getData();
this.pageInfo.type = "add";
this.title = "新增员工关怀信息";
},
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "staff/care/view";
this.getData();
this.pageInfo.type = "view";
this.title = "员工关怀信息详细";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
staffId: null,
staffName: "",
birthday: null,
deptId: null,
deptName: "",
jobId: null,
jobName: "",
entryDate: null,
careType: 1,
sendStatus: 0,
content: "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template>
<div class="page">
<LayoutTable :data="tableData" notDel :config="tableConfig">
<!-- <el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="handleImport"
>导入</el-button
> -->
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="doExport"
:disabled="isExport"
>导出</el-button
>
<span slot="table-head-left2" v-if="$route.query.careType">
<span style="color: #999; font-size: 14px">是否发送短信:</span>
<el-switch
v-if="$route.query.careType == 1"
v-model="tableData.StaffCareBirthdaySend"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
@change="handleChange"
>
</el-switch>
<el-switch
v-if="$route.query.careType == 2"
v-model="tableData.StaffCareEntryDateSend"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
@change="handleChange"
>
</el-switch>
</span>
<span
slot="table-head-right2"
v-if="$route.query.careType"
style="
color: #999;
font-size: 14px;
display: flex;
align-items: center;
margin-right: 10px;
"
>
<span v-if="$route.query.year && $route.query.month"
>{{ $route.query.year + "" + $route.query.month + ""
}}{{
$route.query.careType == 1 ? "过生日的员工" : "过入职周年的员工"
}}
</span>
<span v-else
>当月{{
$route.query.careType == 1 ? "过生日的员工" : "过入职周年的员工"
}}
</span>
<span style="color: #1a7af8; font-size: 14px">
{{
`(共${
$route.query.careType == 1 ? tableData.shengri : tableData.ruzhi
}人)`
}}
</span>
</span>
</LayoutTable>
<!-- 员工关怀信息导入对话框 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
:limit="1"
accept=".xlsx, .xls"
:headers="upload.headers"
:action="upload.url + '?updateSupport=' + upload.updateSupport"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
将文件拖到此处,或
<em>点击上传</em>
</div>
<div class="el-upload__tip" slot="tip">
<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的数据
<el-link
type="primary"
style="font-size: 14px"
@click="downloadTemplate"
>下载模板</el-link
>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
提示:仅允许导入“xls”或“xlsx”格式文件!
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFileForm"> </el-button>
<el-button @click="upload.open = false"> </el-button>
</div>
</el-dialog>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "StaffCareList",
components: {
drawerShow,
},
mixins: [table],
created() {},
data() {
return {
isSend: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(员工关怀信息导入)
open: false,
// 弹出层标题(员工关怀信息导入)
title: "导入员工关怀信息数据",
// 是否禁用上传
isUploading: false,
// 是否更新已经存在的数据
updateSupport: 0,
// 上传的地址
url: "/attendance/staff/care/importData",
},
isExport: false,
config: {
isshowTabPane: true,
search: [
{
name: "careType",
type: "radio",
label: "关怀类型",
},
{
name: "staffName",
type: "text",
label: "员工姓名",
fuzzy: true,
},
{
name: "yearmonth",
type: "month",
label: "请选择月份",
fuzzy: false,
},
],
columns: [
{ type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 },
{ label: "员工姓名", prop: "staffName" },
{
label: "入职时间",
prop: "entryDate",
formatter: this.formatterDateOnly,
},
{
label: "生日时间",
prop: "birthday",
formatter: this.formatterDateOnly,
},
{ label: "关怀类型", prop: "careType", formatter: this.formatter },
{ label: "发送状态", prop: "sendStatus", formatter: this.formatter },
// {
// label: "创建用户",
// prop: "createUserId",
// formatter: this.formatter,
// },
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<table-buttons
noAdd
noView
noDel
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
],
},
};
},
methods: {
// 是否发送短信
handleChange(val) {
this.$post("/staff/care/sendSwitch", {
paramValue: val,
paramType:
this.$route.query.careType == 1
? "StaffCareBirthdaySend"
: this.$route.query.careType == 2
? "StaffCareEntryDateSend"
: "",
})
.then((res) => {
console.log(res);
if (res.code == 1) {
this.$message.success(res.msg);
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 导入 */
handleImport() {
this.upload.title = "员工关怀信息导入";
this.upload.open = true;
},
/** 下载模板操作 */
downloadTemplate() {
this.isExport = true;
this.$download("/staff/care/downloadTemplate", {}, { type: "excel" })
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 文件上传中处理 */
handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true;
},
/** 文件上传成功处理 */
handleFileSuccess(response, file, fileList) {
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
this.getData();
},
/** 提交上传文件 */
submitFileForm() {
this.$refs.upload.submit();
},
/** 导出Excel */
doExport() {
this.isExport = true;
let params = {};
for (let value of this.config.search) {
if (this.query[value.name]) {
params[value.name] = this.query[value.name];
}
}
if (this.selection.length > 0) {
params["idList"] = this.selection;
}
this.$download(
"/staff/care/exportExcel",
{
...params,
},
{ type: "excel" }
)
.then(() => (this.isExport = false))
.catch((error) => {
this.isExport = false;
this.$message.error(error.message);
});
},
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
};
</script>
<style lang="less" scoped>
/deep/.el-radio-button__inner {
border: 1px solid #dcdfe6 !important;
}
/deep/.el-radio-button__orig-radio:checked + .el-radio-button__inner {
color: #fff !important;
background-color: #409eff !important;
border-color: #409eff !important;
-webkit-box-shadow: -1px 0 0 0 #409eff !important;
box-shadow: -1px 0 0 0 #409eff !important;
}
</style>
\ No newline at end of file
<template>
<layout-view>
<el-descriptions :title="title" :column="column" :size="size" :colon="false" border>
<template slot="title">
<i class="el-icon-tickets"></i>
基本详细信息
</template>
<template slot="extra">
<el-button type="primary" @click="$router.go(-1)" size="small">返回</el-button>
</template>
<el-descriptions-item label="员工姓名" label-class-name="labelClass" content-class-name="contentClass">
{{form.staffName}}
</el-descriptions-item>
<el-descriptions-item label="出生日期" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.birthday)}}
</el-descriptions-item>
<el-descriptions-item label="所属部门" label-class-name="labelClass" content-class-name="contentClass">
{{form.deptId}}
</el-descriptions-item>
<el-descriptions-item label="所属部门名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.deptName}}
</el-descriptions-item>
<el-descriptions-item label="职位ID" label-class-name="labelClass" content-class-name="contentClass">
{{form.jobId}}
</el-descriptions-item>
<el-descriptions-item label="职位名称" label-class-name="labelClass" content-class-name="contentClass">
{{form.jobName}}
</el-descriptions-item>
<el-descriptions-item label="入职时间" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatterDate(form.entryDate)}}
</el-descriptions-item>
<el-descriptions-item label="关怀类型" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("careType", form.careType) }}
</el-descriptions-item>
<el-descriptions-item label="发送状态" label-class-name="labelClass" content-class-name="contentClass">
{{ util_formatters("sendStatus", form.sendStatus) }}
</el-descriptions-item>
<el-descriptions-item label="关怀内容" label-class-name="labelClass" content-class-name="contentClass">
<editor v-model="form.content" :min-height="256"/>
</el-descriptions-item>
</el-descriptions>
</layout-view>
</template>
<script>
import view from "@/assets/mixins/view";
import Editor from '@/components/Editor';
export default {
mixins: [view],
components: {
Editor,
},
methods: {
},
data() {
return {
size:"small",
column:2,
toString:[
"careType",
"sendStatus",
],
toArrays: [
],
toDate: [
]
}
}
}
</script>
<style lang="less">
.labelClass{
width: 200px;
}
.el-descriptions__body{
margin-left: 5px;
margin-right: 5px;
color: #606266;
background-color: #FFF;
}
.contentClass{
width: 600px;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment