2 Commits daef7ae23e ... ab9a672a9d

Autor SHA1 Nachricht Datum
  liukai ab9a672a9d 添加OT的逻辑与OA的工作列表只能修改部门的逻辑修复 vor 3 Wochen
  liukai c7f3b55eb3 添加员工筛选的逻辑和时间筛选的默认选择逻辑 vor 3 Wochen

+ 60 - 20
packages/cpt_th/lib/modules/job_er/applied_er/widget/er_applied_add_staff.dart

@@ -32,17 +32,21 @@ class ErAppliedAddStaff extends StatefulWidget {
 }
 
 class _AppliedAddStaffState extends State<ErAppliedAddStaff> {
+  late TextEditingController searchController;
+
   @override
   void initState() {
     super.initState();
-    ErAppliedAddStaffController controller =  Get.put(ErAppliedAddStaffController());
+    ErAppliedAddStaffController controller = Get.put(ErAppliedAddStaffController());
     controller.jobId = widget.jobId;
+    searchController = TextEditingController();
   }
 
   @override
   void dispose() {
     super.dispose();
     Get.delete<ErAppliedAddStaffController>();
+    searchController.dispose();
   }
 
   @override
@@ -67,29 +71,66 @@ class _AppliedAddStaffState extends State<ErAppliedAddStaff> {
                   isFontMedium: true,
                   textColor: ColorConstants.black,
                   marginTop: 22,
-                  marginBottom: 15,
+                  marginBottom: 5,
                   marginLeft: 22,
                   marginRight: 22,
                 ),
               ),
 
-              SearchAppBar(
-                value: controller.keyword,
-                searchBarHeight: 38,
-                searchBarBgColor: Colors.white,
-                searchBarBorderRadius: 15,
-                searchBarBorder: Border.all(
-                  color: const Color(0XFFC3C3C3), // 设置边框颜色为灰色
-                  width: 0.5, // 设置边框宽度
-                ),
-                textHintColor: const Color(0XFFAFB3B7),
-                textColor: ColorConstants.black33,
-                onSearch: (keyword) {
-                  controller.doSearch(keyword);
-                },
-                hintText: "Staff Name/ID/Phone".tr,
-                controller: controller.searchController,
-              ).marginOnly(left: 16.5, right: 1.5, bottom: 15.5),
+              Row(
+                children: [
+                  //选择状态
+                  Container(
+                    padding: const EdgeInsets.only(left: 10, right: 5),
+                    margin: const EdgeInsets.only(left: 15, right: 8),
+                    height: 38,
+                    decoration: BoxDecoration(
+                      color: Colors.white,
+                      borderRadius: const BorderRadius.all(Radius.circular(15)),
+                      border: Border.all(
+                        color: const Color(0XFFC3C3C3), // 添加边框颜色
+                        width: 0.5, // 添加边框宽度
+                      ),
+                    ),
+                    child: Row(
+                      mainAxisSize: MainAxisSize.max,
+                      crossAxisAlignment: CrossAxisAlignment.center,
+                      mainAxisAlignment: MainAxisAlignment.start,
+                      children: [
+                        MyTextView(
+                          controller.selectedType ?? "",
+                          fontSize: 14,
+                          hint: "Choose Type".tr,
+                          textHintColor: ColorConstants.textBlackHint,
+                          isFontMedium: true,
+                          textColor: ColorConstants.black33,
+                        ).expanded(),
+                        const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                      ],
+                    ),
+                  ).onTap(() {
+                    controller.pickerType();
+                  }).expanded(flex: 1),
+
+                  SearchAppBar(
+                    value: controller.keyword,
+                    searchBarHeight: 38,
+                    searchBarBgColor: Colors.white,
+                    searchBarBorderRadius: 15,
+                    searchBarBorder: Border.all(
+                      color: const Color(0XFFC3C3C3), // 设置边框颜色为灰色
+                      width: 0.5, // 设置边框宽度
+                    ),
+                    textHintColor: const Color(0XFFAFB3B7),
+                    textColor: ColorConstants.black33,
+                    onSearch: (keyword) {
+                      controller.doSearch(keyword);
+                    },
+                    hintText: "Staff Name/ID/Phone".tr,
+                    controller: searchController,
+                  ).expanded(flex: 1),
+                ],
+              ).marginOnly(bottom: 10),
 
               Container(
                 color: Colors.white,
@@ -221,7 +262,6 @@ class _AppliedAddStaffState extends State<ErAppliedAddStaff> {
 
       widget.confirmAction?.call(separatedIds);
     }
-
   }
 
   Widget _buildStaffItem(THAppliedEmployeeRows item, VoidCallback callback) {

+ 28 - 2
packages/cpt_th/lib/modules/job_er/applied_er/widget/er_applied_add_staff_controller.dart

@@ -4,13 +4,12 @@ import 'package:flutter/material.dart';
 import 'package:plugin_basic/basic_export.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:widgets/load_state_layout.dart';
+import 'package:widgets/picker/option_pick_util.dart';
 import 'package:widgets/widget_export.dart';
 
 class ErAppliedAddStaffController extends GetxController with DioCancelableMixin {
   final THERRepository _erRepository = Get.find();
 
-  TextEditingController searchController = TextEditingController();
-
   var _curPage = 1;
   var _needShowPlaceholder = true;
 
@@ -22,6 +21,9 @@ class ErAppliedAddStaffController extends GetxController with DioCancelableMixin
   String? jobId;
   List<THAppliedEmployeeRows> datas = [];
 
+  List<String> types = ['regular', 'all'];
+  String? selectedType;
+
   //刷新页面状态
   void changeLoadingState(LoadState state) {
     loadingState = state;
@@ -63,6 +65,7 @@ class ErAppliedAddStaffController extends GetxController with DioCancelableMixin
     var listResult = await _erRepository.searchStaffList(
       jobId,
       keyword,
+      selectedType,
       curPage: _curPage,
       cancelToken: cancelToken,
     );
@@ -127,4 +130,27 @@ class ErAppliedAddStaffController extends GetxController with DioCancelableMixin
     datas.clear();
     super.onClose();
   }
+
+  void pickerType() {
+    int selectedIndex;
+    if (selectedType == null) {
+      selectedIndex = 0;
+    } else {
+      selectedIndex = types.indexWhere((type) => type == selectedType);
+    }
+
+    if (selectedIndex < 0) {
+      selectedIndex = 0;
+    }
+
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: types,
+      initialSelectIndex: selectedIndex,
+      onPickerChanged: (_, index) {
+        selectedType = types[index];
+        refreshController.callRefresh();
+        update();
+      },
+    );
+  }
 }

