ke_junjie
2025-06-04 bb6e2230bb8ded3c5546bc4e4c282ee343754475
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<template>
  <!-- 分类统计 -->
  <div id="Ouptput" class="global-content backgroundrgb">
    <div class="width80 height margin-auto overflow">
      <div class="margintopbot height width overflow">
        <!-- <p class="fontsize2rem text-center">零件出入库统计</p> -->
        <div class="width margintopbot flex justify-end">
          <el-date-picker
            v-model="datatime"
            size="mini"
            type="datetimerange"
            value-format="yyyy-MM-dd HH:mm:ss"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
          >
          </el-date-picker>
          <!-- <el-date-picker
            size="mini"
            v-model="datatime"
            type="date"
            :clearable="false"
            value-format="yyyy-MM-dd"
            placeholder="选择日期"
          >
          </el-date-picker> -->
          <el-button class="margin-left margin-right" type="primary" size="mini" @click="goodsinquer">查询</el-button>
        </div>
        <!-- <div class="width98 height82 margintopbot echart-height">
          <line-echart
            titleechart="出入库任务"
            :linelist="BarItemlinelist"
            :colorList="barcolorList"
            class="width height"
            colors="#fff"
          />
        </div> -->
        <div class="width98 height45 margintopbot echart-height">
          <line-echart
            titleechart="零件数量统计"
            :linelist="BarItemlinelist"
            :colorList="barcolorList"
            colors="#fff"
            class="width height"
          />
        </div>
        <div class="width98 height45 margintopbot echart-height">
          <line-echart
            titleechart="器具出入库统计"
            :linelist="Containerlinelist"
            :colorList="concolorList"
            colors="#fff"
            class="width height"
          />
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import { GetInOutCountByHour } from '@/api/output';
import { GetHomeBarItemData, GetHomeBarContainerData } from '@/api/Didproject';
import LineEchart from './components/lineEcharts.vue';
import { getDate, GetDateStr, GetTimeStr } from '@/utils/date';
export default {
  data() {
    return {
      datatime: [GetDateStr(-15) + ' 00:00:00', getDate() + ' ' + GetTimeStr(0)],
      BarItemlinelist: {}, //零件出入数量
      Containerlinelist: {}, //出入库数量
      barcolorList: ['#ffc637', '#fc7293', '#8477e9', '#2599f0', '#31c3ea', '#17d8b9', '#e8bdf3'],
      concolorList: ['#31c3ea', '#17d8b9', '#2599f0', '#e8bdf3', '#ffc637', '#fc7293', '#8477e9']
    };
  },
  components: { LineEchart },
  computed: {},
  mounted() {
    this.GetHomeBarItemData();
    this.GetHomeBarContainerData();
  },
  methods: {
    //时间查询
    goodsinquer() {
      this.GetHomeBarItemData();
      this.GetHomeBarContainerData();
    },
    //获取零件的出入库数量
    GetHomeBarItemData() {
      let time = {
        startTime: this.datatime ? this.datatime[0] : '',
        endTime: this.datatime ? this.datatime[1] : ''
      };
      this.BarItemlineshow = false;
      GetHomeBarItemData(time).then(res => {
        this.BarItemlinelist = res.data;
        this.BarItemlineshow = true;
      });
    },
    //获取器具的出入库数量
    GetHomeBarContainerData() {
      let time = {
        startTime: this.datatime ? this.datatime[0] : '',
        endTime: this.datatime ? this.datatime[1] : ''
      };
      this.$Loading(true);
      this.Containerline = false;
      GetHomeBarContainerData(time).then(res => {
        this.Containerlinelist = res.data;
        this.Containerline = true;
        this.$Loading();
      });
    }
    //获取零件的出入库数量
    // GetInOutCountByHour() {
    //   let time = {
    //     startTime: this.datatime + ' 00:00:00',
    //     endTime: this.datatime + ' 23:59:59'
    //   };
 
    //   GetInOutCountByHour(time).then(res => {
    //     // this.BarItemlinelist = res.data;
    //   });
    // }
  }
};
</script>
 
<style lang="scss" scoped></style>