Commit 51636af2650ac6ca60b9ebb52088444d4814c653

Authored by wdn127929
1 parent f2ec188f

宴会待跟进、定金管理ok

  1 +import 'package:common_utils/common_utils.dart';
  2 +
  3 +class GetBanquetBeFollowModel {
  4 + int ret;
  5 + List<GetBanquetBeFollowSunModel> data;
  6 + String msg;
  7 +
  8 + GetBanquetBeFollowModel({this.ret, this.data, this.msg});
  9 +
  10 + GetBanquetBeFollowModel.fromJson(Map<String, dynamic> json) {
  11 + ret = json['ret'];
  12 + if (json['data'] != null) {
  13 + data = <GetBanquetBeFollowSunModel>[];
  14 + json['data'].forEach((v) {
  15 + data.add(new GetBanquetBeFollowSunModel.fromJson(v));
  16 + });
  17 + }
  18 + msg = json['msg'];
  19 + }
  20 +
  21 + Map<String, dynamic> toJson() {
  22 + final Map<String, dynamic> data = new Map<String, dynamic>();
  23 + data['ret'] = this.ret;
  24 + if (this.data != null) {
  25 + data['data'] = this.data.map((v) => v.toJson()).toList();
  26 + }
  27 + data['msg'] = this.msg;
  28 + return data;
  29 + }
  30 +}
  31 +
  32 +class GetBanquetBeFollowSunModel {
  33 + String id;
  34 + String rname;
  35 + String sex;
  36 + String staffId;
  37 + String ddate;
  38 + String classifyId;
  39 + dynamic contractFinalPrice;
  40 + String warrantId;
  41 + String className;
  42 + String nickName;
  43 + String account;
  44 + dynamic isDeposit;
  45 + dynamic isTids;
  46 + dynamic isSetmeal;
  47 + dynamic isContractFinalPrice;
  48 + dynamic isWarrant;
  49 + dynamic depositPrice;
  50 +
  51 +//日期
  52 + String get ddateStr {
  53 + if (ddate.toString() == '0') {
  54 + return '';
  55 + }
  56 + DateTime dateTime =
  57 + DateTime.fromMillisecondsSinceEpoch(int.parse(ddate.toString()) * 1000);
  58 + return DateUtil.formatDate(dateTime, format: DateFormats.mo_d);
  59 + }
  60 +
  61 + GetBanquetBeFollowSunModel(
  62 + {this.id,
  63 + this.rname,
  64 + this.sex,
  65 + this.staffId,
  66 + this.ddate,
  67 + this.classifyId,
  68 + this.contractFinalPrice,
  69 + this.warrantId,
  70 + this.className,
  71 + this.nickName,
  72 + this.account,
  73 + this.isDeposit,
  74 + this.isTids,
  75 + this.isSetmeal,
  76 + this.isContractFinalPrice,
  77 + this.isWarrant,
  78 + this.depositPrice});
  79 +
  80 + GetBanquetBeFollowSunModel.fromJson(Map<String, dynamic> json) {
  81 + id = json['id'];
  82 + rname = json['rname'];
  83 + sex = json['sex'];
  84 + staffId = json['staff_id'];
  85 + ddate = json['ddate'];
  86 + classifyId = json['classify_id'];
  87 + contractFinalPrice = json['contract_final_price'];
  88 + warrantId = json['warrant_id'];
  89 + className = json['class_name'];
  90 + nickName = json['nick_name'];
  91 + account = json['account'];
  92 + isDeposit = json['is_deposit'];
  93 + isTids = json['is_tids'];
  94 + isSetmeal = json['is_setmeal'];
  95 + isContractFinalPrice = json['is_contract_final_price'];
  96 + isWarrant = json['is_warrant'];
  97 + depositPrice = json['deposit_price'];
  98 + }
  99 +
  100 + Map<String, dynamic> toJson() {
  101 + final Map<String, dynamic> data = new Map<String, dynamic>();
  102 + data['id'] = this.id;
  103 + data['rname'] = this.rname;
  104 + data['sex'] = this.sex;
  105 + data['staff_id'] = this.staffId;
  106 + data['ddate'] = this.ddate;
  107 + data['classify_id'] = this.classifyId;
  108 + data['contract_final_price'] = this.contractFinalPrice;
  109 + data['warrant_id'] = this.warrantId;
  110 + data['class_name'] = this.className;
  111 + data['nick_name'] = this.nickName;
  112 + data['account'] = this.account;
  113 + data['is_deposit'] = this.isDeposit;
  114 + data['is_tids'] = this.isTids;
  115 + data['is_setmeal'] = this.isSetmeal;
  116 + data['is_contract_final_price'] = this.isContractFinalPrice;
  117 + data['is_warrant'] = this.isWarrant;
  118 + data['deposit_price'] = this.depositPrice;
  119 + return data;
  120 + }
  121 +}
  1 +class SearchBanquetDepositModel {
  2 + int ret;
  3 + SearchBanquetDepositSunModel data;
  4 + String msg;
  5 +
  6 + SearchBanquetDepositModel({this.ret, this.data, this.msg});
  7 +
  8 + SearchBanquetDepositModel.fromJson(Map<String, dynamic> json) {
  9 + ret = json['ret'];
  10 + data = json['data'] != null
  11 + ? new SearchBanquetDepositSunModel.fromJson(json['data'])
  12 + : null;
  13 + msg = json['msg'];
  14 + }
  15 +
  16 + Map<String, dynamic> toJson() {
  17 + final Map<String, dynamic> data = new Map<String, dynamic>();
  18 + data['ret'] = this.ret;
  19 + if (this.data != null) {
  20 + data['data'] = this.data.toJson();
  21 + }
  22 + data['msg'] = this.msg;
  23 + return data;
  24 + }
  25 +}
  26 +
  27 +class SearchBanquetDepositSunModel {
  28 + String id;
  29 + String rname;
  30 + String sex;
  31 + String staffId;
  32 + String ddate;
  33 + String classifyId;
  34 + String className;
  35 + String nickName;
  36 + String account;
  37 + String depositPrice;
  38 + String depositId;
  39 +
  40 + String get ddateStr {
  41 + DateTime dateTime =
  42 + DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000);
  43 + return '${dateTime.month}月${dateTime.day}日';
  44 + }
  45 +
  46 + SearchBanquetDepositSunModel(
  47 + {this.id,
  48 + this.rname,
  49 + this.sex,
  50 + this.staffId,
  51 + this.ddate,
  52 + this.classifyId,
  53 + this.className,
  54 + this.nickName,
  55 + this.account,
  56 + this.depositPrice,
  57 + this.depositId});
  58 +
  59 + SearchBanquetDepositSunModel.fromJson(Map<String, dynamic> json) {
  60 + id = json['id'];
  61 + rname = json['rname'];
  62 + sex = json['sex'];
  63 + staffId = json['staff_id'];
  64 + ddate = json['ddate'];
  65 + classifyId = json['classify_id'];
  66 + className = json['class_name'];
  67 + nickName = json['nick_name'];
  68 + account = json['account'];
  69 + depositPrice = json['deposit_price'];
  70 + depositId = json['deposit_id'];
  71 + }
  72 +
  73 + Map<String, dynamic> toJson() {
  74 + final Map<String, dynamic> data = new Map<String, dynamic>();
  75 + data['id'] = this.id;
  76 + data['rname'] = this.rname;
  77 + data['sex'] = this.sex;
  78 + data['staff_id'] = this.staffId;
  79 + data['ddate'] = this.ddate;
  80 + data['classify_id'] = this.classifyId;
  81 + data['class_name'] = this.className;
  82 + data['nick_name'] = this.nickName;
  83 + data['account'] = this.account;
  84 + data['deposit_price'] = this.depositPrice;
  85 + data['deposit_id'] = this.depositId;
  86 + return data;
  87 + }
  88 +}
@@ -320,4 +320,13 @@ class HttpUrl { @@ -320,4 +320,13 @@ class HttpUrl {
320 static const String get_banquet_be_follow = 320 static const String get_banquet_be_follow =
321 "?service=App.Banquet.GetBanquetBeFollow"; //根据时间范围查询待跟进订单 321 "?service=App.Banquet.GetBanquetBeFollow"; //根据时间范围查询待跟进订单
322 322
  323 + static const String search_banquet_deposit =
  324 + "?service=App.Banquet.SearchBanquetDeposit"; //根据定金编号搜索定金订单
  325 +
  326 + static const String bank_banquet_deposit =
  327 + "?service=App.Banquet.BankBanquetDeposit"; //退定金
  328 +
  329 + static const String get_exits_banquet_by_date =
  330 + "?service=App.Banquet.GetExitsBanquetByDate"; //查看指定时间内是否有宴会预定
  331 +
323 } 332 }
@@ -6,8 +6,11 @@ import 'package:flutter/material.dart'; @@ -6,8 +6,11 @@ import 'package:flutter/material.dart';
6 import 'package:flutter_screenutil/flutter_screenutil.dart'; 6 import 'package:flutter_screenutil/flutter_screenutil.dart';
7 import 'package:one_key/res/colors.dart'; 7 import 'package:one_key/res/colors.dart';
8 import 'package:one_key/widgets/system_app_bar.dart'; 8 import 'package:one_key/widgets/system_app_bar.dart';
  9 +import 'package:provider/provider.dart';
