addPageSubPageSZDX.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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: 'addPageSubPageSZDX',
  12. props:{
  13. buttonData: {},
  14. },
  15. methods:{
  16. auditClick(type){
  17. let self = this;
  18. if(type == 1){
  19. self.$parent.open = true;
  20. }else if(type == 2){
  21. self.$confirm('是否确认审核?', "", {
  22. confirmButtonText: "确定",
  23. cancelButtonText: "取消",
  24. type: "warning"
  25. }).then(function() {
  26. self.laboratoryApply(type);
  27. }).then(() => {}).catch(() => {});
  28. }
  29. },
  30. laboratoryApply(type){
  31. let self = this;
  32. let obj = {
  33. id:type==1?self.$parent.$parent.infoData.list.id:self.$parent.infoData.list.id,
  34. auditStatus:type,
  35. rejectCause:type==1?self.$parent.$parent.rejectCause:self.$parent.rejectCause
  36. };
  37. if(type == 1){
  38. obj.rejectCause = self.$parent.$parent.form.rejectCause;
  39. obj.rejectMaterial = self.$parent.$parent.checkList + '';
  40. }
  41. laboratoryApply(obj).then(response => {
  42. self.msgSuccess("操作成功");
  43. if(type == 1){
  44. self.$parent.$parent.$parent.tableClick(1);
  45. }else{
  46. self.$parent.$parent.tableClick(1);
  47. }
  48. })
  49. },
  50. }
  51. }
  52. </script>
  53. <style scoped>
  54. </style>