add fcs shipment in processing,update cargo types for carton

This commit is contained in:
tzw
2025-03-21 18:19:52 +06:30
parent e208734dfa
commit 3bfbca35fc
34 changed files with 1227 additions and 665 deletions

View File

@@ -40,10 +40,10 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
void initState() {
super.initState();
_initPackage(widget.package);
_loadShipment();
}
_initPackage(Package package) {
_loadShipment();
setState(() {
_package = package;
multiImgController.setImageUrls = package.photoUrls;
@@ -51,10 +51,10 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
}
_loadShipment() async {
if (widget.package.shipmentId == null) return;
if (widget.package.fcsShipmentId == null) return;
var s = await context
.read<FcsShipmentModel>()
.getFcsShipment(widget.package.shipmentId!);
.getFcsShipment(widget.package.fcsShipmentId!);
_shipment = s;
if (mounted) {
setState(() {});
@@ -123,17 +123,17 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
iconData: Ionicons.ios_airplane,
),
),
Flexible(
child: DisplayText(
text: _shipment != null
? _shipment!.processingDate != null
? dateFormatter.format(_shipment!.processingDate!)
: ""
: "",
labelTextKey: "package.processing.date",
iconData: Icons.date_range,
),
),
// Flexible(
// child: DisplayText(
// text: _shipment != null
// ? _shipment!.processingDate != null
// ? dateFormatter.format(_shipment!.processingDate!)
// : ""
// : "",
// labelTextKey: "package.processing.date",
// iconData: Icons.date_range,
// ),
// ),
],
),
Row(
@@ -241,13 +241,11 @@ class _ProcessingInfoState extends State<ProcessingInfo> {
_gotoEditor() async {
if (_package == null) return;
bool? deleted = await Navigator.push<bool>(
bool? updated = await Navigator.push<bool>(
context,
CupertinoPageRoute(
builder: (context) => ProcessingEditEditor(package: _package!)));
if (deleted ?? false) {
Navigator.pop(context);
} else {
if (updated ?? false) {
PackageModel packageModel =
Provider.of<PackageModel>(context, listen: false);
Package? p = await packageModel.getPackage(_package!.id!);