|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="card-container" v-loading="loading.page">
|
|
|
|
|
|
|
+ <div class="card-container">
|
|
|
<div class="flexr">
|
|
<div class="flexr">
|
|
|
<el-form
|
|
<el-form
|
|
|
:model="form"
|
|
:model="form"
|
|
@@ -7,7 +7,23 @@
|
|
|
ref="mailForm"
|
|
ref="mailForm"
|
|
|
label-position="right"
|
|
label-position="right"
|
|
|
label-width="110px"
|
|
label-width="110px"
|
|
|
- class="card-content flex1">
|
|
|
|
|
|
|
+ class="card-content flex1"
|
|
|
|
|
+ v-loading="loading.page">
|
|
|
|
|
+ <div class="section-title" style="text-transform: uppercase;">Email Type</div>
|
|
|
|
|
+ <el-form-item
|
|
|
|
|
+ label="Email Type:"
|
|
|
|
|
+ prop="emailType">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ class="add-text"
|
|
|
|
|
+ v-model="form.emailType"
|
|
|
|
|
+ @change="getMailSettings">
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="(item, index) in configTypes"
|
|
|
|
|
+ :key="index"
|
|
|
|
|
+ :label="item"
|
|
|
|
|
+ :value="item"/>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
|
<span style="padding-right: 30px;text-transform: uppercase;">Mail Notification Settings</span>
|
|
<span style="padding-right: 30px;text-transform: uppercase;">Mail Notification Settings</span>
|
|
|
<el-checkbox v-model="form.enable">Enable notifications</el-checkbox>
|
|
<el-checkbox v-model="form.enable">Enable notifications</el-checkbox>
|
|
@@ -95,7 +111,8 @@
|
|
|
ref="recipForm"
|
|
ref="recipForm"
|
|
|
label-width="90px"
|
|
label-width="90px"
|
|
|
label-position="right"
|
|
label-position="right"
|
|
|
- class="card-content flex1">
|
|
|
|
|
|
|
+ class="card-content flex1"
|
|
|
|
|
+ v-if="form.emailType == 'Internal'">
|
|
|
<el-form-item
|
|
<el-form-item
|
|
|
label="Recipients:"
|
|
label="Recipients:"
|
|
|
prop="recipient">
|
|
prop="recipient">
|
|
@@ -120,7 +137,7 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <div v-loading="loading.table">
|
|
|
|
|
|
|
+ <div v-loading="loading.table || loading.page">
|
|
|
<el-table :data="table.list">
|
|
<el-table :data="table.list">
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
align="center"
|
|
align="center"
|
|
@@ -211,6 +228,8 @@ export default {
|
|
|
save: false
|
|
save: false
|
|
|
},
|
|
},
|
|
|
form: {
|
|
form: {
|
|
|
|
|
+ tenantId: "",
|
|
|
|
|
+ emailType: "Internal",
|
|
|
emailId: "",
|
|
emailId: "",
|
|
|
enable: false,
|
|
enable: false,
|
|
|
protocol: "smtp",
|
|
protocol: "smtp",
|
|
@@ -218,7 +237,9 @@ export default {
|
|
|
port: "",
|
|
port: "",
|
|
|
emailFrom: "",
|
|
emailFrom: "",
|
|
|
username: "",
|
|
username: "",
|
|
|
- password: ""
|
|
|
|
|
|
|
+ password: "",
|
|
|
|
|
+ enableSsl: true,
|
|
|
|
|
+ enableStarttls: true
|
|
|
},
|
|
},
|
|
|
filter: {
|
|
filter: {
|
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
@@ -270,6 +291,7 @@ export default {
|
|
|
message: 'Please type a correct recipient'
|
|
message: 'Please type a correct recipient'
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ configTypes: [],
|
|
|
protocolTypes: [],
|
|
protocolTypes: [],
|
|
|
dialogAssign: {
|
|
dialogAssign: {
|
|
|
item: {},
|
|
item: {},
|
|
@@ -284,6 +306,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getProtocolTypes() {
|
|
getProtocolTypes() {
|
|
|
|
|
+ api.getEmailTypeOptions().then(res => {
|
|
|
|
|
+ if (res.data) {
|
|
|
|
|
+ this.configTypes = res.data
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
api.getProtocolOptions().then(res => {
|
|
api.getProtocolOptions().then(res => {
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
this.protocolTypes = res.data
|
|
this.protocolTypes = res.data
|
|
@@ -293,11 +322,17 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
getMailSettings() {
|
|
getMailSettings() {
|
|
|
- api.getEmailConfiguration().then(res => {
|
|
|
|
|
|
|
+ this.loading.page = true;
|
|
|
|
|
+ api.getEmailConfiguration({
|
|
|
|
|
+ emailType: this.form.emailType
|
|
|
|
|
+ }).then(res => {
|
|
|
this.loading.page = false;
|
|
this.loading.page = false;
|
|
|
if (res.data) {
|
|
if (res.data) {
|
|
|
|
|
+ if (!res.data.emailType) {
|
|
|
|
|
+ res.data.emailType = this.form.emailType;
|
|
|
|
|
+ }
|
|
|
this.form = res.data;
|
|
this.form = res.data;
|
|
|
- if (res.data.emailId) {
|
|
|
|
|
|
|
+ if (res.data.emailId && this.form.emailType == "Internal") {
|
|
|
this.filter.pageCriteria.emailId = res.data.emailId;
|
|
this.filter.pageCriteria.emailId = res.data.emailId;
|
|
|
this.getReceiptTable();
|
|
this.getReceiptTable();
|
|
|
}
|
|
}
|