完善考勤添加员工添加指纹、卡功能

This commit is contained in:
魏少阳 2023-09-21 14:12:22 +08:00
parent 8f00a142ae
commit d4e64da5aa
21 changed files with 410 additions and 144 deletions

View File

@ -405,5 +405,15 @@
"pleaseEnterWifiPwd":"Please Enter WiFi Password", "pleaseEnterWifiPwd":"Please Enter WiFi Password",
"edit":"Edit", "edit":"Edit",
"stressFingerprint":"Stress Fingerprint", "stressFingerprint":"Stress Fingerprint",
"effectiveDay":"Effective Day" "effectiveDay":"Effective Day",
"whetherTheEmployeeHasPassword":"If The Employee Has A Password",
"whetherTheEmployeeHasCard":"If The Employee Has A Card",
"whetherTheEmployeeHasFingerprint":"If The Employee Has A Fingerprint",
"seletPassword":"Selet Password",
"seletCard":"Selet Card",
"seletFingerprint":"Selet Fingerprint",
"getKey":"Get Key",
"getCard":"Get Card",
"getFingerprint":"Get Fingerprint"
} }

View File

@ -405,5 +405,15 @@
"pleaseEnterWifiPwd":"pleaseEnterWifiPwd", "pleaseEnterWifiPwd":"pleaseEnterWifiPwd",
"edit":"edit", "edit":"edit",
"stressFingerprint":"stressFingerprint", "stressFingerprint":"stressFingerprint",
"effectiveDay":"effectiveDay" "effectiveDay":"effectiveDay",
"whetherTheEmployeeHasPassword":"whetherTheEmployeeHasPassword",
"whetherTheEmployeeHasCard":"whetherTheEmployeeHasCard",
"whetherTheEmployeeHasFingerprint":"whetherTheEmployeeHasFingerprint",
"seletPassword":"seletPassword",
"seletCard":"seletCard",
"seletFingerprint":"seletFingerprint",
"getKey":"getKey",
"getCard":"getCard",
"getFingerprint":"getFingerprint"
} }

View File

@ -408,5 +408,15 @@
"pleaseEnterWifiPwd":"请输入WiFi密码", "pleaseEnterWifiPwd":"请输入WiFi密码",
"edit":"编辑", "edit":"编辑",
"stressFingerprint":"胁迫指纹", "stressFingerprint":"胁迫指纹",
"effectiveDay":"有效日" "effectiveDay":"有效日",
"whetherTheEmployeeHasPassword":"员工是否有密码",
"whetherTheEmployeeHasCard":"员工是否有卡",
"whetherTheEmployeeHasFingerprint":"员工是否有指纹",
"seletPassword":"选择密码",
"seletCard":"选择卡",
"seletFingerprint":"选择指纹",
"getKey":"获取钥匙",
"getCard":"获取卡",
"getFingerprint":"获取指纹"
} }

View File

