|
...
|
...
|
@@ -224,11 +224,8 @@ class SelectTablePageState extends State<SelectTablePage> { |
|
|
|
onSelected: (table) {
|
|
|
|
if ((table as t.Table).selected) {
|
|
|
|
selectTables.add(table);
|
|
|
|
Map<String, dynamic> temp =
|
|
|
|
modelToJson(table);
|
|
|
|
TableList tableList =
|
|
|
|
TableList.fromJson(temp);
|
|
|
|
widget.tableList.add(tableList);
|
|
|
|
widget.tableList
|
|
|
|
.add(tableToTableList(table));
|
|
|
|
} else {
|
|
|
|
widget.tableList
|
|
|
|
.removeWhere((t) => t.id == table.id);
|
|
...
|
...
|
@@ -281,25 +278,24 @@ class SelectTablePageState extends State<SelectTablePage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
modelToJson(t.Table table) {
|
|
|
|
Map res = {
|
|
|
|
'id': table.id,
|
|
|
|
'rid': table.rid,
|
|
|
|
'tid': table.tid,
|
|
|
|
'name': table.name,
|
|
|
|
'tablePnum': table.table_pnum,
|
|
|
|
'sellerid': null,
|
|
|
|
'qrcode': null,
|
|
|
|
'mostPnum': table.most_pnum,
|
|
|
|
'hot': null,
|
|
|
|
'orderO': table.order_o,
|
|
|
|
'status': table.status,
|
|
|
|
'enable': table.enable,
|
|
|
|
'spell': table.spell,
|
|
|
|
'cdate': null,
|
|
|
|
'rname': table.rname,
|
|
|
|
'regionName': null
|
|
|
|
};
|
|
|
|
return res;
|
|
|
|
tableToTableList(t.Table table) {
|
|
|
|
TableList _tableList;
|
|
|
|
_tableList.id = table.id;
|
|
|
|
_tableList.rid = table.rid;
|
|
|
|
_tableList.tid = table.tid;
|
|
|
|
_tableList.name = table.name;
|
|
|
|
_tableList.tablePnum = table.table_pnum;
|
|
|
|
_tableList.sellerid = null;
|
|
|
|
_tableList.qrcode = null;
|
|
|
|
_tableList.mostPnum = table.most_pnum;
|
|
|
|
_tableList.hot = null;
|
|
|
|
_tableList.orderO = table.order_o;
|
|
|
|
_tableList.status = table.status;
|
|
|
|
_tableList.enable = table.enable;
|
|
|
|
_tableList.spell = table.spell;
|
|
|
|
_tableList.cdate = null;
|
|
|
|
_tableList.rname = table.rname;
|
|
|
|
_tableList.regionName = null;
|
|
|
|
return _tableList;
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|