|
@@ -4,6 +4,7 @@ import 'package:fis_jsonrpc/rpc.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:get/get.dart';
|
|
|
import 'package:intl/intl.dart';
|
|
|
+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';
|
|
@@ -31,7 +32,11 @@ class ServicePackageContractPage
|
|
|
"/contract/contract_template",
|
|
|
parameters: {
|
|
|
"templateCode": "53C3323BB6444A109B2369703EFFDFF9",
|
|
|
- "patientInfo": json.encode(controller.patient.toJson())
|
|
|
+ "patientInfo": json.encode(controller.patient.toJson()),
|
|
|
+ "servicePackageCodes":
|
|
|
+ controller.state.selectedServicePackageCode,
|
|
|
+ "servicePackageNames":
|
|
|
+ controller.state.selectedServicePackageName,
|
|
|
},
|
|
|
);
|
|
|
},
|
|
@@ -69,42 +74,118 @@ class ServicePackageContractPage
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- /// TODO baka 需要拆分
|
|
|
Drawer _servicePackageDrawer(BuildContext context) {
|
|
|
const double titleSize = 20;
|
|
|
const double labelSize = 18;
|
|
|
+ Widget buildAlertDialog(ServicePackDTO servicePackDTO) {
|
|
|
+ return VAlertDialog(
|
|
|
+ title: '${servicePackDTO.name}详情',
|
|
|
+ content: Container(
|
|
|
+ height: 200,
|
|
|
+ alignment: Alignment.topLeft,
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 15),
|
|
|
+ child: Column(
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ LayoutBuilder(
|
|
|
+ builder: (BuildContext context, BoxConstraints constraints) {
|
|
|
+ return ConstrainedBox(
|
|
|
+ constraints: const BoxConstraints(
|
|
|
+ maxHeight: 100,
|
|
|
+ ),
|
|
|
+ child: Scrollbar(
|
|
|
+ thumbVisibility: true,
|
|
|
+ child: ListView(
|
|
|
+ shrinkWrap: true,
|
|
|
+ children: [
|
|
|
+ Text(
|
|
|
+ servicePackDTO.content ?? "",
|
|
|
+ style: const TextStyle(fontSize: 16),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ const SizedBox(
|
|
|
+ height: 5,
|
|
|
+ ),
|
|
|
+ const Text(
|
|
|
+ '服务项目',
|
|
|
+ style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
|
|
|
+ ),
|
|
|
+ const SizedBox(
|
|
|
+ height: 5,
|
|
|
+ ),
|
|
|
+ Expanded(
|
|
|
+ child: Text(
|
|
|
+ controller.getServiceItemsName(
|
|
|
+ servicePackDTO.items ?? [],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ )),
|
|
|
+ // actions: <Widget>[
|
|
|
+ // TextButton(
|
|
|
+ // child: const Text('取消'),
|
|
|
+ // onPressed: () {
|
|
|
+ // Navigator.of(context).pop(); // 关闭对话框
|
|
|
+ // },
|
|
|
+ // ),
|
|
|
+ // TextButton(
|
|
|
+ // child: const Text('确定'),
|
|
|
+ // onPressed: () {
|
|
|
+ // // 在这里处理确定按钮的逻辑
|
|
|
+ // Navigator.of(context).pop(); // 关闭对话框
|
|
|
+ // },
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
Widget buildItem(ServicePackDTO servicePackDTO) {
|
|
|
return InkWell(
|
|
|
onTap: () {
|
|
|
- List<ServicePackDTO> selectedServicePackage =
|
|
|
- controller.state.selectedServicePackage;
|
|
|
- if (controller.state.selectedServicePackage
|
|
|
- .contains(servicePackDTO)) {
|
|
|
- selectedServicePackage.remove(servicePackDTO);
|
|
|
- } else {
|
|
|
- selectedServicePackage.add(servicePackDTO);
|
|
|
- }
|
|
|
- controller.state.selectedServicePackage = selectedServicePackage;
|
|
|
+ controller.changeServicePackage(servicePackDTO);
|
|
|
},
|
|
|
child: Container(
|
|
|
- margin: const EdgeInsets.all(10),
|
|
|
- padding: const EdgeInsets.all(30),
|
|
|
- color: Colors.white,
|
|
|
+ margin: const EdgeInsets.symmetric(
|
|
|
+ vertical: 10,
|
|
|
+ horizontal: 50,
|
|
|
+ ),
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 15),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ borderRadius: const BorderRadius.all(
|
|
|
+ Radius.circular(
|
|
|
+ 8,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ border: Border.all(
|
|
|
+ color: controller.state.selectedServicePackage
|
|
|
+ .contains(servicePackDTO)
|
|
|
+ ? const Color.fromRGBO(34, 164, 211, 1)
|
|
|
+ : Colors.transparent,
|
|
|
+ width: 2,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
child: Row(
|
|
|
children: [
|
|
|
Container(
|
|
|
- padding: const EdgeInsets.only(right: 20),
|
|
|
- child: Obx(
|
|
|
- () => Icon(
|
|
|
- Icons.check_circle_outline,
|
|
|
- size: 35,
|
|
|
- color: controller.state.selectedServicePackage
|
|
|
- .contains(servicePackDTO)
|
|
|
- ? const Color.fromRGBO(34, 164, 211, 1)
|
|
|
- : Colors.grey.shade500,
|
|
|
- ),
|
|
|
- )),
|
|
|
+ padding: const EdgeInsets.only(right: 20),
|
|
|
+ child: Obx(
|
|
|
+ () => Icon(
|
|
|
+ Icons.check_circle_outline,
|
|
|
+ size: 35,
|
|
|
+ color: controller.state.selectedServicePackage
|
|
|
+ .contains(servicePackDTO)
|
|
|
+ ? const Color.fromRGBO(34, 164, 211, 1)
|
|
|
+ : Colors.grey.shade500,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
Expanded(
|
|
|
child: Column(
|
|
|
children: [
|
|
@@ -152,11 +233,15 @@ class ServicePackageContractPage
|
|
|
style: TextStyle(fontSize: titleSize),
|
|
|
),
|
|
|
Expanded(
|
|
|
- child: Text(
|
|
|
- servicePackDTO.content ?? '',
|
|
|
- overflow: TextOverflow.ellipsis,
|
|
|
- maxLines: 3,
|
|
|
- style: const TextStyle(fontSize: labelSize),
|
|
|
+ child: Container(
|
|
|
+ alignment: Alignment.centerLeft,
|
|
|
+ height: 50,
|
|
|
+ child: Text(
|
|
|
+ servicePackDTO.content ?? '',
|
|
|
+ overflow: TextOverflow.ellipsis,
|
|
|
+ maxLines: 2,
|
|
|
+ style: const TextStyle(fontSize: labelSize),
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
],
|
|
@@ -174,31 +259,19 @@ class ServicePackageContractPage
|
|
|
'查看',
|
|
|
style: TextStyle(fontSize: 18),
|
|
|
),
|
|
|
- onPressed: () {
|
|
|
- showDialog(
|
|
|
- context: context,
|
|
|
- builder: (BuildContext context) {
|
|
|
- return AlertDialog(
|
|
|
- title: const Text('提示'),
|
|
|
- content: const Text('这是一个AlertDialog示例。'),
|
|
|
- actions: <Widget>[
|
|
|
- TextButton(
|
|
|
- child: const Text('取消'),
|
|
|
- onPressed: () {
|
|
|
- Navigator.of(context).pop(); // 关闭对话框
|
|
|
- },
|
|
|
- ),
|
|
|
- TextButton(
|
|
|
- child: const Text('确定'),
|
|
|
- onPressed: () {
|
|
|
- // 在这里处理确定按钮的逻辑
|
|
|
- Navigator.of(context).pop(); // 关闭对话框
|
|
|
- },
|
|
|
- ),
|
|
|
- ],
|
|
|
- );
|
|
|
+ onPressed: () async {
|
|
|
+ await Get.toNamed(
|
|
|
+ '/contract/package_info',
|
|
|
+ parameters: {
|
|
|
+ "servicePack": json.encode(servicePackDTO.toJson()),
|
|
|
},
|
|
|
);
|
|
|
+ // showDialog(
|
|
|
+ // context: context,
|
|
|
+ // builder: (BuildContext context) {
|
|
|
+ // return buildAlertDialog(servicePackDTO);
|
|
|
+ // },
|
|
|
+ // );
|
|
|
},
|
|
|
),
|
|
|
),
|
|
@@ -208,6 +281,61 @@ class ServicePackageContractPage
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ Widget buildCancelButton() {
|
|
|
+ return TextButton(
|
|
|
+ onPressed: () {
|
|
|
+ Get.back();
|
|
|
+ },
|
|
|
+ child: const Text(
|
|
|
+ '取消',
|
|
|
+ style: TextStyle(fontSize: 25),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildConfirmButton() {
|
|
|
+ return TextButton(
|
|
|
+ onPressed: () {},
|
|
|
+ child: const Text(
|
|
|
+ '确定',
|
|
|
+ style: TextStyle(fontSize: 25),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildHeader() {
|
|
|
+ return Container(
|
|
|
+ decoration: const BoxDecoration(
|
|
|
+ color: Colors.white,
|
|
|
+ ),
|
|
|
+ height: 90,
|
|
|
+ padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
|
|
+ child: Row(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
+ children: [
|
|
|
+ buildCancelButton(),
|
|
|
+ buildConfirmButton(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ Widget buildServicePackageList() {
|
|
|
+ return Obx(
|
|
|
+ () => Expanded(
|
|
|
+ child: controller.state.servicePackageItems.isEmpty
|
|
|
+ ? const Center(
|
|
|
+ child: Text('暂无数据'),
|
|
|
+ )
|
|
|
+ : ListView(
|
|
|
+ children: controller.state.servicePackageItems
|
|
|
+ .map((ServicePackDTO e) => buildItem(e))
|
|
|
+ .toList(),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
return Drawer(
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
borderRadius: BorderRadiusDirectional.horizontal(
|
|
@@ -217,13 +345,18 @@ class ServicePackageContractPage
|
|
|
width: MediaQuery.of(context).size.width * 0.7,
|
|
|
child: Container(
|
|
|
color: Colors.grey.shade300,
|
|
|
- padding: const EdgeInsets.all(50),
|
|
|
- child: Obx(
|
|
|
- () => ListView(
|
|
|
- children: controller.state.servicePackageItems
|
|
|
- .map((ServicePackDTO e) => buildItem(e))
|
|
|
- .toList(),
|
|
|
- ),
|
|
|
+ child: Column(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ children: [
|
|
|
+ // buildHeader(),
|
|
|
+ const SizedBox(
|
|
|
+ height: 30,
|
|
|
+ ),
|
|
|
+ buildServicePackageList(),
|
|
|
+ const SizedBox(
|
|
|
+ height: 10,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
);
|
|
@@ -266,7 +399,6 @@ class ServicePackageContractPage
|
|
|
initialValue: controller.state.serviceStartDate,
|
|
|
).show();
|
|
|
controller.state.serviceStartDate = result;
|
|
|
- print(result);
|
|
|
},
|
|
|
),
|
|
|
),
|
|
@@ -327,10 +459,14 @@ class ServicePackageContractPage
|
|
|
controller.state.isExpendPatient =
|
|
|
!controller.state.isExpendPatient;
|
|
|
},
|
|
|
- icon: const Icon(
|
|
|
- Icons.expand_circle_down_outlined,
|
|
|
- color: Color.fromRGBO(34, 164, 211, 1),
|
|
|
- size: 30,
|
|
|
+ icon: Obx(
|
|
|
+ () => Icon(
|
|
|
+ controller.state.isExpendPatient
|
|
|
+ ? Icons.keyboard_arrow_up_rounded
|
|
|
+ : Icons.keyboard_arrow_down_rounded,
|
|
|
+ color: Colors.grey.shade400,
|
|
|
+ size: 30,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
)
|
|
@@ -342,21 +478,15 @@ class ServicePackageContractPage
|
|
|
return VPanel(
|
|
|
child: VListFormCellGroup(
|
|
|
children: [
|
|
|
- VListFormCell(
|
|
|
- label: '家庭医生服务包',
|
|
|
- height: 70,
|
|
|
- contentWidget: const SizedBox(
|
|
|
- child: Row(
|
|
|
- children: [
|
|
|
- SizedBox(
|
|
|
- height: 70,
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
+ Obx(
|
|
|
+ () => VListFormCell(
|
|
|
+ label: '家庭医生服务包',
|
|
|
+ height: 70,
|
|
|
+ content: controller.state.selectedServicePackageName,
|
|
|
+ onTap: () {
|
|
|
+ Scaffold.of(context).openEndDrawer();
|
|
|
+ },
|
|
|
),
|
|
|
- onTap: () {
|
|
|
- Scaffold.of(context).openEndDrawer();
|
|
|
- },
|
|
|
),
|
|
|
const VListFormCell(
|
|
|
label: '备注',
|