@ -1,4 +1,6 @@
import 'dart:async';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/toast.dart'; import 'package:star_lock/tools/toast.dart';
@ -11,6 +13,16 @@ typedef KeyClickCallback = void Function(List<CheckingInAddStaffKeyEntity> selet
class CheckingInAddStaffLogic extends BaseGetXController{ class CheckingInAddStaffLogic extends BaseGetXController{
CheckingInAddStaffState state = CheckingInAddStaffState(); CheckingInAddStaffState state = CheckingInAddStaffState();
//
StreamSubscription? _getNumberEvent;
void _initLoadDataAction() {
// eventBus
_getNumberEvent =
eventBus.on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>().listen((event) {
state.getDataPassword.value = event.number;
});
}
// //
void addStaffLoadData() async{ void addStaffLoadData() async{
var attendanceWay = ""; var attendanceWay = "";
@ -51,11 +63,6 @@ class CheckingInAddStaffLogic extends BaseGetXController{
break; break;
} }
if(state.staffNameController.text.isEmpty){
Toast.show(msg: "请输入姓名");
return;
}
var entity = await ApiRepository.to.addStaffData( var entity = await ApiRepository.to.addStaffData(
attendanceType: state.seletPrintingMethodType.value, attendanceType: state.seletPrintingMethodType.value,
attendanceWay: attendanceWay, attendanceWay: attendanceWay,
@ -72,11 +79,11 @@ class CheckingInAddStaffLogic extends BaseGetXController{
} }
} }
// - // - 1APP234attendanceWay分别为用户名
void addStaffSeletKey(KeyClickCallback kyClickCallback) async{ void addStaffSeletKey(KeyClickCallback kyClickCallback) async{
var entity = await ApiRepository.to.addStaffSeletKeyData( var entity = await ApiRepository.to.addStaffSeletKeyData(
companyId: state.companyId.value, companyId: state.companyId.value,
type:"1", type:state.seletPrintingMethodType.value,
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
state.keyEntity.value = entity.data!; state.keyEntity.value = entity.data!;
@ -124,11 +131,6 @@ class CheckingInAddStaffLogic extends BaseGetXController{
break; break;
} }
if(state.staffNameController.text.isEmpty){
Toast.show(msg: "请输入姓名");
return;
}
var entity = await ApiRepository.to.editStaffData( var entity = await ApiRepository.to.editStaffData(
attendanceType: state.seletPrintingMethodType.value, attendanceType: state.seletPrintingMethodType.value,
attendanceWay: attendanceWay, attendanceWay: attendanceWay,
@ -146,12 +148,38 @@ class CheckingInAddStaffLogic extends BaseGetXController{
} }
} }
//
void getKeyboardPwdRequest() async {
if(state.staffNameController.text.isEmpty){
Toast.show(msg: "请输入姓名");
return;
}
var entity = await ApiRepository.to.getPasswordKey(
"0",
'0',
state.staffNameController.text,
2.toString(),
'0',
state.getKeyInfosData.value.lockId.toString(),
'0',
"0",
'0');
if (entity.errorCode!.codeIsSuccessful) {
print('获取密码成功');
if (entity.data != null) {
state.getDataPassword.value = entity.data!.keyboardPwd!;
}
} else {
Toast.show(msg: '${entity.errorMsg}');
}
}
@override @override
void onReady() { void onReady() {
// TODO: implement onReady // TODO: implement onReady
super.onReady(); super.onReady();
print("onReady()"); print("onReady()");
_initLoadDataAction();
} }
@override @override
@ -159,13 +187,14 @@ class CheckingInAddStaffLogic extends BaseGetXController{
// TODO: implement onInit // TODO: implement onInit
super.onInit(); super.onInit();
print("onInit()"); print("onInit()");
} }
@override @override
void onClose() { void onClose() {
// TODO: implement onClose // TODO: implement onClose
super.onClose();
_getNumberEvent!.cancel();
} }
} }

View File

@ -8,6 +8,7 @@ import '../../../../../tools/commonItem.dart';
import '../../../../../tools/showBottomSheetTool.dart'; import '../../../../../tools/showBottomSheetTool.dart';
import '../../../../../tools/submitBtn.dart'; import '../../../../../tools/submitBtn.dart';
import '../../../../../tools/titleAppBar.dart'; import '../../../../../tools/titleAppBar.dart';
import '../../../../../tools/toast.dart';
import '../../../../../translations/trans_lib.dart'; import '../../../../../translations/trans_lib.dart';
import 'checkingInAddStaff_logic.dart'; import 'checkingInAddStaff_logic.dart';
@ -49,12 +50,10 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
var list = ["APP", "密码", "", "指纹"]; var list = ["APP", "密码", "", "指纹"];
_showSeletClockInType(list, "1"); _showSeletClockInType(list, "1");
})), })),
SizedBox( SizedBox(height: 10.h,),
height: 10.h, //App
), Obx(() => CommonItem(
CommonItem( leftTitel:addStaffGetIfHaveKey(),
leftTitel:
TranslationLoader.lanKeys!.whetherTheEmployeeHasAKey!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
@ -72,9 +71,10 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
}); });
}), }),
], ],
)), ))),
// App时显示
Obx(() => Visibility( Obx(() => Visibility(
visible: state.appUnHaveAccount.value, visible: (state.appUnHaveAccount.value && state.seletPrintingMethodType.value == "1") ? true : false,
child: Column( child: Column(
children: [ children: [
CommonItem( CommonItem(
@ -108,10 +108,77 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
], ],
), ),
)), )),
//
Obx(() => Visibility(
visible: (state.seletPrintingMethodType.value != "1" && state.appUnHaveAccount.value) ? true : false,
child: CommonItem(
leftTitel: addStaffGetKeyType(),
isHaveLine: false,
isHaveRightWidget: true,
rightWidget: Row(
children: [
Obx(() => Text(state.getDataPassword.value, style: TextStyle(fontSize: 24.sp))),
SizedBox(width: 30.w,),
SizedBox(
width: 130.w,
height: 40.h,
child: ElevatedButton(
style: ElevatedButton.styleFrom(backgroundColor: AppColors.mainColor,),
child: Text(addStaffSeletKeyType(), style: TextStyle(color: Colors.white, fontSize: 22.sp)),
onPressed: () async {
switch(int.parse(state.seletPrintingMethodType.value)){
case 2:
//
logic.getKeyboardPwdRequest();
break;
case 3:
//
if(state.staffNameController.text.isEmpty){
Toast.show(msg: "请输入姓名");
return;
}
var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
"lockId": state.getKeyInfosData.value.lockId,
"keyType": 0,
"fromType": 2, // 1 2
"fromTypeTwoStaffName" :state.staffNameController.text
});
if(data != null) {
}
break;
case 4:
//
if(state.staffNameController.text.isEmpty){
Toast.show(msg: "请输入姓名");
return;
}
var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
"lockId": state.getKeyInfosData.value.lockId,
"keyType": 1,
"fromType": 2, // 1 2
"fromTypeTwoStaffName" :state.staffNameController.text
});
if(data != null) {
}
break;
break;
}
}
),
),
],
)),
)),
//
Obx(() => Visibility( Obx(() => Visibility(
visible: !state.appUnHaveAccount.value, visible: !state.appUnHaveAccount.value,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.selectKey!.tr, leftTitel: addStaffGetKeyType(),
rightTitle: state.seletKey.value, rightTitle: state.seletKey.value,
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
@ -126,15 +193,18 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
}), }),
)), )),
SizedBox( SizedBox(height: 50.w),
height: 50.w,
),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.sure!.tr, btnName: TranslationLoader.lanKeys!.sure!.tr,
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () {
if(state.staffNameController.text.isEmpty){
Toast.show(msg: "请输入姓名");
return;
}
if(state.isAdd.value == "2"){ if(state.isAdd.value == "2"){
logic.editStaffLoadData(); logic.editStaffLoadData();
}else{ }else{
@ -191,13 +261,16 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
data: list, data: list,
// //
clickCallBack: (int index, var str) { clickCallBack: (int index, var str) {
print("object:$index str:$str"); setState(() {
if(type == "1"){ if(type == "1"){
state.seletPrintingMethodType.value = (index+1).toString(); state.seletPrintingMethodType.value = (index+1).toString();
state.seletPrintingMethodStr.value = str.toString(); state.seletPrintingMethodStr.value = str.toString();
}else{ state.getDataPassword.value = "";
state.seletKey.value = str.toString(); }else{
} state.seletKey.value = str.toString();
}
print("object:$index str:$str type:$type state.seletPrintingMethodType.value:${state.seletPrintingMethodType.value}");
});
}); });
} }
@ -224,4 +297,62 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
), ),
); );
} }
String addStaffGetIfHaveKey(){
String title = "";
switch(int.parse(state.seletPrintingMethodType.value)){
case 1:
title = TranslationLoader.lanKeys!.whetherTheEmployeeHasAKey!.tr;
break;
case 2:
title = TranslationLoader.lanKeys!.whetherTheEmployeeHasPassword!.tr;
break;
case 3:
title = TranslationLoader.lanKeys!.whetherTheEmployeeHasCard!.tr;
break;
case 4:
title = TranslationLoader.lanKeys!.whetherTheEmployeeHasFingerprint!.tr;
break;
}
return title;
}
String addStaffGetKeyType(){
String title = "";
switch(int.parse(state.seletPrintingMethodType.value)){
case 1:
title = TranslationLoader.lanKeys!.accountNumber!.tr;
break;
case 2:
title = TranslationLoader.lanKeys!.password!.tr;
break;
case 3:
title = TranslationLoader.lanKeys!.card!.tr;
break;
case 4:
title = TranslationLoader.lanKeys!.fingerprint!.tr;
break;
}
return title;
}
String addStaffSeletKeyType(){
String title = "";
switch(int.parse(state.seletPrintingMethodType.value)){
case 1:
title = TranslationLoader.lanKeys!.getKey!.tr;
break;
case 2:
title = TranslationLoader.lanKeys!.getPassword!.tr;
break;
case 3:
title = TranslationLoader.lanKeys!.getCard!.tr;
break;
case 4:
title = TranslationLoader.lanKeys!.getFingerprint!.tr;
break;
}
return title;
}
} }

