fix: resolve import path issues and clean up unused imports across multiple files
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
|
||||
@@ -28,9 +27,8 @@ class KillHouseRootLogic extends GetxController {
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == ChickenRoutes.actionKillHouse,
|
||||
),
|
||||
orElse: () =>
|
||||
ChickenPages.pages.firstWhere((e) => e.name == ChickenRoutes.actionKillHouse),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../steward/data/model/request/steward_allocation/steward_allocation_request.dart';
|
||||
import '../../../steward/data/model/response/waiting_arrival/waiting_arrival.dart';
|
||||
|
||||
class WarehouseAndDistributionBuyInProvinceEnteredLogic extends GetxController {
|
||||
RxInt isExpandedListIndex = (-1).obs;
|
||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||
@@ -14,8 +15,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredLogic extends GetxController {
|
||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
|
||||
WarehouseAndDistributionRootLogic rootLogic =
|
||||
Get.find<WarehouseAndDistributionRootLogic>();
|
||||
WarehouseAndDistributionRootLogic rootLogic = Get.find<WarehouseAndDistributionRootLogic>();
|
||||
|
||||
Rx<Resource<PaginationModel<KillHouseBarsResponse>>> enteredBars =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.loading().obs;
|
||||
@@ -35,11 +35,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredLogic extends GetxController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
debounce(
|
||||
searchedValue,
|
||||
(callback) => getkillHouseBars(),
|
||||
time: Duration(milliseconds: 2000),
|
||||
);
|
||||
debounce(searchedValue, (callback) => getkillHouseBars(), time: Duration(milliseconds: 2000));
|
||||
super.onReady();
|
||||
ever(approvedWithOtpCode, (callback) {
|
||||
if (callback == false) {
|
||||
@@ -52,8 +48,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredLogic extends GetxController {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
enteredBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.loading();
|
||||
enteredBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
@@ -72,7 +67,6 @@ class WarehouseAndDistributionBuyInProvinceEnteredLogic extends GetxController {
|
||||
search: 'filter',
|
||||
role: 'KillHouse',
|
||||
value: searchedValue.value,
|
||||
|
||||
),
|
||||
),
|
||||
|
||||
@@ -80,24 +74,18 @@ class WarehouseAndDistributionBuyInProvinceEnteredLogic extends GetxController {
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
enteredBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
enteredBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
} else {
|
||||
enteredBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.success(
|
||||
PaginationModel<KillHouseBarsResponse>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [
|
||||
...(enteredBars.value.data?.results ?? []),
|
||||
...(res?.results ?? []),
|
||||
],
|
||||
),
|
||||
);
|
||||
enteredBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.success(
|
||||
PaginationModel<KillHouseBarsResponse>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [...(enteredBars.value.data?.results ?? []), ...(res?.results ?? [])],
|
||||
),
|
||||
);
|
||||
}
|
||||
enteredBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
enteredBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../steward/data/model/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
@@ -87,20 +87,14 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
child: Assets.vec.hotChickenSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'item.weightOfCarcasses?.separatedByCommaFa.addKg ' ??
|
||||
'N/A',
|
||||
'item.weightOfCarcasses?.separatedByCommaFa.addKg ' ?? 'N/A',
|
||||
textAlign: TextAlign.left,
|
||||
textDirection: TextDirection.ltr,
|
||||
style: AppFonts.yekan12Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -128,10 +122,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
Container itemListExpandedWidget(KillHouseBarsResponse item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -153,10 +144,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
SvgGenImage.vec(controller.getVecPathItem('pending')).svg(
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.darkGreyDark,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.darkGreyDark, BlendMode.srcIn),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -178,16 +166,12 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
children: [
|
||||
Text(
|
||||
'item.date?.toJalali.formatter.wN ' ?? 'N/A',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.textColor,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${'item.date?.toJalali.formatter.d '} ${'item.date?.toJalali.formatter.mN ' ?? 'N/A'}',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -205,19 +189,13 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'مشخصات فروشنده',
|
||||
value: 'item.toSteward?.user?.fullname ' ?? 'N/A',
|
||||
),
|
||||
buildRow(title: 'مشخصات فروشنده', value: 'item.toSteward?.user?.fullname ' ?? 'N/A'),
|
||||
buildRow(
|
||||
title: 'تلفن فروشنده',
|
||||
value: 'item.toSteward?.user?.mobile ' ?? 'N/A',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(
|
||||
title: 'نوع تخصیص',
|
||||
value: 'item.allocationType?.faAllocationType ' ?? 'N/A',
|
||||
),
|
||||
buildRow(title: 'نوع تخصیص', value: 'item.allocationType?.faAllocationType ' ?? 'N/A'),
|
||||
buildRow(title: ' سهمیه', value: 'item.quota?.faTitle ' ?? 'N/A'),
|
||||
buildRow(title: 'محصول', value: 'item.product?.name ' ?? 'N/A'),
|
||||
buildRow(
|
||||
@@ -228,9 +206,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
buildRow(
|
||||
title: 'قیمت هر کیلوگرم',
|
||||
titleLabel: (false) ? 'مصوب' : 'آزاد',
|
||||
titleLabelStyle: AppFonts.yekan14Bold.copyWith(
|
||||
color: AppColor.greenNormal,
|
||||
),
|
||||
titleLabelStyle: AppFonts.yekan14Bold.copyWith(color: AppColor.greenNormal),
|
||||
value: item.amount?.separatedByCommaFa ?? 'N/A',
|
||||
valueLabel: 'ریال',
|
||||
),
|
||||
@@ -268,9 +244,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
}, controller.isLoadingConfirmMap),
|
||||
ROutlinedElevated(
|
||||
text: 'رد',
|
||||
textStyle: AppFonts.yekan20.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
@@ -315,37 +289,25 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
label: 'وزن(کیلوگرم)',
|
||||
controller: controller.weightController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
SeparatorInputFormatter(),
|
||||
],
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||
),
|
||||
SizedBox(height: 16.h),
|
||||
RTextField(
|
||||
label: 'حجم(قطعه)',
|
||||
controller: controller.countController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
SeparatorInputFormatter(),
|
||||
],
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||
),
|
||||
SizedBox(height: 16.h),
|
||||
RTextField(
|
||||
label: 'افت وزن(کیلوگرم)',
|
||||
controller: controller.lossController,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [
|
||||
FilteringTextInputFormatter.digitsOnly,
|
||||
SeparatorInputFormatter(),
|
||||
],
|
||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||
),
|
||||
SizedBox(height: 16.h),
|
||||
|
||||
Text(
|
||||
'تایید ',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
Text('تایید ', style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor)),
|
||||
ObxValue((data) {
|
||||
return Column(
|
||||
children: [
|
||||
@@ -415,12 +377,7 @@ class WarehouseAndDistributionBuyInProvinceEnteredPage
|
||||
child: Row(
|
||||
children: [
|
||||
Radio(value: value),
|
||||
Text(
|
||||
label,
|
||||
style:
|
||||
textStyle ??
|
||||
AppFonts.yekan16.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
Text(label, style: textStyle ?? AppFonts.yekan16.copyWith(color: AppColor.textColor)),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -2,12 +2,13 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_bars/kill_house_bars_response.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../steward/data/model/request/steward_allocation/steward_allocation_request.dart';
|
||||
import '../../../steward/data/model/response/waiting_arrival/waiting_arrival.dart';
|
||||
|
||||
class WarehouseAndDistributionBuyInProvinceWaitingLogic extends GetxController {
|
||||
RxInt isExpandedListIndex = (-1).obs;
|
||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||
@@ -18,8 +19,7 @@ class WarehouseAndDistributionBuyInProvinceWaitingLogic extends GetxController {
|
||||
RxInt currentPage = 1.obs;
|
||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||
|
||||
WarehouseAndDistributionRootLogic rootLogic =
|
||||
Get.find<WarehouseAndDistributionRootLogic>();
|
||||
WarehouseAndDistributionRootLogic rootLogic = Get.find<WarehouseAndDistributionRootLogic>();
|
||||
RxBool isButtonConfirm = false.obs;
|
||||
|
||||
Rx<Resource<PaginationModel<KillHouseBarsResponse>>> waitingBars =
|
||||
@@ -59,8 +59,7 @@ class WarehouseAndDistributionBuyInProvinceWaitingLogic extends GetxController {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
waitingBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.loading();
|
||||
waitingBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
@@ -79,32 +78,25 @@ class WarehouseAndDistributionBuyInProvinceWaitingLogic extends GetxController {
|
||||
search: 'filter',
|
||||
role: 'KillHouse',
|
||||
value: searchedValue.value,
|
||||
|
||||
),
|
||||
),
|
||||
onSuccess: (res) async {
|
||||
await Future.delayed(Duration(milliseconds: 200));
|
||||
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
waitingBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
waitingBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
} else {
|
||||
waitingBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.success(
|
||||
PaginationModel<KillHouseBarsResponse>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [
|
||||
...(waitingBars.value.data?.results ?? []),
|
||||
...(res?.results ?? []),
|
||||
],
|
||||
),
|
||||
);
|
||||
waitingBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.success(
|
||||
PaginationModel<KillHouseBarsResponse>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [...(waitingBars.value.data?.results ?? []), ...(res?.results ?? [])],
|
||||
),
|
||||
);
|
||||
flashingFabBgColor();
|
||||
}
|
||||
waitingBars.value =
|
||||
Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
waitingBars.value = Resource<PaginationModel<KillHouseBarsResponse>>.empty();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/buy/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sale/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import '../../../common/data/model/response/roles_products/roles_products.dart';
|
||||
import '../../../steward/data/model/request/create_steward_free_bar/create_steward_free_bar.dart';
|
||||
import '../../../steward/data/model/response/steward_free_bar/steward_free_bar.dart';
|
||||
|
||||
class WarehouseAndDistributionBuyOutOfProvinceLogic extends GetxController {
|
||||
late List<String> routesName;
|
||||
RxBool isSubmitButtonEnabled = false.obs;
|
||||
@@ -33,11 +34,9 @@ class WarehouseAndDistributionBuyOutOfProvinceLogic extends GetxController {
|
||||
RxnString editImageUrl = RxnString();
|
||||
RxnString editFreeBarKey = RxnString();
|
||||
|
||||
WarehouseAndDistributionRootLogic rootLogic =
|
||||
Get.find<WarehouseAndDistributionRootLogic>();
|
||||
WarehouseAndDistributionRootLogic rootLogic = Get.find<WarehouseAndDistributionRootLogic>();
|
||||
|
||||
WarehouseAndDistributionBuyLogic buyLogic =
|
||||
Get.find<WarehouseAndDistributionBuyLogic>();
|
||||
WarehouseAndDistributionBuyLogic buyLogic = Get.find<WarehouseAndDistributionBuyLogic>();
|
||||
|
||||
WarehouseAndDistributionSaleLogic outOfTheProvinceLogic =
|
||||
Get.find<WarehouseAndDistributionSaleLogic>();
|
||||
@@ -89,14 +88,11 @@ class WarehouseAndDistributionBuyOutOfProvinceLogic extends GetxController {
|
||||
searchedValue.value = data?.trim();
|
||||
}
|
||||
|
||||
Future<void> getStewardPurchaseOutOfProvince([
|
||||
bool isLoadingMore = false,
|
||||
]) async {
|
||||
Future<void> getStewardPurchaseOutOfProvince([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
purchaseOutOfProvinceList.value =
|
||||
Resource<PaginationModel<StewardFreeBar>>.loading();
|
||||
purchaseOutOfProvinceList.value = Resource<PaginationModel<StewardFreeBar>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
@@ -137,8 +133,7 @@ class WarehouseAndDistributionBuyOutOfProvinceLogic extends GetxController {
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
purchaseOutOfProvinceList.value =
|
||||
Resource<PaginationModel<StewardFreeBar>>.empty();
|
||||
purchaseOutOfProvinceList.value = Resource<PaginationModel<StewardFreeBar>>.empty();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,13 +3,12 @@ import 'dart:io';
|
||||
import 'package:flutter/cupertino.dart' hide Image;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
@@ -55,8 +54,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async =>
|
||||
controller.getStewardPurchaseOutOfProvince(true),
|
||||
onLoadMore: () async => controller.getStewardPurchaseOutOfProvince(true),
|
||||
);
|
||||
}, controller.purchaseOutOfProvinceList),
|
||||
],
|
||||
@@ -85,10 +83,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
Container itemListExpandedWidget(StewardFreeBar item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -120,16 +115,12 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
children: [
|
||||
Text(
|
||||
item.date?.toJalali.formatter.wN ?? 'ندارد',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.textColor,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'ندارد'}',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -147,10 +138,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'مشخصات فروشنده',
|
||||
value: item.killHouseName ?? 'ندارد',
|
||||
),
|
||||
buildRow(title: 'مشخصات فروشنده', value: item.killHouseName ?? 'ندارد'),
|
||||
|
||||
buildRow(
|
||||
title: 'تلفن فروشنده',
|
||||
@@ -172,10 +160,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
valueWidget: Assets.vec.clipboardEyeSvg.svg(
|
||||
width: 20,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
@@ -186,9 +171,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
children: [
|
||||
Text(
|
||||
'بارنامه',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
|
||||
Image.network(
|
||||
@@ -237,8 +220,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
buildDeleteDialog(
|
||||
onConfirm: () => controller
|
||||
.deleteStewardPurchaseOutOfProvince(item.key!),
|
||||
onConfirm: () => controller.deleteStewardPurchaseOutOfProvince(item.key!),
|
||||
onRefresh: () async {
|
||||
controller.rootLogic.onRefresh();
|
||||
controller.onRefresh();
|
||||
@@ -296,18 +278,13 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
child: Assets.vec.hotChickenSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'${item.weightOfCarcasses?.separatedByCommaFa}kg',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -355,8 +332,8 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
//_productDropDown(),
|
||||
|
||||
//_productDropDown(),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
@@ -365,10 +342,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
|
||||
child: Column(
|
||||
spacing: 12,
|
||||
children: [_provinceWidget(), _cityWidget()],
|
||||
),
|
||||
child: Column(spacing: 12, children: [_provinceWidget(), _cityWidget()]),
|
||||
),
|
||||
|
||||
Container(
|
||||
@@ -467,7 +441,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
});
|
||||
}
|
||||
|
||||
/* Widget _productDropDown() {
|
||||
/* Widget _productDropDown() {
|
||||
return Obx(() {
|
||||
return OverlayDropdownWidget<ProductModel>(
|
||||
items: controller.rootLogic.rolesProductsModel,
|
||||
@@ -511,15 +485,10 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
||||
),
|
||||
labelBuilder: (item) => item?.name != null
|
||||
? Text(
|
||||
item!.name!,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
)
|
||||
? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor))
|
||||
: Text(
|
||||
'انتخاب استان',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.textColorLight,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight),
|
||||
),
|
||||
);
|
||||
});
|
||||
@@ -538,16 +507,8 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarker),
|
||||
),
|
||||
labelBuilder: (item) => item?.name != null
|
||||
? Text(
|
||||
item!.name!,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
)
|
||||
: Text(
|
||||
'انتخاب شهر',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.textColorLight,
|
||||
),
|
||||
),
|
||||
? Text(item!.name!, style: AppFonts.yekan14.copyWith(color: AppColor.textColor))
|
||||
: Text('انتخاب شهر', style: AppFonts.yekan14.copyWith(color: AppColor.textColorLight)),
|
||||
);
|
||||
}, controller.cites);
|
||||
}
|
||||
@@ -563,12 +524,7 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text(
|
||||
'بارنامه',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text('بارنامه', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return Container(
|
||||
@@ -584,21 +540,10 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
? Image.network(controller.editImageUrl.value ?? '')
|
||||
: data.value == null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
30,
|
||||
10,
|
||||
10,
|
||||
30,
|
||||
),
|
||||
child: Assets.vec.placeHolderSvg.svg(
|
||||
width: 200.w,
|
||||
height: 150.h,
|
||||
),
|
||||
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
|
||||
child: Assets.vec.placeHolderSvg.svg(width: 200.w, height: 150.h),
|
||||
)
|
||||
: Image.file(
|
||||
File(data.value!.path),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
||||
),
|
||||
);
|
||||
}, controller.selectedImage),
|
||||
@@ -614,14 +559,12 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller
|
||||
.imagePicker
|
||||
.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
@@ -629,18 +572,14 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
text: 'دوربین',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller
|
||||
.imagePicker
|
||||
.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -658,18 +597,14 @@ class WarehouseAndDistributionBuyOutOfProvincePage
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
'فیلترها',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: dateFilterWidget(
|
||||
date: controller.fromDateFilter,
|
||||
onChanged: (jalali) =>
|
||||
controller.fromDateFilter.value = jalali,
|
||||
onChanged: (jalali) => controller.fromDateFilter.value = jalali,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class WarehouseAndDistributionHomeLogic extends GetxController {
|
||||
WarehouseAndDistributionRootLogic rootLogic =
|
||||
Get.find<WarehouseAndDistributionRootLogic>();
|
||||
WarehouseAndDistributionRootLogic rootLogic = Get.find<WarehouseAndDistributionRootLogic>();
|
||||
|
||||
RxList<Map<String, String?>> inventoryItems = [
|
||||
{'خریدهای دولتی داخل استان': null},
|
||||
@@ -35,12 +31,6 @@ class WarehouseAndDistributionHomeLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> refreshData() async {
|
||||
await Future.wait([
|
||||
rootLogic.getRolesProducts(),
|
||||
rootLogic.getInfoSaleDashboard(),
|
||||
]);
|
||||
await Future.wait([rootLogic.getRolesProducts(), rootLogic.getInfoSaleDashboard()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import 'package:flutter/cupertino.dart' hide LinearGradient;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import '../../../common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'logic.dart';
|
||||
|
||||
class WarehouseAndDistributionHomePage
|
||||
extends GetView<WarehouseAndDistributionHomeLogic> {
|
||||
class WarehouseAndDistributionHomePage extends GetView<WarehouseAndDistributionHomeLogic> {
|
||||
const WarehouseAndDistributionHomePage({super.key});
|
||||
|
||||
@override
|
||||
@@ -77,10 +76,7 @@ class WarehouseAndDistributionHomePage
|
||||
AnimatedRotation(
|
||||
turns: 180,
|
||||
duration: Duration(milliseconds: 3000),
|
||||
child: Icon(
|
||||
CupertinoIcons.chevron_up,
|
||||
size: 18,
|
||||
),
|
||||
child: Icon(CupertinoIcons.chevron_up, size: 18),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -104,9 +100,7 @@ class WarehouseAndDistributionHomePage
|
||||
Row(
|
||||
spacing: 8,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Icon(CupertinoIcons.chevron_down, size: 18),
|
||||
],
|
||||
children: [Icon(CupertinoIcons.chevron_down, size: 18)],
|
||||
),
|
||||
_dashboradWidget1(),
|
||||
_dashboradWidget2(),
|
||||
@@ -133,17 +127,12 @@ class WarehouseAndDistributionHomePage
|
||||
Assets.vec.chicken2Svg.svg(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.blueDark,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.blueDark, BlendMode.srcIn),
|
||||
),
|
||||
Text(
|
||||
'اطلاعات مرغ گرم',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.iconColor,
|
||||
),
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.iconColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -167,8 +156,7 @@ class WarehouseAndDistributionHomePage
|
||||
titleColor: AppColor.textColor,
|
||||
borderColor: Color(0xFFFFAE00),
|
||||
isLoading: data.value == null,
|
||||
description:
|
||||
data.value?.realAllocatedWeight.separatedByCommaFa ?? '0',
|
||||
description: data.value?.realAllocatedWeight.separatedByCommaFa ?? '0',
|
||||
icon: Container(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
@@ -180,10 +168,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: Assets.vec.cubeScanSvg.svg(
|
||||
width: 12.w,
|
||||
height: 12.h,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
Colors.white,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
bgDescriptionColor: Colors.white,
|
||||
@@ -203,8 +188,7 @@ class WarehouseAndDistributionHomePage
|
||||
title: 'مانده انبار',
|
||||
borderColor: const Color(0xFF9758FF),
|
||||
isLoading: data.value == null,
|
||||
description:
|
||||
data.value?.totalRemainWeight.separatedByCommaFa ?? '0',
|
||||
description: data.value?.totalRemainWeight.separatedByCommaFa ?? '0',
|
||||
unit: 'کیلوگرم',
|
||||
icon: Container(
|
||||
width: 24.w,
|
||||
@@ -217,10 +201,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: Assets.vec.cubeCardFreeSvg.svg(
|
||||
width: 12.w,
|
||||
height: 12.h,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
Colors.white,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
bgDescriptionColor: Colors.white,
|
||||
@@ -248,12 +229,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: _informationLabelCard(
|
||||
title: 'مانده دولتی',
|
||||
isLoading: data.value == null,
|
||||
description:
|
||||
data
|
||||
.value
|
||||
?.totalGovernmentalRemainWeight
|
||||
?.separatedByCommaFa ??
|
||||
'0',
|
||||
description: data.value?.totalGovernmentalRemainWeight?.separatedByCommaFa ?? '0',
|
||||
iconPath: Assets.vec.cubeCardGovermentSvg.path,
|
||||
iconColor: AppColor.textColor,
|
||||
bgDescriptionColor: const Color(0xFFF5ECEE),
|
||||
@@ -264,8 +240,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: _informationLabelCard(
|
||||
title: 'مانده آزاد',
|
||||
isLoading: data.value == null,
|
||||
description:
|
||||
data.value?.totalFreeRemainWeight.separatedByCommaFa ?? '0',
|
||||
description: data.value?.totalFreeRemainWeight.separatedByCommaFa ?? '0',
|
||||
unit: 'کیلوگرم',
|
||||
iconPath: Assets.vec.cubeCardFreeSvg.path,
|
||||
iconColor: AppColor.textColor,
|
||||
@@ -287,11 +262,7 @@ class WarehouseAndDistributionHomePage
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(width: 5.w),
|
||||
Text(
|
||||
'اطلاعات پخش',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16,
|
||||
),
|
||||
Text('اطلاعات پخش', textAlign: TextAlign.right, style: AppFonts.yekan16),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.h),
|
||||
@@ -304,8 +275,7 @@ class WarehouseAndDistributionHomePage
|
||||
title: 'وزن دولتی',
|
||||
titleBgColor: const Color(0xFFB8E7DC),
|
||||
valueBgColor: const Color(0xFFE6FAF5),
|
||||
value:
|
||||
data.value?.totalGovernmentalInputWeight.separatedByComma,
|
||||
value: data.value?.totalGovernmentalInputWeight.separatedByComma,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -319,10 +289,7 @@ class WarehouseAndDistributionHomePage
|
||||
Expanded(
|
||||
child: broadcastItem(
|
||||
title: 'فروش دولتی',
|
||||
value: data
|
||||
.value
|
||||
?.totalGovernmentalOutputWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalGovernmentalOutputWeight.separatedByComma,
|
||||
titleBgColor: const Color(0xFFEBC4CE),
|
||||
valueBgColor: const Color(0xFFEDDCE0),
|
||||
),
|
||||
@@ -348,8 +315,7 @@ class WarehouseAndDistributionHomePage
|
||||
title: 'وزن انجماد',
|
||||
titleBgColor: const Color(0xFFEBC4CE),
|
||||
valueBgColor: const Color(0xFFEDDCE0),
|
||||
value:
|
||||
data.value?.coldHouseAllocationsWeight.separatedByComma,
|
||||
value: data.value?.coldHouseAllocationsWeight.separatedByComma,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -387,10 +353,7 @@ class WarehouseAndDistributionHomePage
|
||||
Expanded(
|
||||
child: broadcastItem(
|
||||
title: 'فروش و توزیع داخل استان',
|
||||
value: data
|
||||
.value
|
||||
?.totalKillHouseAllocationsWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalKillHouseAllocationsWeight.separatedByComma,
|
||||
titleBgColor: const Color(0xFFEBC4CE),
|
||||
valueBgColor: const Color(0xFFEDDCE0),
|
||||
),
|
||||
@@ -398,10 +361,7 @@ class WarehouseAndDistributionHomePage
|
||||
Expanded(
|
||||
child: broadcastItem(
|
||||
title: 'فروش و توزیع خارج استان',
|
||||
value: data
|
||||
.value
|
||||
?.totalKillHouseFreeSaleBarCarcassesWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalKillHouseFreeSaleBarCarcassesWeight.separatedByComma,
|
||||
titleBgColor: const Color(0xFFC2D3F2),
|
||||
valueBgColor: const Color(0xFFECF2FF),
|
||||
),
|
||||
@@ -488,9 +448,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: _informationLabelCard(
|
||||
title: 'خارج استان',
|
||||
isLoading: data.value == null,
|
||||
description:
|
||||
data.value?.freeBuyingCarcassesWeight.separatedByCommaFa ??
|
||||
'0',
|
||||
description: data.value?.freeBuyingCarcassesWeight.separatedByCommaFa ?? '0',
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
iconColor: Color(0xFF2D5FFF),
|
||||
bgLabelColor: const Color(0xFFAFCBFF),
|
||||
@@ -518,8 +476,7 @@ class WarehouseAndDistributionHomePage
|
||||
children: [
|
||||
inventoryListItem(
|
||||
title: 'خریدهای دولتی داخل استان',
|
||||
value:
|
||||
model?.provinceGovernmentalCarcassesWeight?.separatedByComma,
|
||||
value: model?.provinceGovernmentalCarcassesWeight?.separatedByComma,
|
||||
),
|
||||
Divider(),
|
||||
inventoryListItem(
|
||||
@@ -560,25 +517,14 @@ class WarehouseAndDistributionHomePage
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: const Color(0xFF353535),
|
||||
height: 1.2,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: const Color(0xFF353535), height: 1.2),
|
||||
),
|
||||
Spacer(),
|
||||
value == null
|
||||
? Center(child: CupertinoActivityIndicator())
|
||||
: Text(
|
||||
value,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: const Color(0xFF353535),
|
||||
),
|
||||
),
|
||||
: Text(value, style: AppFonts.yekan14.copyWith(color: const Color(0xFF353535))),
|
||||
SizedBox(width: 20.w),
|
||||
Text(
|
||||
'کیلوگرم',
|
||||
style: AppFonts.yekan10.copyWith(color: const Color(0xFF353535)),
|
||||
),
|
||||
Text('کیلوگرم', style: AppFonts.yekan10.copyWith(color: const Color(0xFF353535))),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -604,9 +550,7 @@ class WarehouseAndDistributionHomePage
|
||||
height: 65.h,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: borderColor != null
|
||||
? Border.all(width: 1, color: borderColor)
|
||||
: null,
|
||||
border: borderColor != null ? Border.all(width: 1, color: borderColor) : null,
|
||||
),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Row(
|
||||
@@ -669,16 +613,12 @@ class WarehouseAndDistributionHomePage
|
||||
textAlign: TextAlign.right,
|
||||
style:
|
||||
descriptionStyle ??
|
||||
AppFonts.yekan16.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -724,9 +664,7 @@ class WarehouseAndDistributionHomePage
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
|
||||
isLoading
|
||||
@@ -734,16 +672,12 @@ class WarehouseAndDistributionHomePage
|
||||
: Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -803,14 +737,8 @@ class WarehouseAndDistributionHomePage
|
||||
'کل ورودی به انبار (کیلوگرم)',
|
||||
model.totalFreeBarsCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل فروش (کیلوگرم)',
|
||||
model.realAllocatedWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'مانده انبار (کیلوگرم)',
|
||||
model.totalRemainWeight.toString(),
|
||||
),
|
||||
buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()),
|
||||
buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -829,9 +757,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
@@ -839,9 +765,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -867,9 +791,7 @@ class WarehouseAndDistributionHomePage
|
||||
Text(
|
||||
'اطلاعات ارسالی',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
buildRow(
|
||||
@@ -902,10 +824,7 @@ class WarehouseAndDistributionHomePage
|
||||
return Container(
|
||||
height: height?.h ?? 73.h,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
color: valueBgColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: valueBgColor, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
@@ -918,9 +837,7 @@ class WarehouseAndDistributionHomePage
|
||||
Text(
|
||||
title ?? 'بدون تیتر',
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
titleStyle ??
|
||||
AppFonts.yekan12.copyWith(color: const Color(0xFF3E3E3E)),
|
||||
style: titleStyle ?? AppFonts.yekan12.copyWith(color: const Color(0xFF3E3E3E)),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -933,9 +850,7 @@ class WarehouseAndDistributionHomePage
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.right,
|
||||
style:
|
||||
valueStyle ??
|
||||
AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
style: valueStyle ?? AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
)
|
||||
: Center(child: CupertinoActivityIndicator()),
|
||||
@@ -943,9 +858,7 @@ class WarehouseAndDistributionHomePage
|
||||
Text(
|
||||
unit ?? 'کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style:
|
||||
unitStyle ??
|
||||
AppFonts.yekan10.copyWith(color: Color(0xFF717171)),
|
||||
style: unitStyle ?? AppFonts.yekan10.copyWith(color: Color(0xFF717171)),
|
||||
),
|
||||
SizedBox(height: 4.h),
|
||||
],
|
||||
@@ -997,29 +910,19 @@ class WarehouseAndDistributionHomePage
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(width: 5.w),
|
||||
Text(
|
||||
'تعهدات',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16,
|
||||
),
|
||||
Text('تعهدات', textAlign: TextAlign.right, style: AppFonts.yekan16),
|
||||
],
|
||||
),
|
||||
|
||||
commitmentsItemList(
|
||||
title: 'تعهد دولتی توزیع داخل استان',
|
||||
value: data
|
||||
.value
|
||||
?.totalCommitmentSellingInProvinceGovernmentalWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalCommitmentSellingInProvinceGovernmentalWeight.separatedByComma,
|
||||
labelColor: const Color(0xFFB9E8DC),
|
||||
bgColor: const Color(0xFFF3F9F8),
|
||||
),
|
||||
commitmentsItemList(
|
||||
title: 'توزیع دولتی داخل استان',
|
||||
value: data
|
||||
.value
|
||||
?.totalSellingInProvinceGovernmentalWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalSellingInProvinceGovernmentalWeight.separatedByComma,
|
||||
labelColor: const Color(0xFFC3D4F3),
|
||||
bgColor: const Color(0xFFECF3FF),
|
||||
),
|
||||
@@ -1034,26 +937,19 @@ class WarehouseAndDistributionHomePage
|
||||
),
|
||||
commitmentsItemList(
|
||||
title: 'تعهد آزاد توزیع داخل استان',
|
||||
value: data
|
||||
.value
|
||||
?.totalCommitmentSellingInProvinceFreeWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalCommitmentSellingInProvinceFreeWeight.separatedByComma,
|
||||
labelColor: const Color(0xFFC7DADA),
|
||||
bgColor: const Color(0xFFE5F7F7),
|
||||
),
|
||||
commitmentsItemList(
|
||||
title: 'توزیع آزاد داخل استان',
|
||||
value:
|
||||
data.value?.totalSellingInProvinceFreeWeight.separatedByComma,
|
||||
value: data.value?.totalSellingInProvinceFreeWeight.separatedByComma,
|
||||
labelColor: const Color(0xFFE0D6ED),
|
||||
bgColor: const Color(0xFFF5EDFF),
|
||||
),
|
||||
commitmentsItemList(
|
||||
title: 'باقیمانده تعهد آزاد توزیع داخل استان',
|
||||
value: data
|
||||
.value
|
||||
?.totalCommitmentSellingInProvinceFreeRemainWeight
|
||||
.separatedByComma,
|
||||
value: data.value?.totalCommitmentSellingInProvinceFreeRemainWeight.separatedByComma,
|
||||
labelColor: const Color(0xFFEBC5CE),
|
||||
bgColor: const Color(0xFFFFF1F4),
|
||||
),
|
||||
@@ -1098,9 +994,7 @@ class WarehouseAndDistributionHomePage
|
||||
: Text(
|
||||
value,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.textColor,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
SizedBox(width: 8.w),
|
||||
|
||||
|
||||
@@ -4,14 +4,6 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/models/kill_house_module/warehouse_and_distribution/response/kill_house_sales_info_dashboard/kill_house_sales_info_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_remain_weight/steward_remain_weight.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/buy/view.dart';
|
||||
@@ -23,6 +15,14 @@ import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../common/data/model/local/widely_used_local_model.dart';
|
||||
import '../../../common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import '../../../common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import '../../../common/data/model/response/roles_products/roles_products.dart';
|
||||
import '../../../steward/data/model/response/steward_remain_weight/steward_remain_weight.dart';
|
||||
import '../../../steward/data/model/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
|
||||
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
@@ -41,7 +41,6 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
];
|
||||
|
||||
late KillHouseRepository killHouseRepository;
|
||||
late ChickenRepository chickenRepository;
|
||||
|
||||
final defaultRoutes = <int, String>{
|
||||
0: ChickenRoutes.buyWarehouseAndDistribution,
|
||||
@@ -52,8 +51,7 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
Rxn<WidelyUsedLocalModel> widelyUsedList = Rxn<WidelyUsedLocalModel>();
|
||||
|
||||
Rxn<BroadcastPrice> broadcastPrice = Rxn<BroadcastPrice>();
|
||||
Rxn<KillHouseSalesInfoDashboard> salesInfoDashboard =
|
||||
Rxn<KillHouseSalesInfoDashboard>();
|
||||
Rxn<KillHouseSalesInfoDashboard> salesInfoDashboard = Rxn<KillHouseSalesInfoDashboard>();
|
||||
Rxn<StewardRemainWeight> remainWeight = Rxn<StewardRemainWeight>();
|
||||
|
||||
RxList<ErrorLocationType> errorLocationType = RxList();
|
||||
@@ -70,7 +68,6 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
super.onInit();
|
||||
|
||||
killHouseRepository = diChicken.get<KillHouseRepository>();
|
||||
chickenRepository = diChicken.get<ChickenRepository>();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -122,9 +119,8 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
_inventoryCancelToken = CancelToken();
|
||||
|
||||
await safeCall<KillHouseSalesInfoDashboard?>(
|
||||
call: () async => await killHouseRepository.getInfoDashboard(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
call: () async =>
|
||||
await killHouseRepository.getInfoDashboard(token: tokenService.accessToken.value!),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
salesInfoDashboard.value = result;
|
||||
@@ -155,13 +151,13 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
_provincesCancelToken = CancelToken();
|
||||
|
||||
try {
|
||||
final res = await chickenRepository.getProvince(
|
||||
/* final res = await chickenRepository.getProvince(
|
||||
cancelToken: _provincesCancelToken,
|
||||
);
|
||||
if (res != null) {
|
||||
provinces.clear();
|
||||
provinces.value = res;
|
||||
}
|
||||
}*/
|
||||
} catch (e) {
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) {
|
||||
// Request was cancelled, ignore the error
|
||||
@@ -172,7 +168,7 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getBroadcastPrice() async {
|
||||
safeCall(
|
||||
/* safeCall(
|
||||
call: () async => await chickenRepository.getBroadcastPrice(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
@@ -180,11 +176,11 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
broadcastPrice.value = result;
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
);*/
|
||||
}
|
||||
|
||||
Future<void> getRolesProducts() async {
|
||||
await safeCall(
|
||||
/*await safeCall(
|
||||
call: () async => await chickenRepository.getRolesProducts(
|
||||
token: tokenService.accessToken.value!,
|
||||
queryParameters: buildRawQueryParams(role: 'KillHouse'),
|
||||
@@ -195,7 +191,7 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
);*/
|
||||
}
|
||||
|
||||
int getNestedKey() {
|
||||
@@ -228,8 +224,7 @@ class WarehouseAndDistributionRootLogic extends GetxController {
|
||||
currentNestedKey?.currentState?.popUntil((route) => route.isFirst);
|
||||
} else {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null ||
|
||||
now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class WarehouseAndDistributionRootPage
|
||||
extends GetView<WarehouseAndDistributionRootLogic> {
|
||||
import '../../../common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
|
||||
class WarehouseAndDistributionRootPage extends GetView<WarehouseAndDistributionRootLogic> {
|
||||
WarehouseAndDistributionRootPage({super.key});
|
||||
|
||||
@override
|
||||
@@ -27,8 +27,7 @@ class WarehouseAndDistributionRootPage
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => ChickenPages.pages.firstWhere(
|
||||
(e) =>
|
||||
e.name == ChickenRoutes.buyWarehouseAndDistribution,
|
||||
(e) => e.name == ChickenRoutes.buyWarehouseAndDistribution,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -41,9 +40,7 @@ class WarehouseAndDistributionRootPage
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => ChickenPages.pages.firstWhere(
|
||||
(e) =>
|
||||
e.name ==
|
||||
ChickenRoutes.saleWarehouseAndDistribution,
|
||||
(e) => e.name == ChickenRoutes.saleWarehouseAndDistribution,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -52,18 +49,15 @@ class WarehouseAndDistributionRootPage
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(stewardThirdKey),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[2]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(stewardFourthKey),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[3]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(stewardFifthKey),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[4]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
|
||||
),
|
||||
],
|
||||
index: data.value,
|
||||
@@ -159,10 +153,7 @@ class WarehouseAndDistributionRootPage
|
||||
return Container(
|
||||
height: 70,
|
||||
width: Get.width / 2,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -183,9 +174,7 @@ class WarehouseAndDistributionRootPage
|
||||
Text(
|
||||
'بارهای امروز',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -252,9 +241,7 @@ class WarehouseAndDistributionRootPage
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -277,16 +264,12 @@ class WarehouseAndDistributionRootPage
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -331,23 +314,17 @@ class WarehouseAndDistributionRootPage
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -395,18 +372,14 @@ class WarehouseAndDistributionRootPage
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFBECDFF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: SvgGenImage.vec(iconPath).svg(
|
||||
width: 24,
|
||||
@@ -416,10 +389,7 @@ class WarehouseAndDistributionRootPage
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -436,29 +406,20 @@ class WarehouseAndDistributionRootPage
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFD9F7F0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Assets.vec.messageAddSvg.svg(
|
||||
width: 40,
|
||||
height: 40,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.greenNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'افزودن',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover),
|
||||
),
|
||||
Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Widget buildRow(String title, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
@@ -470,9 +431,7 @@ class WarehouseAndDistributionRootPage
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
@@ -480,9 +439,7 @@ class WarehouseAndDistributionRootPage
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -508,9 +465,7 @@ class WarehouseAndDistributionRootPage
|
||||
Text(
|
||||
'اطلاعات ارسالی',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
buildRow(
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/allocated_made/allocated_made.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class WarehouseAndDistributionSaleLogic extends GetxController {
|
||||
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel =
|
||||
Rxn<List<AllocatedMadeModel>?>();
|
||||
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel = Rxn<List<AllocatedMadeModel>?>();
|
||||
|
||||
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
||||
|
||||
Rxn<StewardFreeBarDashboard> stewardFreeDashboard =
|
||||
Rxn<StewardFreeBarDashboard>();
|
||||
Rxn<StewardFreeBarDashboard> stewardFreeDashboard = Rxn<StewardFreeBarDashboard>();
|
||||
|
||||
WarehouseAndDistributionRootLogic rootLogic =
|
||||
Get.find<WarehouseAndDistributionRootLogic>();
|
||||
WarehouseAndDistributionRootLogic rootLogic = Get.find<WarehouseAndDistributionRootLogic>();
|
||||
|
||||
List<String> routesName = ['فروش'];
|
||||
DateTime? _lastBackPressed;
|
||||
@@ -118,8 +117,7 @@ class WarehouseAndDistributionSaleLogic extends GetxController {
|
||||
|
||||
void onPopScopTaped() async {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null ||
|
||||
now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
@@ -25,14 +25,14 @@ class WarehouseAndDistributionSalePage extends GetView<WarehouseAndDistributionS
|
||||
title: 'فروش داخل استان',
|
||||
vecIcon: Assets.vec.map2Svg.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesInProvinceSteward, id: stewardSecondKey);
|
||||
// Get.toNamed(ChickenRoutes.salesInProvinceSteward, id: stewardSecondKey);
|
||||
},
|
||||
),
|
||||
GlassMorphismCardIcon(
|
||||
title: 'فروش خارج استان',
|
||||
vecIcon: Assets.vec.saleOutProvinceSvg.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesOutOfProvinceSteward, id: stewardSecondKey);
|
||||
//Get.toNamed(ChickenRoutes.salesOutOfProvinceSteward, id: stewardSecondKey);
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
=
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sale/logic.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/request/submit_steward_allocation/submit_steward_allocation.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/allocated_made/allocated_made.dart';
|
||||
@@ -9,9 +11,6 @@ import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_p
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_remain_weight/steward_remain_weight.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/pages/sale/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
@@ -57,8 +56,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
final RxBool hasMoreDataAllocationsMade = true.obs;
|
||||
|
||||
Rxn<BroadcastPrice> broadcastPrice = Rxn<BroadcastPrice>();
|
||||
Rxn<AllocatedMadeModel> selectedAllocationModelForUpdate =
|
||||
Rxn<AllocatedMadeModel>();
|
||||
Rxn<AllocatedMadeModel> selectedAllocationModelForUpdate = Rxn<AllocatedMadeModel>();
|
||||
SubmitStewardAllocation? tmpStewardAllocation;
|
||||
|
||||
Rxn<Jalali> productionDate = Rxn(null);
|
||||
@@ -135,8 +133,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
void _updateGovernmentalProductionDateData() {
|
||||
=
|
||||
List<RemainWeightDay> dates =
|
||||
/*List<RemainWeightDay> dates =
|
||||
rootLogic.stewardRemainWeight.value?.governmental ?? [];
|
||||
governmentalProductionDateData = {
|
||||
for (var element in dates)
|
||||
@@ -147,7 +144,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
void _updateFreeProductionDateData() {
|
||||
/* var dates = rootLogic.stewardRemainWeight.value?.free ?? [];
|
||||
/* var dates = rootLogic.stewardRemainWeight.value?.free ?? [];
|
||||
freeProductionDateData = {
|
||||
for (var element in dates)
|
||||
element.day.toString().toJalali.formatCompactDate(): DayData(
|
||||
@@ -160,17 +157,16 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
allocatedList.value =
|
||||
Resource<PaginationModel<AllocatedMadeModel>>.loading();
|
||||
allocatedList.value = Resource<PaginationModel<AllocatedMadeModel>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
/*if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1; // Reset to first page if search value is set
|
||||
}
|
||||
|
||||
=
|
||||
|
||||
safeCall(
|
||||
call: () async => await rootLogic.stewardRepository.getAllocatedMade(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -214,20 +210,15 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
isLoadingMoreAllocationsMade.value = false;
|
||||
},
|
||||
); */
|
||||
|
||||
}
|
||||
|
||||
void checkVerification() {
|
||||
var hasWeight = quotaType.value == 1
|
||||
? weight.value <=
|
||||
(governmentalProductionDateData[productionDate.value
|
||||
?.formatCompactDate()]
|
||||
?.value ??
|
||||
(governmentalProductionDateData[productionDate.value?.formatCompactDate()]?.value ??
|
||||
0)
|
||||
: weight.value <=
|
||||
(freeProductionDateData[productionDate.value?.formatCompactDate()]
|
||||
?.value ??
|
||||
0);
|
||||
(freeProductionDateData[productionDate.value?.formatCompactDate()]?.value ?? 0);
|
||||
|
||||
isValid.value =
|
||||
weight.value > 0 &&
|
||||
@@ -239,7 +230,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
void confirmAllocation(ConformAllocation allocation) {
|
||||
=
|
||||
/*
|
||||
safeCall(
|
||||
call: () async => await rootLogic.stewardRepository.confirmAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -253,8 +244,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
void denyAllocation(String token) {
|
||||
=
|
||||
safeCall(
|
||||
/*safeCall(
|
||||
call: () async => await rootLogic.stewardRepository.denyAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
allocationToken: token,
|
||||
@@ -267,7 +257,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> confirmAllAllocations() async {
|
||||
=
|
||||
/*
|
||||
safeCall(
|
||||
call: () async => await rootLogic.stewardRepository.confirmAllAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -283,7 +273,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getRolesProducts() async {
|
||||
=
|
||||
/*
|
||||
safeCall(
|
||||
call: () async => await rootLogic.commonRepository.getRolesProducts(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -300,7 +290,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getGuilds() async {
|
||||
=
|
||||
/*
|
||||
safeCall(
|
||||
call: () async => await rootLogic.commonRepository.getGuilds(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -333,7 +323,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getGuildProfile() async {
|
||||
=
|
||||
/*
|
||||
await safeCall(
|
||||
call: () async => await rootLogic.commonRepository.getProfile(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -351,17 +341,13 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
allocationType:
|
||||
'${guildProfile.value?.steward == true ? "steward" : "guild"}_${selectedGuildModel.value?.steward == true ? "steward" : "guild"}',
|
||||
sellerType: guildProfile.value?.steward == true ? "Steward" : "Guild",
|
||||
buyerType: selectedGuildModel.value?.steward == true
|
||||
? "Steward"
|
||||
: "Guild",
|
||||
buyerType: selectedGuildModel.value?.steward == true ? "Steward" : "Guild",
|
||||
amount: pricePerKilo.value,
|
||||
totalAmount: totalCost.value,
|
||||
weightOfCarcasses: weight.value,
|
||||
sellType: saleType.value == 2 ? "free" : 'exclusive',
|
||||
numberOfCarcasses: 0,
|
||||
productionDate: productionDate.value
|
||||
?.toDateTime()
|
||||
.formattedDashedGregorian,
|
||||
productionDate: productionDate.value?.toDateTime().formattedDashedGregorian,
|
||||
quota: quotaType.value == 1 ? 'governmental' : 'free',
|
||||
guildKey: selectedGuildModel.value?.key,
|
||||
productKey: selectedProductModel.value?.key,
|
||||
@@ -373,7 +359,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
Future<void> submitAllocation() async {
|
||||
setSubmitData();
|
||||
|
||||
/* safeCall(
|
||||
/* safeCall(
|
||||
showError: true,
|
||||
call: () async =>
|
||||
await rootLogic.stewardRepository.postSubmitStewardAllocation(
|
||||
@@ -396,7 +382,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> deleteAllocation(AllocatedMadeModel model) async {
|
||||
=
|
||||
/*
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await rootLogic.stewardRepository.deleteStewardAllocation(
|
||||
@@ -426,9 +412,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
pricePerKilo.value = item.amount ?? 0;
|
||||
totalCost.value = item.totalAmount ?? 0;
|
||||
weightController.text = weight.value.toString().separatedByComma;
|
||||
pricePerKiloController.text = pricePerKilo.value
|
||||
.toString()
|
||||
.separatedByComma;
|
||||
pricePerKiloController.text = pricePerKilo.value.toString().separatedByComma;
|
||||
totalCostController.text = totalCost.value.toString().separatedByComma;
|
||||
isValid.value = true;
|
||||
productionDate.value = item.productionDate.toJalali;
|
||||
@@ -460,7 +444,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
weight_of_carcasses: weight.value,
|
||||
);
|
||||
|
||||
/* safeCall(
|
||||
/* safeCall(
|
||||
showError: true,
|
||||
call: () async =>
|
||||
await rootLogic.stewardRepository.updateStewardAllocation(
|
||||
@@ -513,7 +497,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getBroadcastPrice() async {
|
||||
=
|
||||
/*
|
||||
safeCall(
|
||||
call: () async => await rootLogic.commonRepository.getBroadcastPrice(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -536,11 +520,7 @@ class WarehouseAndDistributionSalesInProvinceLogic extends GetxController {
|
||||
toggleExpansion();
|
||||
currentPage.value = 1;
|
||||
hasMoreDataAllocationsMade.value = true;
|
||||
await Future.wait([
|
||||
getAllocatedMade(),
|
||||
getRolesProducts(),
|
||||
rootLogic.onRefresh(),
|
||||
]);
|
||||
await Future.wait([getAllocatedMade(), getRolesProducts(), rootLogic.onRefresh()]);
|
||||
}
|
||||
|
||||
void toggleExpansion({int? index}) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sales_in_province/widgets/cu_sale_in_provience.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
@@ -35,8 +35,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
isPaginating:
|
||||
controller.isLoadingMoreAllocationsMade.value,
|
||||
isPaginating: controller.isLoadingMoreAllocationsMade.value,
|
||||
onLoadMore: () async {
|
||||
controller.currentPage.value++;
|
||||
await controller.getAllocatedMade(true);
|
||||
@@ -47,8 +46,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
return ObxValue((val) {
|
||||
return ExpandableListItem2(
|
||||
selected: val.value == index,
|
||||
onTap: () =>
|
||||
controller.toggleExpansion(index: index),
|
||||
onTap: () => controller.toggleExpansion(index: index),
|
||||
index: index,
|
||||
child: itemListWidget(item),
|
||||
secondChild: itemListExpandedWidget(item, index),
|
||||
@@ -61,8 +59,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
}, controller.expandedListIndex);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) =>
|
||||
SizedBox(height: 8.h),
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
);
|
||||
}, controller.allocatedList),
|
||||
),
|
||||
@@ -96,13 +93,12 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
onPressed: () async {
|
||||
Get.defaultDialog(
|
||||
title: 'تایید یکجا',
|
||||
middleText:
|
||||
'آیا از تایید تمامی تخصیص ها اطمینان دارید؟',
|
||||
middleText: 'آیا از تایید تمامی تخصیص ها اطمینان دارید؟',
|
||||
confirm: ElevatedButton(
|
||||
onPressed: () async {
|
||||
await controller.confirmAllAllocations();
|
||||
controller.getAllocatedMade();
|
||||
// controller.rootLogic.getKillHouseSalesInfoDashboard();
|
||||
// controller.rootLogic.getKillHouseSalesInfoDashboard();
|
||||
Get.back();
|
||||
},
|
||||
child: Text('تایید'),
|
||||
@@ -118,10 +114,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
style: OutlinedButton.styleFrom(
|
||||
foregroundColor: AppColor.error,
|
||||
enableFeedback: true,
|
||||
side: BorderSide(
|
||||
color: AppColor.error,
|
||||
width: 1,
|
||||
),
|
||||
side: BorderSide(color: AppColor.error, width: 1),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
@@ -134,10 +127,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
);
|
||||
},
|
||||
message: 'تایید یکجا',
|
||||
icon: Assets.vec.clipboardTaskSvg.svg(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
),
|
||||
icon: Assets.vec.clipboardTaskSvg.svg(width: 40.w, height: 40.h),
|
||||
backgroundColor: controller.bgConfirmAllColor.value,
|
||||
),
|
||||
);
|
||||
@@ -193,19 +183,14 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
child: Assets.vec.hotChickenSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
item.weightOfCarcasses!.separatedByCommaFa.addKg,
|
||||
textAlign: TextAlign.left,
|
||||
textDirection: TextDirection.ltr,
|
||||
style: AppFonts.yekan12Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -252,10 +237,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
Container itemListExpandedWidget(AllocatedMadeModel item, int index) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -269,14 +251,10 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
),
|
||||
Spacer(),
|
||||
Text(
|
||||
item.registrationCode == null
|
||||
? 'در انتظار'
|
||||
: 'در انتظار تایید خریدار',
|
||||
item.registrationCode == null ? 'در انتظار' : 'در انتظار تایید خریدار',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: item.registrationCode == null
|
||||
? AppColor.darkGreyDark
|
||||
: AppColor.error,
|
||||
color: item.registrationCode == null ? AppColor.darkGreyDark : AppColor.error,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 7),
|
||||
@@ -284,9 +262,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
width: 16.w,
|
||||
height: 16.h,
|
||||
colorFilter: ColorFilter.mode(
|
||||
item.registrationCode == null
|
||||
? AppColor.darkGreyDark
|
||||
: AppColor.error,
|
||||
item.registrationCode == null ? AppColor.darkGreyDark : AppColor.error,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
@@ -310,16 +286,12 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
children: [
|
||||
Text(
|
||||
item.date?.toJalali.formatter.wN ?? 'ندارد',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.textColor,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${item.date?.toJalali.formatter.d} ${item.date?.toJalali.formatter.mN ?? 'ندارد'}',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -338,8 +310,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
),
|
||||
buildRow(
|
||||
title: 'تلفن خریدار',
|
||||
value:
|
||||
controller.getBuyerInformation(item)?.user?.mobile ?? 'ندارد',
|
||||
value: controller.getBuyerInformation(item)?.user?.mobile ?? 'ندارد',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(title: 'محصول', value: item.product?.name ?? 'ندارد'),
|
||||
@@ -349,18 +320,12 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
value: item.productionDate?.toJalali.formatCompactDate() ?? 'ندارد',
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'نوع تخصیص',
|
||||
value: item.allocationType?.faAllocationType ?? 'ندارد',
|
||||
),
|
||||
buildRow(title: 'نوع تخصیص', value: item.allocationType?.faAllocationType ?? 'ندارد'),
|
||||
buildRow(
|
||||
title: 'نوع فروش',
|
||||
value: (item.approvedPriceStatus ?? false) ? 'دولتی' : 'آزاد',
|
||||
),
|
||||
buildRow(
|
||||
title: 'نوع انبار',
|
||||
value: (item.quota == 'governmental') ? 'دولتی' : 'آزاد',
|
||||
),
|
||||
buildRow(title: 'نوع انبار', value: (item.quota == 'governmental') ? 'دولتی' : 'آزاد'),
|
||||
|
||||
buildRow(
|
||||
title: 'وزن خریداری شده',
|
||||
@@ -380,20 +345,12 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
),
|
||||
value: '${item.amount?.separatedByCommaFa} ریال',
|
||||
),
|
||||
buildRow(
|
||||
title: 'قیمت کل',
|
||||
value: '${item.totalAmount?.separatedByCommaFa} ریال',
|
||||
),
|
||||
buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByCommaFa} ریال'),
|
||||
|
||||
buildRow(
|
||||
title: 'کداحراز',
|
||||
value: item.registrationCode?.toString() ?? 'ندارد',
|
||||
),
|
||||
buildRow(title: 'کداحراز', value: item.registrationCode?.toString() ?? 'ندارد'),
|
||||
buildRow(
|
||||
title: 'وضعیت کد احراز',
|
||||
value: item.systemRegistrationCode == true
|
||||
? "ارسال شده"
|
||||
: "ارسال نشده",
|
||||
value: item.systemRegistrationCode == true ? "ارسال شده" : "ارسال نشده",
|
||||
),
|
||||
|
||||
Visibility(
|
||||
@@ -421,9 +378,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
),
|
||||
ROutlinedElevated(
|
||||
text: 'حذف',
|
||||
textStyle: AppFonts.yekan20.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal),
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
@@ -452,10 +407,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text(
|
||||
'فیلترها',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
||||
Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -463,8 +415,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
child: timeFilterWidget(
|
||||
controller: controller,
|
||||
date: controller.fromDateFilter,
|
||||
onChanged: (jalali) =>
|
||||
controller.fromDateFilter.value = jalali,
|
||||
onChanged: (jalali) => controller.fromDateFilter.value = jalali,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -515,10 +466,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
Assets.vec.calendarSvg.svg(
|
||||
width: 24,
|
||||
height: 24,
|
||||
colorFilter: const ColorFilter.mode(
|
||||
AppColor.blueNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: const ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
Text(
|
||||
isFrom ? 'از' : 'تا',
|
||||
@@ -529,9 +477,7 @@ class WarehouseAndDistributionSalesInProvincePage
|
||||
return Text(
|
||||
date.value.formatCompactDate(),
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.lightGreyNormalActive,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive),
|
||||
);
|
||||
}, date),
|
||||
),
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sales_in_province/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget addOrEditBottomSheet(WarehouseAndDistributionSalesInProvinceLogic controller, {bool isEditMode = false}) {
|
||||
Widget addOrEditBottomSheet(
|
||||
WarehouseAndDistributionSalesInProvinceLogic controller, {
|
||||
bool isEditMode = false,
|
||||
}) {
|
||||
return BaseBottomSheet(
|
||||
height: Get.height * (isEditMode ? 0.60 : 0.75),
|
||||
child: Form(
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_remain_weight/steward_remain_weight.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sale/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sales_out_of_province_buyers/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sales_out_of_province_sales_list/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -18,9 +18,11 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
|
||||
WarehouseAndDistributionSaleLogic saleLogic = Get.find<WarehouseAndDistributionSaleLogic>();
|
||||
|
||||
WarehouseAndDistributionSalesOutOfProvinceSalesListLogic saleListLogic = Get.find<WarehouseAndDistributionSalesOutOfProvinceSalesListLogic>();
|
||||
WarehouseAndDistributionSalesOutOfProvinceSalesListLogic saleListLogic =
|
||||
Get.find<WarehouseAndDistributionSalesOutOfProvinceSalesListLogic>();
|
||||
|
||||
WarehouseAndDistributionSalesOutOfProvinceBuyersLogic buyerLogic = Get.find<WarehouseAndDistributionSalesOutOfProvinceBuyersLogic>();
|
||||
WarehouseAndDistributionSalesOutOfProvinceBuyersLogic buyerLogic =
|
||||
Get.find<WarehouseAndDistributionSalesOutOfProvinceBuyersLogic>();
|
||||
|
||||
RxBool isExpanded = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
@@ -71,7 +73,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
super.onReady();
|
||||
getOutProvinceSales();
|
||||
getBroadcastPrice();
|
||||
// selectedProduct.value = rootLogic.rolesProductsModel.first;
|
||||
// selectedProduct.value = rootLogic.rolesProductsModel.first;
|
||||
debounce(
|
||||
searchedValue,
|
||||
(callback) => getOutProvinceSales(),
|
||||
@@ -81,7 +83,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
|
||||
_updateGovernmentalProductionDateData();
|
||||
_updateFreeProductionDateData();
|
||||
/* ever(rootLogic.stewardRemainWeight, (callback) {
|
||||
/* ever(rootLogic.stewardRemainWeight, (callback) {
|
||||
_updateGovernmentalProductionDateData();
|
||||
_updateFreeProductionDateData();
|
||||
}); */
|
||||
@@ -99,7 +101,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
void _updateGovernmentalProductionDateData() {
|
||||
/* List<RemainWeightDay> dates = rootLogic.stewardRemainWeight.value?.governmental ?? [];
|
||||
/* List<RemainWeightDay> dates = rootLogic.stewardRemainWeight.value?.governmental ?? [];
|
||||
governmentalProductionDateData = {
|
||||
for (var element in dates)
|
||||
element.day.toString().toJalali.formatCompactDate(): DayData(
|
||||
@@ -109,7 +111,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
void _updateFreeProductionDateData() {
|
||||
/* var dates = rootLogic.stewardRemainWeight.value?.free ?? [];
|
||||
/* var dates = rootLogic.stewardRemainWeight.value?.free ?? [];
|
||||
freeProductionDateData = {
|
||||
for (var element in dates)
|
||||
element.day.toString().toJalali.formatCompactDate(): DayData(
|
||||
@@ -129,7 +131,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getOutProvinceSales([bool isLoadingMore = false]) async {
|
||||
/* if (isLoadingMore) {
|
||||
/* if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
salesList.value = Resource<PaginationModel<StewardFreeSaleBar>>.loading();
|
||||
@@ -195,10 +197,10 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
saleWeightController.text = item.weightOfCarcasses?.toInt().toString() ?? '';
|
||||
saleDate.value = Jalali.fromDateTime(DateTime.parse(item.date!));
|
||||
selectedCity.value = IranProvinceCityModel(name: item.city);
|
||||
selectedBuyer.value = buyerLogic.buyerList.value.data?.results?.firstWhere(
|
||||
/*selectedBuyer.value = buyerLogic.buyerList.value.data?.results?.firstWhere(
|
||||
(element) => element.key == item.buyer?.key,
|
||||
);
|
||||
// selectedProduct.value = rootLogic.rolesProductsModel.first;
|
||||
);*/
|
||||
// selectedProduct.value = rootLogic.rolesProductsModel.first;
|
||||
key = item.key;
|
||||
saleType.value = item.saleType == 'free' ? 2 : 1;
|
||||
quotaType.value = item.quota == 'governmental' ? 1 : 2;
|
||||
@@ -209,7 +211,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
call: () => rootLogic.chickenRepository.deleteOutProvinceStewardFreeBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
key: key,
|
||||
@@ -230,7 +232,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
quota: quotaType.value == 1 ? 'governmental' : 'free',
|
||||
productionDate: productionDate.value?.toDateTime().formattedDashedGregorian,
|
||||
);
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
showError: true,
|
||||
call: () => rootLogic.chickenRepository.createOutProvinceStewardFreeBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -271,7 +273,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
quota: quotaType.value == 1 ? 'governmental' : 'free',
|
||||
key: key,
|
||||
);
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
call: () => rootLogic.chickenRepository.updateOutProvinceStewardFreeBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
body: requestBody,
|
||||
@@ -306,7 +308,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
city: item.city,
|
||||
province: item.province,
|
||||
);
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
showError: true,
|
||||
call: () => rootLogic.chickenRepository.updateOutProvinceStewardFreeBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -347,7 +349,7 @@ class WarehouseAndDistributionSalesOutOfProvinceLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getBroadcastPrice() async {
|
||||
/* safeCall(
|
||||
/* safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getBroadcastPrice(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
),
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sale/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sales_out_of_province/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class WarehouseAndDistributionSalesOutOfProvinceBuyersLogic
|
||||
extends GetxController {
|
||||
WarehouseAndDistributionRootLogic rootLogic =
|
||||
Get.find<WarehouseAndDistributionRootLogic>();
|
||||
class WarehouseAndDistributionSalesOutOfProvinceBuyersLogic extends GetxController {
|
||||
WarehouseAndDistributionRootLogic rootLogic = Get.find<WarehouseAndDistributionRootLogic>();
|
||||
|
||||
WarehouseAndDistributionSaleLogic get saleLogic =>
|
||||
Get.find<WarehouseAndDistributionSaleLogic>();
|
||||
WarehouseAndDistributionSaleLogic get saleLogic => Get.find<WarehouseAndDistributionSaleLogic>();
|
||||
|
||||
WarehouseAndDistributionSalesOutOfProvinceLogic get saleOutOfProvince =>
|
||||
Get.find<WarehouseAndDistributionSalesOutOfProvinceLogic>();
|
||||
@@ -78,14 +74,11 @@ class WarehouseAndDistributionSalesOutOfProvinceBuyersLogic
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Future<void> getOutProvinceCarcassesBuyer([
|
||||
bool isLoadingMore = false,
|
||||
]) async {
|
||||
Future<void> getOutProvinceCarcassesBuyer([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
buyerList.value =
|
||||
Resource<PaginationModel<OutProvinceCarcassesBuyer>>.loading();
|
||||
buyerList.value = Resource<PaginationModel<OutProvinceCarcassesBuyer>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
@@ -172,7 +165,7 @@ class WarehouseAndDistributionSalesOutOfProvinceBuyersLogic
|
||||
if (!(formKey.currentState?.validate() ?? false)) {
|
||||
return res;
|
||||
}
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
call: () async {
|
||||
OutProvinceCarcassesBuyer buyer = OutProvinceCarcassesBuyer(
|
||||
province: selectedProvince.value!.name,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
@@ -8,7 +8,8 @@ import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class WarehouseAndDistributionSalesOutOfProvinceBuyersPage extends GetView<WarehouseAndDistributionSalesOutOfProvinceBuyersLogic> {
|
||||
class WarehouseAndDistributionSalesOutOfProvinceBuyersPage
|
||||
extends GetView<WarehouseAndDistributionSalesOutOfProvinceBuyersLogic> {
|
||||
const WarehouseAndDistributionSalesOutOfProvinceBuyersPage({super.key});
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sale/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/sales_out_of_province_buyers/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'
|
||||
show OutProvinceCarcassesBuyer;
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -15,7 +16,8 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
|
||||
WarehouseAndDistributionSaleLogic saleLogic = Get.find<WarehouseAndDistributionSaleLogic>();
|
||||
|
||||
WarehouseAndDistributionSalesOutOfProvinceBuyersLogic buyerLogic = Get.find<WarehouseAndDistributionSalesOutOfProvinceBuyersLogic>();
|
||||
WarehouseAndDistributionSalesOutOfProvinceBuyersLogic buyerLogic =
|
||||
Get.find<WarehouseAndDistributionSalesOutOfProvinceBuyersLogic>();
|
||||
|
||||
RxInt selectedSegmentIndex = 0.obs;
|
||||
RxBool isExpanded = false.obs;
|
||||
@@ -32,12 +34,9 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
//TODO add this to Di
|
||||
ImagePicker imagePicker = ImagePicker();
|
||||
|
||||
|
||||
|
||||
RxInt saleType = 1.obs;
|
||||
RxInt quotaType = 1.obs;
|
||||
|
||||
|
||||
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||
TextEditingController quarantineCodeController = TextEditingController();
|
||||
TextEditingController saleWeightController = TextEditingController();
|
||||
@@ -81,7 +80,7 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
} else {
|
||||
salesList.value = Resource<PaginationModel<StewardFreeSaleBar>>.loading();
|
||||
}
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
call: () => rootLogic.chickenRepository.getStewardFreeSaleBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
@@ -115,7 +114,6 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
}
|
||||
|
||||
void setupListeners() {
|
||||
|
||||
quarantineCodeController.addListener(checkSalesFormValid);
|
||||
ever(selectedBuyer, (_) => checkSalesFormValid);
|
||||
ever(selectedProduct, (_) => checkSalesFormValid);
|
||||
@@ -168,7 +166,7 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
clearanceCode: quarantineCodeController.text,
|
||||
productKey: selectedProduct.value?.key,
|
||||
);
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
call: () => rootLogic.chickenRepository.createOutProvinceStewardFreeBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
body: requestBody,
|
||||
@@ -197,7 +195,7 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
clearanceCode: quarantineCodeController.text,
|
||||
key: key,
|
||||
);
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
call: () => rootLogic.chickenRepository.updateOutProvinceStewardFreeBar(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
body: requestBody,
|
||||
@@ -214,6 +212,7 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListLogic extends GetxContr
|
||||
selectedProduct.value = null;
|
||||
key = null;
|
||||
}
|
||||
|
||||
void toggleExpansion({int? index}) {
|
||||
if (expandedListIndex.value == index || index == null) {
|
||||
expandedListIndex.value = -1;
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class WarehouseAndDistributionSalesOutOfProvinceSalesListPage extends GetView<WarehouseAndDistributionSalesOutOfProvinceSalesListLogic> {
|
||||
class WarehouseAndDistributionSalesOutOfProvinceSalesListPage
|
||||
extends GetView<WarehouseAndDistributionSalesOutOfProvinceSalesListLogic> {
|
||||
const WarehouseAndDistributionSalesOutOfProvinceSalesListPage({super.key});
|
||||
|
||||
@override
|
||||
@@ -60,7 +61,7 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListPage extends GetView<Wa
|
||||
icon: Icon(CupertinoIcons.person_add_solid, color: Colors.white, size: 35.w),
|
||||
backgroundColor: AppColor.blueNormal,
|
||||
onPressed: () {
|
||||
Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyerSteward, id: 1);
|
||||
//Get.toNamed(ChickenRoutes.salesOutOfProvinceBuyerSteward, id: 1);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 25),
|
||||
@@ -246,8 +247,8 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListPage extends GetView<Wa
|
||||
isOnEdit ? 'ویرایش فروش' : 'افزودن فروش',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
//_productDropDown(),
|
||||
|
||||
//_productDropDown(),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
@@ -369,7 +370,7 @@ class WarehouseAndDistributionSalesOutOfProvinceSalesListPage extends GetView<Wa
|
||||
});
|
||||
}
|
||||
|
||||
/* Widget _productDropDown() {
|
||||
/* Widget _productDropDown() {
|
||||
return Obx(() {
|
||||
return OverlayDropdownWidget<ProductModel>(
|
||||
items: controller.rootLogic.rolesProductsModel,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -57,14 +57,14 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
});
|
||||
_updateGovernmentalProductionDateData();
|
||||
_updateFreeProductionDateData();
|
||||
/* ever(rootLogic.stewardRemainWeight, (callback) {
|
||||
/* ever(rootLogic.stewardRemainWeight, (callback) {
|
||||
_updateGovernmentalProductionDateData();
|
||||
_updateFreeProductionDateData();
|
||||
}); */
|
||||
}
|
||||
|
||||
void _updateGovernmentalProductionDateData() {
|
||||
/* List<RemainWeightDay> dates = rootLogic.stewardRemainWeight.value?.governmental ?? [];
|
||||
/* List<RemainWeightDay> dates = rootLogic.stewardRemainWeight.value?.governmental ?? [];
|
||||
governmentalProductionDateData = {
|
||||
for (var element in dates)
|
||||
element.day.toString().toJalali.formatCompactDate(): DayData(
|
||||
@@ -89,7 +89,6 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
setUpListener();
|
||||
}
|
||||
|
||||
|
||||
void setSearchValue(String? value) {
|
||||
searchedValue.value = value?.trim();
|
||||
}
|
||||
@@ -149,7 +148,7 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
currentPage.value = 1; // Reset to first page if search value is set
|
||||
}
|
||||
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
showError: true,
|
||||
call: () async => await rootLogic.chickenRepository.getSegmentation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -187,7 +186,7 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> deleteSegmentation(String key) async {
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
showError: true,
|
||||
showSuccess: true,
|
||||
call: () => rootLogic.chickenRepository.deleteSegmentation(
|
||||
@@ -199,7 +198,7 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
|
||||
Future<bool> editSegment() async {
|
||||
var res = true;
|
||||
/* safeCall(
|
||||
/* safeCall(
|
||||
showError: true,
|
||||
call: () async => await rootLogic.chickenRepository.editSegmentation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -234,7 +233,7 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
segmentationModel = segmentationModel.copyWith(
|
||||
productionDate: productionDate.value?.toDateTime().formattedDashedGregorian,
|
||||
);
|
||||
/* await safeCall(
|
||||
/* await safeCall(
|
||||
showError: true,
|
||||
call: () async => await rootLogic.chickenRepository.createSegmentation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
@@ -258,7 +257,7 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getGuilds() async {
|
||||
/* safeCall(
|
||||
/* safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getGuilds(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(queryParams: {'all': true}, role: 'Steward'),
|
||||
@@ -284,7 +283,7 @@ class WarehouseAndDistributionSegmentationLogic extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> getBroadcastPrice() async {
|
||||
/* safeCall(
|
||||
/* safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getBroadcastPrice(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/segmentation/widgets/cu_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/filter_bottom_sheet.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
@@ -144,9 +144,7 @@ class WarehouseAndDistributionSegmentationPage
|
||||
item.weight.separatedByCommaFa.addKg,
|
||||
textAlign: TextAlign.center,
|
||||
textDirection: TextDirection.ltr,
|
||||
style: AppFonts.yekan14Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.saleType == "governmental" ? 'دولتی' : 'آزاد',
|
||||
@@ -168,10 +166,7 @@ class WarehouseAndDistributionSegmentationPage
|
||||
Container itemListExpandedWidget(SegmentationModel item, int index) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -192,18 +187,13 @@ class WarehouseAndDistributionSegmentationPage
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
DateTimeExtensions(item.date)?.toJalali().formatter.wN ??
|
||||
'N/A',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.textColor,
|
||||
),
|
||||
DateTimeExtensions(item.date)?.toJalali().formatter.wN ?? 'N/A',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
Text(
|
||||
'${DateTimeExtensions(item.date)?.toJalali().formatter.d} ${DateTimeExtensions(item.date)?.toJalali().formatter.mN ?? 'N/A'}',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -238,18 +228,9 @@ class WarehouseAndDistributionSegmentationPage
|
||||
? item.toGuild?.guildsName ?? 'N/A'
|
||||
: item.buyer?.shop ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
title: 'ماهیت',
|
||||
value: item.toGuild != null ? 'قطعهبند' : 'مباشر',
|
||||
),
|
||||
buildRow(
|
||||
title: 'نوع فروش',
|
||||
value: item.saleType == "governmental" ? 'دولتی' : 'آزاد',
|
||||
),
|
||||
buildRow(
|
||||
title: 'انبار فروش',
|
||||
value: item.quota == "governmental" ? 'دولتی' : 'آزاد',
|
||||
),
|
||||
buildRow(title: 'ماهیت', value: item.toGuild != null ? 'قطعهبند' : 'مباشر'),
|
||||
buildRow(title: 'نوع فروش', value: item.saleType == "governmental" ? 'دولتی' : 'آزاد'),
|
||||
buildRow(title: 'انبار فروش', value: item.quota == "governmental" ? 'دولتی' : 'آزاد'),
|
||||
buildRow(
|
||||
title: 'تاریخ تولید گوشت',
|
||||
value: item.productionDate?.toJalali.formatCompactDate() ?? 'ندارد',
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/kill_house/warehouse_and_distribution/segmentation/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
Widget addOrEditBottomSheet(WarehouseAndDistributionSegmentationLogic controller, {bool isOnEdit = false}) {
|
||||
Widget addOrEditBottomSheet(
|
||||
WarehouseAndDistributionSegmentationLogic controller, {
|
||||
bool isOnEdit = false,
|
||||
}) {
|
||||
return BaseBottomSheet(
|
||||
height: isOnEdit ? 350.h : 600.h,
|
||||
child: SingleChildScrollView(
|
||||
@@ -257,7 +259,10 @@ Widget addOrEditBottomSheet(WarehouseAndDistributionSegmentationLogic controller
|
||||
);
|
||||
}
|
||||
|
||||
Widget submitButtonWidget(WarehouseAndDistributionSegmentationLogic controller, {bool isOnEdit = false}) {
|
||||
Widget submitButtonWidget(
|
||||
WarehouseAndDistributionSegmentationLogic controller, {
|
||||
bool isOnEdit = false,
|
||||
}) {
|
||||
return ObxValue((data) {
|
||||
return RElevated(
|
||||
isFullWidth: true,
|
||||
@@ -279,7 +284,7 @@ Widget submitButtonWidget(WarehouseAndDistributionSegmentationLogic controller,
|
||||
}
|
||||
|
||||
Widget _productDropDown(WarehouseAndDistributionSegmentationLogic controller) {
|
||||
/* return Obx(() {
|
||||
/* return Obx(() {
|
||||
return OverlayDropdownWidget<ProductModel>(
|
||||
items: controller.rootLogic.rolesProductsModel,
|
||||
height: 56,
|
||||
@@ -335,7 +340,10 @@ Widget guildsDropDown(WarehouseAndDistributionSegmentationLogic controller) {
|
||||
});
|
||||
}
|
||||
|
||||
Container modalDatePicker(WarehouseAndDistributionSegmentationLogic controller, ValueChanged<Jalali> onDateSelected) {
|
||||
Container modalDatePicker(
|
||||
WarehouseAndDistributionSegmentationLogic controller,
|
||||
ValueChanged<Jalali> onDateSelected,
|
||||
) {
|
||||
Jalali currentDate = Jalali.now();
|
||||
Jalali? tempPickedDate;
|
||||
return Container(
|
||||
|
||||
Reference in New Issue
Block a user