guoyujie
2025-12-04 03627defbc56d0498e7778523da255eb972db6a4
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
<template>
    <view style="width: 100%;height: 100%;">
        <view class="charts-box">
            <qiun-data-charts 
                  type="pie"
                            :opts="opts"
                  :chartData="chartData"
                />
        </view>
        <!-- <uni-table  border stripe  style='width:100%;height: 100%;overflow: auto;'>
            <uni-tr>
                <uni-th align="center">ID</uni-th>
                <uni-th align="center">物料</uni-th>
                <uni-th align="center">尺寸</uni-th>
                <uni-th align="center">总面积</uni-th>
                <uni-th align="center">库存</uni-th>
                <uni-th align="center">可用</uni-th>
                <uni-th align="center">计划</uni-th>
                <uni-th align="center">产地</uni-th>
                <uni-th align="center">备注</uni-th>
            </uni-tr>
            
            <uni-tr v-for="item in datas">
                <uni-td align="center">{{ item.id }}</uni-td>
                <uni-td align="center">{{ item.json.name }}</uni-td>
                <uni-td align="center">{{ item.json.thickness+"*"+item.json.width+"*"+item.json.height }}</uni-td>
                <uni-td align="center">{{ item.totalArea}}</uni-td>
                <uni-td align="center">{{ item.inventoryQuantity }}</uni-td>
                <uni-td align="center">{{ item.availableQuantity }}</uni-td>
                <uni-td align="center">{{ item.planQuantity }}</uni-td>
                <uni-td align="center">{{ item.producer }}</uni-td>
                <uni-td align="center">{{ item.remarks }}</uni-td>
            </uni-tr>
        </uni-table> -->
    </view>
</template>
 
<script setup>
import { onMounted, ref } from 'vue'; 
import request from '../../utils/request'
import { onLoad } from '@dcloudio/uni-app'
const totalSum = ref({})
const datas = ref([])
 
const opts = ref({
        color: ["#1890FF","#91CB74","#FAC858","#EE6666","#73C0DE","#3CA272","#FC8452","#9A60B4","#ea7ccc"],
        padding: [5,5,5,5],
        enableScroll: false,
        extra: {
          pie: {
            activeOpacity: 0.5,
            activeRadius: 10,
            offsetAngle: 0,
            labelWidth: 15,
            border: false,
            borderWidth: 3,
            borderColor: "#FFFFFF"
          }
        }
      })
 
 
let chartData = ref()
 
onLoad(()=>{
    uni.showLoading({
        title: '加载中...',
            mask:true
      })
    getOriginalGlassList()
})
 
 
const getOriginalGlassList = () => {
    
    request.post("/app/getOriginalGlassList").then(res => {
        res.data.glassStock.forEach(data => {
            data.json = JSON.parse(data.json)
        })
        datas.value = res.data.glassStock
        totalSum.value = res.data.totalSum
        
    }).finally(()=>{
        uni.hideLoading()
    })
}
</script>
 
<style scoped>
    .charts-box {
        width: 100%;
        height: 300px;
      }
</style>