mo 4 years ago
parent
commit
ddab5283e0

+ 2 - 0
src/router/notKeepAliveList.js

@@ -9,4 +9,6 @@ export default [
   '/vipClassSet/branchActive',
   '/vipClassSet/branchActiveOperation',
   '/vipClassSet/vipChargeSeting',
+  '/vipClassSet/vipActiveList',
+  '/vipClassSet/vipNewActive'
 ]

+ 1 - 2
src/views/categroyManager/insideSetting/branchActive.vue

@@ -179,8 +179,7 @@ export default {
     },
     onReset() {
       this.$refs.searchForm.resetFields()
-      this.pageInfo.page = 1
-      this.getList()
+      this.onSearch()
     }
   }
 }

+ 90 - 73
src/views/categroyManager/vipActiveList.vue

@@ -5,10 +5,8 @@
     </h2>
 
     <div class="m-core">
-      <div class="newBand"
-           v-permission="'/vipNewActive'"
-           @click="gotoNewActive">新建</div>
-      <el-form :inline="true"
+      <el-button type="primary" style="margin-bottom: 20px" v-permission="'/vipNewActive'" @click="gotoNewActive">新建</el-button>
+      <save-form :inline="true"
                class="searchForm"
                ref='searchForm'
                :model="searchForm">
@@ -23,7 +21,7 @@
                      v-model.trim="searchForm.organId"
                      clearable
                      placeholder="请选择分部">
-            <el-option v-for="(item,index) in organList"
+            <el-option v-for="(item,index) in selects.branchs"
                        :key="index"
                        :label="item.name"
                        :value="item.id"></el-option>
@@ -44,13 +42,13 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="search"
-                     type="danger">搜索</el-button>
+                     type="primary">搜索</el-button>
         </el-form-item>
         <el-form-item>
-          <el-button type='primary'
+          <el-button type='danger'
                      @click="onReset">重置</el-button>
         </el-form-item>
-      </el-form>
+      </save-form>
       <div class="tableWrap">
         <el-table :data="tableList"
                   :header-cell-style="{background:'#EDEEF0',color:'#444'}">
@@ -59,7 +57,11 @@
                            label="活动编号"></el-table-column>
           <el-table-column align="center"
                            prop="name"
-                           label="活动名称"></el-table-column>
+                           label="活动名称">
+            <template slot-scope="scope">
+              <tooltip :content="scope.row.name"></tooltip>
+            </template>
+          </el-table-column>
           <el-table-column align="center"
                            prop="vipGroupCategoryNames"
                            label="适用课程形式"></el-table-column>
@@ -150,8 +152,8 @@
                     @pagination="getList" />
       </div>
     </div>
-    <el-dialog title="活动详情"
-               width="60%"
+    <el-dialog title="修改VIP活动"
+               width="650px"
                :before-close="closeVipform"
                :visible.sync="dialogVisible">
       <div>
@@ -161,19 +163,20 @@
                  :rules="resetFormRules"
                  class="vipform">
           <el-form-item label="活动名称"
+                        label-width="120px"
                         prop="name">
-            <el-input style="width:400px"
-                      disabled
+            <el-input disabled
                       v-model.trim="resetForm.name"></el-input>
           </el-form-item>
           <el-form-item label="适用分部"
+                        label-width="120px"
                         prop="organ">
             <el-select v-model.trim="resetForm.organ"
                        filterable
                        multiple
                        disabled
                        clearable>
-              <el-option v-for="(item,index) in organList"
+              <el-option v-for="(item,index) in selects.branchs"
                          :key="index"
                          :label="item.name"
                          :value="item.id"></el-option>
@@ -181,46 +184,51 @@
             <!-- <el-button @click="onCheckAllBranch">适用所有分部</el-button> -->
           </el-form-item>
           <el-form-item label="课程形式"
-                        prop="stauts">
+                        prop="stauts"
+                        label-width="120px">
             <el-select v-model.trim="resetForm.stauts"
                        filterable
                        clearable
                        disabled
                        multiple>
