47 lines
1.3 KiB
Dart
Executable File

import 'package:star_lock/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart';
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{
final CheckingInDetailEntity 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() {
super.onReady();
// getCheckInDetailData();
}
@override
void onInit() {
super.onInit();
}
@override
void onClose() {
}
}