Commit f572ca6db334cd83e37d6a186b7edf79d34e9dfb

Authored by wangfan
1 parent 4130ee68

most_pnum

... ... @@ -69,7 +69,7 @@ Page({
},
async initLoad(options={}){
this.reserve_id=options.id||'';
this.setDateStr();
await this.setDateStr();
this.sellerid=util.cache('sellerid');
let timePickerArray= await comm.getDayTimeSpace();
this.setData({
... ...
... ... @@ -76,7 +76,7 @@ Page({
},1000);
},
async getbooklist(){
async getbooklist(isExport=false){
let time=0;
if(this.data.form.time<0){
time=await bookOrder.getTimeSpaceIndex();
... ... @@ -95,21 +95,25 @@ Page({
formdata.y=200;
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);
formdata.rdate=rdate;
var that=this;
App.Reserve.GetReserveList(formdata).then(function(json){
console.log(json)
if(json.ret==200){
that.setData({
isloading:true,
bookList:json.data.length==0 ? null : json.data,
form:{time:time},
})
that.boolists=that.selectAllComponents('.orderbook');
that.boolists.forEach(function(v,i){
v.changeitem();
})
}
})
if(isExport){
this.__exportFile(formdata);
}else{
var that=this;
App.Reserve.GetReserveList(formdata).then(function(json){
console.log(json)
if(json.ret==200){
that.setData({
isloading:true,
bookList:json.data.length==0 ? null : json.data,
form:{time:time},
})
that.boolists=that.selectAllComponents('.orderbook');
that.boolists.forEach(function(v,i){
v.changeitem();
})
}
}).catch(e=>{})
}
},
timeorder:function(){
if(this.data.sort==''){
... ... @@ -167,35 +171,33 @@ Page({
console.log(this.data.form)
this.getbooklist();
},
exportFile(){
App.Reserve.ExportReserve().then(res=>{
__exportFile(formdata){
App.Reserve.ExportReserve(formdata).then(res=>{
let url=res.data;
if(!url){
return util.toast('没有预订数据','none')
}
wx.downloadFile({
url: url,
success: function(res) {
const filePath = res.tempFilePath;
console.log('filePath',filePath);
wx.saveFile({
tempFilePath: filePath,
success (res) {
const savedFilePath = res.savedFilePath;
console.log('savedFilePath',savedFilePath);
wx.openDocument({
filePath: savedFilePath,
fileType:'pdf',
success: function(res) {
console.log('打开文档成功')
},
fail(e){
console.log('打开文档失败',e)
},
})
wx.previewImage({
current: filePath,
urls: [filePath]
})
wx.saveImageToPhotosAlbum({
filePath:filePath,
fail (res) {
util.toast('保存失败','none')
}
})
}
})
});
},
exportFile(){
this.getbooklist(true);
},
})
\ No newline at end of file
... ...
... ... @@ -80,7 +80,9 @@ export default {
},
//导出
'App.Reserve.ExportReserve':null,
'App.Reserve.ExportReserve':{
silence:false,
},
//查询短信剩余及套餐
'App.Reserve.SmsInfo':{
... ...