|
@@ -257,7 +257,9 @@ class _PatientCard extends StatelessWidget {
|
|
|
Positioned(
|
|
|
top: 0,
|
|
|
right: 0,
|
|
|
- child: _PatientSignStatusTag(),
|
|
|
+ child: _PatientSignStatusTag(
|
|
|
+ dto: dto,
|
|
|
+ ),
|
|
|
),
|
|
|
],
|
|
|
);
|
|
@@ -346,16 +348,32 @@ class _PatientCard extends StatelessWidget {
|
|
|
}
|
|
|
|
|
|
class _PatientSignStatusTag extends StatelessWidget {
|
|
|
+ final PatientDTO dto;
|
|
|
+ const _PatientSignStatusTag({required this.dto});
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- const radius = Radius.circular(8);
|
|
|
return Container(
|
|
|
alignment: Alignment.centerRight,
|
|
|
width: 120,
|
|
|
child: StatusLabel(
|
|
|
- title: '已签约',
|
|
|
+ title: contractStateTransition(dto.contractState),
|
|
|
color: Theme.of(context).primaryColor,
|
|
|
),
|
|
|
);
|
|
|
}
|
|
|
+
|
|
|
+ String contractStateTransition(ContractStateEnum state) {
|
|
|
+ switch (state) {
|
|
|
+ case ContractStateEnum.Unsigned:
|
|
|
+ return "待签约";
|
|
|
+ case ContractStateEnum.Cancelled:
|
|
|
+ return "已解约";
|
|
|
+ case ContractStateEnum.Expired:
|
|
|
+ return "已过期";
|
|
|
+ case ContractStateEnum.Signed:
|
|
|
+ return "已签约";
|
|
|
+ default:
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|