|
@@ -29,7 +29,7 @@ import 'labour_request_edit_state.dart';
|
|
class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditController> {
|
|
class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditController> {
|
|
LabourRequestEditPage({Key? key}) : super(key: key);
|
|
LabourRequestEditPage({Key? key}) : super(key: key);
|
|
|
|
|
|
- //启动当前页面,pageType 1是编辑 2是详情
|
|
|
|
|
|
+ //启动当前页面,pageType 1是编辑 2是详情 3是review编辑 4是review详情
|
|
static void startInstance(int pageType, String? requestId, void Function(dynamic value)? cb) {
|
|
static void startInstance(int pageType, String? requestId, void Function(dynamic value)? cb) {
|
|
return Get.start(RouterPath.labourRequestEditSG, arguments: {'pageType': pageType, 'requestId': requestId, 'cb': cb});
|
|
return Get.start(RouterPath.labourRequestEditSG, arguments: {'pageType': pageType, 'requestId': requestId, 'cb': cb});
|
|
}
|
|
}
|
|
@@ -54,7 +54,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
return autoCtlGetBuilder(builder: (controller) {
|
|
return autoCtlGetBuilder(builder: (controller) {
|
|
return Scaffold(
|
|
return Scaffold(
|
|
extendBodyBehindAppBar: true,
|
|
extendBodyBehindAppBar: true,
|
|
- appBar: MyAppBar.appBar(context, 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(
|
|
body: SafeArea(
|
|
bottom: true,
|
|
bottom: true,
|
|
top: false,
|
|
top: false,
|
|
@@ -158,7 +158,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
padding: const EdgeInsets.only(left: 16, right: 10),
|
|
padding: const EdgeInsets.only(left: 16, right: 10),
|
|
height: 45,
|
|
height: 45,
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
- color: const 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)),
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
),
|
|
),
|
|
child: Row(
|
|
child: Row(
|
|
@@ -176,14 +176,14 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
).expanded(),
|
|
).expanded(),
|
|
//下拉选图标
|
|
//下拉选图标
|
|
Visibility(
|
|
Visibility(
|
|
- visible: state.pageType != 2,
|
|
|
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
).onTap(() {
|
|
).onTap(() {
|
|
FocusScope.of(context).unfocus();
|
|
FocusScope.of(context).unfocus();
|
|
- if (state.pageType != 2) controller.pickStartTime();
|
|
|
|
|
|
+ if (state.pageType == 1 || state.pageType == 3) controller.pickStartTime();
|
|
}),
|
|
}),
|
|
),
|
|
),
|
|
|
|
|
|
@@ -194,7 +194,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
margin: const EdgeInsets.only(left: 10),
|
|
margin: const EdgeInsets.only(left: 10),
|
|
height: 45,
|
|
height: 45,
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
- color: const 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)),
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
),
|
|
),
|
|
child: Row(
|
|
child: Row(
|
|
@@ -212,14 +212,14 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
).expanded(),
|
|
).expanded(),
|
|
//下拉选图标
|
|
//下拉选图标
|
|
Visibility(
|
|
Visibility(
|
|
- visible: state.pageType != 2,
|
|
|
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
).onTap(() {
|
|
).onTap(() {
|
|
FocusScope.of(context).unfocus();
|
|
FocusScope.of(context).unfocus();
|
|
- if (state.pageType != 2) controller.pickEndTime();
|
|
|
|
|
|
+ if (state.pageType == 1 || state.pageType == 3) controller.pickEndTime();
|
|
}),
|
|
}),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
@@ -236,7 +236,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
margin: const EdgeInsets.only(top: 10),
|
|
margin: const EdgeInsets.only(top: 10),
|
|
height: 45,
|
|
height: 45,
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
- color: const 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)),
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
),
|
|
),
|
|
child: Row(
|
|
child: Row(
|
|
@@ -253,14 +253,14 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
textColor: ColorConstants.white,
|
|
textColor: ColorConstants.white,
|
|
).expanded(),
|
|
).expanded(),
|
|
Visibility(
|
|
Visibility(
|
|
- visible: state.pageType != 2,
|
|
|
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
|
|
),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
).onTap(() {
|
|
).onTap(() {
|
|
FocusScope.of(context).unfocus();
|
|
FocusScope.of(context).unfocus();
|
|
- if (state.pageType != 2) controller.pickOutlet();
|
|
|
|
|
|
+ if (state.pageType == 1 || state.pageType == 3) controller.pickOutlet();
|
|
}),
|
|
}),
|
|
|
|
|
|
//需要的人数
|
|
//需要的人数
|
|
@@ -271,7 +271,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
//选择人数类型单选
|
|
//选择人数类型单选
|
|
CustomRadioCheck(
|
|
CustomRadioCheck(
|
|
options: state.genderOptions,
|
|
options: state.genderOptions,
|
|
- enable: state.pageType != 2,
|
|
|
|
|
|
+ enable: state.pageType == 1 || state.pageType == 3,
|
|
onOptionSelected: (index, text) {
|
|
onOptionSelected: (index, text) {
|
|
state.genderOptionType = index;
|
|
state.genderOptionType = index;
|
|
controller.update();
|
|
controller.update();
|
|
@@ -289,8 +289,8 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
paddingTop: 0,
|
|
paddingTop: 0,
|
|
paddingBottom: 0,
|
|
paddingBottom: 0,
|
|
height: 45,
|
|
height: 45,
|
|
- fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
|
- enabled: state.pageType != 2,
|
|
|
|
|
|
+ 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],
|
|
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
textInputType: TextInputType.number,
|
|
textInputType: TextInputType.number,
|
|
formData: state.formData,
|
|
formData: state.formData,
|
|
@@ -320,8 +320,8 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
paddingTop: 0,
|
|
paddingTop: 0,
|
|
paddingBottom: 0,
|
|
paddingBottom: 0,
|
|
height: 45,
|
|
height: 45,
|
|
- fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
|
- enabled: state.pageType != 2,
|
|
|
|
|
|
+ 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],
|
|
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
textInputType: TextInputType.number,
|
|
textInputType: TextInputType.number,
|
|
formData: state.formData,
|
|
formData: state.formData,
|
|
@@ -345,8 +345,8 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
paddingTop: 0,
|
|
paddingTop: 0,
|
|
paddingBottom: 0,
|
|
paddingBottom: 0,
|
|
height: 45,
|
|
height: 45,
|
|
- fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
|
|
|
|
- enabled: state.pageType != 2,
|
|
|
|
|
|
+ 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],
|
|
inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
|
|
textInputType: TextInputType.number,
|
|
textInputType: TextInputType.number,
|
|
formData: state.formData,
|
|
formData: state.formData,
|
|
@@ -380,6 +380,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
state.selectRequestTypeId = state.editDetailEntity!.requestType[index].value;
|
|
state.selectRequestTypeId = state.editDetailEntity!.requestType[index].value;
|
|
controller.update(["position"]);
|
|
controller.update(["position"]);
|
|
},
|
|
},
|
|
|
|
+ enable: state.pageType == 1 || state.pageType == 3,
|
|
selectedPosition: state.editDetailEntity == null ? -1 : state.editDetailEntity?.requestType.indexWhere((e) => e.checked == "checked"),
|
|
selectedPosition: state.editDetailEntity == null ? -1 : state.editDetailEntity?.requestType.indexWhere((e) => e.checked == "checked"),
|
|
).marginOnly(top: 10),
|
|
).marginOnly(top: 10),
|
|
),
|
|
),
|
|
@@ -437,14 +438,14 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
margin: const EdgeInsets.only(top: 10),
|
|
margin: const EdgeInsets.only(top: 10),
|
|
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
|
padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
- color: const 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)),
|
|
borderRadius: const BorderRadius.all(Radius.circular(5)),
|
|
),
|
|
),
|
|
child: TextField(
|
|
child: TextField(
|
|
cursorColor: ColorConstants.white,
|
|
cursorColor: ColorConstants.white,
|
|
cursorWidth: 1.5,
|
|
cursorWidth: 1.5,
|
|
autofocus: false,
|
|
autofocus: false,
|
|
- enabled: state.pageType != 2,
|
|
|
|
|
|
+ enabled: state.pageType == 1 || state.pageType == 3,
|
|
focusNode: state.formData["remark"]!['focusNode'],
|
|
focusNode: state.formData["remark"]!['focusNode'],
|
|
controller: state.formData["remark"]!['controller'],
|
|
controller: state.formData["remark"]!['controller'],
|
|
// 装饰
|
|
// 装饰
|
|
@@ -475,7 +476,7 @@ class LabourRequestEditPage extends BaseStatelessPage<LabourRequestEditControlle
|
|
|
|
|
|
//提交按钮
|
|
//提交按钮
|
|
Visibility(
|
|
Visibility(
|
|
- visible: state.pageType != 2,
|
|
|
|
|
|
+ visible: state.pageType == 1 || state.pageType == 3,
|
|
child: MyButton(
|
|
child: MyButton(
|
|
type: ClickType.throttle,
|
|
type: ClickType.throttle,
|
|
milliseconds: 500,
|
|
milliseconds: 500,
|