| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <template>
- <div id="inboundRequests">
- <el-card shadow="never" v-loading="loading">
- <search @search="reload" :activeName="activeName" ref="searchRef">
- </search>
- <el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="入库" name="入库">
- <tgTable v-if="activeName == '入库'" ref="tableRef" type="1" @batch-receive="$emit('batch-receive', $event)"></tgTable>
- </el-tab-pane>
- <el-tab-pane label="出库" name="出库">
- <tgTable v-if="activeName == '出库'" ref="tableRef" type="2"></tgTable>
- </el-tab-pane>
- <!-- <el-tab-pane label="出入库明细表" name="出入库明细表">
- <allTable v-if="activeName == '出入库明细表'" ref="tableRef"></allTable>
- </el-tab-pane> -->
- </el-tabs>
- </el-card>
- </div>
- </template>
- <script>
- import search from './components/search.vue';
- import tgDetails from './components/tgDetails.vue';
- import tgTable from './components/tgTable.vue';
- import allTable from './components/allTable.vue';
- export default {
- components: {
- search,
- tgDetails,
- tgTable,
- allTable
- },
- data() {
- return {
- activeName: '入库',
- loading: false
- };
- },
- created() {
- this.applyDashboardFilters();
- },
- watch: {
- '$route.query': {
- handler() { this.applyDashboardFilters(); },
- deep: true
- }
- },
- methods: {
- // 首页下钻沿用申请列表支持的筛选条件。
- applyDashboardFilters() {
- const query = this.$route.query;
- const direction = query.direction || query.tab;
- this.activeName = ['out','出库','2'].includes(String(direction)) ? '出库' : '入库';
- this.$nextTick(() => {
- if (!this.$refs.searchRef) return;
- this.$refs.searchRef.applyRouteFilters(query);
- this.$refs.searchRef.search();
- });
- },
- handleClick(tab) {
- this.activeName = tab.name;
- this.$nextTick(() => {
- if (this.$refs.tableRef) this.$refs.tableRef.reload(this.$refs.searchRef.query());
- });
- },
- /* 刷新表格 */
- reload(where) {
- if (this.$refs.tableRef) this.$refs.tableRef.reload(where);
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- #inboundRequests {
- height: calc(100vh - 96px);
- width: 100%;
- :deep(.el-card) {
- height: 100%;
- .el-card__body {
- height: 100%;
- box-sizing: border-box;
- display: flex;
- flex-direction: column;
- .el-tabs {
- flex: 1;
- display: flex;
- flex-direction: column;
- .el-tabs__content {
- flex: 1;
- .el-tab-pane {
- height: 100%;
- }
- }
- }
- .el-form-item {
- margin-bottom: 5px !important;
- }
- }
- }
- }
- </style>
|