Commit 364039ca authored by zhangderong's avatar zhangderong

邮件发送

parent 40e9a080
......@@ -54,7 +54,6 @@ export function deleteREsume (deleteallArr) {
}
// 单条下载简历
export function downloadOne (parmars) {
console.log(parmars.resumeId)
return axios.get(`${sapi}/api/resume/download/formatted/one?resumeId=${parmars.resumeId}`,{headers: {
// 'Content-Type':'application/x-www-form-urlencoded'
}})
......@@ -104,8 +103,21 @@ export function getEmailMoo() {
}
//根据获取id邮件模板内容
export function getEmailContent(parmars) {
console.log(parmars,76666666666)
return axios.post(`${sapi}/api/emailTemplate/loadTemplate`,parmars,{headers: {
'Content-Type':'application/json'
}})
}
\ No newline at end of file
}
//上传图片
export function uploadimage() {
return axios.get(`${sapi}/api/ckeditor/uploadImage`,{headers: {
'Content-Type':'application/json'
}})
}
// 发送邮件
export function sendEmail(parmars) {
return axios.post(`${sapi}/api/sendMail/sendEmailTemplate`,parmars,{headers: {
// 'Content-Type':'multipart/form-data',
// 'Content-Disposition':'multipart/form-data'
// 'Content-Type':'application/json'
}})
}
......@@ -53,7 +53,7 @@
cloudServices_uploadUrl: 'https://your-organization-id.cke-cs.com/easyimage/upload/',
});
this.editor = CKEDITOR.instances.editor;
this.editor.on( 'blur', ( evt ) =>{
this.editor.on( 'change', ( evt ) =>{
// getData() returns CKEditor's HTML content.
this.$emit('getValue', evt.editor.getData())
});
......
......@@ -203,7 +203,7 @@ import localstorage from '../service/localstorage.service.js'
getChannelMenu(){
this.menuList[0].child[1].child = []
getChannelMassage().then(res=>{
if (!res.data.status) {
if (res.data.status==false) {
return
}
this.channelARR=res.data.body || []
......
......@@ -296,11 +296,12 @@
<div class="emailModal-title">
<div class="emailModalTitle-left">
<p>
<Form :label-width="60" :model="emailInline" label-position="left" style="margin-left:5%">
<FormItem label="选择模板" style="margin-top:20px" >
<Select style="width:95%" @on-change='getEmailContentValue' v-model="emailInline.moo">
<Form :label-width="60" :model="emailInline" label-position="left" style="margin-left:5%" ref="emailInline" :rules="ruleInline">
<FormItem label="选择模板" style="margin-top:20px" prop='moo'>
<Select style="width:95%" @on-change='getEmailContentValue' v-model="emailInline.moo" >
<Option v-for="(item,index) in emailInline.modalArr" :key="index" :value="item.templateCode">{{item.templateName}}</Option>
</Select>
</Select><br>
<!-- <span v-show="emailMassage==true">你尚未选择简历,请先选择简历</span> -->
</FormItem>
<FormItem label="收件人" style="margin-top:20px">
<Input style="width:95%" v-model="emailInline.receiveEmail"/>
......@@ -351,15 +352,15 @@
</div>
<div slot='footer' style="text-align:center" class="Ubt">
<Button type='primary' @click='emailModalPush'>取消</Button>
<Button type='primary' @click='emailMOdal=false' v-show="this.isShowAll==false">发送</Button>
<Button type='primary' @click='emailMOdal=false' v-show="this.isShowAll==true">添加并发送</Button>
<Button type='primary' @click='confireSendEmail' v-show="this.isShowAll==false">发送</Button>
<Button type='primary' @click='confireSendEmail' v-show="this.isShowAll==true">添加并发送</Button>
</div>
</Modal>
</div>
</template>
<script>
import moment from 'moment'
import { serchList,downloadone,sousuoList,seedetail,PASS,OPTION,deleteREsume,downloadOne,exportLIST,recodeLIST,addinterview,updatastatus,TODORes,getEmailMoo,getEmailContent} from '../../api/resume.server'
import { serchList,downloadone,sousuoList,seedetail,PASS,OPTION,deleteREsume,downloadOne,exportLIST,recodeLIST,addinterview,updatastatus,TODORes,sendEmail,getEmailMoo,getEmailContent,uploadimage} from '../../api/resume.server'
import qs from 'qs'
import {
sapi
......@@ -369,6 +370,17 @@ import ckeditor from '../../components/ckeditor'
// import ckeditor from '../../../static/ckeditor'
export default {
data () {
const vidte=(rule,value,callback)=>{
if(this.emailMassage==true){
callback(new Error('你尚未选择简历,请先选择简历'))
}
else if(this.allEmailVilitor==true){
callback(new Error('不能选择多份简历,请选择单份简历'))
}
else{
callback ()
}
}
return {
sad:'',
ruleInline: {
......@@ -381,6 +393,9 @@ import ckeditor from '../../components/ckeditor'
UpdateVIEW: [
{ required: true,message: '面试官不能为空', trigger: 'blur' }
],
moo:[
{required: false, validator: vidte, trigger: 'change'},
],
},
formInline:{
UpdateOWER:'',
......@@ -396,12 +411,24 @@ import ckeditor from '../../components/ckeditor'
Enclosure:[],//附件
templateContent:'',//模板内容
},
EmailruleInline:{
moo:[
{ required: true, pattern:this.emailMassage==true, message: '请输入正确的手机号', trigger: 'blur' }
]
},
emailMassage:false,
allEmailVilitor:false,
emailContent:'',
emailFlowStatus:'',
fileList:[],
uploadurl:'192.168.28.10',
isShowAll:false,
emailId:'',
RescopyArr:[],
interelement:'1',
emailId:'',
emailIdArr:[],
attachFileList:[],
flowStatusTT:'',
emailCode:'',
modal1:false,
modal2:false,
......@@ -560,7 +587,7 @@ import ckeditor from '../../components/ckeditor'
//操作处理面试状态
selectFn1(e,SID,itemsta) {
this.toseeid=SID
this.emailId=SID
this.emailIdArr.push(SID)
this.isShowAll=true
this.ITEMSTA=itemsta
// 准备约面
......@@ -569,6 +596,7 @@ import ckeditor from '../../components/ckeditor'
this.emailInline.modalArr.push(res.data.body[0])
})
this.emailMOdal=true
this.emailFlowStatus='TO_SEE'
}
// 简历PASS
if(e.target.value==2){
......@@ -636,8 +664,7 @@ import ckeditor from '../../components/ckeditor'
this.emailInline.modalArr.push(res.data.body[0])
})
this.emailMOdal=true
// this.modal2=true
this.emailFlowStatus='TO_SEE'
}
// 简历PASS
if(e.target.value==3){
......@@ -683,8 +710,8 @@ import ckeditor from '../../components/ckeditor'
getEmailMoo().then(res=>{
this.emailInline.modalArr.push(res.data.body[0])
})
this.emailMOdal=true
// this.modal2=true
this.emailMOdal=true
this.emailFlowStatus='TO_SEE'
}
// 简历PASS
if(e.target.value==3){
......@@ -730,7 +757,8 @@ import ckeditor from '../../components/ckeditor'
getEmailMoo().then(res=>{
this.emailInline.modalArr.push(res.data.body[0])
})
this.emailMOdal=true
this.emailMOdal=true
this.emailFlowStatus='TO_SEE'
}
// 简历PASS
if(e.target.value==1){
......@@ -956,6 +984,7 @@ import ckeditor from '../../components/ckeditor'
// 选择input元素
selectInputElement(index,doID,doStatus,sss){
this.DOWNLOAD=doID
this.emailIdArr.push(doID)
this.emailId=doID
sss=!sss
this.ajaxData[index].STATES=sss
......@@ -1178,13 +1207,6 @@ import ckeditor from '../../components/ckeditor'
},
// 发送邮件
sendEmail(){
if(this.emailId==''){
this.$Notice.error({
title: '提示',
desc: '未选中元素'
});
return
}
this.emailInline.modalArr=[]
this.emailMOdal=true
getEmailMoo().then(res=>{
......@@ -1192,14 +1214,31 @@ import ckeditor from '../../components/ckeditor'
})
},
getEmailContentValue(value){
if(this.emailIdArr.length>1&&(value=='TEMP_0001'||value=='TEMP_0005'||value=='TEMP_0006')){
this.allEmailVilitor=true
}else{
this.allEmailVilitor=false
}
if(value=='TEMP_0001'){
this.interviewIsShow=true
this.interviewIsShow=true}else{
this.interviewIsShow=false
}
this.emailId=this.emailIdArr.length==0?'':this.emailIdArr[0]
if(value=='TEMP_0001' &&this.emailId==''){
this.interviewBtu=true
this.isShowAll=true
}else{
this.interviewIsShow=false
this.emailMassage=true
}
else if(value=='TEMP_0005' && this.emailId==''){
this.emailMassage=true
}
else if(value=='TEMP_0006' && this.emailId==''){
this.emailMassage=true
}
else{
this.interviewBtu=false
this.isShowAll=false
this.emailMassage=false
}
this.emailCode=value
let parmars={
......@@ -1230,14 +1269,38 @@ import ckeditor from '../../components/ckeditor'
this.fileList=[]
this.emailInline.moo=''
this.emailMOdal=false
this.emailMassage=false
this.emailIdArr=[]
this.emailFlowStatus=''
this.SouSuo(this.pageT)
},
getEditorValue(value){
console.log(value,3333333333)
this.emailContent=value
},
delateFile(index){
this.fileList.splice(index,1)
},
// 确认发送邮件
confireSendEmail(){
this.attachFileList=this.fileList.length==0?'':this.fileList
this.flowStatusTT=this.emailFlowStatus==''?'':'TO_SEE'
var formData= new FormData()
formData.append('attachFileList',this.attachFileList)
formData.append('resumeId',this.emailId)
formData.append('templateCode',this.emailCode)
formData.append('subject',this.emailInline.theme)
formData.append('toEmail',this.emailInline.receiveEmail)
formData.append('ccEmail',this.emailInline.copyname)
formData.append('emailContent',this.emailContent)
formData.append('resumeInterviewVO.resumeId',this.emailId)
formData.append('resumeInterviewVO.inviterName',this.formInline.UpdateOWER)
formData.append('resumeInterviewVO.interviewerName',this.formInline.UpdateVIEW)
formData.append('resumeInterviewVO.seeTime',moment(this.formInline.UpdateTIME).format('YYYY/MM/DD HH:mm'))
formData.append(' flowStatus',this.flowStatusTT)
sendEmail(formData).then(res=>{
console.log(res)
})
}
},
mounted(){
this.SearchList()
......
<template>
<div id="Sweepcode">
<div class="header">
<h3 style="margin-top:10px;font-size:0.35rem">应聘登记表</h3>
<h3 style="margin-top:5px;font-size:0.35rem">应聘登记表</h3>
</div>
<div class="sweepcode_content">
<Form :label-width="120" :model="formInline" :rules="ruleInline" ref="formInline" class="fontsize" label-position=left style="margin-left:3%">
<FormItem label="邀约人" prop="Inviter" style="margin-top:0.4rem;font-size:15px">
<FormItem label="邀约人" prop="Inviter" style="margin-top:10px;font-size:15px">
<Input placeholder="请输入" style="width:85%;" v-model="formInline.Inviter" size="large"/>
</FormItem>
<FormItem label="邀约人手机" style="" class="phone" prop="InviterPhoneNumber">
<Input placeholder="请输入" style="width:85%;" v-model="formInline.InviterPhoneNumber" size="large" /><br>
<!-- <span style="position: absolute;top: 100%;left: 0;line-height: 1;padding-top: 6px;color:#ed4014;display:inline-block;height:30px;" v-show="isV==true">请输入正确的手机号码</span> -->
<FormItem label="邀约人手机" style="" class="phone">
<Input placeholder="请输入" style="width:85%;" v-model="formInline.InviterPhoneNumber" size="large" @on-blur='jedugePhone'/><br>
<span style="position: absolute;top: 100%;left: 0;line-height: 1;padding-top: 6px;color:#ed4014;display:inline-block;height:30px;" v-show="isV==true">请输入正确的手机号码</span>
</FormItem>
<FormItem label="面试时间" prop="time" style="margin-top:0px" class="dateTime">
<FormItem label="面试时间" prop="time" class="dateTime">
<Input placeholder="请输入" style="width:40%;" v-model="formInline.date" :readonly="true" size="large" />
<!-- <DatePicker type="date" placeholder="请选择日期" style="width: 120px;margin-left:20px" v-model="formInline.date" @on-change="selectDate" :options="options3" ></DatePicker> -->
<TimePicker type="time" placeholder="请选择时间" style="width: 43%" v-model="formInline.time" format="HH:mm" @on-change="selectTime" @on-focus="defaultRRRR" :editable="false" size="large"></TimePicker>
</FormItem>
<FormItem label="应聘职位" prop="position" class="position">
......@@ -86,9 +85,9 @@ export default {
{ required: true,message: '面试时间不能为空', trigger: 'date' },
],
InviterPhoneNumber: [
{ required: false, pattern:/^[1][3,4,5,7,8,6,9][0-9]{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
],
// InviterPhoneNumber: [
// { required: false, pattern:/^[1][3,4,5,7,8,6,9][0-9]{9}$/, message: '请输入正确的手机号', trigger: 'blur' }
// ],
position: [
{ required: true,message: '请输入应聘职位', trigger: 'blur' }
],
......@@ -219,12 +218,16 @@ export default {
this.modal3=true
},
jedugePhone(){
if(!(/^[1][3,4,5,7,8,6,9][0-9]{9}$/.test(this.formInline.InviterPhoneNumber))){
this.isV=true
setTimeout(() => {
this.isV=false
}, 3000);
}
if(this.formInline.InviterPhoneNumber==''){
this.isV=false
return
}
if(!(/^[1][3,4,5,7,8,6,9][0-9]{9}$/.test(this.formInline.InviterPhoneNumber))){
this.isV=true
}
if((/^[1][3,4,5,7,8,6,9][0-9]{9}$/.test(this.formInline.InviterPhoneNumber))){
this.isV=false
}
},
// 阻止弹出键盘
defaultRRRR(){
......@@ -286,22 +289,22 @@ export default {
.header{
text-align: center;
height: 5%;
/* float: left; */
}
.submission{
height: 20%;
height: 10%;
margin-top:10px;
}
.submission button{
width: 47%;
font-size: 0.35rem;
margin-top: 15%;
margin-top:20px;
margin-left: 26%;
height: 39px;
}
.sweepcode_content{
margin-top:0.2rem;
margin-top:10px;
font-size: 0.15rem;
height: 70%;
height: 80%;
border-top: 1px solid rgba(241,241,241,1);
}
......@@ -316,10 +319,10 @@ export default {
.fontsize .ivu-form-item-label{
font-size: 0.28rem;
}
.dateTime .ivu-form-item-label{
/* .dateTime .ivu-form-item-label{
margin-top:6px
}
.position .ivu-form-item-label{
} */
/* .position .ivu-form-item-label{
margin-top:6px
}
.model2 .ivu-form-item-label{
......@@ -333,25 +336,25 @@ export default {
}
.phoneNUmber .ivu-form-item-label{
margin-top:6px
}
} */
.fontsize{
height: 100%;
width: 100%;
/* border: 1px solid yellow */
}
.fontsize .ivu-form-item.ivu-form-item-required{
height:30px;
height:7.5%;
}
.fontsize .phone{
height:26px;
height:7%;
}
.fontsize .ivu-input.ivu-input-large{
font-size: 0.23rem
}
.dateTime .ivu-form-item-content{
/* .dateTime .ivu-form-item-content{
margin-top:6px
}
.position .ivu-form-item-content{
} */
/* .position .ivu-form-item-content{
margin-top:6px
}
.name .ivu-form-item-content{
......@@ -365,5 +368,5 @@ export default {
}
.model1 .ivu-form-item-content{
margin-top:6px
}
} */
</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