addPageSubPagePublic.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <div style="display: inline-block">
  3. <p v-if="buttonData.type == '0'" class="button-p reset-button-one" style="width:100px;margin-right:20px;" @click="auditClick(1)">驳回</p>
  4. <p v-if="buttonData.type == '1'" class="inquire-button-one" style="width:100px;" @click="auditClick(2)">通过</p>
  5. <el-button v-if="buttonData.type == '2'" type="primary" @click="laboratoryApply(1)">确 定</el-button>
  6. </div>
  7. </template>
  8. <script>
  9. import { laboratoryApply } from "@/api/laboratory/approval";
  10. export default {
  11. name: 'addPageSubPagePublic',
  12. props:{
  13. buttonData: {},
  14. },
  15. methods:{
  16. //审核按钮
  17. auditClick(type){
  18. let self = this;
  19. if(type == 1){
  20. self.$parent.open = true;
  21. }else if(type == 2){
  22. self.$confirm('是否确认审核?', "", {
  23. confirmButtonText: "确定",
  24. cancelButtonText: "取消",
  25. type: "warning"
  26. }).then(function() {
  27. self.laboratoryApply(type);
  28. }).then(() => {}).catch(() => {});
  29. }
  30. },
  31. laboratoryApply(type){
  32. let self = this;
  33. let obj = {
  34. id:type==1?self.$parent.$parent.infoData.list.id:self.$parent.infoData.list.id,
  35. auditStatus:type,
  36. rejectCause:type==1?self.$parent.$parent.rejectCause:self.$parent.rejectCause
  37. };
  38. if(type == 1){
  39. obj.rejectCause = self.$parent.$parent.form.rejectCause;
  40. obj.rejectMaterial = self.$parent.$parent.checkList + '';
  41. }
  42. laboratoryApply(obj).then(response => {
  43. if(response.code==200){
  44. self.msgSuccess("操作成功");
  45. if(type == 1){
  46. self.$parent.$parent.$parent.tableClick(1);
  47. }else{
  48. self.$parent.$parent.tableClick(1);
  49. }
  50. }else if(response.code==205){
  51. self.$confirm(response.msg, "警告", {
  52. confirmButtonText: "确定",
  53. cancelButtonText: "取消",
  54. type: "warning"
  55. }).then(() => {
  56. // 确定
  57. self.$router.push({ path: '/comprehensive/laboratoryManagement/accessAuthorization' });
  58. }).catch(function() {
  59. // 取消
  60. if(type == 1){
  61. self.$parent.$parent.$parent.tableClick(1);
  62. }else{
  63. self.$parent.$parent.tableClick(1);
  64. }
  65. });
  66. }
  67. })
  68. },
  69. }
  70. }
  71. </script>
  72. <style scoped>
  73. </style>