-              <el-option v-for="(item,index) in courseStatusList"
+              <el-option v-for="(item,index) in selects.vipGroupCategory"
                          :key="index"
                          :value="item.id"
                          :label="item.name"></el-option>
             </el-select>
           </el-form-item>
           <el-form-item label="活动描述"
-                        prop="desc">
+                        prop="desc"
+                        label-width="120px">
             <el-input type="textarea"
                       v-model.trim="resetForm.desc"
-                      style="width:400px"
                       :rows="5"
                       disabled
                       placeholder="请输入活动说明"></el-input>
           </el-form-item>
           <el-form-item label="活动时间"
-                        prop="activeTime">
+                        prop="activeTime"
+                        label-width="120px">
             <el-date-picker v-model.trim="resetForm.activeTime"
+                            style="width: 100%"
                             type="datetimerange"
                             range-separator="至"
                             value-format="yyyy-MM-dd HH:mm:ss"
                             :picker-options="{
-                            firstDayOfWeek:1
-                          }"
+                              firstDayOfWeek:1
+                            }"
                             start-placeholder="开始日期"
                             end-placeholder="结束日期"></el-date-picker>
           </el-form-item>
           <el-form-item label="课程时间"
-                        prop="courseTime">
+                        prop="courseTime"
+                        label-width="120px">
             <el-date-picker v-model.trim="resetForm.courseTime"
+                            style="width: 100%"
                             type="datetimerange"
                             :picker-options="{
-                            firstDayOfWeek:1
-                          }"
+                              firstDayOfWeek:1
+                            }"
                             range-separator="至"
                             value-format="yyyy-MM-dd HH:mm:ss"
                             start-placeholder="开始日期"
@@ -228,10 +236,16 @@
           </el-form-item>
 
         </el-form>
+        <el-alert
+          title="活动适用范围"
+          type="info"
+          :closable="false"
+          class="alert">
+        </el-alert>
         <div class="activeRange">
-          <div class="left">
+          <!-- <div class="left">
             <p>活动适用范围&结算标准:</p>
-          </div>
+          </div> -->
           <div class="right">
             <div class="chioseWrap">
               <el-checkbox label="线上课"
@@ -322,10 +336,17 @@
             </div>
           </div>
         </div>
+        <el-alert
+          title="活动类型"
+          type="info"
+          :closable="false"
+          style="margin-bottom: 15px;"
+          class="alert">
+        </el-alert>
         <div class="activeType">
-          <div class="left">
+          <!-- <div class="left">
             <p style="width:60px;">活动类型</p>
-          </div>
+          </div> -->
           <div class="right">
             <div>
               <!--  @click="activeType='BASE_ACTIVITY'" -->
@@ -386,9 +407,10 @@ import {
   removeVipActive
 } from "@/api/vipSeting";
 import { getEmployeeOrgan } from "@/api/buildTeam";
