|
@@ -6,54 +6,66 @@
|
|
|
<y-page-list-layout :page-list="pageData" :page-para="listQuery" :get-page-list="selectPage">
|
|
|
<template slot="left">
|
|
|
<el-input style="width: 250px;float: left;margin-right:10px" class="filter-item" v-model="listQuery.recipientEmail" placeholder="收件人邮箱" clearable></el-input>
|
|
|
- <el-input style="width: 250px;float: left;" class="filter-item" v-model="listQuery.recipientName" placeholder="收件人姓名" clearable></el-input>
|
|
|
+ <el-input style="width: 250px;float: left;margin-right:10px" class="filter-item" v-model="listQuery.recipientName" placeholder="收件人姓名" clearable></el-input>
|
|
|
+ <el-input :controls="false" style="width: 150px;float: left;margin-right:10px" class="filter-item" v-model="listQuery.salaryYear" type="number" placeholder="发放年份"></el-input>
|
|
|
+ <el-input :controls="false" style="width: 150px;float: left;" class="filter-item" v-model="listQuery.salaryMonth" type="number" placeholder="发放月份"></el-input>
|
|
|
<el-button class="filter-item" style="margin-left: 10px;float: left;" type="primary" @click="searchList" round>搜索</el-button>
|
|
|
<el-button class="filter-item" style="float: left;" round type="success" @click="resetParams()">重置</el-button>
|
|
|
- <el-button class="filter-item" style="float: left;" round type="warning" @click="sendEmailDialogVisible = true">发送邮件</el-button>
|
|
|
+ <el-button class="filter-item" style="float: left;" round type="warning" @click="openSendEmailDialog()">发送邮件</el-button>
|
|
|
</template>
|
|
|
<parentTable ref="table" v-loading="listLoading" :data="pageData.records" slot="table" style="width: 100%;">
|
|
|
- <el-table-column label="操作人" align="operatorName" min-width="10%" prop="operatorName">
|
|
|
+ <el-table-column label="操作人" align="center" min-width="10%" prop="operatorName">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.operatorName ? '-' : row.operatorName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="发件人邮箱" align="senderEmail" min-width="12%" prop="senderEmail">
|
|
|
+ <el-table-column label="发件人邮箱" align="center" min-width="12%" prop="senderEmail">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.senderEmail ? '-' : row.senderEmail }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="收件人邮箱" align="recipientEmail" min-width="12%" prop="recipientEmail">
|
|
|
+ <el-table-column label="收件人邮箱" align="center" min-width="12%" prop="recipientEmail">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.recipientEmail ? '-' : row.recipientEmail }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="收件人姓名" align="recipientName" min-width="10%" prop="recipientName">
|
|
|
+ <el-table-column label="收件人姓名" align="center" min-width="10%" prop="recipientName">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.recipientName ? '-' : row.recipientName }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="身份证号" align="idNo" min-width="15%" prop="idNo">
|
|
|
+ <el-table-column label="身份证号" align="center" min-width="15%" prop="idNo">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.idNo ? '-' : row.idNo }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="部门" align="department" min-width="10%" prop="department">
|
|
|
+ <el-table-column label="部门" align="center" min-width="10%" prop="department">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.department ? '-' : row.department }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="发送时间" align="sendTime" min-width="11%" prop="sendTime">
|
|
|
+ <el-table-column label="发放年份" align="center" min-width="8%" prop="salaryYear">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ !row.salaryYear ? '-' : row.salaryYear }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="发放月份" align="center" min-width="8%" prop="salaryMonth">
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ !row.salaryMonth ? '-' : row.salaryMonth }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="发送时间" align="center" min-width="11%" prop="sendTime">
|
|
|
<template slot-scope="{row}">
|
|
|
<span>{{ !row.sendTime ? '-' : row.sendTime }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="发送状态" align="sendingStatus" min-width="11%" prop="sendingStatus">
|
|
|
+ <el-table-column label="发送状态" align="center" min-width="11%" prop="sendingStatus">
|
|
|
<template slot-scope="{row}">
|
|
|
<span v-if="row.sendingStatus" style="color:#5CB87A">发送成功</span>
|
|
|
<span v-if="!row.sendingStatus" style="color:red">发送失败</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="失败原因" align="failureReason" min-width="15%" prop="failureReason" show-overflow-tooltip>
|
|
|
+ <el-table-column label="失败原因" align="center" min-width="15%" prop="failureReason" show-overflow-tooltip>
|
|
|
<template slot-scope="{row}">
|
|
|
<span v-if="row.failureReason" style="color:red">{{ row.failureReason }}</span>
|
|
|
<span v-if="!row.failureReason">-</span>
|
|
@@ -61,7 +73,7 @@
|
|
|
</el-table-column>
|
|
|
</parentTable>
|
|
|
</y-page-list-layout>
|
|
|
- <el-dialog title="发送薪资邮件" :visible.sync="sendEmailDialogVisible" width="30%" @close="clearForm">
|
|
|
+ <el-dialog title="发送薪资邮件" :visible.sync="sendEmailDialogVisible" width="50%" @close="clearForm">
|
|
|
<el-form :model="fileData" :rules="fileDataRules" ref="sendEmailForm">
|
|
|
<el-row>
|
|
|
<el-col>
|
|
@@ -216,6 +228,13 @@ export default {
|
|
|
};
|
|
|
this.selectPage();
|
|
|
},
|
|
|
+ openSendEmailDialog() {
|
|
|
+ this.sendEmailDialogVisible = true;
|
|
|
+ const now = new Date();
|
|
|
+ this.fileData.year = now.getFullYear(); // 年份
|
|
|
+ this.fileData.month = now.getMonth() + 1; // 月份(0–11),加 1 得到 1–12
|
|
|
+ this.fileData.subject = this.fileData.year + '年' + this.fileData.month + '月 薪资邮件,请查收'
|
|
|
+ },
|
|
|
// 上传前校验
|
|
|
beforeUploadHandle(file) {
|
|
|
const fileSuffix = file.name.substring(file.name.lastIndexOf('.') + 1);
|
|
@@ -245,9 +264,9 @@ export default {
|
|
|
if (res.code === 200 && res.data) {
|
|
|
this.$notify({
|
|
|
title: '成功',
|
|
|
- message: '邮件发送成功。',
|
|
|
+ message: '邮件正在后台推送中, 请稍后刷新页面查看推送结果。',
|
|
|
type: 'success',
|
|
|
- duration: 2000,
|
|
|
+ duration: 5000,
|
|
|
});
|
|
|
this.clearForm();
|
|
|
} else {
|
|
@@ -260,13 +279,16 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 上传文件改变时
|
|
|
onFileChange() {
|
|
|
- this.$refs['sendEmailForm'].clearValidate(['file']); //移除表单某个字段的校验
|
|
|
+ this.$refs['sendEmailForm'].clearValidate(['file']); //移除表单文件上传字段的校验
|
|
|
this.fileList = this.$refs.upload.uploadFiles;
|
|
|
},
|
|
|
+ // 移除上传文件时
|
|
|
beforeRemove() {
|
|
|
this.fileList = [];
|
|
|
},
|
|
|
+ // 上传文件超过数量限制时
|
|
|
onExceed() {
|
|
|
this.$notify({
|
|
|
title: '错误',
|
|
@@ -275,6 +297,7 @@ export default {
|
|
|
duration: 2000,
|
|
|
});
|
|
|
},
|
|
|
+ // 上传文件并发送邮件
|
|
|
sendEmail() {
|
|
|
this.$refs.sendEmailForm.validate((valid) => {
|
|
|
console.log(valid);
|
|
@@ -283,6 +306,7 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 清除表单
|
|
|
clearForm() {
|
|
|
this.fileList = [];
|
|
|
this.sendEmailDialogVisible = false;
|