163 lines
5.8 KiB
Dart
Executable File
163 lines
5.8 KiB
Dart
Executable File
import 'package:date_format/date_format.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../../../app_settings/app_colors.dart';
|
|
import '../../../../../tools/commonItem.dart';
|
|
import '../../../../../tools/showCalendar.dart';
|
|
import '../../../../../tools/submitBtn.dart';
|
|
import '../../../../../tools/titleAppBar.dart';
|
|
import '../../../../../translations/trans_lib.dart';
|
|
import 'checkingInAddHolidays_logic.dart';
|
|
|
|
class CheckingInAddHolidaysPage extends StatefulWidget {
|
|
const CheckingInAddHolidaysPage({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<CheckingInAddHolidaysPage> createState() =>
|
|
_CheckingInAddHolidaysPageState();
|
|
}
|
|
|
|
class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
|
final logic = Get.put(CheckingInAddHolidaysLogic());
|
|
final state = Get.find<CheckingInAddHolidaysLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: AppColors.mainBackgroundColor,
|
|
appBar: TitleAppBar(
|
|
barTitle: TranslationLoader.lanKeys!.addedHoliday!.tr,
|
|
haveBack: true,
|
|
backgroundColor: AppColors.mainColor),
|
|
body: Column(
|
|
children: [
|
|
CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
|
rightTitle: "",
|
|
isHaveLine: true,
|
|
isHaveRightWidget: true,
|
|
rightWidget: getTFWidget(
|
|
"(${TranslationLoader.lanKeys!.mustFillIn!.tr})")),
|
|
Obx(() => CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.startDate!.tr,
|
|
rightTitle: state.beginDate.value.isEmpty ? "(${TranslationLoader.lanKeys!.mustFillIn!.tr})" : state.beginDate.value,
|
|
isHaveLine: true,
|
|
isHaveDirection: false,
|
|
action: () async {
|
|
await showDialog(
|
|
context: context,
|
|
builder: (context) {
|
|
return ShowCalendar(
|
|
datePickerMode: DatePickerMode.day,
|
|
selectAction: (dateTime) {
|
|
String beginDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
|
|
state.beginDate.value = beginDate;
|
|
Get.back();
|
|
// Navigator.of(context).pop(true);
|
|
});
|
|
});
|
|
})),
|
|
Obx(() => CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.endDate!.tr,
|
|
rightTitle: state.endDate.value.isEmpty ? "(${TranslationLoader.lanKeys!.mustFillIn!.tr})" : state.endDate.value,
|
|
isHaveLine: true,
|
|
isHaveDirection: false,
|
|
action: () async {
|
|
await showDialog(
|
|
context: context,
|
|
builder: (context) {
|
|
return ShowCalendar(
|
|
datePickerMode: DatePickerMode.day,
|
|
selectAction: (dateTime) {
|
|
String endDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
|
|
state.endDate.value = endDate;
|
|
Get.back();
|
|
});
|
|
});
|
|
})),
|
|
Obx(() => CommonItem(
|
|
leftTitel: TranslationLoader.lanKeys!.coverDate!.tr,
|
|
rightTitle: state.makeUpWorkDate.value,
|
|
isHaveLine: false,
|
|
isHaveDirection: false,
|
|
action: () async {
|
|
await showDialog(
|
|
context: context,
|
|
builder: (context) {
|
|
return ShowCalendar(
|
|
datePickerMode: DatePickerMode.day,
|
|
selectAction: (dateTime) {
|
|
String makeUpWorkDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
|
|
state.makeUpWorkDate.value = makeUpWorkDate;
|
|
Get.back();
|
|
});
|
|
});
|
|
})),
|
|
SizedBox(
|
|
height: 50.w,
|
|
),
|
|
SubmitBtn(
|
|
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
|
borderRadius: 20.w,
|
|
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
|
onClick: () {
|
|
logic.editStaffLoadData();
|
|
}),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget getTFWidget(String tfStr) {
|
|
return Container(
|
|
height: 50.h,
|
|
width: 300.w,
|
|
// color: Colors.red,
|
|
child: Row(
|
|
children: [
|
|
Expanded(
|
|
child: TextField(
|
|
//输入框一行
|
|
maxLines: 1,
|
|
controller: state.staffNameController,
|
|
autofocus: false,
|
|
textAlign: TextAlign.end,
|
|
decoration: InputDecoration(
|
|
//输入里面输入文字内边距设置
|
|
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
|
hintText: tfStr,
|
|
hintStyle: TextStyle(
|
|
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
|
//不需要输入框下划线
|
|
border: InputBorder.none,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget whetherTheEmployeeHasAKeyWidget(String title, Function action) {
|
|
return GestureDetector(
|
|
onTap: () {},
|
|
child: Row(
|
|
children: [
|
|
Image.asset(
|
|
'images/icon_round_unSelect.png',
|
|
width: 40.w,
|
|
height: 40.w,
|
|
),
|
|
SizedBox(
|
|
width: 5.w,
|
|
),
|
|
Text(title),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|