#
zjj
2024-04-07 e6a02c8b09a796e436a501e9b87d19e25c34c9d1
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
<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"
            >
            <block slot="right">
                <view class="city">
                    <view>
                        <text class="uni-nav-bar-text">{{user.username}}</text>
                    </view>
                    <uni-icons type="arrowdown" color="#333333" size="20" />
                </view>
            </block>
         </uni-nav-bar>
         
         <view class="card" v-for="item in items" >
             <view class=card @click="goDetl(item)">
                 <view class="item100noborder" >
                     <view class="box-time" style="flex: 1;">{{item.weeklyDay$}}</view>
                     <view class="box-time">{{item.dailyTime$}}</view>
                 </view>             
                 <view class="item100">
                     <view class="code-decs">工作内容</view>
                     {{item.workContent}}
                 </view>
                 <view class="item100">
                     <view class="code-decs">工作目的</view>
                     {{item.workPurpose}}
                 </view>
                 <view class="item100">
                     <view class="code-decs">甲方单位</view>
                     {{item.cstmrId$}}
                 </view>
             </view>
             
             <view class="buttomcss">
                 <button  size="mini" class="mini-btn" type="default" @click="goDayStroke(item)">查看当前日行程</button>
                <button  size="mini" class="mini-btn" type="primary" @click="goDayStrokeCreate(item)">创建日行程</button>
             </view>
             
             
         </view>
        
    </view>
</template>
 
<script>
    export default {
        data() {
            return {
                user: {
                    username: '',
                    id: 0,
                    type: ''
                },                
                token: '',
                items:[]
                
            }
        },
        onShow() {
            // this.baseUrl = uni.getStorageSync('baseUrl');
            this.token = uni.getStorageSync('token');
            
        },
        onLoad(option) {
            let _this = this
            _this.items = []
            const eventChannel = this.getOpenerEventChannel();
            eventChannel.on('weekly', function(data) {    
                
                uni.request({
                    url: `${_this.baseUrl}/weeklyDailyPlan/list/auth`,
                    // method: 'POST',
                    header: { 'token': uni.getStorageSync('token') },
                    data: {
                        weekly_id: data.data.id
                    },
                    success(res) {
                        res = res.data.data
                        _this.items = res.records
                        console.log(res.records)
                    }
                })
                _this.items = data
                console.log(data);
                
            })
            
        },
        methods: {
            goDayStrokeCreate(e){
                uni.navigateTo({
                    url: '/pages/business/process/dayStrokeCreate',
                    success: function(res) {
                        res.eventChannel.emit('dayStrokeCreate', {
                            data: e
                        })
                    }
                })
            },
            goDayStroke(e){
                uni.navigateTo({
                    url: '/pages/business/process/dayStroke',
                    success: function(res) {
                        res.eventChannel.emit('dayStroke', {
                            data: e
                        })
                    }
                })
            },
            goDetl(e) {
                // console.log(e);
                uni.navigateTo({
                    url: '/pages/business/process/dayDetl',
                    success: function(res) {
                        res.eventChannel.emit('day', {
                            data: e
                        })
                    }
                })
            },
            getOrderNoList() {
                let that = this
                uni.request({
                    url: this.baseUrl + '/originRule/list/all',
                    method: 'POST',
                    success(res) {
                        res = res.data
                        that.menuList = res.data
                    }
                })
            },
            chose(item) {
                let that = this
                uni.navigateTo({
                    url: "./goodsUp2",
                    success: function(res) {
                        // 通过eventChannel向被打开页面传送数据   向另外一个页面传递值的
                        res.eventChannel.emit('item', {
                            item: item
                        })
                    },
                    events: {
                        // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据  另外一个页面传过来的
                        acceptDataFromOpenedPage: function(data) {
                            // that.matnr = data.data
                            that.input(that.matnr)
                        },
                    },
                
                
                });
            },
            back() {
                uni.navigateBack({})
            },scan() {
                uni.navigateTo({
                    url: '/pages/authority/authority'
                })
            },
        }
    }
</script>
 
<style>
    .box-time {
        color: #bdbdbd;
    }
    .card {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        margin: 20rpx;
        background-color: #ffffff;
        border-radius: 20rpx;
        color: #000000;
    }
    .card2 {
        display: flex;
        flex-wrap: wrap;
        padding: 20rpx;
        justify-content: space-between;        
        background-color: #ffffff;
        border-radius: 20rpx;
        color: #000000;
    }
    .uni-pb-5 {
        padding-bottom: 10px;
    }
    .uni-px-5 {
        padding-left: 10px;
        padding-right: 10px;
    }
    .buttom {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 100rpx;
        background-color: #FFF;
        box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.2) ;
    }
    .item {
        width: 40%;
        display: flex;
        align-items: center;
        height: 70rpx;
        padding: 0px 10upx 0px;
        /* margin-left: 20rpx; */
        border-bottom: 1px solid #b7b7b7;
    }
    .item100 {
        width: 100%;
        display: flex;
        align-items: center;
        height: 70rpx;
        padding: 0px 10upx 0px;
        /* margin-left: 20rpx; */
        border-bottom: 1px solid #b7b7b7;
    }
    .item100noborder {
        width: 100%;
        display: flex;
        align-items: center;
        height: 70rpx;
        padding: 0px 10upx 0px;
        /* margin-top: 0rpx; */
        /* border-bottom: 1px solid #000000; */
    }
    .code-decs {
        width: 20vw;
        font-size: 15px;
        color: #8c8c8c;
    }
    .buttomcss {
        display: flex;
        width: 100%;
        margin: 0 0 5px;
        /* text-align: center; */
    }
    button{
        font-size: 10rpx;
    }
</style>