+import Tooltip from '@/components/Tooltip'
 export default {
   name: "vipActiveList",
-  components: { pagination },
+  components: { pagination, Tooltip },
   data () {
     return {
       labelPosition: "right",
@@ -454,13 +476,15 @@ export default {
       isReset: false
     };
   },
-  created () {
+  // created () {
+  //   this.init();
+  // },
+  // activated () {
+  //   this.init();
+  // },
+  mounted () {
     this.init();
   },
-  activated () {
-    this.init();
-  },
-  mounted () { },
   filters: {
     onlinePip (val) {
       let obj = JSON.parse(val);
@@ -575,35 +599,38 @@ export default {
     }
   },
   methods: {
-    init () {
-      if (this.$route.query.searchForm) {
-        this.$route.query.searchForm instanceof Object
-          ? (this.searchForm = this.$route.query.searchForm)
-          : (this.searchForm = JSON.parse(this.$route.query.searchForm));
-      }
-      if (this.$route.query.rules) {
-        this.$route.query.rules instanceof Object
-          ? (this.rules = this.$route.query.rules)
-          : (this.rules = JSON.parse(this.$route.query.rules));
-      }
-      getEmployeeOrgan().then(res => {
-        if (res.code == 200) {
-          this.organList = res.data;
-        }
-      });
+    async init () {
+      // if (this.$route.query.searchForm) {
+      //   this.$route.query.searchForm instanceof Object
+      //     ? (this.searchForm = this.$route.query.searchForm)
+      //     : (this.searchForm = JSON.parse(this.$route.query.searchForm));
+      // }
+      // if (this.$route.query.rules) {
+      //   this.$route.query.rules instanceof Object
+      //     ? (this.rules = this.$route.query.rules)
+      //     : (this.rules = JSON.parse(this.$route.query.rules));
+      // }
+      // getEmployeeOrgan().then(res => {
+      //   if (res.code == 200) {
+      //     this.organList = res.data;
+      //   }
+      // });
+      // 获取类型
+      await this.$store.dispatch('setVipGroupCategory')
+      // 获取分部
+      await this.$store.dispatch('setBranchs')
       this.getList();
       // 首先获取课程形式
       // 获取分部id
-      vipGroupCategory().then(res => {
-        if (res.code == 200) {
-          this.courseStatusList = res.data;
-        }
-      });
+      // vipGroupCategory().then(res => {
+      //   if (res.code == 200) {
+      //     this.courseStatusList = res.data;
+      //   }
+      // });
     },
     loadNumber (event) {
       var el = event.currentTarget;
       var elValue = el.value;
-      console.log(elValue)
       var reg = /^((?!0)\d{1,2}|100)$/;
       if (!elValue.match(reg)) {
         elValue = "";
@@ -623,15 +650,12 @@ export default {
     },
     search () {
       this.rules.page = 1;
-      this.getList();
+      this.$refs.searchForm.validate(valid => {
+        this.getList()
+      })
     },
     onReset () {
-      // this.searchForm = {
-      //   enable: null,
-      //   search: null,
-      //   organId: null,
-      // }
-      this.$refs['searchForm'].resetFields();
+      this.$refs.searchForm.resetFields()
       this.search()
     },
     getList () {
@@ -730,10 +754,9 @@ export default {
         this.resetForm.courseTime = [row.coursesStartTime, row.coursesEndTime];
       }
       // 同步适用范围
-      let obj = JSON.parse(row.salarySettlementJson);
+      let obj = row.salarySettlementJson ? JSON.parse(row.salarySettlementJson) : {};
       // 同步线上课状态
       obj.onlineSalarySettlement ? (this.online = true) : (this.online = false);
-      console.log(obj.onlineSalarySettlement)
       if (obj.onlineSalarySettlement) {
         this.onlineSalary = obj.salarySettlementType;
         if (obj.onlineSalarySettlement.settlementValue) {
@@ -899,11 +922,8 @@ export default {
     },
     gotoNewActive () {
       // 带参数 searchForm: { organId: null } 搜索条件
-      let rules = JSON.stringify(this.rules);
-      let searchForm = JSON.stringify(this.searchForm);
       this.$router.push({
-        path: "/vipClassSet/vipNewActive?type=create",
-        query: { rules, searchForm }
+        path: "/vipClassSet/vipNewActive?type=create"
       });
     },
     closeVipform () {
@@ -990,10 +1010,7 @@ export default {
 }
 .vipform {
   .el-select {
-    width: 400px !important;
-    .el-input__inner {
-      width: 400px;
-    }
+    width: 100% !important;
   }
 }
 .ishidden {

+ 1 - 1
src/views/categroyManager/vipChargeSeting.vue

@@ -22,7 +22,7 @@
         </el-form-item>
         <el-form-item>
           <el-button @click="search"
-                     type="danger">搜索</el-button>
+                     type="primary">搜索</el-button>
         </el-form-item>
       </save-form>
       <div class="tableWrap">

+ 44 - 28
src/views/categroyManager/vipNewActive.vue

@@ -9,6 +9,7 @@
       <el-form :label-position="labelPosition"
                :model="vipform"
                ref="vipform"
+               label-width="120px"
                :rules="vipformRules"
                class="vipform">
         <el-form-item label="活动名称"
@@ -24,7 +25,7 @@
                      @visible-change="$forceUpdate()"
                      @change="onOrganChange"
                      clearable>
-            <el-option v-for="(item,index) in organList"
+            <el-option v-for="(item,index) in selects.branchs"
                        :key="index"
                        :label="item.name"
                        :value="item.id"></el-option>
@@ -37,7 +38,7 @@
                      @visible-change="$forceUpdate()"
                      clearable
                      multiple>
-            <el-option v-for="item in courseStatusList"
+            <el-option v-for="item in selects.vipGroupCategory"
                        :key="item.id"
                        :value="item.id"
                        :label="item.name"></el-option>
@@ -75,12 +76,17 @@
                           }"
                           end-placeholder="结束日期"></el-date-picker>
         </el-form-item>
-
       </el-form>
-      <div class="activeRange">
-        <div class="left">
+      <el-alert
+        title="活动适用范围&结算标准:"
+        type="info"
+        :closable="false"
+        class="alert">
+      </el-alert>
+      <div class="activeRange" style="padding-left: 120px;">
+        <!-- <div class="left">
           <p>活动适用范围&结算标准:</p>
-        </div>
+        </div> -->
         <div class="right">
           <div class="chioseWrap">
             <el-checkbox label="线上课"
@@ -160,10 +166,17 @@
           </div>
         </div>
       </div>
+      <el-alert
+        title="活动类型:"
+        type="info"
+        style="margin-bottom: 15px;"
+        :closable="false"
+        class="alert">
+      </el-alert>
       <div class="activeType">
-        <div class="left">
+        <!-- <div class="left">
           <p>活动类型</p>
-        </div>
+        </div> -->
         <div class="right">
           <div>
             <div class="head"
@@ -213,12 +226,11 @@
         </div>
       </div>
     </div>
-    <div class="btnWrap"
-         style="justify-content:flex-start">
-      <div class="closeBtn"
-           @click="onReSet">重置</div>
-      <div class="okBtn"
-           @click="submitFrom">确定</div>
+    <div class="btnWrap" style="justify-content:flex-start; padding-left: 120px">
+      <el-button type="info" @click="onReSet">重置</el-button>
+      <el-button type="primary" @click="submitFrom">确定</el-button>
+      <!-- <div class="okBtn"
+           @click="submitFrom">确定</div> -->
     </div>
   </div>
 </template>
@@ -230,7 +242,7 @@ export default {
   data () {
     return {
       pageType: '',
-      labelPosition: "left",
+      labelPosition: "right",
       vipform: {
         name: "",
         desc: "",
@@ -293,19 +305,23 @@ export default {
     this.$refs.vipform.resetFields();
   },
 
-  mounted () {
+  async mounted () {
     // 首先获取课程形式
-    vipGroupCategory().then(res => {
-      if (res.code == 200) {
-        this.courseStatusList = res.data;
-      }
-    });
-    // 适用分部
-    getEmployeeOrgan().then(res => {
-      if (res.code == 200) {
-        this.organList = res.data;
-      }
-    });
+    // vipGroupCategory().then(res => {
+    //   if (res.code == 200) {
+    //     this.courseStatusList = res.data;
+    //   }
+    // });
+    // // 适用分部
+    // getEmployeeOrgan().then(res => {
+    //   if (res.code == 200) {
+    //     this.organList = res.data;
+    //   }
+    // });
+    // 获取类型
+    await this.$store.dispatch('setVipGroupCategory')
+    // 获取分部
+    await this.$store.dispatch('setBranchs')
     this.onReSet()
     if (this.$route.query.rules) {
       this.rules = this.$route.query.rules;
@@ -423,7 +439,7 @@ export default {
       // 选择所有分部
       let vipform = this.vipform
       vipform.organ = [];
-      this.organList.forEach(item => {
+      this.selects.branchs.forEach(item => {
         vipform.organ.push(item.id);
       });
       this.$forceUpdate()