View File

@ -25,6 +25,7 @@ class CheckingInAddStaffState{
final seletKey = "".obs; final seletKey = "".obs;
final isAdd = "1".obs; // 1 2 final isAdd = "1".obs; // 1 2
final getDataPassword = "".obs;
CheckingInAddStaffState() { CheckingInAddStaffState() {
Map map = Get.arguments; Map map = Get.arguments;

View File

@ -86,8 +86,8 @@ class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
child: Row( child: Row(
children: [ children: [
SizedBox(width: 30.w,), SizedBox(width: 30.w,),
CustomNetworkImage(url: staffListItem.headurl!, width: 40.w , height: 40.w), // CustomNetworkImage(url: staffListItem.headurl!, width: 40.w , height: 40.w),
// Image.asset('images/controls_user.png', width: 40.w, height: 40.w), Image.asset('images/controls_user.png', width: 40.w, height: 40.w),
SizedBox(width: 30.w,), SizedBox(width: 30.w,),
Text(staffListItem.staffName!, style: TextStyle(fontSize: 24.sp)), Text(staffListItem.staffName!, style: TextStyle(fontSize: 24.sp)),
], ],

View File

@ -14,6 +14,7 @@ import '../../../../../blue/io_tool/manager_event_bus.dart';
import '../../../../../blue/sender_manage.dart'; import '../../../../../blue/sender_manage.dart';
import '../../../../../network/api_repository.dart'; import '../../../../../network/api_repository.dart';
import '../../../../../tools/baseGetXController.dart'; import '../../../../../tools/baseGetXController.dart';
import '../../../../../tools/eventBusEventManage.dart';
import '../../../../../tools/storage.dart'; import '../../../../../tools/storage.dart';
import '../../../../../tools/toast.dart'; import '../../../../../tools/toast.dart';
import 'addFingerprint_state.dart'; import 'addFingerprint_state.dart';
@ -231,6 +232,10 @@ class AddFingerprintLogic extends BaseGetXController {
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
Toast.show(msg: "添加成功"); Toast.show(msg: "添加成功");
if(state.fromType.value == 2){
//
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(""));
}
Get.close(3); Get.close(3);
} }
} }

View File

@ -13,6 +13,7 @@ class AddFingerprintState{
final isCoerced = "".obs; final isCoerced = "".obs;
final startDate = "".obs; final startDate = "".obs;
final weekDay = [].obs; final weekDay = [].obs;
final fromType = 0.obs;
AddFingerprintState() { AddFingerprintState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -26,5 +27,6 @@ class AddFingerprintState{
startDate.value = map["startDate"]; startDate.value = map["startDate"];
lockId.value = map["lockId"]; lockId.value = map["lockId"];
weekDay.value = map["weekDay"]; weekDay.value = map["weekDay"];
fromType.value = map["fromType"];
} }
} }

