wzp
2022-02-11 1c6c22d91c98e8f8077abc15558c1f5590173057
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
<template>
    <view>
        <view class="">
            <cu-custom bgColor="bg-gradual-blue" >
                <!-- <block slot="backText">返回</block> -->
                <block slot="content">我的申请</block>
            </cu-custom>
        </view>
        <view class="">
            <view class="cu-list menu-avatar">
                <view class="cu-item" v-for="(item,index) in assetsList" :key="index">
                    <view class="cu-avatar radius lg bg-white"
                        style="background-image:url(../../static/device.png);">
                    </view>
                    <view class="content">
                        <view>
                            <view class="text-cut text-bold text-xl">设备</view>
                            <view class="cu-tag radius bg-orange sm">数量:{{item.quantity}}</view>
                        </view>
                        <view class="text-gray text-sm flex">
                            <view class="text-cut">申请时间:{{item.createTime}}</view>
                        </view>
                    </view>
                    <view class="action">
                    <view class="text-grey text-xs">申请状态</view>
                    <view class="cu-tag round bg-red sm">通过</view>
                    </view>
                </view>
            </view>
            
            <view class=""  v-if="listFlag">
                <u-empty mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png">
                </u-empty>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                assetsList:[],
                listFlag:false
            }
        },
        onShow() {
            this.getAssetList();
        },
        methods: {
            //请求
            getAssetList() {
                this.$http.post('/assets/approval/myAssets')
                    .then(res => {
                        // debugger;
                        if(res.data.code===0){
                            this.assetsList =res.data.data;
                            console.log(JSON.stringify(res.data.data[0]))
                        }
                        else{
                            this.listFlag=true;
                        }
                        
                        
                    }).catch(err => {
                        console.log(err.data)
                    })
            }
        }
    }
</script>
 
<style>
 
</style>