Browse Source

工作的编辑与批量操作的弹窗

liukai 7 months ago
parent
commit
09c2ca13b0

+ 2 - 4
packages/cpt_job_sg/lib/modules/job_applied/applied_staff_item.dart

@@ -5,8 +5,6 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:plugin_basic/basic_export.dart';
-import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
-import 'package:shared/utils/util.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
@@ -99,7 +97,7 @@ class AppliedStaffItem extends StatelessWidget {
             crossAxisAlignment: CrossAxisAlignment.center,
             children: [
               MyTextView(
-                "NRIC".tr + ":",
+                "Nric".tr + ":",
                 isFontRegular: true,
                 textColor: ColorConstants.textGrayAECAE5,
                 fontSize: 14,
@@ -281,7 +279,7 @@ class AppliedStaffItem extends StatelessWidget {
 
               //小时
               MyTextView(
-                item.adjustHours.toString(),
+                item.adjustHours ?? "",
                 marginLeft: 5,
                 isFontRegular: true,
                 textColor: Colors.white,

+ 350 - 0
packages/cpt_job_sg/lib/modules/job_applied/dialog_applied_butch_modify.dart

@@ -0,0 +1,350 @@
+import 'dart:typed_data';
+import 'dart:ui';
+
+import 'package:cs_resources/generated/assets.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:get/get.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:shared/utils/date_time_utils.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:cs_resources/constants/color_constants.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_field.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/picker/date_picker_util.dart';
+import 'package:widgets/picker/option_pick_util.dart';
+import 'package:widgets/shatter/form_require_text.dart';
+import 'package:widgets/widget_export.dart';
+
+/**
+ * 批量操作修改时间的弹窗
+ */
+class DialogAppliedButchModify extends StatefulWidget {
+  DateTime? selectedStartDate;
+  DateTime? selectedEndDate;
+  void Function(DateTime? startTime, DateTime? endTime, String? subtractHour, String? statusId)? confirmAction;
+
+  DialogAppliedButchModify({this.selectedStartDate, this.selectedEndDate, this.confirmAction});
+
+  @override
+  State<DialogAppliedButchModify> createState() => _DialogAppliedButchModifyState();
+}
+
+class _DialogAppliedButchModifyState extends State<DialogAppliedButchModify> {
+  DateTime? selectedStartDate;
+  DateTime? selectedEndDate;
+  String? chooseStatusId;
+  String? chooseStatusTxt;
+  late TextEditingController hourController;
+  late FocusNode hourFocusNode;
+  List<String> statusIdList = ["1", "6"];
+  List<String> statusTxtList = ["Applied", "No Show"];
+
+  @override
+  void initState() {
+    super.initState();
+    selectedStartDate = widget.selectedStartDate;
+    selectedEndDate = widget.selectedEndDate;
+    hourController = TextEditingController();
+    hourFocusNode = FocusNode();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Column(
+      crossAxisAlignment: CrossAxisAlignment.center,
+      mainAxisAlignment: MainAxisAlignment.center,
+      children: [
+        //Title (如果使用 Container 为最外层容器则默认为 match_parent 的效果,除非我们限制宽度和最大高度最小高度)
+        Container(
+          padding: EdgeInsets.symmetric(horizontal: 16.5),
+          width: double.infinity,
+          decoration: BoxDecoration(
+            color: Colors.white,
+            borderRadius: const BorderRadius.all(Radius.circular(15)),
+          ),
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            children: [
+              Center(
+                child: MyTextView(
+                  "Batch Modify".tr,
+                  fontSize: 19,
+                  isFontMedium: true,
+                  textColor: ColorConstants.black,
+                  marginTop: 22,
+                  marginBottom: 20,
+                ),
+              ),
+
+              MyTextView(
+                "Job Start Time".tr,
+                fontSize: 14,
+                textColor: ColorConstants.black33,
+                isFontRegular: true,
+              ),
+
+              //选择时间
+              Container(
+                padding: EdgeInsets.only(left: 16, right: 10),
+                margin: EdgeInsets.only(top: 10),
+                height: 45,
+                decoration: BoxDecoration(
+                  color: ColorConstants.grayECECEC,
+                  borderRadius: const BorderRadius.all(Radius.circular(5)),
+                ),
+                child: Row(
+                  mainAxisSize: MainAxisSize.max,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  children: [
+                    MyTextView(
+                      selectedStartDate == null ? "" : DateTimeUtils.formatDate(selectedStartDate),
+                      fontSize: 14,
+                      hint: "Choose Start Date".tr,
+                      textHintColor: ColorConstants.textBlackHint,
+                      isFontMedium: true,
+                      textColor: ColorConstants.black33,
+                    ).expanded(),
+                    MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                  ],
+                ),
+              ).onTap(() {
+                pickerStartDate();
+              }),
+
+              //结束日期
+              MyTextView(
+                "Job End Time".tr,
+                fontSize: 14,
+                marginTop: 11,
+                textColor: ColorConstants.black33,
+                isFontRegular: true,
+              ),
+
+              //选择结束日期
+              Container(
+                padding: EdgeInsets.only(left: 16, right: 10),
+                margin: EdgeInsets.only(top: 10),
+                height: 45,
+                decoration: BoxDecoration(
+                  color: ColorConstants.grayECECEC,
+                  borderRadius: const BorderRadius.all(Radius.circular(5)),
+                ),
+                child: Row(
+                  mainAxisSize: MainAxisSize.max,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  children: [
+                    MyTextView(
+                      selectedEndDate == null ? "" : DateTimeUtils.formatDate(selectedEndDate),
+                      fontSize: 14,
+                      hint: "Choose End Date".tr,
+                      textHintColor: ColorConstants.textBlackHint,
+                      isFontMedium: true,
+                      textColor: ColorConstants.black33,
+                    ).expanded(),
+                    MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                  ],
+                ),
+              ).onTap(() {
+                pickerEndDate();
+              }),
+
+              // + / - 小时
+              MyTextView(
+                "Subtract Hours".tr,
+                fontSize: 14,
+                marginTop: 11,
+                textColor: ColorConstants.black33,
+                isFontRegular: true,
+              ),
+
+              // 加减小时的输入框
+              IgnoreKeyboardDismiss(
+                child: MyTextField(
+                  "hour",
+                  "",
+                  hintText: "Enter...".tr,
+                  hintStyle: TextStyle(
+                    color: ColorConstants.gray88,
+                    fontSize: 14,
+                    fontWeight: FontWeight.w400,
+                  ),
+                  controller: hourController,
+                  focusNode: hourFocusNode,
+                  margin: EdgeInsets.only(left: 0, right: 0, top: 8),
+                  showDivider: false,
+                  fillBackgroundColor: ColorConstants.grayECECEC,
+                  fillCornerRadius: 5,
+                  padding: EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 0),
+                  height: 40,
+                  style: TextStyle(
+                    color: ColorConstants.black33,
+                    fontSize: 14,
+                    fontWeight: FontWeight.w400,
+                  ),
+                  inputType: TextInputType.numberWithOptions(signed: false, decimal: true),
+                  textInputAction: TextInputAction.next,
+                  enabled: true,
+                  onSubmit: (key, value) {},
+                  cursorColor: ColorConstants.black33,
+                  showLeftIcon: false,
+                  showRightIcon: false,
+                ),
+              ),
+
+              // 修改状态
+              MyTextView(
+                "Status".tr,
+                fontSize: 14,
+                marginTop: 11,
+                textColor: ColorConstants.black33,
+                isFontRegular: true,
+              ),
+
+              Container(
+                padding: EdgeInsets.only(left: 16, right: 10),
+                margin: EdgeInsets.only(top: 10),
+                height: 45,
+                decoration: BoxDecoration(
+                  color: ColorConstants.grayECECEC,
+                  borderRadius: const BorderRadius.all(Radius.circular(5)),
+                ),
+                child: Row(
+                  mainAxisSize: MainAxisSize.max,
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  children: [
+                    MyTextView(
+                      chooseStatusTxt ?? "",
+                      fontSize: 14,
+                      hint: "Choose Status".tr,
+                      textHintColor: ColorConstants.textBlackHint,
+                      isFontMedium: true,
+                      textColor: ColorConstants.black33,
+                    ).expanded(),
+                    MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                  ],
+                ),
+              ).onTap(() {
+                pickerStatus();
+              }),
+
+              //分割线
+              Container(
+                margin: EdgeInsets.only(top: 25),
+                color: Color(0XFFCECECE),
+                height: 0.5,
+              ),
+              Row(
+                children: [
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () {
+                          onCancel();
+                        },
+                        child: MyTextView(
+                          "Cancel".tr,
+                          fontSize: 17.5,
+                          isFontMedium: true,
+                          textAlign: TextAlign.center,
+                          textColor: Color(0XFF0085C4),
+                          cornerRadius: 3,
+                          borderWidth: 1,
+                        ),
+                      )),
+                  Container(
+                    color: Color(0xff09141F).withOpacity(0.13),
+                    width: 0.5,
+                  ),
+                  Expanded(
+                      flex: 1,
+                      child: InkWell(
+                        onTap: () async {
+                          String hour = hourController.text;
+                          widget.confirmAction?.call(selectedStartDate, selectedEndDate, hour, chooseStatusId);
+                          onCancel();
+                        },
+                        child: MyTextView(
+                          "Submit".tr,
+                          marginLeft: 10,
+                          fontSize: 17.5,
+                          isFontMedium: true,
+                          textAlign: TextAlign.center,
+                          textColor: Color(0XFF0085C4),
+                          cornerRadius: 3,
+                        ),
+                      )),
+                ],
+              ).constrained(height: 46),
+            ],
+          ),
+        ),
+      ],
+    ).constrained(width: 285);
+  }
+
+  /// 筛选开始日期
+  void pickerStartDate() {
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: selectedStartDate,
+      mode: CupertinoDatePickerMode.time,
+      onDateTimeChanged: (date) {
+        setState(() {
+          selectedStartDate = date;
+        });
+      },
+      title: "Start Date".tr,
+    );
+  }
+
+  /// 筛选结束日期
+  void pickerEndDate() {
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: selectedEndDate ?? selectedStartDate,
+      mode: CupertinoDatePickerMode.time,
+      onDateTimeChanged: (date) {
+        setState(() {
+          selectedEndDate = date;
+        });
+      },
+      title: "End Date".tr,
+    );
+  }
+
+  //取消弹框
+  void onCancel() async {
+    SmartDialog.dismiss();
+  }
+
+  /// 筛选状态
+  void pickerStatus() {
+    int selectedIndex;
+    if (chooseStatusId == null) {
+      selectedIndex = 0;
+    } else {
+      selectedIndex = statusIdList.indexWhere((e) => e == chooseStatusId);
+    }
+
+    if (selectedIndex < 0) {
+      selectedIndex = 0;
+    }
+
+    OptionPickerUtil.showCupertinoOptionPicker(
+      items: statusTxtList,
+      initialSelectIndex: selectedIndex,
+      onPickerChanged: (_, index) {
+        chooseStatusId = statusIdList[index];
+
+        setState(() {
+          chooseStatusTxt = statusTxtList[index];
+        });
+      },
+    );
+  }
+}