+ 21 - 4
packages/cpt_th/lib/modules/job_er/applied_er_edit/applied_er_edit_controller.dart

@@ -8,6 +8,7 @@ import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/event_bus.dart';
+import 'package:shared/utils/util.dart';
 import 'package:widgets/picker/date_picker_util.dart';
 
 import 'applied_er_edit_state.dart';
@@ -81,8 +82,12 @@ class AppliedErEditController extends GetxController with DioCancelableMixin {
   void pickSecurityInTime() {
     if (state.appliedEditView == null) return;
 
+   DateTime? selectedDate = Utils.isNotEmpty(state.appliedEditView!.securityIn) && state.appliedEditView!.securityIn != "0" ?
+   DateTimeUtils.getDateTime(state.appliedEditView!.securityIn ?? "") :
+   DateTimeUtils.getDateTimeByMs((state.appliedEditView?.applied?.startTime ?? 0) * 1000);
+
     DatePickerUtil.showCupertinoDatePicker(
-      selectedDateTime: DateTimeUtils.getDateTime(state.appliedEditView!.securityIn ?? ""),
+      selectedDateTime: selectedDate,
       mode: CupertinoDatePickerMode.dateAndTime,
       onDateTimeChanged: (date) {
         state.appliedEditView!.securityIn = DateTimeUtils.formatDate(date);
@@ -96,8 +101,12 @@ class AppliedErEditController extends GetxController with DioCancelableMixin {
   void pickSecurityOutTime() {
     if (state.appliedEditView == null) return;
 
+    DateTime? selectedDate = Utils.isNotEmpty(state.appliedEditView!.securityOut) && state.appliedEditView!.securityOut != "0" ?
+    DateTimeUtils.getDateTime(state.appliedEditView!.securityOut ?? "") :
+    DateTimeUtils.getDateTimeByMs((state.appliedEditView?.applied?.endTime ?? 0) * 1000);
+
     DatePickerUtil.showCupertinoDatePicker(
-      selectedDateTime: DateTimeUtils.getDateTime(state.appliedEditView!.securityOut ?? ""),
+      selectedDateTime: selectedDate,
       mode: CupertinoDatePickerMode.dateAndTime,
       onDateTimeChanged: (date) {
         state.appliedEditView!.securityOut = DateTimeUtils.formatDate(date);
@@ -111,8 +120,12 @@ class AppliedErEditController extends GetxController with DioCancelableMixin {
   void pickWorkInTime() {
     if (state.appliedEditView == null) return;
 
+    DateTime? selectedDate = Utils.isNotEmpty(state.appliedEditView!.workIn) && state.appliedEditView!.workIn != "0" ?
+    DateTimeUtils.getDateTime(state.appliedEditView!.workIn ?? "") :
+    DateTimeUtils.getDateTimeByMs((state.appliedEditView?.applied?.startTime ?? 0) * 1000);
+
     DatePickerUtil.showCupertinoDatePicker(
-      selectedDateTime: DateTimeUtils.getDateTime(state.appliedEditView!.workIn ?? ""),
+      selectedDateTime: selectedDate,
       mode: CupertinoDatePickerMode.dateAndTime,
       onDateTimeChanged: (date) {
         state.appliedEditView!.workIn = DateTimeUtils.formatDate(date);
@@ -126,8 +139,12 @@ class AppliedErEditController extends GetxController with DioCancelableMixin {
   void pickWorkOutTime() {
     if (state.appliedEditView == null) return;
 
+    DateTime? selectedDate = Utils.isNotEmpty(state.appliedEditView!.workOut) && state.appliedEditView!.workOut != "0" ?
+    DateTimeUtils.getDateTime(state.appliedEditView!.workOut ?? "") :
+    DateTimeUtils.getDateTimeByMs((state.appliedEditView?.applied?.endTime ?? 0) * 1000);
+
     DatePickerUtil.showCupertinoDatePicker(
-      selectedDateTime: DateTimeUtils.getDateTime(state.appliedEditView!.workOut ?? ""),
+      selectedDateTime: selectedDate,
       mode: CupertinoDatePickerMode.dateAndTime,
       onDateTimeChanged: (date) {
         state.appliedEditView!.workOut = DateTimeUtils.formatDate(date);

+ 23 - 0
packages/cpt_th/lib/modules/job_er/job_list_er/job_list_er_item.dart

@@ -175,6 +175,29 @@ class JobListErItem extends StatelessWidget {
           //   ],
           // ).marginOnly(top: 6),
 
+          //OT的设置
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "${"OT".tr}:",
+                fontSize: 15,
+                textColor: Colors.white,
+                isFontRegular: true,
+                marginRight: 10,
+              ),
+              CupertinoSwitch(
+                value: item.isOt == 2,
+                activeColor: const Color(0XFF03DC9A),
+                trackColor: const Color(0XFFDCDDDD),
+                thumbColor: CupertinoColors.white,
+                onChanged: (value) {
+                },
+              ),
+            ],
+          ).marginOnly(top: 6),
+
           // 状态
           Row(
             mainAxisSize: MainAxisSize.max,

+ 11 - 0
packages/cpt_th/lib/modules/labour/labour_request_add/labour_request_add_controller.dart

@@ -86,6 +86,8 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
 
         state.attFilePath = state.editDetailEntity?.labReq?.attUrl;
 
+        state.isOTSelected = state.editDetailEntity?.labReq?.isOt == 2; //等于2就是选中状态
+
         update();
       }
     } else {
@@ -228,6 +230,7 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
         estRevenue: revenue,
         position: position,
         estCost: totalCost,
+        isOT: state.isOTSelected,
         cancelToken: cancelToken,
       );
     } else {
@@ -252,6 +255,7 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
         position: position,
         estCost: totalCost,
         attUrl: state.attFilePath,
+        isOT: state.isOTSelected,
         cancelToken: cancelToken,
       );
     }
@@ -388,4 +392,11 @@ class LabourRequestAddController extends GetxController with DioCancelableMixin
       }
     }
   }
+
+  //设置OT的Switch控件是否选中
+  void setOTSelected(bool selected) {
+    state.isOTSelected = selected;
+    update();
+  }
+
 }

+ 24 - 0
packages/cpt_th/lib/modules/labour/labour_request_add/labour_request_add_page.dart

@@ -482,6 +482,30 @@ class _LabourRequestAddState extends BaseState<LabourRequestAddPage, LabourReque
                         ],
                       ),
 
+                      //OT的设置
+                      Row(
+                        children: [
+                          MyTextView(
+                            "${"OT".tr}:",
+                            fontSize: 15,
+                            textColor: Colors.white,
+                            isFontRegular: true,
+                            marginRight: 10,
+                          ),
+                          CupertinoSwitch(
+                            value: state.isOTSelected,
+                            activeColor: const Color(0XFF03DC9A),
+                            trackColor: const Color(0XFFDCDDDD),
+                            thumbColor: CupertinoColors.white,
+                            onChanged: state.pageType == 2
+                                ? null
+                                : (value) {
+                                    controller.setOTSelected(value);
+                                  },
+                          ),
+                        ],
+                      ).marginOnly(top: 15),
+
                       //输入Remark
                       MyTextView(
                         "Remark".tr,

+ 2 - 1
packages/cpt_th/lib/modules/labour/labour_request_add/labour_request_add_state.dart

@@ -1,4 +1,3 @@
-import 'package:domain/entity/response/s_g_labour_request_detail_entity.dart';
 import 'package:domain/entity/response/t_h_o_a_labour_detail_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:plugin_basic/basic_export.dart';
@@ -105,4 +104,6 @@ class LabourRequestAddState {
   String? selectedType;
 
   String? attFilePath;
+
+  bool isOTSelected = false;
 }

+ 23 - 0
packages/cpt_th/lib/modules/labour/labour_request_list/labour_request_item.dart

@@ -204,6 +204,29 @@ class LabourRequestItem extends StatelessWidget {
             ],
           ),
 
+          //OT的设置
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "${"OT".tr}:",
+                fontSize: 15,
+                textColor: Colors.white,
+                isFontRegular: true,
+                marginRight: 10,
+              ),
+              CupertinoSwitch(
+                value: item.isOt == 2,
+                activeColor: const Color(0XFF03DC9A),
+                trackColor: const Color(0XFFDCDDDD),
+                thumbColor: CupertinoColors.white,
+                onChanged: (value) {
+                },
+              ),
+            ],
+          ).marginOnly(top: 1,bottom: 4),
+
           // 状态
           Row(
             mainAxisSize: MainAxisSize.max,

+ 22 - 0
packages/cpt_th/lib/modules/labour/labour_review_list/labour_review_item.dart

@@ -176,6 +176,28 @@ class LabourReviewItem extends StatelessWidget {
             ],
           ).marginOnly(top:10),
 
+          //OT的设置
+          Row(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: [
+              MyTextView(
+                "${"OT".tr}:",
+                fontSize: 15,
+                textColor: Colors.white,
+                isFontRegular: true,
+                marginRight: 10,
+              ),
+              CupertinoSwitch(
+                value: item.isOt == 2,
+                activeColor: const Color(0XFF03DC9A),
+                trackColor: const Color(0XFFDCDDDD),
+                thumbColor: CupertinoColors.white,
+                onChanged: (value) {
+                },
+              ),
+            ],
+          ).marginOnly(top: 5),
 
           //按钮组
           Visibility(

+ 11 - 0
packages/cpt_th/lib/modules/labour_er/labour_request_er_add/labour_request_er_add_controller.dart

@@ -61,6 +61,8 @@ class LabourRequestERAddController extends GetxController with DioCancelableMixi
         remarkController.text = state.editDetailEntity?.job?.description ?? '';
         eventNameController.text = state.editDetailEntity?.job?.eventName ?? '';
         eventTypeController.text = state.editDetailEntity?.job?.eventType ?? '';
+
+        state.isOTSelected = state.editDetailEntity?.job?.isOt == 2; //2是选中
       } else {
         ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
       }
@@ -72,6 +74,7 @@ class LabourRequestERAddController extends GetxController with DioCancelableMixi
 
       if (result.isSuccess) {
         state.editDetailEntity = result.data;
+        state.isOTSelected = false;
       } else {
         ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
       }
@@ -176,6 +179,7 @@ class LabourRequestERAddController extends GetxController with DioCancelableMixi
         eventName: eventName,
         eventType: evenType,
         remark: remark,
+        isOT: state.isOTSelected,
         cancelToken: cancelToken,
       );
     } else {
@@ -194,6 +198,7 @@ class LabourRequestERAddController extends GetxController with DioCancelableMixi
         eventName: eventName,
         eventType: evenType,
         remark: remark,
+        isOT: state.isOTSelected,
         cancelToken: cancelToken,
       );
     }
