|
...
|
...
|
@@ -104,6 +104,8 @@ Page({ |
|
|
|
})
|
|
|
|
if (this.reserve_id > 0) {
|
|
|
|
this.initModify(this.reserve_id);
|
|
|
|
} else if(options.hasQuick==1){
|
|
|
|
this.initQuick(options);
|
|
|
|
} else {
|
|
|
|
this.getTables();
|
|
|
|
}
|
|
...
|
...
|
@@ -648,4 +650,49 @@ Page({ |
|
|
|
[`calendar.nextNum`]: this.data.calendar.nextNum - 1
|
|
|
|
})
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
* 快速预定初始化
|
|
|
|
* tid
|
|
|
|
* ddate
|
|
|
|
* pnum
|
|
|
|
*/
|
|
|
|
async initQuick(options){
|
|
|
|
try {
|
|
|
|
console.log('initQuick', options);
|
|
|
|
options.ddate=options.ddate.substr(0,10);
|
|
|
|
//设置日期
|
|
|
|
let obj = await this.setDateStr(options.ddate);
|
|
|
|
//设置时间
|
|
|
|
let nd = util.unixtoTime(options.ddate, 'HH:II');
|
|
|
|
let timePickerIndex = this.data.timePickerIndex
|
|
|
|
console.log('initQuick-', this.data.timePickerArray, obj.form.time, nd)
|
|
|
|
this.data.timePickerArray[obj.form.time].forEach((dd, ii) => {
|
|
|
|
console.log('initQuick-', nd, dd)
|
|
|
|
if (nd == dd) {
|
|
|
|
timePickerIndex[obj.form.time] = ii;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
console.log('initQuick-timePickerIndex', timePickerIndex);
|
|
|
|
obj.form.pnum = options.pnum || 6;
|
|
|
|
obj.form.rname = "";
|
|
|
|
obj.form.phone = "";
|
|
|
|
obj.form.sex = 1;
|
|
|
|
obj.form.cusdem = "";
|
|
|
|
obj.form.rid = "";
|
|
|
|
obj.form.tid = [options.tid];
|
|
|
|
this.setData({
|
|
|
|
timePickerIndex: timePickerIndex,
|
|
|
|
form: obj.form,
|
|
|
|
hasUseDefDtime: false,
|
|
|
|
})
|
|
|
|
setTimeout(() => {
|
|
|
|
this.getTables();
|
|
|
|
}, 300)
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
console.log('initQuick', e)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}) |
|
|
\ No newline at end of file |
...
|
...
|
|