|
...
|
...
|
@@ -60,6 +60,7 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
String selectDateStr = '';
|
|
|
|
|
|
|
|
DateTime dateTimeSelect;
|
|
|
|
int selectNumber;
|
|
|
|
|
|
|
|
//初始化时间
|
|
|
|
initTime(BuildContext context) async {
|
|
...
|
...
|
@@ -244,13 +245,14 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
}
|
|
|
|
|
|
|
|
///录入更改内部预订
|
|
|
|
Future<SunReserveInfoModel> setReserveInfo(BuildContext context) async {
|
|
|
|
Future<SunReserveInfoModel> setReserveInfo(BuildContext context,
|
|
|
|
{needKeep = false}) async {
|
|
|
|
if (selectTables.length == 0) {
|
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
bool sucess =
|
|
|
|
await getReserveList(context, showMsg: true, needLoading: false);
|
|
|
|
bool sucess = await getReserveList(context,
|
|
|
|
showMsg: true, needLoading: false, needKeep: true, showloading: true);
|
|
|
|
if (sucess) {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
//
|
|
...
|
...
|
@@ -440,7 +442,8 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
getReserveList(BuildContext context,
|
|
|
|
{bool needLoading = true,
|
|
|
|
bool needKeep = false,
|
|
|
|
bool showMsg = false}) async {
|
|
|
|
bool showMsg = false,
|
|
|
|
bool showloading = false}) async {
|
|
|
|
tableMap.clear();
|
|
|
|
NoteBookModel model = new NoteBookModel();
|
|
|
|
Map<String, String> params = {
|
|
...
|
...
|
@@ -457,7 +460,8 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
notifyListeners();
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Notebook> noteBooks = await newGetReserveList(context, params);
|
|
|
|
List<Notebook> noteBooks =
|
|
|
|
await newGetReserveList(context, params, showLoading: showloading);
|
|
|
|
List<t.Table> tempSelectTables = [];
|
|
|
|
tempSelectTables.addAll(selectTables);
|
|
|
|
String msg = '';
|
|
...
|
...
|
@@ -504,7 +508,8 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
|
|
|
|
//获取已预订订单
|
|
|
|
Future<List<Notebook>> newGetReserveList(
|
|
|
|
BuildContext context, Map<String, String> params) async {
|
|
|
|
BuildContext context, Map<String, String> params,
|
|
|
|
{showLoading = false}) async {
|
|
|
|
List<Notebook> notebooks = [];
|
|
|
|
BaseResp<List> baseResp = await DioUtil()
|
|
|
|
.request<List>(context, Method.get, HttpUrl.get_reserve_list,
|
|
...
|
...
|
@@ -661,15 +666,25 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (areaTableMap.isNotEmpty) {
|
|
|
|
if (areaTableMapShow.isNotEmpty) {
|
|
|
|
if (!needKeep) {
|
|
|
|
// currentArea = areaTableMap.keys.first;
|
|
|
|
// currentTables = areaTableMap[currentArea];
|
|
|
|
currentArea = '全部';
|
|
|
|
currentTables = tablesAll;
|
|
|
|
// currentTables = tablesAll;
|
|
|
|
pageState = PageState.Success;
|
|
|
|
} else {
|
|
|
|
if (currentArea != null && currentArea != '') {
|
|
|
|
// tablesShow = areaTableMapShow[currentArea];
|
|
|
|
List keys = areaTableMapShow.keys.toList();
|
|
|
|
selectNumber = keys.indexOf(currentArea) + 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (currentArea != null && currentArea != '') {
|
|
|
|
tablesShow = areaTableMapShow[currentArea];
|
|
|
|
selectNumber = areaTableMapShow.length;
|
|
|
|
}
|
|
|
|
// pageState = PageState.Empty;
|
|
|
|
pageState = PageState.Success;
|
|
|
|
}
|
|
...
|
...
|
@@ -848,7 +863,7 @@ class TableManagerModel with ChangeNotifier { |
|
|
|
refreshTable(context) async {
|
|
|
|
List temp = await getTableList(context, needLoading: false);
|
|
|
|
if (temp.length > 0) {
|
|
|
|
getReserveList(context, needLoading: false);
|
|
|
|
getReserveList(context, needLoading: false, needKeep: true);
|
|
|
|
} else {
|
|
|
|
// pageState = PageState.Empty;
|
|
|
|
pageState = PageState.Success;
|
...
|
...
|
|