linwe
2024-08-08 3c738f4fe2762bba8087e5a22fc0dc06560eab0e
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
161
162
163
164
165
166
167
168
<template>
    <view>
        <view class="tab">
            <u-tabs :list="tabList" :current="tabIndex" @click="changeTab" :inactiveStyle="{color:'#999999'}"
                :activeStyle="{color:'#017BFC'}"></u-tabs>
        </view>
        <view class="list">
            <view class="list-item bgc-ff mb-20" v-for="(i,k) in list" :key="k" @click="navTo(i.name,i.id)">
                <view class="item-title flex a-i-c j-c-s-b mb-20">
                    <text class="f-32 fw">{{i.name}}</text>
                    <u-tag v-if="i.status == 1" text="待审批" type="warning" plain plainFill></u-tag>
                    <u-tag v-if="i.status == 2" text="审核通过" type="success" plain plainFill></u-tag>
                    <u-tag v-if="i.status == 3" text="审核拒绝" type="error" plain plainFill></u-tag>
                </view>
                <view class="item-row flex a-i-c j-c-s-b">
                    <text class="f-28">时间</text>
                    <text class="f-28 c-66">{{i.createTime}}</text>
                </view>
                <view class="item-row flex a-i-c j-c-s-b">
                    <text class="f-28">地址</text>
                    <text class="address f-28 c-66">{{i.addressName}}</text>
                </view>
            </view>
        </view>
        <u-loadmore :status="loadingStatus" loadmoreText="开始加载" loadingText="数据加载中" nomoreText="没有更多了" line />
    </view>
</template>
 
<script>
    import {
        getAuditReportingList
    } from "@/api/reporting/reporting"
    export default {
        data() {
            return {
                tabList: [{
                        name: "待审核",
                        status: 1
                    },
                    {
                        name: "审核通过",
                        status: 2
                    },
                    {
                        name: "已拒绝",
                        status: 3
                    },
                ],
                tabIndex: 0,
                currentStatus: 1,
                list: [],
                loadingStatus: 'nomore',
                currentPage: 1,
                frequency: '',
            }
        },
 
        onLoad(option) {
            if (option.type == 1) {
                uni.setNavigationBarTitle({
                    title: "一次性"
                })
                this.frequency = 1
            }
            if (option.type == 2) {
                uni.setNavigationBarTitle({
                    title: "周期性"
                })
                this.frequency = 2
            }
            this.getList()
        },
        onReachBottom() {
            this.currentPage++
            this.getList()
        },
 
        methods: {
            changeTab(e) {
                this.tabIndex = e.index;
                this.currentStatus = e.status;
                this.list = [];
                this.currentPage = 1;
                this.getList();
            },
            getList() {
                getAuditReportingList({
                    current: this.currentPage,
                    size: 20,
                    status: this.currentStatus,
                    frequency: this.frequency,
                }).then(res => {
                    if (res.code != 200) {
                        uni.showToast({
                            title: '数据请求失败',
                            icon: 'error'
                        })
                        return
                    }
                    let records = res.data.records;
                    this.list = [...this.list, ...records]
                    this.loadingStatus = 'nomore'
                })
            },
            navTo(name, id) {
                if (name == "旅馆安全") {
                    this.$u.func.globalNavigator(`/subPackage/workbench/views/hotelReportDetail?id=${id}`)
                } else if (name == "取保候审") {
                    this.$u.func.globalNavigator(`/subPackage/workbench/views/bailReportDetail?id=${id}`)
                } else if (name == "校园安全自查") {
                    this.$u.func.globalNavigator(`/subPackage/workbench/views/schoolReportDetail?id=${id}`)
                } else {
                    this.$u.func.globalNavigator(`/subPackage/workbench/views/labelReportDetail?id=${id}`)
                }
            }
        }
    }
</script>
 
<style lang="scss">
    page {
        background-color: #F5F5F5;
    }
 
    .tab {
        width: 100%;
        height: 88rpx;
        position: fixed;
        /*#ifdef H5*/
        top: 88rpx;
        /*#endif*/
        /*#ifdef MP-WEIXIN*/
        top: 0;
        /*#endif*/
        left: 0;
        background-color: #fff;
        padding: 0 30rpx;
        box-sizing: border-box;
        z-index: 999;
 
    }
 
    .tab /deep/.u-tabs__wrapper__nav__item {
        flex: 1;
    }
 
    .list {
        margin: 118rpx 30rpx 0;
    }
 
    .list-item {
        padding: 0 30rpx 20rpx;
        border-radius: 8rpx;
 
        .item-title {
            padding: 30rpx 0;
            border-bottom: 1px solid #F5F5F5;
        }
 
        .item-row {
            padding: 10rpx 0;
 
            .address {
                width: 65%;
            }
        }
    }
</style>