|
@@ -179,11 +179,12 @@ class MedicalController extends FControllerBase {
|
|
|
diagnosisTime: DateTime.now().toUtc(),
|
|
|
);
|
|
|
print(submitDiagnosisRequest.toJson());
|
|
|
-
|
|
|
+ busy = true;
|
|
|
final result =
|
|
|
await _diagnosisManager.submitDiagnosisAsync(submitDiagnosisRequest);
|
|
|
if (result) {
|
|
|
await _submitHistory();
|
|
|
+ busy = false;
|
|
|
recordDataCacheManager.recordSyncStateChange(appDataId);
|
|
|
PromptBox.toast('提交成功');
|
|
|
await saveCachedAppDataId();
|
|
@@ -196,6 +197,9 @@ class MedicalController extends FControllerBase {
|
|
|
} else {
|
|
|
PromptBox.toast('提交失败');
|
|
|
}
|
|
|
+ if (busy) {
|
|
|
+ busy = false;
|
|
|
+ }
|
|
|
} else {
|
|
|
PromptBox.toast("已缓存至本地");
|
|
|
Get.back();
|
|
@@ -255,7 +259,7 @@ class MedicalController extends FControllerBase {
|
|
|
if (historyDatas.isEmpty) {
|
|
|
return;
|
|
|
}
|
|
|
- busy = true;
|
|
|
+
|
|
|
for (DiagnosisEntity data in historyDatas) {
|
|
|
try {
|
|
|
Map<String, dynamic> jsonData = jsonDecode(data.dataJson);
|
|
@@ -281,6 +285,5 @@ class MedicalController extends FControllerBase {
|
|
|
logger.e('MedicalController _submitHistory ex:', e);
|
|
|
}
|
|
|
}
|
|
|
- busy = false;
|
|
|
}
|
|
|
}
|