对接: 借还管理 删除物品 明细信息

hmxc
张萌 4 years ago
parent 34fa3693e8
commit e8df4c569a

@ -177,6 +177,8 @@ class _Manage {
/// ///
String get insertArticle => '/user/borrow/insertArticle'; String get insertArticle => '/user/borrow/insertArticle';
///
String get borrowDelete => '/user/borrow/delete';
} }
class _Upload { class _Upload {

@ -35,48 +35,12 @@ class AddBorrowObjectPage extends StatefulWidget {
class _AddBorrowObjectPageState extends State<AddBorrowObjectPage> { class _AddBorrowObjectPageState extends State<AddBorrowObjectPage> {
TextEditingController _textEditingController = TextEditingController(); TextEditingController _textEditingController = TextEditingController();
// TextEditingController _numberController = TextEditingController();
File file; File file;
// List<BorrowObject> get objects => BorrowData.borrowObjects;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold( return AkuScaffold(
title: '新增总类', title: '新增总类',
// actions: [
// userProvider.userInfoModel.role != USER_ROLE.MANAGER
// ? AkuMaterialButton(
// minWidth: 120.w,
// onPressed: () {
// if (TextUtil.isEmpty(_textEditingController.text)) {
// BotToast.showText(text: '名称不能为空');
// } else if (file == null) {
// BotToast.showText(text: '图片不能为空');
// } else if (int.tryParse(_numberController.text) == null) {
// BotToast.showText(text: '数量错误');
// } else {
// objects.insert(
// 0,
// BorrowObject.init(
// name: _textEditingController.text,
// allNumber: int.parse(_numberController.text),
// assetPath: file,
// ),
// );
// Get.back();
// }
// },
// child: Text(
// '完成',
// style: TextStyle(
// fontSize: 28.w,
// color: AppStyle.primaryTextColor,
// ),
// ),
// )
// : SizedBox(),
// ],
body: ListView( body: ListView(
padding: EdgeInsets.symmetric(vertical: 16.w), padding: EdgeInsets.symmetric(vertical: 16.w),
children: [ children: [

@ -1,6 +1,7 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/borrow/borrow_item_model.dart'; import 'package:aku_community_manager/models/manager/borrow/borrow_item_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_object_page.dart'; import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_object_page.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart'; import 'package:aku_ui/common_widgets/aku_material_button.dart';
@ -16,6 +17,7 @@ import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_items_page.dart'; import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_items_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:provider/provider.dart';
class AllBorrowGoods extends StatefulWidget { class AllBorrowGoods extends StatefulWidget {
AllBorrowGoods({Key key}) : super(key: key); AllBorrowGoods({Key key}) : super(key: key);
@ -28,9 +30,12 @@ class _AllBorrowGoodsState extends State<AllBorrowGoods> {
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold( return AkuScaffold(
title: '全部物品', title: '全部物品',
actions: [ AkuMaterialButton( actions: [
userProvider.infoModel.canOperation
? AkuMaterialButton(
minWidth: 120.w, minWidth: 120.w,
onPressed: () { onPressed: () {
Get.to(() => AddBorrowObjectPage()); Get.to(() => AddBorrowObjectPage());
@ -43,6 +48,7 @@ class _AllBorrowGoodsState extends State<AllBorrowGoods> {
), ),
), ),
) )
: SizedBox()
], ],
body: BeeListView( body: BeeListView(
path: API.manage.borrowList, path: API.manage.borrowList,

@ -1,19 +1,20 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/models/manager/borrow/borrow_detail_item_model.dart'; import 'package:aku_community_manager/models/manager/borrow/borrow_detail_item_model.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/add_borrow_item_page.dart';
import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart'; import 'package:aku_community_manager/ui/sub_pages/borrow_manager/borrow_item_detail_page.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
// Package imports: // Package imports:
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
// Project imports: // Project imports:
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
@ -31,24 +32,25 @@ class _BorrowItemPageState extends State<BorrowItemPage> {
EasyRefreshController _refreshController = EasyRefreshController(); EasyRefreshController _refreshController = EasyRefreshController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold( return AkuScaffold(
title: '物品查看', title: '物品查看',
actions: [ actions: [
// userProvider.userInfoModel.role == USER_ROLE.MANAGER userProvider.infoModel.canOperation
// ? AkuMaterialButton( ? AkuMaterialButton(
// minWidth: 120.w, minWidth: 120.w,
// onPressed: () { onPressed: () {
// // Get.to(AddBorrowItemPage(object: widget.object)); // Get.to(AddBorrowItemPage(object: widget.object));
// }, },
// child: Text( child: Text(
// '新增', '新增',
// style: TextStyle( style: TextStyle(
// fontSize: 28.w, fontSize: 28.w,
// color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
// ), ),
// ), ),
// ) )
// : SizedBox(), : SizedBox(),
], ],
body: BeeListView( body: BeeListView(
path: API.manage.borrowDetailList, path: API.manage.borrowDetailList,
@ -93,54 +95,60 @@ class _BorrowItemPageState extends State<BorrowItemPage> {
), ),
), ),
Spacer(), Spacer(),
// userProvider.userInfoModel.role == USER_ROLE.MANAGER userProvider.infoModel.canOperation
// ? AkuMaterialButton( ? AkuMaterialButton(
// padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
// onPressed: () { onPressed: () {
// showCupertinoDialog( showCupertinoDialog(
// context: context, context: context,
// builder: (context) { builder: (context) {
// return CupertinoAlertDialog( return CupertinoAlertDialog(
// title: Text('删除物品'), title: Text('删除物品'),
// content: Text('确定要删除${item.name}该物品吗?'), content: Text('确定要删除${item.name}该物品吗?'),
// actions: [ actions: [
// CupertinoDialogAction( CupertinoDialogAction(
// child: Text('取消'), child: Text('取消'),
// onPressed: () { onPressed: () {
// Get.back(); Get.back();
// }, },
// ), ),
// CupertinoDialogAction( CupertinoDialogAction(
// child: Text('删除'), child: Text('删除'),
// onPressed: () { onPressed: () async {
// //TODO delete await NetUtil().post(
// setState(() {}); API.manage.borrowDelete,
// Get.back(); params: {
// }, "ids": [item.id]
// ), },
// ], showMessage: true,
// ); );
// }, _refreshController.callRefresh();
// ); Get.back();
// }, },
// child: Row( ),
// children: [ ],
// Icon( );
// Icons.delete, },
// color: AppStyle.minorTextColor, );
// size: 40.w, },
// ), child: Row(
// Text( children: [
// '删除', Icon(
// style: TextStyle( Icons.delete,
// color: AppStyle.minorTextColor, color: AppStyle.minorTextColor,
// fontSize: 28.sp, size: 40.w,
// ), ),
// ), Text(
// ], '删除',
// ), style: TextStyle(
// ) color: AppStyle.minorTextColor,
// : SizedBox(), fontSize: 28.sp,
),
),
],
),
)
: SizedBox(),
], ],
), ),
Divider( Divider(

Loading…
Cancel
Save