|
@@ -1,30 +1,81 @@
|
|
|
<template>
|
|
|
<div class="salarySet">
|
|
|
- <h4>单次课次参考时长:30min</h4>
|
|
|
+ <!-- <h4>单次课次参考时长:30min</h4> -->
|
|
|
<div class="tableList">
|
|
|
<div class="left">
|
|
|
+ <h3>单次课次参考时长:30min</h3>
|
|
|
<el-table :data='teamTable'
|
|
|
:header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
- <el-table-column label="乐团课酬参考值">
|
|
|
+ <el-table-column label="乐团课课酬课时结算">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.courseScheduleType | coursesType }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="主教单课次课酬">
|
|
|
+ <el-table-column label="主教课酬">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.mainTeacherSalary" placeholder="请输入内容"></el-input>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="助教单课次课酬">
|
|
|
+ <el-table-column label="助教课酬">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.assistantTeacherSalary" placeholder="请输入内容"></el-input>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
+ <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>
|
|
|
- </div>
|
|
|
- <div class="right">
|
|
|
+
|
|
|
+ <h3>单次课次参考时长:30min</h3>
|
|
|
<el-table :data='vipTable'
|
|
|
:header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
- <el-table-column label="VIP课酬参考值">
|
|
|
+ <el-table-column label="VIP课课酬参考值" prop="vipGroupCategoryName">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="线上课">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.onlineClassesSalary" placeholder="请输入内容"></el-input>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="线下课">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input v-model="scope.row.offlineClassesSalary" placeholder="请输入内容"></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <h3>乐团课梯度课酬结算</h3>
|
|
|
+ <el-table :data="musicGroupTable" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column label="">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.courseScheduleType | coursesType }}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="操作">
|
|
|
+ <el-table-column label="最小值/分钟" prop="durationMin">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="最大值/分钟" prop="durationMax">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="主教课酬">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <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>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <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>
|
|
|
</div>
|
|
@@ -32,29 +83,237 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { vipGroupSalaryList, vipGroupSalarySet, teacherSalaryList, teacherSalaryBatchUpset } from '@/api/teacherManager'
|
|
|
+import { sysConfigList } from '@/api/generalSettings'
|
|
|
+import { vipGroupCategory } from '@/api/vipSeting'
|
|
|
export default {
|
|
|
data () {
|
|
|
return {
|
|
|
+ teacherId: this.$route.query.teacherId,
|
|
|
teamTable: [],
|
|
|
- vipTable: []
|
|
|
+ vipTable: [],
|
|
|
+ musicGroupTable: [],
|
|
|
+ ruleList: [],
|
|
|
+ vipList: []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.__init()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ __init() {
|
|
|
+ // 获取课程形态 设置vip课酬
|
|
|
+ vipGroupCategory({ organId: this.$store.getters.organ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.vipList = res.data
|
|
|
+ let vipData = res.data
|
|
|
+ // VIP课列表
|
|
|
+ vipGroupSalaryList({
|
|
|
+ rows: 9999,
|
|
|
+ page: 1,
|
|
|
+ teacherId: this.teacherId
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ let rows = res.data.rows
|
|
|
+ this.vipListCompare(vipData, rows)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 乐团
|
|
|
+ teacherSalaryList({
|
|
|
+ rows: 9999,
|
|
|
+ page: 1,
|
|
|
+ teacherId: this.teacherId,
|
|
|
+ settlementType: 'FIXED_SALARY'
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.teamTable = res.data.rows
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 乐团梯度结算
|
|
|
+ sysConfigList({ group: 'settlement_rule' }).then(res => {
|
|
|
+ if(res.code == 200 && res.data.length > 0) {
|
|
|
+ let domain = []
|
|
|
+ res.data.forEach(item => {
|
|
|
+ let paramName
|
|
|
+ if(item.paramName == 'sigle_gradient_settlement_rule') {
|
|
|
+ paramName = "SINGLE"
|
|
|
+ }
|
|
|
+ if(item.paramName == "max_gradient_settlement_rule") {
|
|
|
+ paramName = "MIX"
|
|
|
+ }
|
|
|
+ if(item.paramName == "high_gradient_settlement_rule") {
|
|
|
+ paramName = "HIGH"
|
|
|
+ }
|
|
|
+ if(item.paranValue) {
|
|
|
+ let value = JSON.parse(item.paranValue)
|
|
|
+ value.forEach(type => {
|
|
|
+ domain.push({
|
|
|
+ paramName: paramName,
|
|
|
+ max: type.max,
|
|
|
+ min: type.min
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // this.ruleList.push(domain)
|
|
|
+
|
|
|
+ // 乐团
|
|
|
+ teacherSalaryList({
|
|
|
+ rows: 9999,
|
|
|
+ page: 1,
|
|
|
+ teacherId: this.teacherId,
|
|
|
+ settlementType: 'GRADIENT_SALARY'
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ let rows = res.data.rows
|
|
|
+ // this.musicGroupTable = res.data.rows
|
|
|
+ this.teacherSalaryList(domain, rows)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ vipListCompare(vipData, rows) { // vip 做对比
|
|
|
+ if(!vipData) { // 判断是否有数据
|
|
|
+ this.vipTable = rows
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let result = []
|
|
|
+ vipData.forEach(item => {
|
|
|
+ if(rows) { // 判断是否已经设置的课程
|
|
|
+ rows.forEach(c => {
|
|
|
+ if(item.id == c.vipGroupCategoryId) {
|
|
|
+ result.push({
|
|
|
+ id: c.id,
|
|
|
+ vipGroupCategoryName: c.vipGroupCategoryName,
|
|
|
+ offlineClassesSalary: c.offlineClassesSalary,
|
|
|
+ onlineClassesSalary: c.onlineClassesSalary
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ result.push({
|
|
|
+ vipGroupCategoryName: item.name,
|
|
|
+ offlineClassesSalary: item.offlineClassesUnitPrice,
|
|
|
+ onlineClassesSalary: item.onlineClassesUnitPrice
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ result.push({
|
|
|
+ vipGroupCategoryName: item.name,
|
|
|
+ offlineClassesSalary: item.offlineClassesUnitPrice,
|
|
|
+ onlineClassesSalary: item.onlineClassesUnitPrice
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.vipTable = result
|
|
|
+ },
|
|
|
+ teacherSalaryList(domain, rows) {
|
|
|
+ console.log(domain)
|
|
|
+ console.log(rows)
|
|
|
+ if(domain.length <= 0) { // 判断后台是否有设置
|
|
|
+ this.musicGroupTable = rows
|
|
|
+ return
|
|
|
+ }
|
|
|
+ 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
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if(rows) {
|
|
|
+
|
|
|
+ }
|
|
|
+ console.log(result)
|
|
|
+ // this.musicGroupTable = result
|
|
|
+ },
|
|
|
+ onVIPSave(row) { // vip保存
|
|
|
+ vipGroupSalarySet({
|
|
|
+ id: row.id,
|
|
|
+ offlineClassesSalary: row.offlineClassesSalary,
|
|
|
+ onlineClassesSalary: row.onlineClassesSalary
|
|
|
+ }).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onMusicGroupSave(row) {
|
|
|
+ teacherSalaryBatchUpset([{
|
|
|
+ id: row.id,
|
|
|
+ mainTeacherSalary: row.mainTeacherSalary,
|
|
|
+ assistantTeacherSalary: row.assistantTeacherSalary
|
|
|
+ }]).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onMusicGroupSave2(row) {
|
|
|
+ teacherSalaryBatchUpset([{
|
|
|
+ id: row.id,
|
|
|
+ mainTeacherSalary: row.mainTeacherSalary,
|
|
|
+ assistantTeacherSalary: row.assistantTeacherSalary
|
|
|
+ }]).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '保存成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scope>
|
|
|
.salarySet {
|
|
|
- h4 {
|
|
|
- margin-bottom: 20px;
|
|
|
+ h3 {
|
|
|
+ margin-top: 10px;
|
|
|
+ margin-bottom: 10px;
|
|
|
font-size: 14px;
|
|
|
color: #444;
|
|
|
font-weight: normal;
|
|
|
}
|
|
|
.tableList {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- justify-content: space-between;
|
|
|
- > div {
|
|
|
- flex: 1;
|
|
|
+ .left, .right {
|
|
|
+
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+ .left {
|
|
|
+ width: 40%;
|
|
|
+ margin-right: 2%;
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ width: 56%;
|
|
|
+ margin-left: 2%;
|
|
|
}
|
|
|
}
|
|
|
}
|