Browse Source

生意总览更改改;

wr_2023_business
wurong 1 year ago
parent
commit
469b45b23b
  1. 38
      lib/business_system/home/business_home_page.dart
  2. 123
      lib/business_system/home/flow_page.dart
  3. 3
      lib/business_system/home/home_view/home_sideslip_dialog.dart
  4. 425
      lib/business_system/home/overview/trade_goods.dart
  5. 2
      lib/business_system/home/overview/trade_overview_page.dart
  6. 916
      lib/business_system/home/overview/trade_summary.dart
  7. 9
      lib/retrofit/business_api.dart
  8. 23
      lib/retrofit/business_api.g.dart
  9. 110
      lib/retrofit/data/trade_summary_list.dart
  10. 3
      lib/setting/setting_page.dart

38
lib/business_system/home/business_home_page.dart

@ -205,7 +205,9 @@ class _BusinessHomePage extends State<BusinessHomePage>
controller: refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
header: MyHeader(
color: Color(0xFF30415B),
),
physics: BouncingScrollPhysics(),
scrollController: scrollController,
footer: CustomFooter(
@ -906,10 +908,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 1;
queryPopularList();
});
daySelectIndex = 1;
queryPopularList();
},
child: Container(
padding:
@ -940,10 +940,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 2;
queryPopularList();
});
daySelectIndex = 7;
queryPopularList();
},
child: Container(
padding:
@ -952,7 +950,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
color: daySelectIndex == 2
color: daySelectIndex == 7
? Color(0xFF30415B)
: Colors.transparent,
border: Border.all(
@ -965,7 +963,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: daySelectIndex == 2
color: daySelectIndex == 7
? Colors.white
: Color(0XFF30415B),
),
@ -974,10 +972,8 @@ class _BusinessHomePage extends State<BusinessHomePage>
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
daySelectIndex = 3;
queryPopularList();
});
daySelectIndex = 30;
queryPopularList();
},
child: Container(
padding:
@ -986,7 +982,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
margin: EdgeInsets.only(right: 16.w, bottom: 16.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
color: daySelectIndex == 3
color: daySelectIndex == 30
? Color(0xFF30415B)
: Colors.transparent,
border: Border.all(
@ -999,7 +995,7 @@ class _BusinessHomePage extends State<BusinessHomePage>
style: TextStyle(
fontSize: 12.sp,
fontWeight: MyFontWeight.regular,
color: daySelectIndex == 3
color: daySelectIndex == 30
? Colors.white
: Color(0XFF30415B),
),
@ -1012,11 +1008,11 @@ class _BusinessHomePage extends State<BusinessHomePage>
child: (popularSalesList == null ||
popularSalesList.saleProductList.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
padding: EdgeInsets.zero,
@ -1176,11 +1172,11 @@ class _BusinessHomePage extends State<BusinessHomePage>
height: 360.h,
child: (dayFlowList.length == null || dayFlowList?.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
padding: EdgeInsets.zero,

123
lib/business_system/home/flow_page.dart

@ -2,6 +2,7 @@ import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:huixiang/view_widget/my_appbar.dart';
import 'package:intl/intl.dart';
@ -14,8 +15,10 @@ import '../../retrofit/business_api.dart';
import '../../retrofit/data/base_data.dart';
import '../../retrofit/data/day_flow_list.dart';
import '../../utils/business_instance.dart';
import '../../utils/flutter_utils.dart';
import '../../view_widget/classic_header.dart';
import '../../view_widget/my_footer.dart';
import '../../view_widget/no_data_view.dart';
class FlowPage extends StatefulWidget {
final arguments;
@ -33,44 +36,67 @@ class _FlowPage extends State<FlowPage> {
String storeId;
BusinessApiService businessService;
List<DayFlowList> dayFlowList = [];
int _loadCount = 0;
@override
void initState() {
super.initState();
storeId = widget.arguments["storeId"];
_onRefresh();
}
_onRefresh() async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
SharedPreferences.getInstance().then((value) {
businessService = BusinessApiService(Dio(),
context: context,
token: BusinessInstance.instance.businessToken,
tenant: BusinessInstance.instance.businessTenant,
storeId: storeId);
queryDayFlow(DateFormat("yyyy-MM-dd").format(DateTime.now()), "0");
queryDayFlow(DateFormat("yyyy-MM-dd").format(DateTime.now()), "0",
isSing: false);
});
}
addLoadCount() {
_loadCount += 1;
if (_loadCount == 1) {
_loadCount = 0;
EasyLoading.dismiss();
if (refreshController.isRefresh) refreshController.refreshCompleted();
if (mounted) setState(() {});
}
}
////isMonth=0()isMonth=1()
queryDayFlow(yearMonth, isMonth) async {
EasyLoading.show(
status: S.current.zhengzaijiazai, maskType: EasyLoadingMaskType.black);
queryDayFlow(yearMonth, isMonth, {isSing = true}) async {
if (isSing)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
try {
BaseData<List<DayFlowList>> baseData = await businessService
.dayFlow(
// "${DateFormat("yyyy-MM-dd").format(DateTime.now())}",
yearMonth,
isMonth)
.catchError((error) {});
BaseData<List<DayFlowList>> baseData =
await businessService.dayFlow(yearMonth, isMonth).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
if (baseData != null && baseData.isSuccess) {
if (isMonth == "0") {
dayFlowList = baseData.data;
} else {
dayFlowList.firstWhere((element) => element.localDate == yearMonth)
dayFlowList
.firstWhere((element) => element.localDate == yearMonth)
.detailList = baseData.data;
}
setState(() {});
}
} finally {
EasyLoading.dismiss();
if (isSing) {
setState(() {});
EasyLoading.dismiss();
} else {
addLoadCount();
}
}
}
@ -90,14 +116,14 @@ class _FlowPage extends State<FlowPage> {
enablePullDown: true,
enablePullUp: false,
header: MyHeader(
color: Colors.white,
color: Color(0xFF30415B),
),
footer: CustomFooter(
builder: (context, mode) {
return MyFooter(mode);
},
),
onRefresh: () {},
onRefresh: _onRefresh,
physics: BouncingScrollPhysics(),
scrollController: ScrollController(),
child: SingleChildScrollView(
@ -114,7 +140,7 @@ class _FlowPage extends State<FlowPage> {
child: Row(
children: [
Text(
"2023年6月",
DateFormat("yyyy年MM月").format(DateTime.now()),
style: TextStyle(
fontSize: 15.sp,
fontWeight: MyFontWeight.semi_bold,
@ -132,19 +158,27 @@ class _FlowPage extends State<FlowPage> {
SizedBox(
height: 16.h,
),
ListView.builder(
padding: EdgeInsets.zero,
itemCount: dayFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: billItem(dayFlowList[position]),
);
},
)
(dayFlowList == null || dayFlowList.length == 0)
? NoDataView(
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
)
: ListView.builder(
padding: EdgeInsets.zero,
itemCount: dayFlowList?.length ?? 0,
scrollDirection: Axis.vertical,
shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (context, position) {
return GestureDetector(
onTap: () {},
child: billItem(dayFlowList[position]),
);
},
)
],
),
),
@ -166,11 +200,11 @@ class _FlowPage extends State<FlowPage> {
children: [
GestureDetector(
onTap: () {
if(dayFlowList.detailList != null){
setState((){
if (dayFlowList.detailList != null) {
setState(() {
dayFlowList.detailList = null;
});
}else{
} else {
queryDayFlow(dayFlowList?.localDate ?? "", "1");
}
},
@ -222,9 +256,9 @@ class _FlowPage extends State<FlowPage> {
SizedBox(
height: 20.h,
),
if(dayFlowList.detailList != null)
if (dayFlowList.detailList != null)
Column(
children:dayFlowList.detailList.map((e) {
children: dayFlowList.detailList.map((e) {
return billIDetailsItem(e);
}).toList(),
)
@ -246,7 +280,7 @@ class _FlowPage extends State<FlowPage> {
Padding(
padding: EdgeInsets.only(bottom: 15.h),
child: Text(
detailList?.localDateTime ??"",
detailList?.localDateTime ?? "",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
@ -255,7 +289,10 @@ class _FlowPage extends State<FlowPage> {
),
),
Text(
detailList?.phone ?? detailList?.nickname ?? detailList?.storeName ??"",
detailList?.nickname ??
AppUtils.phoneEncode(detailList?.phone) ??
detailList?.storeName ??
"",
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.regular,
@ -269,7 +306,7 @@ class _FlowPage extends State<FlowPage> {
TextSpan(
children: [
TextSpan(
text: "+",
text: (detailList?.amount != "0.00") ? "+" : "-",
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
@ -277,7 +314,9 @@ class _FlowPage extends State<FlowPage> {
),
),
TextSpan(
text: detailList?.amount ?? "",
text: (detailList?.amount != "0.00")
? (detailList?.amount ?? "")
: (detailList?.refundAmount ?? ""),
style: TextStyle(
fontSize: 18.sp,
fontWeight: MyFontWeight.medium,
@ -294,7 +333,7 @@ class _FlowPage extends State<FlowPage> {
showDateSelector() {
DatePicker.showDatePicker(context,
showTitleActions: true,
minTime: DateTime.now(),
minTime: DateTime.now().subtract(const Duration(days: 360)),
maxTime: DateTime.now(),
theme: DatePickerTheme(
headerColor: Colors.white,
@ -303,13 +342,13 @@ class _FlowPage extends State<FlowPage> {
color: Colors.black,
fontWeight: MyFontWeight.bold,
fontSize: 18),
doneStyle: TextStyle(color: Color(0xFF32A060), fontSize: 16.sp)),
doneStyle: TextStyle(color: Color(0xFF30415B), fontSize: 16.sp)),
onChanged: (date) {
print('change $date in time zone ' +
date.timeZoneOffset.inHours.toString());
}, onConfirm: (date) {
// "2023-09-04";
setState(() {});
// setState(() {});
}, currentTime: DateTime.now(), locale: LocaleType.zh);
}
}

3
lib/business_system/home/home_view/home_sideslip_dialog.dart

@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:huixiang/utils/font_weight.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../../../generated/l10n.dart';
import '../../../retrofit/data/business_login_info.dart';
import '../../../utils/flutter_utils.dart';
import '../../../view_widget/custom_image.dart';
@ -202,7 +203,7 @@ class _HomeSideslipDialog extends State<HomeSideslipDialog>
borderRadius: BorderRadius.circular(4.w),
),
child: Text(
"退出登录",
S.of(context).tuichudenglu,
style: TextStyle(
fontSize: 14.sp,
fontWeight: MyFontWeight.medium,

425
lib/business_system/home/overview/trade_goods.dart

@ -73,16 +73,12 @@ class _TradeGoods extends State<TradeGoods> {
storeId: widget.storeId);
querySingleSales(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", ""));
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
isSing: false);
queryGoodsSalesList(
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
dayDate
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", ""));
dayDate.replaceAll("", "-").replaceAll("", "-").replaceAll("", ""),
isSing: false);
});
}
@ -97,7 +93,11 @@ class _TradeGoods extends State<TradeGoods> {
}
///
queryGoodsSalesList(date, endDat) async {
queryGoodsSalesList(date, endDat, {isSing = true}) async {
if (isSing)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
try {
BaseData<List<GoodsTypeSalesList>> baseData =
await businessService.goodsSalesList({
@ -115,12 +115,21 @@ class _TradeGoods extends State<TradeGoods> {
goodsTypeSalesList = baseData.data;
}
} finally {
addLoadCount();
if (isSing) {
setState(() {});
EasyLoading.dismiss();
} else {
addLoadCount();
}
}
}
///
querySingleSales(date, endDate) async {
querySingleSales(date, endDate, {isSing = true}) async {
if (isSing)
EasyLoading.show(
status: S.current.zhengzaijiazai,
maskType: EasyLoadingMaskType.black);
try {
BaseData<List<SingleSalesList>> baseData =
await businessService.singleSales({
@ -130,15 +139,17 @@ class _TradeGoods extends State<TradeGoods> {
"orderBy": 1,
"searchType": 2,
"type": 1
}).catchError((error) {
SmartDialog.showToast(AppUtils.dioErrorTypeToString(error.type),
alignment: Alignment.center);
});
}).catchError((error) {});
if (baseData != null && baseData.isSuccess) {
singleSalesList = baseData.data;
}
} finally {
addLoadCount();
if (isSing) {
setState(() {});
EasyLoading.dismiss();
} else {
addLoadCount();
}
}
}
@ -158,7 +169,9 @@ class _TradeGoods extends State<TradeGoods> {
controller: _refreshController,
enablePullDown: true,
enablePullUp: false,
header: MyHeader(),
header: MyHeader(
color: Color(0xFF30415B),
),
physics: BouncingScrollPhysics(),
scrollController: scrollController,
footer: CustomFooter(
@ -187,31 +200,29 @@ class _TradeGoods extends State<TradeGoods> {
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 0;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
dateIndex = 0;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
},
child: Container(
alignment: Alignment.center,
@ -238,31 +249,29 @@ class _TradeGoods extends State<TradeGoods> {
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 1;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
dateIndex = 1;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
},
child: Container(
alignment: Alignment.center,
@ -289,23 +298,21 @@ class _TradeGoods extends State<TradeGoods> {
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 2;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"");
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"");
});
dateIndex = 2;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"");
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
"");
},
child: Container(
alignment: Alignment.center,
@ -332,31 +339,33 @@ class _TradeGoods extends State<TradeGoods> {
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
setState(() {
dateIndex = 3;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
dateIndex = 3;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(
timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(
timeDate().length <= 15 ? 0 : 12,
timeDate().length <= 15 ? 10 : 23));
},
child: Container(
alignment: Alignment.center,
@ -391,121 +400,113 @@ class _TradeGoods extends State<TradeGoods> {
Navigator.of(context)
.pushNamed('/router/day_report_page')
.then((value) {
setState(() {
selectedDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
selectedDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
} else if (dateIndex == 1) {
Navigator.of(context)
.pushNamed('/router/week_report_page')
.then((value) {
setState(() {
weekDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
weekDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
} else if (dateIndex == 2) {
Navigator.of(context)
.pushNamed('/router/monthly_report_page')
.then((value) {
setState(() {
monthlyDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
monthlyDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10));
});
} else if (dateIndex == 3) {
Navigator.of(context)
.pushNamed('/router/custom_page')
.then((value) {
setState(() {
customDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
customDate = value;
querySingleSales(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
queryGoodsSalesList(
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(0, 10),
timeDate()
.replaceAll("", "-")
.replaceAll("", "-")
.replaceAll("", "")
.substring(12, 23));
});
}
},
@ -676,7 +677,7 @@ class _TradeGoods extends State<TradeGoods> {
),
(goodsTypeSalesList == null || goodsTypeSalesList.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
@ -850,11 +851,11 @@ class _TradeGoods extends State<TradeGoods> {
),
(singleSalesList == null || singleSalesList.length == 0)
? NoDataView(
src: "assets/image/xiao_fei.webp",
src: "assets/image/bs_no data_logo.webp",
isShowBtn: false,
text: "暂无数据",
fontSize: 16.sp,
margin: EdgeInsets.all(20.h),
margin: EdgeInsets.all(20),
)
: Container(
height: 243.h,

2
lib/business_system/home/overview/trade_overview_page.dart

@ -69,7 +69,7 @@ class _TradeOverviewPage extends State<TradeOverviewPage> with SingleTickerProvi
),
body: TabBarView(
children: [
TradeSummary(),
TradeSummary(storeId),
TradeOrder(),
TradeGoods(storeId),],
),

916
lib/business_system/home/overview/trade_summary.dart

File diff suppressed because it is too large Load Diff

9
lib/retrofit/business_api.dart

@ -6,18 +6,17 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:huixiang/retrofit/data/business_login_info.dart';
import 'package:huixiang/retrofit/data/day_count.dart';
import 'package:huixiang/retrofit/data/order_trend.dart';
import 'package:huixiang/retrofit/data/vip_counts_info.dart';
import 'package:retrofit/retrofit.dart';
import '../utils/flutter_utils.dart';
import 'data/base_data.dart';
import 'data/day_flow_list.dart';
import 'data/goods_type_sales_list.dart';
import 'data/popular_sales_list.dart';
import 'data/single_sales_list.dart';
import 'data/trade_summary_list.dart';
part 'business_api.g.dart';
@ -137,7 +136,7 @@ abstract class BusinessApiService {
@POST("comprehensiveReport/getDayCounts")
Future<BaseData<DayCount>> getDayCounts(@Body() Map<String, dynamic> param);
////
////,01773030
@GET("dashBoard/store/?offsetDay={offsetDay}")
Future<BaseData<PopularSalesList>> popularList(
@Path("offsetDay") String offsetDay);
@ -164,4 +163,8 @@ abstract class BusinessApiService {
@POST("audit/allKindsSalesStatistics")
Future<BaseData<List<GoodsTypeSalesList>>> goodsSalesList(@Body() Map<String, dynamic> param);
//// day week month custom
@POST("largeScreenReport/saleBusinessAnalysis")
Future<BaseData<TradeSummaryList>> saleBusinessAnalysis(@Body() Map<String, dynamic> param);
}

23
lib/retrofit/business_api.g.dart

@ -209,4 +209,27 @@ class _BusinessApiService implements BusinessApiService {
return value;
}
@override
Future<BaseData<TradeSummaryList>> saleBusinessAnalysis(param) async {
ArgumentError.checkNotNull(param, 'param');
const _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(param ?? <String, dynamic>{});
final _result = await _dio.request<Map<String, dynamic>>(
'largeScreenReport/saleBusinessAnalysis',
queryParameters: queryParameters,
options: RequestOptions(
method: 'POST',
headers: <String, dynamic>{},
extra: _extra,
baseUrl: baseUrl),
data: _data);
final value = BaseData<TradeSummaryList>.fromJson(
_result.data,
(json) => json == "" ? null :TradeSummaryList.fromJson(json),
);
return value;
}
}

110
lib/retrofit/data/trade_summary_list.dart

@ -0,0 +1,110 @@
/// saleBusinessAnalysisVOS : [{"localDateTime":"2023-08-29 00:00:00","localDateBigDecimal":"22.00","localDateCount":"1"},{"localDateTime":"2023-08-13 00:00:00","localDateBigDecimal":"12.00","localDateCount":"1"},{"localDateTime":"2023-08-12 00:00:00","localDateBigDecimal":"485.00","localDateCount":"23"},{"localDateTime":"2023-08-11 00:00:00","localDateBigDecimal":"1105.00","localDateCount":"40"},{"localDateTime":"2023-08-10 00:00:00","localDateBigDecimal":"720.00","localDateCount":"28"},{"localDateTime":"2023-08-09 00:00:00","localDateBigDecimal":"311.50","localDateCount":"26"},{"localDateTime":"2023-08-08 00:00:00","localDateBigDecimal":"273.50","localDateCount":"18"},{"localDateTime":"2023-08-07 00:00:00","localDateBigDecimal":"411.00","localDateCount":"19"},{"localDateTime":"2023-08-06 00:00:00","localDateBigDecimal":"26.00","localDateCount":"4"},{"localDateTime":"2023-08-05 00:00:00","localDateBigDecimal":"131.00","localDateCount":"6"},{"localDateTime":"2023-08-04 00:00:00","localDateBigDecimal":"53.00","localDateCount":"4"},{"localDateTime":"2023-08-01 00:00:00","localDateBigDecimal":"442.00","localDateCount":"3"}]
/// collectionAmount : "2816.00"
/// collectionCount : 173
/// refundAmount : "0"
/// refundCount : 0
class TradeSummaryList {
TradeSummaryList({
List<SaleBusinessAnalysisVos> saleBusinessAnalysisVOS,
String collectionAmount,
num collectionCount,
String refundAmount,
num refundCount,}){
_saleBusinessAnalysisVOS = saleBusinessAnalysisVOS;
_collectionAmount = collectionAmount;
_collectionCount = collectionCount;
_refundAmount = refundAmount;
_refundCount = refundCount;
}
TradeSummaryList.fromJson(dynamic json) {
if (json['saleBusinessAnalysisVOS'] != null) {
_saleBusinessAnalysisVOS = [];
json['saleBusinessAnalysisVOS'].forEach((v) {
_saleBusinessAnalysisVOS.add(SaleBusinessAnalysisVos.fromJson(v));
});
}
_collectionAmount = json['collectionAmount'];
_collectionCount = json['collectionCount'];
_refundAmount = json['refundAmount'];
_refundCount = json['refundCount'];
}
List<SaleBusinessAnalysisVos> _saleBusinessAnalysisVOS;
String _collectionAmount;
num _collectionCount;
String _refundAmount;
num _refundCount;
TradeSummaryList copyWith({ List<SaleBusinessAnalysisVos> saleBusinessAnalysisVOS,
String collectionAmount,
num collectionCount,
String refundAmount,
num refundCount,
}) => TradeSummaryList( saleBusinessAnalysisVOS: saleBusinessAnalysisVOS ?? _saleBusinessAnalysisVOS,
collectionAmount: collectionAmount ?? _collectionAmount,
collectionCount: collectionCount ?? _collectionCount,
refundAmount: refundAmount ?? _refundAmount,
refundCount: refundCount ?? _refundCount,
);
List<SaleBusinessAnalysisVos> get saleBusinessAnalysisVOS => _saleBusinessAnalysisVOS;
String get collectionAmount => _collectionAmount;
num get collectionCount => _collectionCount;
String get refundAmount => _refundAmount;
num get refundCount => _refundCount;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (_saleBusinessAnalysisVOS != null) {
map['saleBusinessAnalysisVOS'] = _saleBusinessAnalysisVOS.map((v) => v.toJson()).toList();
}
map['collectionAmount'] = _collectionAmount;
map['collectionCount'] = _collectionCount;
map['refundAmount'] = _refundAmount;
map['refundCount'] = _refundCount;
return map;
}
}
/// localDateTime : "2023-08-29 00:00:00"
/// localDateBigDecimal : "22.00"
/// localDateCount : "1"
class SaleBusinessAnalysisVos {
SaleBusinessAnalysisVos({
String localDateTime,
String localDateBigDecimal,
String localDateCount,}){
_localDateTime = localDateTime;
_localDateBigDecimal = localDateBigDecimal;
_localDateCount = localDateCount;
}
SaleBusinessAnalysisVos.fromJson(dynamic json) {
_localDateTime = json['localDateTime'];
_localDateBigDecimal = json['localDateBigDecimal'];
_localDateCount = json['localDateCount'];
}
String _localDateTime;
String _localDateBigDecimal;
String _localDateCount;
SaleBusinessAnalysisVos copyWith({ String localDateTime,
String localDateBigDecimal,
String localDateCount,
}) => SaleBusinessAnalysisVos( localDateTime: localDateTime ?? _localDateTime,
localDateBigDecimal: localDateBigDecimal ?? _localDateBigDecimal,
localDateCount: localDateCount ?? _localDateCount,
);
String get localDateTime => _localDateTime;
String get localDateBigDecimal => _localDateBigDecimal;
String get localDateCount => _localDateCount;
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['localDateTime'] = _localDateTime;
map['localDateBigDecimal'] = _localDateBigDecimal;
map['localDateCount'] = _localDateCount;
return map;
}
}

3
lib/setting/setting_page.dart

@ -292,6 +292,9 @@ class _SettingPage extends State<SettingPage> {
sharedPreferences.setString("userId", "");
sharedPreferences.setString("mobile", "");
sharedPreferences.setString("nick", "");
sharedPreferences.setString("account", "");
sharedPreferences.setString("password", "");
Navigator.of(context)
.pushNamedAndRemoveUntil('/router/new_login_page', (route) => false);

Loading…
Cancel
Save