物品出户对接放行接口

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

@ -86,4 +86,7 @@ class _Manage {
///id ///id
String get goodsOutDetail => '/user/articleOut/findById'; 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_notpass_page.dart';
import 'package:aku_community_manager/ui/sub_pages/items_outdoor/outdoor_pass_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:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:url_launcher/url_launcher.dart';
class ItemsOutdoorDetailsPage extends StatefulWidget { class ItemsOutdoorDetailsPage extends StatefulWidget {
final int id; final int id;
@ -134,7 +135,9 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
), ),
Divider(height: 1.w), Divider(height: 1.w),
MaterialButton( MaterialButton(
onPressed: () {}, onPressed: () {
launch('tel:${_model.applicantTel}');
},
elevation: 0, elevation: 0,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -319,10 +322,7 @@ class _ItemsOutdoorDetailsPageState extends State<ItemsOutdoorDetailsPage> {
Spacer(), Spacer(),
AkuMaterialButton( AkuMaterialButton(
onPressed: () { onPressed: () {
//TODO pass Get.to(OutdoorPassPage(id: _model.id));
// Get.to(OutdoorPassPage(
// model: widget.cardMedel,
// ));
}, },
radius: 4.w, radius: 4.w,
color: Color(0xFFFFC40C), color: Color(0xFFFFC40C),

@ -1,4 +1,6 @@
// Flutter imports: // 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'; import 'package:flutter/material.dart';
// Package imports: // 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'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
class OutdoorPassPage extends StatefulWidget { class OutdoorPassPage extends StatefulWidget {
final ItemsOutdoorModel model; final int id;
OutdoorPassPage({Key key, @required this.model}) : super(key: key);
OutdoorPassPage({Key key, this.id}) : super(key: key);
@override @override
_OutdoorPassPageState createState() => _OutdoorPassPageState(); _OutdoorPassPageState createState() => _OutdoorPassPageState();
} }
class _OutdoorPassPageState extends State<OutdoorPassPage> { class _OutdoorPassPageState extends State<OutdoorPassPage> {
TextEditingController _textController; int _doorValue;
@override
void initState() {
super.initState();
_textController = TextEditingController();
}
@override
void dispose() {
_textController?.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String _currentTime = DateUtil.formatDate(DateTime.now()); String _currentTime =
DateUtil.formatDate(DateTime.now(), format: 'yyyy-MM-dd HH:mm');
return AkuScaffold( return AkuScaffold(
title: '放行', title: '放行',
@ -86,21 +78,34 @@ class _OutdoorPassPageState extends State<OutdoorPassPage> {
), ),
AkuBox.w(32), AkuBox.w(32),
Expanded( 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( child: Container(
height: double.infinity,
width: double.infinity,
padding: EdgeInsets.only(left: 48.w), padding: EdgeInsets.only(left: 48.w),
child: TextFormField( child: Text(
controller: _textController, _doorValue == null
maxLines: 1, ? '请输入当前入口'
style: TextStyle( : {
color: AppStyle.primaryTextColor, 1: '东门',
fontSize: 32.sp, 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( bottom: AkuButton(
onPressed: _textController.text == null onPressed: _doorValue == null
? () { ? () {
BotToast.showText(text: '出口不能为空!'); BotToast.showText(text: '出口不能为空!');
} }
: () { : () async {
widget.model.finalOutTime = _currentTime; Function cancel = BotToast.showLoading();
widget.model.outPlace = _textController.text; NetUtil().post(
widget.model.datetime = DateTime.now(); API.manage.goodsOutRelease,
widget.model.status = OUTDOORSTATUS.OUT_DONE; params: {
'id': widget.id,
'export': _doorValue,
},
showMessage: true,
);
cancel();
Get.back(); Get.back();
Get.back(); Get.back();
}, },

Loading…
Cancel
Save