Showing
10 changed files
with
766 additions
and
85 deletions
| 1 | import 'dart:convert' as convert; | 1 | import 'dart:convert' as convert; |
| 2 | 2 | ||
| 3 | import 'package:flutter/material.dart'; | 3 | import 'package:flutter/material.dart'; |
| 4 | +import 'package:one_key/models/set_xuan_tai_model.dart'; | ||
| 5 | +import 'package:one_key/models/upload_img_model.dart'; | ||
| 4 | import 'package:one_key/utils/ConvertNumberToChineseMoneyWords.dart'; | 6 | import 'package:one_key/utils/ConvertNumberToChineseMoneyWords.dart'; |
| 7 | +import 'package:one_key/models/table_list.dart' as t; | ||
| 5 | 8 | ||
| 6 | class GetBanquetByIdNewModel { | 9 | class GetBanquetByIdNewModel { |
| 7 | int ret; | 10 | int ret; |
| @@ -71,7 +74,8 @@ class GetBanquetByIdNewSunModel { | @@ -71,7 +74,8 @@ class GetBanquetByIdNewSunModel { | ||
| 71 | costInfo = <CostInfoModel>[]; | 74 | costInfo = <CostInfoModel>[]; |
| 72 | if (json['cost_info'] != null && json['cost_info'].length > 0) { | 75 | if (json['cost_info'] != null && json['cost_info'].length > 0) { |
| 73 | double totalP = 0.0; | 76 | double totalP = 0.0; |
| 74 | - json['cost_info'].forEach((key, v) { | 77 | + Map map = json['cost_info']; |
| 78 | + map.forEach((key, v) { | ||
| 75 | CostInfoModel model = CostInfoModel.fromJson(v); | 79 | CostInfoModel model = CostInfoModel.fromJson(v); |
| 76 | model.title = '${key}费用'; | 80 | model.title = '${key}费用'; |
| 77 | int start = key.indexOf('第'); | 81 | int start = key.indexOf('第'); |
| @@ -86,7 +90,7 @@ class GetBanquetByIdNewSunModel { | @@ -86,7 +90,7 @@ class GetBanquetByIdNewSunModel { | ||
| 86 | model.servicetype = info.servicetype; | 90 | model.servicetype = info.servicetype; |
| 87 | model.serviceper = info.serviceper; | 91 | model.serviceper = info.serviceper; |
| 88 | model.serviceprice = info.serviceprice; | 92 | model.serviceprice = info.serviceprice; |
| 89 | - model.totalPrice = info.totalprice; | 93 | + model.totalprice = info.totalprice; |
| 90 | model.service = info.servicetype == '1' ? true : false; | 94 | model.service = info.servicetype == '1' ? true : false; |
| 91 | model.discount = info.discounttype == '1' ? true : false; | 95 | model.discount = info.discounttype == '1' ? true : false; |
| 92 | costInfo.add(model); | 96 | costInfo.add(model); |
| @@ -129,7 +133,10 @@ class BasicInfo { | @@ -129,7 +133,10 @@ class BasicInfo { | ||
| 129 | Jiedan jiedan; | 133 | Jiedan jiedan; |
| 130 | Jiedan staff; | 134 | Jiedan staff; |
| 131 | String classify; | 135 | String classify; |
| 132 | - List<ImagesById> images; | 136 | + List<Images> images; |
| 137 | + String warrantId; //担保人id | ||
| 138 | + List<Images> warrantImages; //担保图片 | ||
| 139 | + String warrantDesc; //担保说明 | ||
| 133 | 140 | ||
| 134 | BasicInfo( | 141 | BasicInfo( |
| 135 | {this.ddate, | 142 | {this.ddate, |
| @@ -140,7 +147,10 @@ class BasicInfo { | @@ -140,7 +147,10 @@ class BasicInfo { | ||
| 140 | this.jiedan, | 147 | this.jiedan, |
| 141 | this.staff, | 148 | this.staff, |
| 142 | this.classify, | 149 | this.classify, |
| 143 | - this.images}); | 150 | + this.images, |
| 151 | + this.warrantId, | ||
| 152 | + this.warrantImages, | ||
| 153 | + this.warrantDesc}); | ||
| 144 | 154 | ||
| 145 | BasicInfo.fromJson(Map<String, dynamic> json) { | 155 | BasicInfo.fromJson(Map<String, dynamic> json) { |
| 146 | ddate = json['ddate']; | 156 | ddate = json['ddate']; |
| @@ -153,17 +163,32 @@ class BasicInfo { | @@ -153,17 +163,32 @@ class BasicInfo { | ||
| 153 | staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null; | 163 | staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null; |
| 154 | classify = json['classify']; | 164 | classify = json['classify']; |
| 155 | if (json['images'] != null) { | 165 | if (json['images'] != null) { |
| 156 | - images = <ImagesById>[]; | 166 | + images = <Images>[]; |
| 157 | if (json['images'] is List) { | 167 | if (json['images'] is List) { |
| 158 | json['images'].forEach((v) { | 168 | json['images'].forEach((v) { |
| 159 | - images.add(new ImagesById.fromJson(v)); | 169 | + images.add(new Images.fromJson(v)); |
| 160 | }); | 170 | }); |
| 161 | } else { | 171 | } else { |
| 162 | convert.jsonDecode(json['images']).forEach((v) { | 172 | convert.jsonDecode(json['images']).forEach((v) { |
| 163 | - images.add(new ImagesById.fromJson(v)); | 173 | + images.add(new Images.fromJson(v)); |
| 174 | + }); | ||
| 175 | + } | ||
| 176 | + } | ||
| 177 | + warrantId = json['warrant_id']; | ||
| 178 | + | ||
| 179 | + if (json['warrant_images'] != null) { | ||
| 180 | + warrantImages = <Images>[]; | ||
| 181 | + if (json['warrant_images'] is List) { | ||
| 182 | + json['warrant_images'].forEach((v) { | ||
| 183 | + warrantImages.add(new Images.fromJson(v)); | ||
| 184 | + }); | ||
| 185 | + } else { | ||
| 186 | + convert.jsonDecode(json['warrant_images']).forEach((v) { | ||
| 187 | + warrantImages.add(new Images.fromJson(v)); | ||
| 164 | }); | 188 | }); |
| 165 | } | 189 | } |
| 166 | } | 190 | } |
| 191 | + warrantDesc = json['warrant_desc']; | ||
| 167 | } | 192 | } |
| 168 | 193 | ||
| 169 | Map<String, dynamic> toJson() { | 194 | Map<String, dynamic> toJson() { |
| @@ -212,7 +237,7 @@ class SessionsInfo { | @@ -212,7 +237,7 @@ class SessionsInfo { | ||
| 212 | List<WineDetail> wine; | 237 | List<WineDetail> wine; |
| 213 | List<OtherDetail> other; | 238 | List<OtherDetail> other; |
| 214 | String remark; | 239 | String remark; |
| 215 | - List<ImagesById> images; | 240 | + List<Images> images; |
| 216 | dynamic tableNum; | 241 | dynamic tableNum; |
| 217 | String servicetype; | 242 | String servicetype; |
| 218 | String serviceper; | 243 | String serviceper; |
| @@ -221,6 +246,57 @@ class SessionsInfo { | @@ -221,6 +246,57 @@ class SessionsInfo { | ||
| 221 | String discountper; | 246 | String discountper; |
| 222 | String discountprice; | 247 | String discountprice; |
| 223 | String totalprice; | 248 | String totalprice; |
| 249 | + String id; //场次ID | ||
| 250 | + String rid; //宴会ID | ||
| 251 | + String qrdate; //开始时间 | ||
| 252 | + String jedate; //结束时间 | ||
| 253 | + String ddateInterval; //餐段(0不代餐,1早餐,2午餐,3晚餐) | ||
| 254 | + String reserveOrder; //第一场、第二场 | ||
| 255 | + List<Tids> tids; // 桌位信息 | ||
| 256 | + List<Setmeal> setmeals; // 套餐信息 | ||
| 257 | + List<Wine> wines; // 酒水信息 | ||
| 258 | + List<Other> others; // 酒水信息 | ||
| 259 | + | ||
| 260 | + String get cdStr { | ||
| 261 | + switch (ddateInterval) { | ||
| 262 | + case '0': | ||
| 263 | + return '不带餐'; | ||
| 264 | + break; | ||
| 265 | + case '1': | ||
| 266 | + return '早餐'; | ||
| 267 | + break; | ||
| 268 | + case '2': | ||
| 269 | + return '午餐'; | ||
| 270 | + break; | ||
| 271 | + case '3': | ||
| 272 | + return '晚餐'; | ||
| 273 | + break; | ||
| 274 | + default: | ||
| 275 | + } | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + List<t.TableList> get tableList { | ||
| 279 | + List<t.TableList> tableList = []; | ||
| 280 | + tids.forEach((element) { | ||
| 281 | + t.TableList tmodel = t.TableList( | ||
| 282 | + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); | ||
| 283 | + tmodel.id = element.tid; | ||
| 284 | + tmodel.name = element.name; | ||
| 285 | + tableList.add(tmodel); | ||
| 286 | + }); | ||
| 287 | + return tableList; | ||
| 288 | + } | ||
| 289 | + | ||
| 290 | + List<UploadImgModel> get feastRemarkImages { | ||
| 291 | + List<UploadImgModel> upload = []; | ||
| 292 | + images.forEach((element) { | ||
| 293 | + UploadImgModel model = UploadImgModel(); | ||
| 294 | + model.process = 1; | ||
| 295 | + model.qiniuUrl = element.url; | ||
| 296 | + upload.add(model); | ||
| 297 | + }); | ||
| 298 | + return upload; | ||
| 299 | + } | ||
| 224 | 300 | ||
| 225 | SessionsInfo( | 301 | SessionsInfo( |
| 226 | {this.rdate, | 302 | {this.rdate, |
| @@ -237,7 +313,17 @@ class SessionsInfo { | @@ -237,7 +313,17 @@ class SessionsInfo { | ||
| 237 | this.discounttype, | 313 | this.discounttype, |
| 238 | this.discountper, | 314 | this.discountper, |
| 239 | this.discountprice, | 315 | this.discountprice, |
| 240 | - this.totalprice}); | 316 | + this.totalprice, |
| 317 | + this.id, | ||
| 318 | + this.rid, | ||
| 319 | + this.qrdate, | ||
| 320 | + this.jedate, | ||
| 321 | + this.ddateInterval, | ||
| 322 | + this.reserveOrder, | ||
| 323 | + this.tids, | ||
| 324 | + this.setmeals, | ||
| 325 | + this.wines, | ||
| 326 | + this.others}); | ||
| 241 | 327 | ||
| 242 | SessionsInfo.fromJson(Map<String, dynamic> json) { | 328 | SessionsInfo.fromJson(Map<String, dynamic> json) { |
| 243 | rdate = json['rdate']; | 329 | rdate = json['rdate']; |
| @@ -263,14 +349,14 @@ class SessionsInfo { | @@ -263,14 +349,14 @@ class SessionsInfo { | ||
| 263 | remark = json['remark']; | 349 | remark = json['remark']; |
| 264 | 350 | ||
| 265 | if (json['images'] != null) { | 351 | if (json['images'] != null) { |
| 266 | - images = <ImagesById>[]; | 352 | + images = <Images>[]; |
| 267 | if (json['images'] is List) { | 353 | if (json['images'] is List) { |
| 268 | json['images'].forEach((v) { | 354 | json['images'].forEach((v) { |
| 269 | - images.add(new ImagesById.fromJson(v)); | 355 | + images.add(new Images.fromJson(v)); |
| 270 | }); | 356 | }); |
| 271 | } else { | 357 | } else { |
| 272 | convert.jsonDecode(json['images']).forEach((v) { | 358 | convert.jsonDecode(json['images']).forEach((v) { |
| 273 | - images.add(new ImagesById.fromJson(v)); | 359 | + images.add(new Images.fromJson(v)); |
| 274 | }); | 360 | }); |
| 275 | } | 361 | } |
| 276 | } | 362 | } |
| @@ -283,6 +369,45 @@ class SessionsInfo { | @@ -283,6 +369,45 @@ class SessionsInfo { | ||
| 283 | discountper = json['discount_per']; | 369 | discountper = json['discount_per']; |
| 284 | discountprice = json['discount_price']; | 370 | discountprice = json['discount_price']; |
| 285 | totalprice = json['total_price']; | 371 | totalprice = json['total_price']; |
| 372 | + | ||
| 373 | + //解析session新加字段,下午做 | ||
| 374 | + id = json['id']; | ||
| 375 | + rid = json['rid']; | ||
| 376 | + qrdate = json['_rdate']; | ||
| 377 | + jedate = json['_edate']; | ||
| 378 | + ddateInterval = json['ddate_interval']; | ||
| 379 | + reserveOrder = json['reserve_order']; | ||
| 380 | + if (json['images'] != null) { | ||
| 381 | + images = <Images>[]; | ||
| 382 | + | ||
| 383 | + convert.jsonDecode(json['images']).forEach((v) { | ||
| 384 | + images.add(new Images.fromJson(v)); | ||
| 385 | + }); | ||
| 386 | + } | ||
| 387 | + if (json['tableData'] != null) { | ||
| 388 | + tids = <Tids>[]; | ||
| 389 | + convert.jsonDecode(json['tableData']).forEach((v) { | ||
| 390 | + tids.add(new Tids.fromJson(v)); | ||
| 391 | + }); | ||
| 392 | + } | ||
| 393 | + if (json['setmealData'] != null) { | ||
| 394 | + setmeals = <Setmeal>[]; | ||
| 395 | + convert.jsonDecode(json['setmealData']).forEach((v) { | ||
| 396 | + setmeals.add(new Setmeal.fromJson(v)); | ||
| 397 | + }); | ||
| 398 | + } | ||
| 399 | + if (json['wineData'] != null) { | ||
| 400 | + wines = <Wine>[]; | ||
| 401 | + convert.jsonDecode(json['wineData']).forEach((v) { | ||
| 402 | + wines.add(new Wine.fromJson(v)); | ||
| 403 | + }); | ||
| 404 | + } | ||
| 405 | + if (json['otherData'] != null) { | ||
| 406 | + others = <Other>[]; | ||
| 407 | + convert.jsonDecode(json['otherData']).forEach((v) { | ||
| 408 | + others.add(new Other.fromJson(v)); | ||
| 409 | + }); | ||
| 410 | + } | ||
| 286 | } | 411 | } |
| 287 | 412 | ||
| 288 | Map<String, dynamic> toJson() { | 413 | Map<String, dynamic> toJson() { |
| @@ -308,6 +433,25 @@ class SessionsInfo { | @@ -308,6 +433,25 @@ class SessionsInfo { | ||
| 308 | data['discount_per'] = this.discountper; | 433 | data['discount_per'] = this.discountper; |
| 309 | data['discount_price'] = this.discountprice; | 434 | data['discount_price'] = this.discountprice; |
| 310 | data['total_price'] = this.totalprice; | 435 | data['total_price'] = this.totalprice; |
| 436 | + data['id'] = this.id; | ||
| 437 | + data['rid'] = this.rid; | ||
| 438 | + data['_rdate'] = this.qrdate; | ||
| 439 | + data['_edate'] = this.jedate; | ||
| 440 | + data['ddate_interval'] = this.ddateInterval; | ||
| 441 | + data['reserve_order'] = this.reserveOrder; | ||
| 442 | + | ||
| 443 | + if (this.tids != null) { | ||
| 444 | + data['tableData'] = this.tids.map((v) => v.toJson()).toList(); | ||
| 445 | + } | ||
| 446 | + if (this.setmeals != null) { | ||
| 447 | + data['setmealData'] = this.setmeal.map((v) => v.toJson()).toList(); | ||
| 448 | + } | ||
| 449 | + if (this.wines != null) { | ||
| 450 | + data['wineData'] = this.wine.map((v) => v.toJson()).toList(); | ||
| 451 | + } | ||
| 452 | + if (this.others != null) { | ||
| 453 | + data['otherData'] = this.other.map((v) => v.toJson()).toList(); | ||
| 454 | + } | ||
| 311 | return data; | 455 | return data; |
| 312 | } | 456 | } |
| 313 | } | 457 | } |
| @@ -433,7 +577,7 @@ class CostInfoModel { | @@ -433,7 +577,7 @@ class CostInfoModel { | ||
| 433 | 577 | ||
| 434 | TextEditingController serviceC = TextEditingController(); | 578 | TextEditingController serviceC = TextEditingController(); |
| 435 | TextEditingController discountC = TextEditingController(); | 579 | TextEditingController discountC = TextEditingController(); |
| 436 | - String totalPrice; //合计 | 580 | + String totalPriceSelf; //合计 |
| 437 | String sumPrice; //优惠和服务费之前的金额 | 581 | String sumPrice; //优惠和服务费之前的金额 |
| 438 | String servicetype; | 582 | String servicetype; |
| 439 | String serviceper; | 583 | String serviceper; |
| @@ -441,7 +585,7 @@ class CostInfoModel { | @@ -441,7 +585,7 @@ class CostInfoModel { | ||
| 441 | String discounttype; | 585 | String discounttype; |
| 442 | String discountper; | 586 | String discountper; |
| 443 | String discountprice; | 587 | String discountprice; |
| 444 | - String totalprice; | 588 | + String totalprice; //接口获取到的值,在详情展示 |
| 445 | 589 | ||
| 446 | //详情用的服务费展示 | 590 | //详情用的服务费展示 |
| 447 | String get showService { | 591 | String get showService { |
| @@ -471,7 +615,7 @@ class CostInfoModel { | @@ -471,7 +615,7 @@ class CostInfoModel { | ||
| 471 | 615 | ||
| 472 | if (discount) { | 616 | if (discount) { |
| 473 | //选中固定金额 | 617 | //选中固定金额 |
| 474 | - return discountprice; | 618 | + return '-${discountprice} 元'; |
| 475 | } else { | 619 | } else { |
| 476 | //选中百分比 | 620 | //选中百分比 |
| 477 | 621 | ||
| @@ -492,7 +636,7 @@ class CostInfoModel { | @@ -492,7 +636,7 @@ class CostInfoModel { | ||
| 492 | data.add(sunModel); | 636 | data.add(sunModel); |
| 493 | }); | 637 | }); |
| 494 | sumPrice = price.toString(); | 638 | sumPrice = price.toString(); |
| 495 | - totalPrice = sumPrice; | 639 | + totalPriceSelf = sumPrice; |
| 496 | } | 640 | } |
| 497 | 641 | ||
| 498 | Map<String, dynamic> toJson() { | 642 | Map<String, dynamic> toJson() { |
| @@ -546,7 +690,7 @@ class ContractInfo { | @@ -546,7 +690,7 @@ class ContractInfo { | ||
| 546 | String contractRname; | 690 | String contractRname; |
| 547 | String contractSellerName; | 691 | String contractSellerName; |
| 548 | String contractNo; | 692 | String contractNo; |
| 549 | - List<ImagesById> contractImages; | 693 | + List<Images> contractImages; |
| 550 | TextEditingController contractFinalPriceC = TextEditingController(); | 694 | TextEditingController contractFinalPriceC = TextEditingController(); |
| 551 | TextEditingController customerC = TextEditingController(); //客户签约人 | 695 | TextEditingController customerC = TextEditingController(); //客户签约人 |
| 552 | TextEditingController storeC = TextEditingController(); //店铺签约人 | 696 | TextEditingController storeC = TextEditingController(); //店铺签约人 |
| @@ -568,14 +712,14 @@ class ContractInfo { | @@ -568,14 +712,14 @@ class ContractInfo { | ||
| 568 | contractNo = json['contract_no']; | 712 | contractNo = json['contract_no']; |
| 569 | 713 | ||
| 570 | if (json['contract_images'] != null) { | 714 | if (json['contract_images'] != null) { |
| 571 | - contractImages = <ImagesById>[]; | 715 | + contractImages = <Images>[]; |
| 572 | if (json['contract_images'] is List) { | 716 | if (json['contract_images'] is List) { |
| 573 | json['contract_images'].forEach((v) { | 717 | json['contract_images'].forEach((v) { |
| 574 | - contractImages.add(new ImagesById.fromJson(v)); | 718 | + contractImages.add(new Images.fromJson(v)); |
| 575 | }); | 719 | }); |
| 576 | } else { | 720 | } else { |
| 577 | convert.jsonDecode(json['contract_images']).forEach((v) { | 721 | convert.jsonDecode(json['contract_images']).forEach((v) { |
| 578 | - contractImages.add(new ImagesById.fromJson(v)); | 722 | + contractImages.add(new Images.fromJson(v)); |
| 579 | }); | 723 | }); |
| 580 | } | 724 | } |
| 581 | } | 725 | } |
| @@ -593,21 +737,21 @@ class ContractInfo { | @@ -593,21 +737,21 @@ class ContractInfo { | ||
| 593 | } | 737 | } |
| 594 | } | 738 | } |
| 595 | 739 | ||
| 596 | -class ImagesById { | ||
| 597 | - String url; | 740 | +// class Images { |
| 741 | +// String url; | ||
| 598 | 742 | ||
| 599 | - ImagesById({this.url}); | 743 | +// Images({this.url}); |
| 600 | 744 | ||
| 601 | - ImagesById.fromJson(Map<String, dynamic> json) { | ||
| 602 | - url = json['url']; | ||
| 603 | - } | 745 | +// Images.fromJson(Map<String, dynamic> json) { |
| 746 | +// url = json['url']; | ||
| 747 | +// } | ||
| 604 | 748 | ||
| 605 | - Map<String, dynamic> toJson() { | ||
| 606 | - final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
| 607 | - data['url'] = this.url; | ||
| 608 | - return data; | ||
| 609 | - } | ||
| 610 | -} | 749 | +// Map<String, dynamic> toJson() { |
| 750 | +// final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
| 751 | +// data['url'] = this.url; | ||
| 752 | +// return data; | ||
| 753 | +// } | ||
| 754 | +// } | ||
| 611 | 755 | ||
| 612 | class Invoice { | 756 | class Invoice { |
| 613 | String invoiceType; // "1 普通 2 专用", | 757 | String invoiceType; // "1 普通 2 专用", |
| @@ -623,7 +767,7 @@ class Invoice { | @@ -623,7 +767,7 @@ class Invoice { | ||
| 623 | String addresseePhone; //收件人电话 | 767 | String addresseePhone; //收件人电话 |
| 624 | String addresseeAddress; //收件人地址 | 768 | String addresseeAddress; //收件人地址 |
| 625 | String code; //邮编 | 769 | String code; //邮编 |
| 626 | - List<ImagesById> images; | 770 | + List<Images> images; |
| 627 | 771 | ||
| 628 | Invoice( | 772 | Invoice( |
| 629 | {this.invoiceType, | 773 | {this.invoiceType, |
| @@ -656,14 +800,14 @@ class Invoice { | @@ -656,14 +800,14 @@ class Invoice { | ||
| 656 | addresseeAddress = json['addressee_address']; | 800 | addresseeAddress = json['addressee_address']; |
| 657 | code = json['code']; | 801 | code = json['code']; |
| 658 | if (json['images'] != null) { | 802 | if (json['images'] != null) { |
| 659 | - images = <ImagesById>[]; | 803 | + images = <Images>[]; |
| 660 | if (json['images'] is List) { | 804 | if (json['images'] is List) { |
| 661 | json['images'].forEach((v) { | 805 | json['images'].forEach((v) { |
| 662 | - images.add(new ImagesById.fromJson(v)); | 806 | + images.add(new Images.fromJson(v)); |
| 663 | }); | 807 | }); |
| 664 | } else { | 808 | } else { |
| 665 | convert.jsonDecode(json['images']).forEach((v) { | 809 | convert.jsonDecode(json['images']).forEach((v) { |
| 666 | - images.add(new ImagesById.fromJson(v)); | 810 | + images.add(new Images.fromJson(v)); |
| 667 | }); | 811 | }); |
| 668 | } | 812 | } |
| 669 | } | 813 | } |
| @@ -10,7 +10,7 @@ class SetXuanTaiModel { | @@ -10,7 +10,7 @@ class SetXuanTaiModel { | ||
| 10 | String rid; | 10 | String rid; |
| 11 | String reserveOrder; | 11 | String reserveOrder; |
| 12 | String ddateInterval; | 12 | String ddateInterval; |
| 13 | - String rdate; | 13 | + // String rdate; |
| 14 | List<Tids> tids; | 14 | List<Tids> tids; |
| 15 | List<Setmeal> setmeal; | 15 | List<Setmeal> setmeal; |
| 16 | List<Wine> wine; | 16 | List<Wine> wine; |
| @@ -37,7 +37,7 @@ class SetXuanTaiModel { | @@ -37,7 +37,7 @@ class SetXuanTaiModel { | ||
| 37 | {this.rid, | 37 | {this.rid, |
| 38 | this.reserveOrder, | 38 | this.reserveOrder, |
| 39 | this.ddateInterval, | 39 | this.ddateInterval, |
| 40 | - this.rdate, | 40 | + // this.rdate, |
| 41 | this.tids, | 41 | this.tids, |
| 42 | this.setmeal, | 42 | this.setmeal, |
| 43 | this.wine, | 43 | this.wine, |
| @@ -49,7 +49,7 @@ class SetXuanTaiModel { | @@ -49,7 +49,7 @@ class SetXuanTaiModel { | ||
| 49 | rid = json['rid']; | 49 | rid = json['rid']; |
| 50 | reserveOrder = json['reserve_order']; | 50 | reserveOrder = json['reserve_order']; |
| 51 | ddateInterval = json['ddate_interval']; | 51 | ddateInterval = json['ddate_interval']; |
| 52 | - rdate = json['rdate']; | 52 | + // rdate = json['rdate']; |
| 53 | if (json['tids'] != null) { | 53 | if (json['tids'] != null) { |
| 54 | tids = <Tids>[]; | 54 | tids = <Tids>[]; |
| 55 | json['tids'].forEach((v) { | 55 | json['tids'].forEach((v) { |
| @@ -89,7 +89,7 @@ class SetXuanTaiModel { | @@ -89,7 +89,7 @@ class SetXuanTaiModel { | ||
| 89 | data['rid'] = this.rid; | 89 | data['rid'] = this.rid; |
| 90 | data['reserve_order'] = this.reserveOrder; | 90 | data['reserve_order'] = this.reserveOrder; |
| 91 | data['ddate_interval'] = this.ddateInterval; | 91 | data['ddate_interval'] = this.ddateInterval; |
| 92 | - data['rdate'] = this.rdate; | 92 | + // data['rdate'] = this.rdate; |
| 93 | if (this.tids != null) { | 93 | if (this.tids != null) { |
| 94 | data['tids'] = this.tids.map((v) => v.toJson()).toList(); | 94 | data['tids'] = this.tids.map((v) => v.toJson()).toList(); |
| 95 | } | 95 | } |
| @@ -121,6 +121,7 @@ class Tids { | @@ -121,6 +121,7 @@ class Tids { | ||
| 121 | Tids.fromJson(Map<String, dynamic> json) { | 121 | Tids.fromJson(Map<String, dynamic> json) { |
| 122 | tid = json['tid']; | 122 | tid = json['tid']; |
| 123 | numStr = json['num']; | 123 | numStr = json['num']; |
| 124 | + name = json['name']; | ||
| 124 | tableNumC.text = numStr; | 125 | tableNumC.text = numStr; |
| 125 | } | 126 | } |
| 126 | 127 | ||
| @@ -128,6 +129,7 @@ class Tids { | @@ -128,6 +129,7 @@ class Tids { | ||
| 128 | final Map<String, dynamic> data = new Map<String, dynamic>(); | 129 | final Map<String, dynamic> data = new Map<String, dynamic>(); |
| 129 | data['tid'] = this.tid; | 130 | data['tid'] = this.tid; |
| 130 | data['num'] = this.numStr; | 131 | data['num'] = this.numStr; |
| 132 | + data['name'] = this.name; | ||
| 131 | return data; | 133 | return data; |
| 132 | } | 134 | } |
| 133 | } | 135 | } |
| @@ -149,23 +151,24 @@ class Setmeal { | @@ -149,23 +151,24 @@ class Setmeal { | ||
| 149 | List<Cooklist> cooklist; | 151 | List<Cooklist> cooklist; |
| 150 | Map<String, List<CookByIdSetmeal>> dataMenu = {}; | 152 | Map<String, List<CookByIdSetmeal>> dataMenu = {}; |
| 151 | 153 | ||
| 152 | - Setmeal( | ||
| 153 | - {this.setmealId, | ||
| 154 | - this.price, | ||
| 155 | - this.finalPrice, | ||
| 156 | - this.pnum, | ||
| 157 | - this.min, | ||
| 158 | - this.spare, | ||
| 159 | - this.name, | ||
| 160 | - this.select, | ||
| 161 | - this.bargaining, | ||
| 162 | - this.cooklist, | ||
| 163 | - this.dataMenu | ||
| 164 | - // this.finalPriceC, | ||
| 165 | - // this.pnumC, | ||
| 166 | - // this.minC, | ||
| 167 | - // this.spareC, | ||
| 168 | - }); | 154 | + Setmeal({ |
| 155 | + this.setmealId, | ||
| 156 | + this.price, | ||
| 157 | + this.finalPrice, | ||
| 158 | + this.pnum, | ||
| 159 | + this.min, | ||
| 160 | + this.spare, | ||
| 161 | + this.name, | ||
| 162 | + this.select, | ||
| 163 | + this.bargaining, | ||
| 164 | + this.cooklist, | ||
| 165 | + this.dataMenu, | ||
| 166 | + | ||
| 167 | + // this.finalPriceC, | ||
| 168 | + // this.pnumC, | ||
| 169 | + // this.minC, | ||
| 170 | + // this.spareC, | ||
| 171 | + }); | ||
| 169 | 172 | ||
| 170 | Setmeal.fromJson(Map<String, dynamic> json) { | 173 | Setmeal.fromJson(Map<String, dynamic> json) { |
| 171 | setmealId = json['setmeal_id']; | 174 | setmealId = json['setmeal_id']; |
| @@ -251,6 +254,7 @@ class Wine { | @@ -251,6 +254,7 @@ class Wine { | ||
| 251 | price = json['price']; | 254 | price = json['price']; |
| 252 | finalPrice = json['final_price']; | 255 | finalPrice = json['final_price']; |
| 253 | numStr = json['num']; | 256 | numStr = json['num']; |
| 257 | + name = json['name']; | ||
| 254 | } | 258 | } |
| 255 | 259 | ||
| 256 | Map<String, dynamic> toJson() { | 260 | Map<String, dynamic> toJson() { |
| @@ -259,6 +263,8 @@ class Wine { | @@ -259,6 +263,8 @@ class Wine { | ||
| 259 | data['price'] = this.price; | 263 | data['price'] = this.price; |
| 260 | data['final_price'] = this.finalPrice; | 264 | data['final_price'] = this.finalPrice; |
| 261 | data['num'] = this.numStr; | 265 | data['num'] = this.numStr; |
| 266 | + data['name'] = this.name; | ||
| 267 | + | ||
| 262 | return data; | 268 | return data; |
| 263 | } | 269 | } |
| 264 | } | 270 | } |
| @@ -284,6 +290,7 @@ class Other { | @@ -284,6 +290,7 @@ class Other { | ||
| 284 | price = json['price']; | 290 | price = json['price']; |
| 285 | finalPrice = json['final_price']; | 291 | finalPrice = json['final_price']; |
| 286 | numStr = json['num']; | 292 | numStr = json['num']; |
| 293 | + name = json['name']; | ||
| 287 | } | 294 | } |
| 288 | 295 | ||
| 289 | Map<String, dynamic> toJson() { | 296 | Map<String, dynamic> toJson() { |
| @@ -292,6 +299,8 @@ class Other { | @@ -292,6 +299,8 @@ class Other { | ||
| 292 | data['price'] = this.price; | 299 | data['price'] = this.price; |
| 293 | data['final_price'] = this.finalPrice; | 300 | data['final_price'] = this.finalPrice; |
| 294 | data['num'] = this.numStr; | 301 | data['num'] = this.numStr; |
| 302 | + data['name'] = this.name; | ||
| 303 | + | ||
| 295 | return data; | 304 | return data; |
| 296 | } | 305 | } |
| 297 | } | 306 | } |
| @@ -315,5 +315,9 @@ class HttpUrl { | @@ -315,5 +315,9 @@ class HttpUrl { | ||
| 315 | "?service=App.Banquet.GetBanquetByTime"; //根据时间范围获取宴会订单 | 315 | "?service=App.Banquet.GetBanquetByTime"; //根据时间范围获取宴会订单 |
| 316 | static const String set_banquet_info_price = | 316 | static const String set_banquet_info_price = |
| 317 | "?service=App.Banquet.SetBanquetInfoPrice"; //设置宴会场次费用 | 317 | "?service=App.Banquet.SetBanquetInfoPrice"; //设置宴会场次费用 |
| 318 | + static const String set_banquet_lost = | ||
| 319 | + "?service=App.Banquet.SetBanquetLost"; //设置丢单原因 | ||
| 320 | + static const String get_banquet_be_follow = | ||
| 321 | + "?service=App.Banquet.GetBanquetBeFollow"; //根据时间范围查询待跟进订单 | ||
| 318 | 322 | ||
| 319 | } | 323 | } |
| @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; | @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; | ||
| 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 8 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 9 | import 'package:one_key/models/cookbook_one_model.dart'; | 9 | import 'package:one_key/models/cookbook_one_model.dart'; |
| 10 | import 'package:one_key/models/get_banquet_deposit_model.dart'; | 10 | import 'package:one_key/models/get_banquet_deposit_model.dart'; |
| 11 | +import 'package:one_key/models/sessions_model.dart'; | ||
| 11 | import 'package:one_key/route/navigator_util.dart'; | 12 | import 'package:one_key/route/navigator_util.dart'; |
| 12 | import 'package:one_key/widgets/MyDivider.dart'; | 13 | import 'package:one_key/widgets/MyDivider.dart'; |
| 13 | import 'package:one_key/widgets/round_button.dart'; | 14 | import 'package:one_key/widgets/round_button.dart'; |
| @@ -126,6 +127,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -126,6 +127,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 126 | if (results[0] && results[1] && results[2] && results[3]) { | 127 | if (results[0] && results[1] && results[2] && results[3]) { |
| 127 | //成功 | 128 | //成功 |
| 128 | if (widget.banquetDetail != null) { | 129 | if (widget.banquetDetail != null) { |
| 130 | + menuSet.add('意向'); | ||
| 131 | + menuSet.add('选台'); | ||
| 132 | + menuSet.add('定金'); | ||
| 133 | + menuSet.add('签约'); | ||
| 134 | + | ||
| 129 | //旧内容编辑 | 135 | //旧内容编辑 |
| 130 | // ******意向****** | 136 | // ******意向****** |
| 131 | BasicInfo basicInfo = widget.banquetDetail.basicInfo; | 137 | BasicInfo basicInfo = widget.banquetDetail.basicInfo; |
| @@ -178,6 +184,96 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -178,6 +184,96 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 178 | imgModel.process = 1; | 184 | imgModel.process = 1; |
| 179 | _uploadImageProvider.feastRemarkImageList.add(imgModel); | 185 | _uploadImageProvider.feastRemarkImageList.add(imgModel); |
| 180 | }); | 186 | }); |
| 187 | + /** | ||
| 188 | + * 选台 | ||
| 189 | + */ | ||
| 190 | + xuantaiData = []; | ||
| 191 | + // xuantaiSelIndex = 0; | ||
| 192 | + feastModel.sessionsSunModelList = []; //场次对应的id,删除场次的时候用 | ||
| 193 | + List<SessionsInfo> sessionsInfos = widget.banquetDetail.sessionsInfo; | ||
| 194 | + sessionsInfos.forEach((element) { | ||
| 195 | + feastModel.rid = element.rid; | ||
| 196 | + SetXuanTaiModel setXuanTaiModel = SetXuanTaiModel(); | ||
| 197 | + setXuanTaiModel.rid = element.rid; | ||
| 198 | + setXuanTaiModel.reserveOrder = element.reserveOrder; | ||
| 199 | + setXuanTaiModel.ddateInterval = element.ddateInterval; | ||
| 200 | + // setXuanTaiModel.rdate = element.qrdate; | ||
| 201 | + setXuanTaiModel.tids = element.tids; | ||
| 202 | + setXuanTaiModel.setmeal = element.setmeals; | ||
| 203 | + setXuanTaiModel.wine = element.wines; | ||
| 204 | + setXuanTaiModel.other = element.others; | ||
| 205 | + setXuanTaiModel.remark = element.remark; | ||
| 206 | + setXuanTaiModel.images = element.images; | ||
| 207 | + setXuanTaiModel.dateTimext = DateTime.fromMillisecondsSinceEpoch( | ||
| 208 | + int.parse(element.qrdate.toString()) * 1000); | ||
| 209 | + setXuanTaiModel.dateTimeShowxt = | ||
| 210 | + createDateText(context, setXuanTaiModel.dateTimext); | ||
| 211 | + | ||
| 212 | + setXuanTaiModel.cdShow = element.cdStr; | ||
| 213 | + setXuanTaiModel.cdSelIndex = dsoltList | ||
| 214 | + .map((item) { | ||
| 215 | + return item.title; | ||
| 216 | + }) | ||
| 217 | + .toList() | ||
| 218 | + .indexOf(element.cdStr); | ||
| 219 | + setXuanTaiModel.cdCode = dsoltList[setXuanTaiModel.cdSelIndex].id; | ||
| 220 | + DateTime start = DateTime.fromMillisecondsSinceEpoch( | ||
| 221 | + int.parse(element.qrdate.toString()) * 1000); | ||
| 222 | + setXuanTaiModel.startDate = | ||
| 223 | + '${Utils.addZeroNumber(start.hour)}:${Utils.addZeroNumber(start.minute)}'; | ||
| 224 | + DateTime end = DateTime.fromMillisecondsSinceEpoch( | ||
| 225 | + int.parse(element.jedate.toString()) * 1000); | ||
| 226 | + setXuanTaiModel.endDate = | ||
| 227 | + '${Utils.addZeroNumber(end.hour)}:${Utils.addZeroNumber(end.minute)}'; | ||
| 228 | + | ||
| 229 | + setXuanTaiModel.qsDateShow = setXuanTaiModel.startDate + | ||
| 230 | + '-' + | ||
| 231 | + setXuanTaiModel.endDate; //起始时间 | ||
| 232 | + setXuanTaiModel.tableList = element.tableList; | ||
| 233 | + | ||
| 234 | + setXuanTaiModel.tableSum = int.parse('${element.tableNum}'); //桌位总数 | ||
| 235 | + setXuanTaiModel.customCxt.text = element.remark; //选台备注 | ||
| 236 | + setXuanTaiModel.feastRemarkXtImageList = | ||
| 237 | + element.feastRemarkImages; //宴会备注图片信息列表----选台 | ||
| 238 | + setXuanTaiModel.reserveId = element.id; //场次id | ||
| 239 | + xuantaiData.add(setXuanTaiModel); | ||
| 240 | + SessionsSunModel sessionsSunModel = SessionsSunModel(); | ||
| 241 | + sessionsSunModel.reserveOrder = element.reserveOrder; | ||
| 242 | + sessionsSunModel.id = element.id; | ||
| 243 | + feastModel.sessionsSunModelList.add(sessionsSunModel); | ||
| 244 | + }); | ||
| 245 | + | ||
| 246 | + /** | ||
| 247 | + * 定金 | ||
| 248 | + */ | ||
| 249 | + _getBanquetDeposit(); //获取的rid后执行,编辑宴会信息-----定金信息获取 | ||
| 250 | + /** | ||
| 251 | + * 担保信息 | ||
| 252 | + */ | ||
| 253 | + //担保人 | ||
| 254 | + feastModel.sellerManageList.forEach((item) { | ||
| 255 | + if (item.id == basicInfo.warrantId) { | ||
| 256 | + djDBR = item.title; | ||
| 257 | + } | ||
| 258 | + }); | ||
| 259 | + | ||
| 260 | + djDBRIndex = feastModel.sellerManageList | ||
| 261 | + .map((item) { | ||
| 262 | + return item.title; | ||
| 263 | + }) | ||
| 264 | + .toList() | ||
| 265 | + .indexOf(djDBR); | ||
| 266 | + //担保说明 | ||
| 267 | + customCdb.text = basicInfo.warrantDesc ?? ''; | ||
| 268 | + //担保图片 | ||
| 269 | + _uploadImageProvider.feastRemarkDjImageList = []; | ||
| 270 | + basicInfo.warrantImages.forEach((element) { | ||
| 271 | + UploadImgModel imgModel = UploadImgModel(); | ||
| 272 | + imgModel.qiniuUrl = element.url; | ||
| 273 | + imgModel.process = 1; | ||
| 274 | + _uploadImageProvider.feastRemarkDjImageList.add(imgModel); | ||
| 275 | + }); | ||
| 276 | + | ||
| 181 | setState(() {}); | 277 | setState(() {}); |
| 182 | } | 278 | } |
| 183 | } else { | 279 | } else { |
| @@ -1134,7 +1230,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1134,7 +1230,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1134 | // map['edate'] = _getEdate(element, element.dateTimext); | 1230 | // map['edate'] = _getEdate(element, element.dateTimext); |
| 1135 | List tids = []; | 1231 | List tids = []; |
| 1136 | for (Tids item in element.tids) { | 1232 | for (Tids item in element.tids) { |
| 1137 | - Map mapTids = {'tid': item.tid, 'num': item.tableNumC.text}; | 1233 | + Map mapTids = { |
| 1234 | + 'tid': item.tid, | ||
| 1235 | + 'num': item.tableNumC.text, | ||
| 1236 | + 'name': item.name | ||
| 1237 | + }; | ||
| 1138 | tids.add(mapTids); | 1238 | tids.add(mapTids); |
| 1139 | } | 1239 | } |
| 1140 | map['tids'] = tids; //桌位数据 | 1240 | map['tids'] = tids; //桌位数据 |
| @@ -1152,6 +1252,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1152,6 +1252,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1152 | 'pnum': mealValue.pnum, | 1252 | 'pnum': mealValue.pnum, |
| 1153 | 'min': mealValue.min, | 1253 | 'min': mealValue.min, |
| 1154 | 'spare': mealValue.spare, | 1254 | 'spare': mealValue.spare, |
| 1255 | + 'name': mealValue.name | ||
| 1155 | }; | 1256 | }; |
| 1156 | List cooklist = []; //菜单数据 | 1257 | List cooklist = []; //菜单数据 |
| 1157 | if (mealValue.dataMenu != null && mealValue.dataMenu.length > 0) { | 1258 | if (mealValue.dataMenu != null && mealValue.dataMenu.length > 0) { |
| @@ -1192,7 +1293,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1192,7 +1293,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1192 | 'wine_id': element.wineId, | 1293 | 'wine_id': element.wineId, |
| 1193 | 'price': element.price, | 1294 | 'price': element.price, |
| 1194 | 'final_price': element.finalPrice, | 1295 | 'final_price': element.finalPrice, |
| 1195 | - 'num': element.numStr | 1296 | + 'num': element.numStr, |
| 1297 | + 'name': element.name, | ||
| 1298 | + 'spec': element.spec | ||
| 1196 | }; | 1299 | }; |
| 1197 | wines.add(mapWine); | 1300 | wines.add(mapWine); |
| 1198 | }); | 1301 | }); |
| @@ -1206,7 +1309,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1206,7 +1309,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1206 | 'other_id': element.otherId, | 1309 | 'other_id': element.otherId, |
| 1207 | 'price': element.price, | 1310 | 'price': element.price, |
| 1208 | 'final_price': element.finalPrice, | 1311 | 'final_price': element.finalPrice, |
| 1209 | - 'num': element.numStr | 1312 | + 'num': element.numStr, |
| 1313 | + 'name': element.name, | ||
| 1314 | + 'spec': element.spec | ||
| 1210 | }; | 1315 | }; |
| 1211 | others.add(mapOther); | 1316 | others.add(mapOther); |
| 1212 | }); | 1317 | }); |
| @@ -1586,8 +1691,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1586,8 +1691,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1586 | Expanded( | 1691 | Expanded( |
| 1587 | child: Text( | 1692 | child: Text( |
| 1588 | xuantaiData[xuantaiSelIndex] | 1693 | xuantaiData[xuantaiSelIndex] |
| 1589 | - .tids[index] | ||
| 1590 | - .name, | 1694 | + .tids[index] |
| 1695 | + .name ?? | ||
| 1696 | + "", | ||
| 1591 | overflow: TextOverflow.ellipsis, | 1697 | overflow: TextOverflow.ellipsis, |
| 1592 | style: TextStyle( | 1698 | style: TextStyle( |
| 1593 | color: MyColours.color_438E93, | 1699 | color: MyColours.color_438E93, |
| @@ -1771,7 +1877,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1771,7 +1877,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1771 | item.selected = true; | 1877 | item.selected = true; |
| 1772 | Tids tids = Tids(); | 1878 | Tids tids = Tids(); |
| 1773 | tids.tid = item.id; | 1879 | tids.tid = item.id; |
| 1774 | - tids.name = item.name; | 1880 | + tids.name = item.name ?? ""; |
| 1775 | xuantaiData[xuantaiSelIndex] | 1881 | xuantaiData[xuantaiSelIndex] |
| 1776 | .tids | 1882 | .tids |
| 1777 | .add(tids); | 1883 | .add(tids); |
| @@ -1835,7 +1941,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1835,7 +1941,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1835 | item.selected = true; | 1941 | item.selected = true; |
| 1836 | Tids tids = Tids(); | 1942 | Tids tids = Tids(); |
| 1837 | tids.tid = item.id; | 1943 | tids.tid = item.id; |
| 1838 | - tids.name = item.name; | 1944 | + tids.name = item.name ?? ""; |
| 1839 | xuantaiData[xuantaiSelIndex] | 1945 | xuantaiData[xuantaiSelIndex] |
| 1840 | .tids | 1946 | .tids |
| 1841 | .add(tids); | 1947 | .add(tids); |
| @@ -1883,7 +1989,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -1883,7 +1989,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 1883 | children: [ | 1989 | children: [ |
| 1884 | Expanded( | 1990 | Expanded( |
| 1885 | child: Text( | 1991 | child: Text( |
| 1886 | - setmeal.name, | 1992 | + setmeal.name ?? "", |
| 1887 | overflow: TextOverflow.ellipsis, | 1993 | overflow: TextOverflow.ellipsis, |
| 1888 | style: TextStyle( | 1994 | style: TextStyle( |
| 1889 | color: | 1995 | color: |
| @@ -2092,7 +2198,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -2092,7 +2198,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 2092 | children: [ | 2198 | children: [ |
| 2093 | Expanded( | 2199 | Expanded( |
| 2094 | child: Text( | 2200 | child: Text( |
| 2095 | - wine.name, | 2201 | + wine.name ?? "", |
| 2096 | overflow: TextOverflow.ellipsis, | 2202 | overflow: TextOverflow.ellipsis, |
| 2097 | style: TextStyle( | 2203 | style: TextStyle( |
| 2098 | color: MyColours.color_515151, | 2204 | color: MyColours.color_515151, |
| @@ -2210,7 +2316,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -2210,7 +2316,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 2210 | children: [ | 2316 | children: [ |
| 2211 | Expanded( | 2317 | Expanded( |
| 2212 | child: Text( | 2318 | child: Text( |
| 2213 | - other.name, | 2319 | + other.name ?? "", |
| 2214 | overflow: TextOverflow.ellipsis, | 2320 | overflow: TextOverflow.ellipsis, |
| 2215 | style: TextStyle( | 2321 | style: TextStyle( |
| 2216 | color: MyColours.color_515151, | 2322 | color: MyColours.color_515151, |
| @@ -3043,14 +3149,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -3043,14 +3149,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 3043 | // } | 3149 | // } |
| 3044 | } | 3150 | } |
| 3045 | if (total == 0.0) { | 3151 | if (total == 0.0) { |
| 3046 | - costInfoModel.totalPrice = costInfoModel.sumPrice; | 3152 | + costInfoModel.totalPriceSelf = costInfoModel.sumPrice; |
| 3047 | } else { | 3153 | } else { |
| 3048 | String num2StrD = total.toStringAsFixed(2); //保留两位小数 | 3154 | String num2StrD = total.toStringAsFixed(2); //保留两位小数 |
| 3049 | - costInfoModel.totalPrice = num2StrD; | 3155 | + costInfoModel.totalPriceSelf = num2StrD; |
| 3050 | } | 3156 | } |
| 3051 | double finalContract = 0.0; //最终议价 | 3157 | double finalContract = 0.0; //最终议价 |
| 3052 | feastModel.banquetDetail.costInfo.forEach((element) { | 3158 | feastModel.banquetDetail.costInfo.forEach((element) { |
| 3053 | - finalContract += double.parse(element.totalPrice); | 3159 | + finalContract += double.parse(element.totalPriceSelf); |
| 3054 | }); | 3160 | }); |
| 3055 | feastModel.banquetDetail.contractInfo.contractFinalPrice = | 3161 | feastModel.banquetDetail.contractInfo.contractFinalPrice = |
| 3056 | finalContract.toString(); | 3162 | finalContract.toString(); |
| @@ -3480,7 +3586,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -3480,7 +3586,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 3480 | ), | 3586 | ), |
| 3481 | Spacer(), | 3587 | Spacer(), |
| 3482 | Text( | 3588 | Text( |
| 3483 | - '${costInfoModel.totalPrice} 元', | 3589 | + '${costInfoModel.totalPriceSelf} 元', |
| 3484 | style: TextStyle( | 3590 | style: TextStyle( |
| 3485 | color: MyColours.color_515151, | 3591 | color: MyColours.color_515151, |
| 3486 | fontWeight: FontWeight.bold, | 3592 | fontWeight: FontWeight.bold, |
| @@ -4198,7 +4304,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -4198,7 +4304,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 4198 | } else { | 4304 | } else { |
| 4199 | map['discount_per'] = element.discountC.text; | 4305 | map['discount_per'] = element.discountC.text; |
| 4200 | } | 4306 | } |
| 4201 | - map['total_price'] = element.totalPrice; | 4307 | + map['total_price'] = element.totalPriceSelf; |
| 4202 | dataRequest.add(map); | 4308 | dataRequest.add(map); |
| 4203 | }); | 4309 | }); |
| 4204 | 4310 | ||
| @@ -4260,7 +4366,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | @@ -4260,7 +4366,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { | ||
| 4260 | feastModel.banquetDetail.invoice.images = []; | 4366 | feastModel.banquetDetail.invoice.images = []; |
| 4261 | 4367 | ||
| 4262 | imageQiniuUrlListInvoice.forEach((v) { | 4368 | imageQiniuUrlListInvoice.forEach((v) { |
| 4263 | - feastModel.banquetDetail.invoice.images.add(new ImagesById.fromJson(v)); | 4369 | + feastModel.banquetDetail.invoice.images.add(new Images.fromJson(v)); |
| 4264 | }); | 4370 | }); |
| 4265 | } | 4371 | } |
| 4266 | 4372 |
| @@ -11,7 +11,9 @@ import '../../route/navigator_util.dart'; | @@ -11,7 +11,9 @@ import '../../route/navigator_util.dart'; | ||
| 11 | import '../../utils/ConvertNumberToChineseMoneyWords.dart'; | 11 | import '../../utils/ConvertNumberToChineseMoneyWords.dart'; |
| 12 | import '../../utils/screen_util.dart'; | 12 | import '../../utils/screen_util.dart'; |
| 13 | import '../../utils/utils.dart'; | 13 | import '../../utils/utils.dart'; |
| 14 | +import '../../widgets/MyDivider.dart'; | ||
| 14 | import '../../widgets/h_empty_view.dart'; | 15 | import '../../widgets/h_empty_view.dart'; |
| 16 | +import '../../widgets/loading.dart'; | ||
| 15 | import '../../widgets/page_exception.dart'; | 17 | import '../../widgets/page_exception.dart'; |
| 16 | import '../../widgets/round_button.dart'; | 18 | import '../../widgets/round_button.dart'; |
| 17 | import '../../widgets/system_app_bar.dart'; | 19 | import '../../widgets/system_app_bar.dart'; |
| @@ -56,6 +58,22 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -56,6 +58,22 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 56 | } | 58 | } |
| 57 | } | 59 | } |
| 58 | 60 | ||
| 61 | + /// 设置丢单原因 | ||
| 62 | + _setBanquetLost(String lost) async { | ||
| 63 | + Map<String, String> pramas = {'rid': widget.rid, 'lost': lost}; // | ||
| 64 | + bool success = await feastModel.setBanquetLost(context, pramas); | ||
| 65 | + if (success) { | ||
| 66 | + // _uploadImageProvider.feastRemarkContractImageList = []; | ||
| 67 | + // feastModel.banquetDetail.contractInfo.contractImages.forEach((element) { | ||
| 68 | + // UploadImgModel uploadImgModel = UploadImgModel(); | ||
| 69 | + // uploadImgModel.process = 1; | ||
| 70 | + // uploadImgModel.qiniuUrl = element.url; | ||
| 71 | + // _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel); | ||
| 72 | + // }); | ||
| 73 | + // setState(() {}); | ||
| 74 | + } | ||
| 75 | + } | ||
| 76 | + | ||
| 59 | Widget baseInfoItem(String title, String content) { | 77 | Widget baseInfoItem(String title, String content) { |
| 60 | return Padding( | 78 | return Padding( |
| 61 | padding: EdgeInsets.symmetric(vertical: h(6)), | 79 | padding: EdgeInsets.symmetric(vertical: h(6)), |
| @@ -658,7 +676,7 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -658,7 +676,7 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 658 | ), | 676 | ), |
| 659 | Spacer(), | 677 | Spacer(), |
| 660 | Text( | 678 | Text( |
| 661 | - '${costInfoModel.totalPrice} 元', | 679 | + '${costInfoModel.totalprice} 元', |
| 662 | style: TextStyle( | 680 | style: TextStyle( |
| 663 | color: MyColours.color_515151, | 681 | color: MyColours.color_515151, |
| 664 | fontSize: font(14)), | 682 | fontSize: font(14)), |
| @@ -912,6 +930,307 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -912,6 +930,307 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 912 | ])); | 930 | ])); |
| 913 | } | 931 | } |
| 914 | 932 | ||
| 933 | + ///取消预订弹框 | ||
| 934 | + _showCancelWidget(context) { | ||
| 935 | + ScrollController _scrollController = ScrollController(); | ||
| 936 | + TextEditingController _cancelController = TextEditingController(); | ||
| 937 | + FocusNode _cancelNode = FocusNode(); | ||
| 938 | + | ||
| 939 | + List cancelReasonList = [ | ||
| 940 | + {'title': '已选择其他酒店', 'select': false}, | ||
| 941 | + {'title': '不接受增值服务', 'select': false}, | ||
| 942 | + {'title': '场地无法满足客户', 'select': false}, | ||
| 943 | + {'title': '内部失误,跟单失败', 'select': false}, | ||
| 944 | + {'title': '其他原因', 'select': false}, | ||
| 945 | + ]; | ||
| 946 | + showGeneralDialog( | ||
| 947 | + context: context, | ||
| 948 | + barrierDismissible: false, | ||
| 949 | + barrierLabel: | ||
| 950 | + MaterialLocalizations.of(context).modalBarrierDismissLabel, | ||
| 951 | + transitionDuration: const Duration(milliseconds: 150), | ||
| 952 | + barrierColor: Color.fromRGBO(0, 0, 0, 0.25), | ||
| 953 | + pageBuilder: (BuildContext context, Animation animation, | ||
| 954 | + Animation secondaryAnimation) { | ||
| 955 | + return Scaffold( | ||
| 956 | + backgroundColor: Color.fromRGBO(0, 0, 0, 0.25), | ||
| 957 | + body: StatefulBuilder(builder: (context, state) { | ||
| 958 | + // _cancelState = state; | ||
| 959 | + return GestureDetector( | ||
| 960 | + behavior: HitTestBehavior.opaque, | ||
| 961 | + // onTap: () { | ||
| 962 | + // Navigator.of(context).pop(); | ||
| 963 | + // }, | ||
| 964 | + child: Center( | ||
| 965 | + child: Container( | ||
| 966 | + margin: EdgeInsets.symmetric( | ||
| 967 | + horizontal: ScreenUtil().setWidth(28 * 2)), | ||
| 968 | + decoration: BoxDecoration( | ||
| 969 | + color: Colors.white, | ||
| 970 | + borderRadius: | ||
| 971 | + BorderRadius.circular(ScreenUtil().setWidth(10)), | ||
| 972 | + ), | ||
| 973 | + height: ScreenUtil().setWidth(355 * 2 + 20), | ||
| 974 | + child: Column( | ||
| 975 | + // mainAxisSize: MainAxisSize.min, | ||
| 976 | + children: [ | ||
| 977 | + // Stack( | ||
| 978 | + // children: [ | ||
| 979 | + VEmptyView(48), | ||
| 980 | + Container( | ||
| 981 | + height: ScreenUtil().setWidth(48), | ||
| 982 | + child: Text( | ||
| 983 | + '请选择丢单原因', | ||
| 984 | + style: TextStyle( | ||
| 985 | + fontSize: ScreenUtil().setSp(32), | ||
| 986 | + fontWeight: FontWeight.bold, | ||
| 987 | + decoration: TextDecoration.none, | ||
| 988 | + color: Color.fromRGBO(0, 0, 0, 0.9)), | ||
| 989 | + ), | ||
| 990 | + ), | ||
| 991 | + // Positioned( | ||
| 992 | + // top: ScreenUtil().setWidth(8), | ||
| 993 | + // right: ScreenUtil().setWidth(0), | ||
| 994 | + // child: GestureDetector( | ||
| 995 | + // onTap: () { | ||
| 996 | + // _initCancel(); | ||
| 997 | + // Navigator.of(context).pop(); | ||
| 998 | + // }, | ||
| 999 | + // child: Container( | ||
| 1000 | + // padding: EdgeInsets.only(left: 20), | ||
| 1001 | + // child: Image.asset( | ||
| 1002 | + // 'assets/close.png', | ||
| 1003 | + // width: ScreenUtil().setWidth(32), | ||
| 1004 | + // height: ScreenUtil().setWidth(32), | ||
| 1005 | + // ), | ||
| 1006 | + // ))) | ||
| 1007 | + // ], | ||
| 1008 | + // ), | ||
| 1009 | + VEmptyView(40), | ||
| 1010 | + Container( | ||
| 1011 | + padding: EdgeInsets.symmetric( | ||
| 1012 | + horizontal: ScreenUtil().setWidth(32)), | ||
| 1013 | + child: Column( | ||
| 1014 | + // mainAxisSize: MainAxisSize.min, | ||
| 1015 | + children: cancelReasonList.map((value) { | ||
| 1016 | + return value['title'] == '其他原因' | ||
| 1017 | + ? SizedBox() | ||
| 1018 | + : GestureDetector( | ||
| 1019 | + onTap: () { | ||
| 1020 | + for (var item | ||
| 1021 | + in cancelReasonList) { | ||
| 1022 | + item['select'] = false; | ||
| 1023 | + // isShowTF = false; | ||
| 1024 | + // paddingBottom = | ||
| 1025 | + // ScreenUtil().screenHeight.ceil() - | ||
| 1026 | + // 138 - | ||
| 1027 | + // 340; | ||
| 1028 | + if (item['title'] == | ||
| 1029 | + value['title']) { | ||
| 1030 | + item['select'] = true; | ||
| 1031 | + // if (item['title'] == '其他原因') { | ||
| 1032 | + // // isShowTF = true; | ||
| 1033 | + // // paddingBottom = 130; | ||
| 1034 | + // // paddingBottom = | ||
| 1035 | + // // ScreenUtil().screenHeight.ceil() - | ||
| 1036 | + // // 138 - | ||
| 1037 | + // // 340 - | ||
| 1038 | + // // 46; | ||
| 1039 | + // } | ||
| 1040 | + } | ||
| 1041 | + } | ||
| 1042 | + state(() {}); | ||
| 1043 | + }, | ||
| 1044 | + child: Container( | ||
| 1045 | + height: ScreenUtil().setWidth(48), | ||
| 1046 | + margin: EdgeInsets.only( | ||
| 1047 | + bottom: ScreenUtil() | ||
| 1048 | + .setWidth(40)), | ||
| 1049 | + child: Row( | ||
| 1050 | + children: [ | ||
| 1051 | + Image.asset( | ||
| 1052 | + value['select'] | ||
| 1053 | + ? 'assets/select.png' | ||
| 1054 | + : 'assets/unselect.png', | ||
| 1055 | + width: ScreenUtil() | ||
| 1056 | + .setWidth(42)), | ||
| 1057 | + HEmptyView(20), | ||
| 1058 | + Container( | ||
| 1059 | + child: Text( | ||
| 1060 | + value['title'], | ||
| 1061 | + style: TextStyle( | ||
| 1062 | + fontSize: | ||
| 1063 | + ScreenUtil() | ||
| 1064 | + .setSp( | ||
| 1065 | + 32), | ||
| 1066 | + fontWeight: | ||
| 1067 | + FontWeight | ||
| 1068 | + .normal, | ||
| 1069 | + decoration: | ||
| 1070 | + TextDecoration | ||
| 1071 | + .none, | ||
| 1072 | + color: MyColours | ||
| 1073 | + .color_333333))) | ||
| 1074 | + ], | ||
| 1075 | + ), | ||
| 1076 | + ), | ||
| 1077 | + ); | ||
| 1078 | + }).toList(), | ||
| 1079 | + )), | ||
| 1080 | + Material( | ||
| 1081 | + child: Container( | ||
| 1082 | + color: Colors.white, | ||
| 1083 | + padding: EdgeInsets.symmetric( | ||
| 1084 | + horizontal: ScreenUtil().setWidth(32)), | ||
| 1085 | + height: ScreenUtil().setWidth(42 * 2), | ||
| 1086 | + child: Row(children: [ | ||
| 1087 | + InkWell( | ||
| 1088 | + onTap: () { | ||
| 1089 | + for (var item in cancelReasonList) { | ||
| 1090 | + item['select'] = false; | ||
| 1091 | + } | ||
| 1092 | + cancelReasonList[4]['select'] = | ||
| 1093 | + true; | ||
| 1094 | + state(() {}); | ||
| 1095 | + }, | ||
| 1096 | + child: Padding( | ||
| 1097 | + padding: EdgeInsets.only( | ||
| 1098 | + right: ScreenUtil() | ||
| 1099 | + .setWidth(20)), | ||
| 1100 | + child: Image.asset( | ||
| 1101 | + cancelReasonList[4]['select'] | ||
| 1102 | + ? 'assets/select.png' | ||
| 1103 | + : 'assets/unselect.png', | ||
| 1104 | + width: ScreenUtil() | ||
| 1105 | + .setWidth(44)))), | ||
| 1106 | + Expanded( | ||
| 1107 | + child: Container( | ||
| 1108 | + decoration: BoxDecoration( | ||
| 1109 | + color: Color.fromRGBO( | ||
| 1110 | + 240, 240, 240, 1), | ||
| 1111 | + borderRadius: BorderRadius.circular( | ||
| 1112 | + ScreenUtil().setWidth(8))), | ||
| 1113 | + // height: ScreenUtil().setWidth(42 * 2), | ||
| 1114 | + padding: EdgeInsets.symmetric( | ||
| 1115 | + horizontal: | ||
| 1116 | + ScreenUtil().setWidth(16)), | ||
| 1117 | + child: TextField( | ||
| 1118 | + maxLines: 1, | ||
| 1119 | + controller: _cancelController, | ||
| 1120 | + focusNode: _cancelNode, | ||
| 1121 | + style: TextStyle( | ||
| 1122 | + textBaseline: | ||
| 1123 | + TextBaseline.alphabetic), | ||
| 1124 | + textAlignVertical: | ||
| 1125 | + TextAlignVertical.center, | ||
| 1126 | + decoration: InputDecoration( | ||
| 1127 | + contentPadding: EdgeInsets.zero, | ||
| 1128 | + hintText: "其他", | ||
| 1129 | + // focusColor: Color.fromRGBO(0, 0, 0, 0.4), | ||
| 1130 | + hintStyle: TextStyle( | ||
| 1131 | + color: | ||
| 1132 | + Color.fromRGBO(0, 0, 0, 0.4), | ||
| 1133 | + fontSize: ScreenUtil().setSp(32), | ||
| 1134 | + ), | ||
| 1135 | + enabledBorder: OutlineInputBorder( | ||
| 1136 | + borderSide: BorderSide( | ||
| 1137 | + width: 0, | ||
| 1138 | + color: Colors.transparent)), | ||
| 1139 | + border: OutlineInputBorder( | ||
| 1140 | + borderSide: BorderSide( | ||
| 1141 | + width: 0, | ||
| 1142 | + color: Colors.transparent)), | ||
| 1143 | + focusedBorder: OutlineInputBorder( | ||
| 1144 | + borderSide: BorderSide( | ||
| 1145 | + width: 0, | ||
| 1146 | + color: Colors.transparent)), | ||
| 1147 | + ), | ||
| 1148 | + | ||
| 1149 | + // border: InputBorder.none, | ||
| 1150 | + | ||
| 1151 | + onChanged: (_) { | ||
| 1152 | + setState(() {}); | ||
| 1153 | + }, | ||
| 1154 | + onEditingComplete: () { | ||
| 1155 | + print('fff'); | ||
| 1156 | + _cancelNode.unfocus(); | ||
| 1157 | + }, | ||
| 1158 | + // keyboardType: TextInputType.number, | ||
| 1159 | + ), | ||
| 1160 | + )) | ||
| 1161 | + ]))), | ||
| 1162 | + | ||
| 1163 | + VEmptyView(40), | ||
| 1164 | + MyDivider(double.infinity, ScreenUtil().setWidth(2), | ||
| 1165 | + color: MyColours.color_f3f3f3), | ||
| 1166 | + Row( | ||
| 1167 | + // mainAxisAlignment: | ||
| 1168 | + // MainAxisAlignment.spaceBetween, | ||
| 1169 | + children: [ | ||
| 1170 | + RoundButton( | ||
| 1171 | + text: '取消', | ||
| 1172 | + width: (ScreenUtil().screenWidth - | ||
| 1173 | + ScreenUtil().setWidth(62) * 2) / | ||
| 1174 | + 2, | ||
| 1175 | + height: ScreenUtil().setWidth(112), | ||
| 1176 | + // radius: ScreenUtil().setWidth(10), | ||
| 1177 | + gradientStart: Colors.transparent, | ||
| 1178 | + gradientEnd: Colors.transparent, | ||
| 1179 | + textColor: MyColours.color_E6000000, | ||
| 1180 | + isBold: false, | ||
| 1181 | + fontSize: 32, | ||
| 1182 | + onPressed: () { | ||
| 1183 | + Navigator.pop(context); | ||
| 1184 | + }), | ||
| 1185 | + MyDivider(ScreenUtil().setWidth(2), | ||
| 1186 | + ScreenUtil().setWidth(112), | ||
| 1187 | + color: MyColours.color_f3f3f3), | ||
| 1188 | + RoundButton( | ||
| 1189 | + text: '确定丢单', | ||
| 1190 | + width: (ScreenUtil().screenWidth - | ||
| 1191 | + ScreenUtil().setWidth(62) * 2) / | ||
| 1192 | + 2, | ||
| 1193 | + height: ScreenUtil().setWidth(112), | ||
| 1194 | + // radius: ScreenUtil().setWidth(10), | ||
| 1195 | + gradientStart: Colors.transparent, | ||
| 1196 | + gradientEnd: Colors.transparent, | ||
| 1197 | + textColor: MyColours.color_E34D59, | ||
| 1198 | + fontSize: 32, | ||
| 1199 | + isBold: true, | ||
| 1200 | + onPressed: () { | ||
| 1201 | + String desc = ''; | ||
| 1202 | + for (var value in cancelReasonList) { | ||
| 1203 | + if (value['select'] == true) { | ||
| 1204 | + desc = value['title']; | ||
| 1205 | + if (value['title'] == '其他原因') { | ||
| 1206 | + desc = | ||
| 1207 | + _cancelController.text.trim(); | ||
| 1208 | + if (desc.isEmpty) { | ||
| 1209 | + Utils.showToast("请填写原因"); | ||
| 1210 | + return; | ||
| 1211 | + } | ||
| 1212 | + } | ||
| 1213 | + } | ||
| 1214 | + } | ||
| 1215 | + | ||
| 1216 | + if (desc == '') { | ||
| 1217 | + Utils.showToast('请选择原因'); | ||
| 1218 | + return; | ||
| 1219 | + } | ||
| 1220 | + | ||
| 1221 | + Navigator.of(context).pop(); | ||
| 1222 | + Loading.showLoading(context); | ||
| 1223 | + _setBanquetLost(desc); | ||
| 1224 | + }), | ||
| 1225 | + ]) | ||
| 1226 | + ], | ||
| 1227 | + ), | ||
| 1228 | + ), | ||
| 1229 | + )); | ||
| 1230 | + })); | ||
| 1231 | + }); | ||
| 1232 | + } | ||
| 1233 | + | ||
| 915 | ///签约 | 1234 | ///签约 |
| 916 | Widget qyWidget() { | 1235 | Widget qyWidget() { |
| 917 | return Column(children: <Widget>[ | 1236 | return Column(children: <Widget>[ |
| @@ -965,7 +1284,9 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -965,7 +1284,9 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 965 | children: [ | 1284 | children: [ |
| 966 | Expanded( | 1285 | Expanded( |
| 967 | child: _callButton( | 1286 | child: _callButton( |
| 968 | - onPress: () {}, | 1287 | + onPress: () { |
| 1288 | + _showCancelWidget(context); | ||
| 1289 | + }, | ||
| 969 | content: '丢单', | 1290 | content: '丢单', |
| 970 | hasLeftBorder: true, | 1291 | hasLeftBorder: true, |
| 971 | textColor: MyColours.color_E34D59, | 1292 | textColor: MyColours.color_E34D59, |
| @@ -974,7 +1295,9 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | @@ -974,7 +1295,9 @@ class _FeastDetailPageState extends State<FeastDetailPage> { | ||
| 974 | child: _callButton( | 1295 | child: _callButton( |
| 975 | onPress: () async { | 1296 | onPress: () async { |
| 976 | NavigatorUtil.goFeastCreatePage(context, | 1297 | NavigatorUtil.goFeastCreatePage(context, |
| 977 | - banquetDetail: feastModel.banquetDetail); | 1298 | + banquetDetail: { |
| 1299 | + 'object': feastModel.banquetDetailMap | ||
| 1300 | + }); | ||
| 978 | // selectMenu = '签约'; | 1301 | // selectMenu = '签约'; |
| 979 | // menuSet.add('定金'); | 1302 | // menuSet.add('定金'); |
| 980 | // menuSet.add('签约'); | 1303 | // menuSet.add('签约'); |
| @@ -363,7 +363,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { | @@ -363,7 +363,7 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { | ||
| 363 | FocusNode _cancelNode = FocusNode(); | 363 | FocusNode _cancelNode = FocusNode(); |
| 364 | 364 | ||
| 365 | List cancelReasonList = [ | 365 | List cancelReasonList = [ |
| 366 | - {'title': '已选则其他酒店', 'select': false}, | 366 | + {'title': '已选择其他酒店', 'select': false}, |
| 367 | {'title': '不接受增值服务', 'select': false}, | 367 | {'title': '不接受增值服务', 'select': false}, |
| 368 | {'title': '场地无法满足客户', 'select': false}, | 368 | {'title': '场地无法满足客户', 'select': false}, |
| 369 | {'title': '内部失误,跟单失败', 'select': false}, | 369 | {'title': '内部失误,跟单失败', 'select': false}, |
| @@ -506,8 +506,8 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { | @@ -506,8 +506,8 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { | ||
| 506 | Material( | 506 | Material( |
| 507 | child: Container( | 507 | child: Container( |
| 508 | color: Colors.white, | 508 | color: Colors.white, |
| 509 | - padding: EdgeInsets.symmetric( | ||
| 510 | - horizontal: ScreenUtil().setWidth(32)), | 509 | + padding: EdgeInsets.symmetric( |
| 510 | + horizontal: ScreenUtil().setWidth(32)), | ||
| 511 | height: ScreenUtil().setWidth(42 * 2), | 511 | height: ScreenUtil().setWidth(42 * 2), |
| 512 | child: Row(children: [ | 512 | child: Row(children: [ |
| 513 | InkWell( | 513 | InkWell( |
| @@ -749,7 +749,8 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { | @@ -749,7 +749,8 @@ class _FeastFollowUpPageState extends State<FeastFollowUpPage> { | ||
| 749 | } else { | 749 | } else { |
| 750 | return ListView.builder( | 750 | return ListView.builder( |
| 751 | itemCount: 100, | 751 | itemCount: 100, |
| 752 | - padding: EdgeInsets.only(left: w(12), top: w(19),right:w(12)), | 752 | + padding: |
| 753 | + EdgeInsets.only(left: w(12), top: w(19), right: w(12)), | ||
| 753 | itemBuilder: (BuildContext context, int index) { | 754 | itemBuilder: (BuildContext context, int index) { |
| 754 | // WineSunModel data = feastModel.wineData[index]; | 755 | // WineSunModel data = feastModel.wineData[index]; |
| 755 | return buildFeastTypeItem(); | 756 | return buildFeastTypeItem(); |
| @@ -172,6 +172,7 @@ class FeastSelectTablePageState extends State<FeastSelectTablePage> { | @@ -172,6 +172,7 @@ class FeastSelectTablePageState extends State<FeastSelectTablePage> { | ||
| 172 | if (item1.id == table.id) { | 172 | if (item1.id == table.id) { |
| 173 | item1.selected = true; | 173 | item1.selected = true; |
| 174 | selectNum++; | 174 | selectNum++; |
| 175 | + selectTables.add(item1); | ||
| 175 | // if (!tableList.contains(item)) { | 176 | // if (!tableList.contains(item)) { |
| 176 | // tableList.add(item); | 177 | // tableList.add(item); |
| 177 | // } | 178 | // } |
| @@ -76,8 +76,92 @@ class FeastModel extends ChangeNotifier { | @@ -76,8 +76,92 @@ class FeastModel extends ChangeNotifier { | ||
| 76 | 76 | ||
| 77 | PageState pageStateBanquet = PageState.Loading; //宴会详情 | 77 | PageState pageStateBanquet = PageState.Loading; //宴会详情 |
| 78 | GetBanquetByIdNewSunModel banquetDetail; //宴会详情信息 | 78 | GetBanquetByIdNewSunModel banquetDetail; //宴会详情信息 |
| 79 | + dynamic banquetDetailMap; //宴会详情信息--接口原始数据 | ||
| 79 | 80 | ||
| 80 | List<GetBanquetByTimeSunModel> banquetHome; //宴会首页数据 | 81 | List<GetBanquetByTimeSunModel> banquetHome; //宴会首页数据 |
| 82 | + PageState pageStateBeFollow = PageState.Loading; //待跟进订单 | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 宴会待跟进 | ||
| 86 | + */ | ||
| 87 | + | ||
| 88 | + /// 设置丢单原因 | ||
| 89 | + Future<dynamic> setBanquetLost( | ||
| 90 | + BuildContext context, Map<String, String> params, | ||
| 91 | + {isShowLoading = true}) async { | ||
| 92 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 93 | + .request<dynamic>(context, Method.get, HttpUrl.set_banquet_lost, | ||
| 94 | + data: params, showLoading: isShowLoading) | ||
| 95 | + .catchError((error) { | ||
| 96 | + print(error.toString()); | ||
| 97 | + if (error is MyError) {} | ||
| 98 | + return false; | ||
| 99 | + }); | ||
| 100 | + if (baseResp.code == Constant.status_success) { | ||
| 101 | + // if (baseResp.data == 1) { | ||
| 102 | + // rid = baseResp.data['id']; | ||
| 103 | + return true; | ||
| 104 | + // } else { | ||
| 105 | + // return false; | ||
| 106 | + // } | ||
| 107 | + } else { | ||
| 108 | + if (baseResp != null) { | ||
| 109 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 110 | + } | ||
| 111 | + return false; | ||
| 112 | + } | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + /// 根据时间范围查询待跟进订单 | ||
| 116 | + Future<dynamic> getBanquetBeFollow( | ||
| 117 | + BuildContext context, Map<String, String> params, | ||
| 118 | + {isShowLoading = true}) async { | ||
| 119 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 120 | + .request<dynamic>(context, Method.get, HttpUrl.get_banquet_be_follow, | ||
| 121 | + data: params, showLoading: isShowLoading) | ||
| 122 | + .catchError((error) { | ||
| 123 | + print(error.toString()); | ||
| 124 | + if (error is MyError) { | ||
| 125 | + switch (error.type) { | ||
| 126 | + case 1: | ||
| 127 | + pageStateBeFollow = PageState.ConnectivityError; | ||
| 128 | + break; | ||
| 129 | + case 2: | ||
| 130 | + pageStateBeFollow = PageState.ConnectivityTimeOut; | ||
| 131 | + break; | ||
| 132 | + default: | ||
| 133 | + pageStateBeFollow = PageState.ConnectivityError; | ||
| 134 | + break; | ||
| 135 | + } | ||
| 136 | + } | ||
| 137 | + notifyListeners(); | ||
| 138 | + return false; | ||
| 139 | + }); | ||
| 140 | + if (baseResp.code == Constant.status_success) { | ||
| 141 | + // banquetHome = GetBanquetByTimeModel.fromJson(baseResp.responseData).data; | ||
| 142 | + | ||
| 143 | + // if (baseResp.data == 1) { | ||
| 144 | + // rid = baseResp.data['id']; | ||
| 145 | + if (banquetHome.length == 0) { | ||
| 146 | + pageStateBeFollow = PageState.Empty; | ||
| 147 | + } else { | ||
| 148 | + pageStateBeFollow = PageState.Success; | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + notifyListeners(); | ||
| 152 | + return true; | ||
| 153 | + // } else { | ||
| 154 | + // return false; | ||
| 155 | + // } | ||
| 156 | + } else { | ||
| 157 | + if (baseResp != null) { | ||
| 158 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 159 | + } | ||
| 160 | + pageStateBeFollow = PageState.ConnectivityError; | ||
| 161 | + notifyListeners(); | ||
| 162 | + return false; | ||
| 163 | + } | ||
| 164 | + } | ||
| 81 | 165 | ||
| 82 | /** | 166 | /** |
| 83 | * 宴会首页 | 167 | * 宴会首页 |
| @@ -411,6 +495,7 @@ class FeastModel extends ChangeNotifier { | @@ -411,6 +495,7 @@ class FeastModel extends ChangeNotifier { | ||
| 411 | if (baseResp.code == Constant.status_success) { | 495 | if (baseResp.code == Constant.status_success) { |
| 412 | banquetDetail = | 496 | banquetDetail = |
| 413 | GetBanquetByIdNewModel.fromJson(baseResp.responseData).data; | 497 | GetBanquetByIdNewModel.fromJson(baseResp.responseData).data; |
| 498 | + banquetDetailMap = baseResp.data; | ||
| 414 | 499 | ||
| 415 | // if (baseResp.data == 1) { | 500 | // if (baseResp.data == 1) { |
| 416 | // rid = baseResp.data['id']; | 501 | // rid = baseResp.data['id']; |
| @@ -855,9 +855,7 @@ class NavigatorUtil { | @@ -855,9 +855,7 @@ class NavigatorUtil { | ||
| 855 | 855 | ||
| 856 | ///宴会----新建宴会 | 856 | ///宴会----新建宴会 |
| 857 | static Future<dynamic> goFeastCreatePage(BuildContext context, | 857 | static Future<dynamic> goFeastCreatePage(BuildContext context, |
| 858 | - {replace = false, | ||
| 859 | - bool onlyShow = false, | ||
| 860 | - GetBanquetByIdNewSunModel banquetDetail}) { | 858 | + {replace = false, bool onlyShow = false, Map banquetDetail}) { |
| 861 | if (banquetDetail != null) { | 859 | if (banquetDetail != null) { |
| 862 | return _navigateTo(context, | 860 | return _navigateTo(context, |
| 863 | "${Routes.feast_create_page}?banquetDetail=${FluroConvertUtils.object2string(banquetDetail)}", | 861 | "${Routes.feast_create_page}?banquetDetail=${FluroConvertUtils.object2string(banquetDetail)}", |
| @@ -1369,8 +1369,18 @@ var feastCreatePageHandle = new Handler( | @@ -1369,8 +1369,18 @@ var feastCreatePageHandle = new Handler( | ||
| 1369 | 1369 | ||
| 1370 | GetBanquetByIdNewSunModel banquetDetail; | 1370 | GetBanquetByIdNewSunModel banquetDetail; |
| 1371 | if (params.keys.contains('banquetDetail')) { | 1371 | if (params.keys.contains('banquetDetail')) { |
| 1372 | - banquetDetail = GetBanquetByIdNewSunModel.fromJson(json.decode( | ||
| 1373 | - FluroConvertUtils.fluroCnParamsDecode(params["banquetDetail"].first))); | 1372 | + Map object = FluroConvertUtils.string2map(params["banquetDetail"].first); |
| 1373 | + Map<String, dynamic> temp = object['object']; | ||
| 1374 | + | ||
| 1375 | + // temp.forEach((key, value) { | ||
| 1376 | + // List<CookByIdSetmeal> cook = []; | ||
| 1377 | + // for (var item in value) { | ||
| 1378 | + // cook.add(CookByIdSetmeal.fromJson(item)); | ||
| 1379 | + // } | ||
| 1380 | + // justSelData[key] = cook; | ||
| 1381 | + // }); | ||
| 1382 | + | ||
| 1383 | + banquetDetail = GetBanquetByIdNewSunModel.fromJson(temp); | ||
| 1374 | } | 1384 | } |
| 1375 | return ChangeNotifierProvider<FeastModel>( | 1385 | return ChangeNotifierProvider<FeastModel>( |
| 1376 | create: (_) => FeastModel(), | 1386 | create: (_) => FeastModel(), |
-
Please register or login to post a comment