|
...
|
...
|
@@ -14,6 +14,7 @@ import 'package:one_key/utils/utils.dart'; |
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/common_button.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/need_item.dart';
|
|
|
|
import 'package:one_key/widgets/page_exception.dart';
|
|
|
|
import 'package:one_key/widgets/row_multi_text.dart';
|
|
...
|
...
|
@@ -54,6 +55,10 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
|
|
|
|
String formatPhone = ""; //格式客户号码
|
|
|
|
|
|
|
|
bool isRefused = false; //是否已拒绝
|
|
|
|
bool isPause = false; //是否暂停预订
|
|
|
|
StateSetter refuseDialogState; //决绝弹框setState
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
...
|
...
|
@@ -86,7 +91,7 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
if (detailEntity.status != "0") {
|
|
|
|
if (detailEntity.status != "0" && !isPause) {
|
|
|
|
//已处理
|
|
|
|
Future.delayed(Duration(milliseconds: 200), () {
|
|
|
|
NavigatorUtil.goNotebookDetailPage(context, detailEntity.id,
|
|
...
|
...
|
@@ -112,54 +117,216 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
}
|
|
|
|
|
|
|
|
//拒绝订单弹框
|
|
|
|
_showRefuseDialog() {
|
|
|
|
showDialog(
|
|
|
|
context: context,
|
|
|
|
builder: (context) {
|
|
|
|
return AlertDialog(
|
|
|
|
title: Text("确定拒绝订单吗?\n拒绝后无法联系客户"),
|
|
|
|
titleTextStyle: TextStyle(
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
content: Text("如果包间类型订满,请及时停用"),
|
|
|
|
contentTextStyle: TextStyle(
|
|
|
|
color: MyColours.color_828282,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
actions: <Widget>[
|
|
|
|
FlatButton(
|
|
|
|
child: Text(
|
|
|
|
"拒绝订单",
|
|
|
|
style: TextStyle(fontSize: ScreenUtil().setSp(32)),
|
|
|
|
_showRefuseDialog2() {
|
|
|
|
Widget dialogContent = StatefulBuilder(
|
|
|
|
builder: (context, setState) {
|
|
|
|
refuseDialogState = setState;
|
|
|
|
Container container = Container(
|
|
|
|
child: Stack(
|
|
|
|
alignment: AlignmentDirectional.topCenter,
|
|
|
|
children: [
|
|
|
|
Positioned(
|
|
|
|
right: 0,
|
|
|
|
top: ScreenUtil().setWidth(6),
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(21)),
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/close.png",
|
|
|
|
width: ScreenUtil().setWidth(28),
|
|
|
|
height: ScreenUtil().setWidth(28),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
setReserveStatus("6");
|
|
|
|
},
|
|
|
|
),
|
|
|
|
FlatButton(
|
|
|
|
child: Text(
|
|
|
|
"去安排",
|
|
|
|
style: TextStyle(fontSize: ScreenUtil().setSp(32)),
|
|
|
|
Offstage(
|
|
|
|
offstage: isRefused,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
VEmptyView(40),
|
|
|
|
Text(
|
|
|
|
"拒绝订单",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_353535,
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
VEmptyView(60),
|
|
|
|
Text(
|
|
|
|
"确定要拒绝订单吗?一旦拒绝无法恢复。",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
),
|
|
|
|
VEmptyView(80),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
setReserveStatus("6", ac: "1");
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(336),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
child: Text(
|
|
|
|
"拒绝并暂停预订",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_ffffff),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
setReserveStatus("6");
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(336),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
width: ScreenUtil().setWidth(2))),
|
|
|
|
child: Text(
|
|
|
|
"直接拒绝",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () async {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Map temp = await NavigatorUtil.goSelectTablePage(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
int.parse(detailEntity.ddate) * 1000,
|
|
|
|
detailEntity.ddate_solt);
|
|
|
|
if (temp != null && temp['tid'] != null) {
|
|
|
|
setReserveStatus("5", tid: temp['tid']);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(336),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: Text(
|
|
|
|
"去安排包间",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(44),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: !isRefused,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
VEmptyView(98),
|
|
|
|
Row(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
"assets/icon_refuse_book.png",
|
|
|
|
width: ScreenUtil().setWidth(56),
|
|
|
|
height: ScreenUtil().setWidth(56),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
"订单已拒绝",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: !isPause,
|
|
|
|
child: Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
VEmptyView(20),
|
|
|
|
Text(
|
|
|
|
"并已将${detailEntity.ddateMd}的${detailEntity.demandStr}置满",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(120),
|
|
|
|
Text(
|
|
|
|
"如果有包间空出来或其他包间也满了,你可以:",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
Utils.goMiniProgramZm(context, "roomtype/roomtype");
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(336),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
child: Text(
|
|
|
|
"去管理包间",
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(34),
|
|
|
|
color: MyColours.color_ffffff),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(60)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
onPressed: () async {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Map temp = await NavigatorUtil.goSelectTablePage(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
int.parse(detailEntity.ddate) * 1000,
|
|
|
|
detailEntity.ddate_solt);
|
|
|
|
if (temp != null && temp['tid'] != null) {
|
|
|
|
setReserveStatus("5", tid: temp['tid']);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
return container;
|
|
|
|
},
|
|
|
|
);
|
|
|
|
Widget dialog = Container(
|
|
|
|
width: double.infinity,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(40)))),
|
|
|
|
child: dialogContent);
|
|
|
|
showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
builder: (context) {
|
|
|
|
return Stack(
|
|
|
|
children: <Widget>[dialog],
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//处理在线预订
|
|
|
|
setReserveStatus(String status, {String tid = ""}) async {
|
|
|
|
setReserveStatus(String status, {String tid = "", String ac = ""}) async {
|
|
|
|
bus.emit("remove_untreated_message", widget.mid);
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
Map<String, String> causeMap = {
|
|
...
|
...
|
@@ -174,10 +341,21 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
"mid": widget.mid,
|
|
|
|
"cause": json.encode(causeMap)
|
|
|
|
};
|
|
|
|
bool success =
|
|
|
|
await detailModel.setReserveStatus(context, params, showLoading: true);
|
|
|
|
if (status == "6") {
|
|
|
|
isPause = true;
|
|
|
|
params['ac'] = ac; //0=直接拒绝 1=拒绝并暂停预订
|
|
|
|
}
|
|
|
|
bool success = await detailModel.setReserveStatus(context, params,
|
|
|
|
ifPush: (isPause ? false : true), showLoading: true);
|
|
|
|
if (success != null && success) {
|
|
|
|
bus.emit("refresh_book_list");
|
|
|
|
if (status == "6") {
|
|
|
|
isRefused = true;
|
|
|
|
}
|
|
|
|
if (isPause) {
|
|
|
|
_getOrderListData();
|
|
|
|
refuseDialogState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -373,108 +551,119 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { |
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setHeight(30),
|
|
|
|
bottom: ScreenUtil().setHeight(30)),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
CommonButton(
|
|
|
|
content: "安排包间",
|
|
|
|
width: 669,
|
|
|
|
height: 84,
|
|
|
|
fontSize: 34,
|
|
|
|
onPress: () async {
|
|
|
|
Map map = await NavigatorUtil
|
|
|
|
.goSelectTablePage(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
int.parse(detailEntity.ddate) *
|
|
|
|
1000,
|
|
|
|
detailEntity.ddate_solt);
|
|
|
|
if (map != null && map['tid'] != null) {
|
|
|
|
setReserveStatus("5",
|
|
|
|
tid: map['tid']);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(669),
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
Offstage(
|
|
|
|
offstage: detailEntity.status != "0",
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setHeight(30),
|
|
|
|
bottom: ScreenUtil().setHeight(30)),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
CommonButton(
|
|
|
|
content: "安排包间",
|
|
|
|
width: 669,
|
|
|
|
height: 84,
|
|
|
|
fontSize: 34,
|
|
|
|
onPress: () async {
|
|
|
|
Map map = await NavigatorUtil
|
|
|
|
.goSelectTablePage(
|
|
|
|
context,
|
|
|
|
widget.rid,
|
|
|
|
int.parse(
|
|
|
|
detailEntity.ddate) *
|
|
|
|
1000,
|
|
|
|
detailEntity.ddate_solt);
|
|
|
|
if (map != null &&
|
|
|
|
map['tid'] != null) {
|
|
|
|
setReserveStatus("5",
|
|
|
|
tid: map['tid']);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
"拒绝订单",
|
|
|
|
style: TextStyle(
|
|
|
|
color:
|
|
|
|
MyColours.color_199095,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(34)),
|
|
|
|
VEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(669),
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
"拒绝订单",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_199095,
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(34)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
_showRefuseDialog();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
Offstage(
|
|
|
|
offstage: !isCallTel,
|
|
|
|
child: SizedBox(
|
|
|
|
width: ScreenUtil().setWidth(335),
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setHeight(52),
|
|
|
|
color:
|
|
|
|
MyColours.color_199095,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
"联系顾客",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_199095,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(34)),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
_showRefuseDialog2();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
Offstage(
|
|
|
|
offstage: !isCallTel,
|
|
|
|
child: SizedBox(
|
|
|
|
width:
|
|
|
|
ScreenUtil().setWidth(335),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(84),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil()
|
|
|
|
.setHeight(52),
|
|
|
|
color: MyColours
|
|
|
|
.color_199095,
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
if (detailEntity.phone !=
|
|
|
|
null &&
|
|
|
|
detailEntity.phone
|
|
|
|
.isNotEmpty) {
|
|
|
|
Utils.goPhone(
|
|
|
|
detailEntity.phone);
|
|
|
|
} else {
|
|
|
|
Utils.showToast(
|
|
|
|
"没有客户电话!");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Center(
|
|
|
|
child: Text(
|
|
|
|
"联系顾客",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours
|
|
|
|
.color_199095,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
34)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
if (detailEntity
|
|
|
|
.phone !=
|
|
|
|
null &&
|
|
|
|
detailEntity.phone
|
|
|
|
.isNotEmpty) {
|
|
|
|
Utils.goPhone(
|
|
|
|
detailEntity
|
|
|
|
.phone);
|
|
|
|
} else {
|
|
|
|
Utils.showToast(
|
|
|
|
"没有客户电话!");
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
...
|
...
|
|