@@ -308,4 +313,10 @@ class LabourRequestERAddController extends GetxController with DioCancelableMixi
       title: "Repeat End Time".tr,
     );
   }
+
+  //设置OT的Switch控件是否选中
+  void setOTSelected(bool selected) {
+    state.isOTSelected = selected;
+    update();
+  }
 }

+ 50 - 17
packages/cpt_th/lib/modules/labour_er/labour_request_er_add/labour_request_er_add_page.dart

@@ -7,6 +7,7 @@ import 'package:flutter/widgets.dart';
 import 'package:get/get.dart';
 import 'package:plugin_basic/base/base_state.dart';
 import 'package:plugin_basic/base/base_stateful_page.dart';
+import 'package:plugin_basic/service/app_config_service.dart';
 import 'package:plugin_basic/utils/ext_get_nav.dart';
 import 'package:router/path/router_path.dart';
 import 'package:shared/utils/date_time_utils.dart';
@@ -97,7 +98,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                         margin: const EdgeInsets.only(top: 10),
                         height: 45,
                         decoration: BoxDecoration(
-                          color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
+                          color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                           borderRadius: const BorderRadius.all(Radius.circular(5)),
                         ),
                         child: Row(
@@ -116,7 +117,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
 
                             //下拉选图标
                             Visibility(
-                              visible: state.pageType != 2,
+                              visible: state.pageType != 2 && !ConfigService.to.isTHOAType,
                               child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
                             ),
                           ],
