张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<template>
  <div class="main" style="overflow:hidden">
    <div class="main_tabs">
      <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="原材料消耗" name="first">
                <material-cost ref="Materials"></material-cost> 
            </el-tab-pane>
            <el-tab-pane label="钢筋消耗" name="second">
                <rebar-cost ref="Rebars"></rebar-cost>
            </el-tab-pane>
            <el-tab-pane label="辅材消耗" name="third">
                <auxiliary-cost ref="Auxiliarys"></auxiliary-cost>
            </el-tab-pane>
        </el-tabs>
    </div>
  </div>
</template>
<script>
import MaterialCost from './components/MaterialCost.vue'//原材料消耗
import RebarCost from './components/RebarCost.vue'//钢筋消耗
import AuxiliaryCost from './components/AuxiliaryCost.vue'//辅材消耗
export default {
    components:{
        MaterialCost,
        RebarCost,
        AuxiliaryCost,
    },
    data(){
        return{
            activeName:'first'
        }
    },
    mounted(){
        this.$refs.Materials.searchButtonInfo();
    },
    methods:{
        //切换界面
        handleClick(tab){
            switch(tab.name){
                case 'second':
                    this.$refs.Rebars.searchButtonInfo();
                    break;
                case 'third':
                    this.$refs.Auxiliarys.searchButtonInfo();
                    break;
                default:
                    this.$refs.Materials.searchButtonInfo();
            }
        },
    }
}
</script>
<style scoped lang="scss">
@import'@/style/layout-main.scss';
/deep/ .el-tabs__content{
    position: static;
}
 
/deep/.main {
  background: none;
}
</style>