View File

@ -11,6 +11,7 @@ class AddFingerprintTipState{
final isCoerced = "".obs; final isCoerced = "".obs;
final startDate = "".obs; final startDate = "".obs;
final weekDay = [].obs; final weekDay = [].obs;
final fromType = 0.obs;
AddFingerprintTipState() { AddFingerprintTipState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -24,5 +25,6 @@ class AddFingerprintTipState{
startDate.value = map["startDate"]; startDate.value = map["startDate"];
lockId.value = map["lockId"]; lockId.value = map["lockId"];
weekDay.value = map["weekDay"]; weekDay.value = map["weekDay"];
fromType.value = map["fromType"];
} }
} }

View File

@ -14,6 +14,7 @@ import '../../../../blue/io_tool/io_tool.dart';
import '../../../../blue/io_tool/manager_event_bus.dart'; import '../../../../blue/io_tool/manager_event_bus.dart';
import '../../../../blue/sender_manage.dart'; import '../../../../blue/sender_manage.dart';
import '../../../../network/api_repository.dart'; import '../../../../network/api_repository.dart';
import '../../../../tools/eventBusEventManage.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/storage.dart';
import '../../../../tools/toast.dart'; import '../../../../tools/toast.dart';
import 'addICCard_state.dart'; import 'addICCard_state.dart';
@ -186,7 +187,11 @@ class AddICCardLogic extends BaseGetXController{
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
Toast.show(msg: "添加成功"); Toast.show(msg: "添加成功");
Get.close(3); if(state.fromType.value == 2){
//
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(""));
}
Get.close(2);
} }
} }

