|
@@ -66,7 +66,7 @@ class _LabourRequestAddState extends BaseState<UKLabourRequestAddPage, LabourReq
|
|
|
? "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,
|
|
@@ -140,7 +140,7 @@ class _LabourRequestAddState extends BaseState<UKLabourRequestAddPage, LabourReq
|
|
|
|
|
|
//开始时间
|
|
|
FormRequireText(
|
|
|
- text: "Start Time".tr,
|
|
|
+ text: "Job Date".tr,
|
|
|
).marginOnly(top: 15),
|
|
|
|
|
|
//选择时间
|
|
@@ -158,9 +158,9 @@ class _LabourRequestAddState extends BaseState<UKLabourRequestAddPage, LabourReq
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
children: [
|
|
|
MyTextView(
|
|
|
- state.selectedStartTime == null ? "" : DateTimeUtils.formatDate(state.selectedStartTime),
|
|
|
+ state.selectedDate == null ? "" : DateTimeUtils.formatDate(state.selectedDate, format: 'yyyy-MM-dd'),
|
|
|
fontSize: 14,
|
|
|
- hint: "Job Start Time".tr,
|
|
|
+ hint: "Job Date".tr,
|
|
|
textHintColor: ColorConstants.textGrayAECAE5,
|
|
|
isFontMedium: true,
|
|
|
textColor: ColorConstants.white,
|
|
@@ -174,47 +174,90 @@ class _LabourRequestAddState extends BaseState<UKLabourRequestAddPage, LabourReq
|
|
|
),
|
|
|
).onTap(() {
|
|
|
FocusScope.of(context).unfocus();
|
|
|
- controller.pickStartTime();
|
|
|
+ controller.pickJobDate();
|
|
|
}),
|
|
|
|
|
|
- //结束时间
|
|
|
- FormRequireText(
|
|
|
- text: "End Time".tr,
|
|
|
- ).marginOnly(top: 15),
|
|
|
+ Row(
|
|
|
+ children: [
|
|
|
+ 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.selectedStartTime == null ? "" : DateTimeUtils.formatDate(state.selectedStartTime, format: 'HH:mm'),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Job 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();
|
|
|
+ controller.pickStartTime();
|
|
|
+ }).expanded(),
|
|
|
|
|
|
- //选择时间
|
|
|
- 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.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: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ //分割线
|
|
|
+ MyTextView(
|
|
|
+ "-",
|
|
|
+ textColor: Colors.white,
|
|
|
+ marginLeft: 10,
|
|
|
+ marginRight: 10,
|
|
|
+ fontSize: 14,
|
|
|
+ isFontRegular: true,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //结束时间
|
|
|
+ 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)),
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
- ).onTap(() {
|
|
|
- FocusScope.of(context).unfocus();
|
|
|
- controller.pickEndTime();
|
|
|
- }),
|
|
|
+ child: Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ state.selectedEndTime == null ? "" : DateTimeUtils.formatDate(state.selectedEndTime, format: 'HH:mm'),
|
|
|
+ fontSize: 14,
|
|
|
+ hint: "Job 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();
|
|
|
+ controller.pickEndTime();
|
|
|
+ }).expanded(),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ //选择时间
|
|
|
|
|
|
//工作选择部门
|
|
|
FormRequireText(
|
|
@@ -286,21 +329,71 @@ class _LabourRequestAddState extends BaseState<UKLabourRequestAddPage, LabourReq
|
|
|
marginTop: 10,
|
|
|
),
|
|
|
|
|
|
- // FormRequireText(
|
|
|
- // text: "Salary By".tr,
|
|
|
- // ).marginOnly(top: 15),
|
|
|
- //
|
|
|
- // //选择计费类型
|
|
|
- // 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.pageType == 0,
|
|
|
+ child: MyTextView(
|
|
|
+ "Repeat Date".tr,
|
|
|
+ fontSize: 15,
|
|
|
+ textColor: Colors.white,
|
|
|
+ isFontRegular: true,
|
|
|
+ marginTop: 15,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+ //重复的日期区间
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType == 0,
|
|
|
+ child: Container(
|
|
|
+ padding: const EdgeInsets.only(left: 16, right: 10, top: 5, bottom: 5),
|
|
|
+ margin: const EdgeInsets.only(top: 10),
|
|
|
+ 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: [
|
|
|
+ //横向的流式布局
|
|
|
+ Expanded(
|
|
|
+ child: Wrap(
|
|
|
+ spacing: 8.0, // 子组件之间的水平间距
|
|
|
+ runSpacing: 5.0, // 子组件之间的垂直间距
|
|
|
+ children: state.repeatDateStr == null
|
|
|
+ ? []
|
|
|
+ : List.generate(state.repeatDateStr!.split(",").length, (index) {
|
|
|
+ return MyTextView(
|
|
|
+ state.repeatDateStr!.split(",")[index],
|
|
|
+ textColor: Colors.white,
|
|
|
+ isFontRegular: true,
|
|
|
+ fontSize: 14,
|
|
|
+ backgroundColor: ColorConstants.string2Color('#0AC074'),
|
|
|
+ paddingTop: 5,
|
|
|
+ paddingBottom: 5,
|
|
|
+ paddingLeft: 7.5,
|
|
|
+ paddingRight: 7.5,
|
|
|
+ cornerRadius: 5.0,
|
|
|
+ );
|
|
|
+ }),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+
|
|
|
+ const SizedBox(width: 10),
|
|
|
+
|
|
|
+ //下拉选图标
|
|
|
+ Visibility(
|
|
|
+ visible: state.pageType != 2,
|
|
|
+ child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).constrained(minHeight: 60).onTap(() {
|
|
|
+ FocusScope.of(context).unfocus();
|
|
|
+ controller.pickDateRange();
|
|
|
+ }),
|
|
|
+ ),
|
|
|
|
|
|
//选择是否需要输入金额
|
|
|
Visibility(
|