|
@@ -16,6 +16,7 @@ import 'package:one_key/widgets/round_button.dart'; |
|
@@ -16,6 +16,7 @@ import 'package:one_key/widgets/round_button.dart'; |
|
16
|
import 'package:one_key/widgets/v_empty_view.dart';
|
16
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
17
|
import 'package:provider/provider.dart';
|
17
|
import 'package:provider/provider.dart';
|
|
18
|
|
18
|
|
|
|
|
19
|
+import '../../app.dart';
|
|
19
|
import '../../constant/state.dart';
|
20
|
import '../../constant/state.dart';
|
|
20
|
import '../../models/dsolt_xt.dart';
|
21
|
import '../../models/dsolt_xt.dart';
|
|
21
|
import '../../models/feast_menu_model.dart';
|
22
|
import '../../models/feast_menu_model.dart';
|
|
@@ -24,6 +25,7 @@ import '../../models/get_board_model.dart'; |
|
@@ -24,6 +25,7 @@ import '../../models/get_board_model.dart'; |
|
24
|
import '../../models/notebook.dart';
|
25
|
import '../../models/notebook.dart';
|
|
25
|
import '../../models/set_xuan_tai_model.dart';
|
26
|
import '../../models/set_xuan_tai_model.dart';
|
|
26
|
import '../../models/setmeal_by_id_model.dart';
|
27
|
import '../../models/setmeal_by_id_model.dart';
|
|
|
|
28
|
+import '../../models/tableOuter.dart';
|
|
27
|
import '../../models/upload_img_model.dart';
|
29
|
import '../../models/upload_img_model.dart';
|
|
28
|
import '../../provider/choose_table_model.dart';
|
30
|
import '../../provider/choose_table_model.dart';
|
|
29
|
import '../../provider/feast_model.dart';
|
31
|
import '../../provider/feast_model.dart';
|
|
@@ -108,6 +110,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -108,6 +110,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
108
|
ChooseTableModel _chooseTableModel;
|
110
|
ChooseTableModel _chooseTableModel;
|
|
109
|
List<Notebook> noteBooks;
|
111
|
List<Notebook> noteBooks;
|
|
110
|
Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单
|
112
|
Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单
|
|
|
|
113
|
+ List<TableOuter> tableOuterList = []; //区域-桌位列表
|
|
111
|
|
114
|
|
|
112
|
@override
|
115
|
@override
|
|
113
|
void initState() {
|
116
|
void initState() {
|
|
@@ -262,7 +265,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -262,7 +265,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
262
|
setXuanTaiModel.endDate; //起始时间
|
265
|
setXuanTaiModel.endDate; //起始时间
|
|
263
|
setXuanTaiModel.tableList = element.tableList;
|
266
|
setXuanTaiModel.tableList = element.tableList;
|
|
264
|
|
267
|
|
|
265
|
- setXuanTaiModel.tableSum = int.parse('${element.tableNum}'); //桌位总数
|
268
|
+ setXuanTaiModel.tableSum =
|
|
|
|
269
|
+ element.tableNum == null || element.tableNum == ''
|
|
|
|
270
|
+ ? 0
|
|
|
|
271
|
+ : int.parse('${element.tableNum}'); //桌位总数
|
|
266
|
setXuanTaiModel.customCxt.text = element.remark; //选台备注
|
272
|
setXuanTaiModel.customCxt.text = element.remark; //选台备注
|
|
267
|
setXuanTaiModel.feastRemarkXtImageList =
|
273
|
setXuanTaiModel.feastRemarkXtImageList =
|
|
268
|
element.feastRemarkImages; //宴会备注图片信息列表----选台
|
274
|
element.feastRemarkImages; //宴会备注图片信息列表----选台
|
|
@@ -1326,6 +1332,60 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1326,6 +1332,60 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1326
|
return true;
|
1332
|
return true;
|
|
1327
|
}
|
1333
|
}
|
|
1328
|
|
1334
|
|
|
|
|
1335
|
+ List<TableOuter> getSpTableList() {
|
|
|
|
1336
|
+ String tableList = App.sp.getString('table_list');
|
|
|
|
1337
|
+ if (tableList == null) {
|
|
|
|
1338
|
+ return [];
|
|
|
|
1339
|
+ }
|
|
|
|
1340
|
+ List<TableOuter> temp = [];
|
|
|
|
1341
|
+ List list = json.decode(tableList);
|
|
|
|
1342
|
+ if (list.length > 0) {
|
|
|
|
1343
|
+ list.forEach((element) {
|
|
|
|
1344
|
+ temp.add(TableOuter.fromJson2(element));
|
|
|
|
1345
|
+ });
|
|
|
|
1346
|
+ }
|
|
|
|
1347
|
+
|
|
|
|
1348
|
+ return temp;
|
|
|
|
1349
|
+ }
|
|
|
|
1350
|
+
|
|
|
|
1351
|
+ //获取桌位列表
|
|
|
|
1352
|
+ _getTableList({needLoading = true}) async {
|
|
|
|
1353
|
+ UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
1354
|
+ Map<String, String> params = {"sellerid": userModel.user.sellerid};
|
|
|
|
1355
|
+
|
|
|
|
1356
|
+ String tableSp = App.sp.getString('table_list');
|
|
|
|
1357
|
+
|
|
|
|
1358
|
+ if (tableSp == null) {
|
|
|
|
1359
|
+ //接口请求桌位
|
|
|
|
1360
|
+ tableOuterList = await _chooseTableModel.getTableList(context, params,
|
|
|
|
1361
|
+ needLoading: needLoading);
|
|
|
|
1362
|
+ } else {
|
|
|
|
1363
|
+ tableOuterList = getSpTableList();
|
|
|
|
1364
|
+ }
|
|
|
|
1365
|
+
|
|
|
|
1366
|
+ _chooseTableModel.tablesAll = [];
|
|
|
|
1367
|
+
|
|
|
|
1368
|
+ for (TableOuter item in tableOuterList) {
|
|
|
|
1369
|
+ // if (item.name == "推荐") {
|
|
|
|
1370
|
+ // itemModelList.remove(item);
|
|
|
|
1371
|
+ // }
|
|
|
|
1372
|
+ for (var item1 in item.list) {
|
|
|
|
1373
|
+ item1.selected = false;
|
|
|
|
1374
|
+ }
|
|
|
|
1375
|
+ _chooseTableModel.tablesAll.addAll(item.list);
|
|
|
|
1376
|
+ }
|
|
|
|
1377
|
+
|
|
|
|
1378
|
+ if (tableOuterList.isEmpty) {
|
|
|
|
1379
|
+ // _chooseTableModel.pageState = PageState.Success;
|
|
|
|
1380
|
+ // _chooseTableModel.notifyListeners();
|
|
|
|
1381
|
+ } else {
|
|
|
|
1382
|
+ _getReserveList(needLoading: needLoading);
|
|
|
|
1383
|
+ }
|
|
|
|
1384
|
+ // if (_chooseTableModel.pageState == PageState.Success) {
|
|
|
|
1385
|
+
|
|
|
|
1386
|
+ // }
|
|
|
|
1387
|
+ }
|
|
|
|
1388
|
+
|
|
1329
|
//获取已预订列表
|
1389
|
//获取已预订列表
|
|
1330
|
_getReserveList({needLoading = true}) async {
|
1390
|
_getReserveList({needLoading = true}) async {
|
|
1331
|
Map<String, String> params = {
|
1391
|
Map<String, String> params = {
|
|
@@ -1354,15 +1414,6 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1354,15 +1414,6 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1354
|
}
|
1414
|
}
|
|
1355
|
});
|
1415
|
});
|
|
1356
|
});
|
1416
|
});
|
|
1357
|
- // banquetByDateData.map((e) => null)
|
|
|
|
1358
|
- // String banquetKey = '';
|
|
|
|
1359
|
- // if (widget.ddate_slot == '1') {
|
|
|
|
1360
|
- // banquetKey = '早餐';
|
|
|
|
1361
|
- // } else if (widget.ddate_slot == '2') {
|
|
|
|
1362
|
- // banquetKey = '午餐';
|
|
|
|
1363
|
- // } else if (widget.ddate_slot == '3') {
|
|
|
|
1364
|
- // banquetKey = '晚餐';
|
|
|
|
1365
|
- // }
|
|
|
|
1366
|
|
1417
|
|
|
1367
|
Map<String, List<FeastBoardSunModel>> banquetData = {};
|
1418
|
Map<String, List<FeastBoardSunModel>> banquetData = {};
|
|
1368
|
banquetByDateDataTemp.forEach((element) {
|
1419
|
banquetByDateDataTemp.forEach((element) {
|
|
@@ -1400,26 +1451,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1400,26 +1451,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1400
|
}
|
1451
|
}
|
|
1401
|
});
|
1452
|
});
|
|
1402
|
|
1453
|
|
|
1403
|
- List<String> tidsWidget = xuantaiData[xuantaiSelIndex]
|
|
|
|
1404
|
- .tableList
|
|
|
|
1405
|
- .map((element) => element.id)
|
|
|
|
1406
|
- .toList();
|
|
|
|
1407
|
- print(tidsWidget);
|
1454
|
+ // List<String> tidsWidget = xuantaiData[xuantaiSelIndex]
|
|
|
|
1455
|
+ // .tableList
|
|
|
|
1456
|
+ // .map((element) => element.id)
|
|
|
|
1457
|
+ // .toList();
|
|
|
|
1458
|
+ // print(tidsWidget);
|
|
1408
|
banquetData.forEach((key, value) {
|
1459
|
banquetData.forEach((key, value) {
|
|
1409
|
value.forEach((element) {
|
1460
|
value.forEach((element) {
|
|
1410
|
//未丢单的宴会
|
1461
|
//未丢单的宴会
|
|
1411
|
|
1462
|
|
|
1412
|
- if (!tidsWidget.contains(key)) {
|
|
|
|
1413
|
- //带过来的桌子,不能标记已预订,或者已经有宴会
|
|
|
|
1414
|
- Notebook notebook = Notebook();
|
|
|
|
1415
|
- notebook.tid = key;
|
|
|
|
1416
|
- notebook.status = '10'; //宴会类型
|
|
|
|
1417
|
- notebook.className = element.className;
|
|
|
|
1418
|
- notebook.id = element.rid;
|
|
|
|
1419
|
- notebook.rname = element.rname;
|
|
|
|
1420
|
- notebook.nick_name = element.nickName ?? element.account;
|
|
|
|
1421
|
- noteBooks.add(notebook);
|
|
|
|
1422
|
- }
|
1463
|
+ // if (!tidsWidget.contains(key)) {
|
|
|
|
1464
|
+ //带过来的桌子,不能标记已预订,或者已经有宴会
|
|
|
|
1465
|
+ Notebook notebook = Notebook();
|
|
|
|
1466
|
+ notebook.tid = key;
|
|
|
|
1467
|
+ notebook.status = '10'; //宴会类型
|
|
|
|
1468
|
+ notebook.className = element.className;
|
|
|
|
1469
|
+ notebook.id = element.rid;
|
|
|
|
1470
|
+ notebook.rname = element.rname;
|
|
|
|
1471
|
+ notebook.nick_name = element.nickName ?? element.account;
|
|
|
|
1472
|
+ noteBooks.add(notebook);
|
|
|
|
1473
|
+ // }
|
|
1423
|
|
1474
|
|
|
1424
|
print(noteBooks);
|
1475
|
print(noteBooks);
|
|
1425
|
});
|
1476
|
});
|
|
@@ -1517,7 +1568,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1517,7 +1568,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1517
|
xuantaiData[xuantaiSelIndex].tableSum = 0;
|
1568
|
xuantaiData[xuantaiSelIndex].tableSum = 0;
|
|
1518
|
|
1569
|
|
|
1519
|
xuantaiData[xuantaiSelIndex].tids.forEach((element) {
|
1570
|
xuantaiData[xuantaiSelIndex].tids.forEach((element) {
|
|
1520
|
- xuantaiData[xuantaiSelIndex].tableSum += element.numStr;
|
1571
|
+ xuantaiData[xuantaiSelIndex].tableSum += int.parse(
|
|
|
|
1572
|
+ element.numStr == '' || element.numStr == null
|
|
|
|
1573
|
+ ? '0'
|
|
|
|
1574
|
+ : element.numStr);
|
|
1521
|
});
|
1575
|
});
|
|
1522
|
|
1576
|
|
|
1523
|
setState(() {});
|
1577
|
setState(() {});
|
|
@@ -1973,7 +2027,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1973,7 +2027,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1973
|
xuantaiData[xuantaiSelIndex].dateTimeShowxt =
|
2027
|
xuantaiData[xuantaiSelIndex].dateTimeShowxt =
|
|
1974
|
createDateText(context, day);
|
2028
|
createDateText(context, day);
|
|
1975
|
});
|
2029
|
});
|
|
1976
|
- _getReserveList();
|
2030
|
+ if (xuantaiData[xuantaiSelIndex].startDate != '' &&
|
|
|
|
2031
|
+ xuantaiData[xuantaiSelIndex].endDate != '' &&
|
|
|
|
2032
|
+ xuantaiData[xuantaiSelIndex].tableList !=
|
|
|
|
2033
|
+ null) {
|
|
|
|
2034
|
+ _getTableList();
|
|
|
|
2035
|
+ }
|
|
1977
|
}
|
2036
|
}
|
|
1978
|
});
|
2037
|
});
|
|
1979
|
}),
|
2038
|
}),
|
|
@@ -1986,9 +2045,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1986,9 +2045,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1986
|
return item.title;
|
2045
|
return item.title;
|
|
1987
|
}).toList(), (value) {
|
2046
|
}).toList(), (value) {
|
|
1988
|
if (value != null) {
|
2047
|
if (value != null) {
|
|
1989
|
- xuantaiData[xuantaiSelIndex].tids = [];
|
|
|
|
1990
|
- xuantaiData[xuantaiSelIndex].tableList = [];
|
|
|
|
1991
|
- xuantaiData[xuantaiSelIndex].tableSum = 0;
|
2048
|
+ // xuantaiData[xuantaiSelIndex].tids = [];
|
|
|
|
2049
|
+ // xuantaiData[xuantaiSelIndex].tableList = [];
|
|
|
|
2050
|
+ // xuantaiData[xuantaiSelIndex].tableSum = 0;
|
|
1992
|
setState(() {
|
2051
|
setState(() {
|
|
1993
|
xuantaiData[xuantaiSelIndex].cdSelIndex =
|
2052
|
xuantaiData[xuantaiSelIndex].cdSelIndex =
|
|
1994
|
value.first;
|
2053
|
value.first;
|
|
@@ -2038,6 +2097,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -2038,6 +2097,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
2038
|
'-' +
|
2097
|
'-' +
|
|
2039
|
xuantaiData[xuantaiSelIndex].endDate;
|
2098
|
xuantaiData[xuantaiSelIndex].endDate;
|
|
2040
|
setState(() {});
|
2099
|
setState(() {});
|
|
|
|
2100
|
+ if (xuantaiData[xuantaiSelIndex].startDate != '' &&
|
|
|
|
2101
|
+ xuantaiData[xuantaiSelIndex].endDate != '' &&
|
|
|
|
2102
|
+ xuantaiData[xuantaiSelIndex].dateTimeShowxt !=
|
|
|
|
2103
|
+ '请选择' &&
|
|
|
|
2104
|
+ xuantaiData[xuantaiSelIndex].tableList !=
|
|
|
|
2105
|
+ null) {
|
|
|
|
2106
|
+ _getTableList();
|
|
|
|
2107
|
+ }
|
|
2041
|
}
|
2108
|
}
|
|
2042
|
});
|
2109
|
});
|
|
2043
|
// DialogUtil.showSelectCusmanDialog(
|
2110
|
// DialogUtil.showSelectCusmanDialog(
|
|
@@ -2170,19 +2237,28 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -2170,19 +2237,28 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
2170
|
),
|
2237
|
),
|
|
2171
|
onChanged: (value) {
|
2238
|
onChanged: (value) {
|
|
2172
|
print('ggg');
|
2239
|
print('ggg');
|
|
|
|
2240
|
+ print(value);
|
|
|
|
2241
|
+
|
|
2173
|
xuantaiData[xuantaiSelIndex]
|
2242
|
xuantaiData[xuantaiSelIndex]
|
|
2174
|
.tableSum = 0;
|
2243
|
.tableSum = 0;
|
|
2175
|
for (Tids item
|
2244
|
for (Tids item
|
|
2176
|
in xuantaiData[
|
2245
|
in xuantaiData[
|
|
2177
|
xuantaiSelIndex]
|
2246
|
xuantaiSelIndex]
|
|
2178
|
.tids) {
|
2247
|
.tids) {
|
|
|
|
2248
|
+ item.numStr =
|
|
|
|
2249
|
+ item.tableNumC.text;
|
|
2179
|
xuantaiData[xuantaiSelIndex]
|
2250
|
xuantaiData[xuantaiSelIndex]
|
|
2180
|
.tableSum +=
|
2251
|
.tableSum +=
|
|
2181
|
int.parse(item
|
2252
|
int.parse(item
|
|
2182
|
- .tableNumC.text);
|
2253
|
+ .tableNumC
|
|
|
|
2254
|
+ .text ==
|
|
|
|
2255
|
+ ''
|
|
|
|
2256
|
+ ? '0'
|
|
|
|
2257
|
+ : item.tableNumC
|
|
|
|
2258
|
+ .text);
|
|
|
|
2259
|
+
|
|
|
|
2260
|
+ setState(() {});
|
|
2183
|
}
|
2261
|
}
|
|
2184
|
-
|
|
|
|
2185
|
- setState(() {});
|
|
|
|
2186
|
},
|
2262
|
},
|
|
2187
|
onEditingComplete: () {
|
2263
|
onEditingComplete: () {
|
|
2188
|
// print('fff');
|
2264
|
// print('fff');
|
|
@@ -2221,23 +2297,42 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -2221,23 +2297,42 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
2221
|
.color_E6000000,
|
2297
|
.color_E6000000,
|
|
2222
|
rTitle: "删除",
|
2298
|
rTitle: "删除",
|
|
2223
|
rCallback: () {
|
2299
|
rCallback: () {
|
|
2224
|
- if (xuantaiData[
|
|
|
|
2225
|
- xuantaiSelIndex]
|
|
|
|
2226
|
- .tableSum >
|
|
|
|
2227
|
- 0) {
|
2300
|
+ if (xuantaiData[xuantaiSelIndex]
|
|
|
|
2301
|
+ .tableSum >
|
|
|
|
2302
|
+ 0 &&
|
|
|
|
2303
|
+ xuantaiData[xuantaiSelIndex]
|
|
|
|
2304
|
+ .tids[index]
|
|
|
|
2305
|
+ .tableNumC
|
|
|
|
2306
|
+ .text !=
|
|
|
|
2307
|
+ '') {
|
|
2228
|
xuantaiData[xuantaiSelIndex]
|
2308
|
xuantaiData[xuantaiSelIndex]
|
|
2229
|
.tableSum -=
|
2309
|
.tableSum -=
|
|
2230
|
int.parse(xuantaiData[
|
2310
|
int.parse(xuantaiData[
|
|
2231
|
- xuantaiSelIndex]
|
|
|
|
2232
|
- .tids[index]
|
|
|
|
2233
|
- .tableNumC
|
|
|
|
2234
|
- .text);
|
2311
|
+ xuantaiSelIndex]
|
|
|
|
2312
|
+ .tids[index]
|
|
|
|
2313
|
+ .tableNumC
|
|
|
|
2314
|
+ .text ==
|
|
|
|
2315
|
+ ''
|
|
|
|
2316
|
+ ? '0'
|
|
|
|
2317
|
+ : xuantaiData[
|
|
|
|
2318
|
+ xuantaiSelIndex]
|
|
|
|
2319
|
+ .tids[index]
|
|
|
|
2320
|
+ .tableNumC
|
|
|
|
2321
|
+ .text);
|
|
2235
|
}
|
2322
|
}
|
|
2236
|
|
2323
|
|
|
2237
|
xuantaiData[xuantaiSelIndex]
|
2324
|
xuantaiData[xuantaiSelIndex]
|
|
|
|
2325
|
+ .tableList
|
|
|
|
2326
|
+ .removeWhere((element) =>
|
|
|
|
2327
|
+ element.id ==
|
|
|
|
2328
|
+ xuantaiData[
|
|
|
|
2329
|
+ xuantaiSelIndex]
|
|
|
|
2330
|
+ .tids[index]
|
|
|
|
2331
|
+ .tid);
|
|
|
|
2332
|
+ xuantaiData[xuantaiSelIndex]
|
|
2238
|
.tids
|
2333
|
.tids
|
|
2239
|
.removeAt(index);
|
2334
|
.removeAt(index);
|
|
2240
|
- print('eeeeeee');
|
2335
|
+
|
|
2241
|
setState(() {});
|
2336
|
setState(() {});
|
|
2242
|
// _delGuestInfocDay(model.cday[index].id);
|
2337
|
// _delGuestInfocDay(model.cday[index].id);
|
|
2243
|
});
|
2338
|
});
|
|
@@ -2358,6 +2453,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -2358,6 +2453,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
2358
|
hmE: xuantaiData[xuantaiSelIndex]
|
2453
|
hmE: xuantaiData[xuantaiSelIndex]
|
|
2359
|
.endDate,
|
2454
|
.endDate,
|
|
2360
|
source: '1',
|
2455
|
source: '1',
|
|
|
|
2456
|
+ ridFeast:
|
|
|
|
2457
|
+ xuantaiData[xuantaiSelIndex]
|
|
|
|
2458
|
+ .rid,
|
|
2361
|
object: {
|
2459
|
object: {
|
|
2362
|
'object': xuantaiData[xuantaiSelIndex]
|
2460
|
'object': xuantaiData[xuantaiSelIndex]
|
|
2363
|
.tableList
|
2461
|
.tableList
|
|
@@ -2373,28 +2471,58 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -2373,28 +2471,58 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
2373
|
.startDate,
|
2471
|
.startDate,
|
|
2374
|
hmE: xuantaiData[xuantaiSelIndex].endDate,
|
2472
|
hmE: xuantaiData[xuantaiSelIndex].endDate,
|
|
2375
|
source: '1',
|
2473
|
source: '1',
|
|
|
|
2474
|
+ ridFeast:
|
|
|
|
2475
|
+ xuantaiData[xuantaiSelIndex].rid,
|
|
2376
|
canChoose: true,
|
2476
|
canChoose: true,
|
|
2377
|
);
|
2477
|
);
|
|
2378
|
}
|
2478
|
}
|
|
2379
|
|
2479
|
|
|
2380
|
if (temp == null) {
|
2480
|
if (temp == null) {
|
|
2381
|
} else if (temp['object'].length == 0) {
|
2481
|
} else if (temp['object'].length == 0) {
|
|
2382
|
- } else {
|
2482
|
+ print('----------');
|
|
|
|
2483
|
+ xuantaiData[xuantaiSelIndex].tableList = [];
|
|
2383
|
xuantaiData[xuantaiSelIndex].tids = [];
|
2484
|
xuantaiData[xuantaiSelIndex].tids = [];
|
|
|
|
2485
|
+ xuantaiData[xuantaiSelIndex].tableSum = 0;
|
|
|
|
2486
|
+
|
|
|
|
2487
|
+ setState(() {});
|
|
|
|
2488
|
+ } else {
|
|
|
|
2489
|
+ // xuantaiData[xuantaiSelIndex].tids = [];
|
|
2384
|
xuantaiData[xuantaiSelIndex].tableList =
|
2490
|
xuantaiData[xuantaiSelIndex].tableList =
|
|
2385
|
temp['object'];
|
2491
|
temp['object'];
|
|
2386
|
-
|
2492
|
+ xuantaiData[xuantaiSelIndex].tableSum = 0;
|
|
|
|
2493
|
+ List<Tids> tidsTemp = [];
|
|
2387
|
for (t.TableList item
|
2494
|
for (t.TableList item
|
|
2388
|
in xuantaiData[xuantaiSelIndex]
|
2495
|
in xuantaiData[xuantaiSelIndex]
|
|
2389
|
.tableList) {
|
2496
|
.tableList) {
|
|
2390
|
item.selected = true;
|
2497
|
item.selected = true;
|
|
|
|
2498
|
+
|
|
2391
|
Tids tids = Tids();
|
2499
|
Tids tids = Tids();
|
|
2392
|
tids.tid = item.id;
|
2500
|
tids.tid = item.id;
|
|
2393
|
tids.name = item.name ?? "";
|
2501
|
tids.name = item.name ?? "";
|
|
2394
|
- xuantaiData[xuantaiSelIndex]
|
|
|
|
2395
|
- .tids
|
|
|
|
2396
|
- .add(tids);
|
2502
|
+ List<Tids> temp =
|
|
|
|
2503
|
+ xuantaiData[xuantaiSelIndex]
|
|
|
|
2504
|
+ .tids
|
|
|
|
2505
|
+ .where((element) =>
|
|
|
|
2506
|
+ element.tid == tids.tid)
|
|
|
|
2507
|
+ .toList();
|
|
|
|
2508
|
+ if (temp != null && temp.length > 0) {
|
|
|
|
2509
|
+ tids.numStr = temp[0].tableNumC.text;
|
|
|
|
2510
|
+ tids.tableNumC.text = temp[0].numStr;
|
|
|
|
2511
|
+ }
|
|
|
|
2512
|
+ tidsTemp.add(tids);
|
|
2397
|
}
|
2513
|
}
|
|
|
|
2514
|
+ xuantaiData[xuantaiSelIndex].tids =
|
|
|
|
2515
|
+ tidsTemp;
|
|
|
|
2516
|
+ xuantaiData[xuantaiSelIndex]
|
|
|
|
2517
|
+ .tids
|
|
|
|
2518
|
+ .forEach((element) {
|
|
|
|
2519
|
+ xuantaiData[xuantaiSelIndex].tableSum +=
|
|
|
|
2520
|
+ int.parse(element.numStr == '' ||
|
|
|
|
2521
|
+ element.numStr == null
|
|
|
|
2522
|
+ ? '0'
|
|
|
|
2523
|
+ : element.numStr);
|
|
|
|
2524
|
+ });
|
|
|
|
2525
|
+
|
|
2398
|
setState(() {});
|
2526
|
setState(() {});
|
|
2399
|
}
|
2527
|
}
|
|
2400
|
// }
|
2528
|
// }
|
|
@@ -3557,7 +3685,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -3557,7 +3685,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
3557
|
total = sum + double.parse(costInfoModel.serviceC.text);
|
3685
|
total = sum + double.parse(costInfoModel.serviceC.text);
|
|
3558
|
} else {
|
3686
|
} else {
|
|
3559
|
//选中百分比
|
3687
|
//选中百分比
|
|
3560
|
- if (int.parse(costInfoModel.serviceC.text) > 100) {
|
3688
|
+ if (int.parse(costInfoModel.serviceC.text == ''
|
|
|
|
3689
|
+ ? '0'
|
|
|
|
3690
|
+ : costInfoModel.serviceC.text) >
|
|
|
|
3691
|
+ 100) {
|
|
3561
|
Utils.showToast('请输入小于100的数字');
|
3692
|
Utils.showToast('请输入小于100的数字');
|
|
3562
|
|
3693
|
|
|
3563
|
return;
|
3694
|
return;
|
|
@@ -3584,7 +3715,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -3584,7 +3715,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
3584
|
total -= double.parse(costInfoModel.discountC.text);
|
3715
|
total -= double.parse(costInfoModel.discountC.text);
|
|
3585
|
} else {
|
3716
|
} else {
|
|
3586
|
//选中百分比
|
3717
|
//选中百分比
|
|
3587
|
- if (int.parse(costInfoModel.discountC.text) > 100) {
|
3718
|
+ if (int.parse(costInfoModel.discountC.text == ''
|
|
|
|
3719
|
+ ? '0'
|
|
|
|
3720
|
+ : costInfoModel.discountC.text) >
|
|
|
|
3721
|
+ 100) {
|
|
3588
|
Utils.showToast('请输入小于100的数字');
|
3722
|
Utils.showToast('请输入小于100的数字');
|
|
3589
|
|
3723
|
|
|
3590
|
return;
|
3724
|
return;
|