物品出户对接放行接口

hmxc
小赖 4 years ago
parent 22dcebf677
commit 110d479ce3

@ -86,4 +86,7 @@ class _Manage {
///id
String get goodsOutDetail => '/user/articleOut/findById';
///
String get goodsOutRelease => '/user/articleOut/release';
}

@ -26,6 +26,7 @@ import 'package:aku_community_manager/ui/sub_pages/items_outdoor/items_outdoor_c
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_notpass_page.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_pass_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:url_launcher/url_launcher.dart';
class ItemsOutdoorDetailsPage extends StatefulWidget {
final int id;
@ -134,7 +135,9 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
),
Divider(height: 1.w),
MaterialButton(
onPressed: () {},
onPressed: () {
launch('tel:${_model.applicantTel}');
},
elevation: 0,
child: Row(
mainAxisSize: MainAxisSize.min,
@ -319,10 +322,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
Spacer(),
AkuMaterialButton(
onPressed: () {
//TODO pass
// Get.to(OutdoorPassPage(
// model: widget.cardMedel,
// ));
Get.to(OutdoorPassPage(id: _model.id));
},
radius: 4.w,
color: Color(0xFFFFC40C),

@ -1,4 +1,6 @@
// Flutter imports:
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:flutter/material.dart';
// Package imports:
@ -15,30 +17,20 @@ import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class OutdoorPassPage extends StatefulWidget {
final ItemsOutdoorModel model;
OutdoorPassPage({Key key, @required this.model}) : super(key: key);
final int id;
OutdoorPassPage({Key key, this.id}) : super(key: key);
@override
_OutdoorPassPageState createState() => _OutdoorPassPageState();
}
class _OutdoorPassPageState extends State<OutdoorPassPage> {
TextEditingController _textController;
@override
void initState() {
super.initState();
_textController = TextEditingController();
}
@override
void dispose() {
_textController?.dispose();
super.dispose();
}
int _doorValue;
@override
Widget build(BuildContext context) {
String _currentTime = DateUtil.formatDate(DateTime.now());
String _currentTime =
DateUtil.formatDate(DateTime.now(), format: 'yyyy-MM-dd HH:mm');
return AkuScaffold(
title: '放行',
@ -86,21 +78,34 @@ class _OutdoorPassPageState extends State<OutdoorPassPage> {
),
AkuBox.w(32),
Expanded(
child: PopupMenuButton(
itemBuilder: (context) {
return [
PopupMenuItem(child: Text('东门'), value: 1),
PopupMenuItem(child: Text('南门'), value: 2),
PopupMenuItem(child: Text('西门'), value: 3),
PopupMenuItem(child: Text('北门'), value: 4),
];
},
onSelected: (value) {
_doorValue = value;
setState(() {});
},
child: Container(
height: double.infinity,
width: double.infinity,
padding: EdgeInsets.only(left: 48.w),
child: TextFormField(
controller: _textController,
maxLines: 1,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.sp,
child: Text(
_doorValue == null
? '请输入当前入口'
: {
1: '东门',
2: '南门',
3: '西门',
4: '北门',
}[_doorValue],
style: _doorValue == null
? AppStyle().secondaryTextStyle
: AppStyle().primaryStyle,
),
decoration: InputDecoration(
hintText: '请输入当前入口',
hintStyle: AppStyle().secondaryTextStyle,
border: InputBorder.none),
),
),
),
@ -110,15 +115,21 @@ class _OutdoorPassPageState extends State<OutdoorPassPage> {
],
),
bottom: AkuButton(
onPressed: _textController.text == null
onPressed: _doorValue == null
? () {
BotToast.showText(text: '出口不能为空!');
}
: () {
widget.model.finalOutTime = _currentTime;
widget.model.outPlace = _textController.text;
widget.model.datetime = DateTime.now();
widget.model.status = OUTDOORSTATUS.OUT_DONE;
: () async {
Function cancel = BotToast.showLoading();
NetUtil().post(
API.manage.goodsOutRelease,
params: {
'id': widget.id,
'export': _doorValue,
},
showMessage: true,
);
cancel();
Get.back();
Get.back();
},

Loading…
Cancel
Save