|
...
|
...
|
@@ -9,6 +9,7 @@ import 'package:provider/provider.dart'; |
|
|
|
|
|
|
|
import '../../constant/state.dart';
|
|
|
|
import '../../provider/feast_model.dart';
|
|
|
|
import '../../provider/user_model.dart';
|
|
|
|
import '../../utils/screen_util.dart';
|
|
|
|
import '../../utils/utils.dart';
|
|
|
|
import '../../widgets/MyDivider.dart';
|
|
...
|
...
|
@@ -28,11 +29,83 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
FeastModel feastModel;
|
|
|
|
|
|
|
|
TextEditingController editingController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController priceC = TextEditingController(); //退款金额
|
|
|
|
TextEditingController collectionC = TextEditingController(); //收款人
|
|
|
|
int czSelIndex;
|
|
|
|
List<String> payType = []; //支付方式
|
|
|
|
int payTypeIndex;
|
|
|
|
TextEditingController _cancelController = TextEditingController(); //备注
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
payType = ['现金', '刷卡', '微信', '支付宝', '转账'];
|
|
|
|
|
|
|
|
Utils.changeStatusColor(color: MyColours.color_438E93);
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// _searchBanquetDeposit();
|
|
|
|
_getSellerUserBySellerid();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///获取经理数据 ---- 接单人---全部员工
|
|
|
|
|
|
|
|
Future<bool> _getSellerUserBySellerid() async {
|
|
|
|
bool success = await feastModel.getAuthUserLists(context);
|
|
|
|
|
|
|
|
if (success) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 根据时间范围查询待跟进订单
|
|
|
|
_searchBanquetDeposit() async {
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
'no': editingController.text
|
|
|
|
}; //
|
|
|
|
bool success = await feastModel.searchBanquetDeposit(context, pramas);
|
|
|
|
if (success) {
|
|
|
|
// _uploadImageProvider.feastRemarkContractImageList = [];
|
|
|
|
// feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
|
|
|
|
// UploadImgModel uploadImgModel = UploadImgModel();
|
|
|
|
// uploadImgModel.process = 1;
|
|
|
|
// uploadImgModel.qiniuUrl = element.url;
|
|
|
|
// _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
|
|
|
|
// });
|
|
|
|
// setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 退定金
|
|
|
|
_bankBanquetDeposit() async {
|
|
|
|
Map<String, String> pramas = {
|
|
|
|
'id': feastModel.depositsManagesData.depositId, //定金id
|
|
|
|
"rid": feastModel.depositsManagesData.id, //宴会id
|
|
|
|
'price': priceC.text,
|
|
|
|
'uid': feastModel.sellerManageList[czSelIndex].id,
|
|
|
|
'pay': payType[payTypeIndex], //支付方式
|
|
|
|
'collection': collectionC.text,
|
|
|
|
'reamrk': _cancelController.text
|
|
|
|
}; //
|
|
|
|
print(pramas);
|
|
|
|
bool success = await feastModel.bankBanquetDeposit(context, pramas);
|
|
|
|
if (success) {
|
|
|
|
priceC.text = '';
|
|
|
|
collectionC.text = '';
|
|
|
|
_searchBanquetDeposit();
|
|
|
|
// _uploadImageProvider.feastRemarkContractImageList = [];
|
|
|
|
// feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
|
|
|
|
// UploadImgModel uploadImgModel = UploadImgModel();
|
|
|
|
// uploadImgModel.process = 1;
|
|
|
|
// uploadImgModel.qiniuUrl = element.url;
|
|
|
|
// _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
|
|
|
|
// });
|
|
|
|
// setState(() {});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget buildFeastTypeHeader() {
|
|
...
|
...
|
@@ -106,7 +179,15 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
)),
|
|
|
|
),
|
|
|
|
RoundButton(
|
|
|
|
onPressed: () async {},
|
|
|
|
onPressed: () async {
|
|
|
|
if (editingController.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入收据编号');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode());
|
|
|
|
|
|
|
|
_searchBanquetDeposit();
|
|
|
|
},
|
|
|
|
text: '搜索',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
...
|
...
|
@@ -126,10 +207,12 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
|
|
|
|
Widget buildFeastTypeItem() {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
|
|
|
|
// height: h(99 * 2),
|
|
|
|
// margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_f3f3f3, width: ScreenUtil().setWidth(2)),
|
|
|
|
color: MyColours.color_ffffff, width: ScreenUtil().setWidth(2)),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: MyColours.color_1F000000,
|
|
...
|
...
|
@@ -154,14 +237,14 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'8月1日 午餐',
|
|
|
|
'${feastModel.depositsManagesData.ddateStr}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_F6F6F6,
|
|
|
|
fontSize: ScreenUtil().setSp(40)),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
'婚宴',
|
|
|
|
'${feastModel.depositsManagesData.className}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_F6F6F6,
|
|
...
|
...
|
@@ -186,11 +269,9 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
Wrap(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'[定金2000]',
|
|
|
|
'[定金${feastModel.depositsManagesData.depositPrice}]',
|
|
|
|
style: TextStyle(
|
|
|
|
color: true
|
|
|
|
? MyColours.color_00A870
|
|
|
|
: MyColours.color_E34D59,
|
|
|
|
color: MyColours.color_00A870,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
],
|
|
...
|
...
|
@@ -200,7 +281,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'方先生 负责人:刘经理',
|
|
|
|
'${feastModel.depositsManagesData.rname} 跟单经理:${feastModel.depositsManagesData.nickName ?? feastModel.depositsManagesData.account}',
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_000000,
|
|
...
|
...
|
@@ -208,18 +289,36 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
),
|
|
|
|
RoundButton(
|
|
|
|
onPressed: () async {
|
|
|
|
if (feastModel.depositsManagesData.depositPrice ==
|
|
|
|
'0') {
|
|
|
|
//已经全额退款,不再点击
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_showCancelWidget(context);
|
|
|
|
},
|
|
|
|
text: '退定金',
|
|
|
|
text: feastModel.depositsManagesData.depositPrice == '0'
|
|
|
|
? '已全额退回'
|
|
|
|
: '退定金',
|
|
|
|
fontSize: 28,
|
|
|
|
isBold: false,
|
|
|
|
height: h(28),
|
|
|
|
width: w(58),
|
|
|
|
// padding: EdgeInsets.symmetric(horizontal: w(8)),
|
|
|
|
width: feastModel.depositsManagesData.depositPrice == '0'
|
|
|
|
?w(86): w(58),
|
|
|
|
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
|
|
|
|
textColor: MyColours.color_F6F6F6,
|
|
|
|
gradientStart: MyColours.color_E34D59,
|
|
|
|
gradientEnd: MyColours.color_E34D59,
|
|
|
|
borderColor: MyColours.color_E34D59,
|
|
|
|
gradientStart:
|
|
|
|
feastModel.depositsManagesData.depositPrice == '0'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_E34D59,
|
|
|
|
gradientEnd:
|
|
|
|
feastModel.depositsManagesData.depositPrice == '0'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_E34D59,
|
|
|
|
borderColor:
|
|
|
|
feastModel.depositsManagesData.depositPrice == '0'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_E34D59,
|
|
|
|
radius: r(4),
|
|
|
|
),
|
|
|
|
],
|
|
...
|
...
|
@@ -235,7 +334,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
///取消预订弹框
|
|
|
|
_showCancelWidget(context) {
|
|
|
|
ScrollController _scrollController = ScrollController();
|
|
|
|
TextEditingController _cancelController = TextEditingController();
|
|
|
|
|
|
|
|
FocusNode _cancelNode = FocusNode();
|
|
|
|
|
|
|
|
bool showPerson = true;
|
|
...
|
...
|
@@ -261,6 +360,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
// Navigator.of(context).pop();
|
|
|
|
// },
|
|
|
|
child: Center(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Stack(children: [
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
...
|
...
|
@@ -289,7 +389,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
_textfield('退款金额', '请输入', null, null, '元'),
|
|
|
|
_textfield('退款金额', '请输入', priceC, null, '元'),
|
|
|
|
_selectWidget('操作人', person, onTap: () {
|
|
|
|
state(() {
|
|
|
|
showType = true;
|
|
...
|
...
|
@@ -302,7 +402,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
showType = !showType;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
_textfield('收款人', '请输入', null, null, '',
|
|
|
|
_textfield('收款人', '请输入', collectionC, null, '',
|
|
|
|
inputType: TextInputType.text),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
...
|
...
|
@@ -346,7 +446,7 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
// border: InputBorder.none,
|
|
|
|
|
|
|
|
onChanged: (_) {
|
|
|
|
setState(() {});
|
|
|
|
state(() {});
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
...
|
...
|
@@ -394,10 +494,46 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
fontSize: 32,
|
|
|
|
isBold: true,
|
|
|
|
onPressed: () {
|
|
|
|
if (priceC.text.trim().length == 0) {
|
|
|
|
Utils.showToast('请输入退款金额');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
bool isNumber = Utils.isNumeric(
|
|
|
|
priceC.text); //判断输入的内容是否是数字
|
|
|
|
if (!isNumber) {
|
|
|
|
Utils.showToast('退款金额请输入数字');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (double.parse(priceC.text) >
|
|
|
|
double.parse(feastModel
|
|
|
|
.depositsManagesData
|
|
|
|
.depositPrice)) {
|
|
|
|
//如果超过可退金额,自动把可退金额赋值给输入框
|
|
|
|
priceC.text = feastModel
|
|
|
|
.depositsManagesData
|
|
|
|
.depositPrice;
|
|
|
|
state(() {});
|
|
|
|
Utils.showToast(
|
|
|
|
'超过最大可退金额,已为您修改为最大金额');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (person == '请选择') {
|
|
|
|
Utils.showToast('请选择操作人');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (type == '请选择') {
|
|
|
|
Utils.showToast('请选择退款方式');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (collectionC.text.trim().length ==
|
|
|
|
0) {
|
|
|
|
Utils.showToast('请输入收款人');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
Loading.showLoading(context);
|
|
|
|
|
|
|
|
// setReserveStatus('4', desc: desc);
|
|
|
|
_bankBanquetDeposit();
|
|
|
|
}),
|
|
|
|
])
|
|
|
|
],
|
|
...
|
...
|
@@ -411,10 +547,16 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: selectWidgetTableManage(
|
|
|
|
['dffd', 'fdf'], (index) {
|
|
|
|
feastModel.sellerManageList.map((item) {
|
|
|
|
return item.title;
|
|
|
|
}).toList(), (index) {
|
|
|
|
state(() {
|
|
|
|
showPerson = !showPerson;
|
|
|
|
person = ['dffd', 'fdf'][index];
|
|
|
|
czSelIndex = index;
|
|
|
|
person = feastModel.sellerManageList
|
|
|
|
.map((item) {
|
|
|
|
return item.title;
|
|
|
|
}).toList()[index];
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
))),
|
|
...
|
...
|
@@ -425,29 +567,17 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
offstage: showType,
|
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: selectWidgetTableManage([
|
|
|
|
'dffd',
|
|
|
|
'fdf',
|
|
|
|
'dffd',
|
|
|
|
'fdf',
|
|
|
|
'dffd',
|
|
|
|
'fdf'
|
|
|
|
], (index) {
|
|
|
|
child:
|
|
|
|
selectWidgetTableManage(payType, (index) {
|
|
|
|
state(() {
|
|
|
|
showType = !showType;
|
|
|
|
type = [
|
|
|
|
'dffd',
|
|
|
|
'fdf',
|
|
|
|
'dffd',
|
|
|
|
'fdf',
|
|
|
|
'dffd',
|
|
|
|
'fdf'
|
|
|
|
][index];
|
|
|
|
payTypeIndex = index;
|
|
|
|
type = payType[index];
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
))),
|
|
|
|
]),
|
|
|
|
));
|
|
|
|
)));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
}
|
|
...
|
...
|
@@ -708,7 +838,6 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
feastModel = Provider.of<FeastModel>(context);
|
|
|
|
feastModel.pageStateDepositData = PageState.Success;
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
...
|
...
|
@@ -720,70 +849,65 @@ class _FeastDepositDataPageState extends State<FeastDepositDataPage> { |
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: NestedScrollView(
|
|
|
|
// controller: _scrollViewController,
|
|
|
|
headerSliverBuilder:
|
|
|
|
(BuildContext context, bool innerBoxIsScrolled) {
|
|
|
|
return <Widget>[
|
|
|
|
SliverAppBar(
|
|
|
|
pinned: true,
|
|
|
|
floating: false,
|
|
|
|
leading: null,
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
// expandedHeight: ScreenUtil().setWidth(128 * 2),
|
|
|
|
automaticallyImplyLeading: false,
|
|
|
|
toolbarHeight: ScreenUtil().setWidth(64 * 2),
|
|
|
|
title: buildFeastTypeHeader(),
|
|
|
|
// flexibleSpace: FlexibleSpaceBar(
|
|
|
|
// collapseMode: CollapseMode.pin,
|
|
|
|
// title: buildFeastTypeHeader())
|
|
|
|
)
|
|
|
|
];
|
|
|
|
}, body: Consumer<FeastModel>(builder: (context, model, _) {
|
|
|
|
if (model.pageStateDepositData != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateDepositData,
|
|
|
|
callback: () {
|
|
|
|
// _getWine();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有定金数据哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return ListView.builder(
|
|
|
|
itemCount: 100,
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
// WineSunModel data = feastModel.wineData[index];
|
|
|
|
return buildFeastTypeItem();
|
|
|
|
// '剑南春52度500ml', '1150元/份 不可议价'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}))),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: _callButton(
|
|
|
|
onPress: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
content: '回到今天',
|
|
|
|
hasLeftBorder: true,
|
|
|
|
isSelect: false)),
|
|
|
|
Expanded(
|
|
|
|
child: _callButton(
|
|
|
|
onPress: () {},
|
|
|
|
content: '创建宴会',
|
|
|
|
hasLeftBorder: true,
|
|
|
|
isSelect: true))
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
body: Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
|
|
|
|
child: Column(children: [
|
|
|
|
buildFeastTypeHeader(),
|
|
|
|
VEmptyView(66),
|
|
|
|
feastModel.depositsManagesData == null
|
|
|
|
? SizedBox()
|
|
|
|
: buildFeastTypeItem()
|
|
|
|
]),
|
|
|
|
// ) NestedScrollView(
|
|
|
|
// // controller: _scrollViewController,
|
|
|
|
// headerSliverBuilder:
|
|
|
|
// (BuildContext context, bool innerBoxIsScrolled) {
|
|
|
|
// return <Widget>[
|
|
|
|
// SliverAppBar(
|
|
|
|
// pinned: true,
|
|
|
|
// floating: false,
|
|
|
|
// leading: null,
|
|
|
|
// backgroundColor: MyColours.color_ffffff,
|
|
|
|
// // expandedHeight: ScreenUtil().setWidth(128 * 2),
|
|
|
|
// automaticallyImplyLeading: false,
|
|
|
|
// toolbarHeight: ScreenUtil().setWidth(64 * 2),
|
|
|
|
// title: buildFeastTypeHeader(),
|
|
|
|
// // flexibleSpace: FlexibleSpaceBar(
|
|
|
|
// // collapseMode: CollapseMode.pin,
|
|
|
|
// // title: buildFeastTypeHeader())
|
|
|
|
// )
|
|
|
|
// ];
|
|
|
|
// },
|
|
|
|
// body:
|
|
|
|
// // Consumer<FeastModel>(builder: (context, model, _) {
|
|
|
|
// // if (model.pageStateDepositData != PageState.Success) {
|
|
|
|
// // return ExceptionPage(
|
|
|
|
// // pageState: model.pageStateDepositData,
|
|
|
|
// // callback: () {
|
|
|
|
// // // _getWine();
|
|
|
|
// // },
|
|
|
|
// // emptyMsg: "暂时没有定金数据哦",
|
|
|
|
// // emptyImg: "empty_search",
|
|
|
|
// // showMsg: "加载中,请稍后...",
|
|
|
|
// // );
|
|
|
|
// // } else {
|
|
|
|
// // return
|
|
|
|
// feastModel.depositsManagesData == null
|
|
|
|
// ? SizedBox()
|
|
|
|
// : Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: w(12), top: w(19), right: w(12)),
|
|
|
|
// child: buildFeastTypeItem())
|
|
|
|
// // return ListView.builder(
|
|
|
|
// // itemCount: 100,
|
|
|
|
// // padding: EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
|
|
|
|
// // itemBuilder: (BuildContext context, int index) {
|
|
|
|
// // // WineSunModel data = feastModel.wineData[index];
|
|
|
|
// // return ;
|
|
|
|
// // // '剑南春52度500ml', '1150元/份 不可议价'
|
|
|
|
// // });
|
|
|
|
// // }
|
|
|
|
// // })
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|