@@ -142,7 +143,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                               padding: const EdgeInsets.only(left: 16, right: 10),
                               height: 45,
                               decoration: BoxDecoration(
-                                color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
+                                color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                                 borderRadius: const BorderRadius.all(Radius.circular(5)),
                               ),
                               child: Row(
@@ -160,14 +161,14 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                                   ).expanded(),
                                   //下拉选图标
                                   Visibility(
-                                    visible: state.pageType != 2,
+                                    visible: state.pageType != 2 && !ConfigService.to.isTHOAType,
                                     child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
                                   ),
                                 ],
                               ),
                             ).onTap(() {
                               FocusScope.of(context).unfocus();
-                              if (state.pageType != 2) controller.pickStartTime();
+                              if (state.pageType != 2 && !ConfigService.to.isTHOAType) controller.pickStartTime();
                             }),
                           ),
 
@@ -178,7 +179,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                               margin: const EdgeInsets.only(left: 10),
                               height: 45,
                               decoration: BoxDecoration(
-                                color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
+                                color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                                 borderRadius: const BorderRadius.all(Radius.circular(5)),
                               ),
                               child: Row(
@@ -196,14 +197,14 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                                   ).expanded(),
                                   //下拉选图标
                                   Visibility(
-                                    visible: state.pageType != 2,
+                                    visible: state.pageType != 2 && !ConfigService.to.isTHOAType,
                                     child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
                                   ),
                                 ],
                               ),
                             ).onTap(() {
                               FocusScope.of(context).unfocus();
-                              if (state.pageType != 2) controller.pickEndTime();
+                              if (state.pageType != 2 && !ConfigService.to.isTHOAType) controller.pickEndTime();
                             }),
                           ),
                         ],
