|
@@ -179,9 +179,15 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <el-form style="margin-top: 20px;">
|
|
|
- <el-form-item required label="生效日期">
|
|
|
- <el-date-picker v-model.trim="startDate"
|
|
|
+ <el-form style="margin-top: 20px;" ref="salaryForm" :model="updateForm" :rules="rules">
|
|
|
+ <el-form-item label="是否结算课酬" label-width="120px" prop="isSettlementSalary" :rules="[{ required: true, message: '请选择是否结算课酬', trigger: 'change'}]">
|
|
|
+ <el-select v-model.trim="updateForm.isSettlementSalary" style="width: 220px !important;">
|
|
|
+ <el-option label="是" :value="1"></el-option>
|
|
|
+ <el-option label="否" :value="0"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="生效日期" label-width="120px" prop="startDate" :rules="[{ required: true, message: '请选择生效日期', trigger: 'change'}]">
|
|
|
+ <el-date-picker v-model.trim="updateForm.startDate"
|
|
|
type="date"
|
|
|
value-format="yyyy-MM-dd"
|
|
|
:picker-options="pickerOptions"
|
|
@@ -208,7 +214,9 @@ import {
|
|
|
teacherSalaryList,
|
|
|
teacherSalaryBatchUpset,
|
|
|
teacherDefaultPracticeGroupSalary,
|
|
|
- PracticeGroupSalaryUpdate
|
|
|
+ PracticeGroupSalaryUpdate,
|
|
|
+ teacherGet,
|
|
|
+ teacherUpdate
|
|
|
} from "@/api/teacherManager";
|
|
|
import { sysConfigList } from "@/api/generalSettings";
|
|
|
import { findTeacherDefaultSalary } from "@/api/vipSeting";
|
|
@@ -320,7 +328,11 @@ export default {
|
|
|
musicGroupTable: [],
|
|
|
ruleList: [],
|
|
|
vipList: [],
|
|
|
- startDate: null,
|
|
|
+ updateForm: {
|
|
|
+ startDate: null,
|
|
|
+ isSettlementSalary: null,
|
|
|
+ },
|
|
|
+ rules: {},
|
|
|
accompanyTable: [
|
|
|
{
|
|
|
assistantTeacherSalary: 30,
|
|
@@ -354,6 +366,13 @@ export default {
|
|
|
if (this.$route.query.rules) {
|
|
|
this.Frules = this.$route.query.rules;
|
|
|
}
|
|
|
+ teacherGet({ teacherId: this.teacherId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ let result = res.data;
|
|
|
+ this.updateForm.isSettlementSalary = result.isSettlementSalary ? 1 : 0
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 获取课程形态 设置vip课酬
|
|
|
findTeacherDefaultSalary({ userId: this.teacherId }).then(res => {
|
|
|
if (res.code == 200 && res.data.length > 0) {
|
|
@@ -558,51 +577,63 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
|
- // 判断输入的值是否正确
|
|
|
- if (!this.startDate) {
|
|
|
- this.$message.error("请填写生效日期");
|
|
|
- return;
|
|
|
- }
|
|
|
if (!checkStatus) {
|
|
|
return
|
|
|
}
|
|
|
- this.$confirm("您确定更改老师课酬", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- let params = teamTable.concat(temps)
|
|
|
- teacherSalaryBatchUpset({
|
|
|
- teacherDefaultMusicGroupSalaries: params,
|
|
|
- startDate: this.startDate
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- // 判断输入的值是否正确
|
|
|
- vipGroupSalarySet({
|
|
|
- teacherDefaultVipGroupSalaries: this.vipTable,
|
|
|
- startDate: this.startDate
|
|
|
+ this.$refs['salaryForm'].validate((valid) => {
|
|
|
+ if(valid) {
|
|
|
+ this.$confirm("您确定更改老师课酬", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ let params = teamTable.concat(temps)
|
|
|
+ let updateForm = this.updateForm
|
|
|
+ let res = await teacherUpdate({ id: this.teacherId, isSettlementSalary: updateForm.isSettlementSalary })
|
|
|
+ if(res.code != 200) {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ teacherSalaryBatchUpset({
|
|
|
+ teacherDefaultMusicGroupSalaries: params,
|
|
|
+ startDate: updateForm.startDate
|
|
|
}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- PracticeGroupSalaryUpdate({
|
|
|
- startDate: this.startDate,
|
|
|
- teacherDefaultPracticeGroupSalaries: this.accompanyTable
|
|
|
+ // 判断输入的值是否正确
|
|
|
+ vipGroupSalarySet({
|
|
|
+ teacherDefaultVipGroupSalaries: this.vipTable,
|
|
|
+ startDate: updateForm.startDate
|
|
|
}).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.$message.success("保存成功");
|
|
|
- this.$store.dispatch('delVisitedViews', this.$route)
|
|
|
- this.$router.push({
|
|
|
- path: "/teacherManager/teacherList",
|
|
|
- query: { rules: this.Frules, search: this.Fsearch }
|
|
|
+ PracticeGroupSalaryUpdate({
|
|
|
+ startDate: updateForm.startDate,
|
|
|
+ teacherDefaultPracticeGroupSalaries: this.accompanyTable
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ this.$store.dispatch('delVisitedViews', this.$route)
|
|
|
+ this.$router.push({
|
|
|
+ path: "/teacherManager/teacherList",
|
|
|
+ query: { rules: this.Frules, search: this.Fsearch }
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => { });
|
|
|
+ })
|
|
|
+ .catch(() => { });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 判断输入的值是否正确
|
|
|
+ // if (!this.startDate) {
|
|
|
+ // this.$message.error("请填写生效日期");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
};
|