|
@@ -76,7 +76,7 @@ Page({ |
|
@@ -76,7 +76,7 @@ Page({ |
|
76
|
|
76
|
|
|
77
|
},1000);
|
77
|
},1000);
|
|
78
|
},
|
78
|
},
|
|
79
|
- async getbooklist(){
|
79
|
+ async getbooklist(isExport=false){
|
|
80
|
let time=0;
|
80
|
let time=0;
|
|
81
|
if(this.data.form.time<0){
|
81
|
if(this.data.form.time<0){
|
|
82
|
time=await bookOrder.getTimeSpaceIndex();
|
82
|
time=await bookOrder.getTimeSpaceIndex();
|
|
@@ -95,21 +95,25 @@ Page({ |
|
@@ -95,21 +95,25 @@ Page({ |
|
95
|
formdata.y=200;
|
95
|
formdata.y=200;
|
|
96
|
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);
|
96
|
let rdate=await bookOrder.getTimeSpace(this.data.dateStr,time);
|
|
97
|
formdata.rdate=rdate;
|
97
|
formdata.rdate=rdate;
|
|
98
|
- var that=this;
|
|
|
|
99
|
- App.Reserve.GetReserveList(formdata).then(function(json){
|
|
|
|
100
|
- console.log(json)
|
|
|
|
101
|
- if(json.ret==200){
|
|
|
|
102
|
- that.setData({
|
|
|
|
103
|
- isloading:true,
|
|
|
|
104
|
- bookList:json.data.length==0 ? null : json.data,
|
|
|
|
105
|
- form:{time:time},
|
|
|
|
106
|
- })
|
|
|
|
107
|
- that.boolists=that.selectAllComponents('.orderbook');
|
|
|
|
108
|
- that.boolists.forEach(function(v,i){
|
|
|
|
109
|
- v.changeitem();
|
|
|
|
110
|
- })
|
|
|
|
111
|
- }
|
|
|
|
112
|
- })
|
98
|
+ if(isExport){
|
|
|
|
99
|
+ this.__exportFile(formdata);
|
|
|
|
100
|
+ }else{
|
|
|
|
101
|
+ var that=this;
|
|
|
|
102
|
+ App.Reserve.GetReserveList(formdata).then(function(json){
|
|
|
|
103
|
+ console.log(json)
|
|
|
|
104
|
+ if(json.ret==200){
|
|
|
|
105
|
+ that.setData({
|
|
|
|
106
|
+ isloading:true,
|
|
|
|
107
|
+ bookList:json.data.length==0 ? null : json.data,
|
|
|
|
108
|
+ form:{time:time},
|
|
|
|
109
|
+ })
|
|
|
|
110
|
+ that.boolists=that.selectAllComponents('.orderbook');
|
|
|
|
111
|
+ that.boolists.forEach(function(v,i){
|
|
|
|
112
|
+ v.changeitem();
|
|
|
|
113
|
+ })
|
|
|
|
114
|
+ }
|
|
|
|
115
|
+ }).catch(e=>{})
|
|
|
|
116
|
+ }
|
|
113
|
},
|
117
|
},
|
|
114
|
timeorder:function(){
|
118
|
timeorder:function(){
|
|
115
|
if(this.data.sort==''){
|
119
|
if(this.data.sort==''){
|
|
@@ -167,35 +171,33 @@ Page({ |
|
@@ -167,35 +171,33 @@ Page({ |
|
167
|
console.log(this.data.form)
|
171
|
console.log(this.data.form)
|
|
168
|
this.getbooklist();
|
172
|
this.getbooklist();
|
|
169
|
},
|
173
|
},
|
|
170
|
- exportFile(){
|
|
|
|
171
|
- App.Reserve.ExportReserve().then(res=>{
|
174
|
+ __exportFile(formdata){
|
|
|
|
175
|
+ App.Reserve.ExportReserve(formdata).then(res=>{
|
|
172
|
let url=res.data;
|
176
|
let url=res.data;
|
|
|
|
177
|
+ if(!url){
|
|
|
|
178
|
+ return util.toast('没有预订数据','none')
|
|
|
|
179
|
+ }
|
|
173
|
wx.downloadFile({
|
180
|
wx.downloadFile({
|
|
174
|
url: url,
|
181
|
url: url,
|
|
175
|
success: function(res) {
|
182
|
success: function(res) {
|
|
176
|
const filePath = res.tempFilePath;
|
183
|
const filePath = res.tempFilePath;
|
|
177
|
console.log('filePath',filePath);
|
184
|
console.log('filePath',filePath);
|
|
178
|
- wx.saveFile({
|
|
|
|
179
|
- tempFilePath: filePath,
|
|
|
|
180
|
- success (res) {
|
|
|
|
181
|
- const savedFilePath = res.savedFilePath;
|
|
|
|
182
|
- console.log('savedFilePath',savedFilePath);
|
|
|
|
183
|
- wx.openDocument({
|
|
|
|
184
|
- filePath: savedFilePath,
|
|
|
|
185
|
- fileType:'pdf',
|
|
|
|
186
|
- success: function(res) {
|
|
|
|
187
|
- console.log('打开文档成功')
|
|
|
|
188
|
- },
|
|
|
|
189
|
- fail(e){
|
|
|
|
190
|
- console.log('打开文档失败',e)
|
|
|
|
191
|
- },
|
|
|
|
192
|
- })
|
185
|
+ wx.previewImage({
|
|
|
|
186
|
+ current: filePath,
|
|
|
|
187
|
+ urls: [filePath]
|
|
|
|
188
|
+ })
|
|
|
|
189
|
+ wx.saveImageToPhotosAlbum({
|
|
|
|
190
|
+ filePath:filePath,
|
|
|
|
191
|
+ fail (res) {
|
|
|
|
192
|
+ util.toast('保存失败','none')
|
|
193
|
}
|
193
|
}
|
|
194
|
})
|
194
|
})
|
|
195
|
-
|
|
|
|
196
|
}
|
195
|
}
|
|
197
|
})
|
196
|
})
|
|
198
|
});
|
197
|
});
|
|
199
|
|
198
|
|
|
200
|
},
|
199
|
},
|
|
|
|
200
|
+ exportFile(){
|
|
|
|
201
|
+ this.getbooklist(true);
|
|
|
|
202
|
+ },
|
|
201
|
}) |
203
|
}) |