fix : has more in list
This commit is contained in:
@@ -18,6 +18,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
|
hasMore: data.value.data?.next!= null,
|
||||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var item = data.value.data!.results![index];
|
var item = data.value.data!.results![index];
|
||||||
|
|||||||
@@ -58,10 +58,8 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
super.onReady();
|
super.onReady();
|
||||||
getStewardPurchaseOutOfProvince();
|
getStewardPurchaseOutOfProvince();
|
||||||
selectedProvince.listen((p0) => getCites());
|
selectedProvince.listen((p0) => getCites());
|
||||||
outOfTheProvinceLogic.rolesProductsModel.listen((lists) {
|
|
||||||
selectedProduct.value = lists.first;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
selectedProduct.value = outOfTheProvinceLogic.rolesProductsModel.first;
|
||||||
setupListeners();
|
setupListeners();
|
||||||
|
|
||||||
debounce(
|
debounce(
|
||||||
@@ -101,7 +99,7 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
call: () => rootLogic.chickenRepository.getStewardPurchasesOutSideOfTheProvince(
|
call: () => rootLogic.chickenRepository.getStewardPurchasesOutSideOfTheProvince(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
queryParameters: buildQueryParams(
|
queryParameters: buildQueryParams(
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
page: currentPage.value,
|
page: currentPage.value,
|
||||||
search: 'filter',
|
search: 'filter',
|
||||||
role: 'Steward',
|
role: 'Steward',
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
|
hasMore:data.value.data?.next!=null ,
|
||||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
var item = data.value.data!.results![index];
|
var item = data.value.data!.results![index];
|
||||||
@@ -295,13 +296,36 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
child: Form(
|
child: Form(
|
||||||
key: controller.formKey,
|
key: controller.formKey,
|
||||||
child: Column(
|
child: Column(
|
||||||
spacing: 16,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید',
|
isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید',
|
||||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
),
|
),
|
||||||
_productTypeWidget(),
|
_productDropDown(),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||||
|
),
|
||||||
|
|
||||||
|
child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]),
|
||||||
|
),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||||
|
),
|
||||||
|
|
||||||
|
child: Column(
|
||||||
|
spacing: 12,
|
||||||
|
children: [
|
||||||
RTextField(
|
RTextField(
|
||||||
controller: controller.sellerNameController,
|
controller: controller.sellerNameController,
|
||||||
label: 'نام فروشنده',
|
label: 'نام فروشنده',
|
||||||
@@ -331,8 +355,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
_provinceWidget(),
|
|
||||||
_cityWidget(),
|
|
||||||
RTextField(
|
RTextField(
|
||||||
controller: controller.carcassWeightController,
|
controller: controller.carcassWeightController,
|
||||||
label: 'وزن',
|
label: 'وزن',
|
||||||
@@ -349,6 +372,9 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
SeparatorInputFormatter(),
|
SeparatorInputFormatter(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
_imageCarcasesWidget(isOnEdit),
|
_imageCarcasesWidget(isOnEdit),
|
||||||
submitButtonWidget(isOnEdit),
|
submitButtonWidget(isOnEdit),
|
||||||
SizedBox(),
|
SizedBox(),
|
||||||
@@ -362,7 +388,7 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
Widget submitButtonWidget(bool isOnEdit) {
|
Widget submitButtonWidget(bool isOnEdit) {
|
||||||
return ObxValue((data) {
|
return ObxValue((data) {
|
||||||
return RElevated(
|
return RElevated(
|
||||||
text: isOnEdit ? 'ویرایش' : 'ثبت خرید',
|
text: isOnEdit ? 'ویرایش' : 'ثبت',
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
backgroundColor: AppColor.greenNormal,
|
backgroundColor: AppColor.greenNormal,
|
||||||
onPressed: data.value
|
onPressed: data.value
|
||||||
@@ -378,24 +404,32 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
}, controller.isSubmitButtonEnabled);
|
}, controller.isSubmitButtonEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _productTypeWidget() {
|
Widget _productDropDown() {
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
return OverlayDropdownWidget<ProductModel>(
|
return OverlayDropdownWidget<ProductModel>(
|
||||||
items: controller.outOfTheProvinceLogic.rolesProductsModel,
|
items: controller.outOfTheProvinceLogic.rolesProductsModel,
|
||||||
|
height: 56,
|
||||||
|
hasDropIcon: false,
|
||||||
|
background: Colors.white,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.selectedProduct.value = value;
|
controller.selectedProduct.value = value;
|
||||||
},
|
},
|
||||||
selectedItem: controller.selectedProduct.value,
|
selectedItem: controller.selectedProduct.value,
|
||||||
initialValue: controller.selectedProduct.value,
|
initialValue: controller.selectedProduct.value,
|
||||||
itemBuilder: (item) => Text(
|
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
||||||
item.name ?? 'بدون نام',
|
labelBuilder: (item) => Row(
|
||||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
spacing: 8,
|
||||||
|
children: [
|
||||||
|
(item?.name?.contains('مرغ گرم') ?? false)
|
||||||
|
? Assets.images.chicken.image(width: 40, height: 40)
|
||||||
|
: Assets.vec.placeHolderSvg.svg(width: 40, height: 40),
|
||||||
|
|
||||||
|
Text(item?.name ?? 'انتخاب محصول'),
|
||||||
|
Spacer(),
|
||||||
|
Text(
|
||||||
|
'موجودی:${controller.rootLogic.inventoryModel.value?.totalRemainWeight.separatedByComma ?? 0}',
|
||||||
),
|
),
|
||||||
labelBuilder: (item) => item?.name != null
|
],
|
||||||
? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor))
|
|
||||||
: Text(
|
|
||||||
'انتخاب محصول',
|
|
||||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -575,5 +609,4 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
}, controller.rootLogic.inventoryModel),
|
}, controller.rootLogic.inventoryModel),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class SalesOutOfProvinceBuyersPage extends GetView<SalesOutOfProvinceBuyersLogic
|
|||||||
controller.currentPage.value = 1;
|
controller.currentPage.value = 1;
|
||||||
await controller.getOutProvinceCarcassesBuyer();
|
await controller.getOutProvinceCarcassesBuyer();
|
||||||
},
|
},
|
||||||
|
hasMore: data.value.data?.next!= null,
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||||
|
|||||||
@@ -9,8 +9,7 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class SalesOutOfProvinceSalesListPage
|
class SalesOutOfProvinceSalesListPage extends GetView<SalesOutOfProvinceSalesListLogic> {
|
||||||
extends GetView<SalesOutOfProvinceSalesListLogic> {
|
|
||||||
const SalesOutOfProvinceSalesListPage({super.key});
|
const SalesOutOfProvinceSalesListPage({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -23,6 +22,7 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
controller.currentPage.value = 1;
|
controller.currentPage.value = 1;
|
||||||
await controller.getOutProvinceSales();
|
await controller.getOutProvinceSales();
|
||||||
},
|
},
|
||||||
|
hasMore: data.value.data?.next != null,
|
||||||
listType: ListType.separated,
|
listType: ListType.separated,
|
||||||
resource: data.value,
|
resource: data.value,
|
||||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||||
@@ -123,10 +123,7 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
||||||
|
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
@@ -150,21 +147,12 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: buildRow(
|
child: buildRow(title: 'تاریخ', value: item.date?.formattedJalaliDateYHMS ?? 'N/A'),
|
||||||
title: 'تاریخ',
|
|
||||||
value: item.date?.formattedJalaliDateYHMS ?? 'N/A',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
title: 'مشخصات خریدار',
|
|
||||||
value: item.buyer?.fullname ?? 'N/A',
|
|
||||||
),
|
),
|
||||||
|
buildRow(title: 'مشخصات خریدار', value: item.buyer?.fullname ?? 'N/A'),
|
||||||
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
|
buildRow(title: 'تلفن خریدار', value: item.buyer?.mobile ?? 'N/A'),
|
||||||
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
|
buildRow(title: 'نام واحد', value: item.buyer?.unitName ?? 'N/A'),
|
||||||
buildRow(
|
buildRow(title: 'وزن لاشه', value: '${item.weightOfCarcasses?.separatedByComma}'),
|
||||||
title: 'وزن لاشه',
|
|
||||||
value: '${item.weightOfCarcasses?.separatedByComma}',
|
|
||||||
),
|
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@@ -220,13 +208,10 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
isOnEdit ? 'ویرایش فروش' : 'افزودن فروش',
|
isOnEdit ? 'ویرایش فروش' : 'افزودن فروش',
|
||||||
style: AppFonts.yekan16Bold.copyWith(
|
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
||||||
color: AppColor.darkGreyDarkHover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
_productDropDown(),
|
_productDropDown(),
|
||||||
|
|
||||||
|
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(8),
|
padding: EdgeInsets.all(8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@@ -301,9 +286,7 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
text: isOnEdit ? 'ویرایش' : 'ثبت',
|
text: isOnEdit ? 'ویرایش' : 'ثبت',
|
||||||
onPressed: data.value
|
onPressed: data.value
|
||||||
? () async {
|
? () async {
|
||||||
var res = isOnEdit
|
var res = isOnEdit ? await controller.editSale() : await controller.createSale();
|
||||||
? await controller.editSale()
|
|
||||||
: await controller.createSale();
|
|
||||||
if (res) {
|
if (res) {
|
||||||
controller.getOutProvinceSales();
|
controller.getOutProvinceSales();
|
||||||
controller.clearSaleForm();
|
controller.clearSaleForm();
|
||||||
@@ -330,7 +313,6 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget _productDropDown() {
|
Widget _productDropDown() {
|
||||||
return Obx(() {
|
return Obx(() {
|
||||||
return OverlayDropdownWidget<ProductModel>(
|
return OverlayDropdownWidget<ProductModel>(
|
||||||
@@ -362,7 +344,6 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
GestureDetector timeFilterWidget({
|
GestureDetector timeFilterWidget({
|
||||||
isFrom = true,
|
isFrom = true,
|
||||||
required Rx<Jalali> date,
|
required Rx<Jalali> date,
|
||||||
@@ -375,7 +356,7 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
child: Container(
|
child: Container(
|
||||||
height: 40,
|
height: 40,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:AppColor.bgLight,
|
color: AppColor.bgLight,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(width: 1, color: AppColor.darkGreyLight),
|
border: Border.all(width: 1, color: AppColor.darkGreyLight),
|
||||||
),
|
),
|
||||||
@@ -386,23 +367,15 @@ class SalesOutOfProvinceSalesListPage
|
|||||||
Assets.vec.calendarSvg.svg(
|
Assets.vec.calendarSvg.svg(
|
||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
colorFilter: const ColorFilter.mode(
|
colorFilter: const ColorFilter.mode(AppColor.bgDark, BlendMode.srcIn),
|
||||||
AppColor.bgDark,
|
|
||||||
BlendMode.srcIn,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
'تاریخ',
|
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.bgDark),
|
|
||||||
),
|
),
|
||||||
|
Text('تاریخ', style: AppFonts.yekan16.copyWith(color: AppColor.bgDark)),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
return Text(
|
return Text(
|
||||||
date.value.formatCompactDate(),
|
date.value.formatCompactDate(),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan16.copyWith(
|
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark),
|
||||||
color: AppColor.darkGreyDark,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}, date),
|
}, date),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user