|
@@ -16,9 +16,9 @@ Page({ |
|
@@ -16,9 +16,9 @@ Page({ |
16
|
"门诊服务"
|
16
|
"门诊服务"
|
17
|
],
|
17
|
],
|
18
|
time_arr: [
|
18
|
time_arr: [
|
19
|
- "上午", "下午"
|
19
|
+ "上午", "下午","全天"
|
20
|
],
|
20
|
],
|
21
|
-
|
21
|
+
|
22
|
t_arr: [{ //选择日期数组
|
22
|
t_arr: [{ //选择日期数组
|
23
|
data: '',
|
23
|
data: '',
|
24
|
time: ''
|
24
|
time: ''
|
|
@@ -31,7 +31,7 @@ Page({ |
|
@@ -31,7 +31,7 @@ Page({ |
31
|
e_arr: [ //申请用餐数组
|
31
|
e_arr: [ //申请用餐数组
|
32
|
{
|
32
|
{
|
33
|
time: '',
|
33
|
time: '',
|
34
|
- night:''
|
34
|
+ night: ''
|
35
|
}
|
35
|
}
|
36
|
],
|
36
|
],
|
37
|
|
37
|
|
|
@@ -42,54 +42,67 @@ Page({ |
|
@@ -42,54 +42,67 @@ Page({ |
42
|
zhiyuan: '',
|
42
|
zhiyuan: '',
|
43
|
show: false,
|
43
|
show: false,
|
44
|
shows: false,
|
44
|
shows: false,
|
45
|
- shownight:false,
|
|
|
46
|
- showdate:false,
|
|
|
47
|
- arr:[],
|
|
|
48
|
- },
|
|
|
49
|
-
|
|
|
50
|
-//日历
|
|
|
51
|
-// 参加日期
|
|
|
52
|
-onDisplaydate() {
|
|
|
53
|
- this.setData({
|
|
|
54
|
- showdate: true
|
|
|
55
|
- });
|
|
|
56
|
-},
|
|
|
57
|
-
|
|
|
58
|
-onClosedate() {
|
|
|
59
|
- this.setData({
|
|
|
60
|
- showdate: false
|
|
|
61
|
- });
|
|
|
62
|
-},
|
|
|
63
|
-
|
|
|
64
|
-onConfirmdate(event) {
|
|
|
65
|
-
|
|
|
66
|
- console.log(event)
|
|
|
67
|
- var that = this;
|
|
|
68
|
- var dates = event.detail
|
|
|
69
|
- console.log(dates);
|
|
|
70
|
- var list = [];
|
|
|
71
|
- event.detail.forEach(item => {
|
|
|
72
|
- var date = new Date(item);
|
|
|
73
|
- console.log(date)
|
|
|
74
|
-
|
|
|
75
|
- var year = date.getFullYear();
|
|
|
76
|
- var m = date.getMonth() + 1;
|
|
|
77
|
- var d = date.getDate();
|
|
|
78
|
-
|
|
|
79
|
- var Data = year + "/" + m + "/" + d
|
|
|
80
|
- list.push(Data);
|
|
|
81
|
- });
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
- console.log('1111111111111111', list)
|
|
|
85
|
- this.setData({
|
45
|
+ shownight: false,
|
86
|
showdate: false,
|
46
|
showdate: false,
|
87
|
- data: list.join(',')
|
|
|
88
|
- });
|
47
|
+ selectdata:[],
|
|
|
48
|
+ arr: [],
|
|
|
49
|
+ lunch: [],
|
|
|
50
|
+ dinner: [],
|
|
|
51
|
+ },
|
|
|
52
|
+
|
|
|
53
|
+ //日历
|
|
|
54
|
+ // 参加日期
|
|
|
55
|
+ onDisplaydate() {
|
|
|
56
|
+ this.setData({
|
|
|
57
|
+ showdate: true
|
|
|
58
|
+ });
|
|
|
59
|
+ },
|
|
|
60
|
+
|
|
|
61
|
+ onClosedate() {
|
|
|
62
|
+ this.setData({
|
|
|
63
|
+ showdate: false
|
|
|
64
|
+ });
|
|
|
65
|
+ },
|
|
|
66
|
+
|
|
|
67
|
+ onConfirmdate(event) {
|
|
|
68
|
+
|
|
|
69
|
+ console.log(event)
|
|
|
70
|
+ var that = this;
|
|
|
71
|
+ var dates = event.detail
|
|
|
72
|
+ console.log(dates);
|
|
|
73
|
+ var list = [];
|
|
|
74
|
+ event.detail.forEach(item => {
|
|
|
75
|
+ var date = new Date(item);
|
|
|
76
|
+ console.log(date)
|
|
|
77
|
+
|
|
|
78
|
+ var year = date.getFullYear();
|
|
|
79
|
+ var m = date.getMonth() + 1;
|
|
|
80
|
+ var d = date.getDate();
|
|
|
81
|
+
|
|
|
82
|
+ var Data = year + "/" + m + "/" + d
|
|
|
83
|
+ list.push(Data);
|
|
|
84
|
+ });
|
|
|
85
|
+ let data = [];
|
|
|
86
|
+ console.log('1111111111111111', list)
|
|
|
87
|
+ list.forEach(item => {
|
|
|
88
|
+ console.log("item-", item);
|
|
|
89
|
+ data.push({
|
|
|
90
|
+ date: item
|
|
|
91
|
+ })
|
|
|
92
|
+ })
|
|
|
93
|
+ console.log("---", data);
|
|
|
94
|
+
|
|
|
95
|
+ console.log('1111111111111111', list)
|
|
|
96
|
+ this.setData({
|
|
|
97
|
+ showdate: false,
|
|
|
98
|
+ data: list.join(','),
|
|
|
99
|
+ selectdata: data
|
89
|
|
100
|
|
|
|
101
|
+ });
|
90
|
|
102
|
|
91
|
-},
|
|
|
92
|
-// 入住日期
|
103
|
+
|
|
|
104
|
+ },
|
|
|
105
|
+ // 入住日期
|
93
|
onDisplay() {
|
106
|
onDisplay() {
|
94
|
this.setData({
|
107
|
this.setData({
|
95
|
show: true
|
108
|
show: true
|
|
@@ -119,23 +132,23 @@ onConfirmdate(event) { |
|
@@ -119,23 +132,23 @@ onConfirmdate(event) { |
119
|
list.push(Data);
|
132
|
list.push(Data);
|
120
|
});
|
133
|
});
|
121
|
|
134
|
|
122
|
- let data=[];
|
135
|
+ let data = [];
|
123
|
console.log('1111111111111111', list)
|
136
|
console.log('1111111111111111', list)
|
124
|
list.forEach(item => {
|
137
|
list.forEach(item => {
|
125
|
- console.log("item-",item);
|
138
|
+ console.log("item-", item);
|
126
|
data.push({
|
139
|
data.push({
|
127
|
- date:item
|
140
|
+ date: item
|
128
|
})
|
141
|
})
|
129
|
})
|
142
|
})
|
130
|
- console.log("---",data);
|
143
|
+ console.log("---", data);
|
131
|
this.setData({
|
144
|
this.setData({
|
132
|
show: false,
|
145
|
show: false,
|
133
|
date: list.join(','),
|
146
|
date: list.join(','),
|
134
|
- arr:data,
|
147
|
+ arr: data,
|
135
|
});
|
148
|
});
|
136
|
},
|
149
|
},
|
137
|
|
150
|
|
138
|
-//午餐
|
151
|
+ //午餐
|
139
|
onDisplays() {
|
152
|
onDisplays() {
|
140
|
this.setData({
|
153
|
this.setData({
|
141
|
shows: true
|
154
|
shows: true
|
|
@@ -167,16 +180,27 @@ onConfirmdate(event) { |
|
@@ -167,16 +180,27 @@ onConfirmdate(event) { |
167
|
list.push(Data);
|
180
|
list.push(Data);
|
168
|
});
|
181
|
});
|
169
|
|
182
|
|
|
|
183
|
+ let data = [];
|
|
|
184
|
+ console.log('1111111111111111', list)
|
|
|
185
|
+ list.forEach(item => {
|
|
|
186
|
+ console.log("item-", item);
|
|
|
187
|
+ data.push({
|
|
|
188
|
+ date: item
|
|
|
189
|
+ })
|
|
|
190
|
+ })
|
|
|
191
|
+ console.log("---", data);
|
170
|
|
192
|
|
171
|
console.log('1111111111111111', list)
|
193
|
console.log('1111111111111111', list)
|
172
|
this.setData({
|
194
|
this.setData({
|
173
|
shows: false,
|
195
|
shows: false,
|
174
|
- time: list.join(',')
|
196
|
+ time: list.join(','),
|
|
|
197
|
+ lunch: data,
|
|
|
198
|
+
|
175
|
});
|
199
|
});
|
176
|
|
200
|
|
177
|
|
201
|
|
178
|
},
|
202
|
},
|
179
|
-// 晚餐
|
203
|
+ // 晚餐
|
180
|
onDisplaynight() {
|
204
|
onDisplaynight() {
|
181
|
this.setData({
|
205
|
this.setData({
|
182
|
shownight: true
|
206
|
shownight: true
|
|
@@ -208,27 +232,26 @@ onConfirmdate(event) { |
|
@@ -208,27 +232,26 @@ onConfirmdate(event) { |
208
|
list.push(Data);
|
232
|
list.push(Data);
|
209
|
});
|
233
|
});
|
210
|
|
234
|
|
211
|
-
|
235
|
+ let data = [];
|
|
|
236
|
+ console.log('1111111111111111', list)
|
|
|
237
|
+ list.forEach(item => {
|
|
|
238
|
+ console.log("item-", item);
|
|
|
239
|
+ data.push({
|
|
|
240
|
+ date: item
|
|
|
241
|
+ })
|
|
|
242
|
+ })
|
|
|
243
|
+ console.log("---", data);
|
212
|
console.log('1111111111111111', list)
|
244
|
console.log('1111111111111111', list)
|
213
|
this.setData({
|
245
|
this.setData({
|
214
|
shownight: false,
|
246
|
shownight: false,
|
215
|
- night: list.join(',')
|
247
|
+ night: list.join(','),
|
|
|
248
|
+ dinner: data
|
|
|
249
|
+
|
216
|
});
|
250
|
});
|
217
|
|
251
|
|
218
|
|
252
|
|
219
|
},
|
253
|
},
|
220
|
|
254
|
|
221
|
-
|
|
|
222
|
-
|
|
|
223
|
-
|
|
|
224
|
-
|
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
- //
|
|
|
229
|
-
|
|
|
230
|
-
|
|
|
231
|
-
|
|
|
232
|
// 获取到焦点
|
255
|
// 获取到焦点
|
233
|
focus: function (e) {
|
256
|
focus: function (e) {
|
234
|
this.setData({
|
257
|
this.setData({
|
|
@@ -345,10 +368,10 @@ onConfirmdate(event) { |
|
@@ -345,10 +368,10 @@ onConfirmdate(event) { |
345
|
let index = e.currentTarget.dataset.index
|
368
|
let index = e.currentTarget.dataset.index
|
346
|
// let id = e.currentTarget.dataset.id
|
369
|
// let id = e.currentTarget.dataset.id
|
347
|
let zindex = Number(e.detail.value)
|
370
|
let zindex = Number(e.detail.value)
|
348
|
-
|
|
|
349
|
- that.setData({
|
|
|
350
|
- [`t_arr[${index}].date`]: that.data.date_arr[zindex]
|
|
|
351
|
- })
|
371
|
+
|
|
|
372
|
+ that.setData({
|
|
|
373
|
+ [`t_arr[${index}].date`]: that.data.date_arr[zindex]
|
|
|
374
|
+ })
|
352
|
|
375
|
|
353
|
|
376
|
|
354
|
// else if (id == 2) {
|
377
|
// else if (id == 2) {
|
|
@@ -576,21 +599,21 @@ onConfirmdate(event) { |
|
@@ -576,21 +599,21 @@ onConfirmdate(event) { |
576
|
})
|
599
|
})
|
577
|
return
|
600
|
return
|
578
|
}
|
601
|
}
|
579
|
- if (that.data.t_type == false) {
|
602
|
+ if (that.data.selectdata == '') {
|
580
|
wx.showToast({
|
603
|
wx.showToast({
|
581
|
title: '请先完善选择日期信息',
|
604
|
title: '请先完善选择日期信息',
|
582
|
icon: 'none'
|
605
|
icon: 'none'
|
583
|
})
|
606
|
})
|
584
|
return
|
607
|
return
|
585
|
}
|
608
|
}
|
586
|
- if (that.data.z_type == false) {
|
609
|
+ if (that.data.arr == '') {
|
587
|
wx.showToast({
|
610
|
wx.showToast({
|
588
|
title: '请先完善申请入住信息',
|
611
|
title: '请先完善申请入住信息',
|
589
|
icon: 'none'
|
612
|
icon: 'none'
|
590
|
})
|
613
|
})
|
591
|
return
|
614
|
return
|
592
|
}
|
615
|
}
|
593
|
- if (that.data.e_type == false) {
|
616
|
+ if (that.data.lunch =='' ) {
|
594
|
wx.showToast({
|
617
|
wx.showToast({
|
595
|
title: '请先完善申请用餐信息',
|
618
|
title: '请先完善申请用餐信息',
|
596
|
icon: 'none'
|
619
|
icon: 'none'
|
|
@@ -654,10 +677,16 @@ onConfirmdate(event) { |
|
@@ -654,10 +677,16 @@ onConfirmdate(event) { |
654
|
form_id: form_id,
|
677
|
form_id: form_id,
|
655
|
type: that.data.type_id,
|
678
|
type: that.data.type_id,
|
656
|
work_content: that.data.check_id,
|
679
|
work_content: that.data.check_id,
|
657
|
- select_time: JSON.stringify(that.data.t_arr),
|
680
|
+ // select_time: JSON.stringify(that.data.t_arr),
|
|
|
681
|
+ select_time: JSON.stringify(that.data.selectdata),
|
658
|
// apply_stay: JSON.stringify(that.data.z_arr),
|
682
|
// apply_stay: JSON.stringify(that.data.z_arr),
|
659
|
apply_stay: JSON.stringify(that.data.arr),
|
683
|
apply_stay: JSON.stringify(that.data.arr),
|
660
|
- apply_food: JSON.stringify(that.data.e_arr)
|
684
|
+ // apply_food: JSON.stringify(that.data.e_arr)
|
|
|
685
|
+ apply_lunch_food: JSON.stringify(that.data.lunch),
|
|
|
686
|
+ apply_dinner_food: JSON.stringify(that.data.dinner)
|
|
|
687
|
+
|
|
|
688
|
+
|
|
|
689
|
+
|
661
|
}
|
690
|
}
|
662
|
let header = {
|
691
|
let header = {
|
663
|
'XX-Token': wx.getStorageSync('token')
|
692
|
'XX-Token': wx.getStorageSync('token')
|