瀏覽代碼

fixed: 0018900: 【医生签约】签约的服务时间范围从当天开始往后推整年,应该参照晶奇,当年无论哪天签约,时间范围从当年的01-01往后推整年

loki.wu 10 月之前
父節點
當前提交
5caafb22b6

+ 3 - 2
lib/pages/contract/contract_record_html/view.dart

@@ -31,9 +31,10 @@ class ContractRecordsHtmlPage extends GetView<ContractRecordsHtmlController> {
             right: 0,
             child: Obx(() {
               final dto = controller.state.contractRecordDTO;
+
               return _ServiceTimeEffectRow(
-                startDate: dto.serviceStartDate,
-                endDate: dto.serviceEndDate,
+                startDate: dto.serviceStartDate?.toLocal(),
+                endDate: dto.serviceEndDate?.toLocal(),
               );
             }),
           ),

+ 4 - 3
lib/pages/contract/contract_template/controller.dart

@@ -81,14 +81,15 @@ class ContractTemplateController extends FControllerBase {
   }
 
   Future<void> createContractRecord() async {
+    var year = DateTime.parse(serviceStartDate).year;
+    DateTime startDate = DateTime(year, 1, 1).toUtc();
     final result = await _contractManager.createContractRecordAsync(
       CreateContractRecordRequest(
         contractedPatient: patient.code,
         contractedDoctor: Store.user.userCode,
         contractedTime: DateTime.now(),
-        serviceStartDate: DateTime.parse(serviceStartDate),
-        serviceEndDate: DateTime.parse(serviceStartDate)
-            .add(Duration(days: 365 * int.parse(serviceTime))),
+        serviceStartDate: startDate,
+        serviceEndDate: DateTime(year, 12, 31).toUtc(),
         contractedFileUrl: state.templateContent,
         servicePacks: servicePackageCodes.split('、'),
         photos: ["data:image/png;base64,$base64Image"],