|
...
|
...
|
@@ -6,6 +6,7 @@ import 'package:one_key/models/notebook.dart'; |
|
|
|
import 'package:one_key/net/base_resp.dart';
|
|
|
|
import 'package:one_key/net/dio_util.dart';
|
|
|
|
import 'package:one_key/net/http_url.dart';
|
|
|
|
import 'package:one_key/provider/table_manager_model.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
...
|
...
|
@@ -30,8 +31,7 @@ class NoteBookModel extends ChangeNotifier { |
|
|
|
showLoading = false;
|
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
// pageState = PageState.Loading;
|
|
|
|
// notifyListeners();
|
|
|
|
|
|
|
|
BaseResp<List> baseResp = await DioUtil()
|
|
|
|
.request<List>(context, Method.get, HttpUrl.get_reserve_list,
|
|
|
|
data: params, showLoading: needLoading ? false : showLoading)
|
|
...
|
...
|
@@ -62,11 +62,64 @@ class NoteBookModel extends ChangeNotifier { |
|
|
|
if (notebooks.isEmpty) {
|
|
|
|
pageState = PageState.Empty;
|
|
|
|
} else {
|
|
|
|
TableManagerModel tableManagerModel =
|
|
|
|
Provider.of<TableManagerModel>(context, listen: false);
|
|
|
|
|
|
|
|
await tableManagerModel.getTableList(context);
|
|
|
|
List<Notebook> temp = [];
|
|
|
|
|
|
|
|
notebooks.forEach((notebook) {
|
|
|
|
if (notebook.tableinfoList.length > 0) {
|
|
|
|
tableManagerModel.tableOuterList.forEach((elementAll) {
|
|
|
|
if (notebook.tableinfoList[0].rid == elementAll.rid) {
|
|
|
|
elementAll.list.forEach((element) {
|
|
|
|
if(notebook.tableinfoList[0].id == element.id){
|
|
|
|
//桌子ID
|
|
|
|
element.notebook = notebook;
|
|
|
|
//
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// // if( elementTable.rid == element.tableinfoList[0].rid){
|
|
|
|
// // //区域ID
|
|
|
|
|
|
|
|
// // element.orderRID = elementTable.orderId;
|
|
|
|
|
|
|
|
// // }
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
for(int i=0;i<tableManagerModel.tableOuterList.length;i++){
|
|
|
|
|
|
|
|
for(int j=0;j<tableManagerModel.tableOuterList[i].list.length;j++){
|
|
|
|
if(tableManagerModel.tableOuterList[i].list[j].notebook != null){
|
|
|
|
temp.add(tableManagerModel.tableOuterList[i].list[j].notebook);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print(temp);
|
|
|
|
print(notebooks);
|
|
|
|
|
|
|
|
notebooks = temp.toList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// tableManagerModel.tableOuterList //桌子
|
|
|
|
// tableManagerModel.areaSunModelList //区域
|
|
|
|
|
|
|
|
pageState = PageState.Success;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
Utils.showToast(baseResp.msg ?? "");
|
|
|
|
}
|
|
|
|
|
|
|
|
notifyListeners();
|
|
|
|
return notebooks;
|
|
|
|
}
|
...
|
...
|
|