boxTabPage.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div>
  3. <div v-for="item in tabOption" :label="item.label" :name="item.name">
  4. <div class="title"> {{ item.label }}</div>
  5. <component
  6. :is="item.name"
  7. :key="item.name"
  8. :ref="'componentRef' + item.name"
  9. v-if="form.id"
  10. v-bind="activeNameProps(item.name)"
  11. />
  12. </div>
  13. </div>
  14. </template>
  15. <script>
  16. import { getPurchaseOutSourceSendDetailAPI } from '@/api/bpm/components/purchasingManage/outSourceSend';
  17. export default {
  18. name: 'boxTabPage',
  19. components: {
  20. tab1: () => import('./detailDialog.vue'),
  21. tab2: () => import('@/views/bpm/outgoingManagement/outbound.vue'),
  22. tab3: () => import('@/views/bpm/outgoingManagement/details.vue')
  23. },
  24. props: {
  25. taskDefinitionKey: {
  26. type: String,
  27. default: ''
  28. },
  29. activeComp: {
  30. type: String,
  31. default: ''
  32. },
  33. permissionType: {
  34. type: String,
  35. default: 'view'
  36. },
  37. businessId: {
  38. type: String,
  39. default: ''
  40. },
  41. isView: ''
  42. },
  43. data() {
  44. return {
  45. form: {},
  46. activeName: 'tab1',
  47. cKey: 1
  48. };
  49. },
  50. computed: {
  51. tabOption() {
  52. let list = [
  53. {
  54. label: '发货单信息',
  55. name: 'tab1',
  56. isShow: true
  57. },
  58. {
  59. label: '出库单信息',
  60. name: this.isView ? 'tab3' : 'tab2',
  61. isShow: true
  62. }
  63. ];
  64. return list.filter((item) => item.isShow);
  65. }
  66. },
  67. async created() {
  68. this.form = await getPurchaseOutSourceSendDetailAPI(this.businessId);
  69. },
  70. methods: {
  71. activeNameProps(name) {
  72. switch (name) {
  73. case 'tab1':
  74. return {
  75. businessId: this.businessId
  76. };
  77. case 'tab2':
  78. return {
  79. form: this.form,
  80. bizType: 7,
  81. sourceBizNo: this.form.code,
  82. };
  83. case 'tab3':
  84. return {
  85. businessId: this.form.code
  86. };
  87. }
  88. },
  89. isValidComponent(componentName) {
  90. const validComponents = ['tab1', 'tab2'];
  91. return validComponents.includes(componentName);
  92. },
  93. handleClick(val) {
  94. this.activeName = val.name;
  95. },
  96. async getTableValue() {
  97. return {
  98. form: this.form,
  99. returnStorageData: this.$refs['componentReftab2'][0].getReturnStorage
  100. ? await this.$refs['componentReftab2'][0].getReturnStorage()
  101. : {}
  102. };
  103. }
  104. }
  105. };
  106. </script>
  107. <style scoped lang="scss">
  108. .title {
  109. font-size: 22px;
  110. font-weight: 800;
  111. margin-top: 15px;
  112. }
  113. </style>