Merge branch 'master' of https://git.mokkon.com/tzw/fcs
This commit is contained in:
@@ -315,6 +315,27 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
child: LocalText(context, "box.imageupload.title",
|
||||
color: Colors.white, fontSize: 14)),
|
||||
);
|
||||
final shipBtn = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: LocalButton(
|
||||
color: primaryColor,
|
||||
textKey: "box.ship.btn",
|
||||
callBack: _ship,
|
||||
));
|
||||
final arriveBtn = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: LocalButton(
|
||||
color: primaryColor,
|
||||
textKey: "box.arrive.btn",
|
||||
callBack: _arrive,
|
||||
));
|
||||
final invoiceBtn = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
child: LocalButton(
|
||||
color: primaryColor,
|
||||
textKey: "box.invoice.btn",
|
||||
callBack: _invoice,
|
||||
));
|
||||
|
||||
final deleteBtn = Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30),
|
||||
@@ -397,9 +418,22 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
_cargoTypes.isEmpty ? const SizedBox() : cargosBox,
|
||||
_surchareItems.isEmpty ? const SizedBox() : surchargeItemBox,
|
||||
uploadImageBtn,
|
||||
const SizedBox(height: 30),
|
||||
img,
|
||||
const SizedBox(height: 15),
|
||||
deleteBtn,
|
||||
const SizedBox(height: 40),
|
||||
_carton.status == carton_processing_status
|
||||
? shipBtn
|
||||
: Container(),
|
||||
const SizedBox(height: 40),
|
||||
_carton.status == carton_processing_status
|
||||
? deleteBtn
|
||||
: Container(),
|
||||
_carton.status == carton_arrived_status
|
||||
? arriveBtn
|
||||
: Container(),
|
||||
_carton.status == carton_arrived_status
|
||||
? invoiceBtn
|
||||
: Container(),
|
||||
const SizedBox(height: 20)
|
||||
]))));
|
||||
}
|
||||
@@ -446,6 +480,78 @@ class _CartonInfoState extends State<CartonInfo> {
|
||||
}
|
||||
}
|
||||
|
||||
_ship() {
|
||||
showConfirmDialog(context, "box.ship.confirm", () {
|
||||
_shipCarton();
|
||||
});
|
||||
}
|
||||
|
||||
_shipCarton() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
// CartonModel cartonModel =
|
||||
// Provider.of<CartonModel>(context, listen: false);
|
||||
//await cartonModel.ship(_carton.id!);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_arrive() {
|
||||
showConfirmDialog(context, "box.arrive.confirm", () {
|
||||
_arriveCarton();
|
||||
});
|
||||
}
|
||||
|
||||
_arriveCarton() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
// CartonModel cartonModel =
|
||||
// Provider.of<CartonModel>(context, listen: false);
|
||||
//await cartonModel.ship(_carton.id!);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_invoice() {
|
||||
showConfirmDialog(context, "box.invoice.confirm", () {
|
||||
_invoiceCarton();
|
||||
});
|
||||
}
|
||||
|
||||
_invoiceCarton() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
try {
|
||||
// CartonModel cartonModel =
|
||||
// Provider.of<CartonModel>(context, listen: false);
|
||||
//await cartonModel.ship(_carton.id!);
|
||||
Navigator.pop(context, true);
|
||||
} catch (e) {
|
||||
showMsgDialog(context, "Error", e.toString());
|
||||
} finally {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
_delete() {
|
||||
showConfirmDialog(context, "box.delete.confirm", () {
|
||||
_deleteCarton();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -44,10 +44,11 @@ class _PinLoginPageState extends State<PinLoginPage> {
|
||||
cursorColor: primaryColor,
|
||||
keyboardType: TextInputType.text,
|
||||
decoration: new InputDecoration(
|
||||
prefix: Text(
|
||||
prefixIcon: Text(
|
||||
prefixText,
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
prefixIconConstraints: BoxConstraints(minWidth: 0, minHeight: 0),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
labelStyle: newLabelStyle(color: Colors.black54, fontSize: 17),
|
||||
enabledBorder: UnderlineInputBorder(
|
||||
|
||||
Reference in New Issue
Block a user