123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <template>
- <div class='salary-container'>
- <!-- <el-form :inline="true"
- :model="searchForm">
- <el-form-item label="课酬结算标准">
- <el-select v-model="searchForm.salary"
- @change="changeSalary">
- <el-option label="课时默认结算"
- value="TEACHER_DEFAULT"></el-option>
- <el-option label="课时梯度结算"
- value="GRADIENT_SALARY"></el-option>
- </el-select>
- </el-form-item>
- </el-form> -->
- <div class="tableWrap"
- v-if='searchForm.salary == "TEACHER_DEFAULT" || searchForm.salary =="CLASSROOM_SALARY"'>
- <el-table :data="defaultTableList"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- row-key="id"
- border
- default-expand-all
- :tree-props="{children: 'classGroupTeacherMapperList', hasChildren: 'hasChildren'}">
- <el-table-column label="班级名称"
- width="180px"
- prop='name'>
- </el-table-column>
- <el-table-column label="老师名称"
- width="180px"
- prop='userName'>
- </el-table-column>
- <el-table-column label="老师类型"
- width="180px"
- prop="teacherRole">
- <template slot-scope="scope">
- <div>
- {{ scope.row.teacherRole|workType}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="金额">
- <template slot-scope="scope">
- <div v-if="scope.row.teacherDefaultMusicGroupSalaryList&&scope.row.teacherDefaultMusicGroupSalaryList[0]&&scope.row.teacherDefaultMusicGroupSalaryList[0]">
- <span>课酬:</span>
- <!-- &&scope.row.teacherDefaultMusicGroupSalaryList[0].mainTeacherSalary &&scope.row.teacherDefaultMusicGroupSalaryList[0].mainTeacherSalary-->
- <el-input style="width: 80px;margin-right:10px"
- v-if='scope.row.teacherDefaultMusicGroupSalaryList&&scope.row.teacherDefaultMusicGroupSalaryList[0]&&scope.row.teacherRole =="TEACHING"'
- v-model="scope.row.teacherDefaultMusicGroupSalaryList[0].assistantTeacherSalary"></el-input>
- <el-input style="width: 80px;margin-right:10px"
- v-if='scope.row.teacherDefaultMusicGroupSalaryList&&scope.row.teacherDefaultMusicGroupSalaryList[0]&&scope.row.teacherRole =="BISHOP"'
- v-model="scope.row.teacherDefaultMusicGroupSalaryList[0].mainTeacherSalary"></el-input>
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="tableWrap"
- v-if='searchForm.salary == "GRADIENT_SALARY"'>
- <el-table :data="gradientTableList"
- :header-cell-style="{background:'#EDEEF0',color:'#444'}"
- row-key="id"
- border
- default-expand-all
- :tree-props="{children: 'classGroupTeacherMapperList', hasChildren: 'hasChildren'}">
- <el-table-column label="班级名称"
- width="180px"
- prop='name'>
- </el-table-column>
- <el-table-column label="老师名称"
- width="180px"
- prop='userName'>
- </el-table-column>
- <el-table-column label="老师类型"
- width="180px"
- prop="teacherRole">
- <template slot-scope="scope">
- <div>
- {{ scope.row.teacherRole|workType}}
- </div>
- </template>
- </el-table-column>
- <el-table-column label="金额">
- <template slot-scope="scope">
- <div v-if='scope.row.teacherDefaultMusicGroupSalaryList'>
- <div v-for="(item,index) in scope.row.teacherDefaultMusicGroupSalaryList"
- v-if="scope.row.teacherRole =='TEACHING'"
- style="display: table-cell;"
- :key='index'>
- <span>梯度{{index+1}}:</span>
- <el-input style="width: 80px;margin-right:10px"
- v-model="scope.row.teacherDefaultMusicGroupSalaryList[index].assistantTeacherSalary"></el-input>
- </div>
- <div v-for="(item,index) in scope.row.teacherDefaultMusicGroupSalaryList"
- v-if="scope.row.teacherRole =='BISHOP'"
- style="display: table-cell;"
- :key='index'>
- <span>梯度{{index+1}}:</span>
- <el-input style="width: 80px;margin-right:10px"
- v-model="scope.row.teacherDefaultMusicGroupSalaryList[index].mainTeacherSalary"></el-input>
- </div>
- <!-- <el-input v-if='scope.row.teacherDefaultMusicGroupSalaryList&&scope.row.teacherDefaultMusicGroupSalaryList[0]&&scope.row.teacherDefaultMusicGroupSalaryList[0].mainTeacherSalary&&scope.row.teacherRole =="TEACHING"'
- v-model="scope.row.teacherDefaultMusicGroupSalaryList[0].mainTeacherSalary"></el-input>
- <el-input v-if='scope.row.teacherDefaultMusicGroupSalaryList&&scope.row.teacherDefaultMusicGroupSalaryList[0]&&scope.row.teacherDefaultMusicGroupSalaryList[0].mainTeacherSalary&&scope.row.teacherRole =="BISHOP"'
- v-model="scope.row.teacherDefaultMusicGroupSalaryList[0].assistantTeacherSalary"></el-input> -->
- </div>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 确认取消 -->
- <div class="btnWrap"
- style="margin-top:40px;">
- <div class="nextBtn"
- @click='gotoNext'>下一步</div>
- <div class="okBtn">返回</div>
- </div>
- </div>
- </template>
- <script>
- import { findMusicGroupClassTeacherSalary, setClassGroupTeacherSalary, getTeamDetail } from '@/api/buildTeam'
- import { format } from 'path'
- export default {
- props: {
- teamid: {
- type: String,
- required: true
- }
- },
- data () {
- return {
- searchForm: {
- salary: ''
- },
- defaultTableList: [],
- gradientTableList: [],
- subList: [],
- isok: true
- }
- },
- mounted () {
- getTeamDetail({ musicGroupId: this.teamid }).then(res => {
- if (res.code == 200) {
- this.searchForm.salary = res.data.settlementType;
- if (this.searchForm.salary == 'TEACHER_DEFAULT') {
- findMusicGroupClassTeacherSalary({ musicGroupId: this.teamid, type: 'TEACHER_DEFAULT' }).then(res => {
- if (res.code == 200) {
- this.defaultTableList = res.data;
- this.changeSalary(this.searchForm.salary);
- }
- })
- } else if (this.searchForm.salary == 'GRADIENT_SALARY') {
- findMusicGroupClassTeacherSalary({ musicGroupId: this.teamid, type: 'GRADIENT_SALARY' }).then(res => {
- if (res.code == 200) {
- this.gradientTableList = res.data;
- this.changeSalary(this.searchForm.salary);
- }
- })
- } else if (this.searchForm.salary == 'CLASSROOM_SALARY') {
- findMusicGroupClassTeacherSalary({ musicGroupId: this.teamid, type: 'CLASSROOM_SALARY' }).then(res => {
- if (res.code == 200) {
- this.defaultTableList = res.data;
- this.changeSalary(this.searchForm.salary);
- }
- })
- }
- }
- })
- // 获取乐团收费类型
- // 获取默认老师列表 类型为默认
- // GRADIENT_SALARY
- // 类型为梯度
- }, methods: {
- gotoNext () {
- if (!this.isok) {
- this.$message.error('有老师未设置默认课酬,请设置后再试')
- }
- if (this.searchForm.salary == 'TEACHER_DEFAULT' || this.searchForm.salary == 'CLASSROOM_SALARY') {
- // 组件默认课酬
- for (let i in this.defaultTableList) {
- for (let j in this.defaultTableList[i].classGroupTeacherMapperList) {
- let obj = {}
- obj.classGroupId = this.defaultTableList[i].id;
- obj.userId = this.defaultTableList[i].classGroupTeacherMapperList[j].userId;
- obj.teacherRole = this.defaultTableList[i].classGroupTeacherMapperList[j].teacherRole;
- obj.teacherDefaultMusicGroupSalaryList = this.defaultTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList;
- this.subList.push(obj);
- }
- }
- } else if (this.searchForm.salary == 'GRADIENT_SALARY') {
- // 组件梯度课酬
- for (let i in this.defaultTableList) {
- for (let j in this.defaultTableList[i].classGroupTeacherMapperList) {
- let obj = {}
- obj.classGroupId = this.defaultTableList[i].id;
- obj.userId = this.defaultTableList[i].classGroupTeacherMapperList[j].userId;
- obj.teacherRole = this.defaultTableList[i].classGroupTeacherMapperList[j].teacherRole;
- obj.teacherDefaultMusicGroupSalaryList = this.defaultTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList;
- this.subList.push(obj);
- }
- }
- }
- setClassGroupTeacherSalary(this.subList).then(res => {
- if (res.code == 200) {
- this.subList = [];
- this.$message.success('恭喜您设置成功');
- this.$router.push({ path: '/business/teamDetail' })
- }
- }).catch(res => {
- this.$message.error('提交失败')
- this.subList = [];
- })
- },
- changeSalary (val) {
- return
- if (val == 'TEACHER_DEFAULT') {
- for (let i in this.defaultTableList) {
- for (let j in this.defaultTableList[i].classGroupTeacherMapperList) {
- if (this.defaultTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList.length <= 0 || this.defaultTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList) {
- this.$message.error('还有老师课酬未设置')
- this.isok = false;
- return
- }
- }
- }
- } else if (val == 'GRADIENT_SALARY') {
- for (let i in this.gradientTableList) {
- for (let j in this.gradientTableList[i].classGroupTeacherMapperList) {
- if (this.gradientTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList.length <= 0 || this.gradientTableList[i].classGroupTeacherMapperList[j].teacherDefaultMusicGroupSalaryList) {
- this.$message.error('还有老师课酬未确认')
- this.isok = false;
- return
- }
- }
- }
- }
- }
- },
- }
- </script>
- <style lang="scss">
- .salary-container {
- padding: 47px 58px;
- background-color: #fff;
- min-height: 75vh;
- }
- </style>
|