@@ -348,7 +349,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                             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 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                               borderRadius: const BorderRadius.all(Radius.circular(5)),
                             ),
                             child: Row(
@@ -364,12 +365,15 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                                   textColor: ColorConstants.white,
                                 ).expanded(),
                                 //下拉选图标
-                                const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                                Visibility(
+                                  visible: state.pageType != 2 && !ConfigService.to.isTHOAType,
+                                  child: const MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                                ),
                               ],
                             ),
                           ).onTap(() {
                             FocusScope.of(context).unfocus();
-                            controller.pickLimitType();
+                            if (state.pageType != 2 && !ConfigService.to.isTHOAType) controller.pickLimitType();
                           }).expanded(flex: 55),
 
                           //输入框-不限制性别
@@ -382,7 +386,8 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                               paddingTop: 0,
                               paddingBottom: 0,
                               height: 45,
-                              fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
+                              enabled: state.pageType != 2 && !ConfigService.to.isTHOAType,
+                              fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                               inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
                               textInputType: TextInputType.number,
                               formData: state.formData,
@@ -417,6 +422,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                                       paddingRight: 10,
                                       height: 45,
                                       cornerRadius: 0,
+                                      enabled: state.pageType != 2 && !ConfigService.to.isTHOAType,
                                       fillBackgroundColor: Colors.transparent,
                                       inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
                                       textInputType: TextInputType.number,
