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
63
64
65
66
67
68
69
70
71
72
73
74
<template>
  <a-card :bordered="false">
    <a-row type="flex" :gutter="16">
      <a-col :md="5">
        <a-tabs :activeKey="activeKey" @change="tabChange">
          <a-tab-pane key="1" tab="车间层级" force-render>
            <base-tree @getCurrSelected="changeSelectionNode"></base-tree>
          </a-tab-pane>
          <a-tab-pane v-if="isDepartType == 0" key="2" tab="部门层级">
            <depart-tree @getCurrSelectedDD="changeSelectionNodedd"></depart-tree>
          </a-tab-pane>
        </a-tabs>
      </a-col>
      <a-col :md="24-5" :sm="24">
        <equipment-day-avail-main  ref="equipmentDayAvailMain" :nodeTree='selectEquipment'  :nodePeople='selectPeople' :Type="selectTypeTree"></equipment-day-avail-main>
      </a-col>
    </a-row>
  </a-card>
</template>
 
<script>
  import BaseTree from '../common/BaseTree'
  import EquipmentDayAvailMain from './modules/EquipmentDayAvail/EquipmentDayAvailMain'
  import DepartTree from './modules/DepartList/DepartListTree/DepartTree'
  import {mapActions} from 'vuex'
 
  export default {
    name: 'EquipmentDayAvail',
    components:{
      BaseTree,
      EquipmentDayAvailMain,
      DepartTree
    },
    data() {
      return {
        activeKey: '1',
        selectEquipment: {},
        selectPeople:{},
        selectTypeTree: '',
        isDepartType:'',
      }
    },
    created() {
      this.queryTreeData()
    },
    methods: {
      ...mapActions(['QueryDepartTree']),
      queryTreeData() {
          this.QueryDepartTree().then(res => {
          if (res.success) {
            this.isDepartType = res.result[0].value
          } else {
            this.$notification.warning({
              message:'消息',
              description:res.message
            });
          }
        })
      },
      tabChange(val) {
        this.activeKey = val
        this.selectTypeTree = val
      },
      changeSelectionNode(val) {
        this.selectEquipment = val
        this.selectTypeTree = '1'
      },
      changeSelectionNodedd(val) {
        this.selectPeople = val
        this.selectTypeTree = '2'
      }
    }
  }
</script>