9 import 'package:table_calendar/table_calendar.dart'; 10 import 'package:table_calendar/table_calendar.dart';
10 11
  12 +import '../../provider/feast_model.dart';
  13 +import '../../provider/user_model.dart';
11 import '../../utils/utils.dart'; 14 import '../../utils/utils.dart';
12 import '../../widgets/round_button.dart'; 15 import '../../widgets/round_button.dart';
13 import '../../widgets/v_empty_view.dart'; 16 import '../../widgets/v_empty_view.dart';
@@ -24,12 +27,17 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -24,12 +27,17 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
24 CalendarController _calendarController = CalendarController(); 27 CalendarController _calendarController = CalendarController();
25 DateTime dateTimeNow; //当前日期 28 DateTime dateTimeNow; //当前日期
26 bool calendarShow = true; //日历展开 29 bool calendarShow = true; //日历展开
  30 + FeastModel feastModel;
  31 +
27 @override 32 @override
28 void initState() { 33 void initState() {
29 // TODO: implement initState 34 // TODO: implement initState
30 super.initState(); 35 super.initState();
31 dateTimeNow = DateTime.now(); 36 dateTimeNow = DateTime.now();
32 Utils.changeStatusColor(color: MyColours.color_438E93); 37 Utils.changeStatusColor(color: MyColours.color_438E93);
  38 + WidgetsBinding.instance.addPostFrameCallback((_) {
  39 + _getExitsBanquetByDate();
  40 + });
33 } 41 }
34 42
35 //解析返回显示的日期 43 //解析返回显示的日期
@@ -48,8 +56,29 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -48,8 +56,29 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
48 } 56 }
49 } 57 }
50 58
  59 + ///查看指定时间内是否有宴会预定
  60 + _getExitsBanquetByDate() async {
  61 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  62 + DateTime firstDay = DateTime(dateTimeNow.year, dateTimeNow.month);
  63 + String startDay =
  64 + (firstDay.millisecondsSinceEpoch / 1000).floor().toString();
  65 + //下个月的第一天
  66 + DateTime lastDateTime = DateTime(dateTimeNow.year, dateTimeNow.month + 1);
  67 +//再减一天
  68 + DateTime lastDay = lastDateTime.subtract(Duration(days: 1));
  69 + String endDay = (lastDay.millisecondsSinceEpoch / 1000).floor().toString();
  70 +
  71 + Map<String, String> pramas = {
  72 + 'sid': userModel.user.sellerid,
  73 + 'rdate': '${startDay}',
  74 + 'edate': '${endDay}'
  75 + };
  76 + await feastModel.getExitsBanquetByDate(context, pramas, showLoading: true);
  77 + }
  78 +
51 @override 79 @override
52 Widget build(BuildContext context) { 80 Widget build(BuildContext context) {
  81 + feastModel = Provider.of<FeastModel>(context, listen: true);
53 return Scaffold( 82 return Scaffold(
54 backgroundColor: MyColours.color_ffffff, 83 backgroundColor: MyColours.color_ffffff,
55 appBar: SystemAppBar( 84 appBar: SystemAppBar(
@@ -91,6 +120,27 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -91,6 +120,27 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
91 availableGestures: AvailableGestures.none, 120 availableGestures: AvailableGestures.none,
92 121
93 locale: "zh_CN", 122 locale: "zh_CN",
  123 + onVisibleDaysChanged: (date1, date2, cal) async {
  124 + feastModel.fullStatusByTime = {};
  125 + print('r');
  126 + UserModel userModel =
  127 + Provider.of<UserModel>(context, listen: false);
  128 + String startDay = (date1.millisecondsSinceEpoch / 1000)
  129 + .floor()
  130 + .toString();
  131 + String endDay = (date2.millisecondsSinceEpoch / 1000)
  132 + .floor()
  133 + .toString();
  134 +
  135 + Map<String, String> pramas = {
  136 + 'sid': userModel.user.sellerid,
  137 + 'rdate': '${startDay}',
  138 + 'edate': '${endDay}'
  139 + };
  140 + await feastModel.getExitsBanquetByDate(context, pramas,
  141 + showLoading: true);
  142 + setState(() {});
  143 + },
94 initialCalendarFormat: calendarShow 144 initialCalendarFormat: calendarShow
95 ? CalendarFormat.month 145 ? CalendarFormat.month
96 : CalendarFormat.week, 146 : CalendarFormat.week,
@@ -151,6 +201,11 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -151,6 +201,11 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
151 ); 201 );
152 }, 202 },
153 dayBuilder: (context, date, _) { 203 dayBuilder: (context, date, _) {
  204 + String keytemp = '${date.year}' +
  205 + '-' +
  206 + '${Utils.addZeroNumber(date.month)}' +
  207 + '-' +
  208 + '${Utils.addZeroNumber(date.day)}';
154 return Container( 209 return Container(
155 // height: ScreenUtil().setWidth(210), 210 // height: ScreenUtil().setWidth(210),
156 decoration: BoxDecoration( 211 decoration: BoxDecoration(
@@ -192,21 +247,31 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -192,21 +247,31 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
192 fontSize: ScreenUtil().setSp(20), 247 fontSize: ScreenUtil().setSp(20),
193 color: MyColours.color_515151), 248 color: MyColours.color_515151),
194 ), 249 ),
195 - Container(  
196 - margin: EdgeInsets.symmetric(  
197 - vertical: ScreenUtil().setWidth(4)),  
198 - width: ScreenUtil().setWidth(16),  
199 - height: ScreenUtil().setWidth(16),  
200 - decoration: BoxDecoration(  
201 - color: MyColours.color_E34D59,  
202 - borderRadius: BorderRadius.circular(  
203 - ScreenUtil().radius(8))),  
204 - ) 250 + feastModel.fullStatusByTime.keys
  251 + .contains(keytemp) &&
  252 + feastModel.fullStatusByTime[keytemp] ==
  253 + '1'
  254 + ? Container(
  255 + margin: EdgeInsets.symmetric(
  256 + vertical: ScreenUtil().setWidth(4)),
  257 + width: ScreenUtil().setWidth(16),
  258 + height: ScreenUtil().setWidth(16),
  259 + decoration: BoxDecoration(
  260 + color: MyColours.color_E34D59,
  261 + borderRadius: BorderRadius.circular(
  262 + ScreenUtil().radius(8))),
  263 + )
  264 + : SizedBox()
205 ], 265 ],
206 ), 266 ),
207 ); 267 );
208 }, 268 },
209 selectedDayBuilder: (context, date, _) { 269 selectedDayBuilder: (context, date, _) {
  270 + String keytemp = '${date.year}' +
  271 + '-' +
  272 + '${Utils.addZeroNumber(date.month)}' +
  273 + '-' +
  274 + '${Utils.addZeroNumber(date.day)}';
210 return Container( 275 return Container(
211 // alignment: Alignment.center, 276 // alignment: Alignment.center,
212 // margin: EdgeInsets.fromLTRB( 277 // margin: EdgeInsets.fromLTRB(
@@ -243,22 +308,32 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -243,22 +308,32 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
243 fontSize: ScreenUtil().setSp(22), 308 fontSize: ScreenUtil().setSp(22),
244 color: MyColours.color_F6F6F6), 309 color: MyColours.color_F6F6F6),
245 ), 310 ),
246 - Container(  
247 - margin: EdgeInsets.symmetric(  
248 - vertical: ScreenUtil().setWidth(4)),  
249 - width: ScreenUtil().setWidth(16),  
250 - height: ScreenUtil().setWidth(16),  
251 - decoration: BoxDecoration(  
252 - color: MyColours.color_E34D59,  
253 - borderRadius: BorderRadius.circular(  
254 - ScreenUtil().radius(8))),  
255 - ) 311 + feastModel.fullStatusByTime.keys
  312 + .contains(keytemp) &&
  313 + feastModel.fullStatusByTime[keytemp] ==
  314 + '1'
  315 + ? Container(
  316 + margin: EdgeInsets.symmetric(
  317 + vertical: ScreenUtil().setWidth(4)),
  318 + width: ScreenUtil().setWidth(16),
  319 + height: ScreenUtil().setWidth(16),
  320 + decoration: BoxDecoration(
  321 + color: MyColours.color_E34D59,
  322 + borderRadius: BorderRadius.circular(
  323 + ScreenUtil().radius(8))),
  324 + )
  325 + : SizedBox()