@@ -429,7 +435,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                                   ],
                                 )
                                     .decorated(
-                                      color: const Color(0xFF4DCFF6).withOpacity(0.2),
+                                      color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                                       borderRadius: const BorderRadius.all(Radius.circular(5)),
                                     )
                                     .expanded(),
@@ -452,6 +458,7 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                                       paddingLeft: 10,
                                       paddingRight: 10,
                                       height: 45,
+                                      enabled: state.pageType != 2 && !ConfigService.to.isTHOAType,
                                       cornerRadius: 0,
                                       fillBackgroundColor: Colors.transparent,
                                       inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
@@ -475,6 +482,30 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                         ],
                       ),
 
+                      //OT的设置
+                      Row(
+                        children: [
+                          MyTextView(
+                            "${"OT".tr}:",
+                            fontSize: 15,
+                            textColor: Colors.white,
+                            isFontRegular: true,
+                            marginRight: 10,
+                          ),
+                          CupertinoSwitch(
+                            value: state.isOTSelected,
+                            activeColor: const Color(0XFF03DC9A),
+                            trackColor: const Color(0XFFDCDDDD),
+                            thumbColor: CupertinoColors.white,
+                            onChanged: state.pageType == 2
+                                ? null
+                                : (value) {
+                                    controller.setOTSelected(value);
+                                  },
+                          ),
+                        ],
+                      ).marginOnly(top: 15, bottom: 10),
+
                       //输入类型
                       MyTextView("Event".tr, fontSize: 15, textColor: Colors.white, isFontRegular: true, marginTop: 15, marginBottom: 10),
 
@@ -487,7 +518,8 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                             paddingTop: 0,
                             paddingBottom: 0,
                             height: 45,
-                            fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
+                            enabled: state.pageType != 2 && !ConfigService.to.isTHOAType,
+                            fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                             inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
                             textInputType: TextInputType.number,
                             formData: state.formData,
@@ -505,7 +537,8 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                             paddingTop: 0,
                             paddingBottom: 0,
                             height: 45,
-                            fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(0.2),
+                            enabled: state.pageType != 2 && !ConfigService.to.isTHOAType,
+                            fillBackgroundColor: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                             inputFormatters: <TextInputFormatter>[FilteringTextInputFormatter.digitsOnly],
                             textInputType: TextInputType.number,
                             formData: state.formData,