+ 530 - 0
packages/cpt_job_sg/lib/modules/job_applied/dialog_applied_modify.dart

@@ -0,0 +1,530 @@
+import 'dart:typed_data';
+import 'dart:ui';
+
+import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/response/job_applied_edit_index_s_g_entity.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
+import 'package:get/get.dart';
+import 'package:shared/utils/date_time_utils.dart';
+import 'package:shared/utils/util.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:cs_resources/constants/color_constants.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_field.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/picker/date_picker_util.dart';
+import 'package:widgets/shatter/custom_radio_check.dart';
+import 'package:widgets/widget_export.dart';
+
+/**
+ * 修改员工的信息的弹窗
+ */
+class DialogAppliedModify extends StatefulWidget {
+  JobAppliedEditIndexSGEntity? editIndexOption;
+
+  void Function(JobAppliedEditIndexSGEntity? entity)? confirmAction;
+
+  DialogAppliedModify({this.editIndexOption, this.confirmAction});
+
+  @override
+  State<DialogAppliedModify> createState() => _DialogAppliedModifyState();
+}
+
+class _DialogAppliedModifyState extends State<DialogAppliedModify> {
+  JobAppliedEditIndexSGEntity? editIndexOption;
+  late TextEditingController hourController;
+  late FocusNode hourFocusNode;
+
+  @override
+  void initState() {
+    super.initState();
+    editIndexOption = widget.editIndexOption;
+    hourController = TextEditingController();
+    if (Utils.isNotEmpty(editIndexOption?.adjustHours) && editIndexOption?.adjustHours != "0.00") {
+      hourController.text = editIndexOption!.adjustHours!;
+    }
+    hourFocusNode = FocusNode();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return Container(
+      padding: EdgeInsets.symmetric(horizontal: 16.5),
+      width: 285,
+      height: 510,
+      decoration: BoxDecoration(
+        color: Colors.white,
+        borderRadius: const BorderRadius.all(Radius.circular(15)),
+      ),
+      child: Column(
+        crossAxisAlignment: CrossAxisAlignment.start,
+        mainAxisSize: MainAxisSize.max,
+        children: [
+          Center(
+            // 标题
+            child: MyTextView(
+              "Modify".tr,
+              fontSize: 19,
+              isFontMedium: true,
+              textColor: ColorConstants.black,
+              marginTop: 22,
+              marginBottom: 20,
+            ),
+          ),
+
+          SingleChildScrollView(
+            scrollDirection: Axis.vertical,
+            physics: const BouncingScrollPhysics(),
+            child: Column(
+              crossAxisAlignment: CrossAxisAlignment.start,
+              children: [
+                MyTextView(
+                  "Job Start Time".tr,
+                  fontSize: 14,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //选择时间
+                Container(
+                  padding: EdgeInsets.only(left: 16, right: 10),
+                  margin: EdgeInsets.only(top: 10),
+                  height: 45,
+                  decoration: BoxDecoration(
+                    color: ColorConstants.grayECECEC,
+                    borderRadius: const BorderRadius.all(Radius.circular(5)),
+                  ),
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.start,
+                    children: [
+                      MyTextView(
+                        editIndexOption == null ? "" : editIndexOption?.startTime ?? "",
+                        fontSize: 14,
+                        hint: "Choose Start Date".tr,
+                        textHintColor: ColorConstants.textBlackHint,
+                        isFontMedium: true,
+                        textColor: ColorConstants.black33,
+                      ).expanded(),
+                      MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                    ],
+                  ),
+                ).onTap(() {
+                  pickerStartDate();
+                }),
+
+                // 门卫签到
+                MyTextView(
+                  "Security Clock In".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //选择结束日期
+                Container(
+                  padding: EdgeInsets.only(left: 16, right: 10),
+                  margin: EdgeInsets.only(top: 10),
+                  height: 45,
+                  decoration: BoxDecoration(
+                    color: ColorConstants.grayECECEC,
+                    borderRadius: const BorderRadius.all(Radius.circular(5)),
+                  ),
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.start,
+                    children: [
+                      MyTextView(
+                        editIndexOption == null ? "" : editIndexOption?.securityIn ?? "",
+                        fontSize: 14,
+                        hint: "Choose Date".tr,
+                        textHintColor: ColorConstants.textBlackHint,
+                        isFontMedium: true,
+                        textColor: ColorConstants.black33,
+                      ).expanded(),
+                      MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                    ],
+                  ),
+                ).onTap(() {
+                  pickerSecurityIn();
+                }),
+
+                // 工作地签到
+                MyTextView(
+                  "Work Clock In".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //选择结束日期
+                Container(
+                  padding: EdgeInsets.only(left: 16, right: 10),
+                  margin: EdgeInsets.only(top: 10),
+                  height: 45,
+                  decoration: BoxDecoration(
+                    color: ColorConstants.grayECECEC,
+                    borderRadius: const BorderRadius.all(Radius.circular(5)),
+                  ),
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.start,
+                    children: [
+                      MyTextView(
+                        editIndexOption == null ? "" : editIndexOption?.workIn ?? "",
+                        fontSize: 14,
+                        hint: "Choose Date".tr,
+                        textHintColor: ColorConstants.textBlackHint,
+                        isFontMedium: true,
+                        textColor: ColorConstants.black33,
+                      ).expanded(),
+                      MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                    ],
+                  ),
+                ).onTap(() {
+                  pickerWorkIn();
+                }),
+
+                MyTextView(
+                  "Job End Time".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //选择结束日期
+                Container(
+                  padding: EdgeInsets.only(left: 16, right: 10),
+                  margin: EdgeInsets.only(top: 10),
+                  height: 45,
+                  decoration: BoxDecoration(
+                    color: ColorConstants.grayECECEC,
+                    borderRadius: const BorderRadius.all(Radius.circular(5)),
+                  ),
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.start,
+                    children: [
+                      MyTextView(
+                        editIndexOption == null ? "" : editIndexOption?.endTime ?? "",
+                        fontSize: 14,
+                        hint: "Choose End Date".tr,
+                        textHintColor: ColorConstants.textBlackHint,
+                        isFontMedium: true,
+                        textColor: ColorConstants.black33,
+                      ).expanded(),
+                      MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                    ],
+                  ),
+                ).onTap(() {
+                  pickerEndDate();
+                }),
+
+                // 工作地签出
+                MyTextView(
+                  "Work Clock Out".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //选择结束日期
+                Container(
+                  padding: EdgeInsets.only(left: 16, right: 10),
+                  margin: EdgeInsets.only(top: 10),
+                  height: 45,
+                  decoration: BoxDecoration(
+                    color: ColorConstants.grayECECEC,
+                    borderRadius: const BorderRadius.all(Radius.circular(5)),
+                  ),
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.start,
+                    children: [
+                      MyTextView(
+                        editIndexOption == null ? "" : editIndexOption?.workOut ?? "",
+                        fontSize: 14,
+                        hint: "Choose Date".tr,
+                        textHintColor: ColorConstants.textBlackHint,
+                        isFontMedium: true,
+                        textColor: ColorConstants.black33,
+                      ).expanded(),
+                      MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                    ],
+                  ),
+                ).onTap(() {
+                  pickerWorkOut();
+                }),
+
+                // 门卫签出
+                MyTextView(
+                  "Security Clock Out".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //选择结束日期
+                Container(
+                  padding: EdgeInsets.only(left: 16, right: 10),
+                  margin: EdgeInsets.only(top: 10),
+                  height: 45,
+                  decoration: BoxDecoration(
+                    color: ColorConstants.grayECECEC,
+                    borderRadius: const BorderRadius.all(Radius.circular(5)),
+                  ),
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    mainAxisAlignment: MainAxisAlignment.start,
+                    children: [
+                      MyTextView(
+                        editIndexOption == null ? "" : editIndexOption?.securityOut ?? "",
+                        fontSize: 14,
+                        hint: "Choose Date".tr,
+                        textHintColor: ColorConstants.textBlackHint,
+                        isFontMedium: true,
+                        textColor: ColorConstants.black33,
+                      ).expanded(),
+                      MyAssetImage(Assets.baseServiceTriangleDropDownIcon, width: 11.5, height: 6.28),
+                    ],
+                  ),
+                ).onTap(() {
+                  pickerSecurityOut();
+                }),
+
+                // + / - 小时
+                MyTextView(
+                  "+/- Hours".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                // 加减小时的输入框
+                IgnoreKeyboardDismiss(
+                  child: MyTextField(
+                    "hour",
+                    Utils.isNotEmpty(editIndexOption?.adjustHours) && editIndexOption?.adjustHours != "0.00" ? editIndexOption!.adjustHours! : "",
+                    hintText: "Enter...".tr,
+                    hintStyle: TextStyle(
+                      color: ColorConstants.gray88,
+                      fontSize: 14,
+                      fontWeight: FontWeight.w400,
+                    ),
+                    controller: hourController,
+                    focusNode: hourFocusNode,
+                    margin: EdgeInsets.only(left: 0, right: 0, top: 8),
+                    showDivider: false,
+                    fillBackgroundColor: ColorConstants.grayECECEC,
+                    fillCornerRadius: 5,
+                    padding: EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 0),
+                    height: 40,
+                    style: TextStyle(
+                      color: ColorConstants.black33,
+                      fontSize: 14,
+                      fontWeight: FontWeight.w400,
+                    ),
+                    inputType: TextInputType.numberWithOptions(signed: true,decimal: true),
+                    textInputAction: TextInputAction.next,
+                    enabled: true,
+                    onSubmit: (key, value) {},
+                    cursorColor: ColorConstants.black33,
+                    showLeftIcon: false,
+                    showRightIcon: false,
+                  ),
+                ),
+
+                //状态的选择
+                MyTextView(
+                  "Status".tr,
+                  fontSize: 14,
+                  marginTop: 11,
+                  textColor: ColorConstants.black33,
+                  isFontRegular: true,
+                ),
+
+                //状态单选
+                CustomRadioCheck(
+                  options: editIndexOption?.statusList?.map((e) => e.txt!).toList() ?? [],
+                  onOptionSelected: (index, text) {
+                    editIndexOption?.status = editIndexOption?.statusList?[index].value ?? 0;
+                  },
+                  textColor: ColorConstants.black33,
+                  selectedPosition: editIndexOption?.statusList?.indexWhere((e) => e.checked == "checked") ?? -1,
+                ).marginOnly(left: 15, right: 15, top: 10),
+              ],
+            ),
+          ).expanded(),
+
+          //分割线
+          Container(
+            margin: EdgeInsets.only(top: 25),
+            color: Color(0XFFCECECE),
+            height: 0.5,
+          ),
+          Row(
+            children: [
+              Expanded(
+                  flex: 1,
+                  child: InkWell(
+                    onTap: () {
+                      onCancel();
+                    },
+                    child: MyTextView(
+                      "Cancel".tr,
+                      fontSize: 17.5,
+                      isFontMedium: true,
+                      textAlign: TextAlign.center,
+                      textColor: Color(0XFF0085C4),
+                      cornerRadius: 3,
+                      borderWidth: 1,
+                    ),
+                  )),
+              Container(
+                color: Color(0xff09141F).withOpacity(0.13),
+                width: 0.5,
+              ),
+              Expanded(
+                  flex: 1,
+                  child: InkWell(
+                    onTap: () async {
+                      //输入框需要手动赋值
+                      String hour = hourController.text;
+                      editIndexOption?.adjustHours = hour;
+
+                      widget.confirmAction?.call(editIndexOption);
+                      onCancel();
+                    },
+                    child: MyTextView(
+                      "Submit".tr,
+                      marginLeft: 10,
+                      fontSize: 17.5,
+                      isFontMedium: true,
+                      textAlign: TextAlign.center,
+                      textColor: Color(0XFF0085C4),
+                      cornerRadius: 3,
+                    ),
+                  )),
+            ],
+          ).constrained(height: 46),
+        ],
+      ),
+    );
+  }
+
+  //取消弹框
+  void onCancel() async {
+    SmartDialog.dismiss();
+  }
+
+  /// 筛选开始日期
+  void pickerStartDate() {
+    if (editIndexOption == null) return;
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: DateTimeUtils.getDateTime(editIndexOption!.startTime ?? ""),
+      mode: CupertinoDatePickerMode.time,
+      onDateTimeChanged: (date) {
+        setState(() {
+          editIndexOption?.startTime = DateTimeUtils.formatDate(date);
+        });
+      },
+      title: "Start Date".tr,
+    );
+  }
+
+  /// 筛选结束日期
+  void pickerEndDate() {
+    if (editIndexOption == null) return;
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: DateTimeUtils.getDateTime(editIndexOption!.endTime ?? ""),
+      mode: CupertinoDatePickerMode.time,
+      onDateTimeChanged: (date) {
+        setState(() {
+          editIndexOption?.endTime = DateTimeUtils.formatDate(date);
+        });
+      },
+      title: "End Date".tr,
+    );
+  }
+
+  /// 选择门卫签到
+  void pickerSecurityIn() {
+    if (editIndexOption == null) return;
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: DateTimeUtils.getDateTime(editIndexOption!.securityIn ?? ""),
+      mode: CupertinoDatePickerMode.dateAndTime,
+      onDateTimeChanged: (date) {
+        setState(() {
+          editIndexOption?.securityIn = DateTimeUtils.formatDate(date);
+        });
+      },
+      title: "Security Clock In".tr,
+    );
+  }
+
+  /// 选择工作地签到
+  void pickerWorkIn() {
+    if (editIndexOption == null) return;
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: DateTimeUtils.getDateTime(editIndexOption!.workIn ?? ""),
+      mode: CupertinoDatePickerMode.dateAndTime,
+      onDateTimeChanged: (date) {
+        setState(() {
+          editIndexOption?.workIn = DateTimeUtils.formatDate(date);
+        });
+      },
+      title: "Work Clock In".tr,
+    );
+  }
+
+  /// 选择工作地签出
+  void pickerWorkOut() {
+    if (editIndexOption == null) return;
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: DateTimeUtils.getDateTime(editIndexOption!.workOut ?? ""),
+      mode: CupertinoDatePickerMode.dateAndTime,
+      onDateTimeChanged: (date) {
+        setState(() {
+          editIndexOption?.workOut = DateTimeUtils.formatDate(date);
+        });
+      },
+      title: "Work Clock Out".tr,
+    );
+  }
+
+  /// 选择门卫签出
+  void pickerSecurityOut() {
+    if (editIndexOption == null) return;
+
+    DatePickerUtil.showCupertinoDatePicker(
+      selectedDateTime: DateTimeUtils.getDateTime(editIndexOption!.securityOut ?? ""),
+      mode: CupertinoDatePickerMode.dateAndTime,
+      onDateTimeChanged: (date) {
+        setState(() {
+          editIndexOption?.securityOut = DateTimeUtils.formatDate(date);
+        });
+      },
+      title: "Security Clock Out".tr,
+    );
+  }
+}

