Ver código fonte

Separate E-mail
https://dev.wormwood.com.sg/zentao/task-view-841.html

wudebin 5 meses atrás
pai
commit
c18c4ccc18
1 arquivos alterados com 42 adições e 7 exclusões
  1. 42 7
      Strides-Admin/src/views/zetting/MailNotification.vue

+ 42 - 7
Strides-Admin/src/views/zetting/MailNotification.vue

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