index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <div id="inboundRequests">
  3. <el-card shadow="never" v-loading="loading">
  4. <search @search="reload" :activeName="activeName" ref="searchRef">
  5. </search>
  6. <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
  7. <el-tab-pane label="入库" name="入库">
  8. <tgTable
  9. v-if="activeName == '入库'"
  10. ref="tableRef"
  11. type="1"
  12. ></tgTable>
  13. </el-tab-pane>
  14. <el-tab-pane label="出库" name="出库">
  15. <tgTable
  16. v-if="activeName == '出库'"
  17. ref="tableRef"
  18. type="2"
  19. ></tgTable>
  20. </el-tab-pane>
  21. <el-tab-pane label="出入库明细表" name="出入库明细表">
  22. <allTable
  23. v-if="activeName == '出入库明细表'"
  24. ref="tableRef"
  25. ></allTable>
  26. </el-tab-pane>
  27. </el-tabs>
  28. </el-card>
  29. </div>
  30. </template>
  31. <script>
  32. import search from './components/search.vue';
  33. import tgDetails from './components/tgDetails.vue';
  34. import tgTable from './components/tgTable.vue';
  35. import allTable from './components/allTable.vue';
  36. export default {
  37. components: {
  38. search,
  39. tgDetails,
  40. tgTable,
  41. allTable
  42. },
  43. data() {
  44. return {
  45. activeName: '入库',
  46. loading: false
  47. };
  48. },
  49. created() {},
  50. methods: {
  51. handleClick(tab) {
  52. this.activeName = tab.name;
  53. this.$refs.tableRef && this.$refs.tableRef.reload(tab.name);
  54. },
  55. /* 刷新表格 */
  56. reload(where) {
  57. this.$refs.tableRef.reload(where);
  58. }
  59. }
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. #inboundRequests {
  64. height: calc(100vh - 96px);
  65. width: 100%;
  66. :deep(.el-card) {
  67. height: 100%;
  68. .el-card__body {
  69. height: 100%;
  70. box-sizing: border-box;
  71. display: flex;
  72. flex-direction: column;
  73. .el-tabs {
  74. flex: 1;
  75. display: flex;
  76. flex-direction: column;
  77. .el-tabs__content {
  78. flex: 1;
  79. .el-tab-pane {
  80. height: 100%;
  81. }
  82. }
  83. }
  84. .el-form-item {
  85. margin-bottom: 5px !important;
  86. }
  87. }
  88. }
  89. }
  90. </style>