|
@@ -289,7 +289,7 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
import pagination from '@/components/Pagination/index'
|
|
|
-import { queryEmployByOrganId, employeeOperate, getUserRole, employeeAdd, employeeUpdate, hasCourseGroupRelation } from '@/api/systemManage'
|
|
|
+import { queryEmployByOrganId, employeeOperate, getUserRole, employeeAdd, employeeUpdate, hasCourseGroupRelation, updateEducationTeacherId } from '@/api/systemManage'
|
|
|
import { branchQueryPage } from '@/api/specialSetting'
|
|
|
import { findEducationUsers } from '@/api/buildTeam'
|
|
|
import store from '@/store'
|
|
@@ -369,9 +369,7 @@ export default {
|
|
|
this.getEducationUsers()
|
|
|
},
|
|
|
methods: {
|
|
|
- submitEducation () {
|
|
|
- console.log('来了')
|
|
|
- },
|
|
|
+
|
|
|
getEducationUsers () {
|
|
|
findEducationUsers().then(res => {
|
|
|
if (res.code === 200) {
|
|
@@ -505,35 +503,80 @@ export default {
|
|
|
return reuslt[row.lockFlag]
|
|
|
}
|
|
|
},
|
|
|
- async onStaffOperation (type, data) {
|
|
|
- if (type === 'DEMISSION' && !data.demissionDate) {
|
|
|
- this.activeRow = data;
|
|
|
- // 1.点击的是离职按钮
|
|
|
- // 2.判断该考级是否存在教务老师
|
|
|
- await hasCourseGroupRelation({ employeeId: data.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- if (res.deta === 0) {
|
|
|
- return
|
|
|
+ async checkStatus (data) {
|
|
|
+ let status;
|
|
|
+ await hasCourseGroupRelation({ employeeId: data.id }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ if (res.data.hasCourseSchedule) {
|
|
|
+ this.$message.error('请先交接指导老师课程')
|
|
|
+ status = false
|
|
|
+ } else {
|
|
|
+ if (res.data.hasCourseGroupRelation) {
|
|
|
+ this.educationViseble = true
|
|
|
+ status = false
|
|
|
} else {
|
|
|
- this.educationViseble = true;
|
|
|
+ // 1 要弹出
|
|
|
+ status = true
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ return status
|
|
|
+ },
|
|
|
+ onStaffOperation (type, data) {
|
|
|
+ this.$confirm("您确定修改员工状态", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(async () => {
|
|
|
+ if (type === 'DEMISSION' && !data.demissionDate) {
|
|
|
+ this.activeRow = data;
|
|
|
+ // 1.点击的是离职按钮
|
|
|
+ // 2.判断该考级是否存在教务老师
|
|
|
+ const status = await this.checkStatus(data)
|
|
|
+ if (!status) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ employeeOperate({
|
|
|
+ employeeId: data.id,
|
|
|
+ operate: type
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('更改成功')
|
|
|
+ this.roleStatus = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
})
|
|
|
- return
|
|
|
- }
|
|
|
- employeeOperate({
|
|
|
- employeeId: data.id,
|
|
|
- operate: type
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.$message.success('更改成功')
|
|
|
- this.roleStatus = false
|
|
|
- this.getList()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
+ }).catch(err => { })
|
|
|
+
|
|
|
+ },
|
|
|
+ submitEducation () {
|
|
|
+ // 发请求 提交信息
|
|
|
+ updateEducationTeacherId({ currentUserId: this.activeRow.id, targetUserId: this.educationForm.targetUserId }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ const type = 'DEMISSION'
|
|
|
+ const data = this.activeRow;
|
|
|
+ employeeOperate({
|
|
|
+ employeeId: data.id,
|
|
|
+ operate: type
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('更改成功')
|
|
|
+ this.roleStatus = false
|
|
|
+ this.educationViseble = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
educationViseble (val) {
|