#
whycq
2023-11-10 1c3c95044a9f5462935bb62ae1918b5406f7ae50
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
<template>
    <view>
        <view class="status_bar">
            <!-- 这里是状态栏 -->
        </view>
        <uni-nav-bar left-icon="left" title="详情" @clickLeft="back" @clickRight="scan" :fixed="true" :border="false"
            rightWidth="160rpx" leftWidth="160rpx">
        </uni-nav-bar>
        <view class="main-box">
            <view class="box" v-for="item in list">
                <view class="box-single-row flex-row" v-for="rule in listRule">
                    <view style="flex: 1;">{{rule.label}}</view>
                    <view style="flex: 4;">{{item[rule.attribute]}}</view>
                </view>
            </view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                list: [{
                    businessTripReasons: '沟通立库事宜',
                    businessTransportation$: '交通工具',
                    businessStartAddr$: '出发地',
                    businessEndAddr$: '目的地',
                    businessStartTimeDay$: '出发日期',
                    businessEndTimeDay$: '结束日期',
                    businessDuration$: '出差时长',
                    businessTripDays$: '出差天数',
                    businessPeers: '同行人',
                    userId$: '申请人',
                    orderId: '跟踪项目',
                    updateTime$: '更新时间',
                    updateId$: '更新人员',
                    settle: 1,
                    settle$: '申请通过',
                    businessNotes: '出差备注',
                    createTime$: '2023-11-06 08:51:24',
                    bgcolor: 'color:#24ab59'
                }, ],
                listRule: [
                    {
                        label: "出差事由",
                        attribute: "businessTripReasons",
                    },
                    {
                        label: "交通工具",
                        attribute: "businessTransportation$",
                    },
                    {
                        label: "出发地",
                        attribute: "businessStartAddr$",
                    },
                    {
                        label: "目的地",
                        attribute: "businessEndAddr$",
                    },
                    {
                        label: "出发日期",
                        attribute: "businessStartTimeDay$",
                    },
                    {
                        label: "结束日期",
                        attribute: "businessStartTimeDay$",
                    },
                    
                    {
                        label: "出差时长",
                        attribute: "businessStartTimeDay$",
                    },
                    {
                        label: "出差天数",
                        attribute: "businessEndTimeDay$",
                    },
                    {
                        label: "同行人",
                        attribute: "userId$",
                    },
                    {
                        label: "申请人",
                        attribute: "userId$",
                    },
                    {
                        label: "跟踪项目",
                        attribute: "orderId",
                    },
                    {
                        label: "更新时间",
                        attribute: "updateTime$",
                    },
                    {
                        label: "更新人员",
                        attribute: "updateId$",
                    },
                    {
                        label: "进度",
                        attribute: "settle$",
                    },
                ],
            }
        },
        onLoad(option) {
            let _this = this
            const eventChannel = this.getOpenerEventChannel();
            eventChannel.on('busunessDetl', function(data) {
                _this.list.push(data.data)
                console.log(data)
            })
        },
        methods: {
            back() {
                uni.navigateBack({})
            },
            scan() {
 
            }
        }
    }
</script>
 
<style>
    .main-box {
        border-radius: 20rpx;
        padding: 8rpx;
    }
 
    .box {
        margin: 16rpx 8rpx;
        /* height: 200px; */
        box-shadow: 0 0 5px #dddddd;
        background-color: #FFF;
        padding: 16rpx 32rpx;
        position: relative;
        border-radius: 20rpx;
        font-size: 24rpx;
        /* color: #bdbdbd; */
    }
    .box-single-row {
        display: flex;
    }
</style>