Browse Source

优化课程收费设置

lex-xin 4 years ago
parent
commit
2df7a8fcbc
2 changed files with 19 additions and 17 deletions
  1. 2 1
      src/router/notKeepAliveList.js
  2. 17 16
      src/views/categroyManager/vipChargeSeting.vue

+ 2 - 1
src/router/notKeepAliveList.js

@@ -7,5 +7,6 @@ export default [
   // '/operateManager/HumanResources'
   '/vipClassSet/vipParameterManager',
   '/vipClassSet/branchActive',
-  '/vipClassSet/branchActiveOperation'
+  '/vipClassSet/branchActiveOperation',
+  '/vipClassSet/vipChargeSeting'
 ]

+ 17 - 16
src/views/categroyManager/vipChargeSeting.vue

@@ -4,16 +4,17 @@
       <div class="squrt"></div>VIP课程收费设置
     </h2>
     <div class="m-core">
-      <el-form :inline="true"
+      <save-form :inline="true"
+               ref="searchForm"
                class="searchForm"
-               v-model.trim="searchForm">
+               :model.sync="searchForm">
         <el-form-item prop='organId'>
           <el-select class='multiple'
                      style="width:180px!important"
                      v-model.trim="searchForm.organId"
                      filterable
                      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>
@@ -23,7 +24,7 @@
           <el-button @click="search"
                      type="danger">搜索</el-button>
         </el-form-item>
-      </el-form>
+      </save-form>
       <div class="tableWrap">
         <el-table :data="dataList"
                   style="width:720px;"
@@ -67,6 +68,7 @@
 <script>
 import { vipGroupCategory, defaultClassesUnitPrice } from '@/api/vipSeting'
 import { getEmployeeOrgan } from '@/api/buildTeam'
+import { Searchs } from '@/helpers'
 export default {
   name: 'vipChargeSeting',
   data () {
@@ -78,23 +80,22 @@ export default {
       }
     }
   },
-  mounted () {
+  async mounted () {
     // 获取课程形态 设置vip课酬
-    getEmployeeOrgan().then(res => {
-      if (res.code == 200) {
-        this.organList = res.data;
-        this.searchForm.organId = this.organList[0].id;
-        if (this.organList[0].id) {
-          this.getList();
-        }
-      }
-    })
-    // this.getList();
+    // 获取分部
+    await this.$store.dispatch('setBranchs')
+    // 获取缓存的分部编号
+    const searchs = new Searchs(this.$route.fullPath)
+    const branchId = searchs.searchs[searchs.key]?.form.organId
+    this.searchForm.organId = branchId ? branchId : this.selects?.branchs[0]['id']
+    this.search()
 
   },
   methods: {
     search () {
-      this.getList();
+      this.$refs.searchForm.validate(valid => {
+        this.getList()
+      })
     },
     getList () {
       vipGroupCategory({ organId: this.searchForm.organId }).then(res => {