Commit 8eede8876b29ab04e9c88b59d614ed194866cbf7

Authored by wdn127929
1 parent 74b92374

搜索

... ... @@ -37,6 +37,11 @@ class _ApplyOutStorePageState extends State<ApplyOutStorePage> {
void initState() {
// TODO: implement initState
super.initState();
widget.wineManageDetail.wineDataMove.forEach((element) {
element.wineNumC.text = element.wineAmount; //出库数量初始化剩余库存量
element.checkAmount = element.wineAmount; //出库数量初始化剩余库存量
});
}
Widget _textItemWidget(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/out_wine_record_model.dart';
import 'package:one_key/models/wine_manage_model.dart';
... ... @@ -65,11 +66,9 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
index = tabController.index;
if (index == 0) {
await storeWineProvider.getStoreWineBySeller(context,
showLoading: false);
await _getStoreWineBySeller(context, showLoading: false);
} else if (index == 1) {
await storeWineProvider.getStoreWineCheckList(context,
showLoading: false);
await _getStoreWineCheckList(context, showLoading: false);
}
// _getContantData(first: true);
... ... @@ -81,19 +80,18 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
// _getContantData(first: first);
await _getAuthUserLists(showLoading: true);
await storeWineProvider.getStoreWineBySeller(context, showLoading: true);
await storeWineProvider.getStoreWineCheckList(context, showLoading: true);
_getStoreWineBySeller(context, showLoading: true);
_getStoreWineCheckList(context, showLoading: true);
});
bus.on("refresh_wine_home_all_list", (arg) async {
await storeWineProvider.getStoreWineBySeller(context, showLoading: true);
_getStoreWineBySeller(context, showLoading: true);
});
bus.on("refresh_wine_home_list", (arg) async {
print(arg['index']);
tabController.index = arg['index'];
index = arg['index'];
await storeWineProvider.getStoreWineBySeller(context, showLoading: true);
await storeWineProvider.getStoreWineCheckList(context, showLoading: true);
_getStoreWineBySeller(context, showLoading: true);
_getStoreWineCheckList(context, showLoading: true);
});
}
... ... @@ -104,6 +102,29 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
bus.off('refresh_wine_home_list');
}
_getStoreWineBySeller(BuildContext context, {bool showLoading = true}) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"sid": userModel.user.sellerid};
if (searchC.text.trim().length > 0) {
params['keyword'] = searchC.text; //搜索手机号/姓名
}
await storeWineProvider.getStoreWineBySeller(context, params,
showLoading: showLoading);
}
_getStoreWineCheckList(BuildContext context,
{bool showLoading = true}) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"sid": userModel.user.sellerid};
if (searchC.text.trim().length > 0) {
params['keyword'] = searchC.text; //搜索手机号/姓名
}
await storeWineProvider.getStoreWineCheckList(context, params,
showLoading: showLoading);
}
//获取员工信息列表
_getAuthUserLists({bool showLoading = true}) async {
Map<String, String> params = {
... ... @@ -220,12 +241,30 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
textInputAction: TextInputAction.done,
onChanged: (value) {
// _getContantData(showLoading: false);
// setState(() {});
// _searchSellerLocation();
// customerProvider.searchData(value);
if (tabController.index == 0) {
_getStoreWineBySeller(context, showLoading: false);
}
if (tabController.index == 1) {
_getStoreWineCheckList(context, showLoading: false);
}
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
// _getContantData(showLoading: false);
if (tabController.index == 0) {
_getStoreWineBySeller(context, showLoading: false);
}
if (tabController.index == 1) {
_getStoreWineCheckList(context, showLoading: false);
}
// contantShowModel.searchData(
// contantShowModel.controller.text);
// _searchSellerLocation();
// _focusNode.unfocus();
},
),
),
... ... @@ -248,9 +287,15 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
onTap: () {
WidgetsBinding.instance.addPostFrameCallback(((_) {
searchC.clear();
// customerProvider.searchData('');
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
// _getContantData(showLoading: false);
if (tabController.index == 0) {
_getStoreWineBySeller(context, showLoading: false);
}
if (tabController.index == 1) {
_getStoreWineCheckList(context, showLoading: false);
}
}));
},
)),
... ... @@ -331,7 +376,9 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
@override
Widget build(BuildContext context) {
storeWineProvider = Provider.of<StoreWineProvider>(context, listen: true);
return Scaffold(
return KeyboardDismissOnTap(
child: Scaffold(
resizeToAvoidBottomInset: false,
appBar: SystemAppBar(
'存酒管理',
onTap: () {
... ... @@ -389,7 +436,7 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
)
],
onRefresh: () async {
await storeWineProvider.getStoreWineBySeller(context,
await _getStoreWineBySeller(context,
showLoading: false);
// offset = 0;
// getMessage(typeid, showLoading: false);
... ... @@ -421,7 +468,7 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
return ExceptionPage(
pageState: model.pageStateRecordHome,
callback: () async {
await storeWineProvider.getStoreWineCheckList(context,
await _getStoreWineCheckList(context,
showLoading: true);
// offset = 0;
// getMessage(showLoading: true);
... ... @@ -455,7 +502,7 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
)
],
onRefresh: () async {
await storeWineProvider.getStoreWineCheckList(context,
await _getStoreWineCheckList(context,
showLoading: false);
// offset = 0;
// getMessage(typeid, showLoading: false);
... ... @@ -552,6 +599,6 @@ class _StoreWineManageHomePageState extends State<StoreWineManageHomePage>
// ],
])),
),
);
));
}
}
... ...
... ... @@ -20,7 +20,7 @@ class StoreWineProvider with ChangeNotifier {
PageState pageStateRecord = PageState.Loading; //取酒记录单个存酒
PageState pageStateDetail = PageState.Loading; //存酒详情
PageState pageStateDetailRecord = PageState.Success; //出库记录列表详情
PageState pageStateRecordHome = PageState.Loading; //取酒记录首页
PageState pageStateRecordHome = PageState.Loading; //取酒记录首页
List<WineManageModel> wineManageList; //存酒列表数据
WineManageModel wineManageDetail; //存酒详情数据
... ... @@ -104,10 +104,9 @@ class StoreWineProvider with ChangeNotifier {
}
// 获取存酒列表
Future<bool> getStoreWineBySeller(BuildContext context,
Future<bool> getStoreWineBySeller(
BuildContext context, Map<String, String> params,
{bool showLoading = true}) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"sid": userModel.user.sellerid};
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.get_store_wine_by_seller,
data: params, showLoading: showLoading)
... ... @@ -226,10 +225,9 @@ class StoreWineProvider with ChangeNotifier {
}
// 获取取酒记录
Future<bool> getStoreWineCheckList(BuildContext context,
Future<bool> getStoreWineCheckList(
BuildContext context, Map<String, String> params,
{bool showLoading = true}) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"sid": userModel.user.sellerid};
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(
context, Method.get, HttpUrl.get_store_wine_check_list,
... ...