|
|
|
import 'dart:convert' as convert;
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:one_key/models/set_xuan_tai_model.dart';
|
|
|
|
import 'package:one_key/models/upload_img_model.dart';
|
|
|
|
import 'package:one_key/utils/ConvertNumberToChineseMoneyWords.dart';
|
|
|
|
import 'package:one_key/models/table_list.dart' as t;
|
|
|
|
|
|
|
|
class GetBanquetByIdNewModel {
|
|
|
|
int ret;
|
|
...
|
...
|
@@ -71,7 +74,8 @@ class GetBanquetByIdNewSunModel { |
|
|
|
costInfo = <CostInfoModel>[];
|
|
|
|
if (json['cost_info'] != null && json['cost_info'].length > 0) {
|
|
|
|
double totalP = 0.0;
|
|
|
|
json['cost_info'].forEach((key, v) {
|
|
|
|
Map map = json['cost_info'];
|
|
|
|
map.forEach((key, v) {
|
|
|
|
CostInfoModel model = CostInfoModel.fromJson(v);
|
|
|
|
model.title = '${key}费用';
|
|
|
|
int start = key.indexOf('第');
|
|
...
|
...
|
@@ -86,7 +90,7 @@ class GetBanquetByIdNewSunModel { |
|
|
|
model.servicetype = info.servicetype;
|
|
|
|
model.serviceper = info.serviceper;
|
|
|
|
model.serviceprice = info.serviceprice;
|
|
|
|
model.totalPrice = info.totalprice;
|
|
|
|
model.totalprice = info.totalprice;
|
|
|
|
model.service = info.servicetype == '1' ? true : false;
|
|
|
|
model.discount = info.discounttype == '1' ? true : false;
|
|
|
|
costInfo.add(model);
|
|
...
|
...
|
@@ -129,7 +133,10 @@ class BasicInfo { |
|
|
|
Jiedan jiedan;
|
|
|
|
Jiedan staff;
|
|
|
|
String classify;
|
|
|
|
List<ImagesById> images;
|
|
|
|
List<Images> images;
|
|
|
|
String warrantId; //担保人id
|
|
|
|
List<Images> warrantImages; //担保图片
|
|
|
|
String warrantDesc; //担保说明
|
|
|
|
|
|
|
|
BasicInfo(
|
|
|
|
{this.ddate,
|
|
...
|
...
|
@@ -140,7 +147,10 @@ class BasicInfo { |
|
|
|
this.jiedan,
|
|
|
|
this.staff,
|
|
|
|
this.classify,
|
|
|
|
this.images});
|
|
|
|
this.images,
|
|
|
|
this.warrantId,
|
|
|
|
this.warrantImages,
|
|
|
|
this.warrantDesc});
|
|
|
|
|
|
|
|
BasicInfo.fromJson(Map<String, dynamic> json) {
|
|
|
|
ddate = json['ddate'];
|
|
...
|
...
|
@@ -153,17 +163,32 @@ class BasicInfo { |
|
|
|
staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null;
|
|
|
|
classify = json['classify'];
|
|
|
|
if (json['images'] != null) {
|
|
|
|
images = <ImagesById>[];
|
|
|
|
images = <Images>[];
|
|
|
|
if (json['images'] is List) {
|
|
|
|
json['images'].forEach((v) {
|
|
|
|
images.add(new ImagesById.fromJson(v));
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
convert.jsonDecode(json['images']).forEach((v) {
|
|
|
|
images.add(new ImagesById.fromJson(v));
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
warrantId = json['warrant_id'];
|
|
|
|
|
|
|
|
if (json['warrant_images'] != null) {
|
|
|
|
warrantImages = <Images>[];
|
|
|
|
if (json['warrant_images'] is List) {
|
|
|
|
json['warrant_images'].forEach((v) {
|
|
|
|
warrantImages.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
convert.jsonDecode(json['warrant_images']).forEach((v) {
|
|
|
|
warrantImages.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
warrantDesc = json['warrant_desc'];
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
...
|
...
|
@@ -212,7 +237,7 @@ class SessionsInfo { |
|
|
|
List<WineDetail> wine;
|
|
|
|
List<OtherDetail> other;
|
|
|
|
String remark;
|
|
|
|
List<ImagesById> images;
|
|
|
|
List<Images> images;
|
|
|
|
dynamic tableNum;
|
|
|
|
String servicetype;
|
|
|
|
String serviceper;
|
|
...
|
...
|
@@ -221,6 +246,57 @@ class SessionsInfo { |
|
|
|
String discountper;
|
|
|
|
String discountprice;
|
|
|
|
String totalprice;
|
|
|
|
String id; //场次ID
|
|
|
|
String rid; //宴会ID
|
|
|
|
String qrdate; //开始时间
|
|
|
|
String jedate; //结束时间
|
|
|
|
String ddateInterval; //餐段(0不代餐,1早餐,2午餐,3晚餐)
|
|
|
|
String reserveOrder; //第一场、第二场
|
|
|
|
List<Tids> tids; // 桌位信息
|
|
|
|
List<Setmeal> setmeals; // 套餐信息
|
|
|
|
List<Wine> wines; // 酒水信息
|
|
|
|
List<Other> others; // 酒水信息
|
|
|
|
|
|
|
|
String get cdStr {
|
|
|
|
switch (ddateInterval) {
|
|
|
|
case '0':
|
|
|
|
return '不带餐';
|
|
|
|
break;
|
|
|
|
case '1':
|
|
|
|
return '早餐';
|
|
|
|
break;
|
|
|
|
case '2':
|
|
|
|
return '午餐';
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
return '晚餐';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
List<t.TableList> get tableList {
|
|
|
|
List<t.TableList> tableList = [];
|
|
|
|
tids.forEach((element) {
|
|
|
|
t.TableList tmodel = t.TableList(
|
|
|
|
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
|
|
|
|
tmodel.id = element.tid;
|
|
|
|
tmodel.name = element.name;
|
|
|
|
tableList.add(tmodel);
|
|
|
|
});
|
|
|
|
return tableList;
|
|
|
|
}
|
|
|
|
|
|
|
|
List<UploadImgModel> get feastRemarkImages {
|
|
|
|
List<UploadImgModel> upload = [];
|
|
|
|
images.forEach((element) {
|
|
|
|
UploadImgModel model = UploadImgModel();
|
|
|
|
model.process = 1;
|
|
|
|
model.qiniuUrl = element.url;
|
|
|
|
upload.add(model);
|
|
|
|
});
|
|
|
|
return upload;
|
|
|
|
}
|
|
|
|
|
|
|
|
SessionsInfo(
|
|
|
|
{this.rdate,
|
|
...
|
...
|
@@ -237,7 +313,17 @@ class SessionsInfo { |
|
|
|
this.discounttype,
|
|
|
|
this.discountper,
|
|
|
|
this.discountprice,
|
|
|
|
this.totalprice});
|
|
|
|
this.totalprice,
|
|
|
|
this.id,
|
|
|
|
this.rid,
|
|
|
|
this.qrdate,
|
|
|
|
this.jedate,
|
|
|
|
this.ddateInterval,
|
|
|
|
this.reserveOrder,
|
|
|
|
this.tids,
|
|
|
|
this.setmeals,
|
|
|
|
this.wines,
|
|
|
|
this.others});
|
|
|
|
|
|
|
|
SessionsInfo.fromJson(Map<String, dynamic> json) {
|
|
|
|
rdate = json['rdate'];
|
|
...
|
...
|
@@ -263,14 +349,14 @@ class SessionsInfo { |
|
|
|
remark = json['remark'];
|
|
|
|
|
|
|
|
if (json['images'] != null) {
|
|
|
|
images = <ImagesById>[];
|
|
|
|
images = <Images>[];
|
|
|
|
if (json['images'] is List) {
|
|
|
|
json['images'].forEach((v) {
|
|
|
|
images.add(new ImagesById.fromJson(v));
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
convert.jsonDecode(json['images']).forEach((v) {
|
|
|
|
images.add(new ImagesById.fromJson(v));
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -283,6 +369,45 @@ class SessionsInfo { |
|
|
|
discountper = json['discount_per'];
|
|
|
|
discountprice = json['discount_price'];
|
|
|
|
totalprice = json['total_price'];
|
|
|
|
|
|
|
|
//解析session新加字段,下午做
|
|
|
|
id = json['id'];
|
|
|
|
rid = json['rid'];
|
|
|
|
qrdate = json['_rdate'];
|
|
|
|
jedate = json['_edate'];
|
|
|
|
ddateInterval = json['ddate_interval'];
|
|
|
|
reserveOrder = json['reserve_order'];
|
|
|
|
if (json['images'] != null) {
|
|
|
|
images = <Images>[];
|
|
|
|
|
|
|
|
convert.jsonDecode(json['images']).forEach((v) {
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (json['tableData'] != null) {
|
|
|
|
tids = <Tids>[];
|
|
|
|
convert.jsonDecode(json['tableData']).forEach((v) {
|
|
|
|
tids.add(new Tids.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (json['setmealData'] != null) {
|
|
|
|
setmeals = <Setmeal>[];
|
|
|
|
convert.jsonDecode(json['setmealData']).forEach((v) {
|
|
|
|
setmeals.add(new Setmeal.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (json['wineData'] != null) {
|
|
|
|
wines = <Wine>[];
|
|
|
|
convert.jsonDecode(json['wineData']).forEach((v) {
|
|
|
|
wines.add(new Wine.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
if (json['otherData'] != null) {
|
|
|
|
others = <Other>[];
|
|
|
|
convert.jsonDecode(json['otherData']).forEach((v) {
|
|
|
|
others.add(new Other.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
...
|
...
|
@@ -308,6 +433,25 @@ class SessionsInfo { |
|
|
|
data['discount_per'] = this.discountper;
|
|
|
|
data['discount_price'] = this.discountprice;
|
|
|
|
data['total_price'] = this.totalprice;
|
|
|
|
data['id'] = this.id;
|
|
|
|
data['rid'] = this.rid;
|
|
|
|
data['_rdate'] = this.qrdate;
|
|
|
|
data['_edate'] = this.jedate;
|
|
|
|
data['ddate_interval'] = this.ddateInterval;
|
|
|
|
data['reserve_order'] = this.reserveOrder;
|
|
|
|
|
|
|
|
if (this.tids != null) {
|
|
|
|
data['tableData'] = this.tids.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
if (this.setmeals != null) {
|
|
|
|
data['setmealData'] = this.setmeal.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
if (this.wines != null) {
|
|
|
|
data['wineData'] = this.wine.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
if (this.others != null) {
|
|
|
|
data['otherData'] = this.other.map((v) => v.toJson()).toList();
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -433,7 +577,7 @@ class CostInfoModel { |
|
|
|
|
|
|
|
TextEditingController serviceC = TextEditingController();
|
|
|
|
TextEditingController discountC = TextEditingController();
|
|
|
|
String totalPrice; //合计
|
|
|
|
String totalPriceSelf; //合计
|
|
|
|
String sumPrice; //优惠和服务费之前的金额
|
|
|
|
String servicetype;
|
|
|
|
String serviceper;
|
|
...
|
...
|
@@ -441,7 +585,7 @@ class CostInfoModel { |
|
|
|
String discounttype;
|
|
|
|
String discountper;
|
|
|
|
String discountprice;
|
|
|
|
String totalprice;
|
|
|
|
String totalprice; //接口获取到的值,在详情展示
|
|
|
|
|
|
|
|
//详情用的服务费展示
|
|
|
|
String get showService {
|
|
...
|
...
|
@@ -471,7 +615,7 @@ class CostInfoModel { |
|
|
|
|
|
|
|
if (discount) {
|
|
|
|
//选中固定金额
|
|
|
|
return discountprice;
|
|
|
|
return '-${discountprice} 元';
|
|
|
|
} else {
|
|
|
|
//选中百分比
|
|
|
|
|
|
...
|
...
|
@@ -492,7 +636,7 @@ class CostInfoModel { |
|
|
|
data.add(sunModel);
|
|
|
|
});
|
|
|
|
sumPrice = price.toString();
|
|
|
|
totalPrice = sumPrice;
|
|
|
|
totalPriceSelf = sumPrice;
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
...
|
...
|
@@ -546,7 +690,7 @@ class ContractInfo { |
|
|
|
String contractRname;
|
|
|
|
String contractSellerName;
|
|
|
|
String contractNo;
|
|
|
|
List<ImagesById> contractImages;
|
|
|
|
List<Images> contractImages;
|
|
|
|
TextEditingController contractFinalPriceC = TextEditingController();
|
|
|
|
TextEditingController customerC = TextEditingController(); //客户签约人
|
|
|
|
TextEditingController storeC = TextEditingController(); //店铺签约人
|
|
...
|
...
|
@@ -568,14 +712,14 @@ class ContractInfo { |
|
|
|
contractNo = json['contract_no'];
|
|
|
|
|
|
|
|
if (json['contract_images'] != null) {
|
|
|
|
contractImages = <ImagesById>[];
|
|
|
|
contractImages = <Images>[];
|
|
|
|
if (json['contract_images'] is List) {
|
|
|
|
json['contract_images'].forEach((v) {
|
|
|
|
contractImages.add(new ImagesById.fromJson(v));
|
|
|
|
contractImages.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
convert.jsonDecode(json['contract_images']).forEach((v) {
|
|
|
|
contractImages.add(new ImagesById.fromJson(v));
|
|
|
|
contractImages.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
...
|
...
|
@@ -593,21 +737,21 @@ class ContractInfo { |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class ImagesById {
|
|
|
|
String url;
|
|
|
|
// class Images {
|
|
|
|
// String url;
|
|
|
|
|
|
|
|
ImagesById({this.url});
|
|
|
|
// Images({this.url});
|
|
|
|
|
|
|
|
ImagesById.fromJson(Map<String, dynamic> json) {
|
|
|
|
url = json['url'];
|
|
|
|
}
|
|
|
|
// Images.fromJson(Map<String, dynamic> json) {
|
|
|
|
// url = json['url'];
|
|
|
|
// }
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
|
|
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
data['url'] = this.url;
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Map<String, dynamic> toJson() {
|
|
|
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
|
|
// data['url'] = this.url;
|
|
|
|
// return data;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
class Invoice {
|
|
|
|
String invoiceType; // "1 普通 2 专用",
|
|
...
|
...
|
@@ -623,7 +767,7 @@ class Invoice { |
|
|
|
String addresseePhone; //收件人电话
|
|
|
|
String addresseeAddress; //收件人地址
|
|
|
|
String code; //邮编
|
|
|
|
List<ImagesById> images;
|
|
|
|
List<Images> images;
|
|
|
|
|
|
|
|
Invoice(
|
|
|
|
{this.invoiceType,
|
|
...
|
...
|
@@ -656,14 +800,14 @@ class Invoice { |
|
|
|
addresseeAddress = json['addressee_address'];
|
|
|
|
code = json['code'];
|
|
|
|
if (json['images'] != null) {
|
|
|
|
images = <ImagesById>[];
|
|
|
|
images = <Images>[];
|
|
|
|
if (json['images'] is List) {
|
|
|
|
json['images'].forEach((v) {
|
|
|
|
images.add(new ImagesById.fromJson(v));
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
convert.jsonDecode(json['images']).forEach((v) {
|
|
|
|
images.add(new ImagesById.fromJson(v));
|
|
|
|
images.add(new Images.fromJson(v));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
...
|
...
|
|