|
@@ -11,18 +11,16 @@ import 'package:plugin_basic/utils/ext_get_nav.dart';
|
|
|
import 'package:router/path/router_path.dart';
|
|
|
import 'package:shared/utils/date_time_utils.dart';
|
|
|
import 'package:shared/utils/screen_util.dart';
|
|
|
+import 'package:shared/utils/util.dart';
|
|
|
import 'package:widgets/ext/ex_widget.dart';
|
|
|
import 'package:widgets/my_appbar.dart';
|
|
|
import 'package:widgets/my_button.dart';
|
|
|
import 'package:widgets/my_load_image.dart';
|
|
|
import 'package:widgets/my_text_view.dart';
|
|
|
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,8 +28,8 @@ class LabourRequestAddPage extends BaseStatefulPage<LabourRequestAddController>
|
|
|
LabourRequestAddPage({Key? key}) : super(key: key);
|
|
|
|
|
|
//启动当前页面,pageType 0 是新增 1是编辑 2是详情
|
|
|
- static void startInstance(int pageType, String? appliedId) {
|
|
|
- return Get.start(RouterPath.THLabourRequestAddOA, arguments: {'pageType': pageType, 'appliedId': appliedId});
|
|
|
+ static void startInstance(int pageType, String? appliedId, void Function(dynamic value)? cb) {
|
|
|
+ return Get.start(RouterPath.THLabourRequestAddOA, arguments: {'pageType': pageType, 'appliedId': appliedId, 'cb': cb});
|
|
|
}
|
|
|
|
|
|
@override
|
|
@@ -52,6 +50,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
state = controller.state;
|
|
|
state.pageType = Get.arguments['pageType'];
|
|
|
state.requestId = Get.arguments['appliedId'];
|
|
|
+ state.cb = Get.arguments['cb'] as void Function(dynamic)?;
|
|
|
}
|
|
|
|
|
|
@override
|
|
@@ -59,7 +58,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
return autoCtlGetBuilder(builder: (controller) {
|
|
|
return Scaffold(
|
|
|
extendBodyBehindAppBar: true,
|
|
|
- appBar: MyAppBar.appBar(context, state.pageType == 1 || state.pageType == 3 ? "Edit Labour Requisition".tr : "Labour Requisition".tr),
|
|
|
+ appBar: MyAppBar.appBar(context, state.pageType == 1 ? "Edit Labour Requisition".tr : "Labour Requisition".tr),
|
|
|
body: SafeArea(
|
|
|
bottom: MediaQuery.of(context).padding.bottom > 38,
|
|
|
top: false,
|
|
@@ -87,7 +86,6 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
child: Column(
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
children: [
|
|
|
-
|
|
|
//工作标题,选择模板
|
|
|
FormRequireText(
|
|
|
text: "Job Title".tr,
|
|
@@ -99,7 +97,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
margin: const EdgeInsets.only(top: 10),
|
|
|
height: 45,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(0.5),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -108,15 +106,25 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- state.editDetailEntity?.labReq?.jobTitle ?? "",
|
|
|
+ state.selectedJobTitleName ?? "",
|
|
|
fontSize: 14,
|
|
|
+ hint: "Choose Job Title".tr,
|
|
|
textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
isFontMedium: true,
|
|
|
textColor: ColorConstants.white,
|
|
|
).expanded(),
|
|
|
+
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
- ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickJobTitle();
|
|
|
+ }),
|
|
|
|
|
|
//选择工作时间
|
|
|
FormRequireText(
|
|
@@ -134,7 +142,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
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),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -152,14 +160,14 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
).expanded(),
|
|
|
//下拉选图标
|
|
|
Visibility(
|
|
|
- visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ visible: state.pageType != 2,
|
|
|
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();
|
|
|
+ if (state.pageType != 2) controller.pickStartTime();
|
|
|
}),
|
|
|
),
|
|
|
|
|
@@ -170,7 +178,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
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),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -188,19 +196,108 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
).expanded(),
|
|
|
//下拉选图标
|
|
|
Visibility(
|
|
|
- visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ visible: state.pageType != 2,
|
|
|
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();
|
|
|
+ if (state.pageType != 2) controller.pickEndTime();
|
|
|
}),
|
|
|
),
|
|
|
],
|
|
|
).marginOnly(top: 10),
|
|
|
|
|
|
+ //选择重复时间
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 0,
|
|
|
+ child: MyTextView("Repeat".tr, fontSize: 15, textColor: Colors.white, isFontRegular: true, marginTop: 15),
|
|
|
+ ),
|
|
|
+
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 0,
|
|
|
+ child: 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 ? 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.selectedRepeatStartTime == null
|
|
|
+ ? ""
|
|
|
+ : DateTimeUtils.formatDate(state.selectedRepeatStartTime, format: "yyyy-MM-dd"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Repeat Start Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickRepeatStartTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //结束时间
|
|
|
+ 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 ? 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.selectedRepeatEndTime == null ? "" : DateTimeUtils.formatDate(state.selectedRepeatEndTime, format: "yyyy-MM-dd"),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Repeat End Time".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickRepeatEndTime();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 10),
|
|
|
+ ),
|
|
|
+
|
|
|
//工作选择部门
|
|
|
FormRequireText(
|
|
|
text: "Outlet".tr,
|
|
@@ -212,7 +309,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
margin: const EdgeInsets.only(top: 10),
|
|
|
height: 45,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || state.pageType == 4 ? 0.5 : 0.2),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -229,20 +326,20 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
textColor: ColorConstants.white,
|
|
|
).expanded(),
|
|
|
Visibility(
|
|
|
- visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ visible: state.pageType != 2,
|
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
),
|
|
|
],
|
|
|
),
|
|
|
).onTap(() {
|
|
|
FocusScope.of(context).unfocus();
|
|
|
- if (state.pageType == 1 || state.pageType == 3) controller.pickOutlet();
|
|
|
+ if (state.pageType != 2) controller.pickOutlet();
|
|
|
}),
|
|
|
|
|
|
-
|
|
|
+ //需求人数
|
|
|
FormRequireText(
|
|
|
text: "No. of Staff".tr,
|
|
|
- ).marginOnly(top: 15,bottom: 10),
|
|
|
+ ).marginOnly(top: 15, bottom: 10),
|
|
|
|
|
|
Row(
|
|
|
children: [
|
|
@@ -251,7 +348,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
margin: const EdgeInsets.only(right: 12),
|
|
|
height: 45,
|
|
|
decoration: BoxDecoration(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
),
|
|
|
child: Row(
|
|
@@ -267,12 +364,15 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
textColor: ColorConstants.white,
|
|
|
).expanded(),
|
|
|
//下拉选图标
|
|
|
- const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
).onTap(() {
|
|
|
FocusScope.of(context).unfocus();
|
|
|
- controller.pickLimitType();
|
|
|
+ if (state.pageType != 2) controller.pickLimitType();
|
|
|
}).expanded(flex: 55),
|
|
|
|
|
|
//输入框-不限制性别
|
|
@@ -285,7 +385,8 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
paddingTop: 0,
|
|
|
paddingBottom: 0,
|
|
|
height: 45,
|
|
|
- fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
|
textInputType: TextInputType.number,
|
|
|
formData: state.formData,
|
|
@@ -319,6 +420,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
paddingLeft: 10,
|
|
|
paddingRight: 10,
|
|
|
height: 45,
|
|
|
+ enabled: state.pageType != 2,
|
|
|
cornerRadius: 0,
|
|
|
fillBackgroundColor: Colors.transparent,
|
|
|
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
@@ -332,9 +434,9 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
],
|
|
|
)
|
|
|
.decorated(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
- borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
- )
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ )
|
|
|
.expanded(),
|
|
|
const SizedBox(width: 12),
|
|
|
Row(
|
|
@@ -355,6 +457,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
paddingLeft: 10,
|
|
|
paddingRight: 10,
|
|
|
height: 45,
|
|
|
+ enabled: state.pageType != 2,
|
|
|
cornerRadius: 0,
|
|
|
fillBackgroundColor: Colors.transparent,
|
|
|
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
@@ -368,9 +471,9 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
],
|
|
|
)
|
|
|
.decorated(
|
|
|
- color: const Color(0xFF4DCFF6).withOpacity(0.2),
|
|
|
- borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
- )
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
|
+ )
|
|
|
.expanded(),
|
|
|
],
|
|
|
).expanded(flex: 55),
|
|
@@ -378,102 +481,6 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
],
|
|
|
),
|
|
|
|
|
|
- //需要的人数
|
|
|
- // 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,
|
|
@@ -489,14 +496,14 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
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),
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 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,
|
|
|
+ enabled: state.pageType == 0 || state.pageType == 1,
|
|
|
focusNode: state.formData["remark"]!['focusNode'],
|
|
|
controller: state.formData["remark"]!['controller'],
|
|
|
// 装饰
|
|
@@ -523,11 +530,280 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
},
|
|
|
),
|
|
|
),
|
|
|
- ).marginOnly(bottom: 30),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //OA的其他显示
|
|
|
+
|
|
|
+ //Type
|
|
|
+ MyTextView(
|
|
|
+ "Type".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //选择类型
|
|
|
+ Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const 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.selectedType ?? "",
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Choose Type".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ if (state.pageType != 2) controller.pickType();
|
|
|
+ }),
|
|
|
+
|
|
|
+ //Event
|
|
|
+ MyTextView(
|
|
|
+ "I.Event".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "event",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ marginTop: 10,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ textInputType: TextInputType.text,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.next,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ state.formData[key]!['focusNode'].unfocus();
|
|
|
+ FocusScope.of(context).requestFocus(state.formData['event_type']!['focusNode']);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+
|
|
|
+ //Event Type
|
|
|
+ MyTextView(
|
|
|
+ "II.Event Type".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "event_type",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ marginTop: 10,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ textInputType: TextInputType.text,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.next,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ state.formData[key]!['focusNode'].unfocus();
|
|
|
+ FocusScope.of(context).requestFocus(state.formData['event_pax']!['focusNode']);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+
|
|
|
+ //Event Pax
|
|
|
+ MyTextView(
|
|
|
+ "III.Event Pax".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "event_pax",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ marginTop: 10,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.next,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ state.formData[key]!['focusNode'].unfocus();
|
|
|
+ FocusScope.of(context).requestFocus(state.formData['revenue']!['focusNode']);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+
|
|
|
+ //Revenue
|
|
|
+ MyTextView(
|
|
|
+ "IV.Estimated Revenue".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "revenue",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ marginTop: 10,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ textInputType: TextInputType.number,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.next,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ state.formData[key]!['focusNode'].unfocus();
|
|
|
+ FocusScope.of(context).requestFocus(state.formData['position']!['focusNode']);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+
|
|
|
+ //Position
|
|
|
+ MyTextView(
|
|
|
+ "V.Position".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "position",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ marginTop: 10,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
+ enabled: state.pageType != 2,
|
|
|
+ textInputType: TextInputType.text,
|
|
|
+ formData: state.formData,
|
|
|
+ textInputAction: TextInputAction.next,
|
|
|
+ onSubmit: (key, value) {
|
|
|
+ state.formData[key]!['focusNode'].unfocus();
|
|
|
+ FocusScope.of(context).requestFocus(state.formData['total_cost']!['focusNode']);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+
|
|
|
+ //total_cost
|
|
|
+ MyTextView(
|
|
|
+ "VI.Estimated Total Cost".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+
|
|
|
+ CustomTextField(
|
|
|
+ formKey: "total_cost",
|
|
|
+ marginLeft: 0,
|
|
|
+ marginRight: 0,
|
|
|
+ paddingTop: 0,
|
|
|
+ paddingBottom: 0,
|
|
|
+ marginTop: 10,
|
|
|
+ height: 45,
|
|
|
+ fillBackgroundColor: const 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();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+
|
|
|
+ //附件文件
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 0,
|
|
|
+ child: MyTextView(
|
|
|
+ "Attachment".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //选择类型
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 0,
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ height: 45,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const 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(
|
|
|
+ Utils.isNotEmpty(state.attFilePath) ? Uri.parse(state.attFilePath!).pathSegments.last : "",
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Choose Attachment".tr,
|
|
|
+ textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
+ isFontMedium: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ ).expanded(),
|
|
|
+
|
|
|
+ //下拉选图标
|
|
|
+ MyTextView(
|
|
|
+ 'Upload'.tr,
|
|
|
+ boxHeight: 45,
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ boxWidth: 90,
|
|
|
+ cornerRadius: 5,
|
|
|
+ onClick: controller.pickAttFile,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 15,
|
|
|
+ fontWeight: FontWeight.w400,
|
|
|
+ backgroundColor: ColorConstants.textGreen0AC074,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ )),
|
|
|
+
|
|
|
+ const SizedBox(height: 30),
|
|
|
|
|
|
//提交按钮
|
|
|
Visibility(
|
|
|
- visible: state.pageType == 1 || state.pageType == 3,
|
|
|
+ visible: state.pageType == 1 || state.pageType == 0,
|
|
|
child: MyButton(
|
|
|
type: ClickType.throttle,
|
|
|
milliseconds: 500,
|
|
@@ -541,6 +817,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
|
|
|
radius: 22.5,
|
|
|
backgroundColor: hexToColor("#FFBB1B"),
|
|
|
fontWeight: FontWeight.w500,
|
|
|
+ minHeight: 45,
|
|
|
).marginOnly(bottom: 30),
|
|
|
),
|
|
|
],
|