@@ -532,14 +565,14 @@ class _LabourRequestAddState extends BaseState<LabourRequestERAddPage, LabourReq
                           margin: const EdgeInsets.only(top: 10),
                           padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 15),
                           decoration: BoxDecoration(
-                            color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 ? 0.5 : 0.2),
+                            color: const Color(0xFF4DCFF6).withOpacity(state.pageType == 2 || ConfigService.to.isTHOAType ? 0.5 : 0.2),
                             borderRadius: const BorderRadius.all(Radius.circular(5)),
                           ),
                           child: TextField(
                             cursorColor: ColorConstants.white,
                             cursorWidth: 1.5,
                             autofocus: false,
-                            enabled: state.pageType != 2,
+                            enabled: state.pageType != 2 && !ConfigService.to.isTHOAType,
                             focusNode: state.formData["remark"]!['focusNode'],
                             controller: state.formData["remark"]!['controller'],
                             // 装饰

+ 2 - 0
packages/cpt_th/lib/modules/labour_er/labour_request_er_add/labour_request_er_add_state.dart

@@ -71,4 +71,6 @@ class LabourRequestERAddState {
 
   String? selectOutletId;
   String? selectOutletName;
+
+  bool isOTSelected = false;  //OT的选中
 }

+ 1 - 1
packages/cs_domain/lib/constants/api_constants.dart

@@ -2,7 +2,7 @@
 
 class ApiConstants {
   //当前服务器环境
-  static const isServerRelease = true;
+  static const isServerRelease = false;
 
   //新加坡的域名
   static const sgBaseUrl = isServerRelease ? 'https://casualabour.com/' : 'http://singapore-dev.casualabour.com';

+ 11 - 2
packages/cs_domain/lib/repository/th_er_repository.dart

@@ -92,6 +92,7 @@ class THERRepository extends GetxService {
     String? eventName,
     String? eventType,
     String? remark,
+    bool isOT = false,
     CancelToken? cancelToken,
   }) async {
     Map<String, String> params = {};
@@ -123,6 +124,9 @@ class THERRepository extends GetxService {
     if (!Utils.isEmpty(remark)) {
       params["remark"] = remark!;
     }
+    if (isOT) {
+      params["is_ot"] = "2";
+    }
 
     final result = await httpProvider.requestNetResult(
       ApiConstants.apiERLabourRequestAddSubmitTH,
@@ -279,6 +283,7 @@ class THERRepository extends GetxService {
     String? eventName,
     String? eventType,
     String? remark,
+    bool isOT = false,
     CancelToken? cancelToken,
   }) async {
     Map<String, String> params = {};
@@ -308,6 +313,7 @@ class THERRepository extends GetxService {
     if (!Utils.isEmpty(remark)) {
       params["remark"] = remark!;
     }
+    params["is_ot"] = isOT ? "2" : "1";
 
     final result = await httpProvider.requestNetResult(
       ApiConstants.apiERLabourRequestEditSubmitTH,
@@ -549,7 +555,8 @@ class THERRepository extends GetxService {
   /// 添加员工的全部员工数据列表
   Future<HttpResult<THAppliedEmployeeEntity>> searchStaffList(
     String? jobId,
-    String? keyword, {
+    String? keyword,
+    String? type, {
     required int curPage,
     CancelToken? cancelToken,
   }) async {
@@ -564,6 +571,9 @@ class THERRepository extends GetxService {
     if (Utils.isNotEmpty(keyword)) {
       params["keyword"] = keyword!;
     }
+    if (Utils.isNotEmpty(type) && type == "regular") {
+      params["staff_type"] = type!;
+    }
 
     final result = await httpProvider.requestNetResult(
       ApiConstants.apiERAppliedAddEmployeeTH,
@@ -956,5 +966,4 @@ class THERRepository extends GetxService {
     }
     return result.convert();
   }
-
 }

+ 7 - 2
packages/cs_domain/lib/repository/th_oa_repository.dart

@@ -247,6 +247,7 @@ class THOARepository extends GetxService {
     String? position,
     String? estCost,
     String? attUrl,
+    bool isOT = false,
     CancelToken? cancelToken,
   }) async {
     //参数
@@ -275,6 +276,9 @@ class THOARepository extends GetxService {
     params['position'] = position ?? "";
     params['est_cost'] = estCost ?? "";
     params['att_url'] = attUrl ?? "";
+    if (isOT) {
+      params['is_ot'] = "2";
+    }
 
     final result = await httpProvider.requestNetResult(
       ApiConstants.apiOALabourRequestAddSubmitTH,
@@ -313,6 +317,7 @@ class THOARepository extends GetxService {
     String? estRevenue,
     String? position,
     String? estCost,
+    bool isOT = false,
     CancelToken? cancelToken,
   }) async {
     //参数
@@ -341,6 +346,7 @@ class THOARepository extends GetxService {
     params['est_revenue'] = estRevenue ?? "";
     params['position'] = position ?? "";
     params['est_cost'] = estCost ?? "";
+    params['is_ot'] = isOT ? "2" : "1";
 
     final result = await httpProvider.requestNetResult(
       isReviewEdit ? ApiConstants.apiOALabourReviewEditSubmitTH : ApiConstants.apiOALabourRequestEditSubmitTH,
@@ -593,7 +599,7 @@ class THOARepository extends GetxService {
     Map<String, String> params = {};
     params['record_ids'] = recordIds ?? "";
     params['type'] = type ?? "";
-    if (Utils.isNotEmpty(auditMark)){
+    if (Utils.isNotEmpty(auditMark)) {
       params['audit_mark'] = auditMark!;
     }
 
@@ -638,5 +644,4 @@ class THOARepository extends GetxService {
     }
     return result.convert();
   }
-
 }