YYC
2023-04-14 db1dc3add7bc47c98da408c2e05de28591100bfb
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
<template>
 
 
    <view class="ul">
 
        <u--form labelPositio12n="left" :model="model1" :labelStyle="labelStyle" ref="form1">
            <u-form-item label="预约时间:" labelWidth="80"  prop="dataTime" @click="showDataTime = true" ref="item1">
                <u--input placeholder="请选择日期" v-model="model1.dataTime" prefixIcon="calendar"
                    prefixIconStyle="font-size:50rpx" suffixIcon="arrow-down" border="surround"
                    shape="circle" disabled></u--input>
            </u-form-item>
        </u--form>
        <u-datetime-picker :show="showDataTime" :value="dataTime" mode="date" closeOnClickOverlay
            @confirm="dataTimeConfirm" @cancel="dataTimeClose" @close="dataTimeClose"></u-datetime-picker>
 
        <view class="li" v-for="(item,index) in recordList" :key="index" @click.native="clickRecord(item)">
            <view class="deptName">库区名称:{{item.deptName}}</view>
            <view class="bizType">
                <view class="IN" v-if="item.bizType=='IN'">入库预约</view>
                <view class="OUT" v-if="item.bizType=='OUT'">出库预约</view>
            </view>
            <view class="time">申请时间:{{item.updateTime}}</view>
            <view class="time">预约时间:{{item.dataTime}}</view>
        </view>
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
 
                model1: {
                    dataTime: '',
                    openid: '',
                    customerId: ''
                },
                labelStyle:{
                    fontSize:'17px'
                },
                dataTime: Number(new Date()),
                showDataTime: false,
                recordList: ''
 
            }
        },
        onLoad() {
            this.model1.dataTime = uni.$u.timeFormat(new Date(), 'yyyy-mm-dd')
            var info = JSON.parse(uni.getStorageSync('dept') || '[]');
            console.log(info,"inAndOut")
            this.model1.openid = info.openid
            this.model1.customerId = info.customerId
            
            console.log(JSON.stringify(this.model1))
            uni.request({
                url: 'https://app.fzzygf.com/igds-wx/gateway',
                data: {
                    interfaceId:'2006',
                    data: this.model1
                },
                method:'POST',
                header:{
                    'Content-Type':'application/json'
                },
                success: (res) => {
                    this.recordList = res.data.data
                    console.log(res,"recordList")
                },
            
            })
        },
        methods: {
            clickRecord(item) {
                uni.navigateTo({
                    url: './detail/detail'
                })
                //保存数据需要使用同步的方法,不然在下一个页面可以获取数据,但不能把数据绑定到页面上
                //此方法需要放在uni.navigateTo的下面,不然无法跳转
                uni.setStorageSync('record_detail', JSON.stringify(item))
 
            },
            //关闭预约日期的下拉框
            dataTimeClose() {
                this.showDataTime = false
                this.$refs.form1.validateField('dataTime')
            },
            //点击预约日期下拉框的确认按钮
            dataTimeConfirm(e) {
                console.log(e.value,"e")
                this.showDataTime = false
                this.model1.dataTime = uni.$u.timeFormat(e.value, 'yyyy-mm-dd')
                this.$refs.form1.validateField('dataTime')
                uni.request({
                    url: 'https://app.fzzygf.com/igds-wx/gateway',
                    data: {
                        interfaceId:'2006',
                        data: this.model1
                    },
                    method:'POST',
                    header:{
                        'Content-Type':'application/json'
                    },
                    success: (res) => {
                        this.recordList = res.data.data
                        console.log(res.data,"res")
                    },
                
                })
            },
        }
    }
</script>
<style lang="scss">
    .ul {
        display: flex;
        align-items: center;
        width: 750rpx;
        
        .li {
            width: 730rpx;
            padding: 20rpx;
            margin-top: 30rpx;
            box-shadow: 2rpx 0rpx 10rpx #c1c1c1;
            border-radius: 20rpx;
            position: relative;
 
            .bizType {
                position: absolute;
                top: -15rpx;
                left: 30rpx;
                width: 115rpx;
                height: 100rpx;
                line-height: 38rpx;
                color: #fff;
                text-align: center;
                font-size: 23rpx;
 
                .IN {
                    background-color: #d3c050;
                    border-radius: 10rpx;
                }
 
                .OUT {
                    background-color: #c66cc2;
                    border-radius: 10rpx;
                }
            }
            
            .time{
                padding-top: 10rpx;
            }
 
            .deptName {
                font-size: 35rpx;
                width: 750rpx;
                height: auto;
                line-height: 55rpx;
                margin: 10rpx 0 10rpx 0;
            }
 
        }
    }
</style>