Commit dc220a6831e8b60c382491e6f3c3f2d896cd293c

Authored by wdn127929
1 parent db8ac2c7

修复客情创建预订guest信息可变更

@@ -14,41 +14,41 @@ if (flutterRoot == null) { @@ -14,41 +14,41 @@ if (flutterRoot == null) {
14 14
15 15
16 16
17 -def flutterVersionCode = "100"  
18 -if (flutterVersionCode == null) {  
19 - flutterVersionCode = '100' 17 +// def flutterVersionCode = "100"
  18 +// if (flutterVersionCode == null) {
  19 +// flutterVersionCode = '100'
20 20
21 21
22 -} 22 +// }
23 23
24 24
25 25
26 26
27 27
28 -def flutterVersionName = "1.0.1"  
29 -if (flutterVersionName == null) {  
30 - flutterVersionName = '1.0.1' 28 +// def flutterVersionName = "1.0.0"
  29 +// if (flutterVersionName == null) {
  30 +// flutterVersionName = '1.0.0'
31 31
32 -} 32 +// }
33 33
34 34
35 35
36 -// def flutterVersionCode = "501"  
37 -// if (flutterVersionCode == null) {  
38 -// flutterVersionCode = '501' 36 +def flutterVersionCode = "501"
  37 +if (flutterVersionCode == null) {
  38 + flutterVersionCode = '501'
39 39
40 40
41 -// } 41 +}
42 42
43 43
44 44
45 45
46 46
47 -// def flutterVersionName = "5.0.1"  
48 -// if (flutterVersionName == null) {  
49 -// flutterVersionName = '5.0.1' 47 +def flutterVersionName = "5.0.1"
  48 +if (flutterVersionName == null) {
  49 + flutterVersionName = '5.0.1'
50 50
51 -// } 51 +}
52 52
53 53
54 54
@@ -109,7 +109,7 @@ class Guest extends Object { @@ -109,7 +109,7 @@ class Guest extends Object {
109 } 109 }
110 110
111 String get sexStr { 111 String get sexStr {
112 - if (sex == null || sex == '') return ""; 112 + if (sex == null || sex == '' ||sex == '0') return "先生";
113 switch (sex.toString()) { 113 switch (sex.toString()) {
114 case "1": //先生 114 case "1": //先生
115 case "男": 115 case "男":
@@ -1410,7 +1410,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -1410,7 +1410,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
1410 Provider.of<UserModel>(context, 1410 Provider.of<UserModel>(context,
1411 listen: false); 1411 listen: false);
1412 if (usermodel.downLoading) { 1412 if (usermodel.downLoading) {
1413 - Utils.showToast("正在后台下载,请您耐心等待..."); 1413 + Utils.showToast("正在后台下载新版本…");
1414 return; 1414 return;
1415 } 1415 }
1416 if (newVersion) { 1416 if (newVersion) {
@@ -180,6 +180,20 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -180,6 +180,20 @@ class TableManagerPageState extends State<TableManagerPage> {
180 ///刷新优惠券 180 ///刷新优惠券
181 _couponNetworkData(); 181 _couponNetworkData();
182 }); 182 });
  183 + if (widget.guest != null) {
  184 + for (var item in _baseIndoProvider.sexList) {
  185 + item['select'] = false;
  186 + if (item['title'] == widget.guest.sexStr) {
  187 + item['select'] = true;
  188 + sexSelectIndex = int.parse(item['code']) - 1;
  189 + sexStr = widget.guest.sexStr;
  190 + }
  191 + }
  192 + _baseIndoProvider.phoneController.text = widget.guest.phone; //预订人电话
  193 + nameStr = widget.guest.rname;
  194 + // _homeEnterModel.nameController.text = fullName + _nameSuffix();
  195 + _addNameSuffix(nameStr, sexStr);
  196 + }
183 }); 197 });
184 } 198 }
185 199
@@ -2407,24 +2421,25 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -2407,24 +2421,25 @@ class TableManagerPageState extends State<TableManagerPage> {
2407 null, 2421 null,
2408 null, 2422 null,
2409 null); 2423 null);
2410 - if (widget.guest == null) {  
2411 - guest.phone = _baseIndoProvider  
2412 - .phoneController.text  
2413 - .replaceAll(' ', ''); //预订人电话  
2414 -  
2415 - if (nameStr != null &&  
2416 - nameStr.trim().length > 0) {  
2417 - String sex = '1';  
2418 - if (sexStr == '女士') {  
2419 - sex = '2';  
2420 - } else if (sexStr == '公司') {  
2421 - sex = '3';  
2422 - }  
2423 - guest.rname = nameStr; //预订人姓名  
2424 - guest.sex = sex; //预订人性别:1:男 2:女  
2425 - 2424 + // if (widget.guest == null) {
  2425 +
  2426 + guest.phone = _baseIndoProvider
  2427 + .phoneController.text
  2428 + .replaceAll(' ', ''); //预订人电话
  2429 +
  2430 + if (nameStr != null &&
  2431 + nameStr.trim().length > 0) {
  2432 + String sex = '1';
  2433 + if (sexStr == '女士') {
  2434 + sex = '2';
  2435 + } else if (sexStr == '公司') {
  2436 + sex = '3';
2426 } 2437 }
  2438 + guest.rname = nameStr; //预订人姓名
  2439 + guest.sex = sex; //预订人性别:1:男 2:女
  2440 +
2427 } 2441 }
  2442 + // }
2428 String pnum; 2443 String pnum;
2429 if (pnumController.text != '') { 2444 if (pnumController.text != '') {
2430 pnum = pnumController.text; 2445 pnum = pnumController.text;
@@ -2441,9 +2456,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -2441,9 +2456,7 @@ class TableManagerPageState extends State<TableManagerPage> {
2441 cusdem: cusdem, 2456 cusdem: cusdem,
2442 tempTime: 2457 tempTime:
2443 ddateHm == '选填' ? null : ddateHm, 2458 ddateHm == '选填' ? null : ddateHm,
2444 - guest: widget.guest == null  
2445 - ? guest  
2446 - : widget.guest); 2459 + guest: guest);
2447 if (_model != null && 2460 if (_model != null &&
2448 ObjectUtil.isNotEmpty(_model.row) && 2461 ObjectUtil.isNotEmpty(_model.row) &&
2449 ObjectUtil.isNotEmpty(_model.row.id)) { 2462 ObjectUtil.isNotEmpty(_model.row.id)) {