update fcs-shipmentinfo,cartoninfo and pinlogin

This commit is contained in:
sma
2024-02-22 17:09:48 +06:30
parent 2a1aa9662d
commit d0cef82b19
5 changed files with 205 additions and 6 deletions

View File

@@ -135,21 +135,21 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.process.btn",
callBack: () {},
callBack: _process,
),
);
final arriveBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.arrive.btn",
callBack: () {},
callBack: _arrive,
),
);
final invoiceBtn = Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: LocalButton(
textKey: "FCSshipment.invoice.btn",
callBack: () {},
callBack: _invoice,
),
);
@@ -281,6 +281,30 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
});
}
_process() {
showConfirmDialog(context, "FCSshipment.process.confirm", () {
_processFcsShipment();
});
}
_processFcsShipment() async {
setState(() {
_isLoading = true;
});
try {
FcsShipmentModel fcsShipmentModel =
Provider.of<FcsShipmentModel>(context, listen: false);
await fcsShipmentModel.process(_fcsShipment!.id!);
Navigator.pop(context, true);
} catch (e) {
showMsgDialog(context, "Error", e.toString());
} finally {
setState(() {
_isLoading = false;
});
}
}
_ship() {
showConfirmDialog(context, "FCSshipment.ship.confirm", () {
_shipFcsShipment();
@@ -305,6 +329,54 @@ class _FcsShipmentInfoState extends State<FcsShipmentInfo> {
}
}
_arrive() {
showConfirmDialog(context, "FCSshipment.arrive.confirm", () {
_arriveFcsShipment();
});
}
_arriveFcsShipment() async {
setState(() {
_isLoading = true;
});
try {
FcsShipmentModel fcsShipmentModel =
Provider.of<FcsShipmentModel>(context, listen: false);
await fcsShipmentModel.arrive(_fcsShipment!.id!);
Navigator.pop(context, true);
} catch (e) {
showMsgDialog(context, "Error", e.toString());
} finally {
setState(() {
_isLoading = false;
});
}
}
_invoice() {
showConfirmDialog(context, "FCSshipment.invoice.confirm", () {
_invoiceFcsShipment();
});
}
_invoiceFcsShipment() async {
setState(() {
_isLoading = true;
});
try {
FcsShipmentModel fcsShipmentModel =
Provider.of<FcsShipmentModel>(context, listen: false);
await fcsShipmentModel.invoice(_fcsShipment!.id!);
Navigator.pop(context, true);
} catch (e) {
showMsgDialog(context, "Error", e.toString());
} finally {
setState(() {
_isLoading = false;
});
}
}
_showPDF(int id) async {
setState(() {
_isLoading = true;