add
yirongjin
2025-07-23 4a7f6e608d9e16d5f508829f53a001684467a99f
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<template>
  <!-- 任务平均时长-->
  <div id="tasktime" class="global-content">
    <div class="width flex align-center justify-end">
      <label class="color909399 fontsiez1rem">查询日期:</label>
 
      <el-date-picker
        size="mini"
        v-model="datatime"
        type="date"
        :clearable="false"
        value-format="yyyy-MM-dd"
        placeholder="选择日期"
      >
      </el-date-picker>
      <el-button type="primary" size="mini" @click="inquer">查询</el-button>
      <el-button type="primary" size="mini" @click="linkto">跳转</el-button>
    </div>
    <div class="width height-calc90 overflow margin-top4">
      <line-echarts
        titleechart="出入库任务"
        :linelist="BarItemlinelist"
        :colorList="barcolorList"
        class="width height"
        colors="#fff"
      />
    </div>
  </div>
</template>
 
<script>
import { GetInOutCountByHour } from '@/api/output';
import { getDate } from '@/utils/date';
import lineEcharts from '@/views/dataview/components/lineEcharts.vue';
export default {
  data() {
    return {
      datatime: getDate(),
      BarItemlinelist: {}, //数量
      concolorList: ['#31c3ea', '#17d8b9', '#2599f0', '#e8bdf3', '#ffc637', '#fc7293', '#8477e9']
    };
  },
  components: { lineEcharts },
  computed: {},
  mounted() {
    this.GetInOutCountByHour();
  },
  methods: {
    inquer() {
      this.GetInOutCountByHour();
    },
    //跳转
    linkto() {
      const { href } = this.$router.resolve({
        path: '/output'
      });
      window.open(href, '_blank');
    },
    GetInOutCountByHour() {
      let time = {
        startTime: this.datatime + ' 00:00:00',
        endTime: this.datatime + ' 23:59:59'
      };
      this.BarItemlinelist = {
        legend: ['入库', '出库', '总计'],
        xdata: [
          '2021-06-14 00:00:00',
          '2021-06-14 01:00:00',
          '2021-06-14 02:00:00',
          '2021-06-14 03:00:00',
          '2021-06-14 04:00:00',
          '2021-06-14 05:00:00',
          '2021-06-14 06:00:00',
          '2021-06-14 07:00:00',
          '2021-06-14 08:00:00',
          '2021-06-14 09:00:00',
          '2021-06-14 10:00:00',
          '2021-06-14 11:00:00',
          '2021-06-14 12:00:00',
          '2021-06-14 13:00:00',
          '2021-06-14 14:00:00',
          '2021-06-14 15:00:00',
          '2021-06-14 16:00:00',
          '2021-06-14 17:00:00',
          '2021-06-14 18:00:00',
          '2021-06-14 19:00:00',
          '2021-06-14 20:00:00',
          '2021-06-14 21:00:00',
          '2021-06-14 22:00:00',
          '2021-06-14 23:00:00'
        ],
        data: [
          {
            name: '入库',
            xdata: [
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '29',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00'
            ]
          },
          {
            name: '出库',
            xdata: [
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '79',
              '0.00',
              '0.00',
              '0.00',
              '0.00',
              '0.00'
            ]
          }
        ]
      };
      GetInOutCountByHour(time).then(res => {
        // this.BarItemlinelist = res.data;
      });
    }
  }
};
</script>
 
<style lang="scss" scoped>
#tasktime {
}
</style>