+ 87 - 63
packages/cpt_job_sg/lib/modules/job_applied/job_applied_controller.dart

@@ -1,4 +1,5 @@
 import 'package:cpt_job_sg/modules/applied_staff/applied_staff_page.dart';
+import 'package:domain/entity/response/job_applied_edit_index_s_g_entity.dart';
 import 'package:domain/entity/response/job_applied_list_s_g_entity.dart';
 import 'package:domain/repository/job_sg_repository.dart';
 import 'package:domain/repository/labour_sg_repository.dart';
@@ -12,7 +13,9 @@ 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:router/componentRouter/component_router_service.dart';
+import 'package:shared/utils/date_time_utils.dart';
 import 'package:shared/utils/event_bus.dart';
+import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/util.dart';
 import 'package:widgets/dialog/app_default_dialog.dart';
 import 'package:widgets/load_state_layout.dart';
@@ -20,6 +23,8 @@ import 'package:widgets/picker/option_pick_util.dart';
 import 'package:widgets/widget_export.dart';
 
 import 'applied_staff_reviews.dart';
+import 'dialog_applied_butch_modify.dart';
+import 'dialog_applied_modify.dart';
 import 'drop_down_status.dart';
 import 'job_applied_state.dart';
 
@@ -197,37 +202,55 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
     AppliedStaffPage.startInstance(state.jobId);
   }
 