View File

@ -13,6 +13,7 @@ class AddICCardState{
final isCoerced = "".obs; final isCoerced = "".obs;
final startDate = "".obs; final startDate = "".obs;
final weekDay = [].obs; final weekDay = [].obs;
final fromType = 0.obs;
AddICCardState() { AddICCardState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -26,5 +27,6 @@ class AddICCardState{
startDate.value = map["startDate"]; startDate.value = map["startDate"];
lockId.value = map["lockId"]; lockId.value = map["lockId"];
weekDay.value = map["weekDay"]; weekDay.value = map["weekDay"];
fromType.value = map["fromType"];
} }
} }

View File

@ -73,7 +73,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
} }
switch (state.fromType.value) { switch (state.lockType.value) {
case 0: case 0:
// //
Get.toNamed(Routers.addICCardPage, arguments: { Get.toNamed(Routers.addICCardPage, arguments: {
@ -86,6 +86,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
"isCoerced": state.isStressFingerprint.value ? "1" : "2", "isCoerced": state.isStressFingerprint.value ? "1" : "2",
"startDate": startDate, "startDate": startDate,
"weekDay": state.weekdaysList.value, "weekDay": state.weekdaysList.value,
"fromType": state.fromType.value,
}); });
// var entity = await ApiRepository.to.addICCardData( // var entity = await ApiRepository.to.addICCardData(
@ -117,6 +118,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
"isCoerced": state.isStressFingerprint.value ? "1" : "2", "isCoerced": state.isStressFingerprint.value ? "1" : "2",
"startDate": startDate, "startDate": startDate,
"weekDay": state.weekdaysList.value, "weekDay": state.weekdaysList.value,
"fromType": state.fromType.value,
}); });
// var entity = await ApiRepository.to.addFingerprintsData( // var entity = await ApiRepository.to.addFingerprintsData(

View File

@ -18,8 +18,10 @@ class OtherTypeAddKeyPage extends StatefulWidget {
final String seletType; final String seletType;
final int lockType; // 0 1 2 final int lockType; // 0 1 2
final int lockId; final int lockId;
final int fromType;// // 1 2
final String fromTypeTwoStaffName;//
const OtherTypeAddKeyPage( const OtherTypeAddKeyPage(
{Key? key, required this.seletType, required this.lockType, required this.lockId}) : super(key: key); {Key? key, required this.seletType, required this.lockType, required this.lockId, required this.fromType, required this.fromTypeTwoStaffName}) : super(key: key);
@override @override
State<OtherTypeAddKeyPage> createState() => _OtherTypeAddKeyPageState(); State<OtherTypeAddKeyPage> createState() => _OtherTypeAddKeyPageState();
@ -32,8 +34,9 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
state.seletType.value = widget.seletType; state.seletType.value = widget.seletType;
state.fromType.value = widget.lockType; state.lockType.value = widget.lockType;
state.lockId.value = widget.lockId; state.lockId.value = widget.lockId;
state.nameController.text = widget.fromTypeTwoStaffName;
return indexChangeWidget(); return indexChangeWidget();
} }

