addPageSubPagePublic.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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: 'addPageSubPagePublic',
  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. }else if(response.code==205){
  61. self.$confirm(response.msg, "警告", {
  62. confirmButtonText: "确定",
  63. cancelButtonText: "取消",
  64. type: "warning"
  65. }).then(() => {
  66. // 确定
  67. self.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  68. }).catch(function() {
  69. // 取消
  70. self.$parent.outPageButton();
  71. });
  72. }
  73. });
  74. },
  75. addUserTeacher(obj){
  76. let self = this;
  77. addUserTeacher(obj).then(response => {
  78. if(response.code == 200){
  79. self.msgSuccess(response.msg);
  80. self.$parent.outPageButton();
  81. }else if(response.code==205){
  82. self.$confirm(response.msg, "警告", {
  83. confirmButtonText: "确定",
  84. cancelButtonText: "取消",
  85. type: "warning"
  86. }).then(() => {
  87. // 确定
  88. self.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  89. }).catch(function() {
  90. // 取消
  91. self.$parent.outPageButton();
  92. });
  93. }
  94. });
  95. },
  96. }
  97. }
  98. </script>
  99. <style scoped>
  100. </style>