|
...
|
...
|
@@ -480,10 +480,14 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { |
|
|
|
tableManagerModel.areas.length ==
|
|
|
|
0) {
|
|
|
|
return tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
.tableOuterList
|
|
|
|
.length >
|
|
|
|
0 &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? SizedBox()
|
|
|
|
: InkWell(
|
|
|
|
onTap: () async {
|
|
...
|
...
|
@@ -686,7 +690,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { |
|
|
|
onTap: () async {
|
|
|
|
//添加区域弹框
|
|
|
|
await DialogUtil
|
|
|
|
.openCreateAreaDialog(
|
|
|
|
.openTableManageCreateAreaDialog(
|
|
|
|
context, onTap:
|
|
|
|
(value) async {
|
|
|
|
print(value);
|
|
...
|
...
|
@@ -766,143 +770,59 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { |
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
Expanded(
|
|
|
|
// flex: 2,
|
|
|
|
child: Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
minHeight:
|
|
|
|
ScreenUtil().setWidth(100)),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(20),
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(48)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(26),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? SizedBox()
|
|
|
|
: Row(children: [
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect =
|
|
|
|
!tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect;
|
|
|
|
|
|
|
|
if (!tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length >
|
|
|
|
1) {
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list) {
|
|
|
|
item.selected =
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
tableManagerModel
|
|
|
|
tableManagerModel.tableOuterList.length == 0
|
|
|
|
? SizedBox()
|
|
|
|
: Expanded(
|
|
|
|
// flex: 2,
|
|
|
|
child: Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
minHeight:
|
|
|
|
ScreenUtil().setWidth(100)),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical:
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(48)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(26),
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber !=
|
|
|
|
null &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables = [];
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? 'base_radio_sel'
|
|
|
|
: 'base_radio_un'),
|
|
|
|
width:
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
40),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'批量选择桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_000000),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
Spacer(),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? InkWell(
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? SizedBox()
|
|
|
|
: Row(children: [
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables = [];
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isAll =
|
|
|
|
.isSelect =
|
|
|
|
!tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isAll;
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isAll) {
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.list) {
|
|
|
|
item.selected =
|
|
|
|
true;
|
|
|
|
tableManagerModel
|
|
|
|
.isSelect;
|
|
|
|
|
|
|
|
if (!tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.add(
|
|
|
|
item);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
.isSelect &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length >
|
|
|
|
0) {
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
...
|
...
|
@@ -911,195 +831,422 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { |
|
|
|
item.selected =
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables = [];
|
|
|
|
}
|
|
|
|
setState(() {});
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment
|
|
|
|
.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(tableManagerModel
|
|
|
|
.tableOuterList[tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isAll
|
|
|
|
? 'mine_radio_sel'
|
|
|
|
: 'mine_radio_nor'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
34)),
|
|
|
|
Utils.getImgPath(tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? 'base_radio_sel'
|
|
|
|
: 'base_radio_un'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
40),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'全选',
|
|
|
|
'批量选择桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_515151,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(32)),
|
|
|
|
)
|
|
|
|
.color_000000),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox()
|
|
|
|
]),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? VEmptyView(20)
|
|
|
|
: VEmptyView(60),
|
|
|
|
Expanded(
|
|
|
|
child: item(tableManagerModel
|
|
|
|
.selectNumber)),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil()
|
|
|
|
.setWidth(50)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(60),
|
|
|
|
Row(
|
|
|
|
)),
|
|
|
|
Spacer(),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList
|
|
|
|
.length >
|
|
|
|
0 &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? InkWell(
|
|
|
|
onTap: () {
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables = [];
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isAll =
|
|
|
|
!tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.isAll;
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isAll) {
|
|
|
|
for (t.Table item in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.list) {
|
|
|
|
item.selected =
|
|
|
|
true;
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.add(
|
|
|
|
item);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (t.Table item in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.list) {
|
|
|
|
item.selected =
|
|
|
|
false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setState(
|
|
|
|
() {});
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment
|
|
|
|
.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(tableManagerModel.tableOuterList[tableManagerModel.selectNumber].isAll
|
|
|
|
? 'mine_radio_sel'
|
|
|
|
: 'mine_radio_nor'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(34)),
|
|
|
|
Text(
|
|
|
|
'全选',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_515151,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox()
|
|
|
|
]),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? VEmptyView(20)
|
|
|
|
: VEmptyView(60),
|
|
|
|
Expanded(
|
|
|
|
child: item(
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber)),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil()
|
|
|
|
.setWidth(50)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment
|
|
|
|
.start,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'1、添加区域(如:一楼、二楼、东厅等)',
|
|
|
|
VEmptyView(60),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'1、添加区域(如:一楼、二楼、东厅等)',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration:
|
|
|
|
TextDecoration
|
|
|
|
.lineThrough,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Text('2、选择要添加桌位的区域',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration:
|
|
|
|
TextDecoration
|
|
|
|
.lineThrough,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Text('2、选择要添加桌位的区域',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4)),
|
|
|
|
VEmptyView(40),
|
|
|
|
Text('3、点击“+”号添加桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.color_BFC4D4)),
|
|
|
|
VEmptyView(40),
|
|
|
|
Text('3、点击“+”号添加桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4)),
|
|
|
|
VEmptyView(120),
|
|
|
|
Image.asset(
|
|
|
|
"assets/empty_search.png",
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(520),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(384),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4)),
|
|
|
|
VEmptyView(120),
|
|
|
|
Image.asset(
|
|
|
|
"assets/empty_search.png",
|
|
|
|
width:
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
520),
|
|
|
|
height:
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
384),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
])),
|
|
|
|
model.pageState == PageState.Success &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[tableManagerModel.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(48)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
tableManagerModel.tableOuterList.length == 0
|
|
|
|
? SizedBox()
|
|
|
|
: model.pageState == PageState.Success &&
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(48)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
CommonButton(
|
|
|
|
content: "修改名称",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () async {
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
CommonButton(
|
|
|
|
content: "修改名称",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () async {
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
DialogUtil
|
|
|
|
.openMyTableManageModifyTableNameDialog(
|
|
|
|
context,
|
|
|
|
onTap: (Map<String, String>
|
|
|
|
value) async {
|
|
|
|
Map<String, String> params = {
|
|
|
|
'name': value['name'],
|
|
|
|
};
|
|
|
|
DialogUtil
|
|
|
|
.openMyTableManageModifyTableNameDialog(
|
|
|
|
context,
|
|
|
|
onTap: (Map<String, String>
|
|
|
|
value) async {
|
|
|
|
String tids = '';
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables) {
|
|
|
|
tids += '${item.id},';
|
|
|
|
}
|
|
|
|
if (tids.endsWith(',')) {
|
|
|
|
tids = tids.substring(
|
|
|
|
0, tids.length - 1);
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
'name': value['name'],
|
|
|
|
'tableids': tids,
|
|
|
|
'skip_four':
|
|
|
|
value['skip_four'],
|
|
|
|
'skip_seven':
|
|
|
|
value['skip_seven'],
|
|
|
|
};
|
|
|
|
|
|
|
|
// bool success =
|
|
|
|
// await tableManagerModel
|
|
|
|
// .setTableById(
|
|
|
|
// context, params);
|
|
|
|
// print(success);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('修改成功!');
|
|
|
|
bool success =
|
|
|
|
await tableManagerModel
|
|
|
|
.batchSetTable(
|
|
|
|
context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('修改成功!');
|
|
|
|
|
|
|
|
// await tableManagerModel
|
|
|
|
// .refreshTable(context);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
CommonButton(
|
|
|
|
content: "修改人数",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () async {
|
|
|
|
await DialogUtil
|
|
|
|
.openMyTableManageModifyTableNumDialog(
|
|
|
|
context,
|
|
|
|
personNumList,
|
|
|
|
pnumMin: '',
|
|
|
|
pnumMax: '',
|
|
|
|
onTap: (Map<String, String>
|
|
|
|
value) async {
|
|
|
|
// if (value['pnumMin'] != '') {
|
|
|
|
// params['table_pnum'] = value['pnumMin'];
|
|
|
|
// }
|
|
|
|
// if (value['pnumMax'] != '') {
|
|
|
|
// params['most_pnum'] = value['pnumMax'];
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
await tableManagerModel
|
|
|
|
.refreshTable(context);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
CommonButton(
|
|
|
|
content: "修改人数",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () async {
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
await DialogUtil
|
|
|
|
.openMyTableManageModifyTableNumDialog(
|
|
|
|
context,
|
|
|
|
personNumList,
|
|
|
|
pnumMin: '',
|
|
|
|
pnumMax: '',
|
|
|
|
onTap: (Map<String, String>
|
|
|
|
value) async {
|
|
|
|
String tids = '';
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables) {
|
|
|
|
tids += '${item.id},';
|
|
|
|
}
|
|
|
|
if (tids.endsWith(',')) {
|
|
|
|
tids = tids.substring(
|
|
|
|
0, tids.length - 1);
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
'tableids': tids,
|
|
|
|
};
|
|
|
|
if (value['pnumMin'] != '') {
|
|
|
|
params['table_pnum'] =
|
|
|
|
value['pnumMin'];
|
|
|
|
}
|
|
|
|
if (value['pnumMax'] != '') {
|
|
|
|
params['most_pnum'] =
|
|
|
|
value['pnumMax'];
|
|
|
|
}
|
|
|
|
|
|
|
|
bool success =
|
|
|
|
await tableManagerModel
|
|
|
|
.batchSetTable(
|
|
|
|
context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('修改成功!');
|
|
|
|
|
|
|
|
await tableManagerModel
|
|
|
|
.refreshTable(context);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
CommonButton(
|
|
|
|
content: "修改类型",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () async {
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
List<String> tableTypeS = [];
|
|
|
|
for (int i = 0;
|
|
|
|
i <
|
|
|
|
tableManagerModel
|
|
|
|
.tableTypeList.length;
|
|
|
|
i++) {
|
|
|
|
tableTypeS.add(tableManagerModel
|
|
|
|
.tableTypeList[i].name);
|
|
|
|
}
|
|
|
|
DialogUtil
|
|
|
|
.openMyTableManageModifyTableTypeDialog(
|
|
|
|
context,
|
|
|
|
tableTypeS,
|
|
|
|
onTap: (Map<String, String>
|
|
|
|
value) async {
|
|
|
|
String tid;
|
|
|
|
String tids = '';
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.selectTables) {
|
|
|
|
tids += '${item.id},';
|
|
|
|
}
|
|
|
|
if (tids.endsWith(',')) {
|
|
|
|
tids = tids.substring(
|
|
|
|
0, tids.length - 1);
|
|
|
|
}
|
|
|
|
for (int i = 0;
|
|
|
|
i <
|
|
|
|
tableManagerModel
|
|
|
|
.tableTypeList
|
|
|
|
.length;
|
|
|
|
i++) {
|
|
|
|
if (value['bjtype'] ==
|
|
|
|
tableManagerModel
|
|
|
|
.tableTypeList[i]
|
|
|
|
.name) {
|
|
|
|
tid = tableManagerModel
|
|
|
|
.tableTypeList[i].id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
'tableids': tids,
|
|
|
|
'tid': tid
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success =
|
|
|
|
await tableManagerModel
|
|
|
|
.batchSetTable(
|
|
|
|
context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('修改成功!');
|
|
|
|
|
|
|
|
await tableManagerModel
|
|
|
|
.refreshTable(context);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(44),
|
|
|
|
CommonButton(
|
|
|
|
content: "修改类型",
|
|
|
|
content: "删除桌位",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
state: -3,
|
|
|
|
onPress: () async {
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList[
|
|
...
|
...
|
@@ -1111,135 +1258,70 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { |
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
List<String> tableTypeS = [];
|
|
|
|
for (int i = 0;
|
|
|
|
i <
|
|
|
|
tableManagerModel
|
|
|
|
.tableTypeList.length;
|
|
|
|
i++) {
|
|
|
|
tableTypeS.add(tableManagerModel
|
|
|
|
.tableTypeList[i].name);
|
|
|
|
}
|
|
|
|
DialogUtil
|
|
|
|
.openMyTableManageModifyTableTypeDialog(
|
|
|
|
context,
|
|
|
|
tableTypeS,
|
|
|
|
onTap: (Map<String, String>
|
|
|
|
value) async {
|
|
|
|
String tid;
|
|
|
|
for (int i = 0;
|
|
|
|
i <
|
|
|
|
tableManagerModel
|
|
|
|
.tableTypeList.length;
|
|
|
|
i++) {
|
|
|
|
if (value['bjtype'] ==
|
|
|
|
tableManagerModel
|
|
|
|
.tableTypeList[i].name) {
|
|
|
|
tid = tableManagerModel
|
|
|
|
.tableTypeList[i].id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// 'id': table.id,
|
|
|
|
// 'tid': tid
|
|
|
|
// };
|
|
|
|
|
|
|
|
// bool success =
|
|
|
|
// await tableManagerModel
|
|
|
|
// .setTableById(
|
|
|
|
// context, params);
|
|
|
|
// print(success);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('修改成功!');
|
|
|
|
|
|
|
|
// await tableManagerModel
|
|
|
|
// .refreshTable(context);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(44),
|
|
|
|
CommonButton(
|
|
|
|
content: "删除桌位",
|
|
|
|
width: 200,
|
|
|
|
height: 72,
|
|
|
|
fontSize: 32,
|
|
|
|
state: -3,
|
|
|
|
onPress: () async {
|
|
|
|
if (tableManagerModel
|
|
|
|
String tids = '';
|
|
|
|
for (t.Table item in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.selectTables
|
|
|
|
.length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请选择桌位');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
String tids = '';
|
|
|
|
for (t.Table item in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel.selectNumber]
|
|
|
|
.selectTables) {
|
|
|
|
tids += '${item.id},';
|
|
|
|
}
|
|
|
|
if (tids.endsWith(',')) {
|
|
|
|
tids = tids.substring(0, tids.length - 1);
|
|
|
|
}
|
|
|
|
.selectTables) {
|
|
|
|
tids += '${item.id},';
|
|
|
|
}
|
|
|
|
if (tids.endsWith(',')) {
|
|
|
|
tids = tids.substring(
|
|
|
|
0, tids.length - 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "",
|
|
|
|
content:
|
|
|
|
"是否确定删除${tids.split(',').length}个桌位",
|
|
|
|
lTitle: "取消",
|
|
|
|
rTitle: "确认删除",
|
|
|
|
isBold: true,
|
|
|
|
isBoldContent: true,
|
|
|
|
rColor: MyColours.color_E34D59,
|
|
|
|
lCallback: () {
|
|
|
|
print("取消");
|
|
|
|
}, rCallback: () async {
|
|
|
|
print("确定");
|
|
|
|
DialogUtil.cupertinoAlertDialog(context,
|
|
|
|
title: "",
|
|
|
|
content:
|
|
|
|
"是否确定删除${tids.split(',').length}个桌位",
|
|
|
|
lTitle: "取消",
|
|
|
|
rTitle: "确认删除",
|
|
|
|
isBold: true,
|
|
|
|
isBoldContent: true,
|
|
|
|
rColor: MyColours.color_E34D59,
|
|
|
|
lCallback: () {
|
|
|
|
print("取消");
|
|
|
|
}, rCallback: () async {
|
|
|
|
print("确定");
|
|
|
|
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sid': Provider.of<UserModel>(context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
'tid': tids
|
|
|
|
};
|
|
|
|
Map<String, String> params = {
|
|
|
|
'sid': Provider.of<UserModel>(
|
|
|
|
context,
|
|
|
|
listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
'tid': tids
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success = await tableManagerModel
|
|
|
|
.delSellerTables(context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('删除成功!');
|
|
|
|
// TableOuter tableOuter = TableOuter();
|
|
|
|
// tableOuter.name = value;
|
|
|
|
// tableOuter.list = [];
|
|
|
|
// tableManagerModel.tableOuterList.add(tableOuter);
|
|
|
|
// tableManagerModel.initData();
|
|
|
|
// Timer(
|
|
|
|
// Duration(milliseconds: 500),
|
|
|
|
// () => _areaController.jumpTo(
|
|
|
|
// _areaController.position.maxScrollExtent));
|
|
|
|
bool success = await tableManagerModel
|
|
|
|
.delSellerTables(context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('删除成功!');
|
|
|
|
// TableOuter tableOuter = TableOuter();
|
|
|
|
// tableOuter.name = value;
|
|
|
|
// tableOuter.list = [];
|
|
|
|
// tableManagerModel.tableOuterList.add(tableOuter);
|
|
|
|
// tableManagerModel.initData();
|
|
|
|
// Timer(
|
|
|
|
// Duration(milliseconds: 500),
|
|
|
|
// () => _areaController.jumpTo(
|
|
|
|
// _areaController.position.maxScrollExtent));
|
|
|
|
|
|
|
|
// await tableManagerModel
|
|
|
|
// .getTableList(context);
|
|
|
|
// await tableManagerModel
|
|
|
|
// .initData();
|
|
|
|
await tableManagerModel
|
|
|
|
.refreshTable(context);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox()
|
|
|
|
// await tableManagerModel
|
|
|
|
// .getTableList(context);
|
|
|
|
// await tableManagerModel
|
|
|
|
// .initData();
|
|
|
|
await tableManagerModel
|
|
|
|
.refreshTable(context);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox()
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
...
|
...
|
|