Apply clinic lab workflow feedback
This commit is contained in:
@@ -39,6 +39,7 @@ class ClinicJobsRepository {
|
||||
perPage: limit,
|
||||
filter: filterParts.join(' && '),
|
||||
expand: _listExpand,
|
||||
sort: '-created',
|
||||
);
|
||||
return (result.items.map((r) => Job.fromJson(r.toJson())).toList()
|
||||
..sort((a, b) => b.dateCreated.compareTo(a.dateCreated)));
|
||||
@@ -136,14 +137,14 @@ class ClinicJobsRepository {
|
||||
'location': 'at_lab',
|
||||
});
|
||||
final updated = Job.fromJson(record.toJson());
|
||||
unawaited(JobHistoryService.instance.append(
|
||||
await JobHistoryService.instance.append(
|
||||
jobId: jobId,
|
||||
clinicTenantId: job.clinicTenantId,
|
||||
labTenantId: job.labTenantId,
|
||||
action: JobHistoryAction.revisionRequested,
|
||||
step: job.currentStep,
|
||||
note: note,
|
||||
));
|
||||
);
|
||||
return updated;
|
||||
}
|
||||
|
||||
@@ -195,6 +196,7 @@ class ClinicJobsRepository {
|
||||
filter: 'patient_id = "$patientId"',
|
||||
perPage: limit,
|
||||
expand: _listExpand,
|
||||
sort: '-created',
|
||||
);
|
||||
return (result.items.map((r) => Job.fromJson(r.toJson())).toList()
|
||||
..sort((a, b) => b.dateCreated.compareTo(a.dateCreated)));
|
||||
|
||||
@@ -149,8 +149,14 @@ class _NewJobScreenState extends ConsumerState<NewJobScreen> {
|
||||
labId,
|
||||
isActive: true,
|
||||
);
|
||||
final matchingProducts =
|
||||
products.where((p) => p.prostheticType == ptValue).toList();
|
||||
final matchingProducts = products
|
||||
.where(
|
||||
(p) =>
|
||||
p.prostheticType == ptValue ||
|
||||
parseProstheticTypeValue(p.prostheticType) ==
|
||||
_selectedProstheticType,
|
||||
)
|
||||
.toList();
|
||||
|
||||
ProstheticProduct? product;
|
||||
if (_selectedProduct != null) {
|
||||
@@ -198,6 +204,7 @@ class _NewJobScreenState extends ConsumerState<NewJobScreen> {
|
||||
memberCount: _selectedTeeth.length,
|
||||
clinicTenantId: clinicTenantId,
|
||||
discounts: discounts,
|
||||
teeth: _selectedTeeth,
|
||||
);
|
||||
setState(() {
|
||||
_availableProducts = matchingProducts;
|
||||
@@ -688,7 +695,7 @@ class _NewJobScreenState extends ConsumerState<NewJobScreen> {
|
||||
decoration: const InputDecoration(
|
||||
hintText: 'Protez türü seçin',
|
||||
),
|
||||
items: ProstheticType.values
|
||||
items: visibleProstheticTypes
|
||||
.map(
|
||||
(pt) => DropdownMenuItem(
|
||||
value: pt,
|
||||
@@ -753,6 +760,10 @@ class _NewJobScreenState extends ConsumerState<NewJobScreen> {
|
||||
: _InfoBannerTone.info,
|
||||
),
|
||||
],
|
||||
if (_selectedProduct?.description?.trim().isNotEmpty == true) ...[
|
||||
const SizedBox(height: 8),
|
||||
_ProductDescriptionCard(product: _selectedProduct!),
|
||||
],
|
||||
const SizedBox(height: 16),
|
||||
|
||||
const _SectionLabel(label: 'İş Tipi'),
|
||||
@@ -1404,6 +1415,56 @@ class _PricePreviewChip extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _ProductDescriptionCard extends StatelessWidget {
|
||||
const _ProductDescriptionCard({required this.product});
|
||||
|
||||
final ProstheticProduct product;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.surfaceVariant,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border.all(color: AppColors.border),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(Icons.notes_rounded, size: 16, color: AppColors.textMuted),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Ürün açıklaması',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
product.description!.trim(),
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
height: 1.35,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _SectionLabel extends StatelessWidget {
|
||||
const _SectionLabel({required this.label});
|
||||
final String label;
|
||||
|
||||
Reference in New Issue
Block a user