addPageSubPageSZDX.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <p class="inquire-button-one" @click="upDataButton">提交</p>
  3. </template>
  4. <script>
  5. import { addUserTeacher, putUserTeacherNew } from "@/api/system/user_teacher";
  6. export default {
  7. name: 'addPageSubPageSZDX',
  8. methods:{
  9. upDataButton(){
  10. this.$parent.upDataButton();
  11. // let self = this;
  12. // self.$parent.$refs["form"].validate(valid => {
  13. // if (valid) {
  14. // if(self.$parent.form.email){
  15. // let re = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
  16. // if(!re.test(self.$parent.form.email)){
  17. // self.msgError('请输入正确的邮箱地址')
  18. // return
  19. // }
  20. // }
  21. // let list = self.$parent.toArray();
  22. // let obj = JSON.parse(JSON.stringify(self.$parent.form));
  23. // obj.roleIds = self.$parent.form.position?self.$parent.form.roleIds:[];
  24. // // obj.position = obj.position+'';
  25. // obj.permitMenus = [];
  26. // if(obj.status == 0){
  27. // for(let i=0;i<list.length;i++){
  28. // let minObj = {
  29. // menuId:list[i].menuId,
  30. // }
  31. // if(list[i].dataScope){
  32. // minObj.dataScope = list[i].dataScope
  33. // if(list[i].dataScope == 3){
  34. // minObj.deptIds = list[i].deptIds;
  35. // minObj.deptIdsList = list[i].deptIdsList;
  36. // }
  37. // }else{
  38. // minObj.dataScope = 0
  39. // }
  40. // obj.permitMenus.push(minObj)
  41. // }
  42. // }
  43. // if(self.$parent.propsData.userId){
  44. // //修改
  45. // obj.userId = self.$parent.propsData.userId;
  46. // self.putUserTeacherNew(obj);
  47. // }else{
  48. // //发布
  49. // self.addUserTeacher(obj);
  50. // }
  51. // }
  52. // });
  53. },
  54. putUserTeacherNew(obj){
  55. let self = this;
  56. putUserTeacherNew(obj).then(response => {
  57. if(response.code == 200){
  58. self.msgSuccess(response.msg);
  59. self.$parent.outPageButton();
  60. }
  61. });
  62. },
  63. addUserTeacher(obj){
  64. let self = this;
  65. addUserTeacher(obj).then(response => {
  66. if(response.code == 200){
  67. self.msgSuccess(response.msg);
  68. self.$parent.outPageButton();
  69. }
  70. });
  71. },
  72. }
  73. }
  74. </script>
  75. <style scoped>
  76. </style>