-  //调用接口添加员工
-  void _requestAddStaff2Applied(String selectedIds) async {
-    // var result = await _jobRepository.addStaff2Job(state.jobId, selectedIds, cancelToken: cancelToken);
-    //
-    // if (result.isSuccess) {
-    //   var addStaffEntity = result.data;
-    //   List<String> filteredMessages = [];
-    //   if (addStaffEntity != null && addStaffEntity.resultList?.isNotEmpty == true) {
-    //     filteredMessages = addStaffEntity.resultList!
-    //         .where((resultList) => resultList.result == false && Utils.isNotEmpty(resultList.msg))
-    //         .map((resultList) => '${resultList.name} : ${resultList.msg!}')
-    //         .toList();
-    //   }
-    //
-    //   if (filteredMessages.isNotEmpty) {
-    //     //有错误信息
-    //     NotifyEngine.showFailure(filteredMessages.join(" , "));
-    //   } else {
-    //     //无错误信息
-    //     NotifyEngine.showSuccess("Successful".tr);
-    //     //添加成功之后刷新页面
-    //     refreshController.callRefresh();
-    //   }
-    // } else {
-    //   ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
-    //   return;
-    // }
+  /// 展示编辑员工信息的弹窗
+  void showAppliedEditDialog(JobAppliedListSGRows data) async {
+    var result = await _jobRepository.fetchEditJobAppliedIndex(data.appliedId.toString());
+
+    if (result.isSuccess) {
+      //接口数据获取成功,展示弹窗
+      DialogEngine.show(
+        widget: DialogAppliedModify(
+          editIndexOption: result.data!,
+          confirmAction: (entity) {
+            if (entity != null) {
+              _requestSubmitEditApplied(entity);
+            }
+          },
+        ),
+      );
+    } else {
+      ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
+      return;
+    }
   }
 
-  /// 去编辑员工信息的弹窗
-  void showAppliedEditDialog(JobAppliedListSGRows data) {}
+  // 提交编辑的接口
+  void _requestSubmitEditApplied(JobAppliedEditIndexSGEntity entity) async {
+    Log.d("选中的数据为:${entity.toString()}");
+
+    var result = await _jobRepository.submitEditJobApplied(
+      entity.appliedId,
+      DateTimeUtils.formatDateStr(entity.startTime ?? "", format: "HH:mm:ss"),
+      DateTimeUtils.formatDateStr(entity.endTime ?? "", format: "HH:mm:ss"),
+      entity.securityIn,
+      entity.securityOut,
+      entity.workIn,
+      entity.workOut,
+      entity.adjustHours,
+      entity.status == 0 ? "" : entity.status.toString(),
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      NotifyEngine.showSuccess("Successful".tr);
+
+      //调用接口刷新指定的Staff的信息
+      fetchItemByIdAndRefreshItem(entity.appliedId);
+    } else {
+      ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
+      return;
+    }
+  }
 
   /// 展示评论的弹窗
   void showRemarkDialog(JobAppliedListSGRows data) async {
@@ -278,44 +301,45 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
   /// 批量修改的弹窗
   void showBatchModifyDialog() async {
     if (state.appliedIndexEntity == null) return;
-    //找出已经选中的员工(只有状态为3 Approve的状态才能修改)
-    // var selectedList = state.datas.where((element) => element.isSelected && element.status == 3).toList(growable: false);
-    // if (selectedList.isNotEmpty) {
-    //   var ids = selectedList.map((e) => e.appliedId.toString()).toList(growable: false);
-    //   var separatedIds = ids.join(',');
-    //
-    //   DialogEngine.show(
-    //       widget: AppliedButchModify(
-    //           selectedStartDate: DateTimeUtils.getDateTime(state.jobInfo?.startTime ?? ""),
-    //           selectedEndDate: DateTimeUtils.getDateTime(state.jobInfo?.endTime ?? ""),
-    //           confirmAction: (start, end) {
-    //             _requestBatchModify(start, end, separatedIds);
-    //           }));
-    // } else {
-    //   ToastEngine.show("Please select the applied record".tr);
-    // }
+    //找出已经选中的员工
+    var selectedList = state.datas.where((element) => element.isSelected).toList(growable: false);
+    if (selectedList.isNotEmpty) {
+      var ids = selectedList.map((e) => e.appliedId.toString()).toList(growable: false);
+      var separatedIds = ids.join(',');
+
+      DialogEngine.show(
+          widget: DialogAppliedButchModify(
+              selectedStartDate: null,
+              selectedEndDate: null,
+              confirmAction: (start, end, hour, status) {
+                _requestBatchModify(start, end, hour, status, separatedIds);
+              }));
+    } else {
+      ToastEngine.show("Please select the applied record".tr);
+    }
   }
 
   /// 执行批量修改的请求
-  void _requestBatchModify(DateTime start, DateTime end, String separatedIds) async {
+  void _requestBatchModify(DateTime? start, DateTime? end, String? hour, String? status, String separatedIds) async {
     //执行请求
-    // var result = await _jobRepository.batchEditStaffCheckTime(
-    //   state.jobId,
-    //   separatedIds,
-    //   DateTimeUtils.formatDate(start),
-    //   DateTimeUtils.formatDate(end),
-    //   cancelToken: cancelToken,
-    // );
-    //
-    // if (result.isSuccess) {
-    //   NotifyEngine.showSuccess("Successful".tr);
-    //
-    //   //调用接口刷新指定的Staff的信息
-    //   fetchItemByIdAndRefreshItem(separatedIds);
-    // } else {
-    //   ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
-    //   return;
-    // }
+    var result = await _jobRepository.batchEditJobApplied(
+      separatedIds,
+      start == null ? "" : DateTimeUtils.formatDate(start, format: "HH:mm:ss"),
+      end == null ? "" : DateTimeUtils.formatDate(end, format: "HH:mm:ss"),
+      hour,
+      status,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      NotifyEngine.showSuccess("Successful".tr);
+
+      //调用接口刷新指定的Staff的信息
+      fetchItemByIdAndRefreshItem(separatedIds);
+    } else {
+      ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
+      return;
+    }
   }
 
   /// 根据ID获取Item对象,用于刷新

+ 1 - 1
packages/cs_domain/lib/entity/response/job_applied_edit_index_s_g_entity.dart

@@ -39,7 +39,7 @@ class JobAppliedEditIndexSGEntity {
 
 @JsonSerializable()
 class JobAppliedEditIndexSGStatusList {
-	String? value = null;
+	int value = 0;
 	String? txt = null;
 	String? checked = null;
 

+ 1 - 1
packages/cs_domain/lib/entity/response/job_applied_list_s_g_entity.dart

@@ -42,7 +42,7 @@ class JobAppliedListSGRows {
 	@JSONField(name: "end_time")
 	String? endTime = null;
 	@JSONField(name: "adjust_hours")
-	int adjustHours = 0;
+	String? adjustHours = null;
 	@JSONField(name: "total_hours")
 	String? totalHours = null;
 	int status = 0;

+ 2 - 2
packages/cs_domain/lib/generated/json/job_applied_edit_index_s_g_entity.g.dart

@@ -91,7 +91,7 @@ extension JobAppliedEditIndexSGEntityExtension on JobAppliedEditIndexSGEntity {
 
 JobAppliedEditIndexSGStatusList $JobAppliedEditIndexSGStatusListFromJson(Map<String, dynamic> json) {
   final JobAppliedEditIndexSGStatusList jobAppliedEditIndexSGStatusList = JobAppliedEditIndexSGStatusList();
-  final String? value = jsonConvert.convert<String>(json['value']);
+  final int? value = jsonConvert.convert<int>(json['value']);
   if (value != null) {
     jobAppliedEditIndexSGStatusList.value = value;
   }
@@ -116,7 +116,7 @@ Map<String, dynamic> $JobAppliedEditIndexSGStatusListToJson(JobAppliedEditIndexS
 
 extension JobAppliedEditIndexSGStatusListExtension on JobAppliedEditIndexSGStatusList {
   JobAppliedEditIndexSGStatusList copyWith({
-    String? value,
+    int? value,
     String? txt,
     String? checked,
   }) {

+ 2 - 2
packages/cs_domain/lib/generated/json/job_applied_list_s_g_entity.g.dart

@@ -75,7 +75,7 @@ JobAppliedListSGRows $JobAppliedListSGRowsFromJson(Map<String, dynamic> json) {
   if (endTime != null) {
     jobAppliedListSGRows.endTime = endTime;
   }
-  final int? adjustHours = jsonConvert.convert<int>(json['adjust_hours']);
+  final String? adjustHours = jsonConvert.convert<String>(json['adjust_hours']);
   if (adjustHours != null) {
     jobAppliedListSGRows.adjustHours = adjustHours;
   }
@@ -202,7 +202,7 @@ extension JobAppliedListSGRowsExtension on JobAppliedListSGRows {
     String? jobDate,
     String? startTime,
     String? endTime,
-    int? adjustHours,
+    String? adjustHours,
     String? totalHours,
     int? status,
     String? statusShow,

+ 2 - 1
packages/cs_domain/lib/repository/job_sg_repository.dart

@@ -253,6 +253,7 @@ class JobSGRepository extends GetxService {
     final result = await httpProvider.requestNetResult(
       ApiConstants.apiJobAppliedEditViewSG,
       params: params,
+      isShowLoadingDialog: true,
       cancelToken: cancelToken,
     );
 
@@ -299,7 +300,7 @@ class JobSGRepository extends GetxService {
       params['work_out'] = work_out ?? "";
     }
     if (!Utils.isEmpty(adjustHours)) {
-      params['subtract_hours'] = adjustHours ?? "";
+      params['adjust_hours'] = adjustHours ?? "";
     }
     if (!Utils.isEmpty(status)) {
       params['status'] = status ?? "";

+ 8 - 0
packages/cs_resources/lib/local/language/en_US.dart

@@ -206,6 +206,14 @@ const Map<String, String> en_US = {
   'Name / Nric': 'Name / Nric',
   'Add Staff - Choose Staff': 'Add Staff - Choose Staff',
   'Are you sure you want to send the e-attendance to agency?': 'Are you sure you want to send the e-attendance to agency?',
+  'Work Clock In': 'Work Clock In',
+  'Work Clock Out': 'Work Clock Out',
+  'Security Clock In': 'Security Clock In',
+  'Security Clock Out': 'Security Clock Out',
+  'Applied': 'Applied',
+  'No Show': 'No Show',
+  'Modify': 'Modify',
+  'Subtract Hour': 'Subtract Hour',
 
   //插件的国际化
   'Pull to refresh': 'Pull to refresh',

+ 8 - 0
packages/cs_resources/lib/local/language/vi_VN.dart

@@ -206,6 +206,14 @@ const Map<String, String> vi_VN = {
   'Name / Nric': 'Tên / Thẻ căn cước',
   'Add Staff - Choose Staff': 'Thêm nhân viên - Chọn nhân viên',
   'Are you sure you want to send the e-attendance to agency?': 'Bạn có chắc chắn muốn gửi E-Attendance cho một đại lý?',
+  'Work Clock In': 'Nơi làm việc Đăng ký',
+  'Work Clock Out': 'Kiểm tra tại nơi làm việc',
+  'Security Clock In': 'Người gác cổng đã ký',
+  'Security Clock Out': 'Kiểm tra cửa',
+  'Applied': 'Đã thông qua',
+  'No Show': 'No Show',
+  'Modify': 'Sửa đổi',
+  'Subtract Hour': 'Trừ giờ',
 
   //插件的国际化
   "Pull to refresh": "Kéo để làm mới",

+ 8 - 0
packages/cs_resources/lib/local/language/zh_CN.dart

@@ -206,6 +206,14 @@ const Map<String, String> zh_CN = {
   'Name / Nric': '姓名 / 身份证',
   'Add Staff - Choose Staff': '添加员工 - 选择员工',
   'Are you sure you want to send the e-attendance to agency?': '您确定要将电子考勤发送给代理商吗?',
+  'Work Clock In': '工作地签到',
+  'Work Clock Out': '工作地签出',
+  'Security Clock In': '门卫签到',
+  'Security Clock Out': '门卫签到',
+  'Applied': '已通过',
+  'No Show': '缺席',
+  'Modify': '修改',
+  'Subtract Hour': '扣除小时',
 
   //插件的国际化
   'Pull to refresh': '下拉刷新',

+ 15 - 11
packages/cs_widgets/lib/shatter/custom_radio_check.dart

@@ -15,12 +15,14 @@ class CustomRadioCheck extends StatefulWidget {
   int? selectedPosition;
   final Function(int index, String text) onOptionSelected;
   final bool enable;
+  final Color textColor;
 
   CustomRadioCheck({
     required this.options,
     required this.onOptionSelected,
     this.selectedPosition = 0,
     this.enable = true, // 默认可用
+    this.textColor = Colors.white, // 默认可用
   });
 
   @override
@@ -63,13 +65,16 @@ class _CustomRadioCheckState extends State<CustomRadioCheck> {
           path: option == _selectedOption ? Assets.cptAuthLoginRadioChecked : Assets.cptAuthLoginRadioUncheck,
           text: option,
           value: option == _selectedOption,
-          onChanged: widget.enable ? (value) { // 只在可用状态下响应点击
-            setState(() {
-              _selectedOption = option;
-              int selectedIndex = widget.options.indexOf(option);
-              widget.onOptionSelected(selectedIndex, option);
-            });
-          } : null, // 如果不可用则不设置回调
+          onChanged: widget.enable
+              ? (value) {
+                  // 只在可用状态下响应点击
+                  setState(() {
+                    _selectedOption = option;
+                    int selectedIndex = widget.options.indexOf(option);
+                    widget.onOptionSelected(selectedIndex, option);
+                  });
+                }
+              : null, // 如果不可用则不设置回调
         );
       }).toList(),
     );
@@ -88,17 +93,16 @@ class _CustomRadioCheckState extends State<CustomRadioCheck> {
         SizedBox(width: 10),
         MyTextView(
           text.tr,
-          textColor: widget.enable ? ColorConstants.white : ColorConstants.gray, // 根据 enable 改变文本颜色
+          textColor: widget.enable ? widget.textColor : ColorConstants.gray, // 根据 enable 改变文本颜色
           fontSize: 14,
           isFontRegular: true,
         ),
       ],
     ).marginOnly(right: 20, bottom: 5).onTap(() {
-      if (onChanged != null) { // 只有在可用状态下才触发
+      if (onChanged != null) {
+        // 只有在可用状态下才触发
         onChanged(true);
       }
     });
   }
 }
-
-