View File

@ -6,7 +6,8 @@ import 'package:get/get.dart';
class OtherTypeAddKeyState{ class OtherTypeAddKeyState{
final lockId = 0.obs; final lockId = 0.obs;
final seletType = "0".obs;// 0 1 2 final seletType = "0".obs;// 0 1 2
final fromType = 0.obs;// 0 1 2 final lockType = 0.obs;// 0 1 2
final fromType = 0.obs; // // 1 2
final isStressFingerprint = false.obs; final isStressFingerprint = false.obs;
var beginTime = "".obs;// var beginTime = "".obs;//
@ -20,8 +21,8 @@ class OtherTypeAddKeyState{
final TextEditingController nameController = TextEditingController(); final TextEditingController nameController = TextEditingController();
OtherTypeAddKeyState() { OtherTypeAddKeyState() {
Map map = Get.arguments; // Map map = Get.arguments;
lockId.value = map["lockId"]; // lockId.value = map["lockId"];
fromType.value = map["fromType"]; // fromType.value = map["fromType"];
} }
} }

View File

@ -251,95 +251,95 @@ class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
); );
} }
Widget addControlsBtn(int type) { // Widget addControlsBtn(int type) {
List<Widget> widgetList = []; // List<Widget> widgetList = [];
List<Map<String, dynamic>> routerList = []; // List<Map<String, dynamic>> routerList = [];
// // //
if (type == 0) { // if (type == 0) {
routerList.add({ // routerList.add({
'btnTitle': '设置密码', // 'btnTitle': '设置密码',
'routerName': Routers.passwordKeyDetailPage, // 'routerName': Routers.passwordKeyDetailPage,
'type': 9 // 'type': 9
}); // });
routerList.add({ // routerList.add({
'btnTitle': '设置指纹', // 'btnTitle': '设置指纹',
'routerName': Routers.otherTypeKeyManagePage, // 'routerName': Routers.otherTypeKeyManagePage,
'type': 1 // 'type': 1
}); // });
routerList.add({ // routerList.add({
'btnTitle': '设置遥控', // 'btnTitle': '设置遥控',
'routerName': Routers.otherTypeKeyManagePage, // 'routerName': Routers.otherTypeKeyManagePage,
'type': 2 // 'type': 2
}); // });
} else if (type == 1) { // } else if (type == 1) {
// // //
routerList.add({ // routerList.add({
'btnTitle': '设置密码', // 'btnTitle': '设置密码',
'routerName': Routers.passwordKeyDetailPage, // 'routerName': Routers.passwordKeyDetailPage,
'type': 9 // 'type': 9
}); // });
routerList.add({ // routerList.add({
'btnTitle': '设置卡', // 'btnTitle': '设置卡',
'routerName': Routers.otherTypeKeyManagePage, // 'routerName': Routers.otherTypeKeyManagePage,
'type': 0 // 'type': 0
}); // });
routerList.add({ // routerList.add({
'btnTitle': '设置遥控', // 'btnTitle': '设置遥控',
'routerName': Routers.otherTypeKeyManagePage, // 'routerName': Routers.otherTypeKeyManagePage,
'type': 2 // 'type': 2
}); // });
} else if (type == 2) { // } else if (type == 2) {
// // //
routerList.add({ // routerList.add({
'btnTitle': '设置密码', // 'btnTitle': '设置密码',
'routerName': Routers.passwordKeyDetailPage, // 'routerName': Routers.passwordKeyDetailPage,
'type': 9 // 'type': 9
}); // });
routerList.add({ // routerList.add({
'btnTitle': '设置卡', // 'btnTitle': '设置卡',
'routerName': Routers.otherTypeKeyManagePage, // 'routerName': Routers.otherTypeKeyManagePage,
'type': 0 // 'type': 0
}); // });
routerList.add({ // routerList.add({
'btnTitle': '设置指纹', // 'btnTitle': '设置指纹',
'routerName': Routers.otherTypeKeyManagePage, // 'routerName': Routers.otherTypeKeyManagePage,
'type': 1 // 'type': 1
}); // });
} // }
//
for (int i = 0; i < routerList.length; i++) { // for (int i = 0; i < routerList.length; i++) {
widgetList.add(SizedBox( // widgetList.add(SizedBox(
width: ScreenUtil().screenWidth - 40.w, // width: ScreenUtil().screenWidth - 40.w,
height: 60.h, // height: 60.h,
child: OutlinedButton( // child: OutlinedButton(
style: OutlinedButton.styleFrom( // style: OutlinedButton.styleFrom(
// backgroundColor: Colors.white, // // backgroundColor: Colors.white,
side: BorderSide(width: 1, color: AppColors.mainColor)), // side: BorderSide(width: 1, color: AppColors.mainColor)),
onPressed: () { // onPressed: () {
if (routerList[i]['type'] == 9) { // if (routerList[i]['type'] == 9) {
Navigator.pushNamed(context, Routers.passwordKeyManagePage); // Navigator.pushNamed(context, Routers.passwordKeyManagePage);
} else { // } else {
Navigator.pushNamed(context, Routers.otherTypeKeyManagePage, // Navigator.pushNamed(context, Routers.otherTypeKeyManagePage,
arguments: routerList[i]['type']); // arguments: routerList[i]['type']);
} // }
}, // },
child: Text( // child: Text(
routerList[i]['btnTitle'], // routerList[i]['btnTitle'],
style: TextStyle(color: AppColors.mainColor, fontSize: 24.sp), // style: TextStyle(color: AppColors.mainColor, fontSize: 24.sp),
)), // )),
)); // ));
//
widgetList.add( // widgetList.add(
SizedBox( // SizedBox(
height: 10.h, // height: 10.h,
), // ),
); // );
} // }
//
return Column( // return Column(
children: widgetList, // children: widgetList,
); // );
} // }
String getAppBarTitle(int type) { String getAppBarTitle(int type) {
String title = ""; String title = "";

View File

@ -70,7 +70,8 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
onClick: () async { onClick: () async {
var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: { var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
"lockId": state.lockId.value, "lockId": state.lockId.value,
"fromType": state.fromType.value "keyType": state.fromType.value,
"fromType": 1 // 1 2
}); });
if(data != null) { if(data != null) {
switch (state.fromType.value) { switch (state.fromType.value) {

View File

@ -22,18 +22,23 @@ class _OtherTypeKeyManagePageState extends State<OtherTypeKeyManagePage> {
// 0 1 2 // 0 1 2
Map map = Get.arguments; Map map = Get.arguments;
var lockId = map["lockId"]; var lockId = map["lockId"];
var lockType = map["fromType"]; var lockKeyType = map["keyType"];
var fromType = map["fromType"]; // 1 2
var fromTypeTwoStaffName = "";
if(fromType == 2){
fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; //
}
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: barTitle:
"${TranslationLoader.lanKeys!.addTip!.tr}${getAppBarTitle(lockType)}", "${TranslationLoader.lanKeys!.addTip!.tr}${getAppBarTitle(lockKeyType)}",
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: [
OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockType, lockId: lockId), OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockKeyType, lockId: lockId, fromType: fromType, fromTypeTwoStaffName:fromTypeTwoStaffName),
], ],
), ),
); );

