|
@@ -0,0 +1,329 @@
|
|
|
+import 'package:cs_resources/constants/color_constants.dart';
|
|
|
+import 'package:cs_resources/generated/assets.dart';
|
|
|
+import 'package:domain/entity/response/attendance_review_entity.dart';
|
|
|
+import 'package:flutter/cupertino.dart';
|
|
|
+import 'package:flutter/material.dart';
|
|
|
+import 'package:flutter/widgets.dart';
|
|
|
+import 'package:plugin_basic/basic_export.dart';
|
|
|
+import 'package:shared/utils/util.dart';
|
|
|
+import 'package:widgets/ext/ex_widget.dart';
|
|
|
+import 'package:widgets/my_load_image.dart';
|
|
|
+import 'package:widgets/my_text_view.dart';
|
|
|
+
|
|
|
+/*
|
|
|
+ * 用工审核的列表Item
|
|
|
+ */
|
|
|
+class AttendanceReviewItem extends StatelessWidget {
|
|
|
+ final int index;
|
|
|
+ final AttendanceReviewRows item;
|
|
|
+ final VoidCallback? onStatusAction;
|
|
|
+ final VoidCallback? onItemAction;
|
|
|
+
|
|
|
+ AttendanceReviewItem({
|
|
|
+ required this.index,
|
|
|
+ required this.item,
|
|
|
+ this.onStatusAction,
|
|
|
+ this.onItemAction,
|
|
|
+ });
|
|
|
+
|
|
|
+ @override
|
|
|
+ Widget build(BuildContext context) {
|
|
|
+ return Container(
|
|
|
+ padding: const EdgeInsets.symmetric(vertical: 23, horizontal: 21),
|
|
|
+ margin: const EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ color: const Color(0xFF4DCFF6).withOpacity(0.2), // 设置背景颜色和不透明度
|
|
|
+ borderRadius: BorderRadius.circular(5), // 设置圆角
|
|
|
+ ),
|
|
|
+ child: Column(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
+ children:[
|
|
|
+ //员工姓名
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "Staff Name:".tr,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //姓名
|
|
|
+ MyTextView(
|
|
|
+ item.staffName ?? "-",
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.white,
|
|
|
+ fontSize: 14,
|
|
|
+ marginLeft: 5,
|
|
|
+ marginRight: 5,
|
|
|
+ ).expanded(),
|
|
|
+
|
|
|
+ //是否选中
|
|
|
+ MyAssetImage(
|
|
|
+ item.isSelected ? Assets.baseServiceItemSelectedIcon : Assets.baseServiceItemUnselectedIcon,
|
|
|
+ width: 20.5,
|
|
|
+ height: 20.5,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+
|
|
|
+ // 工作标题
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "${"Title".tr}:",
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ MyTextView(
|
|
|
+ item.jobTitle ?? "-",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ // 部门
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "${"Outlet".tr}:",
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ MyTextView(
|
|
|
+ item.departmentName ?? "-",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ // 工作时间
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "DateTime:".tr,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ MyTextView(
|
|
|
+ item.jobTime ?? "-",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ //考勤时间
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "${"Clock Time".tr}:",
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //时间
|
|
|
+ MyTextView(
|
|
|
+ "${item.clockIn} - ${item.clockOut}",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+
|
|
|
+ // + - Hours
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "+/- Hours:".tr,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //小时
|
|
|
+ MyTextView(
|
|
|
+ Utils.isNotEmpty(item.adjustShow) ? item.adjustShow! : "0",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ // Total Hours
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "${"Total (Hrs/Rms)".tr}:",
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //小时
|
|
|
+ MyTextView(
|
|
|
+ item.totalShow.toString(),
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ // 状态
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "Status:".tr,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ //发布状态
|
|
|
+ MyTextView(
|
|
|
+ item.statusShow ?? "-",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: "Completed" == item.statusShow
|
|
|
+ ? ColorConstants.textGreen05DC82
|
|
|
+ : "Cancelled" == item.statusShow || "Rejected" == item.statusShow
|
|
|
+ ? ColorConstants.textRedFF6262
|
|
|
+ : "Revised" == item.statusShow || "Pending" == item.statusShow || "Approve" == item.statusShow
|
|
|
+ ? ColorConstants.textYellowFFBB1B
|
|
|
+ : ColorConstants.textBlue06D9FF, //默认蓝色
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ // 创建时间
|
|
|
+ Row(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: [
|
|
|
+ MyTextView(
|
|
|
+ "Created At:".tr,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: ColorConstants.textGrayAECAE5,
|
|
|
+ fontSize: 14,
|
|
|
+ ),
|
|
|
+
|
|
|
+ MyTextView(
|
|
|
+ item.createdAt ?? "-",
|
|
|
+ marginLeft: 5,
|
|
|
+ isFontRegular: true,
|
|
|
+ textColor: Colors.white,
|
|
|
+ fontSize: 14,
|
|
|
+ ).expanded(),
|
|
|
+ ],
|
|
|
+ ).marginOnly(top: 12),
|
|
|
+
|
|
|
+ // //按钮组
|
|
|
+ // Visibility(
|
|
|
+ // visible: item.actionList?.isNotEmpty ?? false,
|
|
|
+ // child: Row(
|
|
|
+ // mainAxisSize: MainAxisSize.max,
|
|
|
+ // mainAxisAlignment: MainAxisAlignment.end,
|
|
|
+ // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ // children: [
|
|
|
+ // //编辑按钮
|
|
|
+ // Visibility(
|
|
|
+ // visible: item.actionList?.contains("edit") ?? false,
|
|
|
+ // child: MyButton(
|
|
|
+ // onPressed: () {
|
|
|
+ // FocusScope.of(context).unfocus();
|
|
|
+ // onEditAction?.call();
|
|
|
+ // },
|
|
|
+ // text: "Edit".tr,
|
|
|
+ // textColor: ColorConstants.white,
|
|
|
+ // backgroundColor: hexToColor(
|
|
|
+ // "#FFBB1B",
|
|
|
+ // ),
|
|
|
+ // radius: 17.25,
|
|
|
+ // minWidth: 60,
|
|
|
+ // minHeight: 35,
|
|
|
+ // ).marginOnly(left: 12),
|
|
|
+ // ),
|
|
|
+ //
|
|
|
+ // //状态工作流按钮
|
|
|
+ // Visibility(
|
|
|
+ // visible: item.actionList?.contains("status") ?? false,
|
|
|
+ // child: MyButton(
|
|
|
+ // onPressed: () {
|
|
|
+ // FocusScope.of(context).unfocus();
|
|
|
+ // onStatusAction?.call();
|
|
|
+ // },
|
|
|
+ // text: "Status".tr,
|
|
|
+ // textColor: ColorConstants.white,
|
|
|
+ // backgroundColor: hexToColor("#0AC074"),
|
|
|
+ // radius: 17.25,
|
|
|
+ // minWidth: 60,
|
|
|
+ // minHeight: 35,
|
|
|
+ // ).marginOnly(left: 12),
|
|
|
+ // ),
|
|
|
+ //
|
|
|
+ // //Remark按钮
|
|
|
+ // Visibility(
|
|
|
+ // visible: item.actionList?.contains("remarks") ?? false,
|
|
|
+ // child: MyButton(
|
|
|
+ // onPressed: () {
|
|
|
+ // FocusScope.of(context).unfocus();
|
|
|
+ // onRemarkAction?.call();
|
|
|
+ // },
|
|
|
+ // text: "Remarks".tr,
|
|
|
+ // textColor: ColorConstants.white,
|
|
|
+ // backgroundColor: hexToColor("#56AAFF"),
|
|
|
+ // radius: 17.25,
|
|
|
+ // minWidth: 60,
|
|
|
+ // minHeight: 35,
|
|
|
+ // ).marginOnly(left: 12),
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // ).marginOnly(top: 15),
|
|
|
+ // ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ).onTap(() {
|
|
|
+ onItemAction?.call();
|
|
|
+ });
|
|
|
+ }
|
|
|
+}
|