lex-xin 5 лет назад
Родитель
Сommit
58327eba41

+ 5 - 5
src/views/categroyManager/insideSetting/branchManager.vue

@@ -82,9 +82,8 @@
         <el-form-item label="手机号" prop="mobileNo" :label-width="formLabelWidth">
           <el-input v-model.number="form.mobileNo" autocomplete="off"></el-input>
         </el-form-item>
-        <el-form-item label="手机号" prop="ownershipType" :label-width="formLabelWidth">
-          <el-input v-model.number="form.ownershipType" autocomplete="off"></el-input>
-          <el-select v-model="form.subjectIds">
+        <el-form-item label="权属类型" prop="ownershipType" :label-width="formLabelWidth">
+          <el-select v-model="form.ownershipType">
               <el-option label="自有" value="OWN"></el-option>
               <el-option label="合作" value="COOPERATIO"></el-option>
               <el-option label="租赁" value="LEASE"></el-option>
@@ -143,7 +142,7 @@ export default {
           {required: true, message: '请输入手机号', trigger: 'blur'},
           { type: 'number', message: '手机号必须为数字'},
         ],
-        ownershipType: [{ required: true, message: '请选择权属类型' }]
+        ownershipType: [{ required: true, message: '请选择权属类型', trigger: 'change' }]
       },
       
     }
@@ -222,7 +221,8 @@ export default {
         linkman: null, // 来源
         job: null,  // 费用
         mobileNo: null, // 合作单位
-        ownershipType: null
+        ownershipType: null,
+        organId: store.getters.organ
       }
       this.teachingStatus = true
       this.formActionTitle = type

+ 84 - 49
src/views/teacherManager/teacherDetail/components/salarySet.vue

@@ -13,22 +13,24 @@
           </el-table-column>
           <el-table-column label="主教课酬">
             <template slot-scope="scope">
-              <el-input v-model="scope.row.mainTeacherSalary" placeholder="请输入内容"></el-input>
+              <el-input v-model="scope.row.mainTeacherSalary" placeholder="请输入课酬"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="助教课酬">
             <template slot-scope="scope">
-              <el-input v-model="scope.row.assistantTeacherSalary" placeholder="请输入内容"></el-input>
+              <el-input v-model="scope.row.assistantTeacherSalary" placeholder="请输入课酬"></el-input>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="100px">
+          <!-- <el-table-column label="操作" width="100px">
             <template slot-scope="scope">
               <el-button @click="onMusicGroupSave2(scope.row)" type="text">保存</el-button>
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
 
-        <h3>单次课次参考时长:30min</h3>
+        <h3>单次课次参考时长:30min
+          <el-button @click="onVIPSave()" type="text">保存</el-button>
+        </h3>
         <el-table :data='vipTable'
                   :header-cell-style="{background:'#EDEEF0',color:'#444'}">
           <el-table-column label="VIP课课酬参考值" prop="vipGroupCategoryName">
@@ -43,15 +45,17 @@
               <el-input v-model="scope.row.offlineClassesSalary" placeholder="请输入内容"></el-input>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="100px">
+          <!-- <el-table-column label="操作" width="100px">
             <template slot-scope="scope">
               <el-button @click="onVIPSave(scope.row)" type="text">保存</el-button>
             </template>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
       </div>
       <div class="right">
-        <h3>乐团课梯度课酬结算</h3>
+        <h3>乐团课梯度课酬结算
+          <el-button @click="onMusicGroupSave()" type="text">保存</el-button>
+        </h3>
         <el-table :data="musicGroupTable" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
           <el-table-column label="">
             <template slot-scope="scope">
@@ -64,20 +68,24 @@
           </el-table-column>
           <el-table-column label="主教课酬">
             <template slot-scope="scope">
-              <el-input v-model="scope.row.mainTeacherSalary" placeholder="请输入内容"></el-input>
+              <el-input v-model="scope.row.mainTeacherSalary" placeholder="请输入课酬"></el-input>
             </template>
           </el-table-column>
           <el-table-column label="助教课酬">
             <template slot-scope="scope">
-              <el-input v-model="scope.row.assistantTeacherSalary" placeholder="请输入内容"></el-input>
+              <el-input v-model="scope.row.assistantTeacherSalary" placeholder="请输入课酬"></el-input>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="100px">
+          <!-- <el-table-column label="操作" width="100px">
             <template slot-scope="scope">
               <el-button @click="onMusicGroupSave(scope.row)" type="text">保存</el-button>
             </template>
-          </el-table-column>
+          </el-table-column> -->
+          <!-- <template slot="append" style="text-align: right;">
+            <el-button @click="onMusicGroupSave(scope.row)" type="text">保存</el-button>
+          </template> -->
         </el-table>
+        
       </div>
     </div>
   </div>
