|
1
|
import 'dart:convert';
|
1
|
import 'dart:convert';
|
|
2
|
|
2
|
|
|
3
|
import 'package:cached_network_image/cached_network_image.dart';
|
3
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
|
4
|
+import 'package:common_utils/common_utils.dart';
|
|
4
|
import 'package:dotted_border/dotted_border.dart';
|
5
|
import 'package:dotted_border/dotted_border.dart';
|
|
5
|
import 'package:flutter/gestures.dart';
|
6
|
import 'package:flutter/gestures.dart';
|
|
6
|
import 'package:flutter/material.dart';
|
7
|
import 'package:flutter/material.dart';
|
|
@@ -15,6 +16,7 @@ import 'package:provider/provider.dart'; |
|
@@ -15,6 +16,7 @@ import 'package:provider/provider.dart'; |
|
15
|
import '../../models/dsolt_xt.dart';
|
16
|
import '../../models/dsolt_xt.dart';
|
|
16
|
import '../../models/feast_menu_model.dart';
|
17
|
import '../../models/feast_menu_model.dart';
|
|
17
|
import '../../models/set_xuan_tai_model.dart';
|
18
|
import '../../models/set_xuan_tai_model.dart';
|
|
|
|
19
|
+import '../../models/setmeal_by_id_model.dart';
|
|
18
|
import '../../models/upload_img_model.dart';
|
20
|
import '../../models/upload_img_model.dart';
|
|
19
|
import '../../provider/feast_model.dart';
|
21
|
import '../../provider/feast_model.dart';
|
|
20
|
import '../../provider/upload_img_provider.dart';
|
22
|
import '../../provider/upload_img_provider.dart';
|
|
@@ -46,8 +48,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -46,8 +48,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
46
|
FocusNode phoneF = FocusNode();
|
48
|
FocusNode phoneF = FocusNode();
|
|
47
|
TextEditingController customC = TextEditingController(); //意向备注
|
49
|
TextEditingController customC = TextEditingController(); //意向备注
|
|
48
|
FocusNode customF = FocusNode(); //意向备注
|
50
|
FocusNode customF = FocusNode(); //意向备注
|
|
49
|
- TextEditingController customCxt = TextEditingController(); //选台备注
|
|
|
|
50
|
- FocusNode customFxt = FocusNode(); //选台备注
|
51
|
+
|
|
51
|
TextEditingController customCdb = TextEditingController(); //担保说明
|
52
|
TextEditingController customCdb = TextEditingController(); //担保说明
|
|
52
|
FocusNode customFdb = FocusNode(); //担保说明
|
53
|
FocusNode customFdb = FocusNode(); //担保说明
|
|
53
|
List sexList;
|
54
|
List sexList;
|
|
@@ -75,6 +76,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -75,6 +76,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
75
|
int xuantaiSelIndex = 0;
|
76
|
int xuantaiSelIndex = 0;
|
|
76
|
List<DsoltXt> dsoltList = [];
|
77
|
List<DsoltXt> dsoltList = [];
|
|
77
|
UserModel userModel;
|
78
|
UserModel userModel;
|
|
|
|
79
|
+ Map<String, List<CookByIdSetmeal>> dataMenu = {};
|
|
78
|
|
80
|
|
|
79
|
@override
|
81
|
@override
|
|
80
|
void initState() {
|
82
|
void initState() {
|
|
@@ -84,17 +86,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -84,17 +86,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
84
|
Utils.changeStatusColor(color: MyColours.color_438E93);
|
86
|
Utils.changeStatusColor(color: MyColours.color_438E93);
|
|
85
|
initSexList();
|
87
|
initSexList();
|
|
86
|
|
88
|
|
|
87
|
- xuantaiData.add(initSetXuanTaiModel());
|
89
|
+ xuantaiData.add(initSetXuanTaiModel(index: 0));
|
|
88
|
initTime(context);
|
90
|
initTime(context);
|
|
89
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
91
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
90
|
_getSellerUserBySellerid();
|
92
|
_getSellerUserBySellerid();
|
|
91
|
_getStaff();
|
93
|
_getStaff();
|
|
92
|
_getClassify();
|
94
|
_getClassify();
|
|
|
|
95
|
+ _getSetmeal();
|
|
93
|
// scrollController.jumpTo(scrollController.position.minScrollExtent);
|
96
|
// scrollController.jumpTo(scrollController.position.minScrollExtent);
|
|
94
|
});
|
97
|
});
|
|
95
|
}
|
98
|
}
|
|
96
|
|
99
|
|
|
97
|
- initSetXuanTaiModel() {
|
100
|
+ @override
|
|
|
|
101
|
+ void dispose() {
|
|
|
|
102
|
+ super.dispose();
|
|
|
|
103
|
+ feastModel.rid = null;
|
|
|
|
104
|
+ feastModel.type = null;
|
|
|
|
105
|
+ feastModel.reserve = null;
|
|
|
|
106
|
+ }
|
|
|
|
107
|
+
|
|
|
|
108
|
+ initSetXuanTaiModel({int index}) {
|
|
98
|
SetXuanTaiModel setXuanTaiModel = SetXuanTaiModel();
|
109
|
SetXuanTaiModel setXuanTaiModel = SetXuanTaiModel();
|
|
99
|
setXuanTaiModel.dateTimeShowxt = '请选择';
|
110
|
setXuanTaiModel.dateTimeShowxt = '请选择';
|
|
100
|
setXuanTaiModel.cdShow = '请选择';
|
111
|
setXuanTaiModel.cdShow = '请选择';
|
|
@@ -104,6 +115,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -104,6 +115,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
104
|
setXuanTaiModel.setmeal = [];
|
115
|
setXuanTaiModel.setmeal = [];
|
|
105
|
setXuanTaiModel.tids = [];
|
116
|
setXuanTaiModel.tids = [];
|
|
106
|
setXuanTaiModel.wine = [];
|
117
|
setXuanTaiModel.wine = [];
|
|
|
|
118
|
+ if (feastModel != null) {
|
|
|
|
119
|
+ setXuanTaiModel.rid = feastModel.rid;
|
|
|
|
120
|
+ }
|
|
|
|
121
|
+ if (index != null) {
|
|
|
|
122
|
+ String numStr = ConvertNumberToChineseMoneyWords.toChinese(index);
|
|
|
|
123
|
+ setXuanTaiModel.reserveOrder = '第${numStr}场';
|
|
|
|
124
|
+ }
|
|
|
|
125
|
+
|
|
107
|
return setXuanTaiModel;
|
126
|
return setXuanTaiModel;
|
|
108
|
}
|
127
|
}
|
|
109
|
|
128
|
|
|
@@ -153,6 +172,67 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -153,6 +172,67 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
153
|
await feastModel.getClassify(context, isShowLoading: isShowLoading);
|
172
|
await feastModel.getClassify(context, isShowLoading: isShowLoading);
|
|
154
|
}
|
173
|
}
|
|
155
|
|
174
|
|
|
|
|
175
|
+ // ///获取宴会套餐
|
|
|
|
176
|
+ // Future<bool> _getSetmeal({bool isShowLoading = true}) async {
|
|
|
|
177
|
+ // bool success =
|
|
|
|
178
|
+ // await feastModel.getSetmeal(context, isShowLoading: isShowLoading);
|
|
|
|
179
|
+ // if (success) {
|
|
|
|
180
|
+
|
|
|
|
181
|
+ // for (SetMealSunModel item in feastModel.setmealData) {
|
|
|
|
182
|
+ // Setmeal setmeal = Setmeal();
|
|
|
|
183
|
+ // setmeal.setmealId = item.id;
|
|
|
|
184
|
+ // setmeal.name = item.mealName;
|
|
|
|
185
|
+ // setmeal.bargaining = item.bargaining;
|
|
|
|
186
|
+ // setmeal.finalPriceC = TextEditingController();
|
|
|
|
187
|
+ // setmeal.minC = TextEditingController();
|
|
|
|
188
|
+ // setmeal.pnumC = TextEditingController();
|
|
|
|
189
|
+ // setmeal.spareC = TextEditingController();
|
|
|
|
190
|
+
|
|
|
|
191
|
+ // if (setmealids.contains(item.id)) {
|
|
|
|
192
|
+ // setmeal.select = true;
|
|
|
|
193
|
+ // int index = userModel.justSelData
|
|
|
|
194
|
+ // .indexWhere((element) => element.setmealId == item.id);
|
|
|
|
195
|
+ // Setmeal widgetData = userModel.justSelData[index];
|
|
|
|
196
|
+ // setmeal.finalPriceC.text = widgetData.finalPrice;
|
|
|
|
197
|
+ // setmeal.minC.text = widgetData.min;
|
|
|
|
198
|
+ // setmeal.pnumC.text = widgetData.pnum;
|
|
|
|
199
|
+ // setmeal.spareC.text = widgetData.spare;
|
|
|
|
200
|
+ // setmeal.dataMenu = widgetData.dataMenu;
|
|
|
|
201
|
+ // } else {
|
|
|
|
202
|
+ // setmeal.select = false;
|
|
|
|
203
|
+ // }
|
|
|
|
204
|
+
|
|
|
|
205
|
+ // setmeal.price = item.price;
|
|
|
|
206
|
+ // setmealData.add(setmeal);
|
|
|
|
207
|
+ // }
|
|
|
|
208
|
+ // setState(() {});
|
|
|
|
209
|
+ // }
|
|
|
|
210
|
+ // }
|
|
|
|
211
|
+
|
|
|
|
212
|
+ /// 根据ID获取宴会套餐
|
|
|
|
213
|
+ Future<bool> _getSetmeal({bool isShowLoading = true}) async {
|
|
|
|
214
|
+ await feastModel.getSetmeal(context, isShowLoading: isShowLoading);
|
|
|
|
215
|
+ // if (success) {
|
|
|
|
216
|
+
|
|
|
|
217
|
+ // for ( item in feastModel.setmealData.) {
|
|
|
|
218
|
+ // // Map<String, List<CookByIdSetmeal>> map = {};
|
|
|
|
219
|
+ // String cid = item.id;
|
|
|
|
220
|
+ // String className = item.className;
|
|
|
|
221
|
+
|
|
|
|
222
|
+ // List<CookByIdSetmeal> temp = [];
|
|
|
|
223
|
+ // for (CookByIdSetmeal itemCook in feastModel.setmealDetail.cook) {
|
|
|
|
224
|
+ // if (cid == itemCook.cid) {
|
|
|
|
225
|
+ // temp.add(itemCook);
|
|
|
|
226
|
+ // }
|
|
|
|
227
|
+ // }
|
|
|
|
228
|
+ // // classNames.add(className);
|
|
|
|
229
|
+ // dataMenu[className] = temp;
|
|
|
|
230
|
+ // }
|
|
|
|
231
|
+ // }
|
|
|
|
232
|
+
|
|
|
|
233
|
+ // }
|
|
|
|
234
|
+ }
|
|
|
|
235
|
+
|
|
156
|
///称谓
|
236
|
///称谓
|
|
157
|
initSexList() {
|
237
|
initSexList() {
|
|
158
|
String sexStr = '1';
|
238
|
String sexStr = '1';
|
|
@@ -552,6 +632,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -552,6 +632,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
552
|
return ymd;
|
632
|
return ymd;
|
|
553
|
}
|
633
|
}
|
|
554
|
|
634
|
|
|
|
|
635
|
+ ///意向保存接口
|
|
555
|
Future<bool> yxSave() async {
|
636
|
Future<bool> yxSave() async {
|
|
556
|
if (dateTimeShow == '请选择') {
|
637
|
if (dateTimeShow == '请选择') {
|
|
557
|
Utils.showToast('请选择宴会日期');
|
638
|
Utils.showToast('请选择宴会日期');
|
|
@@ -601,15 +682,19 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -601,15 +682,19 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
601
|
'rname': nameC.text,
|
682
|
'rname': nameC.text,
|
|
602
|
'sex': sexList[sexSelectIndex]['code'],
|
683
|
'sex': sexList[sexSelectIndex]['code'],
|
|
603
|
};
|
684
|
};
|
|
604
|
- if (customC.text.trim().length > 0) {
|
|
|
|
605
|
- pramas['remark'] = customC.text; //备注
|
|
|
|
606
|
- }
|
|
|
|
607
|
- if (imageQiniuUrlList.length > 0) {
|
|
|
|
608
|
- pramas['images'] = json.encode(imageQiniuUrlList); //备注图片
|
685
|
+ // if (customC.text.trim().length > 0) {
|
|
|
|
686
|
+ pramas['remark'] = customC.text; //备注
|
|
|
|
687
|
+ // }
|
|
|
|
688
|
+ // if (imageQiniuUrlList.length > 0) {
|
|
|
|
689
|
+ pramas['images'] = json.encode(imageQiniuUrlList); //备注图片
|
|
|
|
690
|
+ // }
|
|
|
|
691
|
+ if (feastModel.rid != null) {
|
|
|
|
692
|
+ pramas['id'] = feastModel.rid;
|
|
609
|
}
|
693
|
}
|
|
610
|
bool success = await feastModel.createBanquet(context, pramas);
|
694
|
bool success = await feastModel.createBanquet(context, pramas);
|
|
611
|
if (success) {
|
695
|
if (success) {
|
|
612
|
Utils.showToast('保存成功');
|
696
|
Utils.showToast('保存成功');
|
|
|
|
697
|
+
|
|
613
|
return true;
|
698
|
return true;
|
|
614
|
} else {
|
699
|
} else {
|
|
615
|
return false;
|
700
|
return false;
|
|
@@ -750,6 +835,198 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -750,6 +835,198 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
750
|
);
|
835
|
);
|
|
751
|
}
|
836
|
}
|
|
752
|
|
837
|
|
|
|
|
838
|
+ //获取一天开始-结束时间字符串
|
|
|
|
839
|
+ String _getRdate(DateTime date) {
|
|
|
|
840
|
+ String keys = '';
|
|
|
|
841
|
+
|
|
|
|
842
|
+ String ymd = DateUtil.formatDate(date, format: DateFormats.y_mo_d);
|
|
|
|
843
|
+ String timeStrStart = '';
|
|
|
|
844
|
+ String timeStrEnd = '';
|
|
|
|
845
|
+ //一天开始时间
|
|
|
|
846
|
+ double startDay;
|
|
|
|
847
|
+ //一天结束时间
|
|
|
|
848
|
+ double endDay;
|
|
|
|
849
|
+ if (xuantaiData[xuantaiSelIndex].qsDateShow != '暂未选择') {
|
|
|
|
850
|
+ timeStrStart = ymd + ' ' + xuantaiData[xuantaiSelIndex].startDate + ':00';
|
|
|
|
851
|
+ timeStrEnd = ymd + ' ' + xuantaiData[xuantaiSelIndex].endDate + ':00';
|
|
|
|
852
|
+ } else {
|
|
|
|
853
|
+ timeStrStart = date.year.toString() +
|
|
|
|
854
|
+ "-" +
|
|
|
|
855
|
+ Utils.addZeroNumber(date.month) +
|
|
|
|
856
|
+ "-" +
|
|
|
|
857
|
+ Utils.addZeroNumber(date.day) +
|
|
|
|
858
|
+ " 00:00:00";
|
|
|
|
859
|
+ timeStrEnd = date.year.toString() +
|
|
|
|
860
|
+ "-" +
|
|
|
|
861
|
+ Utils.addZeroNumber(date.month) +
|
|
|
|
862
|
+ "-" +
|
|
|
|
863
|
+ Utils.addZeroNumber(date.day) +
|
|
|
|
864
|
+ " 23:59:59";
|
|
|
|
865
|
+ }
|
|
|
|
866
|
+ startDay = (DateTime.parse(timeStrStart).millisecondsSinceEpoch) / 1000;
|
|
|
|
867
|
+ endDay = (DateTime.parse(timeStrEnd).millisecondsSinceEpoch) / 1000;
|
|
|
|
868
|
+ return startDay.floor().toString() + "-" + endDay.floor().toString();
|
|
|
|
869
|
+ }
|
|
|
|
870
|
+
|
|
|
|
871
|
+ /// 选台保存接口
|
|
|
|
872
|
+ Future<bool> xtSave() async {
|
|
|
|
873
|
+ //判断非空选项,并弹窗提醒用户填写信息
|
|
|
|
874
|
+ // xuantaiData 多场次数据
|
|
|
|
875
|
+ bool canRequest = false;
|
|
|
|
876
|
+ xuantaiData.forEach((element) {
|
|
|
|
877
|
+ String reserveOrder = element.reserveOrder;
|
|
|
|
878
|
+ if (element.dateTimeShowxt == '请选择') {
|
|
|
|
879
|
+ Utils.showToast('请选择${reserveOrder}宴会日期');
|
|
|
|
880
|
+ return false;
|
|
|
|
881
|
+ }
|
|
|
|
882
|
+ if (element.cdShow == '请选择') {
|
|
|
|
883
|
+ Utils.showToast('请选择${reserveOrder}餐段');
|
|
|
|
884
|
+ return false;
|
|
|
|
885
|
+ }
|
|
|
|
886
|
+ if (element.tids.length == 0) {
|
|
|
|
887
|
+ Utils.showToast('请选择${reserveOrder}桌位');
|
|
|
|
888
|
+ return false;
|
|
|
|
889
|
+ }
|
|
|
|
890
|
+ for (UploadImgModel item in element.feastRemarkXtImageList) {
|
|
|
|
891
|
+ if (item.process < 1) {
|
|
|
|
892
|
+ Utils.showToast('正在上传${reserveOrder}图片,请稍等');
|
|
|
|
893
|
+ return false;
|
|
|
|
894
|
+ }
|
|
|
|
895
|
+ }
|
|
|
|
896
|
+ canRequest = true;
|
|
|
|
897
|
+ });
|
|
|
|
898
|
+ if (!canRequest) {
|
|
|
|
899
|
+ return false;
|
|
|
|
900
|
+ } else {
|
|
|
|
901
|
+ ///组装请求数据
|
|
|
|
902
|
+ List dataRequest = []; //请求数据
|
|
|
|
903
|
+ xuantaiData.forEach((element) {
|
|
|
|
904
|
+ Map map = {};
|
|
|
|
905
|
+ map['rid'] = feastModel.rid;
|
|
|
|
906
|
+ if (element.reserveId != null) {
|
|
|
|
907
|
+ map['id'] = element.reserveId;
|
|
|
|
908
|
+ }
|
|
|
|
909
|
+ map['reserve_order'] = element.reserveOrder;
|
|
|
|
910
|
+ map['ddate_interval'] = element.cdCode;
|
|
|
|
911
|
+ map['rdate'] = _getRdate(element.dateTimext);
|
|
|
|
912
|
+ List tids = [];
|
|
|
|
913
|
+ for (Tids item in element.tids) {
|
|
|
|
914
|
+ Map mapTids = {'tid': item.tid, 'num': item.numStr};
|
|
|
|
915
|
+ tids.add(mapTids);
|
|
|
|
916
|
+ }
|
|
|
|
917
|
+ map['tids'] = tids; //桌位数据
|
|
|
|
918
|
+
|
|
|
|
919
|
+ //套餐数据
|
|
|
|
920
|
+ // if (xuantaiData[xuantaiSelIndex].setmeal.length > 0) {
|
|
|
|
921
|
+ //选择了套餐数据
|
|
|
|
922
|
+ //组装
|
|
|
|
923
|
+ List setmeal = [];
|
|
|
|
924
|
+ element.setmeal.forEach((mealValue) {
|
|
|
|
925
|
+ Map mapMeal = {
|
|
|
|
926
|
+ 'setmeal_id': mealValue.setmealId,
|
|
|
|
927
|
+ 'price': mealValue.price,
|
|
|
|
928
|
+ 'final_price': mealValue.finalPrice,
|
|
|
|
929
|
+ 'pnum': mealValue.pnum,
|
|
|
|
930
|
+ 'min': mealValue.min,
|
|
|
|
931
|
+ 'spare': mealValue.spare,
|
|
|
|
932
|
+ };
|
|
|
|
933
|
+ List cooklist = []; //菜单数据
|
|
|
|
934
|
+ if (mealValue.dataMenu != null && mealValue.dataMenu.length > 0) {
|
|
|
|
935
|
+ //修改过菜单的数据
|
|
|
|
936
|
+
|
|
|
|
937
|
+ mealValue.dataMenu.forEach((key, value) {
|
|
|
|
938
|
+ value.forEach((element) {
|
|
|
|
939
|
+ Map mapMenu = {'cname': element.cname};
|
|
|
|
940
|
+ cooklist.add(mapMenu);
|
|
|
|
941
|
+ });
|
|
|
|
942
|
+ });
|
|
|
|
943
|
+ } else {
|
|
|
|
944
|
+ // 套餐菜单原数据
|
|
|
|
945
|
+ feastModel.setmealData.forEach((element) {
|
|
|
|
946
|
+ if (element.id == mealValue.setmealId) {
|
|
|
|
947
|
+ //找到当前套餐map
|
|
|
|
948
|
+ element.cook.forEach((element) {
|
|
|
|
949
|
+ Map mapMenu = {'cname': element.cname};
|
|
|
|
950
|
+ cooklist.add(mapMenu);
|
|
|
|
951
|
+ });
|
|
|
|
952
|
+ }
|
|
|
|
953
|
+ });
|
|
|
|
954
|
+ }
|
|
|
|
955
|
+
|
|
|
|
956
|
+ mapMeal['cooklist'] = cooklist; //菜单
|
|
|
|
957
|
+ setmeal.add(mapMeal);
|
|
|
|
958
|
+ });
|
|
|
|
959
|
+
|
|
|
|
960
|
+ map['setmeal'] = setmeal; //桌位数据
|
|
|
|
961
|
+
|
|
|
|
962
|
+ // }
|
|
|
|
963
|
+
|
|
|
|
964
|
+ //酒水
|
|
|
|
965
|
+ // if (xuantaiData[xuantaiSelIndex].wine.length > 0) {
|
|
|
|
966
|
+ List wines = [];
|
|
|
|
967
|
+ element.wine.forEach((element) {
|
|
|
|
968
|
+ Map mapWine = {
|
|
|
|
969
|
+ 'wine_id': element.wineId,
|
|
|
|
970
|
+ 'price': element.price,
|
|
|
|
971
|
+ 'final_price': element.finalPrice,
|
|
|
|
972
|
+ 'num': element.numStr
|
|
|
|
973
|
+ };
|
|
|
|
974
|
+ wines.add(mapWine);
|
|
|
|
975
|
+ });
|
|
|
|
976
|
+ map['wine'] = wines; //酒水数据
|
|
|
|
977
|
+ // }
|
|
|
|
978
|
+ //其他配置
|
|
|
|
979
|
+ // if (xuantaiData[xuantaiSelIndex].other.length > 0) {
|
|
|
|
980
|
+ List others = [];
|
|
|
|
981
|
+ element.other.forEach((element) {
|
|
|
|
982
|
+ Map mapOther = {
|
|
|
|
983
|
+ 'other_id': element.otherId,
|
|
|
|
984
|
+ 'price': element.price,
|
|
|
|
985
|
+ 'final_price': element.finalPrice,
|
|
|
|
986
|
+ 'num': element.numStr
|
|
|
|
987
|
+ };
|
|
|
|
988
|
+ others.add(mapOther);
|
|
|
|
989
|
+ });
|
|
|
|
990
|
+ map['other'] = others; //其他配置数据
|
|
|
|
991
|
+ // }
|
|
|
|
992
|
+ // 备注
|
|
|
|
993
|
+ // if (element.customCxt.text != null) {
|
|
|
|
994
|
+ map['remark'] = element.remark; //备注数据
|
|
|
|
995
|
+ // }
|
|
|
|
996
|
+ // 图片
|
|
|
|
997
|
+ List imageQiniuUrlList = []; //接口图片数据list
|
|
|
|
998
|
+ for (int i = 0; i < element.feastRemarkXtImageList.length; i++) {
|
|
|
|
999
|
+ imageQiniuUrlList
|
|
|
|
1000
|
+ .add({"url": element.feastRemarkXtImageList[i].qiniuUrl});
|
|
|
|
1001
|
+ }
|
|
|
|
1002
|
+ // if (imageQiniuUrlList.length > 0) {
|
|
|
|
1003
|
+ map['images'] = imageQiniuUrlList; //图片数据
|
|
|
|
1004
|
+ // }
|
|
|
|
1005
|
+ dataRequest.add(map);
|
|
|
|
1006
|
+ });
|
|
|
|
1007
|
+
|
|
|
|
1008
|
+ Map<String, String> pramas = {'data': json.encode(dataRequest)};
|
|
|
|
1009
|
+
|
|
|
|
1010
|
+ bool success = await feastModel.setBanquetInfo(context, pramas);
|
|
|
|
1011
|
+ if (success) {
|
|
|
|
1012
|
+ feastModel.sessionsSunModelList.forEach((element) {
|
|
|
|
1013
|
+ //把对应场次的ID赋值给本地数据
|
|
|
|
1014
|
+ xuantaiData.forEach((item) {
|
|
|
|
1015
|
+ if (item.reserveOrder == element.reserveOrder) {
|
|
|
|
1016
|
+ //根据“第一场、第二场。。。”找到当前场次的对应数据
|
|
|
|
1017
|
+ item.reserveId = element.id;
|
|
|
|
1018
|
+ }
|
|
|
|
1019
|
+ });
|
|
|
|
1020
|
+ });
|
|
|
|
1021
|
+ print(xuantaiData);
|
|
|
|
1022
|
+ Utils.showToast('保存成功');
|
|
|
|
1023
|
+ return true;
|
|
|
|
1024
|
+ } else {
|
|
|
|
1025
|
+ return false;
|
|
|
|
1026
|
+ }
|
|
|
|
1027
|
+ }
|
|
|
|
1028
|
+ }
|
|
|
|
1029
|
+
|
|
753
|
///选台
|
1030
|
///选台
|
|
754
|
Widget xtWidget() {
|
1031
|
Widget xtWidget() {
|
|
755
|
return Column(
|
1032
|
return Column(
|
|
@@ -798,7 +1075,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -798,7 +1075,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
798
|
// }
|
1075
|
// }
|
|
799
|
// });
|
1076
|
// });
|
|
800
|
xuantaiSelIndex = index;
|
1077
|
xuantaiSelIndex = index;
|
|
801
|
- xuantaiData.add(initSetXuanTaiModel());
|
1078
|
+ xuantaiData.add(
|
|
|
|
1079
|
+ initSetXuanTaiModel(index: index));
|
|
802
|
setState(() {});
|
1080
|
setState(() {});
|
|
803
|
},
|
1081
|
},
|
|
804
|
child: DottedBorder(
|
1082
|
child: DottedBorder(
|
|
@@ -837,6 +1115,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -837,6 +1115,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
837
|
String numStr =
|
1115
|
String numStr =
|
|
838
|
ConvertNumberToChineseMoneyWords.toChinese(
|
1116
|
ConvertNumberToChineseMoneyWords.toChinese(
|
|
839
|
index);
|
1117
|
index);
|
|
|
|
1118
|
+ xuantaiData[index].reserveOrder = '第${numStr}场';
|
|
840
|
return InkWell(
|
1119
|
return InkWell(
|
|
841
|
onTap: () {
|
1120
|
onTap: () {
|
|
842
|
setState(() {
|
1121
|
setState(() {
|
|
@@ -889,7 +1168,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -889,7 +1168,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
889
|
gradientEnd: MyColours.color_E34D59,
|
1168
|
gradientEnd: MyColours.color_E34D59,
|
|
890
|
onPressed: () async {
|
1169
|
onPressed: () async {
|
|
891
|
xuantaiData.removeAt(xuantaiSelIndex);
|
1170
|
xuantaiData.removeAt(xuantaiSelIndex);
|
|
892
|
- xuantaiSelIndex--;
|
1171
|
+
|
|
|
|
1172
|
+ xuantaiSelIndex--; //删除后,选中前一个
|
|
|
|
1173
|
+
|
|
893
|
setState(() {});
|
1174
|
setState(() {});
|
|
894
|
}))
|
1175
|
}))
|
|
895
|
: SizedBox(),
|
1176
|
: SizedBox(),
|
|
@@ -927,6 +1208,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -927,6 +1208,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
927
|
xuantaiData[xuantaiSelIndex].cdShow = dsoltList[
|
1208
|
xuantaiData[xuantaiSelIndex].cdShow = dsoltList[
|
|
928
|
xuantaiData[xuantaiSelIndex].cdSelIndex]
|
1209
|
xuantaiData[xuantaiSelIndex].cdSelIndex]
|
|
929
|
.title;
|
1210
|
.title;
|
|
|
|
1211
|
+ xuantaiData[xuantaiSelIndex].cdCode = dsoltList[
|
|
|
|
1212
|
+ xuantaiData[xuantaiSelIndex].cdSelIndex]
|
|
|
|
1213
|
+ .id;
|
|
930
|
});
|
1214
|
});
|
|
931
|
}
|
1215
|
}
|
|
932
|
},
|
1216
|
},
|
|
@@ -1213,7 +1497,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1213,7 +1497,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1213
|
.tableList) {
|
1497
|
.tableList) {
|
|
1214
|
item.selected = true;
|
1498
|
item.selected = true;
|
|
1215
|
Tids tids = Tids();
|
1499
|
Tids tids = Tids();
|
|
1216
|
- tids.tid = item.tid;
|
1500
|
+ tids.tid = item.id;
|
|
1217
|
tids.name = item.name;
|
1501
|
tids.name = item.name;
|
|
1218
|
xuantaiData[xuantaiSelIndex]
|
1502
|
xuantaiData[xuantaiSelIndex]
|
|
1219
|
.tids
|
1503
|
.tids
|
|
@@ -1277,7 +1561,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1277,7 +1561,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1277
|
.tableList) {
|
1561
|
.tableList) {
|
|
1278
|
item.selected = true;
|
1562
|
item.selected = true;
|
|
1279
|
Tids tids = Tids();
|
1563
|
Tids tids = Tids();
|
|
1280
|
- tids.tid = item.tid;
|
1564
|
+ tids.tid = item.id;
|
|
1281
|
tids.name = item.name;
|
1565
|
tids.name = item.name;
|
|
1282
|
xuantaiData[xuantaiSelIndex]
|
1566
|
xuantaiData[xuantaiSelIndex]
|
|
1283
|
.tids
|
1567
|
.tids
|
|
@@ -1744,7 +2028,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1744,7 +2028,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1744
|
),
|
2028
|
),
|
|
1745
|
],
|
2029
|
],
|
|
1746
|
)),
|
2030
|
)),
|
|
1747
|
- remark(customCxt, customFxt),
|
2031
|
+ remark(xuantaiData[xuantaiSelIndex].customCxt,
|
|
|
|
2032
|
+ xuantaiData[xuantaiSelIndex].customFxt),
|
|
1748
|
Padding(
|
2033
|
Padding(
|
|
1749
|
padding: EdgeInsets.fromLTRB(
|
2034
|
padding: EdgeInsets.fromLTRB(
|
|
1750
|
ScreenUtil().setWidth(32),
|
2035
|
ScreenUtil().setWidth(32),
|
|
@@ -1763,6 +2048,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1763,6 +2048,8 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1763
|
maxImageNumber: 8,
|
2048
|
maxImageNumber: 8,
|
|
1764
|
mainAxisSpacing: 72,
|
2049
|
mainAxisSpacing: 72,
|
|
1765
|
crossAxisSpacing: 56,
|
2050
|
crossAxisSpacing: 56,
|
|
|
|
2051
|
+ feastRemarkXtImageList: xuantaiData[xuantaiSelIndex]
|
|
|
|
2052
|
+ .feastRemarkXtImageList,
|
|
1766
|
);
|
2053
|
);
|
|
1767
|
}),
|
2054
|
}),
|
|
1768
|
),
|
2055
|
),
|
|
@@ -1772,19 +2059,23 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
@@ -1772,19 +2059,23 @@ class _FeastCreatePageState extends State<FeastCreatePage> { |
|
1772
|
children: [
|
2059
|
children: [
|
|
1773
|
Expanded(
|
2060
|
Expanded(
|
|
1774
|
child: _callButton(
|
2061
|
child: _callButton(
|
|
1775
|
- onPress: () {
|
2062
|
+ onPress: () async {
|
|
1776
|
// setBanquetInfo
|
2063
|
// setBanquetInfo
|
|
|
|
2064
|
+ await xtSave();
|
|
1777
|
},
|
2065
|
},
|
|
1778
|
content: '仅保存',
|
2066
|
content: '仅保存',
|
|
1779
|
hasLeftBorder: true,
|
2067
|
hasLeftBorder: true,
|
|
1780
|
isSelect: false)),
|
2068
|
isSelect: false)),
|
|
1781
|
Expanded(
|
2069
|
Expanded(
|
|
1782
|
child: _callButton(
|
2070
|
child: _callButton(
|
|
1783
|
- onPress: () {
|
|
|
|
1784
|
- selectMenu = '定金';
|
|
|
|
1785
|
- menuSet.add('选台');
|
|
|
|
1786
|
- menuSet.add('定金');
|
|
|
|
1787
|
- setState(() {});
|
2071
|
+ onPress: () async {
|
|
|
|
2072
|
+ bool success = await xtSave();
|
|
|
|
2073
|
+ if (success) {
|
|
|
|
2074
|
+ selectMenu = '定金';
|
|
|
|
2075
|
+ menuSet.add('选台');
|
|
|
|
2076
|
+ menuSet.add('定金');
|
|
|
|
2077
|
+ setState(() {});
|
|
|
|
2078
|
+ }
|
|
1788
|
},
|
2079
|
},
|
|
1789
|
content: '保存并下一步',
|
2080
|
content: '保存并下一步',
|
|
1790
|
hasLeftBorder: true,
|
2081
|
hasLeftBorder: true,
|