2024-05-18 09:37:50 +08:00

50 lines
1.2 KiB
Dart
Executable File

import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart';
import 'checkingInDetail_state.dart';
typedef BlockLoadSuccssCallback = void Function();
class CheckingInDetailLogic extends BaseGetXController{
CheckingInDetailState state = CheckingInDetailState();
// 获取考勤详情
Future<void> getCheckInDetailData(BlockLoadSuccssCallback loadSuccssCallback) async{
var entity = await ApiRepository.to.getCheckInDetailData(
companyId: state.companyId.value,
attendanceDate:state.checkDate.value.toString(),
staffId: state.staffId.value.toString(),
);
if(entity.errorCode!.codeIsSuccessful){
state.lateTimes.value = entity.data!.lateTimes.toString();
state.earlyTimes.value = entity.data!.earlyTimes.toString();
state.noPunchTimes.value = entity.data!.noPunchTimes.toString();
state.monthListData.value = entity.data!.monthList!;
loadSuccssCallback();
}
}
@override
void onReady() {
// TODO: implement onReady
super.onReady();
// getCheckInDetailData();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
}
@override
void onClose() {
// TODO: implement onClose
}
}