|
@@ -229,14 +229,21 @@ Page({ |
|
@@ -229,14 +229,21 @@ Page({ |
|
229
|
if(form.tid.length>0 && form.rname.length>0){
|
229
|
if(form.tid.length>0 && form.rname.length>0){
|
|
230
|
sobj.buttonhide=false;
|
230
|
sobj.buttonhide=false;
|
|
231
|
}
|
231
|
}
|
|
232
|
- if('date,time,pnum,pnum_str,tabid'.indexOf(key)>-1){
|
|
|
|
233
|
- sobj.form.tid=[];
|
|
|
|
234
|
- sobj.buttonhide=true;
|
|
|
|
235
|
- this.getTables();
|
|
|
|
236
|
- }
|
232
|
+ let displayTimes=false;
|
|
237
|
if(key=='time'){
|
233
|
if(key=='time'){
|
|
238
|
- sobj.timePickerMask=true;
|
234
|
+ if(util.attr(e,'display')=='block'){
|
|
|
|
235
|
+ displayTimes=true;
|
|
|
|
236
|
+ sobj.timePickerMask=true;
|
|
|
|
237
|
+ }
|
|
239
|
}
|
238
|
}
|
|
|
|
239
|
+ if('date,time,pnum,pnum_str,tabid'.indexOf(key)>-1){
|
|
|
|
240
|
+ if(!displayTimes){
|
|
|
|
241
|
+ sobj.form.tid=[];
|
|
|
|
242
|
+ sobj.buttonhide=true;
|
|
|
|
243
|
+ this.getTables();
|
|
|
|
244
|
+ }
|
|
|
|
245
|
+ }
|
|
|
|
246
|
+
|
|
240
|
this.setData(sobj)
|
247
|
this.setData(sobj)
|
|
241
|
},
|
248
|
},
|
|
242
|
async getTables(){
|
249
|
async getTables(){
|
|
@@ -298,10 +305,13 @@ Page({ |
|
@@ -298,10 +305,13 @@ Page({ |
|
298
|
async formsubmit(){
|
305
|
async formsubmit(){
|
|
299
|
if(this.data.buttonhide) return;
|
306
|
if(this.data.buttonhide) return;
|
|
300
|
try {
|
307
|
try {
|
|
301
|
- let stimestr=this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
|
|
|
|
302
|
- console.log('stimestr', stimestr,this.data.form.time,this.data.timePickerIndex);
|
308
|
+ let d_stimestr=this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[this.data.form.time]];
|
|
|
|
309
|
+ let d_rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
|
|
|
|
310
|
+ this.data.form.time,d_stimestr);
|
|
|
|
311
|
+ let stimestr=this.data.timePickerArray[this.data.form.time][this.data.timePickerIndex[0]];
|
|
303
|
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
|
312
|
let rdate = await comm.getTimeSpace(this.data.dateStr[this.data.form.date],
|
|
304
|
- this.data.form.time,stimestr);
|
313
|
+ this.data.form.time,stimestr);
|
|
|
|
314
|
+ console.log('stimestr', stimestr,this.data.form.time,this.data.timePickerIndex);
|
|
305
|
console.log('rdate', rdate);
|
315
|
console.log('rdate', rdate);
|
|
306
|
this.setData({
|
316
|
this.setData({
|
|
307
|
buttonhide: true,
|
317
|
buttonhide: true,
|
|
@@ -325,12 +335,14 @@ Page({ |
|
@@ -325,12 +335,14 @@ Page({ |
|
325
|
form.note_name=note_name||'';
|
335
|
form.note_name=note_name||'';
|
|
326
|
}catch (e){}
|
336
|
}catch (e){}
|
|
327
|
}
|
337
|
}
|
|
|
|
338
|
+ form.ddate=d_rdate.substr(0,10);
|
|
328
|
App.Reserve.SetReserveInfo(form).then(res => {
|
339
|
App.Reserve.SetReserveInfo(form).then(res => {
|
|
329
|
if(res.ret==200){
|
340
|
if(res.ret==200){
|
|
330
|
let _id=(res.data.id || res.data)
|
341
|
let _id=(res.data.id || res.data)
|
|
331
|
this.setData({
|
342
|
this.setData({
|
|
332
|
form:JSON.parse(JSON.stringify(formTpl)),
|
343
|
form:JSON.parse(JSON.stringify(formTpl)),
|
|
333
|
tables:[],
|
344
|
tables:[],
|
|
|
|
345
|
+ timePickerIndex:[0,0,0],
|
|
334
|
})
|
346
|
})
|
|
335
|
this.initLoad();
|
347
|
this.initLoad();
|
|
336
|
App.Reserve.Detail({rid:_id,openid:''},'clear')
|
348
|
App.Reserve.Detail({rid:_id,openid:''},'clear')
|
|
@@ -430,9 +442,9 @@ Page({ |
|
@@ -430,9 +442,9 @@ Page({ |
|
430
|
|
442
|
|
|
431
|
console.log('initModify',res);
|
443
|
console.log('initModify',res);
|
|
432
|
//设置日期
|
444
|
//设置日期
|
|
433
|
- let obj = await this.setDateStr(res.data.rdate);
|
445
|
+ let obj = await this.setDateStr(res.data.ddate);
|
|
434
|
//设置时间
|
446
|
//设置时间
|
|
435
|
- let nd=util.unixtoTime(res.data.rdate,'HH:II');
|
447
|
+ let nd=util.unixtoTime(res.data.ddate,'HH:II');
|
|
436
|
let timePickerIndex=this.data.timePickerIndex
|
448
|
let timePickerIndex=this.data.timePickerIndex
|
|
437
|
console.log('initModify-',this.data.timePickerArray,obj.form.time,nd)
|
449
|
console.log('initModify-',this.data.timePickerArray,obj.form.time,nd)
|
|
438
|
this.data.timePickerArray[obj.form.time].forEach((dd,ii)=>{
|
450
|
this.data.timePickerArray[obj.form.time].forEach((dd,ii)=>{
|