256 ], 326 ],
257 ), 327 ),
258 ), 328 ),
259 ); 329 );
260 }, 330 },
261 todayDayBuilder: (context, date, _) { 331 todayDayBuilder: (context, date, _) {
  332 + String keytemp = '${date.year}' +
  333 + '-' +
  334 + '${Utils.addZeroNumber(date.month)}' +
  335 + '-' +
  336 + '${Utils.addZeroNumber(date.day)}';
262 return Container( 337 return Container(
263 // alignment: Alignment.center, 338 // alignment: Alignment.center,
264 // margin: EdgeInsets.fromLTRB( 339 // margin: EdgeInsets.fromLTRB(
@@ -295,16 +370,21 @@ class _FeastBoardPageState extends State<FeastBoardPage> { @@ -295,16 +370,21 @@ class _FeastBoardPageState extends State<FeastBoardPage> {
295 fontSize: ScreenUtil().setSp(22), 370 fontSize: ScreenUtil().setSp(22),
296 color: MyColours.color_F6F6F6), 371 color: MyColours.color_F6F6F6),
297 ), 372 ),
298 - Container(  
299 - margin: EdgeInsets.symmetric(  
300 - vertical: ScreenUtil().setWidth(4)),  
301 - width: ScreenUtil().setWidth(16),  
302 - height: ScreenUtil().setWidth(16),  
303 - decoration: BoxDecoration(  
304 - color: MyColours.color_E34D59,  
305 - borderRadius: BorderRadius.circular(  
306 - ScreenUtil().radius(8))),  
307 - ) 373 + feastModel.fullStatusByTime.keys
  374 + .contains(keytemp) &&
  375 + feastModel.fullStatusByTime[keytemp] ==
  376 + '1'
  377 + ? Container(
  378 + margin: EdgeInsets.symmetric(
  379 + vertical: ScreenUtil().setWidth(4)),
  380 + width: ScreenUtil().setWidth(16),
  381 + height: ScreenUtil().setWidth(16),
  382 + decoration: BoxDecoration(
  383 + color: MyColours.color_E34D59,
  384 + borderRadius: BorderRadius.circular(
  385 + ScreenUtil().radius(8))),
  386 + )
  387 + : SizedBox()
308 ], 388 ],
309 ), 389 ),
310 ), 390 ),
@@ -9,6 +9,7 @@ import 'package:provider/provider.dart'; @@ -9,6 +9,7 @@ import 'package:provider/provider.dart';
9 9
10 import '../../constant/state.dart'; 10 import '../../constant/state.dart';
11 import '../../provider/feast_model.dart'; 11 import '../../provider/feast_model.dart';
  12 +import '../../provider/user_model.dart';
12 import '../../utils/screen_util.dart'; 13 import '../../utils/screen_util.dart';
13 import '../../utils/utils.dart'; 14 import '../../utils/utils.dart';
14 import '../../widgets/MyDivider.dart'; 15 import '../../widgets/MyDivider.dart';
@@ -28,11 +29,83 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -28,11 +29,83 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
28 FeastModel feastModel; 29 FeastModel feastModel;
29 30
30 TextEditingController editingController = TextEditingController(); 31 TextEditingController editingController = TextEditingController();
  32 +
  33 + TextEditingController priceC = TextEditingController(); //退款金额
  34 + TextEditingController collectionC = TextEditingController(); //收款人
  35 + int czSelIndex;
  36 + List<String> payType = []; //支付方式
  37 + int payTypeIndex;
  38 + TextEditingController _cancelController = TextEditingController(); //备注
