Commit ebebf7f7131ebafaaabcf19638b8945ee9fdfb15

Authored by zhangyan
1 parent 12531dec

更多桌位

Showing 1 changed file with 27 additions and 6 deletions
@@ -452,8 +452,28 @@ conditionInfo:function(){ @@ -452,8 +452,28 @@ conditionInfo:function(){
452 this.setData({ 452 this.setData({
453 buttonhide:this.data.buttonhide 453 buttonhide:this.data.buttonhide
454 }) 454 })
455 -}  
456 -}) 455 +},
  456 + /**
  457 + * 修改初始化
  458 + */
  459 + async initModify(id){
  460 + try{
  461 + let res= await App.Reserve.Detail({rid:id,openid:''});
  462 +
  463 + console.log('initModify',res);
  464 + //设置日期
  465 + let obj = await this.setDateStr(res.data.rdate);
  466 + //设置时间
  467 + let nd=util.unixtoTime(res.data.rdate,'HH:II');
  468 + let timePickerIndex=this.data.timePickerIndex
  469 + console.log('initModify-',this.data.timePickerArray,obj.form.time)
  470 + this.data.timePickerArray[obj.form.time].forEach((dd,ii)=>{
  471 + console.log('initModify-',nd,dd)
  472 + if(nd==dd){
  473 + timePickerIndex[obj.form.time]=ii;
  474 + return true;
  475 + }
  476 + })
457 477
458 console.log('initModify-timePickerIndex',timePickerIndex); 478 console.log('initModify-timePickerIndex',timePickerIndex);
459 obj.form.pnum_str=res.data.pnum_str; 479 obj.form.pnum_str=res.data.pnum_str;
@@ -465,9 +485,9 @@ conditionInfo:function(){ @@ -465,9 +485,9 @@ conditionInfo:function(){
465 obj.form.tid=[]; 485 obj.form.tid=[];
466 res.data.tables.forEach((t,ti)=>{ 486 res.data.tables.forEach((t,ti)=>{
467 t.isselect=true 487 t.isselect=true
468 - res.data.tables[ti]=t;  
469 - obj.form.tid.push(t.id)  
470 - }) 488 + res.data.tables[ti]=t;
  489 + obj.form.tid.push(t.id)
  490 + })
471 this.setData({ 491 this.setData({
472 timePickerIndex:timePickerIndex, 492 timePickerIndex:timePickerIndex,
473 form:obj.form, 493 form:obj.form,
@@ -477,4 +497,5 @@ conditionInfo:function(){ @@ -477,4 +497,5 @@ conditionInfo:function(){
477 console.log('initModify',e) 497 console.log('initModify',e)
478 } 498 }
479 }, 499 },
480 -})  
  500 +
  501 +})