|
@@ -1,4 +1,5 @@
|
|
|
import 'dart:convert';
|
|
|
+import 'dart:io';
|
|
|
|
|
|
import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
@@ -8,8 +9,12 @@ import 'package:vnoteapp/components/alert_dialog.dart';
|
|
|
import 'package:vnoteapp/components/appbar.dart';
|
|
|
import 'package:vnoteapp/components/cell.dart';
|
|
|
import 'package:vnoteapp/components/dialog_date.dart';
|
|
|
+import 'package:vnoteapp/components/dialog_input.dart';
|
|
|
+import 'package:vnoteapp/components/dialog_select.dart';
|
|
|
import 'package:vnoteapp/components/panel.dart';
|
|
|
+import 'package:vnoteapp/store/store.dart';
|
|
|
import 'controller.dart';
|
|
|
+import 'package:image_picker/image_picker.dart';
|
|
|
|
|
|
class ServicePackageContractPage
|
|
|
extends GetView<ServicePackageContractController> {
|
|
@@ -37,6 +42,11 @@ class ServicePackageContractPage
|
|
|
controller.state.selectedServicePackageCode,
|
|
|
"servicePackageNames":
|
|
|
controller.state.selectedServicePackageName,
|
|
|
+ "serviceTime": controller.state.serviceTime.toString(),
|
|
|
+ "serviceStartDate":
|
|
|
+ controller.state.serviceStartDate.toString(),
|
|
|
+ "base64Image": controller.base64Image,
|
|
|
+ "notes": controller.state.notes,
|
|
|
},
|
|
|
);
|
|
|
},
|
|
@@ -260,18 +270,18 @@ class ServicePackageContractPage
|
|
|
style: TextStyle(fontSize: 18),
|
|
|
),
|
|
|
onPressed: () async {
|
|
|
- await Get.toNamed(
|
|
|
- '/contract/package_info',
|
|
|
- parameters: {
|
|
|
- "servicePack": json.encode(servicePackDTO.toJson()),
|
|
|
- },
|
|
|
- );
|
|
|
- // showDialog(
|
|
|
- // context: context,
|
|
|
- // builder: (BuildContext context) {
|
|
|
- // return buildAlertDialog(servicePackDTO);
|
|
|
+ // await Get.toNamed(
|
|
|
+ // '/contract/package_info',
|
|
|
+ // parameters: {
|
|
|
+ // "servicePack": json.encode(servicePackDTO.toJson()),
|
|
|
// },
|
|
|
// );
|
|
|
+ showDialog(
|
|
|
+ context: context,
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ return buildAlertDialog(servicePackDTO);
|
|
|
+ },
|
|
|
+ );
|
|
|
},
|
|
|
),
|
|
|
),
|
|
@@ -362,23 +372,39 @@ class ServicePackageContractPage
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Future<String> convertImageToBase64(XFile image) async {
|
|
|
+ List<int> imageBytes = await image.readAsBytes();
|
|
|
+ String base64Image = base64Encode(imageBytes);
|
|
|
+ return base64Image;
|
|
|
+ }
|
|
|
+
|
|
|
Widget _buildPhotoVPanel() {
|
|
|
return VPanel(
|
|
|
child: VListFormCellGroup(
|
|
|
children: [
|
|
|
- VListFormCell(
|
|
|
- label: '拍照',
|
|
|
- height: 70,
|
|
|
- contentWidget: const Center(
|
|
|
- child: Icon(
|
|
|
- Icons.supervised_user_circle_outlined,
|
|
|
- size: 70,
|
|
|
- ),
|
|
|
+ Obx(
|
|
|
+ () => VListFormCell(
|
|
|
+ label: '拍照',
|
|
|
+ height: 70,
|
|
|
+ contentWidget: controller.state.userImage != null
|
|
|
+ ? Image.file(
|
|
|
+ File(controller.state.userImage!.path),
|
|
|
+ )
|
|
|
+ : const Center(
|
|
|
+ child: Icon(
|
|
|
+ Icons.account_box_rounded,
|
|
|
+ size: 70,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ onTap: () async {
|
|
|
+ XFile? image =
|
|
|
+ await ImagePicker().pickImage(source: ImageSource.camera);
|
|
|
+ controller.state.userImage = image;
|
|
|
+ String base64Image = await convertImageToBase64(image!);
|
|
|
+ controller.base64Image = base64Image;
|
|
|
+ },
|
|
|
),
|
|
|
- onTap: () {
|
|
|
- print('拍照拍照');
|
|
|
- },
|
|
|
- ),
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
);
|
|
@@ -402,13 +428,31 @@ class ServicePackageContractPage
|
|
|
},
|
|
|
),
|
|
|
),
|
|
|
- const VListFormCell(
|
|
|
+ Obx(
|
|
|
+ () => VListFormCell(
|
|
|
+ label: '服务年限',
|
|
|
+ content: '${controller.state.serviceTime}年',
|
|
|
+ onTap: () async {
|
|
|
+ String? result = await VDialogSelect<FSelectModel, String>(
|
|
|
+ source: [
|
|
|
+ FSelectModel(code: "1", name: "1年"),
|
|
|
+ FSelectModel(code: "2", name: "2年"),
|
|
|
+ FSelectModel(code: "3", name: "3年"),
|
|
|
+ ],
|
|
|
+ labelGetter: (data) => data.name,
|
|
|
+ valueGetter: (data) => data.code,
|
|
|
+ ).show();
|
|
|
+ controller.state.serviceTime = int.parse(result ?? '1');
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ VListFormCell(
|
|
|
label: '签约医生',
|
|
|
- content: '李四',
|
|
|
+ content: Store.user.principalName,
|
|
|
),
|
|
|
- const VListFormCell(
|
|
|
+ VListFormCell(
|
|
|
label: '医生电话',
|
|
|
- content: '18712341234',
|
|
|
+ content: Store.user.principalPhone,
|
|
|
),
|
|
|
],
|
|
|
),
|
|
@@ -431,9 +475,9 @@ class ServicePackageContractPage
|
|
|
content: controller.state.phone,
|
|
|
),
|
|
|
if (controller.state.isExpendPatient) ...[
|
|
|
- const VListFormCell(
|
|
|
+ VListFormCell(
|
|
|
label: '身份证号码',
|
|
|
- content: '5130221999099987',
|
|
|
+ content: controller.state.cardNo,
|
|
|
),
|
|
|
const VListFormCell(
|
|
|
label: '民族',
|
|
@@ -443,9 +487,11 @@ class ServicePackageContractPage
|
|
|
label: '性别',
|
|
|
content: controller.state.genderDesc,
|
|
|
),
|
|
|
- const VListFormCell(
|
|
|
+ VListFormCell(
|
|
|
label: '出生日期',
|
|
|
- content: '张三',
|
|
|
+ content: DateFormat('yyyy-MM-dd').format(
|
|
|
+ controller.state.birthday,
|
|
|
+ ),
|
|
|
),
|
|
|
]
|
|
|
],
|
|
@@ -488,9 +534,18 @@ class ServicePackageContractPage
|
|
|
},
|
|
|
),
|
|
|
),
|
|
|
- const VListFormCell(
|
|
|
- label: '备注',
|
|
|
- content: '5130221999099987',
|
|
|
+ Obx(
|
|
|
+ () => VListFormCell(
|
|
|
+ label: '备注',
|
|
|
+ content: controller.state.notes,
|
|
|
+ onTap: () async {
|
|
|
+ String? result = await VDialogInput(
|
|
|
+ title: '备注',
|
|
|
+ initialValue: controller.state.notes,
|
|
|
+ ).show();
|
|
|
+ controller.state.notes = result ?? controller.state.notes;
|
|
|
+ },
|
|
|
+ ),
|
|
|
),
|
|
|
],
|
|
|
),
|