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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
| <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 class="floor">
| <view class="wran">删除</view>
| <view class="default" v-show="settle == 1" @click="edit()">修改</view>
| <view class="primary" @click="submit()">{{subTitle}}</view>
| </view>
| </view>
| </template>
|
| <script>
| export default {
| data() {
| return {
| settle: 1,
| subTitle: '申请报销',
| 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: "businessEndTimeDay$",
| },
|
| {
| label: "出差时长",
| attribute: "businessDuration$",
| },
| {
| label: "出差天数",
| attribute: "businessTripDays$",
| },
| {
| label: "同行人",
| attribute: "userId$",
| },
| {
| label: "申请人",
| attribute: "userId$",
| },
| {
| label: "跟踪项目",
| attribute: "orderId",
| },
| {
| label: "更新时间",
| attribute: "updateTime$",
| },
| {
| label: "更新人员",
| attribute: "updateId$",
| },
| {
| label: "进度",
| attribute: "settle$",
| },
| ],
| }
| },
| onLoad(option) {
| let _this = this
| _this.list = []
| const eventChannel = this.getOpenerEventChannel();
| eventChannel.on('busunessDetl', function(data) {
| _this.list.push(data.data)
| _this.settle = data.data.settle
| if (data.data.settle == 1) {
| _this.subTitle = '审批'
| }
| })
| },
| methods: {
| submit() {
| if (this.settle == 1) {
| this.approval()
| } else {
| this.reimburse()
| }
| },
| // 审批
| approval() {
| let _this = this
| uni.request({
| url: `${_this.baseUrl}/businessTrip/approval/auth`,
| header: {
| 'token': uni.getStorageSync('token'),
| 'content-type': 'application/x-www-form-urlencoded;charset=UTF-8'
| },
| method: 'POST',
| sslVerify: false,
| data: {planId: _this.list[0].id},
| success(res) {
| res = res.data
| // console.log(res);
| if (res.code === 200) {
| uni.showToast({title: res.msg, icon: "none", position: 'top'})
| setTimeout(()=>{
| uni.navigateBack({})
| },1000)
| } else if (res.code === 500) {
| uni.showToast({title: res.msg, icon: "none", position: 'top'})
| }
| }
| })
| },
| // 申请报销
| reimburse() {
| let _this = this
| uni.navigateTo({
| url: '/pages/business/goBusiness/modiReimburseOnlineDetl',
| success: function(res) {
| res.eventChannel.emit('reimburseOnlineDetl', {
| data: 'add2',
| detl: _this.list[0]
| })
| }
| })
| },
| edit() {
| let _this = this
| uni.navigateTo({
| url: '/pages/business/goBusiness/addgoBusiness',
| success: function(res) {
| res.eventChannel.emit('modiGoBusinessDetl', {
| data: 'modi',
| detl: _this.list[0]
| })
| }
| })
| },
| 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;
| }
|
| .floor {
| height: 100rpx;
| line-height: 100rpx;
| width: 100%;
| background-color: #fff;
| position: fixed;
| bottom: 0;
| left: 0;
| display: flex;
| align-items: center;
| text-align: center;
| letter-spacing: 10rpx;
| }
| .default {
| flex: 2;
| }
| .default:active {
| background-color: #eff0f1;
| }
| .wran {
| flex: 1;
| background-color: #ff5722;
| color: #fff;
| }
| .primary {
| flex: 2;
| background-color: #2d8cf0;
| color: #fff;
| }
| .primary:active {
| background-color: #007dea;
| }
| </style>
|
|