Commit 364039ca authored by zhangderong's avatar zhangderong

邮件发送

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