50 lines
1.3 KiB
Dart
Executable File
50 lines
1.3 KiB
Dart
Executable File
|
|
import 'package:get/get.dart';
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
|
import '../../../../../network/api_repository.dart';
|
|
import 'checkingInAddHolidays_state.dart';
|
|
|
|
class CheckingInAddHolidaysLogic extends BaseGetXController{
|
|
CheckingInAddHolidaysState state = CheckingInAddHolidaysState();
|
|
|
|
// 添加假期
|
|
void editStaffLoadData() async{
|
|
if(state.staffNameController.text.isEmpty){
|
|
showToast("请输入姓名");
|
|
return;
|
|
}
|
|
|
|
var entity = await ApiRepository.to.addHolidaysData(
|
|
companyId: state.companyId.value,
|
|
fillClassDate: state.makeUpWorkDate.value.isNotEmpty ? DateTime.parse(state.makeUpWorkDate.value).millisecondsSinceEpoch.toString() : "",
|
|
vacationEndDate: DateTime.parse(state.endDate.value).millisecondsSinceEpoch.toString(),
|
|
vacationName: state.staffNameController.text,
|
|
vacationStartDate: DateTime.parse(state.beginDate.value).millisecondsSinceEpoch.toString()
|
|
);
|
|
if(entity.errorCode!.codeIsSuccessful){
|
|
showToast("添加成功");
|
|
Get.back(result: "addScuess");
|
|
}
|
|
}
|
|
|
|
@override
|
|
void onReady() {
|
|
// TODO: implement onReady
|
|
super.onReady();
|
|
|
|
}
|
|
|
|
@override
|
|
void onInit() {
|
|
// TODO: implement onInit
|
|
super.onInit();
|
|
|
|
}
|
|
|
|
@override
|
|
void onClose() {
|
|
// TODO: implement onClose
|
|
|
|
}
|
|
|
|
} |