瀏覽代碼

Merge branch 'LAO_MO' of http://git.dayaedu.com/molingzhide/dy-admin-manager into LAO_MO

mo 5 年之前
父節點
當前提交
879fda97d0
共有 2 個文件被更改,包括 118 次插入4 次删除
  1. 2 1
      src/utils/vueFilter.js
  2. 116 3
      src/views/teacherManager/teacherOperation/components/salarySet.vue

+ 2 - 1
src/utils/vueFilter.js

@@ -88,7 +88,8 @@ Vue.filter('coursesType', (value) => {
     CLASSROOM: '课堂课',
     PRACTICE: '网管课',
     COMM: '对外课',
-    MUSIC: '乐团课'
+    MUSIC: '乐团课',
+    HIGH_ONLINE: '线上基础技能班'
   }
   return template[value]
 })

+ 116 - 3
src/views/teacherManager/teacherOperation/components/salarySet.vue

@@ -81,11 +81,53 @@
           </el-table-column>
         </el-table>
 
+        <el-table :data="teamSmallTable" style=" margin-top: 15px;" :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="1V3">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                @mousewheel.native.prevent
+                v-model.trim="scope.row.v3"
+                placeholder="请输入课酬"
+              >
+                <template slot="append">元/节</template>
+              </el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="1V4">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                @mousewheel.native.prevent
+                v-model.trim="scope.row.v4"
+                placeholder="请输入课酬"
+              >
+                <template slot="append">元/节</template>
+              </el-input>
+            </template>
+          </el-table-column>
+          <el-table-column label="1V5">
+            <template slot-scope="scope">
+              <el-input
+                type="number"
+                @mousewheel.native.prevent
+                v-model.trim="scope.row.v5"
+                placeholder="请输入课酬"
+              >
+                <template slot="append">元/节</template>
+              </el-input>
+            </template>
+          </el-table-column>
+        </el-table>
+
+
         <el-table
           :data="vipTable"
           style="width: 70%; margin-top: 15px;"
-          :header-cell-style="{background:'#EDEEF0',color:'#444'}"
-        >
+          :header-cell-style="{background:'#EDEEF0',color:'#444'}">
           <el-table-column label="VIP课课酬参考值" prop="vipGroupCategoryName"></el-table-column>
           <el-table-column label="线上课">
             <template slot-scope="scope">
@@ -237,6 +279,22 @@ export default {
           userId: this.teacherId
         }
       ],
+      // salaryRuleJson: { 3: 0, 4: 0, 5: 0 },
+      // userId: this.teacherId
+      teamSmallTable: [
+        {
+          courseScheduleType: "HIGH_ONLINE",
+          // salaryRuleJson: { 3: 0, 4: 0, 5: 0 },
+          v3: 0,
+          v4: 0,
+          v5: 0,
+          assistantTeacher30MinSalary: 0,
+          assistantTeacher90MinSalary: 0,
+          mainTeacher30MinSalary: 0,
+          mainTeacher90MinSalary: 0,
+          userId: this.teacherId
+        }
+      ],
       vipTable: [],
       musicGroupTable: [],
       ruleList: [],
@@ -380,6 +438,41 @@ export default {
         result = teamTable;
       }
       this.teamTable = result;
+
+      let smallResult = []
+      let teamSmallTable = this.teamSmallTable
+      teamSmallTable.forEach(item => {
+        rows.forEach(c => {
+          if (item.courseScheduleType == c.courseScheduleType) {
+            item.checked = true;
+            let tempJson = c.salaryRuleJson ? JSON.parse(c.salaryRuleJson) : {3:0,4:0,5:0}
+            // console.log(tempJson)
+            smallResult.push({
+              mainTeacher30MinSalary: c.mainTeacher30MinSalary,
+              mainTeacher90MinSalary: c.mainTeacher90MinSalary,
+              assistantTeacher30MinSalary: c.assistantTeacher30MinSalary,
+              assistantTeacher90MinSalary: c.assistantTeacher90MinSalary,
+              salaryRuleJson: tempJson,
+              v3: tempJson[3],
+              v4: tempJson[4],
+              v5: tempJson[5],
+              courseScheduleType: c.courseScheduleType,
+              userId: this.teacherId
+            });
+          }
+        });
+      })
+
+      if (smallResult.length > 0) {
+        teamSmallTable.forEach(item => {
+          if (!item.checked) {
+            smallResult.push(item);
+          }
+        });
+      } else {
+        smallResult = teamSmallTable;
+      }
+      this.teamSmallTable = smallResult;
     },
     onSave() {
       this.$confirm("您确定更改老师课酬", "提示", {
@@ -402,6 +495,24 @@ export default {
               return;
             }
           });
+          let temps = []
+          this.teamSmallTable.forEach(item => {
+            if(item.v3 < 0 || item.v4 < 0 || item.v5 < 0) {
+              this.$message.error("输入课酬不能为负数");
+              checkStatus = false;
+              return;
+            }
+
+            temps.push({
+              courseScheduleType: "HIGH_ONLINE",
+              salaryRuleJson: JSON.stringify({ 3: item.v3, 4: item.v4, 5: item.v5 }),
+              assistantTeacher30MinSalary: 0,
+              assistantTeacher90MinSalary: 0,
+              mainTeacher30MinSalary: 0,
+              mainTeacher90MinSalary: 0,
+              userId: item.userId
+            })
+          })
           this.vipTable.forEach(item => {
             if (item.offlineClassesSalary < 0 && item.onlineClassesSalary < 0) {
               this.$message.error("输入课酬不能为负数");
@@ -429,8 +540,10 @@ export default {
           if(!checkStatus){
             return
           }
+
+          let params = teamTable.concat(temps)
           teacherSalaryBatchUpset({
-            teacherDefaultMusicGroupSalaries: teamTable,
+            teacherDefaultMusicGroupSalaries: params,
             startDate: this.startDate
           }).then(res => {
             if (res.code == 200) {