Commit 4bcf572c authored by 姬鋆屾's avatar 姬鋆屾

pref:员工关怀添加发送短信控制,调整表格内容及新增编辑内容

parent c3db5788
......@@ -541,7 +541,8 @@ export default {
this.form = Object.assign({}, this.form, newData);
if (
this.$route.name == "check/window/workman/perform/detail/list" ||
this.$route.name == "window/perform/summary/list"
this.$route.name == "window/perform/summary/list" ||
this.$route.name == "staff/care/list"
) {
this.form.yearmonth = timestampToTime(new Date(), 2);
this.form.year = timestampToTime(new Date(), 2).slice(0, 4);
......@@ -551,6 +552,9 @@ export default {
if (this.$route.name == "staff/leave/list") {
this.form.idList = "";
}
if (this.$route.name == "staff/care/list") {
this.form.careType = "1";
}
this.onSubmit();
},
onSubmit() {
......
......@@ -30,14 +30,14 @@
:enumData="dict.deptId"
placeholder="请输入所属部门"
/>
<Field
<!-- <Field
label="职位ID"
prop="jobId"
v-model="form.jobId"
type="select"
:enumData="dict.jobId"
placeholder="请输入职位ID"
/>
/> -->
<Field
label="入职时间"
prop="entryDate"
......@@ -52,12 +52,22 @@
:enumData="dict.careType"
placeholder="请选择关怀类型"
/>
<Field
<!-- <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>
></Field> -->
</el-row>
<form-buttons @submit="submitForm" noCancelBtn />
......@@ -83,7 +93,6 @@ export default {
// 是否显示弹出层
open: false,
direction: "rtl",
toString: ["careType", "sendStatus"],
toDate: ["birthday", "entryDate"],
// 表单校验
rules: {
......
<template>
<div class="page">
<LayoutTable :data="tableData" :config="tableConfig">
<LayoutTable :data="tableData" notDel :config="tableConfig">
<!-- <el-button
slot="table-head-left2"
style="margin-left: 10px"
......@@ -9,6 +9,7 @@
@click="handleImport"
>导入</el-button
> -->
<el-button
slot="table-head-left2"
style="margin-left: 10px"
......@@ -18,6 +19,49 @@
: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;
"
>{{ $route.query.year + "" + $route.query.month + ""
}}{{ $route.query.careType == 1 ? "过生日的员工" : "过入职周年的员工" }}
<span style="color: #1a7af8; font-size: 14px">
{{
`(共${
$route.query.careType == 1 ? tableData.shengri : tableData.ruzhi
}人)`
}}
</span>
</span>
</LayoutTable>
<!-- 员工关怀信息导入对话框 -->
......@@ -80,6 +124,7 @@ export default {
created() {},
data() {
return {
isSend: 0,
// 用户导入参数
upload: {
// 是否显示弹出层(员工关怀信息导入)
......@@ -103,6 +148,17 @@ export default {
label: "员工姓名",
fuzzy: true,
},
{
name: "careType",
type: "select",
label: "关怀类型",
},
{
name: "yearmonth",
type: "month",
label: "请选择月份",
fuzzy: false,
},
],
columns: [
{ type: "selection", width: 60 },
......@@ -112,18 +168,22 @@ export default {
{
label: "入职时间",
prop: "entryDate",
formatter: this.formatterDate,
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: "创建用户",
// prop: "createUserId",
// formatter: this.formatter,
// },
{
label: "操作",
width: 240,
......@@ -131,6 +191,8 @@ export default {
return (
<table-buttons
noAdd
noView
noDel
row={row}
onEdit={this.toEdit}
onView={this.toView}
......@@ -144,6 +206,27 @@ export default {
};
},
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 = "员工关怀信息导入";
......
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