@@ -105,7 +113,7 @@ export default {
       // 获取课程形态 设置vip课酬
       vipGroupCategory({ organId: this.$store.getters.organ }).then(res => {
         if (res.code == 200) {
-          this.vipList = res.data
+          // this.vipList = res.data
           let vipData = res.data
           // VIP课列表
           vipGroupSalaryList({
@@ -154,8 +162,10 @@ export default {
                     courseScheduleType: courseScheduleType,
                     durationMax: type.max,
                     durationMin: type.min,
-                    mainTeacherSalary: 0,
-                    assistantTeacherSalary: 0
+                    mainTeacherSalary: null,
+                    assistantTeacherSalary: null,
+                    userId: this.teacherId,
+                    settlementType: 'GRADIENT_SALARY'
                   })
                 })
               }
@@ -179,6 +189,10 @@ export default {
       })
     },
     vipListCompare(vipData, rows) { // vip 做对比
+      // console.log('start------------------')
+      // console.log(vipData)
+      // console.log(rows)
+      // console.log('end------------------')
       if(!vipData) { // 判断是否有数据
         this.vipTable = rows
         return
@@ -213,43 +227,57 @@ export default {
       this.vipTable = result
     },
     teacherSalaryList(domain, rows) {
-      console.log(domain)
-      console.log(rows)
       if(domain.length <= 0) { // 判断后台是否有设置
         this.musicGroupTable = rows
         return
       }
+      if(!rows || rows.length <= 0) {
+        this.musicGroupTable = domain
+      }
       let result = []
       domain.forEach(item => {
-        if(rows) {
-          rows.forEach(c => {
-            if(item.paramName == c.settlementType && item.max == c.durationMax && item.min == c.durationMin) {
-              result.push({
-                id: c.id,
-                durationMax: c.durationMax,
-                durationMin: c.durationMin,
-                mainTeacherSalary: c.mainTeacherSalary,
-                assistantTeacherSalary: c.assistantTeacherSalary,
-                courseScheduleType: c.courseScheduleType
-              })
-            }
-          })
-        } else {
-          result.push({
-            durationMax: item.max,
-            durationMin: item.min,
-            assistantTeacherSalary: null,
-            mainTeacherSalary: null,
-            courseScheduleType: item.paramName
-          })
-        }
+        rows.forEach(c => {
+          if(item.courseScheduleType == c.courseScheduleType && item.durationMax == c.durationMax && item.durationMin == c.durationMin) {
+            item.checked = true
+            result.push({
+              durationMax: c.durationMax,
+              durationMin: c.durationMin,
+              mainTeacherSalary: c.mainTeacherSalary,
+              assistantTeacherSalary: c.assistantTeacherSalary,
+              courseScheduleType: c.courseScheduleType,
+              userId: this.teacherId,
+              settlementType: 'GRADIENT_SALARY'
+            })
+          }
+        })
       })
-      // 
-      if(rows) {
-        
+      // console.log(result)
+      // console.log(domain)
+      if(result.length > 0) {
+        domain.forEach(item => {
+
+        })
+        // result.forEach(item => {
+        //   domain.forEach(c => {
+        //     if(item.courseScheduleType == c.courseScheduleType && item.durationMax == c.durationMax && item.durationMin == c.durationMin) {
+        //     } else {
+        //       result.push({
+        //         durationMax: c.durationMax,
+        //         durationMin: c.durationMin,
+        //         mainTeacherSalary: c.mainTeacherSalary,
+        //         assistantTeacherSalary: c.assistantTeacherSalary,
+        //         courseScheduleType: c.courseScheduleType,
+        //         userId: this.teacherId,
+        //         settlementType: 'GRADIENT_SALARY'
+        //       })
+        //     }
+        //   })
+        // })
+      } else {
+        result = domain
       }
-      console.log(result)
-      // this.musicGroupTable = result
+      // console.log(result)
+      this.musicGroupTable = result
     },
     onVIPSave(row) { // vip保存
       vipGroupSalarySet({
@@ -266,11 +294,18 @@ export default {
       })
     },
     onMusicGroupSave(row) {
-      teacherSalaryBatchUpset([{
-        id: row.id,
-        mainTeacherSalary: row.mainTeacherSalary,
-        assistantTeacherSalary: row.assistantTeacherSalary
-      }]).then(res => {
+      let musicGroupTable = this.musicGroupTable
+      let checkStatus = true
+      musicGroupTable.forEach(item => {
+        if(item.assistantTeacherSalary < 0 || item.mainTeacherSalary < 0) {
+          this.$message('输入课酬不能为负数')
+          checkStatus = false
+        }
+      })
+      // 判断输入的值是否正确
+      if(!checkStatus) return false
+      // return 
+      teacherSalaryBatchUpset(musicGroupTable).then(res => {
         if(res.code == 200) {
           this.$message({
             message: '保存成功',