zhouwenxuan
2023-08-04 b7d59880975d3aa75760e764c20c2c4217039c78
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<template>
    <view class="box">
        <!-- 自定义导航栏 -->
        <view class="navBarBox fix">
            <!-- 状态栏占位 -->
            <view class="statusBar" :style="{ paddingTop: statusBarHeight + 'px' }"></view>
            <!-- 真正的导航栏内容 -->
            <view style="display: flex; flex-direction: column;">
                <view class="navBar">
                    <u-icon style=" margin-left: -25px;" name="arrow-left" color="black" size="17" @click="goBack" />
                    <view class="barText">叫应率统计</view>
                </view>
            </view>
        </view>
        <view class="responseCard">
            <view class='title'>{{title}}</view>
            <table class="table">
              <thead class="head">
                <tr>
                  <th></th>
                  <th>处理情况</th>
                  <th v-if="unittype == 4">叫应时间</th>
                  <th v-else>转发叫应率</th>
                  <th v-if="unittype == 4">反馈</th>
                  <th v-else>详情</th>
                </tr>
              </thead>
              <tbody class="tableBody">
                <tr v-for="(item, index) in tableData" :key="index" >
                  <td align="center" width="90px">{{ item.receiveUnit }}</td>
                  <td align="center">{{ item.response }}</td>
                  <td align="center" v-if="unittype == 4" width="85px">{{ item.responseTime }}</td>
                  <td align="center" v-else>{{ item.responsivity }}</td>
                  <td>
                      <u-button
                        v-if="unittype == 4"
                        size="medium"
                          type="text" 
                          style="color: blue"
                          @click="toDetail(item)"
                          >查看
                      </u-button>
                    <u-button 
                        v-else
                        size="medium"
                        type="text" 
                        style="color: sandybrown"
                        @click="toNext(item)"
                        >叫应详情
                    </u-button>
                </td>
                </tr>
              </tbody>
            </table>
        </view>
    </view>
</template>
 
<script>
    import { getResponseDetail,getMeasureDetail } from '../../../api/notice.js'
    export default {
        data() {
            return {
                page: 'pages/tabBar/count/count',
                statusBarHeight: '',
                tableData: [],
                unittype: null,
                title: ''
            }
            
        },
        onLoad(options) {
            let test = options.data && JSON.parse(decodeURIComponent(options.data));
            console.log("data",test)
            this.title = test.title;
            this.tableData = test.appPageResponseByIdRespDTOS;
            this.unittype = this.tableData[0].unittype;
            console.log("unittype",this.tableData)
            this.tableData.forEach((item,index) => {
                this.tableData[index].response = item.responseStatus ==1 ? '待叫应' :item.responseStatus == 2 ? '已叫应' :'超时未叫应'
                this.tableData[index].responsivity = item.forwardRate ? item.forwardRate :'--';
                this.tableData[index].responseTime = item.responseTime ? item.responseTime :'--';
            })
            this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
            uni.hideTabBar();
        },
        methods: {
            goBack() {
                uni.switchTab({
                    url:'/pages/tabBar/current/current'
                });
            },
            toNext(item) {
                if(item.forwardWarnInfoId != null){
                    const param = {
                        pageIndex: 1,
                        pageSize: 100,
                        searchParams: {
                            warnInfoId: item.forwardWarnInfoId
                        }
                    }
                    getResponseDetail(param).then(res => {
                        if(res.code == 100){
                            this.tableData = res.data.appPageResponseByIdRespDTOS;
                            this.unittype = this.tableData[0].unittype;
                            this.tableData.forEach((item,index) => {
                                this.tableData[index].response = item.responseStatus ==1 ? '待叫应' :item.responseStatus == 2 ? '已叫应' :'超时未叫应'
                                this.tableData[index].responsivity = item.forwardRate ? item.forwardRate :'--'
                            })
                        }
                    })
                }else {
                    uni.showToast({
                        icon: 'none',
                        title: '暂无下级转发数据',
                        duration: 3000
                    })
                }
            },
            toDetail(item){
                console.log("d",item)
                getMeasureDetail({id: item.id}).then(res => {
                    if(res.code == 100){
                        if(res.data.baseMeasures && res.data.baseMeasures.length>0 ){
                            uni.navigateTo({
                              url: `/pages/tabBar/responsivity/showMeasures?data=` + encodeURIComponent(JSON.stringify(res.data))
                            })
                        }else{
                            uni.showToast({
                                icon: 'none',
                                title: '该记录暂无响应措施',
                                duration: 3000
                        })
                        }
                    }
                })
            }
        }
    }
 
</script>
 
<style lang='scss' scoped>
.box {
    display: flex; 
    flex-direction: column; 
    width: 100%; 
    height: 100%;
}
.fix{
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
}
.navBarBox .navBar {
    background-color:#fff;
      height: 50px;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;
      box-shadow: 0 3px 12px rgba(0,0,0,0.05);
}
.barText{
    text-align: center;
    width: 85%;
    font-size: 16px;
    /* text-align: center; */
    font-weight: 600;
}
.statusBar{
    background-color:lightgrey;
}
.responseCard{
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0,0,0,0.05);
    margin: 12px 12px 20px;
    border-radius: 5px;
    padding: 20px 12px;
}
.table{
    .head{
        color: white;
        line-height: 35px;
        background-color: rgb(66, 157, 218);
    }
    .tableBody{
        color: black;
        background-color: rgb(207, 223, 241);
        line-height: 35px;
    }
    tr:nth-child(odd+1) {
        background-color: rgb(207, 223, 241); /* 设置奇数行颜色 */
    }
    tr:nth-child(even) {
        background-color: rgb(233, 239, 248); /* 设置偶数行颜色 */
    }
}
.title{
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}
</style>