Mr.Zhang
2023-09-06 a89fe32c353040bbb95d7519cf7bafc4b5934f10
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
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
<template>
    <view class="index">
        <!-- <web-view v-if="show" @onPostMessage="onMessage" :src="'https://dmtest.ahapp.net/doumeeplant_h5/#/appletLogin?code=' + code"></web-view> -->
        <!-- {{$store.state.statusbarHeight}} -->
 
        <u-sticky>
            <view class="plr50 pb30 nav-style">
                <view
                    :style="{paddingTop: `${statusbarHeight}px`, height: `${navHeight}px`, lineHeight:`${navHeight}px`, textAlign: 'center'}">
                    待办</view>
                <view class="cY">
                    <u-search placeholder="搜索关键字" bgColor="#f7f7f7" :showAction="false" @search="scrolltoupper"
                        shape="square" v-model="searchForm.mixParam"></u-search>
                    <image src="../../static/filter@2x.png" class="img48 ml20" @click="filterAction" mode=""></image>
                </view>
                <view class="cY mt30">
                    <view v-for="item in tagList" :key="item.id" class="sbtn rd8 mr10"
                        :class="searchForm.status==item.id?'sbtn_green':'sbtn_black_rim'" @click="selectType(item.id)">
                        {{`${item.name}(${item.num})`}}
                    </view>
                </view>
            </view>
        </u-sticky>
        <scroll-view v-if="projectList.length" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered"
            :refresher-threshold="100" @refresherpulling="scrolltolower" @refresherrefresh="scrolltoupper"
        >
            <view v-for="(item, index) in projectList" :key="index">
                <view class="box_list">
                    <view class="box_list_item" @click="jump(item)">
                        <view class="box_list_item_icon">
                            <image src="../../static/daiban_ic_daiban@2x.png" mode=""></image>
                        </view>
                        <view class="box_list_item_nr">
                            <view class="box_list_item_nr_top">
                                <span>{{item.title}}</span>
                                <span>{{item.createTime}}</span>
                            </view>
                            <view class="box_list_item_nr_bottom">
                                {{item.content}}
                            </view>
                        </view>
                    </view>
                </view>
            </view>
        </scroll-view>
        <view v-else class="tc c6">暂无数据...</view>
        <u-popup :show="show" @close="close" :round="8" zIndex="20000">
            <view class="rp p40 contanir">
                <view class="c2 b">类型</view>
                <view class="content">
                    <u-grid col="2" :border="false">
                        <u-grid-item v-for="item in types" :key="item.id">
                            <view class="ptb20 c9 type-style tc rd10" :class="type===item.id?'sbtn_green':'sbtn_gray'"
                                @click="type=item.id">{{ item.name }}</view>
                        </u-grid-item>
                    </u-grid>
                </view>
                <view class="flex ap tc bottom-view">
                    <view class="fx1 ptb20 sbtn_gray c9" @click="resetType">重置</view>
                    <view class="fx1 ml20 ptb20 sbtn_green" @click="confirm">确定</view>
                </view>
            </view>
        </u-popup>
        <myTabbar :index="0" />
    </view>
</template>
 
