Преглед на файлове

Merge branch '11/24SAAS' of http://git.dayaedu.com/yonge/dy-admin-manager into 11/24SAAS

lex-xin преди 3 години
родител
ревизия
e4ad55db08
променени са 5 файла, в които са добавени 224 реда и са изтрити 1 реда
  1. 8 0
      src/api/vipSeting.js
  2. 2 1
      src/router/index.js
  3. 13 0
      src/views/buildVip/index.vue
  4. 15 0
      src/views/mailInfoManager/api.js
  5. 186 0
      src/views/mailInfoManager/index.vue

+ 8 - 0
src/api/vipSeting.js

@@ -474,3 +474,11 @@ export const activityrMapperInfo = data => request2({
   method: 'get',
   requestType: 'form'
 })
+
+// 查询当前线上课数
+export const getOnlineMun = data => request2({
+  url:api +  '/tenantConfig/get',
+  params:data,
+  method: 'get',
+  requestType: 'form'
+})

+ 2 - 1
src/router/index.js

@@ -518,7 +518,8 @@ export const asyncRoutes = {
   OAMananger:() => import('@/views/OAMananger'),
   // 平台员工管理
   staffPlatManager: () => import('@/views/categroyManager/insideSetting/staffPlatManager'),
-  //
+  //邮件配置服务
+  mailInfoManager:()=>import('@/views/mailInfoManager')
 }
 
 export default router

+ 13 - 0
src/views/buildVip/index.vue

@@ -301,6 +301,7 @@
           </el-form-item>
           <el-form-item v-if="hasOnline" label="线上课数">
             <el-input
+            :disabled='studentLimit>studentRuleNum'
               v-model.trim="centerForm.onlineCourseNum"
               @mousewheel.native.prevent
               @input="onCourseNumChange('online')"
@@ -681,6 +682,7 @@ import {
   getPracticeGroupCostCount,
   createPractice,
   getPracticeGroupSellPrice,
+  getOnlineMun
 } from "@/api/vipSeting";
 import { getTeachSchool, getTeacherBySubject } from "@/api/teacherManager";
 import axios from "axios";
