333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
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
<template>
  <div class="chart-wrapper">
    <div class="demo-form-inline">
      <div class="haocai-title">剩余货位实时图</div>
      <el-select v-model="formData.storage_Id" placeholder="请选择" class="w-200" @change="changeDay()">
        <el-option v-for="item in storageNames" :key="item.storage_Id" :label="item.storageName" :value="item.storage_Id">
        </el-option>
      </el-select>
    </div>
    <div class="haocai-title"></div>
    <el-row :gutter="10">
      <el-col v-for="item in dataInfo" :xs="24" :sm="12" :lg="8" :key="item">
        <ring-chart ref="ringchartOne" :ring-color="'#ff6699'" :ring-value="item.blankCount" :data1="(100.0 * dataInfo.data2/dataInfo.data1)" :data2="100-(100.0 * dataInfo.data2/dataInfo.data1)" />
        <div class="haocai-title">{{ item.AreaCode }}</div>
      </el-col>
    </el-row>
  </div>
</template>
 
<script>
import RingChart from "../components/RingChart";
 
export default {
  components: {
    RingChart
  },
  data() {
    return {
      formData: {
        storage_Id: null, // 仓库id
        storageName: null
      },
      // 仓库 列表
      storageNames: null,
      dataInfo: []
    };
  },
  mounted() {
    this.getRingData();
    this.getStorageList();
  },
  methods: {
    getRingData(refresh) {
      const id = this.formData.storage_Id;
      const url = "/api/dashboard/wms/getRingData";
      const params = {
        refresh: refresh,
        id: id
      };
      var callback = res => {
        if (res.result) {
          this.dataInfo = res.data;
        }
      };
      this.common.ajax(url, params, callback, true);
    },
    changeDay() {
      this.getRingData(true);
    },
    // 获取仓库
    getStorageList() {
      const url = "/api/basicInfo/base/storage/getList";
      const params = {};
      var callback = res => {
        if (res.result) {
          this.storageNames = res.data;
        }
      };
      this.common.ajax(url, params, callback);
    }
  }
};
</script>
 
<style rel="stylesheet/scss" lang="scss" scoped>
.chart-wrapper {
  background: #fff;
  padding: 16px 16px;
  margin-bottom: 10px;
  .haocai-title {
    text-align: center;
    color: #888;
    font-size: 18px;
  }
}
</style>