31 @override 39 @override
32 void initState() { 40 void initState() {
33 super.initState(); 41 super.initState();
  42 + payType = ['现金', '刷卡', '微信', '支付宝', '转账'];
34 43
35 Utils.changeStatusColor(color: MyColours.color_438E93); 44 Utils.changeStatusColor(color: MyColours.color_438E93);
  45 +
  46 + WidgetsBinding.instance.addPostFrameCallback((_) {
  47 + // _searchBanquetDeposit();
  48 + _getSellerUserBySellerid();
  49 + });
  50 + }
  51 +
  52 + ///获取经理数据 ---- 接单人---全部员工
  53 +
  54 + Future<bool> _getSellerUserBySellerid() async {
  55 + bool success = await feastModel.getAuthUserLists(context);
  56 +
  57 + if (success) {
  58 + return true;
  59 + } else {
  60 + return false;
  61 + }
  62 + }
  63 +
  64 + /// 根据时间范围查询待跟进订单
  65 + _searchBanquetDeposit() async {
  66 + Map<String, String> pramas = {
  67 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  68 + 'no': editingController.text
  69 + }; //
  70 + bool success = await feastModel.searchBanquetDeposit(context, pramas);
  71 + if (success) {
  72 + // _uploadImageProvider.feastRemarkContractImageList = [];
  73 + // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
  74 + // UploadImgModel uploadImgModel = UploadImgModel();
  75 + // uploadImgModel.process = 1;
  76 + // uploadImgModel.qiniuUrl = element.url;
  77 + // _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
  78 + // });
  79 + // setState(() {});
  80 + }
  81 + }
  82 +
  83 + /// 退定金
  84 + _bankBanquetDeposit() async {
  85 + Map<String, String> pramas = {
  86 + 'id': feastModel.depositsManagesData.depositId, //定金id
  87 + "rid": feastModel.depositsManagesData.id, //宴会id
  88 + 'price': priceC.text,
  89 + 'uid': feastModel.sellerManageList[czSelIndex].id,
  90 + 'pay': payType[payTypeIndex], //支付方式
  91 + 'collection': collectionC.text,
  92 + 'reamrk': _cancelController.text
  93 + }; //
  94 + print(pramas);
  95 + bool success = await feastModel.bankBanquetDeposit(context, pramas);
  96 + if (success) {
  97 + priceC.text = '';
  98 + collectionC.text = '';
  99 + _searchBanquetDeposit();
  100 + // _uploadImageProvider.feastRemarkContractImageList = [];
  101 + // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
  102 + // UploadImgModel uploadImgModel = UploadImgModel();
  103 + // uploadImgModel.process = 1;
  104 + // uploadImgModel.qiniuUrl = element.url;
  105 + // _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
  106 + // });
  107 + // setState(() {});
  108 + }
36 } 109 }
37 110
38 Widget buildFeastTypeHeader() { 111 Widget buildFeastTypeHeader() {
@@ -106,7 +179,15 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -106,7 +179,15 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
106 )), 179 )),
107 ), 180 ),
108 RoundButton( 181 RoundButton(
109 - onPressed: () async {}, 182 + onPressed: () async {
  183 + if (editingController.text.trim().length == 0) {
  184 + Utils.showToast('请输入收据编号');
  185 + return;
  186 + }
  187 + FocusScope.of(context).requestFocus(FocusNode());
  188 +
  189 + _searchBanquetDeposit();
  190 + },
110 text: '搜索', 191 text: '搜索',
111 fontSize: 28, 192 fontSize: 28,
112 isBold: false, 193 isBold: false,
@@ -126,10 +207,12 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -126,10 +207,12 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
126 207
127 Widget buildFeastTypeItem() { 208 Widget buildFeastTypeItem() {
128 return Container( 209 return Container(
129 - margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)), 210 + // height: h(99 * 2),
  211 + // margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
130 decoration: BoxDecoration( 212 decoration: BoxDecoration(
  213 + // color: Colors.red,
131 border: Border.all( 214 border: Border.all(
132 - color: MyColours.color_f3f3f3, width: ScreenUtil().setWidth(2)), 215 + color: MyColours.color_ffffff, width: ScreenUtil().setWidth(2)),
133 boxShadow: [ 216 boxShadow: [
134 BoxShadow( 217 BoxShadow(
135 color: MyColours.color_1F000000, 218 color: MyColours.color_1F000000,
@@ -154,14 +237,14 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -154,14 +237,14 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
154 mainAxisAlignment: MainAxisAlignment.spaceBetween, 237 mainAxisAlignment: MainAxisAlignment.spaceBetween,
155 children: [ 238 children: [
156 Text( 239 Text(
157 - '8月1日 午餐', 240 + '${feastModel.depositsManagesData.ddateStr}',
158 style: TextStyle( 241 style: TextStyle(
159 fontWeight: FontWeight.bold, 242 fontWeight: FontWeight.bold,
160 color: MyColours.color_F6F6F6, 243 color: MyColours.color_F6F6F6,
161 fontSize: ScreenUtil().setSp(40)), 244 fontSize: ScreenUtil().setSp(40)),
162 ), 245 ),
163 Text( 246 Text(
164 - '婚宴', 247 + '${feastModel.depositsManagesData.className}',
165 style: TextStyle( 248 style: TextStyle(
166 fontWeight: FontWeight.bold, 249 fontWeight: FontWeight.bold,
167 color: MyColours.color_F6F6F6, 250 color: MyColours.color_F6F6F6,
@@ -186,11 +269,9 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -186,11 +269,9 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
186 Wrap( 269 Wrap(
187 children: [ 270 children: [
188 Text( 271 Text(
189 - '[定金2000]', 272 + '[定金${feastModel.depositsManagesData.depositPrice}]',
190 style: TextStyle( 273 style: TextStyle(
191 - color: true  
192 - ? MyColours.color_00A870  
193 - : MyColours.color_E34D59, 274 + color: MyColours.color_00A870,
194 fontSize: ScreenUtil().setSp(28)), 275 fontSize: ScreenUtil().setSp(28)),
195 ), 276 ),
196 ], 277 ],
@@ -200,7 +281,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -200,7 +281,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
200 mainAxisAlignment: MainAxisAlignment.spaceBetween, 281 mainAxisAlignment: MainAxisAlignment.spaceBetween,
201 children: [ 282 children: [
202 Text( 283 Text(
203 - '方先生 负责人:刘经理', 284 + '${feastModel.depositsManagesData.rname} 跟单经理:${feastModel.depositsManagesData.nickName ?? feastModel.depositsManagesData.account}',
204 style: TextStyle( 285 style: TextStyle(
205 fontWeight: FontWeight.bold, 286 fontWeight: FontWeight.bold,
206 color: MyColours.color_000000, 287 color: MyColours.color_000000,
@@ -208,18 +289,36 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -208,18 +289,36 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
208 ), 289 ),
209 RoundButton( 290 RoundButton(
210 onPressed: () async { 291 onPressed: () async {
  292 + if (feastModel.depositsManagesData.depositPrice ==
  293 + '0') {
  294 + //已经全额退款,不再点击
  295 + return;
  296 + }
211 _showCancelWidget(context); 297 _showCancelWidget(context);
212 }, 298 },
213 - text: '退定金', 299 + text: feastModel.depositsManagesData.depositPrice == '0'
  300 + ? '已全额退回'
  301 + : '退定金',
214 fontSize: 28, 302 fontSize: 28,
215 isBold: false, 303 isBold: false,
216 height: h(28), 304 height: h(28),
217 - width: w(58), 305 + // padding: EdgeInsets.symmetric(horizontal: w(8)),
  306 + width: feastModel.depositsManagesData.depositPrice == '0'
  307 + ?w(86): w(58),
218 // margin: EdgeInsets.only(top: w(18), bottom: w(4)), 308 // margin: EdgeInsets.only(top: w(18), bottom: w(4)),
219 textColor: MyColours.color_F6F6F6, 309 textColor: MyColours.color_F6F6F6,
220 - gradientStart: MyColours.color_E34D59,  
221 - gradientEnd: MyColours.color_E34D59,  
222 - borderColor: MyColours.color_E34D59, 310 + gradientStart:
  311 + feastModel.depositsManagesData.depositPrice == '0'
  312 + ? MyColours.color_999999
  313 + : MyColours.color_E34D59,
  314 + gradientEnd:
  315 + feastModel.depositsManagesData.depositPrice == '0'
  316 + ? MyColours.color_999999
  317 + : MyColours.color_E34D59,
  318 + borderColor:
  319 + feastModel.depositsManagesData.depositPrice == '0'
  320 + ? MyColours.color_999999
  321 + : MyColours.color_E34D59,
223 radius: r(4), 322 radius: r(4),
224 ), 323 ),
225 ], 324 ],
@@ -235,7 +334,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -235,7 +334,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
235 ///取消预订弹框 334 ///取消预订弹框
236 _showCancelWidget(context) { 335 _showCancelWidget(context) {
237 ScrollController _scrollController = ScrollController(); 336 ScrollController _scrollController = ScrollController();
238 - TextEditingController _cancelController = TextEditingController(); 337 +
239 FocusNode _cancelNode = FocusNode(); 338 FocusNode _cancelNode = FocusNode();
240 339
241 bool showPerson = true; 340 bool showPerson = true;
@@ -261,6 +360,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -261,6 +360,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
261 // Navigator.of(context).pop(); 360 // Navigator.of(context).pop();
262 // }, 361 // },
263 child: Center( 362 child: Center(
  363 + child: SingleChildScrollView(
264 child: Stack(children: [ 364 child: Stack(children: [
265 Container( 365 Container(
266 margin: EdgeInsets.symmetric( 366 margin: EdgeInsets.symmetric(
@@ -289,7 +389,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -289,7 +389,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
289 ), 389 ),
290 ), 390 ),
291 391
292 - _textfield('退款金额', '请输入', null, null, '元'), 392 + _textfield('退款金额', '请输入', priceC, null, '元'),
293 _selectWidget('操作人', person, onTap: () { 393 _selectWidget('操作人', person, onTap: () {
294 state(() { 394 state(() {
295 showType = true; 395 showType = true;
@@ -302,7 +402,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -302,7 +402,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
302 showType = !showType; 402 showType = !showType;
303 }); 403 });
304 }), 404 }),
305 - _textfield('收款人', '请输入', null, null, '', 405 + _textfield('收款人', '请输入', collectionC, null, '',
306 inputType: TextInputType.text), 406 inputType: TextInputType.text),
307 VEmptyView(24), 407 VEmptyView(24),
308 Container( 408 Container(
@@ -346,7 +446,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -346,7 +446,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
346 // border: InputBorder.none, 446 // border: InputBorder.none,
347 447
348 onChanged: (_) { 448 onChanged: (_) {
349 - setState(() {}); 449 + state(() {});
350 }, 450 },
351 onEditingComplete: () { 451 onEditingComplete: () {
352 print('fff'); 452 print('fff');
@@ -394,10 +494,46 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -394,10 +494,46 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
394 fontSize: 32, 494 fontSize: 32,
395 isBold: true, 495 isBold: true,
396 onPressed: () { 496 onPressed: () {
  497 + if (priceC.text.trim().length == 0) {
  498 + Utils.showToast('请输入退款金额');
  499 + return;
  500 + }
  501 + bool isNumber = Utils.isNumeric(
  502 + priceC.text); //判断输入的内容是否是数字
  503 + if (!isNumber) {
  504 + Utils.showToast('退款金额请输入数字');
  505 + return;
  506 + }
  507 + if (double.parse(priceC.text) >
  508 + double.parse(feastModel
  509 + .depositsManagesData
  510 + .depositPrice)) {
  511 + //如果超过可退金额,自动把可退金额赋值给输入框
  512 + priceC.text = feastModel
  513 + .depositsManagesData
  514 + .depositPrice;
  515 + state(() {});
  516 + Utils.showToast(
  517 + '超过最大可退金额,已为您修改为最大金额');
  518 + return;
  519 + }
  520 + if (person == '请选择') {
  521 + Utils.showToast('请选择操作人');
  522 + return;
  523 + }
  524 + if (type == '请选择') {
  525 + Utils.showToast('请选择退款方式');
  526 + return;
  527 + }
  528 + if (collectionC.text.trim().length ==
  529 + 0) {
  530 + Utils.showToast('请输入收款人');
  531 + return;
  532 + }
  533 +
397 Navigator.of(context).pop(); 534 Navigator.of(context).pop();
398 Loading.showLoading(context); 535 Loading.showLoading(context);
399 -  
400 - // setReserveStatus('4', desc: desc); 536 + _bankBanquetDeposit();
401 }), 537 }),
402 ]) 538 ])
403 ], 539 ],
@@ -411,10 +547,16 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -411,10 +547,16 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
411 child: Material( 547 child: Material(
412 color: Colors.transparent, 548 color: Colors.transparent,
413 child: selectWidgetTableManage( 549 child: selectWidgetTableManage(
414 - ['dffd', 'fdf'], (index) { 550 + feastModel.sellerManageList.map((item) {
  551 + return item.title;
  552 + }).toList(), (index) {
415 state(() { 553 state(() {
416 showPerson = !showPerson; 554 showPerson = !showPerson;
417 - person = ['dffd', 'fdf'][index]; 555 + czSelIndex = index;
  556 + person = feastModel.sellerManageList
  557 + .map((item) {
  558 + return item.title;
  559 + }).toList()[index];
418 }); 560 });
419 }), 561 }),
420 ))), 562 ))),
@@ -425,29 +567,17 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -425,29 +567,17 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
425 offstage: showType, 567 offstage: showType,
426 child: Material( 568 child: Material(
427 color: Colors.transparent, 569 color: Colors.transparent,
428 - child: selectWidgetTableManage([  
429 - 'dffd',  
430 - 'fdf',  
431 - 'dffd',  
432 - 'fdf',  
433 - 'dffd',  
434 - 'fdf'  
435 - ], (index) { 570 + child:
  571 + selectWidgetTableManage(payType, (index) {
436 state(() { 572 state(() {
437 showType = !showType; 573 showType = !showType;
438 - type = [  
439 - 'dffd',  
440 - 'fdf',  
441 - 'dffd',  
442 - 'fdf',  
443 - 'dffd',  
444 - 'fdf'  
445 - ][index]; 574 + payTypeIndex = index;
  575 + type = payType[index];
446 }); 576 });
447 }), 577 }),
448 ))), 578 ))),
449 ]), 579 ]),
450 - )); 580 + )));
451 })); 581 }));
452 }); 582 });
453 } 583 }
@@ -708,7 +838,6 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -708,7 +838,6 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
708 @override 838 @override
709 Widget build(BuildContext context) { 839 Widget build(BuildContext context) {
710 feastModel = Provider.of<FeastModel>(context); 840 feastModel = Provider.of<FeastModel>(context);
711 - feastModel.pageStateDepositData = PageState.Success;  
712 return Scaffold( 841 return Scaffold(
713 backgroundColor: MyColours.color_ffffff, 842 backgroundColor: MyColours.color_ffffff,
714 appBar: SystemAppBar( 843 appBar: SystemAppBar(
@@ -720,70 +849,65 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { @@ -720,70 +849,65 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> {
720 Navigator.pop(context); 849 Navigator.pop(context);
721 }, 850 },
722 ), 851 ),
723 - body: Column(  
724 - children: [  
725 - Expanded(  
726 - child: NestedScrollView(  
727 - // controller: _scrollViewController,  
728 - headerSliverBuilder:  
729 - (BuildContext context, bool innerBoxIsScrolled) {  
730 - return <Widget>[  
731 - SliverAppBar(  
732 - pinned: true,  
733 - floating: false,  
734 - leading: null,  
735 - backgroundColor: MyColours.color_ffffff,  
736 - // expandedHeight: ScreenUtil().setWidth(128 * 2),  
737 - automaticallyImplyLeading: false,  
738 - toolbarHeight: ScreenUtil().setWidth(64 * 2),  
739 - title: buildFeastTypeHeader(),  
740 - // flexibleSpace: FlexibleSpaceBar(  
741 - // collapseMode: CollapseMode.pin,  
742 - // title: buildFeastTypeHeader())  
743 - )  
744 - ];  
745 - }, body: Consumer<FeastModel>(builder: (context, model, _) {  
746 - if (model.pageStateDepositData != PageState.Success) {  
747 - return ExceptionPage(  
748 - pageState: model.pageStateDepositData,  
749 - callback: () {  
750 - // _getWine();  
751 - },  
752 - emptyMsg: "暂时没有定金数据哦",  
753 - emptyImg: "empty_search",  
754 - showMsg: "加载中,请稍后...",  
755 - );  
756 - } else {  
757 - return ListView.builder(  
758 - itemCount: 100,  
759 - padding:  
760 - EdgeInsets.only(left: w(12), top: w(19), right: w(12)),  
761 - itemBuilder: (BuildContext context, int index) {  
762 - // WineSunModel data = feastModel.wineData[index];  
763 - return buildFeastTypeItem();  
764 - // '剑南春52度500ml', '1150元/份 不可议价'  
765 - });  
766 - }  
767 - }))),  
768 - Row(  
769 - children: [  
770 - Expanded(  
771 - child: _callButton(  
772 - onPress: () {  
773 - Navigator.pop(context);  
774 - },  
775 - content: '回到今天',  
776 - hasLeftBorder: true,  
777 - isSelect: false)),  
778 - Expanded(  
779 - child: _callButton(  
780 - onPress: () {},  
781 - content: '创建宴会',  
782 - hasLeftBorder: true,  
783 - isSelect: true))  
784 - ],  
785 - )  
786 - ], 852 + body: Padding(
  853 + padding: EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
  854 + child: Column(children: [
  855 + buildFeastTypeHeader(),
  856 + VEmptyView(66),
  857 + feastModel.depositsManagesData == null
  858 + ? SizedBox()
  859 + : buildFeastTypeItem()
  860 + ]),
  861 + // ) NestedScrollView(
  862 + // // controller: _scrollViewController,
  863 + // headerSliverBuilder:
  864 + // (BuildContext context, bool innerBoxIsScrolled) {
  865 + // return <Widget>[
  866 + // SliverAppBar(
  867 + // pinned: true,
  868 + // floating: false,
  869 + // leading: null,
  870 + // backgroundColor: MyColours.color_ffffff,
  871 + // // expandedHeight: ScreenUtil().setWidth(128 * 2),
  872 + // automaticallyImplyLeading: false,
  873 + // toolbarHeight: ScreenUtil().setWidth(64 * 2),
  874 + // title: buildFeastTypeHeader(),
  875 + // // flexibleSpace: FlexibleSpaceBar(
  876 + // // collapseMode: CollapseMode.pin,
  877 + // // title: buildFeastTypeHeader())
  878 + // )
  879 + // ];
  880 + // },
  881 + // body:
  882 + // // Consumer<FeastModel>(builder: (context, model, _) {
  883 + // // if (model.pageStateDepositData != PageState.Success) {
  884 + // // return ExceptionPage(
  885 + // // pageState: model.pageStateDepositData,
  886 + // // callback: () {
  887 + // // // _getWine();
  888 + // // },
  889 + // // emptyMsg: "暂时没有定金数据哦",
  890 + // // emptyImg: "empty_search",
  891 + // // showMsg: "加载中,请稍后...",
  892 + // // );
  893 + // // } else {
  894 + // // return
  895 + // feastModel.depositsManagesData == null
  896 + // ? SizedBox()
  897 + // : Padding(
  898 + // padding: EdgeInsets.only(
  899 + // left: w(12), top: w(19), right: w(12)),
  900 + // child: buildFeastTypeItem())
  901 + // // return ListView.builder(
  902 + // // itemCount: 100,
  903 + // // padding: EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
  904 + // // itemBuilder: (BuildContext context, int index) {
  905 + // // // WineSunModel data = feastModel.wineData[index];
  906 + // // return ;
  907 + // // // '剑南春52度500ml', '1150元/份 不可议价'
  908 + // // });
  909 + // // }
  910 + // // })
787 )); 911 ));
788 } 912 }
789 } 913 }
  1 +import 'package:common_utils/common_utils.dart';