<script>
    import myTabbar from "@/components/myTabber.vue"
    import {
        getList,
        pageCount
    } from '@/util/api/agencyAPI'
    import {
        mapState
    } from 'vuex'
    export default {
        components: {
            myTabbar
        },
        data() {
            return {
                code: '',
                windowHeight: '',
                show: false,
                types: [{
                        id: 0,
                        name: '车间领料-待发货'
                    },
                    {
                        id: 1,
                        name: '车间领料-待入库'
                    },
                    {
                        id: 2,
                        name: '机台备料-待发货'
                    },
                    {
                        id: 3,
                        name: '机台备料-待入库'
                    },
                    {
                        id: 4,
                        name: '完工入库-待接收'
                    },
                    {
                        id: 5,
                        name: '库存转库-待发货'
                    },
                    {
                        id: 6,
                        name: '库存转库-待入库'
                    },
                    {
                        id: 7,
                        name: '申请审批'
                    },
                    {
                        id: 8,
                        name: '客退/返品回厂检验'
                    }
                ],
                tagList: [{
                        id: 0,
                        name: '待办',
                        num: 0
                    },
                    {
                        id: 1,
                        name: '已办',
                        num: 0
                    }
                ],
                type: '',
                searchForm: {
                    mixParam: '',
                    status: 0,
                    type: ''
                },
                page: {
                    total: 0,
                    capacity: 10,
                    page: 1,
                },
                projectList: []
            }
        },
        computed: {
            ...mapState(['statusbarHeight', 'navHeight']),
        },
        async mounted() {
            await this.$store.dispatch('getUpcomingNum')
            this.tagList[0].num = this.$store.state.upcomingNum.d
            this.tagList[1].num = this.$store.state.upcomingNum.y
        },
        onLoad() {
            uni.getSystemInfo({
                success: res => {
                    this.windowHeight = res.windowHeight
 
                }
            })
            this.loadData()
        },
        methods: {
            loadData() {
                getList({
                        model: this.searchForm,
                        ...this.page
                    })
                    .then(res => {
                        let data = res.data
                        if (data.page == 1) {
                            this.projectList = []
                        }
                        this.page.page = data.page
                        this.page.total = data.total
                        this.projectList.push(...data.records)
                    })
                    .catch(err => {
 
                    })
            },
            scrolltolower() {
                this.page.page = 1
                this.loadData()
            },
            scrolltoupper() {
                this.page.page += 1
                this.loadData()
            },
            selectType(status) {
                if (this.searchForm.status == status) return
                this.searchForm.status = status
                this.scrolltolower()
            },
            jump(item) {
                if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 0) { // 跳转出库(转库单)
                    uni.navigateTo({
                        url: 'pages/OutOperation/OutOperation',
                        query: {
                            id: item.objId,
                            dbid: item.id,
                            type: 7
                        }
                    })
                    // router.push({
                    //     name: 'issueOperation',
                    //     query: {
                    //         id: item.objId,
                    //         dbid: item.id,
                    //         type: 7
                    //     }
                    // })
                } else if ((item.type === 0 || item.type === 2 || item.type === 5) && item.status === 1) {
                    // router.push({
                    //     name: 'wTransferDetail',
                    //     query: {
                    //         id: item.objId,
                    //         status: item.status,
                    //         type: item.type,
                    //         dbid: item.id
                    //     }
                    // })
                } else if ((item.type === 1 || item.type === 4 || item.type === 6) && item.status === 0) { // 跳转入库(转库单)
                    if (item.type === 4) { // 跳转完工入库详情
                        // router.push({
                        //     name: 'completionDetails',
                        //     query: {
                        //         id: item.objId,
                        //         dbid: item.id,
                        //         type: 7,
                        //         isShow: 1,
                        //         Type: item.type
                        //     }
                        // })
                        return
                    }
                    uni.navigateTo({
                        url: '/pages/InOperation/InOperation',
                        query: {
                            id: item.objId,
                            dbid: item.id,
                            type: 7
                        }
                    })
                    // router.push({
                    //     name: 'warehousing',
                    //     query: {
                    //         id: item.objId,
                    //         dbid: item.id,
                    //         type: 7
                    //     }
                    // })
                } else if ((item.type === 1 || item.type === 4 || item.type === 6) && item.status === 1) {
                    if (item.type === 4) { // 跳蛛完工入库详情
                        // router.push({
                        //     name: 'completionDetails',
                        //     query: {
                        //         id: item.objId,
                        //         dbid: item.id,
                        //         type: 7,
                        //         isShow: 2
                        //     }
                        // })
                        return
                    }
                    // router.push({
                    //     name: 'wTransferDetail',
                    //     query: {
                    //         id: item.objId
                    //     }
                    // })
                } else if (item.type === 3 && item.status === 0) { // 确认备料
                    // router.push({
                    //     name: 'orderStock',
                    //     query: {
                    //         id: item.objId,
                    //         dbid: item.id
                    //     }
                    // })
                } else if (item.type === 3 && item.status === 1) { // 备料(转库单详情)
                    // router.push({ name: 'wInboundDetail', query: { id: item.objId } })
                    // router.push({
                    //     name: 'wTransferDetail',
                    //     query: {
                    //         id: item.objId
                    //     }
                    // })
                } else if (item.type === 9 && item.status === 0) { // 调整入库(入库单)
                    // router.push({
                    //     name: 'warehousing',
                    //     query: {
                    //         id: item.objId,
                    //         dbid: item.id,
                    //         type: 9
                    //     }
                    // })
                } else if (item.type === 9 && item.status === 1) {
                    // router.push({
                    //     name: 'wInboundDetail',
                    //     query: {
                    //         id: item.objId
                    //     }
                    // })
                }
            },
            filterAction() {
                this.show = true
            },
            close() {
                this.show = false
            },
            resetType() {
                this.type = ''
                this.searchForm.type = ''
                this.confirm()
            },
            confirm() {
                this.searchForm.type = this.type
                this.show = false
                this.scrolltoupper()
            }
        }
    }
</script>
 
<style lang="scss" scoped>
    .index {
        width: 100vw;
        height: 100vh;
    }
 
    .nav-style {
        border-bottom: 20rpx #f7f7f7 solid;
    }
 
    .box_list {
        width: 100%;
        padding: 0 30rpx;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
 
        .box_list_item {
            padding: 30rpx 0;
            display: flex;
            border-bottom: 1rpx solid #E5E5E5;
 
            &:last-child {
                border: none;
            }
 
            .box_list_item_icon {
                flex-shrink: 0;
                width: 64rpx;
                height: 64rpx;
                margin-right: 24rpx;
                position: relative;
 
                .box_list_item_icon_active {
                    position: absolute;
                    right: 0;
                    top: 0;
                    width: 18rpx;
                    height: 18rpx;
                    border-radius: 50%;
                    background: #DE5243;
                    border: 2rpx solid #FFFFFF;
                }
 
                image {
                    width: 100%;
                    height: 100%;
                }
            }
 
            .box_list_item_nr {
                flex: 1;
                display: flex;
                flex-direction: column;
 
                .box_list_item_nr_top {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
 
                    span {
                        &:first-child {
                            font-size: 30rpx;
                            font-weight: 500;
                            max-width: 450rpx;
                            color: #222222;
                            overflow: hidden;
                            white-space: nowrap;
                            text-overflow: ellipsis;
                            -o-text-overflow: ellipsis;
                        }
 
                        &:last-child {
                            flex-shrink: 0;
                            font-size: 24rpx;
                            font-weight: 400;
                            color: #999999;
                            margin-left: 10rpx;
                            overflow: hidden;
                            white-space: nowrap;
                            text-overflow: ellipsis;
                            -o-text-overflow: ellipsis;
                        }
                    }
                }
 
                .box_list_item_nr_bottom {
                    font-size: 28rpx;
                    font-weight: 400;
                    color: #666666;
                    margin-top: 16rpx;
                    word-break: break-all;
                }
            }
        }
    }
 
    .contanir {
        height: calc(env(safe-area-inset-bottom) + 720rpx);
 
        .content {
            margin-top: 20rpx;
 
            .type-style {
                width: 325rpx;
                margin-bottom: 20rpx;
            }
        }
    }
 
    .bottom-view {
        left: 40rpx;
        right: 40rpx;
        bottom: 0
    }
</style>