97 lines
3.0 KiB
Dart
97 lines
3.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '/common/colorCom.dart';
|
|
import 'package:wms_app/utils/dialogUtils.dart';
|
|
|
|
class StockOutEmpty extends StatefulWidget {
|
|
const StockOutEmpty({super.key});
|
|
|
|
@override
|
|
State<StockOutEmpty> createState() => _CallEmptyCartPageState();
|
|
}
|
|
|
|
class _CallEmptyCartPageState extends State<StockOutEmpty> {
|
|
String selectedOption = "1";
|
|
String status = "可用";
|
|
bool isLoading = false;
|
|
|
|
void callEmptyCart() {
|
|
if (selectedOption == "2") {
|
|
DialogUtils.showWarningMessage(context, "警告", "选中的空托不可用",
|
|
btnLabel: "我知道了");
|
|
} else {
|
|
DialogUtils.showSuccessMessage(context, "成功", "空托已呼叫", btnLabel: "我知道了");
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
iconTheme: const IconThemeData(color: Colors.white),
|
|
leading: IconButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
icon: const Icon(Icons.arrow_back)),
|
|
centerTitle: true,
|
|
backgroundColor: ColorCommon.colorScheme,
|
|
title: const Text(
|
|
"呼叫空托",
|
|
style: TextStyle(color: Colors.white),
|
|
),
|
|
),
|
|
body: Center(
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(top: 5, left: 10, right: 10),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
Expanded(
|
|
child: DropdownButton<String>(
|
|
value: selectedOption,
|
|
isExpanded: true,
|
|
items: [
|
|
DropdownMenuItem(
|
|
value: "1",
|
|
child: Text("1 - 可用"),
|
|
),
|
|
DropdownMenuItem(
|
|
value: "2",
|
|
child: Text("2 - 不可用"),
|
|
),
|
|
],
|
|
onChanged: (value) {
|
|
setState(() {
|
|
selectedOption = value!;
|
|
});
|
|
},
|
|
),
|
|
),
|
|
Padding(
|
|
padding: const EdgeInsets.only(left: 10),
|
|
child: ElevatedButton(
|
|
onPressed: isLoading ? null : callEmptyCart,
|
|
style: ButtonStyle(
|
|
backgroundColor:
|
|
WidgetStateProperty.all(ColorCommon.colorScheme),
|
|
),
|
|
child: Text("出库", style: TextStyle(color: Colors.white)),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
if (isLoading)
|
|
Padding(
|
|
padding: const EdgeInsets.only(top: 20),
|
|
child: CircularProgressIndicator(),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|