Pārlūkot izejas kodu

泰国的首页与Setting接口调试

liukai 2 nedēļas atpakaļ
vecāks
revīzija
8b8c8153c1

+ 17 - 15
packages/cpt_auth/lib/modules/setting/setting_controller.dart

@@ -13,7 +13,6 @@ import 'package:plugin_platform/engine/notify/notify_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:shared/utils/event_bus.dart';
-import 'package:shared/utils/util.dart';
 import 'package:widgets/dialog/app_default_dialog.dart';
 
 import 'setting_state.dart';
@@ -25,8 +24,7 @@ class SettingController extends GetxController with DioCancelableMixin {
 
   //切换账号
   void switchProjects() async {
-
-    final result = await _msRepository.fetchSwitchProjectList(cancelToken: cancelToken);
+    final result = await _msRepository.fetchSwitchProjectList(country: ConfigService.to.selectCountry.value, cancelToken: cancelToken);
 
     if (result.isSuccess) {
       final projects = result.data?.cutUser;
@@ -45,25 +43,22 @@ class SettingController extends GetxController with DioCancelableMixin {
         widget: SwitchProjectDialog(
       options: projects,
       confirmAction: (entity) {
-
         _requestSwitchProject(entity);
       },
     ));
   }
 
-  void _requestSwitchProject(IndexOptionEntity entity) async{
-    final result = await _msRepository.switchProjectSubmit(entity.value,cancelToken: cancelToken);
+  void _requestSwitchProject(IndexOptionEntity entity) async {
+    final result = await _msRepository.switchProjectSubmit(entity.value, country: ConfigService.to.selectCountry.value, cancelToken: cancelToken);
 
     if (result.isSuccess) {
-
       NotifyEngine.showSuccess('successful'.tr);
 
-     final token =  result.data?.token;
+      final token = result.data?.token;
       UserService.to.setToken(token);
 
       //发送通知刷新首页
       bus.emit(AppConstant.eventMainRefresh, true);
-
     } else {
       final errorMessage = result.errorMsg;
       ToastEngine.show(errorMessage ?? "Network Load Error".tr);
@@ -114,16 +109,23 @@ class SettingController extends GetxController with DioCancelableMixin {
 
   /// 请求接口退出账号
   void _requestLogout() async {
-    var result = await _authRepository.userLogout(country: ConfigService.to.selectCountry.value, cancelToken: cancelToken);
-
-    //处理数据
-    if (result.isSuccess) {
+    if (ConfigService.to.selectCountry.value == 5) {
+      //直接退出
       //清除数据,去首页
       UserService.to.handleLogoutParams();
       LoginPage.startWithPopAll();
     } else {
-      ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
+      //请求接口
+      var result = await _authRepository.userLogout(country: ConfigService.to.selectCountry.value, cancelToken: cancelToken);
+
+      //处理数据
+      if (result.isSuccess) {
+        //清除数据,去首页
+        UserService.to.handleLogoutParams();
+        LoginPage.startWithPopAll();
+      } else {
+        ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
+      }
     }
   }
-
 }

+ 3 - 3
packages/cpt_auth/lib/modules/setting/setting_page.dart

@@ -59,16 +59,16 @@ class SettingPage extends BaseStatelessPage<SettingController> {
           child: Column(children: [
             const SizedBox(height: 10),
 
-          ConfigService.to.selectCountry.value == 3 ?
+          ConfigService.to.selectCountry.value == 3  ||  ConfigService.to.selectCountry.value == 5 ?
           SettingItemContainer(iconPath: Assets.mainSettingSwitchProject, title: "Switch Projects".tr).onTap(() {
               controller.switchProjects();
             }) : const SizedBox(),
 
-            ConfigService.to.selectCountry.value != 3 ? SettingItemContainer(iconPath: Assets.mainSettingResetPassword, title: "Reset Password".tr).onTap(() {
+            ConfigService.to.selectCountry.value != 3 &&  ConfigService.to.selectCountry.value != 5 ? SettingItemContainer(iconPath: Assets.mainSettingResetPassword, title: "Reset Password".tr).onTap(() {
               controller.gotoResetPasswordPage();
             }): const SizedBox(),
 
-            ConfigService.to.selectCountry.value != 3 ? SettingItemContainer(iconPath: Assets.mainSettingAccountDelectivation, title: "Account Deactivation".tr).onTap(() {
+            ConfigService.to.selectCountry.value != 3 &&  ConfigService.to.selectCountry.value != 5 ? SettingItemContainer(iconPath: Assets.mainSettingAccountDelectivation, title: "Account Deactivation".tr).onTap(() {
               controller.doAccountDelete();
             }): const SizedBox(),
 

+ 247 - 0
packages/cpt_th/lib/modules/labour/labour_request_add/labour_need_number_widget.dart

@@ -0,0 +1,247 @@
+import 'package:cs_resources/constants/color_constants.dart';
+import 'package:cs_resources/generated/assets.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/services.dart';
+import 'package:plugin_basic/basic_export.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import 'package:widgets/shatter/form_require_text.dart';
+import 'package:widgets/shatter/round_my_text_field.dart';
+import 'package:domain/entity/agency_need_number.dart';
+
+/*
+ * 需求数量的限制
+ */
+class LabourNeedNumberWidget extends StatefulWidget {
+
+  int sexLimit = 0; //是否限制性别 0不限制  1限制
+  int needNum = 0;
+  int maleLimit = 0;
+  int femaleLimit = 0;
+
+  LabourNeedNumberWidget({
+    this.sexLimit = 0,
+    this.needNum = 0,
+    this.maleLimit = 0,
+    this.femaleLimit = 0,
+    Key? key,
+  }) : super(key: key ?? GlobalKey<AgencyNeedNumberState>()); // 使用新的 GlobalKey
+
+  @override
+  State<LabourNeedNumberWidget> createState() => AgencyNeedNumberState();
+}
+
+class AgencyNeedNumberState extends State<LabourNeedNumberWidget> {
+  int limitType = 0;
+  List<String> limitTypeList = [
+    "Gender Unlimited".tr,
+    "Gender Limited".tr,
+  ];
+
+  final Map<String, Map<String, dynamic>> formData = {
+    'need_male': {
+      'value': '',
+      'controller': TextEditingController(),
+      'focusNode': FocusNode(),
+      'hintText': 'Male'.tr,
+      'obsecure': false,
+    },
+    'need_female': {
+      'value': '',
+      'controller': TextEditingController(),
+      'focusNode': FocusNode(),
+      'hintText': 'Female'.tr,
+      'obsecure': false,
+    },
+    'need_no': {
+      'value': '',
+      'controller': TextEditingController(),
+      'focusNode': FocusNode(),
+      'hintText': 'Needs Num'.tr,
+      'obsecure': false,
+    },
+  };
+
+  @override
+  void initState() {
+    super.initState();
+    limitType = 0;
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.start,
+      children: [
+
+        FormRequireText(
+          text: "No. of Staff".tr,
+        ).marginOnly(top: 15),
+
+        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(
+                    limitTypeList[limitType],
+                    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();
+              pickLimitType();
+            }).expanded(flex: 55),
+
+            //输入框-不限制性别
+            Visibility(
+              visible: limitType == 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: formData,
+                textInputAction: TextInputAction.done,
+                onSubmit: (key, value) {
+                  FocusScope.of(context).unfocus();
+                },
+              ).expanded(flex: 55),
+            ),
+
+            //输入框组-限制性别
+            Visibility(
+              visible: limitType != 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: 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: 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),
+            ),
+          ],
+        ),
+      ],
+    );
+  }
+
+  //选择分类
+  void pickLimitType() {
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: limitTypeList,
+      initialSelectIndex: limitType,
+      onPickerChanged: (_, index) {
+        setState(() {
+          limitType = index;
+        });
+      },
+    );
+  }
+
+  // 返回 AgencyNeedNumberEntity 对象
+  AgencyNeedNumberEntity getAgencyNeedNumberEntity() {
+    AgencyNeedNumberEntity entity = AgencyNeedNumberEntity();
+    entity.sexLimit = limitType; // 设置性别限制
+    if (limitType == 0) {
+      // 不限制性别的总人数
+      entity.needNum = int.tryParse(formData['need_no']!['controller']!.text) ?? 0;
+    } else {
+      // 限制性别
+      entity.maleLimit = int.tryParse(formData['need_male']!['controller']!.text) ?? 0;
+      entity.femaleLimit = int.tryParse(formData['need_female']!['controller']!.text) ?? 0;
+    }
+    return entity;
+  }
+}

+ 196 - 142
packages/cpt_th/lib/modules/labour/labour_request_add/labour_request_add_controller.dart

@@ -1,10 +1,11 @@
-import 'package:domain/entity/response/labour_request_edit_index_entity.dart';
-import 'package:domain/repository/labour_repository.dart';
+import 'package:domain/repository/labour_sg_repository.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:get/get.dart';
 import 'package:plugin_basic/constants/app_constant.dart';
+import 'package:plugin_platform/engine/loading/loading_engine.dart';
 import 'package:plugin_platform/engine/notify/notify_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/event_bus.dart';
@@ -14,36 +15,50 @@ import 'package:widgets/picker/option_pick_util.dart';
 
 import 'labour_request_add_state.dart';
 
-class LabourRequestAddController extends GetxController {
-  final LabourRepository _labourRepository = Get.find();
+class LabourRequestAddController extends GetxController with DioCancelableMixin {
+  final LabourSGRepository _labourRepository = Get.find();
   final LabourRequestAddState state = LabourRequestAddState();
 
-  /// 获取首页的数据
-  void fetchRequestDetail() async {
-    //获取到数据
-    Future<HttpResult<LabourRequestEditIndexEntity>> taskFuture;
-    if (state.pageType != 0 && Utils.isNotEmpty(state.appliedId) && state.appliedId != "0") {
-      taskFuture = _labourRepository.fetchLabourRequestEditDetail(state.appliedId);
-    } else {
-      taskFuture = _labourRepository.fetchLabourRequestAddOption();
-    }
+  // 获取添加选项数据
+  void fetchLabourRequestEditDetail() async {
+    var result = await _labourRepository.fetchLabourRequestEditDetail(
+      state.requestId,
+      cancelToken: cancelToken,
+    );
 
-    var result = await taskFuture;
+    LoadingEngine.dismiss();
 
-    //处理数据
     if (result.isSuccess) {
-      state.labReqOption = result.data;
-      state.selectedStartTime = state.labReqOption?.jobStart == null ? null : DateTimeUtils.getDateTime(state.labReqOption!.jobStart!);
-      state.selectedEndTime = state.labReqOption?.jobEnd == null ? null : DateTimeUtils.getDateTime(state.labReqOption!.jobEnd!);
-      state.noStaff = state.labReqOption?.needNum.toString() == "0" ? "" : state.labReqOption?.needNum.toString();
-      var needNumController = state.formData['no_of_staff']!['controller'];
-      needNumController.text = state.noStaff;
-      var amountController = state.formData['amount']!['controller'];
-      amountController.text = state.labReqOption?.amount ?? "";
-      state.selectedTemplateId = state.labReqOption?.templateId;
-      state.selectedDepartmentId = state.labReqOption?.departmentId;
-
-      state.chargeOptionId = state.labReqOption?.chargeList.firstWhere((element) => element.checked == "checked").value;
+      state.editDetailEntity = result.data;
+      var needMallController = state.formData['need_male']!['controller'];
+      var needFemaleController = state.formData['need_female']!['controller'];
+      var needNumController = state.formData['need_no']!['controller'];
+      var remarkController = state.formData['remark']!['controller'];
+
+      int genderOptionType = 0; //使用哪一种类型限制
+      if (state.editDetailEntity?.labReq?.sexLimit == 1) {
+        state.genderOptionType = 1;
+        needMallController.text = state.editDetailEntity?.labReq?.maleLimit?.toString();
+        needFemaleController.text = state.editDetailEntity?.labReq?.femaleLimit?.toString();
+        needNumController.text = '';
+      } else {
+        state.genderOptionType = 0;
+        needMallController.text = '';
+        needFemaleController.text = '';
+        needNumController.text = state.editDetailEntity?.labReq?.hiringNum?.toString();
+      }
+
+      remarkController.text = state.editDetailEntity?.labReq?.description ?? '';
+
+      state.selectedStartTime = DateTimeUtils.getDateTime(state.editDetailEntity!.startTime!);
+      state.selectedEndTime = DateTimeUtils.getDateTime(state.editDetailEntity!.endTime!);
+
+      state.selectedOutlet = state.editDetailEntity?.labReq?.outletName;
+      state.selectedOutletId = state.editDetailEntity?.labReq?.outletId?.toString();
+
+      state.selectRequestTypeId = state.editDetailEntity?.labReq?.requestType?.toString();
+      state.selectPositionId = state.editDetailEntity?.labReq?.positionId?.toString();
+      state.selectPositionName = state.editDetailEntity?.labReq?.positionName?.toString();
 
       update();
     } else {
@@ -54,75 +69,157 @@ class LabourRequestAddController extends GetxController {
   @override
   void onReady() {
     super.onReady();
-    fetchRequestDetail();
+    fetchLabourRequestEditDetail();
   }
 
-  /// 提交
-  void doSubmit() async {
-    var needNumController = state.formData['no_of_staff']!['controller'];
-    var amountController = state.formData['amount']!['controller'];
-    String needNum = needNumController.text.toString();
-    String amount = amountController.text.toString();
+  //选择开始时间
+  void pickStartTime() {
+    // if (state.editDetailEntity == null) {
+    //   return;
+    // }
 
-    if (Utils.isEmpty(state.selectedTemplateId)) {
-      ToastEngine.show("Choose Job Title".tr);
-      return;
-    } else if (state.selectedStartTime == null) {
-      ToastEngine.show("Choose Start Date".tr);
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: state.selectedStartTime,
+      mode: CupertinoDatePickerMode.dateAndTime,
+      onDateTimeChanged: (date) {
+        state.selectedStartTime = date;
+        update();
+      },
+      title: "Start Time".tr,
+    );
+  }
+
+  // 选择结束时间
+  void pickEndTime() {
+    if (state.editDetailEntity == null) {
       return;
-    } else if (state.selectedEndTime == null) {
-      ToastEngine.show("Choose End Date".tr);
+    }
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: state.selectedEndTime ?? state.selectedStartTime,
+      mode: CupertinoDatePickerMode.dateAndTime,
+      onDateTimeChanged: (date) {
+        state.selectedEndTime = date;
+        update();
+      },
+      title: "End Time".tr,
+    );
+  }
+
+  //选择部门
+  void pickOutlet() {
+    if (state.editDetailEntity == null) {
       return;
-    } else if (Utils.isEmpty(state.selectedDepartmentId)) {
-      ToastEngine.show("Choose Outlet".tr);
+    }
+
+    int selectedIndex;
+    if (state.selectedOutletId == null) {
+      selectedIndex = 0;
+    } else {
+      selectedIndex = state.editDetailEntity!.outletList.indexWhere((department) => department.value.toString() == state.selectedOutletId);
+    }
+
+    if (selectedIndex < 0) {
+      selectedIndex = 0;
+    }
+
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: state.editDetailEntity!.outletList.map((e) => e.txt!).toList(growable: false),
+      initialSelectIndex: selectedIndex,
+      onPickerChanged: (_, index) {
+        state.selectedOutletId = state.editDetailEntity!.outletList[index].value!.toString();
+        state.selectedOutlet = state.editDetailEntity!.outletList[index].txt!.toString();
+        update();
+      },
+    );
+  }
+
+  // 提交LabourRequest表单
+  void doEditSubmit() async {
+    var maleNoController = state.formData['need_male']!['controller'];
+    var femaleNoController = state.formData['need_female']!['controller'];
+    var needNoController = state.formData['need_no']!['controller'];
+    var remarkController = state.formData['remark']!['controller'];
+
+    String maleNo = maleNoController.text.toString();
+    String femaleNo = femaleNoController.text.toString();
+    String needNo = needNoController.text.toString();
+    String remark = remarkController.text.toString();
+
+    if (state.selectedStartTime == null) {
+      ToastEngine.show("Select Job Start Time".tr);
       return;
-    } else if (Utils.isEmpty(needNum)) {
-      ToastEngine.show("Enter No. of Staff".tr);
+    }
+
+    if (state.selectedEndTime == null) {
+      ToastEngine.show("Select Job End Time".tr);
       return;
-    } else if (state.labReqOption?.serviceType == 1 && Utils.isEmpty(amount)) {
-      ToastEngine.show("Enter Amount".tr);
+    }
+
+    if (Utils.isEmpty(state.selectedOutletId)) {
+      ToastEngine.show("Choose Outlet".tr);
       return;
     }
 
-    Future<HttpResult> taskFuture;
-    if (state.pageType != 0 && Utils.isNotEmpty(state.appliedId) && state.appliedId != "0") {
-      taskFuture = _labourRepository.editLabourRequestSubmit(
-        state.appliedId,
-        state.selectedTemplateId,
-        DateTimeUtils.formatDate(state.selectedStartTime),
-        DateTimeUtils.formatDate(state.selectedEndTime),
-        state.selectedDepartmentId,
-        needNum,
-        state.chargeOptionId,
-        state.labReqOption?.serviceType == 1 ? amount : null,
+    if (state.genderOptionType == 0) {
+      if (Utils.isEmpty(needNo)) {
+        ToastEngine.show("Enter No. of Staff".tr);
+        return;
+      }
+    } else {
+      if (Utils.isEmpty(maleNo) || Utils.isEmpty(femaleNo)) {
+        ToastEngine.show("Enter No. of Staff of The Corresponding Gender".tr);
+        return;
+      }
+    }
+
+    if (state.selectRequestTypeId == "1") {
+      if (Utils.isEmpty(state.selectPositionId)) {
+        ToastEngine.show("Select Position".tr);
+        return;
+      }
+    }
+
+    HttpResult result;
+    if (state.pageType == 1) {
+      result = await _labourRepository.editLabourRequestSubmit(
+        requestId: state.requestId,
+        startTime: DateTimeUtils.formatDate(state.selectedStartTime),
+        endTime: DateTimeUtils.formatDate(state.selectedEndTime),
+        outletId: state.selectedOutletId,
+        sexLimit: state.genderOptionType,
+        maleLimit: maleNo,
+        femaleLimit: femaleNo,
+        needNum: needNo,
+        requestType: state.selectRequestTypeId,
+        positionId: state.selectPositionId,
+        remark: remark,
+        cancelToken: cancelToken,
       );
     } else {
-      taskFuture = _labourRepository.addLabourRequestSubmit(
-        state.selectedTemplateId,
-        DateTimeUtils.formatDate(state.selectedStartTime),
-        DateTimeUtils.formatDate(state.selectedEndTime),
-        state.selectedDepartmentId,
-        needNum,
-        state.chargeOptionId,
-        state.labReqOption?.serviceType == 1 ? amount : null,
+      // state.pageType == 3 这是 LabourRequestReview 的编辑提交
+      result = await _labourRepository.editLabourRequestReviewSubmit(
+        requestId: state.requestId,
+        startTime: DateTimeUtils.formatDate(state.selectedStartTime),
+        endTime: DateTimeUtils.formatDate(state.selectedEndTime),
+        outletId: state.selectedOutletId,
+        sexLimit: state.genderOptionType,
+        maleLimit: maleNo,
+        femaleLimit: femaleNo,
+        needNum: needNo,
+        requestType: state.selectRequestTypeId,
+        positionId: state.selectPositionId,
+        remark: remark,
+        cancelToken: cancelToken,
       );
     }
 
-    var result = await taskFuture;
-
     //处理数据
     if (result.isSuccess) {
       NotifyEngine.showSuccess("Successful".tr);
 
       //根据类型刷新
-
-      if (state.pageType != 0 && Utils.isNotEmpty(state.appliedId) && state.appliedId != "0") {
-        //编辑就发送指定的 requestId
-        bus.emit(AppConstant.eventLabourRequestRefresh, state.appliedId);
-      } else {
-        //新增的就发送空
-        bus.emit(AppConstant.eventLabourRequestRefresh, "");
-      }
+      state.cb?.call(state.requestId);
 
       Get.back();
     } else {
@@ -130,89 +227,46 @@ class LabourRequestAddController extends GetxController {
     }
   }
 
-  // 筛选工作模板
-  void pickJobTitle() {
-    if (state.labReqOption == null || state.pageType == 2) {
+  //选择常规职位
+  void pickRegularPosition() {
+    if (state.editDetailEntity == null) {
       return;
     }
 
-    int selectedTemplateIndex;
-    if (state.selectedTemplateId == null) {
-      selectedTemplateIndex = 0;
+    int selectedIndex;
+    if (state.selectPositionId == null) {
+      selectedIndex = 0;
     } else {
-      selectedTemplateIndex = state.labReqOption!.templateList.indexWhere((department) => department.value.toString() == state.selectedTemplateId);
+      selectedIndex = state.editDetailEntity!.positionList.indexWhere((bean) => bean.value.toString() == state.selectPositionId);
     }
 
-    if (selectedTemplateIndex < 0) {
-      selectedTemplateIndex = 0;
+    if (selectedIndex < 0) {
+      selectedIndex = 0;
+    } else {
+      selectedIndex++;
     }
 
+    List<String> list = [];
+    list.addAll(state.editDetailEntity!.positionList.map((e) => e.txt!).toList(growable: false));
+
     OptionPickerUtil.showCupertinoOptionPicker(
-      items: state.labReqOption!.templateList.map((e) => e.txt!).toList(growable: false),
-      initialSelectIndex: selectedTemplateIndex,
+      items: list,
+      initialSelectIndex: selectedIndex,
       onPickerChanged: (_, index) {
-        state.selectedTemplateId = state.labReqOption!.templateList[index].value!.toString();
-        update();
-      },
-    );
-  }
-
-  //选择开始时间
-  void pickStartTime() {
-    if (state.labReqOption == null || state.pageType == 2) {
-      return;
-    }
-
-    DatePickerUtil.showCupertinoDatePicker(
-      selectedDateTime: state.selectedStartTime,
-      mode: CupertinoDatePickerMode.dateAndTime,
-      onDateTimeChanged: (date) {
-        state.selectedStartTime = date;
+        state.selectPositionId = state.editDetailEntity!.positionList[index].value!.toString();
+        state.selectPositionName = state.editDetailEntity!.positionList[index].txt!.toString();
         update();
       },
-      title: "Start Time".tr,
     );
   }
 
-  // 选择结束时间
-  void pickEndTime() {
-    if (state.labReqOption == null || state.pageType == 2) {
-      return;
-    }
-
-    DatePickerUtil.showCupertinoDatePicker(
-      selectedDateTime: state.selectedEndTime ?? state.selectedStartTime,
-      mode: CupertinoDatePickerMode.dateAndTime,
-      onDateTimeChanged: (date) {
-        state.selectedEndTime = date;
-        update();
-      },
-      title: "End Time".tr,
-    );
-  }
-
-  // 筛选部门
-  void pickDepartment() {
-    if (state.labReqOption == null || state.pageType == 2) {
-      return;
-    }
-
-    int selectedDepartmentIndex;
-    if (state.selectedDepartmentId == null) {
-      selectedDepartmentIndex = 0;
-    } else {
-      selectedDepartmentIndex = state.labReqOption!.departmentList.indexWhere((department) => department.value.toString() == state.selectedDepartmentId);
-    }
-
-    if (selectedDepartmentIndex < 0) {
-      selectedDepartmentIndex = 0;
-    }
-
+  //选择性别限制类型
+  void pickLimitType() {
     OptionPickerUtil.showCupertinoOptionPicker(
-      items: state.labReqOption!.departmentList.map((e) => e.txt!).toList(growable: false),
-      initialSelectIndex: selectedDepartmentIndex,
+      items: state.genderOptions,
+      initialSelectIndex: state.genderOptionType,
       onPickerChanged: (_, index) {
-        state.selectedDepartmentId = state.labReqOption!.departmentList[index].value!.toString();
+        state.genderOptionType = index;
         update();
       },
     );

+ 376 - 182
packages/cpt_th/lib/modules/labour/labour_request_add/labour_request_add_page.dart

@@ -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),

+ 39 - 20
packages/cpt_th/lib/modules/labour/labour_request_add/labour_request_add_state.dart

@@ -1,40 +1,59 @@
-import 'package:domain/entity/response/labour_request_edit_index_entity.dart';
+import 'package:domain/entity/response/s_g_labour_request_detail_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:plugin_basic/basic_export.dart';
 
 class LabourRequestAddState {
 
-  int pageType = 0;  //页面的状态 0 是新增  1是编辑  2是详情
-  String? appliedId;  //编辑和详情需要用到ID
-
-  //页面对应的详情数据
-  LabourRequestEditIndexEntity? labReqOption;
-
-  //页面对应的选择的条件
-  DateTime? selectedStartTime;
-  DateTime? selectedEndTime;
-  String? selectedTemplateId;
-  String? selectedDepartmentId;
-  String? noStaff;  //成员数量
-
-  String? chargeOptionId;
-
   //表单的校验与数据
   Map<String, Map<String, dynamic>> formData = {
-    'no_of_staff': {
+    'remark': {
       'value': '',
       'controller': TextEditingController(),
       'focusNode': FocusNode(),
-      'hintText': 'Enter No. of Staff'.tr,
+      'hintText': 'Enter...'.tr,
       'obsecure': false,
     },
-    'amount': {
+    'need_male': {
       'value': '',
       'controller': TextEditingController(),
       'focusNode': FocusNode(),
-      'hintText': 'Enter Amount'.tr,
+      'hintText': 'Male'.tr,
+      'obsecure': false,
+    },
+    'need_female': {
+      'value': '',
+      'controller': TextEditingController(),
+      'focusNode': FocusNode(),
+      'hintText': 'Female'.tr,
+      'obsecure': false,
+    },
+    'need_no': {
+      'value': '',
+      'controller': TextEditingController(),
+      'focusNode': FocusNode(),
+      'hintText': 'Needs Num'.tr,
       'obsecure': false,
     },
   };
 
+  int pageType = 2;  //pageType  1是编辑  2是详情  3是review编辑  4是review详情
+  String? requestId;  //编辑和详情需要用到ID
+  void Function(dynamic value)? cb;
+
+  List<String> genderOptions = ["Gender Unlimited".tr, "Gender Limited".tr];
+  int genderOptionType = 0;  //使用哪一种类型限制
+
+  SGLabourRequestDetailEntity? editDetailEntity;
+
+
+  DateTime? selectedStartTime;
+  DateTime? selectedEndTime;
+
+  String? selectedOutlet;
+  String? selectedOutletId;
+
+  String? selectRequestTypeId;
+  String? selectPositionId;
+  String? selectPositionName;
+
 }

+ 1 - 1
packages/cpt_th/lib/modules/labour/labour_request_list/labour_request_list_controller.dart

@@ -262,7 +262,7 @@ class LabourRequestListController extends GetxController with DioCancelableMixin
 
   //跳转到添加页面
   void gotoAddLabourPage() {
-    LabourRequestAddPage.startInstance(0, "");
+    LabourRequestAddPage.startInstance(1, "");
   }
 
   //去详情页面

+ 2 - 2
packages/cpt_th/lib/modules/labour/labour_request_list/labour_request_list_page.dart

@@ -18,7 +18,7 @@ import 'labour_request_item.dart';
 import 'labour_request_list_controller.dart';
 import 'labour_request_list_state.dart';
 
-/**
+/*
  * 用工请求的主页列表
  */
 class LabourRequestListPage extends BaseStatefulPage<LabourRequestListController> {
@@ -26,7 +26,7 @@ class LabourRequestListPage extends BaseStatefulPage<LabourRequestListController
 
   //启动当前页面
   static void startInstance() {
-    return Get.start(RouterPath.jobLabourRequestList);
+    return Get.start(RouterPath.THLabourRequestOA);
   }
 
   @override

+ 49 - 43
packages/cpt_th/lib/modules/main/main_controller.dart

@@ -5,15 +5,13 @@ import 'package:get/get.dart';
 import 'package:plugin_basic/constants/app_constant.dart';
 import 'package:plugin_basic/service/app_config_service.dart';
 import 'package:plugin_basic/service/user_service.dart';
-import 'package:plugin_platform/engine/sp/sp_util.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:router/componentRouter/component_router_service.dart';
+import 'package:shared/utils/event_bus.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
-import '../job/attendance_review_list/attendance_review_page.dart';
 import '../job/job_list/job_list_page.dart';
-import '../job/sign_in_sign_out/sign_in_sign_out_page.dart';
 import '../labour/labour_request_list/labour_request_list_page.dart';
 import '../labour/labour_review_list/labour_review_page.dart';
 import '../labour/labour_template_list/labour_template_list_page.dart';
@@ -84,68 +82,63 @@ class MainController extends GetxController {
 
   // 处理数据与展示的逻辑
   void _handleList(List<HotelInfoMenus>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      state.datas.clear();
+
+      //如果是管理员登录,根据Key筛选需要展示的模块
+      for (var hotelInfo in list) {
+        if (hotelInfo.key != null) {
+          state.datas.addAll(_filterModulesByKey(hotelInfo.route!));
+        }
+      }
+      //更新状态
+      changeLoadingState(LoadState.State_Success);
+    } else {
+      //展示无数据的布局
+      state.datas.clear();
+      changeLoadingState(LoadState.State_Empty);
+    }
+  }
 
-    state.datas.clear();
-    state.datas.addAll(state.modules);
-    changeLoadingState(LoadState.State_Success);
-
-    // if (list != null && list.isNotEmpty) {
-    //   //有数据,判断是刷新还是加载更多的数据
-    //   state.datas.clear();
-    //
-    //   int? isAdmin = SPUtil.getInt(AppConstant.storageIsAdmin);
-    //   if (isAdmin == 1) {
-    //     //如果是管理员登录,根据Key筛选需要展示的模块
-    //     for (var hotelInfo in list) {
-    //       if (hotelInfo.key != null) {
-    //         state.datas.addAll(_filterModulesByKey(hotelInfo.key!));
-    //       }
-    //     }
-    //   } else {
-    //     //如果只是签到签出模式,手动的添加模块
-    //     state.datas.addAll(_filterModulesByKey("sign"));
-    //   }
-    //
-    //   //更新状态
-    //   changeLoadingState(LoadState.State_Success);
-    // } else {
-    //   //展示无数据的布局
-    //   state.datas.clear();
-    //   changeLoadingState(LoadState.State_Empty);
-    // }
+  List<HomeModule> _filterModulesByKey(String key) {
+    return state.modules.where((module) => module.key == key).toList();
   }
-  //
-  // List<HomeModule> _filterModulesByKey(String key) {
-  //   return state.modules.where((module) => module.key == key).toList();
-  // }
 
   @override
   void onReady() async {
     super.onReady();
     fetchHomeData();
+    registerEventBus();
+  }
+
+  @override
+  void onClose() {
+    unregisterEventBus();
+    super.onClose();
   }
 
   /// 跳转到指定的模块中去
   void gotoModulePage(HomeModule module) {
     switch (module.key) {
-      case 'labReq_er':
-       ToastEngine.show("ER 的 Labour Request");
+      case 'er/lab-req':
+        ToastEngine.show("ER 的 Labour Request");
         break;
-      case 'jobList_er':
+      case 'er/jobs':
         ToastEngine.show("ER 的 Job List");
         break;
-      case 'labReq':
+      case 'oa/lab-req':
         LabourRequestListPage.startInstance();
         break;
-      case 'jobList':
+      case 'oa/jobs':
         JobListPage.startInstance();
         break;
+      case 'oa/lab-req/review':
+        LabourReviewPage.startInstance();
+        break;
       case 'template':
         LabourTemplateListPage.startInstance();
         break;
-      case 'reqReview':
-        LabourReviewPage.startInstance();
-        break;
     }
   }
 
@@ -153,4 +146,17 @@ class MainController extends GetxController {
   void gotoSettingPage() {
     ComponentRouterServices.authService.startSettingPage();
   }
+
+  // EventBus 的事件接收
+  Subscription? subscribe;
+
+  void registerEventBus() {
+    subscribe = bus.on(AppConstant.eventMainRefresh, (arg) {
+      refreshController.callRefresh();
+    });
+  }
+
+  void unregisterEventBus() {
+    bus.off(AppConstant.eventMainRefresh, subscribe);
+  }
 }

+ 5 - 5
packages/cpt_th/lib/modules/main/main_state.dart

@@ -9,12 +9,12 @@ class MainState {
   //全部的模块
   final List<HomeModule> modules = [
     //ER类型
-    HomeModule(key: 'labReq_er', moduleName: 'Labour Request'.tr, moduleIconPath: Assets.mainHomeLabourRequest, iconWidth: 50, iconHeight: 40.3),
-    HomeModule(key: 'jobList_er', moduleName: 'Job List'.tr, moduleIconPath: Assets.mainHomeJobList, iconWidth: 45, iconHeight: 45),
+    HomeModule(key: 'er/lab-req', moduleName: 'Labour Request'.tr, moduleIconPath: Assets.mainHomeLabourRequest, iconWidth: 50, iconHeight: 40.3),
+    HomeModule(key: 'er/jobs', moduleName: 'Job List'.tr, moduleIconPath: Assets.mainHomeJobList, iconWidth: 45, iconHeight: 45),
     //OA类型
-    HomeModule(key: 'labReq', moduleName: 'Labour Request'.tr, moduleIconPath: Assets.mainHomeLabourRequest, iconWidth: 50, iconHeight: 40.3),
-    HomeModule(key: 'jobList', moduleName: 'Job List'.tr, moduleIconPath: Assets.mainHomeJobList, iconWidth: 45, iconHeight: 45),
-    HomeModule(key: 'reqReview', moduleName: 'Labour Request Review'.tr, moduleIconPath: Assets.mainHomeLabourRequestReview, iconWidth: 50.5, iconHeight: 43),
+    HomeModule(key: 'oa/lab-req', moduleName: 'Labour Request'.tr, moduleIconPath: Assets.mainHomeLabourRequest, iconWidth: 50, iconHeight: 40.3),
+    HomeModule(key: 'oa/jobs', moduleName: 'Job List'.tr, moduleIconPath: Assets.mainHomeJobList, iconWidth: 45, iconHeight: 45),
+    HomeModule(key: 'oa/lab-req/review', moduleName: 'Labour Request Review'.tr, moduleIconPath: Assets.mainHomeLabourRequestReview, iconWidth: 50.5, iconHeight: 43),
     HomeModule(key: 'template', moduleName: 'Default Job Title'.tr, moduleIconPath: Assets.mainHomeJobTemplate, iconWidth: 48.5, iconHeight: 46.5), //越南的模版
     HomeModule(key: 'jobTitle', moduleName: 'Default Job Title'.tr, moduleIconPath: Assets.mainHomeJobTemplate, iconWidth: 48.5, iconHeight: 46.5), //新加坡的模板
   ];

+ 2 - 2
packages/cpt_th/lib/router/th_router.dart

@@ -33,13 +33,13 @@ class THPageRouter {
 
     //用工请求列表
     GetPage(
-      name: RouterPath.jobLabourRequestList,
+      name: RouterPath.THLabourRequestOA,
       page: () => LabourRequestListPage(),
     ),
 
     //用工请求添加
     GetPage(
-      name: RouterPath.jobLabourRequestAdd,
+      name: RouterPath.THLabourRequestAddOA,
       page: () => LabourRequestAddPage(),
     ),
 

+ 14 - 0
packages/cs_domain/lib/constants/api_constants.dart

@@ -513,4 +513,18 @@ class ApiConstants {
   // 用户登出系统
   static const apiUserLogoutMS = "/index.php/api/v1/er/logout";
 
+// ===================================  泰国接口  ↓  ===================================
+
+  //登录
+  static const apiLoginTH = "/index.php/api/er/login";
+
+  //账户信息
+  static const apiAccountInfoTH = "/index.php/api/er/auth/info";
+
+  //账户列表
+  static const apiAccountListTH = "/index.php/api/er/auth/account";
+
+  //切换账号
+  static const apiSwitchAccountTH = "/index.php/api/er/auth/switch";
+
 }

+ 5 - 0
packages/cs_domain/lib/entity/response/hotel_info_entity.dart

@@ -31,6 +31,11 @@ class HotelInfoEntity {
 class HotelInfoMenus {
 	String? key = '';
 	String? name = '';
+	String? route = '';  //泰国的根据这个判断类型
+	@JSONField(name: "red_dot")
+	String? redDot = '';
+	bool own = false;
+
 	List<HotelInfoMenusChildren>? children = [];
 
 	HotelInfoMenus();

+ 21 - 0
packages/cs_domain/lib/generated/json/hotel_info_entity.g.dart

@@ -71,6 +71,18 @@ HotelInfoMenus $HotelInfoMenusFromJson(Map<String, dynamic> json) {
   if (name != null) {
     hotelInfoMenus.name = name;
   }
+  final String? route = jsonConvert.convert<String>(json['route']);
+  if (route != null) {
+    hotelInfoMenus.route = route;
+  }
+  final String? redDot = jsonConvert.convert<String>(json['red_dot']);
+  if (redDot != null) {
+    hotelInfoMenus.redDot = redDot;
+  }
+  final bool? own = jsonConvert.convert<bool>(json['own']);
+  if (own != null) {
+    hotelInfoMenus.own = own;
+  }
   final List<HotelInfoMenusChildren>? children = (json['children'] as List<dynamic>?)?.map(
           (e) => jsonConvert.convert<HotelInfoMenusChildren>(e) as HotelInfoMenusChildren).toList();
   if (children != null) {
@@ -83,6 +95,9 @@ Map<String, dynamic> $HotelInfoMenusToJson(HotelInfoMenus entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['key'] = entity.key;
   data['name'] = entity.name;
+  data['route'] = entity.route;
+  data['red_dot'] = entity.redDot;
+  data['own'] = entity.own;
   data['children'] = entity.children?.map((v) => v.toJson()).toList();
   return data;
 }
@@ -91,11 +106,17 @@ extension HotelInfoMenusExtension on HotelInfoMenus {
   HotelInfoMenus copyWith({
     String? key,
     String? name,
+    String? route,
+    String? redDot,
+    bool? own,
     List<HotelInfoMenusChildren>? children,
   }) {
     return HotelInfoMenus()
       ..key = key ?? this.key
       ..name = name ?? this.name
+      ..route = route ?? this.route
+      ..redDot = redDot ?? this.redDot
+      ..own = own ?? this.own
       ..children = children ?? this.children;
   }
 }

+ 23 - 22
packages/cs_domain/lib/repository/auth_repository.dart

@@ -13,12 +13,11 @@ class AuthRepository extends GetxService {
   AuthRepository({required this.httpProvider});
 
   /// 酒店登录
-  Future<HttpResult<HotelInfoEntity>> userLogin(
-    String? email,
-    String? password, {
-    int country = 1,
-    CancelToken? cancelToken,
-  }) async {
+  Future<HttpResult<HotelInfoEntity>> userLogin(String? email,
+      String? password, {
+        int country = 1,
+        CancelToken? cancelToken,
+      }) async {
     //Post请求
     Map<String, String> params = {};
     params['email'] = email ?? "";
@@ -29,8 +28,10 @@ class AuthRepository extends GetxService {
       country == 1
           ? ApiConstants.apiAuthLoginV2 //新加坡
           : country == 3
-              ? ApiConstants.apiLoginMS //马来
-              : ApiConstants.apiUserLogin,
+          ? ApiConstants.apiLoginMS //马来
+          : country == 5
+          ? ApiConstants.apiLoginTH //泰国
+          : ApiConstants.apiUserLogin,
       //通用
       params: params,
       networkDebounce: true,
@@ -70,12 +71,11 @@ class AuthRepository extends GetxService {
   }
 
   /// 修改密码
-  Future<HttpResult> resetPassword(
-    String? oldPassword,
-    String? password,
-    String? confirmPassword, {
-    CancelToken? cancelToken,
-  }) async {
+  Future<HttpResult> resetPassword(String? oldPassword,
+      String? password,
+      String? confirmPassword, {
+        CancelToken? cancelToken,
+      }) async {
     Map<String, String> params = {};
     params['old_password'] = oldPassword ?? "";
     params['password'] = password ?? "";
@@ -104,8 +104,10 @@ class AuthRepository extends GetxService {
       country == 1
           ? ApiConstants.apiHotelInfoV2 //新加坡
           : country == 3
-              ? ApiConstants.apiAccountInfoMS //马来
-              : ApiConstants.apiHotelInfo,
+          ? ApiConstants.apiAccountInfoMS //马来
+          : country == 5
+          ? ApiConstants.apiAccountInfoTH //泰国
+          : ApiConstants.apiHotelInfo,
       method: HttpMethod.GET,
       networkDebounce: true,
     );
@@ -122,12 +124,11 @@ class AuthRepository extends GetxService {
   }
 
   /// 酒店用户注册
-  Future<HttpResult> hotelRegister(
-    String? email,
-    String? password,
-    String? confirmPassword, {
-    CancelToken? cancelToken,
-  }) async {
+  Future<HttpResult> hotelRegister(String? email,
+      String? password,
+      String? confirmPassword, {
+        CancelToken? cancelToken,
+      }) async {
     //参数
     Map<String, String> params = {};
     params['email'] = email ?? "";

+ 8 - 2
packages/cs_domain/lib/repository/ms_repository.dart

@@ -86,10 +86,13 @@ class MSRepository extends GetxService {
 
   /// 可以切换的Project列表
   Future<HttpResult<SwitchProjectEntity>> fetchSwitchProjectList({
+    required int country,
     CancelToken? cancelToken,
   }) async {
     final result = await httpProvider.requestNetResult(
-      ApiConstants.apiAccountListMS,
+      country == 5
+          ? ApiConstants.apiAccountListTH //泰国
+          : ApiConstants.apiAccountListMS, //默认马来
       isShowLoadingDialog: true,
       networkDebounce: true,
       cancelToken: cancelToken,
@@ -106,6 +109,7 @@ class MSRepository extends GetxService {
   /// 切换项目
   Future<HttpResult<HotelInfoEntity>> switchProjectSubmit(
     String? adminId, {
+    required int country,
     CancelToken? cancelToken,
   }) async {
     //参数
@@ -113,7 +117,9 @@ class MSRepository extends GetxService {
     params['admin_id'] = adminId ?? "";
 
     final result = await httpProvider.requestNetResult(
-      ApiConstants.apiSwitchAccountMS,
+      country == 5
+          ? ApiConstants.apiSwitchAccountTH //泰国
+          : ApiConstants.apiSwitchAccountMS, //默认马来
       method: HttpMethod.POST,
       params: params,
       networkDebounce: true,

+ 3 - 1
packages/cs_router/lib/path/router_path.dart

@@ -146,7 +146,9 @@ class RouterPath {
   static const NLJobSignInSignOut = '/nl/sign_in/sign_out';   //荷兰的签到签出页面
 
   // ===================================  TH泰国  ↓  ===================================
-  static const THMain = '/th/main';   //荷兰的首页
+  static const THMain = '/th/main';   //泰国的首页
+  static const THLabourRequestOA = '/th/labour/request/oa';  //泰国的用工请求页面
+  static const THLabourRequestAddOA = '/th/labour/request/add/oa';  //泰国的用工请求添加
 
   //Runalone
   static const runAloneMain = '/runalone/main'; //独立运行的入口页面