fix:修复 第4栏应都要显示,星锁只显示后部分
This commit is contained in:
parent
c978444330
commit
b3d0c04ddc
@ -4,6 +4,8 @@ import 'dart:ffi';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import '../../../../../network/api_repository.dart';
|
import '../../../../../network/api_repository.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
@ -23,30 +25,30 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_getNumberEvent = eventBus
|
_getNumberEvent = eventBus
|
||||||
.on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>()
|
.on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>()
|
||||||
.listen((event) {
|
.listen((ChickInAddStaffCardAndFingerprintBlockNumberEvent event) {
|
||||||
state.attendanceWayNumber.value = event.number;
|
state.attendanceWayNumber.value = event.number;
|
||||||
isCanClickAction();
|
isCanClickAction();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加员工
|
// 添加员工
|
||||||
void addStaffLoadData() async {
|
Future<void> addStaffLoadData() async {
|
||||||
var usernameType = "1";
|
String usernameType = '1';
|
||||||
if (state.appUnHaveAccount.value && state.staffAccount.contains("@")) {
|
if (state.appUnHaveAccount.value && state.staffAccount.contains('@')) {
|
||||||
usernameType = "2";
|
usernameType = '2';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当是app且没有钥匙时,直接把账号赋值给attendanceWayNumber
|
// 当是app且没有钥匙时,直接把账号赋值给attendanceWayNumber
|
||||||
if (state.appUnHaveAccount.value &&
|
if (state.appUnHaveAccount.value &&
|
||||||
state.selectPrintingMethodType.value == "1") {
|
state.selectPrintingMethodType.value == '1') {
|
||||||
state.attendanceWayNumber.value = state.staffAccountController.text;
|
state.attendanceWayNumber.value = state.staffAccountController.text;
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = await ApiRepository.to.addStaffData(
|
final LoginEntity entity = await ApiRepository.to.addStaffData(
|
||||||
attendanceType: state.selectPrintingMethodType.value,
|
attendanceType: state.selectPrintingMethodType.value,
|
||||||
attendanceWay: state.attendanceWayNumber.value,
|
attendanceWay: state.attendanceWayNumber.value,
|
||||||
companyId: state.companyId.value,
|
companyId: state.companyId.value,
|
||||||
have: state.appUnHaveAccount.value ? "2" : "1",
|
have: state.appUnHaveAccount.value ? '2' : '1',
|
||||||
staffName: state.staffNameController.text,
|
staffName: state.staffNameController.text,
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
usernameType: usernameType,
|
usernameType: usernameType,
|
||||||
@ -54,7 +56,7 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
eventBus.fire(RefreshCheckInSetDataEvent());
|
eventBus.fire(RefreshCheckInSetDataEvent());
|
||||||
eventBus.fire(RefreshCheckInListEvent());
|
eventBus.fire(RefreshCheckInListEvent());
|
||||||
Get.back(result: "addScuess");
|
Get.back(result: 'addScuess');
|
||||||
} else if (entity.errorCode! == 425) {
|
} else if (entity.errorCode! == 425) {
|
||||||
showToast(entity.errorMsg!);
|
showToast(entity.errorMsg!);
|
||||||
}
|
}
|
||||||
@ -62,8 +64,9 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 考勤设置添加员工-选择钥匙 1为APP,2为密码,3为卡,4为指纹,返回数据中,
|
// 考勤设置添加员工-选择钥匙 1为APP,2为密码,3为卡,4为指纹,返回数据中,
|
||||||
// attendanceWay分别为用户名、密码、卡号、指纹号
|
// attendanceWay分别为用户名、密码、卡号、指纹号
|
||||||
void addStaffSelectKey(KeyClickCallback kyClickCallback) async {
|
Future<void> addStaffSelectKey(KeyClickCallback kyClickCallback) async {
|
||||||
var entity = await ApiRepository.to.addStaffSelectKeyData(
|
final CheckingInAddStaffSelectKeyEntity entity =
|
||||||
|
await ApiRepository.to.addStaffSelectKeyData(
|
||||||
companyId: state.companyId.value,
|
companyId: state.companyId.value,
|
||||||
type: state.selectPrintingMethodType.value,
|
type: state.selectPrintingMethodType.value,
|
||||||
);
|
);
|
||||||
@ -74,18 +77,17 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 编辑员工
|
// 编辑员工
|
||||||
void editStaffLoadData() async {
|
Future<void> editStaffLoadData() async {
|
||||||
var usernameType = "1";
|
String usernameType = '1';
|
||||||
if (state.appUnHaveAccount.value && state.staffAccount.contains("@")) {
|
if (state.appUnHaveAccount.value && state.staffAccount.contains('@')) {
|
||||||
usernameType = "2";
|
usernameType = '2';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final LoginEntity entity = await ApiRepository.to.editStaffData(
|
||||||
var entity = await ApiRepository.to.editStaffData(
|
|
||||||
attendanceType: state.selectPrintingMethodType.value,
|
attendanceType: state.selectPrintingMethodType.value,
|
||||||
attendanceWay: state.attendanceWayNumber.value,
|
attendanceWay: state.attendanceWayNumber.value,
|
||||||
staffId: state.staffListItemData.value.staffId.toString(),
|
staffId: state.staffListItemData.value.staffId.toString(),
|
||||||
have: state.appUnHaveAccount.value ? "2" : "1",
|
have: state.appUnHaveAccount.value ? '2' : '1',
|
||||||
staffName: state.staffNameController.text,
|
staffName: state.staffNameController.text,
|
||||||
countryCode: state.countryCode.value,
|
countryCode: state.countryCode.value,
|
||||||
usernameType: usernameType,
|
usernameType: usernameType,
|
||||||
@ -99,13 +101,13 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取密码请求
|
//获取密码请求
|
||||||
void getKeyboardPwdRequest() async {
|
Future<void> getKeyboardPwdRequest() async {
|
||||||
if (state.staffNameController.text.isEmpty) {
|
if (state.staffNameController.text.isEmpty) {
|
||||||
showToast("请输入姓名");
|
showToast('请输入姓名');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var entity = await ApiRepository.to.getPasswordKey(
|
final PasswordKeyEntity entity = await ApiRepository.to.getPasswordKey(
|
||||||
endDate: "0",
|
endDate: '0',
|
||||||
keyboardPwdName: state.staffNameController.text,
|
keyboardPwdName: state.staffNameController.text,
|
||||||
keyboardPwdType: 2.toString(),
|
keyboardPwdType: 2.toString(),
|
||||||
lockId: state.getKeyInfosData.value.lockId.toString(),
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
@ -136,7 +138,7 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 是否能点击
|
// 是否能点击
|
||||||
void isCanClickAction() {
|
void isCanClickAction() {
|
||||||
if (state.selectPrintingMethodType.value == "1" &&
|
if (state.selectPrintingMethodType.value == '1' &&
|
||||||
state.appUnHaveAccount.value) {
|
state.appUnHaveAccount.value) {
|
||||||
// 没有账号的时候直接判断姓名和账号是否为空
|
// 没有账号的时候直接判断姓名和账号是否为空
|
||||||
state.isCanClick.value =
|
state.isCanClick.value =
|
||||||
@ -154,6 +156,8 @@ class CheckingInAddStaffLogic extends BaseGetXController {
|
|||||||
_initLoadDataAction();
|
_initLoadDataAction();
|
||||||
|
|
||||||
changeInput(state.staffNameController);
|
changeInput(state.staffNameController);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSelectKey_entity.dart';
|
import 'package:star_lock/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSelectKey_entity.dart';
|
||||||
@ -62,7 +63,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
if (state.getKeyInfosData.value.lockName!.contains('T9A')) {
|
if (state.getKeyInfosData.value.lockName!.contains('T9A')) {
|
||||||
list.add('人脸'.tr);
|
list.add('人脸'.tr);
|
||||||
}
|
}
|
||||||
_showSelectClockInType(list, list, '1', '选择钥匙'.tr);
|
_showSelectClockInType(list, list, list, '1', '选择钥匙'.tr);
|
||||||
})),
|
})),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
//员工是否有App、卡、钥匙、指纹必须显示
|
//员工是否有App、卡、钥匙、指纹必须显示
|
||||||
@ -96,10 +97,8 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
))),
|
))),
|
||||||
// 当选择App时且没有钥匙的时候 显示输入账号输入框和选择国家 其他隐藏
|
// 当选择App时且没有钥匙的时候 显示输入账号输入框和选择国家 其他隐藏
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: (state.appUnHaveAccount.value &&
|
visible: state.appUnHaveAccount.value &&
|
||||||
state.selectPrintingMethodType.value == '1')
|
state.selectPrintingMethodType.value == '1',
|
||||||
? true
|
|
||||||
: false,
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -166,7 +165,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final data = await Get.toNamed(
|
final dynamic data = await Get.toNamed(
|
||||||
Routers.addCardPage,
|
Routers.addCardPage,
|
||||||
arguments: <String, Object?>{
|
arguments: <String, Object?>{
|
||||||
'lockId':
|
'lockId':
|
||||||
@ -228,9 +227,14 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
// 当选择钥匙类型为有时 必显示
|
// 当选择钥匙类型为有时 必显示
|
||||||
Obx(() {
|
Obx(() {
|
||||||
final bool isPass = state.selectPrintingMethodType.value == '2';
|
final bool isPass = state.selectPrintingMethodType.value == '2';
|
||||||
String rightTitle = state.attendanceWayNumber.value;
|
String attendanceWayNumber = state.attendanceWayNumber.value;
|
||||||
|
final String attendanceWayName = state.attendanceWayName.value;
|
||||||
if (isPass) {
|
if (isPass) {
|
||||||
rightTitle = showPass(rightTitle);
|
attendanceWayNumber = showPass(attendanceWayNumber);
|
||||||
|
}
|
||||||
|
String rightTitle = attendanceWayNumber;
|
||||||
|
if (attendanceWayName.trim() != '') {
|
||||||
|
rightTitle = '$attendanceWayName - ' + rightTitle;
|
||||||
}
|
}
|
||||||
return Visibility(
|
return Visibility(
|
||||||
visible: !state.appUnHaveAccount.value,
|
visible: !state.appUnHaveAccount.value,
|
||||||
@ -243,6 +247,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
logic.addStaffSelectKey(
|
logic.addStaffSelectKey(
|
||||||
(List<CheckingInAddStaffKeyEntity> v) {
|
(List<CheckingInAddStaffKeyEntity> v) {
|
||||||
final List<String> showList = <String>[];
|
final List<String> showList = <String>[];
|
||||||
|
final List<String> nameList = <String>[];
|
||||||
final List<String> numberList = <String>[];
|
final List<String> numberList = <String>[];
|
||||||
for (final CheckingInAddStaffKeyEntity element in v) {
|
for (final CheckingInAddStaffKeyEntity element in v) {
|
||||||
final bool isPass =
|
final bool isPass =
|
||||||
@ -252,12 +257,13 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
attendanceWay = showPass(attendanceWay);
|
attendanceWay = showPass(attendanceWay);
|
||||||
}
|
}
|
||||||
final String text =
|
final String text =
|
||||||
'${element.staffName}-$attendanceWay';
|
'${element.staffName} - $attendanceWay';
|
||||||
showList.add(text);
|
showList.add(text);
|
||||||
numberList.add(element.attendanceWay ?? '');
|
numberList.add(element.attendanceWay ?? '');
|
||||||
|
nameList.add(element.staffName ?? '');
|
||||||
}
|
}
|
||||||
_showSelectClockInType(showList, numberList, '2',
|
_showSelectClockInType(showList, numberList, nameList,
|
||||||
addStaffSelectKeySelectClockInType());
|
'2', addStaffSelectKeySelectClockInType());
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -344,8 +350,8 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// type 1 打卡方式 2选择钥匙
|
// type 1 打卡方式 2选择钥匙
|
||||||
void _showSelectClockInType(List showList, List numberList,
|
void _showSelectClockInType(List<String> showList, List<String> numberList,
|
||||||
String showBottomSheetToolType, String title) {
|
List<String> nameList, String showBottomSheetToolType, String title) {
|
||||||
ShowBottomSheetTool().showSingleRowPicker(
|
ShowBottomSheetTool().showSingleRowPicker(
|
||||||
//上下文
|
//上下文
|
||||||
context,
|
context,
|
||||||
@ -364,8 +370,10 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
|||||||
if (showBottomSheetToolType == '1') {
|
if (showBottomSheetToolType == '1') {
|
||||||
state.selectPrintingMethodType.value = (index + 1).toString();
|
state.selectPrintingMethodType.value = (index + 1).toString();
|
||||||
state.selectPrintingMethodStr.value = str.toString();
|
state.selectPrintingMethodStr.value = str.toString();
|
||||||
|
state.attendanceWayName.value = '';
|
||||||
state.attendanceWayNumber.value = '';
|
state.attendanceWayNumber.value = '';
|
||||||
} else {
|
} else {
|
||||||
|
state.attendanceWayName.value = nameList[index].toString();
|
||||||
state.attendanceWayNumber.value = numberList[index].toString();
|
state.attendanceWayNumber.value = numberList[index].toString();
|
||||||
}
|
}
|
||||||
logic.isCanClickAction();
|
logic.isCanClickAction();
|
||||||
|
|||||||
@ -6,27 +6,28 @@ import '../checkingInSetStaffList/checkingInStaffList_entity.dart';
|
|||||||
import 'checkingInAddStaffSelectKey_entity.dart';
|
import 'checkingInAddStaffSelectKey_entity.dart';
|
||||||
|
|
||||||
class CheckingInAddStaffState {
|
class CheckingInAddStaffState {
|
||||||
final getKeyInfosData = LockListInfoItemEntity().obs;
|
final Rx<LockListInfoItemEntity> getKeyInfosData = LockListInfoItemEntity().obs;
|
||||||
final companyId = "".obs;
|
final RxString companyId = ''.obs;
|
||||||
final staffListItemData = CheckingInAddStaffListItemEntity().obs;
|
final Rx<CheckingInAddStaffListItemEntity> staffListItemData = CheckingInAddStaffListItemEntity().obs;
|
||||||
|
|
||||||
final TextEditingController staffNameController = TextEditingController();
|
final TextEditingController staffNameController = TextEditingController();
|
||||||
final TextEditingController staffAccountController = TextEditingController();
|
final TextEditingController staffAccountController = TextEditingController();
|
||||||
|
|
||||||
final selectPrintingMethodType = "1".obs; // 选择打卡类型 1APP 2密码 3卡 4指纹 5人脸
|
final RxString selectPrintingMethodType = '1'.obs; // 选择打卡类型 1APP 2密码 3卡 4指纹 5人脸
|
||||||
final selectPrintingMethodStr = "APP".obs; // 选择打卡类型字符串
|
final RxString selectPrintingMethodStr = 'APP'.obs; // 选择打卡类型字符串
|
||||||
|
|
||||||
final countryName = "中国".tr.obs;
|
final RxString countryName = '中国'.tr.obs;
|
||||||
final countryCode = "86".obs;
|
final RxString countryCode = '86'.obs;
|
||||||
|
|
||||||
final appUnHaveAccount = true.obs; // 默认没有账号
|
final RxBool appUnHaveAccount = true.obs; // 默认没有账号
|
||||||
final keyEntity = <CheckingInAddStaffKeyEntity>[].obs; // 选择钥匙数据
|
final RxList<CheckingInAddStaffKeyEntity> keyEntity = <CheckingInAddStaffKeyEntity>[].obs; // 选择钥匙数据
|
||||||
|
|
||||||
final isAdd = "1".obs; // 1添加 2编辑
|
final RxString isAdd = '1'.obs; // 1添加 2编辑
|
||||||
final attendanceWayNumber = "".obs;
|
final RxString attendanceWayName = ''.obs;
|
||||||
final isCanClick = false.obs;
|
final RxString attendanceWayNumber = ''.obs;
|
||||||
var staffName = ''.obs;
|
final RxBool isCanClick = false.obs;
|
||||||
var staffAccount = ''.obs;
|
RxString staffName = ''.obs;
|
||||||
|
RxString staffAccount = ''.obs;
|
||||||
|
|
||||||
bool get staffNameIsNotEmpty => staffName.value.isNotEmpty;
|
bool get staffNameIsNotEmpty => staffName.value.isNotEmpty;
|
||||||
|
|
||||||
@ -37,28 +38,28 @@ class CheckingInAddStaffState {
|
|||||||
|
|
||||||
CheckingInAddStaffState() {
|
CheckingInAddStaffState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
getKeyInfosData.value = map["getKeyInfosData"];
|
getKeyInfosData.value = map['getKeyInfosData'];
|
||||||
companyId.value = map["companyId"];
|
companyId.value = map['companyId'];
|
||||||
|
|
||||||
isAdd.value = map["isAdd"];
|
isAdd.value = map['isAdd'];
|
||||||
if (isAdd.value == "2") {
|
if (isAdd.value == '2') {
|
||||||
staffListItemData.value = map["staffListItem"];
|
staffListItemData.value = map['staffListItem'];
|
||||||
staffNameController.text = staffListItemData.value.staffName!;
|
staffNameController.text = staffListItemData.value.staffName!;
|
||||||
|
|
||||||
selectPrintingMethodType.value =
|
selectPrintingMethodType.value =
|
||||||
staffListItemData.value.attendanceType.toString();
|
staffListItemData.value.attendanceType.toString();
|
||||||
switch (staffListItemData.value.attendanceType) {
|
switch (staffListItemData.value.attendanceType) {
|
||||||
case 1:
|
case 1:
|
||||||
selectPrintingMethodStr.value = "APP";
|
selectPrintingMethodStr.value = 'APP';
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
selectPrintingMethodStr.value = "密码".tr;
|
selectPrintingMethodStr.value = '密码'.tr;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
selectPrintingMethodStr.value = "卡".tr;
|
selectPrintingMethodStr.value = '卡'.tr;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
selectPrintingMethodStr.value = "指纹".tr;
|
selectPrintingMethodStr.value = '指纹'.tr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:flutter_slidable/flutter_slidable.dart';
|
import 'package:flutter_slidable/flutter_slidable.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_state.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
|
|
||||||
import '../../../../../appRouters.dart';
|
import '../../../../../appRouters.dart';
|
||||||
@ -23,8 +24,8 @@ class CheckingInStaffListPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
||||||
final logic = Get.put(CheckingInStaffManageLogic());
|
final CheckingInStaffManageLogic logic = Get.put(CheckingInStaffManageLogic());
|
||||||
final state = Get.find<CheckingInStaffManageLogic>().state;
|
final CheckingInStaffManageState state = Get.find<CheckingInStaffManageLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -34,13 +35,13 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
|||||||
barTitle: TranslationLoader.lanKeys!.staff!.tr,
|
barTitle: TranslationLoader.lanKeys!.staff!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: <Widget>[
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
var data = await Get.toNamed(Routers.checkingInAddStaffPage, arguments: {
|
final dynamic data = await Get.toNamed(Routers.checkingInAddStaffPage, arguments: <String, Object>{
|
||||||
"getKeyInfosData": state.getKeyInfosData.value,
|
'getKeyInfosData': state.getKeyInfosData.value,
|
||||||
"companyId": state.companyId.value,
|
'companyId': state.companyId.value,
|
||||||
"isAdd": "1",
|
'isAdd': '1',
|
||||||
});
|
});
|
||||||
if(data != null) {
|
if(data != null) {
|
||||||
logic.getStaffList();
|
logic.getStaffList();
|
||||||
@ -62,23 +63,23 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
|||||||
SlidableAutoCloseBehavior(
|
SlidableAutoCloseBehavior(
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
itemCount: state.staffListData.value.length,
|
itemCount: state.staffListData.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (BuildContext c, int index) {
|
||||||
CheckingInAddStaffListItemEntity staffListItem = state.staffListData[index];
|
final CheckingInAddStaffListItemEntity staffListItem = state.staffListData[index];
|
||||||
return Slidable(
|
return Slidable(
|
||||||
key:ValueKey(staffListItem.staffId),
|
key:ValueKey(staffListItem.staffId),
|
||||||
endActionPane: ActionPane(
|
endActionPane: ActionPane(
|
||||||
extentRatio: 0.2,
|
extentRatio: 0.2,
|
||||||
motion: const ScrollMotion(),
|
motion: const ScrollMotion(),
|
||||||
children: [
|
children: <Widget>[
|
||||||
SlidableAction(
|
SlidableAction(
|
||||||
onPressed: (BuildContext context){
|
onPressed: (BuildContext context){
|
||||||
// 1APP 2密码 3卡 4指纹 5人脸
|
// 1APP 2密码 3卡 4指纹 5人脸
|
||||||
if(staffListItem.attendanceType == 1){
|
if(staffListItem.attendanceType == 1){
|
||||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除员工钥匙'.tr, (isAllData) {
|
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除员工钥匙'.tr, (bool isAllData) {
|
||||||
logic.deletStaff(staffListItem.staffId!, (isAllData ? 1 : 0));
|
logic.deletStaff(staffListItem.staffId!, (isAllData ? 1 : 0));
|
||||||
});
|
});
|
||||||
}else{
|
}else{
|
||||||
ShowTipView().showIosTipWithContentDialog("确定要删除员工吗?".tr, () {
|
ShowTipView().showIosTipWithContentDialog('确定要删除员工吗?'.tr, () {
|
||||||
logic.deletStaff(staffListItem.staffId!, 0);
|
logic.deletStaff(staffListItem.staffId!, 0);
|
||||||
});
|
});
|
||||||
// showIosTipViewDialog(staffListItem.staffId!, context);
|
// showIosTipViewDialog(staffListItem.staffId!, context);
|
||||||
@ -92,10 +93,10 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: _checkingInStaffManageItem(staffListItem, () {
|
child: _checkingInStaffManageItem(staffListItem, () {
|
||||||
Get.toNamed(Routers.checkingInStaffDetailPage, arguments: {
|
Get.toNamed(Routers.checkingInStaffDetailPage, arguments: <String, Object>{
|
||||||
"staffListItem": staffListItem,
|
'staffListItem': staffListItem,
|
||||||
"getKeyInfosData": state.getKeyInfosData.value,
|
'getKeyInfosData': state.getKeyInfosData.value,
|
||||||
"companyId": state.companyId.value,
|
'companyId': state.companyId.value,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -108,7 +109,7 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
|||||||
// });
|
// });
|
||||||
// });
|
// });
|
||||||
},
|
},
|
||||||
separatorBuilder: (context, index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
return Divider(height: 1.h, indent: 20.w, color: AppColors.greyLineColor);
|
return Divider(height: 1.h, indent: 20.w, color: AppColors.greyLineColor);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -125,14 +126,14 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
margin: EdgeInsets.only(right: 10.w, top: 10.h, bottom: 10.h),
|
margin: EdgeInsets.only(right: 10.w, top: 10.h, bottom: 10.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(width: 20.w,),
|
SizedBox(width: 20.w,),
|
||||||
// CustomNetworkImage(url: staffListItem.headurl!, width: 40.w , height: 40.w),
|
// CustomNetworkImage(url: staffListItem.headurl!, width: 40.w , height: 40.w),
|
||||||
Image.asset(getTypeIcon(staffListItem.attendanceType!), width: 60.w, height: 60.w),
|
Image.asset(getTypeIcon(staffListItem.attendanceType!), width: 60.w, height: 60.w),
|
||||||
SizedBox(width: 20.w,),
|
SizedBox(width: 20.w,),
|
||||||
Column(
|
Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: <Widget>[
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 1.sw - 20.w - 60.w - 20.w - 30.w,
|
width: 1.sw - 20.w - 60.w - 20.w - 30.w,
|
||||||
child: Text(staffListItem.staffName!,
|
child: Text(staffListItem.staffName!,
|
||||||
@ -153,7 +154,7 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
|
|||||||
borderRadius: BorderRadius.circular(5.w),
|
borderRadius: BorderRadius.circular(5.w),
|
||||||
color: AppColors.openPassageModeColor,
|
color: AppColors.openPassageModeColor,
|
||||||
),
|
),
|
||||||
child: Text("打卡方式无效".tr, style: TextStyle(fontSize: 18.sp, color: AppColors.appBarIconColor)),
|
child: Text('打卡方式无效'.tr, style: TextStyle(fontSize: 18.sp, color: AppColors.appBarIconColor)),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user