|
@@ -1,6 +1,5 @@
|
|
|
import 'package:cs_resources/constants/color_constants.dart';
|
|
|
import 'package:cs_resources/generated/assets.dart';
|
|
|
-import 'package:domain/entity/response/labour_request_edit_index_entity.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
import 'package:flutter/material.dart';
|
|
|
import 'package:flutter/services.dart';
|
|
@@ -21,7 +20,9 @@ import 'package:widgets/no_shadow_scroll_behavior.dart';
|
|
|
import 'package:widgets/shatter/custom_radio_check.dart';
|
|
|
import 'package:widgets/shatter/form_require_text.dart';
|
|
|
import 'package:widgets/shatter/round_my_text_field.dart';
|
|
|
+import 'package:widgets/widget_export.dart';
|
|
|
|
|
|
+import 'labour_need_number_widget.dart';
|
|
|
import 'labour_request_add_controller.dart';
|
|
|
import 'labour_request_add_state.dart';
|
|
|
|
|
@@ -30,7 +31,7 @@ class LabourRequestAddPage extends BaseStatefulPage<LabourRequestAddController>
|
|
|
|
|
|
//启动当前页面,pageType 0 是新增 1是编辑 2是详情
|
|
|
static void startInstance(int pageType, String? appliedId) {
|
|
|
- return Get.start(RouterPath.jobLabourRequestAdd, arguments: {'pageType': pageType, 'appliedId': appliedId});
|
|
|
+ return Get.start(RouterPath.THLabourRequestAddOA, arguments: {'pageType': pageType, 'appliedId': appliedId});
|
|
|
}
|
|
|
|
|
|
@override
|
|
@@ -50,7 +51,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
super.initState();
|
|
|
state = controller.state;
|
|
|
state.pageType = Get.arguments['pageType'];
|
|
|
- state.appliedId = Get.arguments['appliedId'];
|
|
|
+ state.requestId = Get.arguments['appliedId'];
|
|
|
}
|
|
|
|
|
|
@override
|
|
@@ -58,15 +59,9 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
return autoCtlGetBuilder(builder: (controller) {
|
|
|
return Scaffold(
|
|
|
extendBodyBehindAppBar: true,
|
|
|
- appBar: MyAppBar.appBar(
|
|
|
- context,
|
|
|
- state.pageType == 0
|
|
|
- ? "Add Labour Requisition".tr
|
|
|
- : state.pageType == 1
|
|
|
- ? "Edit Labour Requisition".tr
|
|
|
- : "Labour Requisition".tr),
|
|
|
+ appBar: MyAppBar.appBar(context, state.pageType == 1 || state.pageType == 3 ? "Edit Labour Requisition".tr : "Labour Requisition".tr),
|
|
|
body: SafeArea(
|
|
|
- bottom: MediaQuery.of(context).padding.bottom > 38,
|
|
|
+ bottom: MediaQuery.of(context).padding.bottom > 38,
|
|
|
top: false,
|
|
|
child: Container(
|
|
|
width: double.infinity,
|
|
@@ -92,6 +87,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
+
|
|
|
//工作标题,选择模板
|
|
|
FormRequireText(
|
|
|
text: "Job Title".tr,
|
|
@@ -99,11 +95,11 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
|
|
|
//工作标题
|
|
|
Container(
|
|
|
- padding: EdgeInsets.only(left: 16, right: 10),
|
|
|
- margin: EdgeInsets.only(top: 10),
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
height: 45,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.5),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -112,109 +108,98 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- state.selectedTemplateId == null || state.selectedTemplateId == "0"
|
|
|
- ? ""
|
|
|
- : state.labReqOption!.templateList
|
|
|
- .firstWhere((element) => element.value.toString() == state.selectedTemplateId,
|
|
|
- orElse: () => LabourRequestEditIndexTemplateList())
|
|
|
- .txt ??
|
|
|
- "",
|
|
|
+ state.editDetailEntity?.labReq?.jobTitle ?? "",
|
|
|
fontSize: 14,
|
|
|
- hint: "Choose Job Title".tr,
|
|
|
textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
isFontMedium: true,
|
|
|
textColor: ColorConstants.white,
|
|
|
).expanded(),
|
|
|
-
|
|
|
- //下拉选图标
|
|
|
- Visibility(
|
|
|
- visible: state.pageType != 2,
|
|
|
- child: MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
- ),
|
|
|
],
|
|
|
),
|
|
|
- ).onTap(() {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.pickJobTitle();
|
|
|
- }),
|
|
|
+ ),
|
|
|
|
|
|
- //开始时间
|
|
|
+ //选择工作时间
|
|
|
FormRequireText(
|
|
|
- text: "Start Time".tr,
|
|
|
+ text: "Job Time".tr,
|
|
|
).marginOnly(top: 15),
|
|
|
|
|
|
- //选择时间
|
|
|
- Container(
|
|
|
- padding: EdgeInsets.only(left: 16, right: 10),
|
|
|
- margin: EdgeInsets.only(top: 10),
|
|
|
- height: 45,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
- borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- state.selectedStartTime == null ? "" : DateTimeUtils.formatDate(state.selectedStartTime),
|
|
|
- fontSize: 14,
|
|
|
- hint: "Job Start Time".tr,
|
|
|
- textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
- isFontMedium: true,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- ).expanded(),
|
|
|
- //下拉选图标
|
|
|
- Visibility(
|
|
|
- visible: state.pageType != 2,
|
|
|
- child: MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ).onTap(() {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.pickStartTime();
|
|
|
- }),
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ //选择工作开始时间
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedStartTime == null ? "" : DateTimeUtils.formatDate(state.selectedStartTime, format: "yyyy-MM-dd HH:mm"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Job Start Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType == 1 || state.pageType == 3) controller.pickStartTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
|
|
|
- //结束时间
|
|
|
- FormRequireText(
|
|
|
- text: "End Time".tr,
|
|
|
- ).marginOnly(top: 15),
|
|
|
-
|
|
|
- //选择时间
|
|
|
- Container(
|
|
|
- padding: EdgeInsets.only(left: 16, right: 10),
|
|
|
- margin: EdgeInsets.only(top: 10),
|
|
|
- height: 45,
|
|
|
- decoration: BoxDecoration(
|
|
|
- color: Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
- borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
- ),
|
|
|
- child: Row(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: [
|
|
|
- MyTextView(
|
|
|
- state.selectedEndTime == null ? "" : DateTimeUtils.formatDate(state.selectedEndTime),
|
|
|
- fontSize: 14,
|
|
|
- hint: "Job End Time".tr,
|
|
|
- textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
- isFontMedium: true,
|
|
|
- textColor: ColorConstants.white,
|
|
|
- ).expanded(),
|
|
|
- //下拉选图标
|
|
|
- Visibility(
|
|
|
- visible: state.pageType != 2,
|
|
|
- child: MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
- ),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ).onTap(() {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.pickEndTime();
|
|
|
- }),
|
|
|
+ //选择工作结束时间
|
|
|
+ Expanded(
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(left: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedEndTime == null ? "" : DateTimeUtils.formatDate(state.selectedEndTime, format: "yyyy-MM-dd HH:mm"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Job End Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType == 1 || state.pageType == 3) controller.pickEndTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 10),
|
|
|
|
|
|
//工作选择部门
|
|
|
FormRequireText(
|
|
@@ -223,11 +208,11 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
|
|
|
//选择部门
|
|
|
Container(
|
|
|
- padding: EdgeInsets.only(left: 16, right: 10),
|
|
|
- margin: EdgeInsets.only(top: 10),
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
height: 45,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -236,110 +221,319 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- state.selectedDepartmentId == null || state.selectedDepartmentId == "0"
|
|
|
- ? ""
|
|
|
- : state.labReqOption!.departmentList
|
|
|
- .firstWhere((element) => element.value.toString() == state.selectedDepartmentId,
|
|
|
- orElse: () => LabourRequestEditIndexDepartmentList())
|
|
|
- .txt ??
|
|
|
- "",
|
|
|
+ state.selectedOutlet ?? "",
|
|
|
fontSize: 14,
|
|
|
hint: "Choose Outlet".tr,
|
|
|
textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
isFontMedium: true,
|
|
|
textColor: ColorConstants.white,
|
|
|
).expanded(),
|
|
|
- //下拉选图标
|
|
|
Visibility(
|
|
|
- visible: state.pageType != 2,
|
|
|
- child: MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
).onTap(() {
|
|
|
FocusScope.of(context).unfocus();
|
|
|
- controller.pickDepartment();
|
|
|
+ if (state.pageType == 1 || state.pageType == 3) controller.pickOutlet();
|
|
|
}),
|
|
|
|
|
|
- //需要的人数
|
|
|
+
|
|
|
FormRequireText(
|
|
|
text: "No. of Staff".tr,
|
|
|
- ).marginOnly(top: 15),
|
|
|
+ ).marginOnly(top: 15,bottom: 10),
|
|
|
|
|
|
- //输入框(只允许输入数字)
|
|
|
- CustomTextField(
|
|
|
- formKey: "no_of_staff",
|
|
|
- marginLeft: 0,
|
|
|
- marginRight: 0,
|
|
|
- paddingTop: 0,
|
|
|
- paddingBottom: 0,
|
|
|
- height: 45,
|
|
|
- fillBackgroundColor: Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
- enabled: state.pageType != 2,
|
|
|
- inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
- textInputType: TextInputType.number,
|
|
|
- formData: state.formData,
|
|
|
- textInputAction: TextInputAction.done,
|
|
|
- onSubmit: (key, value) {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- },
|
|
|
- marginTop: 10,
|
|
|
- ),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(right: 12),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.genderOptions[state.genderOptionType],
|
|
|
+ fontSize: 14,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.pickLimitType();
|
|
|
+ }).expanded(flex: 55),
|
|
|
|
|
|
- FormRequireText(
|
|
|
- text: "Salary By".tr,
|
|
|
- ).marginOnly(top: 15),
|
|
|
+ //输入框-不限制性别
|
|
|
+ Visibility(
|
|
|
+ visible: state.genderOptionType == 0,
|
|
|
+ child: CustomTextField(
|
|
|
+ formKey: "need_no",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(flex: 55),
|
|
|
+ ),
|
|
|
|
|
|
- //选择计费类型
|
|
|
- state.labReqOption != null
|
|
|
- ? CustomRadioCheck(
|
|
|
- options: state.labReqOption!.chargeList.map((e) => e.txt).whereType<String>().toList(), //后台返回的数据展示,并且根据后台的数据匹配索引
|
|
|
- selectedPosition: state.labReqOption!.chargeList.indexWhere((element) => element.checked == "checked"),
|
|
|
- onOptionSelected: (index, text) {
|
|
|
- //修改内存的值
|
|
|
- state.chargeOptionId = state.labReqOption!.chargeList[index].value;
|
|
|
- },
|
|
|
- ).marginOnly(top: 15)
|
|
|
- : CircularProgressIndicator(),
|
|
|
+ //输入框组-限制性别
|
|
|
+ Visibility(
|
|
|
+ visible: state.genderOptionType != 0,
|
|
|
+ child: Row(
|
|
|
+ children: [
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "M",
|
|
|
+ fontSize: 15,
|
|
|
+ paddingLeft: 10,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ),
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "need_male",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ paddingLeft: 10,
|
|
|
+ paddingRight: 10,
|
|
|
+ height: 45,
|
|
|
+ cornerRadius: 0,
|
|
|
+ fillBackgroundColor: Colors.transparent,
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ .decorated(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ )
|
|
|
+ .expanded(),
|
|
|
+ const SizedBox(width: 12),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "F",
|
|
|
+ fontSize: 15,
|
|
|
+ paddingLeft: 10,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ),
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "need_female",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ paddingLeft: 10,
|
|
|
+ paddingRight: 10,
|
|
|
+ height: 45,
|
|
|
+ cornerRadius: 0,
|
|
|
+ fillBackgroundColor: Colors.transparent,
|
|
|
+ inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ .decorated(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ )
|
|
|
+ .expanded(),
|
|
|
+ ],
|
|
|
+ ).expanded(flex: 55),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
|
|
|
- //选择是否需要输入金额
|
|
|
- Visibility(
|
|
|
- visible: state.labReqOption?.serviceType == 1,
|
|
|
- child: FormRequireText(
|
|
|
- text: "Amount".tr,
|
|
|
- ).marginOnly(top: 15),
|
|
|
+ //需要的人数
|
|
|
+ // FormRequireText(
|
|
|
+ // text: "No. of Staff".tr,
|
|
|
+ // ).marginOnly(top: 15),
|
|
|
+ //
|
|
|
+ // //选择人数类型单选
|
|
|
+ // CustomRadioCheck(
|
|
|
+ // options: state.genderOptions,
|
|
|
+ // enable: state.pageType == 1 || state.pageType == 3,
|
|
|
+ // onOptionSelected: (index, text) {
|
|
|
+ // state.genderOptionType = index;
|
|
|
+ // controller.update();
|
|
|
+ // },
|
|
|
+ // selectedPosition: state.genderOptionType,
|
|
|
+ // ).marginOnly(top: 10),
|
|
|
+ //
|
|
|
+ // //输入框(只允许输入数字)
|
|
|
+ // Visibility(
|
|
|
+ // visible: state.genderOptionType == 0,
|
|
|
+ // child: CustomTextField(
|
|
|
+ // formKey: "need_no",
|
|
|
+ // marginLeft: 0,
|
|
|
+ // marginRight: 0,
|
|
|
+ // paddingTop: 0,
|
|
|
+ // paddingBottom: 0,
|
|
|
+ // height: 45,
|
|
|
+ // fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ // enabled: state.pageType == 1 || state.pageType == 3,
|
|
|
+ // inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ // textInputType: TextInputType.number,
|
|
|
+ // formData: state.formData,
|
|
|
+ // textInputAction: TextInputAction.done,
|
|
|
+ // onSubmit: (key, value) {
|
|
|
+ // FocusScope.of(context).unfocus();
|
|
|
+ // },
|
|
|
+ // marginTop: 10,
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ //
|
|
|
+ // Visibility(
|
|
|
+ // visible: state.genderOptionType != 0,
|
|
|
+ // child: Row(
|
|
|
+ // children: [
|
|
|
+ // MyTextView(
|
|
|
+ // "Male".tr,
|
|
|
+ // fontSize: 15,
|
|
|
+ // isFontRegular: true,
|
|
|
+ // marginRight: 10,
|
|
|
+ // textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ // ),
|
|
|
+ // CustomTextField(
|
|
|
+ // formKey: "need_male",
|
|
|
+ // marginLeft: 0,
|
|
|
+ // marginRight: 0,
|
|
|
+ // paddingTop: 0,
|
|
|
+ // paddingBottom: 0,
|
|
|
+ // height: 45,
|
|
|
+ // fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ // enabled: state.pageType == 1 || state.pageType == 3,
|
|
|
+ // inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ // textInputType: TextInputType.number,
|
|
|
+ // formData: state.formData,
|
|
|
+ // textInputAction: TextInputAction.done,
|
|
|
+ // onSubmit: (key, value) {
|
|
|
+ // FocusScope.of(context).unfocus();
|
|
|
+ // },
|
|
|
+ // ).expanded(),
|
|
|
+ // MyTextView(
|
|
|
+ // "Female".tr,
|
|
|
+ // fontSize: 15,
|
|
|
+ // isFontRegular: true,
|
|
|
+ // marginLeft: 12,
|
|
|
+ // marginRight: 10,
|
|
|
+ // textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ // ),
|
|
|
+ // CustomTextField(
|
|
|
+ // formKey: "need_female",
|
|
|
+ // marginLeft: 0,
|
|
|
+ // marginRight: 0,
|
|
|
+ // paddingTop: 0,
|
|
|
+ // paddingBottom: 0,
|
|
|
+ // height: 45,
|
|
|
+ // fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ // enabled: state.pageType == 1 || state.pageType == 3,
|
|
|
+ // inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
+ // textInputType: TextInputType.number,
|
|
|
+ // formData: state.formData,
|
|
|
+ // textInputAction: TextInputAction.done,
|
|
|
+ // onSubmit: (key, value) {
|
|
|
+ // FocusScope.of(context).unfocus();
|
|
|
+ // },
|
|
|
+ // ).expanded(),
|
|
|
+ // ],
|
|
|
+ // ).marginOnly(top: 10),
|
|
|
+ // ),
|
|
|
+
|
|
|
+ //输入Remark
|
|
|
+ MyTextView(
|
|
|
+ "Remark".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
),
|
|
|
|
|
|
- Visibility(
|
|
|
- visible: state.labReqOption?.serviceType == 1,
|
|
|
- child: CustomTextField(
|
|
|
- formKey: "amount",
|
|
|
- marginLeft: 0,
|
|
|
- marginRight: 0,
|
|
|
- paddingTop: 0,
|
|
|
- paddingBottom: 0,
|
|
|
- height: 45,
|
|
|
- fillBackgroundColor: Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
- enabled: state.pageType != 2,
|
|
|
- textInputType: TextInputType.number,
|
|
|
- formData: state.formData,
|
|
|
- textInputAction: TextInputAction.done,
|
|
|
- onSubmit: (key, value) {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- },
|
|
|
- marginTop: 10,
|
|
|
+ IgnoreKeyboardDismiss(
|
|
|
+ child: Container(
|
|
|
+ height: 160,
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ ),
|
|
|
+ child: TextField(
|
|
|
+ cursorColor: ColorConstants.white,
|
|
|
+ cursorWidth: 1.5,
|
|
|
+ autofocus: false,
|
|
|
+ enabled: state.pageType == 1 || state.pageType == 3,
|
|
|
+ focusNode: state.formData["remark"]!['focusNode'],
|
|
|
+ controller: state.formData["remark"]!['controller'],
|
|
|
+ // 装饰
|
|
|
+ decoration: InputDecoration(
|
|
|
+ isDense: true,
|
|
|
+ isCollapsed: true,
|
|
|
+ border: InputBorder.none,
|
|
|
+ hintText: state.formData["remark"]!['hintText'],
|
|
|
+ hintStyle: const TextStyle(
|
|
|
+ color: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 15.0,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ style: const TextStyle(
|
|
|
+ color: ColorConstants.white,
|
|
|
+ fontSize: 15.0,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ ),
|
|
|
+ // 键盘动作右下角图标
|
|
|
+ textInputAction: TextInputAction.done,
|
|
|
+ onSubmitted: (value) {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ },
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
+ ).marginOnly(bottom: 30),
|
|
|
|
|
|
//提交按钮
|
|
|
Visibility(
|
|
|
- visible: state.pageType != 2,
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
|
child: MyButton(
|
|
|
type: ClickType.throttle,
|
|
|
milliseconds: 500,
|
|
|
onPressed: () {
|
|
|
FocusScope.of(context).unfocus();
|
|
|
- controller.doSubmit();
|
|
|
+ controller.doEditSubmit();
|
|
|
},
|
|
|
text: "Submit".tr,
|
|
|
textColor: ColorConstants.white,
|
|
@@ -347,7 +541,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
radius: 22.5,
|
|
|
backgroundColor: hexToColor("#FFBB1B"),
|
|
|
fontWeight: FontWeight.w500,
|
|
|
- ).marginSymmetric(horizontal: 0, vertical: 30),
|
|
|
+ ).marginOnly(bottom: 30),
|
|
|
),
|
|
|
],
|
|
|
).paddingOnly(left: 15, right: 15),
|