This commit is contained in:
2025-10-28 23:56:47 +07:00
parent f32e1c16fb
commit 2905668358
5 changed files with 51 additions and 51 deletions

View File

@@ -80,10 +80,10 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
}
Future<void> _onRefresh() async {
await ref.read(productDetailProvider(_providerKey).notifier).refreshProductDetail(
widget.warehouseId,
widget.productId,
);
// await ref.read(productDetailProvider(_providerKey).notifier).refreshProductDetail(
// widget.warehouseId,
// widget.productId,
// );
}
void _clearControllers() {
@@ -114,7 +114,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
final productName = stages.isNotEmpty ? stages.first.productName : 'Product';
// Capitalize first letter of operation type
final operationTitle = widget.operationType == 'import' ? 'Import' : 'Export';
final operationTitle = widget.operationType == 'import' ? 'Nhập' : 'Xuất';
return Scaffold(
appBar: AppBar(
@@ -137,7 +137,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
IconButton(
icon: const Icon(Icons.refresh),
onPressed: _onRefresh,
tooltip: 'Refresh',
tooltip: 'Làm mới',
),
],
),
@@ -215,7 +215,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
),
const SizedBox(height: 16),
Text(
'No stages found',
'Không tìm thấy công đoạn',
style: theme.textTheme.titleLarge,
),
],
@@ -244,14 +244,14 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
),
const SizedBox(height: 16),
Text(
'Stage Not Found',
'Không tìm thấy công đoạn',
style: theme.textTheme.titleLarge?.copyWith(
color: theme.colorScheme.error,
),
),
const SizedBox(height: 8),
Text(
'Stage with ID ${widget.stageId} was not found in this product.',
'Công đoạn với ID ${widget.stageId} không được tìm thấy trong sản phẩm này.',
textAlign: TextAlign.center,
style: theme.textTheme.bodyMedium,
),
@@ -293,8 +293,8 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
children: [
Text(
widget.stageId != null
? 'Selected Stage'
: 'Production Stages (${displayStages.length})',
? 'Công đoạn'
: 'Công đoạn (${displayStages.length})',
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.bold,
),
@@ -383,32 +383,32 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
_buildSectionCard(
theme: theme,
title: 'Stage Information',
title: 'Thông tin công đoạn',
icon: Icons.info_outlined,
children: [
_buildInfoRow('Product ID', '${stageToShow.productId}'),
_buildInfoRow('Mã sản phẩm', '${stageToShow.productId}'),
if (stageToShow.productStageId != null)
_buildInfoRow('Stage ID', '${stageToShow.productStageId}'),
_buildInfoRow('Mã công đoạn', '${stageToShow.productStageId}'),
if (stageToShow.actionTypeId != null)
_buildInfoRow('Action Type ID', '${stageToShow.actionTypeId}'),
_buildInfoRow('Stage Name', stageToShow.displayName),
_buildInfoRow('Mã loại thao tác', '${stageToShow.actionTypeId}'),
_buildInfoRow('Tên công đoạn', stageToShow.displayName),
],
),
// Current Quantity information
_buildSectionCard(
theme: theme,
title: 'Current Quantities',
title: 'Số lượng hiện tại',
icon: Icons.info_outlined,
children: [
_buildInfoRow('Passed Quantity', '${stageToShow.passedQuantity}'),
_buildInfoRow('Số lượng đạt', '${stageToShow.passedQuantity}'),
_buildInfoRow(
'Passed Weight',
'Khối lượng đạt',
'${stageToShow.passedQuantityWeight.toStringAsFixed(2)} kg',
),
_buildInfoRow('Issued Quantity', '${stageToShow.issuedQuantity}'),
_buildInfoRow('Số lượng lỗi', '${stageToShow.issuedQuantity}'),
_buildInfoRow(
'Issued Weight',
'Khối lượng lỗi',
'${stageToShow.issuedQuantityWeight.toStringAsFixed(2)} kg',
),
],
@@ -417,29 +417,29 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
// Add New Quantities section
_buildSectionCard(
theme: theme,
title: 'Add New Quantities',
title: 'Thêm số lượng mới',
icon: Icons.add_circle_outline,
children: [
_buildTextField(
label: 'Passed Quantity',
label: 'Số lượng đạt',
controller: _passedQuantityController,
keyboardType: TextInputType.number,
theme: theme,
),
_buildTextField(
label: 'Passed Weight (kg)',
label: 'Khối lượng đạt (kg)',
controller: _passedWeightController,
keyboardType: const TextInputType.numberWithOptions(decimal: true),
theme: theme,
),
_buildTextField(
label: 'Issued Quantity',
label: 'Số lượng lỗi',
controller: _issuedQuantityController,
keyboardType: TextInputType.number,
theme: theme,
),
_buildTextField(
label: 'Issued Weight (kg)',
label: 'Khối lượng lỗi (kg)',
controller: _issuedWeightController,
keyboardType: const TextInputType.numberWithOptions(decimal: true),
theme: theme,
@@ -450,7 +450,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
_buildSectionCard(theme: theme, title: "Nhân viên", icon: Icons.people, children: [
// Warehouse User Dropdown
_buildUserDropdown(
label: 'Warehouse User',
label: 'Người dùng kho',
value: _selectedWarehouseUser,
users: ref.watch(usersListProvider)
.where((user) => user.isWareHouseUser)
@@ -464,7 +464,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
),
// All Employees Dropdown
_buildUserDropdown(
label: 'Employee',
label: 'Nhân viên',
value: _selectedEmployee,
users: ref.watch(usersListProvider),
onChanged: (user) {
@@ -686,7 +686,7 @@ class _ProductDetailPageState extends ConsumerState<ProductDetailPage> {
),
const SizedBox(height: 4),
Text(
'Product ID: ${stage.productId}',
'Sản phẩm ID: ${stage.productId}',
style: theme.textTheme.bodyMedium?.copyWith(
color: theme.colorScheme.onSurfaceVariant,
),