1 import 'package:flutter/material.dart'; 2 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:one_key/models/get_banquet_be_follow_model.dart';
3 import 'package:one_key/res/colors.dart'; 5 import 'package:one_key/res/colors.dart';
4 import 'package:one_key/utils/dialog_util.dart'; 6 import 'package:one_key/utils/dialog_util.dart';
5 import 'package:one_key/widgets/h_empty_view.dart'; 7 import 'package:one_key/widgets/h_empty_view.dart';
@@ -8,6 +10,9 @@ import 'package:provider/provider.dart'; @@ -8,6 +10,9 @@ import 'package:provider/provider.dart';
8 10
9 import '../../constant/state.dart'; 11 import '../../constant/state.dart';
10 import '../../provider/feast_model.dart'; 12 import '../../provider/feast_model.dart';
  13 +import '../../provider/user_model.dart';
  14 +import '../../route/navigator_util.dart';
  15 +import '../../utils/event_bus.dart';
11 import '../../utils/screen_util.dart'; 16 import '../../utils/screen_util.dart';
12 import '../../utils/utils.dart'; 17 import '../../utils/utils.dart';
13 import '../../widgets/MyDivider.dart'; 18 import '../../widgets/MyDivider.dart';
@@ -27,17 +32,104 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -27,17 +32,104 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
27 FeastModel feastModel; 32 FeastModel feastModel;
28 DateTime dateTimeStart; 33 DateTime dateTimeStart;
29 DateTime dateTimeEnd; 34 DateTime dateTimeEnd;
30 - String start = '请选择';  
31 - String end = '请选择';  
32 - bool isFeastTime = false; 35 + String start = '不限';
  36 + String end = '不限';
  37 + bool isFeastTime = true; //ture 为宴会时间 false 为创建时间