@@ -873,6 +875,7 @@ export default {
       isMusicTheory: false,
       chioseStudent: [],
       classTimeDis: false,
+      studentRuleNum:0,
     };
   },
   computed: {
@@ -1107,6 +1110,14 @@ export default {
       localStorage.removeItem(`newPractice`);
     },
     async init() {
+      try{
+        const res = await getOnlineMun()
+        let tempObj = JSON.parse(res.data.config)
+        this.studentRuleNum = tempObj.cloud_room_rule.cloud_room_up_limit -1
+
+      }catch(e){
+        console.log(e)
+      }
       if (this.$route.query.rules) {
         this.rules = this.$route.query.rules;
       }
@@ -1236,11 +1247,13 @@ export default {
       this.leftForm.activeType = "";
       this.computationalBtn = false;
       this.leftForm.students = []; // 重置所选学生
+        this.centerForm.onlineCourseNum = 0 // 重置线上课数
       this.changePrice(val);
     },
     changePrice(val) {
       for (let i in this.courseTypeList) {
         if (this.courseTypeList[i].id == val) {
+
           // 学生人数
           this.leftForm.classNum = this.courseTypeList[i].studentNum;
           this.studentLimit = this.courseTypeList[i].studentNum;

+ 15 - 0
src/views/mailInfoManager/api.js

@@ -0,0 +1,15 @@
+import request2 from '@/utils/request2'
+
+// 获取首页数据
+export const getEmail = data => request2({
+  url: '/api-web/sysEmail/query',
+  params: data,
+  method: 'get',
+})
+
+export const resetEmail = data => request2({
+  url: '/api-web/sysEmail/update',
+ data,
+  method: 'post',
+})
+

+ 186 - 0
src/views/mailInfoManager/index.vue

@@ -0,0 +1,186 @@
+ <template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>
+      邮件服务配置
+    </h2>
+    <!-- <h3 class="infoTitle">优惠券信息</h3>
+    <el-divider></el-divider> -->
+    <el-form :model="form" ref="form" class="form">
+      <el-row :gutter="20">
+        <el-col style="width: 395px">
+          <el-form-item
+            label="服务器主机名"
+            prop="hostName"
+            :rules="[{ required: true, message: '请输入服务器主机名' }]"
+          >
+            <el-input
+              style="width: 355px !important"
+              v-model="form.hostName"
+              placeholder="请输服务器主机名"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+
+        <el-col style="width: 395px">
+          <el-form-item
+            label="服务器端口号"
+            prop="smtpPort"
+            :rules="[{ required: true, message: '请输入服务器端口号' }]"
+          >
+            <el-input
+              style="width: 355px !important"
+              v-model="form.smtpPort"
+              placeholder="请输入服务器端口号"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+      <el-row :gutter="20">
+        <el-col style="width: 395px">
+          <el-form-item
+            label="服务器用户名"
+            prop="userName"
+            :rules="[{ required: true, message: '请输入服务器用户名' }]"
+          >
+            <el-input
+              style="width: 355px !important"
+              v-model="form.userName"
+              placeholder="请输入服务器用户名"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col style="width: 395px">
+          <el-form-item
+            label="服务器密码"
+            prop="password"
+            :rules="[{ required: true, message: '请输入服务器密码' }]"
+          >
+            <el-input
+              show-password
+              style="width: 355px !important"
+              v-model="form.password"
+              placeholder="请输入服务器密码"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+
+      <el-row :gutter="20">
+        <el-col style="width: 395px">
+          <el-form-item
+            label="邮箱"
+            prop="from"
+            :rules="[{ required: true, message: '请输入邮箱' }]"
+          >
+            <el-input
+              style="width: 355px !important"
+              v-model="form.from"
+              placeholder="请输入邮箱"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col style="width: 395px">
+          <el-form-item
+            label="落款名称"
+            prop="fromName"
+            :rules="[{ required: true, message: '请输入落款名称' }]"
+          >
+            <el-input
+              style="width: 355px !important"
+              v-model="form.fromName"
+              placeholder="请输入落款名称"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+<!--  -->
+      <el-form-item>
+        <el-button type="primary" v-permission="'sysEmail/update'"  @click="setEmil">保存</el-button>
+        <!-- <el-button type="primary" v-else @click="addCoupon">提交</el-button> -->
+        <el-button type="danger" @click="resetForm">重置</el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+<script>
+import { getEmail,resetEmail } from "./api.js";
+import { couponTypeList, coupontypeDetailList } from "@/utils/searchArray";
+import { getTimes } from "@/utils";
+export default {
+  data() {
+    return {
+      couponTypeList,
+      coupontypeDetail: coupontypeDetailList,
+      form: {
+        id:1,
+        hostName: null,
+        smtpPort: null,
+        userName: null,
+        password: null,
+        from: null,
+        fromName: null,
+      },
+    };
+  },
+  mounted() {
+    this.getList()
+  },
+  methods: {
+    async getList() {
+
+      try{
+        const res = await getEmail()
+        if(res.data){
+          this.form = {...res.data}
+          this.activeRow = {...res.data}
+        }
+
+      }catch(e){
+        console.log(e)
+      }
+    },
+    resetForm() {
+      this.$refs.form.resetFields();
+      if (this.activeRow) {
+        this.form = { ...this.activeRow };
+      }
+    },
+    async setEmil() {
+      this.$refs.form.validate(async (some) => {
+        if (some) {
+          this.$confirm("是否保存邮件配置?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+            .then(async () => {
+              try {
+
+                const res = await resetEmail({...this.form});
+                this.$message.success("保存成功");
+                this.getList()
+              } catch (e) {
+                console.log(e);
+              }
+            })
+            .catch(() => {});
+        }
+      });
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+.form {
+  margin-top: 30px;
+}
+.infoTitle {
+  font-weight: 400;
+  margin-top: 30px;
+  font-size: 18px;
+}
+/deep/label {
+  font-weight: 400;
+}
+</style>