Browse Source

老师列表修改

lex-xin 5 years ago
parent
commit
31dd8fb652

+ 1 - 1
src/App.vue

@@ -196,7 +196,7 @@ input[type="number"] {
   padding: 18px 60px 40px;
   // height: calc(100vh- 80px) !important;
   // height: calc(100vh - 70px);
-  width: 100;
+  width: 100%;
   min-width: 1440px;
   // overflow: auto;
   .m-core {

+ 1 - 1
src/router/index.js

@@ -83,7 +83,7 @@ export const asyncRoutes = {
   // 教师管理
   teacherList: () => import('@/views/teacherManager/teacherList'),
   // 新增&修改教师
-  teacherOperation: () => import('@/views/teacherManager/teacherOperation'),
+  teacherOperation: () => import('@/views/teacherManager/teacherOperation/index'),
   // 老师详情
   teacherDetail: () => import('@/views/teacherManager/teacherDetail/index'),
   // 学员管理

+ 3 - 9
src/views/teacherManager/teacherDetail/index.vue

@@ -37,10 +37,6 @@
                      name="6">
           <settlement v-if="activeStatus[6]" />
         </el-tab-pane>
-        <el-tab-pane label="课酬设置"
-                     name="7">
-          <salarySet v-if="activeStatus[7]" />
-        </el-tab-pane>
       </el-tabs>
     </div>
   </div>
@@ -53,18 +49,16 @@ import courseInfo from '@/views/teacherManager/teacherDetail/components/courseIn
 import courseInfo1 from '@/views/teacherManager/teacherDetail/components/courseInfo1'
 import courseInfo2 from '@/views/teacherManager/teacherDetail/components/courseInfo2'
 import settlement from '@/views/teacherManager/teacherDetail/components/settlement'
-import salarySet from '@/views/teacherManager/teacherDetail/components/salarySet'
 export default {
   components: { teacherRecord, 
   leaveRecord, teacherInfo, 
-  courseInfo, courseInfo1, courseInfo2, settlement, 
-  salarySet },
+  courseInfo, courseInfo1, courseInfo2, settlement},
   name: 'teacherDetail',
   data () {
     return {
       teacherName: this.$route.query.teacherName,
-      activeName: "7",
-      activeStatus: [false, false, false, false, false, false, false, true]
+      activeName: "0",
+      activeStatus: [true, false, false, false, false, false, false]
     }
   },
   methods: {

+ 24 - 34
src/views/teacherManager/teacherDetail/components/salarySet.vue → src/views/teacherManager/teacherOperation/components/salarySet.vue

@@ -3,9 +3,6 @@
     <!-- <h4>单次课次参考时长:30min</h4> -->
     <div class="tableList">
       <div class="left">
-        <h3>
-          <el-button @click="onMusicGroupSave2()" type="text">保存</el-button>
-        </h3>
         <el-table :data='teamTable'
                   :header-cell-style="{background:'#EDEEF0',color:'#444'}">
           <el-table-column label="乐团课课酬课时结算">
@@ -35,9 +32,7 @@
           </el-table-column>
         </el-table>
 
-        <h3>单次课次参考时长:30min
-          <el-button @click="onVIPSave()" type="text">保存</el-button>
-        </h3>
+        <h3>单次课次参考时长:30min</h3>
         <el-table :data='vipTable' style="width: 70%"
                   :header-cell-style="{background:'#EDEEF0',color:'#444'}">
           <el-table-column label="VIP课课酬参考值" prop="vipGroupCategoryName">
@@ -53,6 +48,10 @@
             </template>
           </el-table-column>
         </el-table>
+
+        <div style="padding-top: 10px;">
+          <el-button @click="onSave()" type="primary">保存</el-button>
+        </div>
       </div>
     </div>
   </div>
@@ -62,9 +61,10 @@ import { vipGroupSalaryList, vipGroupSalarySet, teacherSalaryList, teacherSalary
 import { sysConfigList } from '@/api/generalSettings'
 import { vipGroupCategory } from '@/api/vipSeting'
 export default {
+  props: ['teacherId'],
   data () {
     return {
-      teacherId: this.$route.query.teacherId,
+      // teacherId: this.teacherId ? this.teacherId : this.$route.query.teacherId,
       teamTable: [{
         assistantTeacher30MinSalary: 0,
         assistantTeacher90MinSalary: 0,
@@ -122,6 +122,7 @@ export default {
     }
   },
   mounted() {
+    console.log(this.teacherId)
     this.__init()
   },
   methods: {
@@ -129,15 +130,11 @@ export default {
       // 获取课程形态 设置vip课酬
       vipGroupCategory({ organId: this.$store.getters.organ }).then(res => {
         if (res.code == 200 && res.data.length > 0) {
-          // this.vipList = res.data
-          // let vipData = res.data
           let vipData = []
           res.data.forEach(item => {
             vipData.push({
               offlineClassesSalary: null,
-              // offlineClassesSalary: item.offlineClassesUnitPrice,
               onlineClassesSalary: null,
-              // onlineClassesSalary: item.onlineClassesUnitPrice,
               vipGroupCategoryId: item.id,
               vipGroupCategoryName: item.name,
               userId: this.teacherId
@@ -234,26 +231,7 @@ export default {
       }
       this.teamTable = result
     },
-    onVIPSave() { // vip保存
-      let checkStatus = true
-      this.vipTable.forEach(item => {
-        if(item.offlineClassesSalary < 0 && item.onlineClassesSalary < 0) {
-          this.$message('输入课酬不能为负数')
-          checkStatus = false
-        }
-      })
-      // 判断输入的值是否正确
-      if(!checkStatus) return false
-      vipGroupSalarySet(this.vipTable).then(res => {
-        if(res.code == 200) {
-          this.$message({
-            message: '保存成功',
-            type: 'success'
-          })
-        }
-      })
-    },
-    onMusicGroupSave2() {
+    onSave() {
       let teamTable = this.teamTable
       let checkStatus = true
       teamTable.forEach(item => {
@@ -267,9 +245,21 @@ export default {
       if(!checkStatus) return false
       teacherSalaryBatchUpset(teamTable).then(res => {
         if(res.code == 200) {
-          this.$message({
-            message: '保存成功',
-            type: 'success'
+          this.vipTable.forEach(item => {
+            if(item.offlineClassesSalary < 0 && item.onlineClassesSalary < 0) {
+              this.$message('输入课酬不能为负数')
+              checkStatus = false
+            }
+          })
+          // 判断输入的值是否正确
+          if(!checkStatus) return false
+          vipGroupSalarySet(this.vipTable).then(res => {
+            if(res.code == 200) {
+              this.$message({
+                message: '保存成功',
+                type: 'success'
+              })
+            }
           })
         }
       })

+ 8 - 3
src/views/teacherManager/teacherOperation.vue → src/views/teacherManager/teacherOperation/components/teacherOperation.vue

@@ -1,8 +1,8 @@
 <template>
   <div class='m-container'>
-    <h2>
+    <!-- <h2>
       <el-page-header @back="onCancel" :content="'老师' + (pageType == 'create' ? '新增' : '修改')"></el-page-header>
-    </h2>
+    </h2> -->
     <div class="infoWrap">
         <div class="left">
             <h4>基本信息</h4>
@@ -327,6 +327,10 @@ export default {
                         delete this.topForm.id
                     }
                     teacherAdd(this.topForm).then(res => {
+                        if(res.code == 200) {
+                            console.log(res)
+                            this.$emit('onTeacher', res.data)
+                        }
                         this.messageTips('添加', res)
                     })
                 }
@@ -341,8 +345,9 @@ export default {
           message: title + '成功',
           type: 'success'
         })
-        this.$router.push('/business/teacherList')
+        // this.$router.push('/business/teacherList')
       } else {
+        this.topForm.subjectId = []
         this.$message.error(res.msg)
       }
     },

+ 63 - 0
src/views/teacherManager/teacherOperation/index.vue

@@ -0,0 +1,63 @@
+<template>
+  <div class='m-container'>
+    <h2><el-page-header @back="onCancel" :content="'老师' + (pageType == 'create' ? '新增' : '修改')"></el-page-header></h2>
+    <div class="m-core">
+      <el-tabs v-model="activeName"
+               type="card"
+               @tab-click="handleClick">
+        <el-tab-pane label="基本信息"  :disabled="isCreate"
+                     name="0">
+          <teacherOperation @onTeacher="onTeacher" v-if="activeStatus[0]" />
+        </el-tab-pane>
+        <el-tab-pane label="课酬设置"
+                     name="1" :disabled="isTeacher">
+          <salarySet :teacherId="teacherId" v-if="activeStatus[1]" />
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </div>
+</template>
+<script>
+import teacherOperation from './components/teacherOperation'
+import salarySet from './components/salarySet'
+export default {
+  components: { teacherOperation, salarySet },
+  name: 'vipDetail',
+  data () {
+    return {
+        pageType: this.$route.query.type,
+        teacherId: this.$route.query.teacherId,
+        activeName: '0',
+        activeStatus: [true, false],
+        isTeacher: true,
+        isCreate: false
+    }
+  },
+  mounted () {
+      if(this.teacherId) {
+          this.isTeacher = false
+      }
+  },
+  methods: {
+    handleClick (val) {
+      this.activeName = val.name
+      this.activeStatus[val.name] = true
+    },
+    onCancel() {
+      this.$router.push('/business/teacherList')
+    },
+    onTeacher(id) {
+        if(id) {
+            this.isCreate = true // 当保存课酬时基本信息不能点
+            this.isTeacher = false
+            this.teacherId = id
+            this.activeName = "1"
+            this.activeStatus[1] = true
+        }
+    }
+  },
+  
+}
+</script>
+<style lang="scss">
+</style>

+ 1 - 0
src/views/vipClass/vipDetail/components/fnanceInfo.vue

@@ -131,6 +131,7 @@ export default {
           this.totalFeeDeduction = res.data.baseInfo.totalFeeDeduction;
           this.feeDeductionNum = res.data.baseInfo.feeDeductionNum;
           this.totalSalary = res.data.baseInfo.totalSalary;
+          this.rules.total = res.data.pageInfo.total
         }
       })
     }

+ 1 - 1
src/views/vipClass/vipDetail/index.vue

@@ -14,7 +14,7 @@
                      name="2">
           <teacherRecord />
         </el-tab-pane>
-        <el-tab-pane label="vip课程财务"
+        <el-tab-pane label="VIP课程财务"
                      name="3">
           <fnanceInfo />
         </el-tab-pane>

+ 0 - 1
src/views/vipClass/vipList.vue

@@ -201,7 +201,6 @@ export default {
       params.page = this.rules.page
       params.rows = this.rules.limit
       params.organId = this.organId
-      console.log(params)
       getVipList(params).then(res => {
         if (res.code == 200) {
           this.tableData = res.data.rows

+ 2 - 2
vue.config.js

@@ -17,10 +17,10 @@ const name = defaultSettings.title || 'vue Admin Template' // page title
 // http://47.99.212.176:8000
 // 
 // let target = 'http://192.168.3.27:8000' // 箭河
-// let target = 'http://192.168.3.28:8000' //邹璇
+let target = 'http://192.168.3.28:8000' //邹璇
 // let target = 'http://192.168.3.8:8000' //勇哥
 // let target = 'http://47.99.212.176:8000' // 测试服
-let target = 'http://192.168.3.48:8000' // 乔
+// let target = 'http://192.168.3.48:8000' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**