33 @override 38 @override
34 void initState() { 39 void initState() {
35 super.initState(); 40 super.initState();
36 dateTimeStart = DateTime.now(); 41 dateTimeStart = DateTime.now();
37 - start = createDateText(context, dateTimeStart); 42 + // start = createDateText(context, dateTimeStart);
38 dateTimeEnd = DateTime.now(); 43 dateTimeEnd = DateTime.now();
39 - end = createDateText(context, dateTimeEnd); 44 + // end = createDateText(context, dateTimeEnd);
40 Utils.changeStatusColor(color: MyColours.color_438E93); 45 Utils.changeStatusColor(color: MyColours.color_438E93);
  46 +
  47 + WidgetsBinding.instance.addPostFrameCallback((_) {
  48 + _getBanquetBeFollow();
  49 + });
  50 + }
  51 +
  52 + /// 根据时间范围查询待跟进订单
  53 + _getBanquetBeFollow() async {
  54 + Map<String, String> pramas = {
  55 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  56 + 'type': isFeastTime ? '2' : '1'
  57 + }; //
  58 + if (start != '不限') {
  59 + pramas['rdate'] = _getRdate(dateTimeStart);
  60 + }
  61 + if (end != '不限') {
  62 + pramas['edate'] = _getEdate(dateTimeEnd);
  63 + }
  64 +
  65 + bool success = await feastModel.getBanquetBeFollow(context, pramas);
  66 + if (success) {
  67 + // _uploadImageProvider.feastRemarkContractImageList = [];
  68 + // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
  69 + // UploadImgModel uploadImgModel = UploadImgModel();
  70 + // uploadImgModel.process = 1;
  71 + // uploadImgModel.qiniuUrl = element.url;
  72 + // _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
  73 + // });
  74 + // setState(() {});
  75 + }
  76 + }
  77 +
  78 + /// 设置丢单原因
  79 + _setBanquetLost(String lost, GetBanquetBeFollowSunModel data) async {
  80 + Map<String, String> pramas = {'rid': data.id, 'lost': lost}; //
  81 + bool success = await feastModel.setBanquetLost(context, pramas);
  82 + if (success) {
  83 + // _uploadImageProvider.feastRemarkContractImageList = [];
  84 + // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
  85 + // UploadImgModel uploadImgModel = UploadImgModel();
  86 + // uploadImgModel.process = 1;
  87 + // uploadImgModel.qiniuUrl = element.url;
  88 + // _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
  89 + // });
  90 + // setState(() {});
  91 + _getBanquetBeFollow(); //刷新当前页面
  92 + bus.emit('feast_home_page'); //编辑之后刷新宴会首页
  93 +
  94 + }
  95 + }
  96 +
  97 + //获取一天开始时间字符串
  98 + String _getRdate(DateTime date) {
  99 + // String ymd = DateUtil.formatDate(date, format: DateFormats.y_mo_d);
  100 + String timeStrStart = '';
  101 + //一天开始时间
  102 + double startDay;
  103 +
  104 + timeStrStart = date.year.toString() +
  105 + "-" +
  106 + Utils.addZeroNumber(date.month) +
  107 + "-" +
  108 + Utils.addZeroNumber(date.day) +
  109 + " 00:00:00";
  110 +
  111 + startDay = (DateTime.parse(timeStrStart).millisecondsSinceEpoch) / 1000;
  112 + return startDay.floor().toString();
  113 + }
  114 +
  115 + //获取一天结束时间字符串
  116 + String _getEdate(DateTime date) {
  117 + // String ymd = DateUtil.formatDate(date, format: DateFormats.y_mo_d);
  118 +
  119 + String timeStrEnd = '';
  120 +
  121 + //一天结束时间
  122 + double endDay;
  123 +
  124 + timeStrEnd = date.year.toString() +
  125 + "-" +
  126 + Utils.addZeroNumber(date.month) +
  127 + "-" +
  128 + Utils.addZeroNumber(date.day) +
  129 + " 23:59:59";
  130 +
  131 + endDay = (DateTime.parse(timeStrEnd).millisecondsSinceEpoch) / 1000;
  132 + return endDay.floor().toString();
41 } 133 }
42 134
43 //生成日期文本 135 //生成日期文本
@@ -126,7 +218,9 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -126,7 +218,9 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
126 ), 218 ),
127 Spacer(), 219 Spacer(),
128 RoundButton( 220 RoundButton(
129 - onPressed: () async {}, 221 + onPressed: () async {
  222 + _getBanquetBeFollow();
  223 + },
130 text: '搜索', 224 text: '搜索',
131 fontSize: 28, 225 fontSize: 28,
132 isBold: false, 226 isBold: false,
@@ -163,7 +257,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -163,7 +257,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
163 start, 257 start,
164 style: TextStyle( 258 style: TextStyle(
165 fontSize: font(18), 259 fontSize: font(18),
166 - color: start == '请选择' 260 + color: start == '不限'
167 ? MyColours.color_999999 261 ? MyColours.color_999999
168 : MyColours.color_515151), 262 : MyColours.color_515151),
169 ), 263 ),
@@ -196,9 +290,8 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -196,9 +290,8 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
196 Text( 290 Text(
197 end, 291 end,
198 style: TextStyle( 292 style: TextStyle(
199 - fontWeight: FontWeight.bold,  
200 fontSize: font(18), 293 fontSize: font(18),
201 - color: end == '请选择' 294 + color: end == '不限'
202 ? MyColours.color_999999 295 ? MyColours.color_999999
203 : MyColours.color_515151), 296 : MyColours.color_515151),
204 ), 297 ),
@@ -216,7 +309,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -216,7 +309,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
216 ); 309 );
217 } 310 }
218 311
219 - Widget buildFeastTypeItem() { 312 + Widget buildFeastTypeItem(GetBanquetBeFollowSunModel data) {
220 return Container( 313 return Container(
221 margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)), 314 margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
222 decoration: BoxDecoration( 315 decoration: BoxDecoration(
@@ -246,14 +339,14 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -246,14 +339,14 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
246 mainAxisAlignment: MainAxisAlignment.spaceBetween, 339 mainAxisAlignment: MainAxisAlignment.spaceBetween,
247 children: [ 340 children: [
248 Text( 341 Text(
249 - '8月1日 午餐', 342 + '${data.ddateStr}',
250 style: TextStyle( 343 style: TextStyle(
251 fontWeight: FontWeight.bold, 344 fontWeight: FontWeight.bold,
252 color: MyColours.color_F6F6F6, 345 color: MyColours.color_F6F6F6,
253 fontSize: ScreenUtil().setSp(40)), 346 fontSize: ScreenUtil().setSp(40)),
254 ), 347 ),
255 Text( 348 Text(
256 - '婚宴', 349 + '${data.className}',
257 style: TextStyle( 350 style: TextStyle(
258 fontWeight: FontWeight.bold, 351 fontWeight: FontWeight.bold,
259 color: MyColours.color_F6F6F6, 352 color: MyColours.color_F6F6F6,
@@ -278,41 +371,43 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -278,41 +371,43 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
278 Wrap( 371 Wrap(
279 children: [ 372 children: [
280 Text( 373 Text(
281 - '[已选桌/未选桌]', 374 + data.isTids == 1 ? '[已选桌]' : '[未选桌]',
282 style: TextStyle( 375 style: TextStyle(
283 - color: true 376 + color: data.isTids == 1
284 ? MyColours.color_00A870 377 ? MyColours.color_00A870
285 : MyColours.color_E34D59, 378 : MyColours.color_E34D59,
286 fontSize: ScreenUtil().setSp(28)), 379 fontSize: ScreenUtil().setSp(28)),
287 ), 380 ),
288 Text( 381 Text(
289 - ' [已选套餐/未选套餐]', 382 + data.isSetmeal == 1 ? ' [已选套餐]' : ' [未选套餐]',
290 style: TextStyle( 383 style: TextStyle(
291 - color: true 384 + color: data.isSetmeal == 1
292 ? MyColours.color_00A870 385 ? MyColours.color_00A870
293 : MyColours.color_E34D59, 386 : MyColours.color_E34D59,
294 fontSize: ScreenUtil().setSp(28)), 387 fontSize: ScreenUtil().setSp(28)),
295 ), 388 ),
296 Text( 389 Text(
297 - ' [定金2000/未交定金]', 390 + data.isDeposit == 1
  391 + ? ' [定金${data.depositPrice}]'
  392 + : ' [未交定金]',
298 style: TextStyle( 393 style: TextStyle(
299 - color: true 394 + color: data.isDeposit == 1
300 ? MyColours.color_00A870 395 ? MyColours.color_00A870
301 : MyColours.color_E34D59, 396 : MyColours.color_E34D59,
302 fontSize: ScreenUtil().setSp(28)), 397 fontSize: ScreenUtil().setSp(28)),
303 ), 398 ),
304 Text( 399 Text(
305 - ' [已担保/未担保]', 400 + data.isWarrant == 1 ? ' [已担保]' : ' [未担保]',
306 style: TextStyle( 401 style: TextStyle(
307 - color: true 402 + color: data.isWarrant == 1
308 ? MyColours.color_00A870 403 ? MyColours.color_00A870
309 : MyColours.color_E34D59, 404 : MyColours.color_E34D59,
310 fontSize: ScreenUtil().setSp(28)), 405 fontSize: ScreenUtil().setSp(28)),
311 ), 406 ),
312 Text( 407 Text(
313 - ' [已签约/未签约]', 408 + data.isContractFinalPrice == 1 ? ' [已签约]' : ' [未签约]',
314 style: TextStyle( 409 style: TextStyle(
315 - color: true 410 + color: data.isContractFinalPrice == 1
316 ? MyColours.color_00A870 411 ? MyColours.color_00A870
317 : MyColours.color_E34D59, 412 : MyColours.color_E34D59,
318 fontSize: ScreenUtil().setSp(28)), 413 fontSize: ScreenUtil().setSp(28)),
@@ -324,7 +419,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -324,7 +419,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
324 mainAxisAlignment: MainAxisAlignment.spaceBetween, 419 mainAxisAlignment: MainAxisAlignment.spaceBetween,
325 children: [ 420 children: [
326 Text( 421 Text(
327 - '方先生 负责人:刘经理', 422 + '${data.rname} 跟单经理:${data.nickName ?? data.account}',
328 style: TextStyle( 423 style: TextStyle(
329 fontWeight: FontWeight.bold, 424 fontWeight: FontWeight.bold,
330 color: MyColours.color_000000, 425 color: MyColours.color_000000,
@@ -332,7 +427,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -332,7 +427,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
332 ), 427 ),
333 RoundButton( 428 RoundButton(
334 onPressed: () async { 429 onPressed: () async {
335 - _showCancelWidget(context); 430 + _showCancelWidget(context, data);
336 }, 431 },
337 text: '丢单', 432 text: '丢单',
338 fontSize: 28, 433 fontSize: 28,
@@ -357,7 +452,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -357,7 +452,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
357 } 452 }
358 453
359 ///取消预订弹框 454 ///取消预订弹框
360 - _showCancelWidget(context) { 455 + _showCancelWidget(context, GetBanquetBeFollowSunModel data) {
361 ScrollController _scrollController = ScrollController(); 456 ScrollController _scrollController = ScrollController();
362 TextEditingController _cancelController = TextEditingController(); 457 TextEditingController _cancelController = TextEditingController();
363 FocusNode _cancelNode = FocusNode(); 458 FocusNode _cancelNode = FocusNode();
@@ -646,8 +741,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -646,8 +741,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
646 741
647 Navigator.of(context).pop(); 742 Navigator.of(context).pop();
648 Loading.showLoading(context); 743 Loading.showLoading(context);
649 -  
650 - // setReserveStatus('4', desc: desc); 744 + _setBanquetLost(desc, data);
651 }), 745 }),
652 ]) 746 ])
653 ], 747 ],
@@ -701,7 +795,6 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -701,7 +795,6 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
701 @override 795 @override
702 Widget build(BuildContext context) { 796 Widget build(BuildContext context) {
703 feastModel = Provider.of<FeastModel>(context); 797 feastModel = Provider.of<FeastModel>(context);
704 - feastModel.pageStateFollowUp = PageState.Success;  
705 return Scaffold( 798 return Scaffold(
706 backgroundColor: MyColours.color_ffffff, 799 backgroundColor: MyColours.color_ffffff,
707 appBar: SystemAppBar( 800 appBar: SystemAppBar(
@@ -741,6 +834,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -741,6 +834,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
741 pageState: model.pageStateFollowUp, 834 pageState: model.pageStateFollowUp,
742 callback: () { 835 callback: () {
743 // _getWine(); 836 // _getWine();
  837 + _getBanquetBeFollow();
744 }, 838 },
745 emptyMsg: "暂时没有待跟进宴会哦", 839 emptyMsg: "暂时没有待跟进宴会哦",
746 emptyImg: "empty_search", 840 emptyImg: "empty_search",
@@ -748,12 +842,14 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -748,12 +842,14 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
748 ); 842 );
749 } else { 843 } else {
750 return ListView.builder( 844 return ListView.builder(
751 - itemCount: 100, 845 + // itemCount: feastModel.beFollowData.length,
  846 + itemCount: feastModel.beFollowData.length,
752 padding: 847 padding:
753 EdgeInsets.only(left: w(12), top: w(19), right: w(12)), 848 EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
754 itemBuilder: (BuildContext context, int index) { 849 itemBuilder: (BuildContext context, int index) {
755 - // WineSunModel data = feastModel.wineData[index];  
756 - return buildFeastTypeItem(); 850 + GetBanquetBeFollowSunModel data =
  851 + feastModel.beFollowData[index];
  852 + return buildFeastTypeItem(data);
757 // '剑南春52度500ml', '1150元/份 不可议价' 853 // '剑南春52度500ml', '1150元/份 不可议价'
758 }); 854 });
759 } 855 }
@@ -763,14 +859,20 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { @@ -763,14 +859,20 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
763 Expanded( 859 Expanded(
764 child: _callButton( 860 child: _callButton(
765 onPress: () { 861 onPress: () {
766 - Navigator.pop(context); 862 + dateTimeStart = DateTime.now();
  863 + start = createDateText(context, dateTimeStart);
  864 + dateTimeEnd = DateTime.now();
  865 + end = createDateText(context, dateTimeEnd);
  866 + setState(() {});
767 }, 867 },
768 content: '回到今天', 868 content: '回到今天',
769 hasLeftBorder: true, 869 hasLeftBorder: true,
770 isSelect: false)), 870 isSelect: false)),
771 Expanded( 871 Expanded(
772 child: _callButton( 872 child: _callButton(
773 - onPress: () {}, 873 + onPress: () {
  874 + NavigatorUtil.goFeastCreatePage(context);
  875 + },
774 content: '创建宴会', 876 content: '创建宴会',
775 hasLeftBorder: true, 877 hasLeftBorder: true,
776 isSelect: true)) 878 isSelect: true))
@@ -97,8 +97,8 @@ class _FeastItemState extends State<FeastItem> { @@ -97,8 +97,8 @@ class _FeastItemState extends State<FeastItem> {
97 crossAxisAlignment: CrossAxisAlignment.start, 97 crossAxisAlignment: CrossAxisAlignment.start,
98 mainAxisAlignment: MainAxisAlignment.start, 98 mainAxisAlignment: MainAxisAlignment.start,
99 children: [ 99 children: [
100 - Row(  
101 - mainAxisAlignment: MainAxisAlignment.spaceBetween, 100 + Wrap(
  101 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
102 children: [ 102 children: [
103 Text( 103 Text(
104 '${widget.sunModel.rname} ${Utils.starPhone(widget.sunModel.phone)}', 104 '${widget.sunModel.rname} ${Utils.starPhone(widget.sunModel.phone)}',
@@ -16,6 +16,7 @@ import '../../provider/user_model.dart'; @@ -16,6 +16,7 @@ import '../../provider/user_model.dart';
16 import '../../res/colors.dart'; 16 import '../../res/colors.dart';
17 17
18 import '../../utils/event_bus.dart'; 18 import '../../utils/event_bus.dart';
  19 +import '../../utils/screen_util.dart';
19 import '../../widgets/page_exception.dart'; 20 import '../../widgets/page_exception.dart';
20 21
21 class FeastPage extends StatefulWidget { 22 class FeastPage extends StatefulWidget {
@@ -34,11 +35,13 @@ class _FeastPageState extends State<FeastPage> { @@ -34,11 +35,13 @@ class _FeastPageState extends State<FeastPage> {
34 super.initState(); 35 super.initState();
35 WidgetsBinding.instance.addPostFrameCallback((_) { 36 WidgetsBinding.instance.addPostFrameCallback((_) {
36 _getBanquetByTime(); 37 _getBanquetByTime();
  38 + _getBanquetBeFollow();
37 // scrollController.jumpTo(scrollController.position.minScrollExtent); 39 // scrollController.jumpTo(scrollController.position.minScrollExtent);
38 }); 40 });
39 41
40 bus.on("feast_home_page", (arg) { 42 bus.on("feast_home_page", (arg) {
41 _getBanquetByTime(); 43 _getBanquetByTime();
  44 + _getBanquetBeFollow();
42 }); 45 });
43 } 46 }
44 47
@@ -48,6 +51,16 @@ class _FeastPageState extends State<FeastPage> { @@ -48,6 +51,16 @@ class _FeastPageState extends State<FeastPage> {
48 bus.off('feast_home_page'); 51 bus.off('feast_home_page');
49 } 52 }
50 53
  54 + /// 根据时间范围查询待跟进订单
  55 + _getBanquetBeFollow() async {
  56 + Map<String, String> pramas = {
  57 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  58 + 'type': '2'
  59 + }; //
  60 + bool success = await feastModel.getBanquetBeFollow(context, pramas);
  61 + if (success) {}
  62 + }
  63 +
51 ///获取宴会详情 64 ///获取宴会详情
52 _getBanquetByTime() async { 65 _getBanquetByTime() async {
53 DateTime now = DateTime.now(); 66 DateTime now = DateTime.now();
@@ -112,31 +125,39 @@ class _FeastPageState extends State<FeastPage> { @@ -112,31 +125,39 @@ class _FeastPageState extends State<FeastPage> {
112 upAndDown('y_new', '新建宴会', onTap: () { 125 upAndDown('y_new', '新建宴会', onTap: () {
113 NavigatorUtil.goFeastCreatePage(context); 126 NavigatorUtil.goFeastCreatePage(context);
114 }), 127 }),
115 - Stack(clipBehavior: Clip.none, children: [  
116 - upAndDown('y_schedule', '待跟进', onTap: () {  
117 - NavigatorUtil.goFeastFollowUpPage(context);  
118 - }),  
119 - Positioned(  
120 - right: ScreenUtil().setWidth(-6),  
121 - bottom: ScreenUtil().setWidth(32),  
122 - child: Container(  
123 - alignment: Alignment.center,  
124 - decoration: BoxDecoration(  
125 - borderRadius:  
126 - BorderRadius.circular(ScreenUtil().setWidth(16)),  
127 - color: MyColours.color_E34D59),  
128 - width: ScreenUtil().setWidth(32),  
129 - height: ScreenUtil().setWidth(32),  
130 - child: Text(  
131 - '7',  
132 - style: TextStyle(  
133 - color: MyColours.color_F6F6F6,  
134 - fontWeight: FontWeight.bold,  
135 - fontSize: ScreenUtil().setSp(24)),  
136 - ),  
137 - ),  
138 - )  
139 - ]), 128 + InkWell(
  129 + onTap: () {
  130 + NavigatorUtil.goFeastFollowUpPage(context);
  131 + },
  132 + child: Stack(clipBehavior: Clip.none, children: [
  133 + upAndDown('y_schedule', '待跟进', onTap: () {
  134 + NavigatorUtil.goFeastFollowUpPage(context);
  135 + }),
  136 + feastModel.beFollowData != null &&
  137 + feastModel.beFollowData.length > 0
  138 + ? Positioned(
  139 + right: ScreenUtil().setWidth(0),
  140 + bottom: ScreenUtil().setWidth(38),
  141 + child: Container(
  142 + alignment: Alignment.center,
  143 + decoration: BoxDecoration(
  144 + borderRadius: BorderRadius.circular(
  145 + ScreenUtil().setWidth(16)),
  146 + color: MyColours.color_E34D59),
  147 + // width: ScreenUtil().setWidth(32),
  148 + height: ScreenUtil().setWidth(32),
  149 + padding: EdgeInsets.symmetric(horizontal: w(4)),
  150 + child: Text(
  151 + '${feastModel.beFollowData.length}',
  152 + style: TextStyle(
  153 + color: MyColours.color_F6F6F6,
  154 + fontWeight: FontWeight.bold,
  155 + fontSize: ScreenUtil().setSp(24)),
  156 + ),
  157 + ),
  158 + )
  159 + : SizedBox()
  160 + ])),
140 upAndDown('y_money', '定金管理', onTap: () { 161 upAndDown('y_money', '定金管理', onTap: () {
141 NavigatorUtil.goFeastDepositDataPage(context); 162 NavigatorUtil.goFeastDepositDataPage(context);
142 }) 163 })
@@ -10,6 +10,7 @@ import '../constant/error.dart'; @@ -10,6 +10,7 @@ import '../constant/error.dart';
10 import '../models/GetBanquetByTimeModel.dart'; 10 import '../models/GetBanquetByTimeModel.dart';
11 import '../models/classify_model.dart'; 11 import '../models/classify_model.dart';
12 import '../models/filter_btn_model.dart'; 12 import '../models/filter_btn_model.dart';
  13 +import '../models/get_banquet_be_follow_model.dart';
13 import '../models/get_banquet_by_id_new_model.dart'; 14 import '../models/get_banquet_by_id_new_model.dart';
14 import '../models/get_banquet_deposit_model.dart'; 15 import '../models/get_banquet_deposit_model.dart';
15 import '../models/get_deposit_model.dart'; 16 import '../models/get_deposit_model.dart';
@@ -18,6 +19,7 @@ import '../models/get_setmeal_class_by_id_model.dart'; @@ -18,6 +19,7 @@ import '../models/get_setmeal_class_by_id_model.dart';
18 import '../models/get_staff_model.dart'; 19 import '../models/get_staff_model.dart';
19 import '../models/otherset_model.dart'; 20 import '../models/otherset_model.dart';
20 import '../models/personnel_manage_model.dart'; 21 import '../models/personnel_manage_model.dart';
  22 +import '../models/search_banquet_deposit_model.dart';
21 import '../models/sessions_model.dart'; 23 import '../models/sessions_model.dart';
22 import '../models/set_xuan_tai_model.dart'; 24 import '../models/set_xuan_tai_model.dart';
23 import '../models/setmeal_by_id_model.dart'; 25 import '../models/setmeal_by_id_model.dart';
@@ -79,7 +81,130 @@ class FeastModel extends ChangeNotifier { @@ -79,7 +81,130 @@ class FeastModel extends ChangeNotifier {
79 dynamic banquetDetailMap; //宴会详情信息--接口原始数据 81 dynamic banquetDetailMap; //宴会详情信息--接口原始数据
80 82
81 List<GetBanquetByTimeSunModel> banquetHome; //宴会首页数据 83 List<GetBanquetByTimeSunModel> banquetHome; //宴会首页数据
82 - PageState pageStateBeFollow = PageState.Loading; //待跟进订单 84 + List<GetBanquetBeFollowSunModel> beFollowData; //待跟进订单数据
  85 +
  86 + SearchBanquetDepositSunModel depositsManagesData; //根据定金编号搜索定金订单
  87 +
  88 + Map<String, String> fullStatusByTime = {}; // 宴会看板 ---- 日历显示红点数据
  89 +
  90 + /**
  91 + * 宴会看板
  92 + */
  93 +
  94 + //查看指定时间内是否有宴会预定
  95 + Future<Map> getExitsBanquetByDate(
  96 + BuildContext context, Map<String, String> params,
  97 + {showLoading = false}) async {
  98 + BaseResp<Map> baseResp = await DioUtil()
  99 + .request<Map>(context, Method.get, HttpUrl.get_exits_banquet_by_date,
  100 + data: params, showLoading: showLoading)
  101 + .catchError((error) {
  102 + print(error.toString());
  103 + if (error is MyError) {}
  104 + });
  105 + if (baseResp == null) return {};
  106 + if (baseResp.code == Constant.status_success) {
  107 + // fullStatusByTime = baseResp.data;
  108 + baseResp.data.forEach((key, value) {
  109 + // DateTime dateTime =
  110 + // DateTime.fromMillisecondsSinceEpoch(int.parse(key) * 1000);
  111 + // String keytemp = '${dateTime.month}' + '${dateTime.day}';
  112 + fullStatusByTime[key] = '${value}';
  113 + });
  114 + } else {
  115 + Utils.showToast(baseResp.msg ?? "");
  116 + }
  117 + notifyListeners();
  118 + return fullStatusByTime;
  119 + }
  120 +
  121 + /**
  122 + * 宴会定金管理
  123 + */
  124 +
  125 + /// 根据定金编号搜索定金订单
  126 + Future<dynamic> searchBanquetDeposit(
  127 + BuildContext context, Map<String, String> params,
  128 + {isShowLoading = true}) async {
  129 + BaseResp<dynamic> baseResp = await DioUtil()
  130 + .request<dynamic>(context, Method.get, HttpUrl.search_banquet_deposit,
  131 + data: params, showLoading: isShowLoading)
  132 + .catchError((error) {
  133 + print(error.toString());
  134 + // if (error is MyError) {
  135 + // switch (error.type) {
  136 + // case 1:
  137 + // pageStateDepositData = PageState.ConnectivityError;
  138 + // break;
  139 + // case 2:
  140 + // pageStateDepositData = PageState.ConnectivityTimeOut;
  141 + // break;
  142 + // default:
  143 + // pageStateDepositData = PageState.ConnectivityError;
  144 + // break;
  145 + // }
  146 + // }
  147 + // notifyListeners();
  148 + return false;
  149 + });
  150 + if (baseResp.code == Constant.status_success) {
  151 + // 输入的编号不存在的时候,怎么判断??
  152 + if (baseResp.data is List) {
  153 + Utils.showToast('您搜索的收据编号不存在,请重新输入!');
  154 + return;
  155 + }
  156 + depositsManagesData =
  157 + SearchBanquetDepositModel.fromJson(baseResp.responseData).data;
  158 +
  159 + // if (baseResp.data == 1) {
  160 + // rid = baseResp.data['id'];
  161 + // if (beFollowData.length == 0) {
  162 + // pageStateFollowUp = PageState.Empty;
  163 + // } else {
  164 + // pageStateDepositData = PageState.Success;
  165 + // }
  166 +
  167 + notifyListeners();
  168 + return true;
  169 + // } else {
  170 + // return false;
  171 + // }
  172 + } else {
  173 + if (baseResp != null) {
  174 + Utils.showToast(baseResp.msg ?? "");
  175 + }
  176 + // pageStateDepositData = PageState.ConnectivityError;
  177 + // notifyListeners();
  178 + return false;
  179 + }
  180 + }
  181 +
  182 + /// 退定金
  183 + Future<dynamic> bankBanquetDeposit(
  184 + BuildContext context, Map<String, String> params,
  185 + {isShowLoading = true}) async {
  186 + BaseResp<dynamic> baseResp = await DioUtil()
  187 + .request<dynamic>(context, Method.get, HttpUrl.bank_banquet_deposit,
  188 + data: params, showLoading: isShowLoading)
  189 + .catchError((error) {
  190 + print(error.toString());
  191 + if (error is MyError) {}
  192 + return false;
  193 + });
  194 + if (baseResp.code == Constant.status_success) {
  195 + // if (baseResp.data == 1) {
  196 + // rid = baseResp.data['id'];
  197 + return true;
  198 + // } else {
  199 + // return false;
  200 + // }
  201 + } else {
  202 + if (baseResp != null) {
  203 + Utils.showToast(baseResp.msg ?? "");
  204 + }
  205 + return false;
  206 + }
  207 + }
83 208
84 /** 209 /**
85 * 宴会待跟进 210 * 宴会待跟进
@@ -124,13 +249,13 @@ class FeastModel extends ChangeNotifier { @@ -124,13 +249,13 @@ class FeastModel extends ChangeNotifier {
124 if (error is MyError) { 249 if (error is MyError) {
125 switch (error.type) { 250 switch (error.type) {
126 case 1: 251 case 1:
127 - pageStateBeFollow = PageState.ConnectivityError; 252 + pageStateFollowUp = PageState.ConnectivityError;
128 break; 253 break;
129 case 2: 254 case 2:
130 - pageStateBeFollow = PageState.ConnectivityTimeOut; 255 + pageStateFollowUp = PageState.ConnectivityTimeOut;
131 break; 256 break;
132 default: 257 default:
133 - pageStateBeFollow = PageState.ConnectivityError; 258 + pageStateFollowUp = PageState.ConnectivityError;
134 break; 259 break;
135 } 260 }
136 } 261 }
@@ -138,14 +263,15 @@ class FeastModel extends ChangeNotifier { @@ -138,14 +263,15 @@ class FeastModel extends ChangeNotifier {
138 return false; 263 return false;
139 }); 264 });
140 if (baseResp.code == Constant.status_success) { 265 if (baseResp.code == Constant.status_success) {
141 - // banquetHome = GetBanquetByTimeModel.fromJson(baseResp.responseData).data; 266 + beFollowData =
  267 + GetBanquetBeFollowModel.fromJson(baseResp.responseData).data;
142 268
143 // if (baseResp.data == 1) { 269 // if (baseResp.data == 1) {
144 // rid = baseResp.data['id']; 270 // rid = baseResp.data['id'];
145 - if (banquetHome.length == 0) {  
146 - pageStateBeFollow = PageState.Empty; 271 + if (beFollowData.length == 0) {
  272 + pageStateFollowUp = PageState.Empty;
147 } else { 273 } else {
148 - pageStateBeFollow = PageState.Success; 274 + pageStateFollowUp = PageState.Success;
149 } 275 }
150 276
151 notifyListeners(); 277 notifyListeners();
@@ -157,7 +283,7 @@ class FeastModel extends ChangeNotifier { @@ -157,7 +283,7 @@ class FeastModel extends ChangeNotifier {
157 if (baseResp != null) { 283 if (baseResp != null) {
158 Utils.showToast(baseResp.msg ?? ""); 284 Utils.showToast(baseResp.msg ?? "");
159 } 285 }
160 - pageStateBeFollow = PageState.ConnectivityError; 286 + pageStateFollowUp = PageState.ConnectivityError;
161 notifyListeners(); 287 notifyListeners();
162 return false; 288 return false;
163 } 289 }