feat : sale out of province
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class SalesOutOfProvinceSalesListLogic extends GetxController {
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class SalesOutOfProvinceSalesListPage extends StatelessWidget {
|
||||
const SalesOutOfProvinceSalesListPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final SalesOutOfProvinceSalesListLogic logic = Get.put(SalesOutOfProvinceSalesListLogic());
|
||||
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: BasePage(
|
||||
routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName),
|
||||
routesWidget: ObxValue(
|
||||
(route) => buildPageRoute(route),
|
||||
controller.routesName,
|
||||
),
|
||||
onBackPressed: () => Get.back(id: 1),
|
||||
onSearchChanged: (data) => controller.setSearchValue(data),
|
||||
filteringWidget: filterBottomSheet(),
|
||||
@@ -32,7 +35,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
isPaginating: controller.isLoadingMoreAllocationsMade.value,
|
||||
onRefresh: () async => await controller.getAllocatedMade(),
|
||||
onRefresh: () async {
|
||||
controller.currentPage.value = 1;
|
||||
await controller.getAllocatedMade();
|
||||
},
|
||||
onLoadMore: () async {
|
||||
controller.currentPage.value++;
|
||||
iLog(controller.currentPage.value);
|
||||
@@ -83,7 +89,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
await controller.confirmAllAllocations();
|
||||
},
|
||||
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,
|
||||
),
|
||||
);
|
||||
@@ -100,7 +109,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
width: Get.width,
|
||||
height: 39,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(color: AppColor.greenLight, borderRadius: BorderRadius.circular(8)),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.greenLight,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
alignment: Alignment.center,
|
||||
child: ObxValue((data) {
|
||||
return Text(
|
||||
@@ -153,13 +165,18 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
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?.separatedByComma}kg',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -190,7 +207,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
itemListExpandedWidget(AllocatedMadeModel item, int index) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
@@ -230,12 +250,16 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -255,7 +279,8 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
|
||||
buildRow(
|
||||
title: 'نام و نام خانوادگی فروشنده',
|
||||
value: controller.getBuyerInformation(item)?.user?.fullname ?? 'N/A',
|
||||
value:
|
||||
controller.getBuyerInformation(item)?.user?.fullname ?? 'N/A',
|
||||
),
|
||||
|
||||
buildRow(
|
||||
@@ -273,12 +298,20 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
title: 'افت وزن(کیلوگرم)',
|
||||
value: item.weightLossOfCarcasses?.toInt().toString() ?? 'N/A',
|
||||
),
|
||||
buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByComma} ریال'),
|
||||
buildRow(
|
||||
title: 'قیمت کل',
|
||||
value: '${item.totalAmount?.separatedByComma} ریال',
|
||||
),
|
||||
|
||||
buildRow(title: 'کداحراز', value: item.registrationCode?.toString() ?? 'ندارد'),
|
||||
buildRow(
|
||||
title: 'کداحراز',
|
||||
value: item.registrationCode?.toString() ?? 'ندارد',
|
||||
),
|
||||
buildRow(
|
||||
title: 'وضعیت کد احراز',
|
||||
value: item.systemRegistrationCode == true ? "ارسال شده" : "ارسال نشده",
|
||||
value: item.systemRegistrationCode == true
|
||||
? "ارسال شده"
|
||||
: "ارسال نشده",
|
||||
),
|
||||
|
||||
Row(
|
||||
@@ -341,7 +374,9 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'${isEditMode ? 'ویرایش' : 'ثبت'} توزیع/ فروش',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: isEditMode == false,
|
||||
@@ -355,7 +390,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
initText: Jalali.now().formatCompactDate(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Material(type: MaterialType.transparency, child: productDropDown()),
|
||||
Material(
|
||||
type: MaterialType.transparency,
|
||||
child: productDropDown(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
@@ -403,7 +441,12 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
],
|
||||
validator: (value) {
|
||||
if (int.parse(value!.clearComma) >
|
||||
(controller.rootLogic.inventoryModel.value?.totalRemainWeight?.toInt() ??
|
||||
(controller
|
||||
.rootLogic
|
||||
.inventoryModel
|
||||
.value
|
||||
?.totalRemainWeight
|
||||
?.toInt() ??
|
||||
100)) {
|
||||
return 'وزن تخصیصی بیشتر از موجودی انبار است';
|
||||
}
|
||||
@@ -424,7 +467,8 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
],
|
||||
|
||||
onChanged: (p0) {
|
||||
controller.pricePerKilo.value = int.tryParse(p0.clearComma) ?? 0;
|
||||
controller.pricePerKilo.value =
|
||||
int.tryParse(p0.clearComma) ?? 0;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
label: 'قیمت هر کیلو',
|
||||
@@ -450,7 +494,8 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
height: 40,
|
||||
onPressed: data.value
|
||||
? () async {
|
||||
if (controller.formKey.currentState?.validate() ?? false) {
|
||||
if (controller.formKey.currentState?.validate() ??
|
||||
false) {
|
||||
iLog("s2");
|
||||
controller.setSubmitData();
|
||||
iLog("s3");
|
||||
@@ -527,14 +572,20 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
child: Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover)),
|
||||
Text(
|
||||
'فیلترها',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Row(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Expanded(
|
||||
child: timeFilterWidget(
|
||||
date: controller.fromDateFilter,
|
||||
onChanged: (jalali) => controller.fromDateFilter.value = jalali,
|
||||
onChanged: (jalali) =>
|
||||
controller.fromDateFilter.value = jalali,
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
@@ -583,7 +634,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
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 ? 'از' : 'تا',
|
||||
@@ -592,9 +646,12 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return Text(
|
||||
date.value?.formatCompactDate() ?? Jalali.now().formatCompactDate(),
|
||||
date.value?.formatCompactDate() ??
|
||||
Jalali.now().formatCompactDate(),
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.lightGreyNormalActive),
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.lightGreyNormalActive,
|
||||
),
|
||||
);
|
||||
}, date),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user