2023-09-15 16:04:11 +08:00
|
|
|
|
|
|
|
|
import 'package:get/get.dart';
|
2024-06-07 10:53:24 +08:00
|
|
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
2023-09-15 16:04:11 +08:00
|
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
|
|
|
|
import '../../../../../network/api_repository.dart';
|
|
|
|
|
import 'checkingInAddHolidays_state.dart';
|
|
|
|
|
|
|
|
|
|
class CheckingInAddHolidaysLogic extends BaseGetXController{
|
|
|
|
|
CheckingInAddHolidaysState state = CheckingInAddHolidaysState();
|
|
|
|
|
|
|
|
|
|
// 添加假期
|
2024-06-07 10:53:24 +08:00
|
|
|
Future<void> editStaffLoadData() async{
|
2023-09-15 16:04:11 +08:00
|
|
|
if(state.staffNameController.text.isEmpty){
|
2024-08-05 09:57:16 +08:00
|
|
|
showToast('请输入姓名'.tr);
|
2023-09-15 16:04:11 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-21 18:31:19 +08:00
|
|
|
final LoginEntity entity = await ApiRepository.to.addHolidaysData(
|
2023-09-15 16:04:11 +08:00
|
|
|
companyId: state.companyId.value,
|
2024-06-07 10:53:24 +08:00
|
|
|
fillClassDate: state.makeUpWorkDate.value.isNotEmpty ? DateTime.parse(state.makeUpWorkDate.value).millisecondsSinceEpoch.toString() : '',
|
2023-09-15 16:04:11 +08:00
|
|
|
vacationEndDate: DateTime.parse(state.endDate.value).millisecondsSinceEpoch.toString(),
|
|
|
|
|
vacationName: state.staffNameController.text,
|
|
|
|
|
vacationStartDate: DateTime.parse(state.beginDate.value).millisecondsSinceEpoch.toString()
|
|
|
|
|
);
|
|
|
|
|
if(entity.errorCode!.codeIsSuccessful){
|
2024-08-21 18:31:19 +08:00
|
|
|
showToast('添加成功'.tr, something: (){
|
|
|
|
|
Get.back(result: 'addScuess');
|
|
|
|
|
});
|
2023-09-15 16:04:11 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-07 10:53:24 +08:00
|
|
|
// @override
|
|
|
|
|
// void onReady() {
|
|
|
|
|
// super.onReady();
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// void onInit() {
|
|
|
|
|
// super.onInit();
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// @override
|
|
|
|
|
// void onClose() {
|
|
|
|
|
// super.onInit();
|
|
|
|
|
//
|
|
|
|
|
// }
|
2023-09-15 16:04:11 +08:00
|
|
|
|
|
|
|
|
}
|