2025-02-19 18:52:05 +08:00
|
|
|
|
|
|
|
|
|
|
import 'package:bruno/bruno.dart';
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
import 'package:wms_app/model/bo/stock_in_data_xugong.dart';
|
|
|
|
|
|
import 'package:wms_app/utils/dialogUtils.dart';
|
|
|
|
|
|
import 'package:wms_app/utils/stringUtils.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class StockInCardXuGong extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
|
|
final List<StockInDataXuGong> stockInDataXuGong;
|
|
|
|
|
|
|
|
|
|
|
|
const StockInCardXuGong({super.key,required this.stockInDataXuGong });
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
State<StockInCardXuGong> createState() => _StockInCardXuGongState();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _StockInCardXuGongState extends State<StockInCardXuGong> {
|
|
|
|
|
|
@override
|
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
if(widget.stockInDataXuGong.isEmpty) {
|
|
|
|
|
|
return const Column();
|
|
|
|
|
|
}
|
|
|
|
|
|
return createListView();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// 创建列表
|
|
|
|
|
|
Column createListView() {
|
|
|
|
|
|
List<Widget> children = [];
|
|
|
|
|
|
for (var item in widget.stockInDataXuGong) {
|
|
|
|
|
|
children.add(BrnRichInfoGrid(
|
|
|
|
|
|
themeData: BrnPairRichInfoGridConfig(
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
pairInfoList: [
|
|
|
|
|
|
BrnRichGridInfo('物料号:', item.goodsId),
|
|
|
|
|
|
BrnRichGridInfo.valueLastClickInfo(context, '物料数量', item.goodsNum.toString(),
|
|
|
|
|
|
clickTitle: "修改", clickCallback: (clickValue) {
|
|
|
|
|
|
DialogUtils.showInputMessage(context, "请输入要修改的数量", message: "仅支持数字", confirm: (value) {
|
|
|
|
|
|
if(!StringUtils.isNumber(value)) {
|
|
|
|
|
|
DialogUtils.showWarningMessage(context, "警告", "该文本框仅支持数字");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
setState((){
|
2025-02-23 16:19:27 +08:00
|
|
|
|
item.goodsNum = int.parse(value);
|
2025-02-19 18:52:05 +08:00
|
|
|
|
});
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
),
|
2025-02-24 15:52:03 +08:00
|
|
|
|
BrnRichGridInfo('单据号:', item.listId),
|
2025-02-19 18:52:05 +08:00
|
|
|
|
BrnRichGridInfo('单据类型:', item.orderType),
|
|
|
|
|
|
BrnRichGridInfo('客户名称:', item.customerName),
|
|
|
|
|
|
BrnRichGridInfo('物料描述:', item.goodsDesc),
|
|
|
|
|
|
BrnRichGridInfo('重量:', item.weight.toString()),
|
|
|
|
|
|
BrnRichGridInfo('尺寸:', item.size),
|
|
|
|
|
|
BrnRichGridInfo('备用1:', item.spare1),
|
|
|
|
|
|
BrnRichGridInfo('备用2:', item.spare2),
|
|
|
|
|
|
BrnRichGridInfo.valueLastClickInfo(context, '操作', '',
|
|
|
|
|
|
themeData: BrnPairRichInfoGridConfig(
|
|
|
|
|
|
linkTextStyle: BrnTextStyle(color: Colors.red),
|
|
|
|
|
|
),
|
|
|
|
|
|
clickTitle: "点此删除", clickCallback: (value) {
|
|
|
|
|
|
setState(() {
|
|
|
|
|
|
widget.stockInDataXuGong.remove(item);
|
|
|
|
|
|
BrnToast.show("删除一个数据", context);
|
|
|
|
|
|
});
|
|
|
|
|
|
}),
|
|
|
|
|
|
],
|
|
|
|
|
|
));
|
|
|
|
|
|
children.add(const Divider());
|
|
|
|
|
|
}
|
|
|
|
|
|
return Column(children: children);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|