|
@@ -1,5 +1,7 @@
|
|
|
|
+import 'package:cpt_job_sg/modules/applied_staff/applied_staff_page.dart';
|
|
import 'package:domain/entity/response/job_applied_list_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/job_sg_repository.dart';
|
|
|
|
+import 'package:domain/repository/labour_sg_repository.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/src/widgets/framework.dart';
|
|
import 'package:flutter/src/widgets/framework.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:get/get.dart';
|
|
@@ -9,20 +11,21 @@ import 'package:plugin_platform/engine/notify/notify_engine.dart';
|
|
|
|
|
|
import 'package:plugin_platform/engine/toast/toast_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/dio/dio_cancelable_mixin.dart';
|
|
-import 'package:shared/utils/date_time_utils.dart';
|
|
|
|
|
|
+import 'package:router/componentRouter/component_router_service.dart';
|
|
import 'package:shared/utils/event_bus.dart';
|
|
import 'package:shared/utils/event_bus.dart';
|
|
-import 'package:shared/utils/log_utils.dart';
|
|
|
|
import 'package:shared/utils/util.dart';
|
|
import 'package:shared/utils/util.dart';
|
|
import 'package:widgets/dialog/app_default_dialog.dart';
|
|
import 'package:widgets/dialog/app_default_dialog.dart';
|
|
import 'package:widgets/load_state_layout.dart';
|
|
import 'package:widgets/load_state_layout.dart';
|
|
import 'package:widgets/picker/option_pick_util.dart';
|
|
import 'package:widgets/picker/option_pick_util.dart';
|
|
import 'package:widgets/widget_export.dart';
|
|
import 'package:widgets/widget_export.dart';
|
|
|
|
|
|
|
|
+import 'applied_staff_reviews.dart';
|
|
import 'drop_down_status.dart';
|
|
import 'drop_down_status.dart';
|
|
import 'job_applied_state.dart';
|
|
import 'job_applied_state.dart';
|
|
|
|
|
|
class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
final JobSGRepository _jobRepository = Get.find();
|
|
final JobSGRepository _jobRepository = Get.find();
|
|
|
|
+ final LabourSGRepository _labourRepository = Get.find();
|
|
final JobAppliedState state = JobAppliedState();
|
|
final JobAppliedState state = JobAppliedState();
|
|
|
|
|
|
var _curPage = 1;
|
|
var _curPage = 1;
|
|
@@ -191,7 +194,7 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
|
|
|
|
/// 展示添加员工的弹窗
|
|
/// 展示添加员工的弹窗
|
|
void gotoAddStaffPage() {
|
|
void gotoAddStaffPage() {
|
|
- ToastEngine.show("展示添加员工");
|
|
|
|
|
|
+ AppliedStaffPage.startInstance(state.jobId);
|
|
}
|
|
}
|
|
|
|
|
|
//调用接口添加员工
|
|
//调用接口添加员工
|
|
@@ -223,63 +226,53 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
|
|
- /// 去编辑员工信息页面
|
|
|
|
- void gotoAppliedEditPage(JobAppliedListSGRows data) {
|
|
|
|
- // JobAppliedEditPage.startInstance(data.appliedId.toString());
|
|
|
|
- }
|
|
|
|
|
|
+ /// 去编辑员工信息的弹窗
|
|
|
|
+ void showAppliedEditDialog(JobAppliedListSGRows data) {}
|
|
|
|
|
|
/// 展示评论的弹窗
|
|
/// 展示评论的弹窗
|
|
void showRemarkDialog(JobAppliedListSGRows data) async {
|
|
void showRemarkDialog(JobAppliedListSGRows data) async {
|
|
- // //请求接口获取到已评论的数据
|
|
|
|
- // var result = await _jobRepository.fetchAppliedStaffReviewView(data.appliedId.toString());
|
|
|
|
- //
|
|
|
|
- // if (result.isSuccess) {
|
|
|
|
- // //接口数据获取成功,展示弹窗
|
|
|
|
- // DialogEngine.show(
|
|
|
|
- // widget: AppliedStaffReviews(
|
|
|
|
- // appliedReviews: result.data!,
|
|
|
|
- // confirmAction: (attitudeRate, performanceRate, experienceRate, groomingRate, content) async {
|
|
|
|
- // //请求接口,提交评论
|
|
|
|
- // var submitResult = await _jobRepository.remarkAppliedSingleStaffSubmit(
|
|
|
|
- // data.appliedId.toString(),
|
|
|
|
- // attitudeRate,
|
|
|
|
- // groomingRate,
|
|
|
|
- // performanceRate,
|
|
|
|
- // experienceRate,
|
|
|
|
- // content,
|
|
|
|
- // );
|
|
|
|
- //
|
|
|
|
- // if (submitResult.isSuccess) {
|
|
|
|
- // NotifyEngine.showSuccess("Successful".tr);
|
|
|
|
- // } else {
|
|
|
|
- // ToastEngine.show(submitResult.errorMsg ?? "Network Load Error".tr);
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // ),
|
|
|
|
- // );
|
|
|
|
- // } else {
|
|
|
|
- // ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
|
|
+ //请求接口获取到已评论的数据
|
|
|
|
+ var result = await _jobRepository.fetchJobAppliedRemarkView(data.appliedId.toString());
|
|
|
|
|
|
- /// 去展示员工状态的审核流程页面
|
|
|
|
- void gotoAppliedWorkflowPage(JobAppliedListSGRows data) {
|
|
|
|
- // AppliedWorkflowPage.startInstance(data.appliedId.toString());
|
|
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ //接口数据获取成功,展示弹窗
|
|
|
|
+ DialogEngine.show(
|
|
|
|
+ widget: AppliedStaffReviews(
|
|
|
|
+ appliedReviews: result.data!,
|
|
|
|
+ confirmAction: (attitudeRate, performanceRate, experienceRate, groomingRate, content) async {
|
|
|
|
+ //请求接口,提交评论
|
|
|
|
+ var submitResult = await _jobRepository.submitAppliedRemark(
|
|
|
|
+ data.appliedId.toString(),
|
|
|
|
+ attitudeRate,
|
|
|
|
+ groomingRate,
|
|
|
|
+ performanceRate,
|
|
|
|
+ experienceRate,
|
|
|
|
+ content,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if (submitResult.isSuccess) {
|
|
|
|
+ NotifyEngine.showSuccess("Successful".tr);
|
|
|
|
+ } else {
|
|
|
|
+ ToastEngine.show(submitResult.errorMsg ?? "Network Load Error".tr);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/// 去查看员工详情页面
|
|
/// 去查看员工详情页面
|
|
void gotoStaffDetailPage(JobAppliedListSGRows data) {
|
|
void gotoStaffDetailPage(JobAppliedListSGRows data) {
|
|
- // AppliedStaffDetailPage.startInstance(data.memberId.toString());
|
|
|
|
|
|
+ ComponentRouterServices.jobService.startStaffDetailPage(data.memberId);
|
|
}
|
|
}
|
|
|
|
|
|
/// Item选中与未选中设置
|
|
/// Item选中与未选中设置
|
|
void doSelectedOrNot(JobAppliedListSGRows data) {
|
|
void doSelectedOrNot(JobAppliedListSGRows data) {
|
|
- //只有 Approve = 3 的状态才能选中
|
|
|
|
-
|
|
|
|
data.isSelected = !data.isSelected;
|
|
data.isSelected = !data.isSelected;
|
|
update();
|
|
update();
|
|
- Log.d("选中:${data.isSelected}");
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/// 批量修改的弹窗
|
|
/// 批量修改的弹窗
|
|
@@ -325,40 +318,6 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
|
|
- /// 批准的操作
|
|
|
|
- void operationApprove() async {
|
|
|
|
- //找出已经选中的员工(只有状态为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(',');
|
|
|
|
- //
|
|
|
|
- // // Are you sure 的弹窗
|
|
|
|
- // DialogEngine.show(
|
|
|
|
- // widget: AppDefaultDialog(
|
|
|
|
- // title: "Message".tr,
|
|
|
|
- // message: "Are you sure you want to setting approved?".tr,
|
|
|
|
- // confirmAction: () async {
|
|
|
|
- // //执行请求
|
|
|
|
- // var result = await _jobRepository.submitBatchStaffApprove(separatedIds, cancelToken: cancelToken);
|
|
|
|
- //
|
|
|
|
- // if (result.isSuccess) {
|
|
|
|
- // NotifyEngine.showSuccess("Successful".tr);
|
|
|
|
- //
|
|
|
|
- // //调用接口刷新指定的Staff的信息
|
|
|
|
- // fetchItemByIdAndRefreshItem(separatedIds);
|
|
|
|
- // } else {
|
|
|
|
- // ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // ),
|
|
|
|
- // );
|
|
|
|
- // } else {
|
|
|
|
- // ToastEngine.show("Please select the applied record".tr);
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/// 根据ID获取Item对象,用于刷新
|
|
/// 根据ID获取Item对象,用于刷新
|
|
void fetchItemByIdAndRefreshItem(String? appliedIds) async {
|
|
void fetchItemByIdAndRefreshItem(String? appliedIds) async {
|
|
var result = await _jobRepository.fetchItemByAppliedIds(
|
|
var result = await _jobRepository.fetchItemByAppliedIds(
|
|
@@ -391,7 +350,35 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- void confirmJob() {}
|
|
|
|
|
|
+ /// 请求接口发送电子考勤,确定考勤
|
|
|
|
+ void confirmJob() {
|
|
|
|
+ DialogEngine.show(
|
|
|
|
+ widget: AppDefaultDialog(
|
|
|
|
+ title: "Notice".tr,
|
|
|
|
+ message: "Are you sure you want to send the e-attendance to agency?".tr,
|
|
|
|
+ confirmAction: () {
|
|
|
|
+ _requestSendEAttendance();
|
|
|
|
+ }),
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //发送接口
|
|
|
|
+ void _requestSendEAttendance() async {
|
|
|
|
+ var result = await _labourRepository.confirmJobList(
|
|
|
|
+ state.jobId,
|
|
|
|
+ cancelToken: cancelToken,
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if (result.isSuccess) {
|
|
|
|
+ NotifyEngine.showSuccess("Successful".tr);
|
|
|
|
+
|
|
|
|
+ //调用接口刷新指定的Staff的信息
|
|
|
|
+ refreshController.callRefresh();
|
|
|
|
+ } else {
|
|
|
|
+ ToastEngine.show(result.errorMsg ?? "Network Load Error".tr);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
// 顶部的筛选状态
|
|
// 顶部的筛选状态
|
|
void pickStatus() {
|
|
void pickStatus() {
|
|
@@ -459,5 +446,4 @@ class JobAppliedController extends GetxController with DioCancelableMixin {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|