|
@@ -3,7 +3,9 @@
|
|
|
<!-- <h4>单次课次参考时长:30min</h4> -->
|
|
|
<div class="tableList">
|
|
|
<div class="left">
|
|
|
- <h3>单次课次参考时长:30min</h3>
|
|
|
+ <h3>单次课次参考时长:30min
|
|
|
+ <el-button @click="onMusicGroupSave2()" type="text">保存</el-button>
|
|
|
+ </h3>
|
|
|
<el-table :data='teamTable'
|
|
|
:header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
<el-table-column label="乐团课课酬课时结算">
|
|
@@ -21,11 +23,6 @@
|
|
|
<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="onMusicGroupSave2(scope.row)" type="text">保存</el-button>
|
|
|
- </template>
|
|
|
- </el-table-column> -->
|
|
|
</el-table>
|
|
|
|
|
|
<h3>单次课次参考时长:30min
|
|
@@ -45,11 +42,6 @@
|
|
|
<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">
|
|
@@ -76,14 +68,6 @@
|
|
|
<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> -->
|
|
|
- <!-- <template slot="append" style="text-align: right;">
|
|
|
- <el-button @click="onMusicGroupSave(scope.row)" type="text">保存</el-button>
|
|
|
- </template> -->
|
|
|
</el-table>
|
|
|
|
|
|
</div>
|
|
@@ -98,7 +82,25 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
teacherId: this.$route.query.teacherId,
|
|
|
- teamTable: [],
|
|
|
+ teamTable: [{
|
|
|
+ assistantTeacherSalary: null,
|
|
|
+ courseScheduleType: "SINGLE",
|
|
|
+ mainTeacherSalary: null,
|
|
|
+ settlementType: "FIXED_SALARY",
|
|
|
+ userId: this.$route.query.teacherId
|
|
|
+ },{
|
|
|
+ assistantTeacherSalary: null,
|
|
|
+ courseScheduleType: "HIGH",
|
|
|
+ mainTeacherSalary: null,
|
|
|
+ settlementType: "FIXED_SALARY",
|
|
|
+ userId: this.$route.query.teacherId
|
|
|
+ },{
|
|
|
+ assistantTeacherSalary: null,
|
|
|
+ courseScheduleType: "MIX",
|
|
|
+ mainTeacherSalary: null,
|
|
|
+ settlementType: "FIXED_SALARY",
|
|
|
+ userId: this.$route.query.teacherId
|
|
|
+ }],
|
|
|
vipTable: [],
|
|
|
musicGroupTable: [],
|
|
|
ruleList: [],
|
|
@@ -114,12 +116,15 @@ export default {
|
|
|
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 tempArray = []
|
|
|
+ // let vipData = res.data
|
|
|
+ let vipData = []
|
|
|
res.data.forEach(item => {
|
|
|
- console.log(item)
|
|
|
- tempArray.push({
|
|
|
- // offlineClassesSalary:
|
|
|
+ vipData.push({
|
|
|
+ offlineClassesSalary: item.offlineClassesUnitPrice,
|
|
|
+ onlineClassesSalary: item.onlineClassesUnitPrice,
|
|
|
+ vipGroupCategoryId: item.id,
|
|
|
+ vipGroupCategoryName: item.name,
|
|
|
+ userId: this.teacherId
|
|
|
})
|
|
|
})
|
|
|
// VIP课列表
|
|
@@ -143,7 +148,9 @@ export default {
|
|
|
settlementType: 'FIXED_SALARY'
|
|
|
}).then(res => {
|
|
|
if(res.code == 200) {
|
|
|
- this.teamTable = res.data.rows
|
|
|
+ // this.teamTable = res.data.rows
|
|
|
+ let rows = res.data.rows
|
|
|
+ this.teacherSalaryMoney(rows)
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -196,35 +203,34 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
vipListCompare(vipData, rows) { // vip 做对比
|
|
|
- console.log('start------------------')
|
|
|
- console.log(vipData)
|
|
|
- console.log(rows)
|
|
|
- console.log('end------------------')
|
|
|
- if(!vipData) { // 判断是否有数据
|
|
|
- this.vipTable = rows
|
|
|
+ if(!rows) { // 判断是否有数据
|
|
|
+ this.vipTable = vipData
|
|
|
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
|
|
|
- })
|
|
|
- }
|
|
|
+ rows.forEach(c => {
|
|
|
+ if(item.vipGroupCategoryId == c.vipGroupCategoryId) {
|
|
|
+ item.checked = true
|
|
|
+ result.push({
|
|
|
+ vipGroupCategoryName: c.vipGroupCategoryName,
|
|
|
+ offlineClassesSalary: c.offlineClassesSalary,
|
|
|
+ onlineClassesSalary: c.onlineClassesSalary,
|
|
|
+ vipGroupCategoryName: c.vipGroupCategoryName,
|
|
|
+ userId: c.userId
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
+ if(result.length > 0) {
|
|
|
+ vipData.forEach(item => {
|
|
|
+ if(!item.checked) {
|
|
|
+ result.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ result.vipData
|
|
|
+ }
|
|
|
this.vipTable = result
|
|
|
},
|
|
|
teacherSalaryList(domain, rows) {
|
|
@@ -261,15 +267,49 @@ export default {
|
|
|
} else {
|
|
|
result = domain
|
|
|
}
|
|
|
- // console.log(result)
|
|
|
this.musicGroupTable = result
|
|
|
},
|
|
|
- onVIPSave(row) { // vip保存
|
|
|
- vipGroupSalarySet({
|
|
|
- id: row.id,
|
|
|
- offlineClassesSalary: row.offlineClassesSalary,
|
|
|
- onlineClassesSalary: row.onlineClassesSalary
|
|
|
- }).then(res => {
|
|
|
+ teacherSalaryMoney(rows) {
|
|
|
+ // 判断是否有数据
|
|
|
+ if(!rows || rows.length <= 0) return
|
|
|
+ let teamTable = this.teamTable
|
|
|
+ let result = []
|
|
|
+ teamTable.forEach(item => {
|
|
|
+ rows.forEach(c => {
|
|
|
+ if(item.courseScheduleType == c.courseScheduleType) {
|
|
|
+ item.checked = true
|
|
|
+ result.push({
|
|
|
+ mainTeacherSalary: c.mainTeacherSalary,
|
|
|
+ assistantTeacherSalary: c.assistantTeacherSalary,
|
|
|
+ courseScheduleType: c.courseScheduleType,
|
|
|
+ userId: this.teacherId,
|
|
|
+ settlementType: 'GRADIENT_SALARY'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ if(result.length > 0) {
|
|
|
+ teamTable.forEach(item => {
|
|
|
+ if(!item.checked) {
|
|
|
+ result.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ result = teamTable
|
|
|
+ }
|
|
|
+ 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: '保存成功',
|
|
@@ -278,7 +318,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onMusicGroupSave(row) {
|
|
|
+ onMusicGroupSave() {
|
|
|
let musicGroupTable = this.musicGroupTable
|
|
|
let checkStatus = true
|
|
|
musicGroupTable.forEach(item => {
|
|
@@ -289,7 +329,6 @@ export default {
|
|
|
})
|
|
|
// 判断输入的值是否正确
|
|
|
if(!checkStatus) return false
|
|
|
- // return
|
|
|
teacherSalaryBatchUpset(musicGroupTable).then(res => {
|
|
|
if(res.code == 200) {
|
|
|
this.$message({
|
|
@@ -299,12 +338,18 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onMusicGroupSave2(row) {
|
|
|
- teacherSalaryBatchUpset([{
|
|
|
- id: row.id,
|
|
|
- mainTeacherSalary: row.mainTeacherSalary,
|
|
|
- assistantTeacherSalary: row.assistantTeacherSalary
|
|
|
- }]).then(res => {
|
|
|
+ onMusicGroupSave2() {
|
|
|
+ let teamTable = this.teamTable
|
|
|
+ let checkStatus = true
|
|
|
+ teamTable.forEach(item => {
|
|
|
+ if(item.assistantTeacherSalary < 0 || item.mainTeacherSalary < 0) {
|
|
|
+ this.$message('输入课酬不能为负数')
|
|
|
+ checkStatus = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 判断输入的值是否正确
|
|
|
+ if(!checkStatus) return false
|
|
|
+ teacherSalaryBatchUpset(teamTable).then(res => {
|
|
|
if(res.code == 200) {
|
|
|
this.$message({
|
|
|
message: '保存成功',
|