View File

@ -11,8 +11,10 @@ class OtherTypeKeyManageTabbar extends StatefulWidget {
var initialIndex = 1; var initialIndex = 1;
var lockType = 0; var lockType = 0;
var lockId = 0; var lockId = 0;
var fromType = 0; // 1 2
var fromTypeTwoStaffName = "";//
OtherTypeKeyManageTabbar( OtherTypeKeyManageTabbar(
{Key? key, required this.initialIndex, required this.lockType, required this.lockId}) {Key? key, required this.initialIndex, required this.lockType, required this.lockId, required this.fromType, required this.fromTypeTwoStaffName})
: super(key: key); : super(key: key);
@override @override
@ -91,6 +93,8 @@ class _OtherTypeKeyManageTabbarState extends State<OtherTypeKeyManageTabbar>
seletType: item.seletType, seletType: item.seletType,
lockType: widget.lockType, lockType: widget.lockType,
lockId: widget.lockId, lockId: widget.lockId,
fromType: widget.fromType,
fromTypeTwoStaffName:widget.fromTypeTwoStaffName
)) ))
.toList(), .toList(),
), ),

View File

@ -24,3 +24,9 @@ class PassCurrentLockInformationEvent{
class OtherTypeRefreshListEvent{ class OtherTypeRefreshListEvent{
OtherTypeRefreshListEvent(); OtherTypeRefreshListEvent();
} }
/// number
class ChickInAddStaffCardAndFingerprintBlockNumberEvent{
String number;
ChickInAddStaffCardAndFingerprintBlockNumberEvent(this.number);
}

View File

@ -387,10 +387,19 @@ class LanKeyEntity {
this.wifiPwd, this.wifiPwd,
this.pleaseEnterWifiPwd, this.pleaseEnterWifiPwd,
this.wifiDistributionNetwork, this.wifiDistributionNetwork,
this.attendanceRecord, this.attendanceRecord,
this.edit, this.edit,
this.stressFingerprint, this.stressFingerprint,
this.effectiveDay this.effectiveDay,
this.whetherTheEmployeeHasPassword,
this.whetherTheEmployeeHasCard,
this.whetherTheEmployeeHasFingerprint,
this.seletPassword,
this.seletCard,
this.seletFingerprint,
this.getKey,
this.getCard,
this.getFingerprint,
}); });
LanKeyEntity.fromJson(dynamic json) { LanKeyEntity.fromJson(dynamic json) {
@ -815,6 +824,15 @@ class LanKeyEntity {
edit = json['edit']; edit = json['edit'];
stressFingerprint = json['stressFingerprint']; stressFingerprint = json['stressFingerprint'];
effectiveDay = json['effectiveDay']; effectiveDay = json['effectiveDay'];
whetherTheEmployeeHasPassword = json['whetherTheEmployeeHasPassword'];
whetherTheEmployeeHasCard = json['whetherTheEmployeeHasCard'];
whetherTheEmployeeHasFingerprint = json['whetherTheEmployeeHasFingerprint'];
seletPassword = json['seletPassword'];
seletCard = json['seletCard'];
seletFingerprint = json['seletFingerprint'];
getKey = json['getKey'];
getCard = json['getCard'];
getFingerprint = json['getFingerprint'];
} }
String? starLock; String? starLock;
String? clickUnlockAndHoldDownClose; String? clickUnlockAndHoldDownClose;
@ -1225,6 +1243,16 @@ class LanKeyEntity {
String? edit; String? edit;
String? stressFingerprint; String? stressFingerprint;
String? effectiveDay; String? effectiveDay;
String? whetherTheEmployeeHasPassword;
String? whetherTheEmployeeHasCard;
String? whetherTheEmployeeHasFingerprint;
String? seletPassword;
String? seletCard;
String? seletFingerprint;
String? getKey;
String? getCard;
String? getFingerprint;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['starLock'] = starLock; map['starLock'] = starLock;
@ -1645,6 +1673,15 @@ class LanKeyEntity {
map['edit'] = edit; map['edit'] = edit;
map['stressFingerprint'] = stressFingerprint; map['stressFingerprint'] = stressFingerprint;
map['effectiveDay'] = effectiveDay; map['effectiveDay'] = effectiveDay;
map['whetherTheEmployeeHasPassword'] = whetherTheEmployeeHasPassword;
map['whetherTheEmployeeHasCard'] = whetherTheEmployeeHasCard;
map['whetherTheEmployeeHasFingerprint'] = whetherTheEmployeeHasFingerprint;
map['seletPassword'] = seletPassword;
map['seletCard'] = seletCard;
map['seletFingerprint'] = seletFingerprint;
map['getKey'] = getKey;
map['getCard'] = getCard;
map['getFingerprint'] = getFingerprint;
return map; return map;
} }
} }