|
|
@@ -814,12 +814,12 @@
|
|
|
<el-table-column align="center" label="操作" width="200">
|
|
|
<template #default="scope">
|
|
|
<div class="options">
|
|
|
- <!-- <div
|
|
|
+ <div
|
|
|
class="reset"
|
|
|
@click="fingerprintEdit(scope.row)"
|
|
|
>
|
|
|
- 修改
|
|
|
- </div> -->
|
|
|
+ 编辑
|
|
|
+ </div>
|
|
|
<el-popconfirm
|
|
|
width="220"
|
|
|
confirm-button-text="确认"
|
|
|
@@ -947,7 +947,7 @@
|
|
|
<el-table-column align="center" label="操作" width="200">
|
|
|
<template #default="scope">
|
|
|
<div class="options">
|
|
|
- <!-- <div class="reset" @click="edit(scope.row)">修改</div> -->
|
|
|
+ <div class="reset" @click="customFingerprintEdit(scope.row)">编辑</div>
|
|
|
<el-popconfirm
|
|
|
width="220"
|
|
|
confirm-button-text="确认"
|
|
|
@@ -1023,6 +1023,7 @@
|
|
|
class="m-2"
|
|
|
placeholder="请选择用户"
|
|
|
style="width: 500px"
|
|
|
+ :disabled="passManagementEditFlag==2"
|
|
|
@change="staffChange($event, '密码')"
|
|
|
v-if="keypassflag == '系统'"
|
|
|
>
|
|
|
@@ -1036,6 +1037,7 @@
|
|
|
v-model.trim="passManagementRuleForm.name"
|
|
|
placeholder="请输入用户"
|
|
|
style="width: 500px"
|
|
|
+ :disabled="passManagementEditFlag==2"
|
|
|
v-if="keypassflag == '自定义'"
|
|
|
>
|
|
|
</el-input>
|
|
|
@@ -1048,6 +1050,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="passManagementRuleForm.phone"
|
|
|
placeholder="请输入号码"
|
|
|
+ :disabled="passManagementEditFlag==2"
|
|
|
style="width: 500px"
|
|
|
>
|
|
|
</el-input>
|
|
|
@@ -1057,11 +1060,20 @@
|
|
|
v-model.trim="passManagementRuleForm.pass"
|
|
|
placeholder="请输入6-8位数密码或者点击随机生成"
|
|
|
style="width: 500px"
|
|
|
+ v-if="passManagementEditFlag==1"
|
|
|
>
|
|
|
<template #append>
|
|
|
<div @click="randomCipher">随机生成</div>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
+ <el-input
|
|
|
+ v-if="passManagementEditFlag==2"
|
|
|
+ v-model.trim="passManagementRuleForm.pass"
|
|
|
+ placeholder="请输入6-8位数密码或者点击随机生成"
|
|
|
+ style="width: 500px"
|
|
|
+ :disabled="true"
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="生效时间 :" prop="effectiveTime">
|
|
|
<div class="block">
|
|
|
@@ -1144,6 +1156,7 @@
|
|
|
class="m-2"
|
|
|
placeholder="请选择用户"
|
|
|
style="width: 214px"
|
|
|
+ :disabled="fingerprintEditFlag==2"
|
|
|
@change="staffChange($event, '指纹')"
|
|
|
v-if="keypassflag == '系统'"
|
|
|
>
|
|
|
@@ -1158,6 +1171,7 @@
|
|
|
placeholder="请输入用户"
|
|
|
style="width: 214px"
|
|
|
v-if="keypassflag == '自定义'"
|
|
|
+ :disabled="fingerprintEditFlag==2"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item
|
|
|
@@ -1168,6 +1182,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="fingerprintRuleForm.phone"
|
|
|
placeholder="请输入号码"
|
|
|
+ :disabled="fingerprintEditFlag==2"
|
|
|
style="width: 214px"
|
|
|
>
|
|
|
</el-input>
|
|
|
@@ -1179,6 +1194,7 @@
|
|
|
style="width: 300px"
|
|
|
type="textarea"
|
|
|
rows="4"
|
|
|
+ :disabled="fingerprintEditFlag==2"
|
|
|
/>
|
|
|
<span
|
|
|
style="
|
|
|
@@ -1187,6 +1203,7 @@
|
|
|
cursor: pointer;
|
|
|
"
|
|
|
@click="fingerprintNext"
|
|
|
+ v-if="fingerprintEditFlag==1"
|
|
|
>录入</span
|
|
|
>
|
|
|
</el-form-item>
|
|
|
@@ -1313,6 +1330,7 @@
|
|
|
class="m-2"
|
|
|
placeholder="再请选择用户"
|
|
|
style="width: 214px"
|
|
|
+ :disabled="identityCardEditFlag==2"
|
|
|
@change="staffChange($event, '房卡')"
|
|
|
v-if="keypassflag == '系统' || keypassflag == '总卡'"
|
|
|
>
|
|
|
@@ -1325,6 +1343,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="identityCardRuleForm.name"
|
|
|
placeholder="请输入用户"
|
|
|
+ :disabled="identityCardEditFlag==2"
|
|
|
style="width: 214px"
|
|
|
v-if="keypassflag == '自定义'"
|
|
|
/>
|
|
|
@@ -1337,6 +1356,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="identityCardRuleForm.phone"
|
|
|
placeholder="请输入号码"
|
|
|
+ :disabled="identityCardEditFlag==2"
|
|
|
style="width: 214px"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
@@ -1353,6 +1373,7 @@
|
|
|
<el-input
|
|
|
v-model.trim="identityCardRuleForm.icCard"
|
|
|
placeholder="请输入卡号"
|
|
|
+ :disabled="identityCardEditFlag==2"
|
|
|
style="width: 300px"
|
|
|
type="textarea"
|
|
|
rows="4"
|
|
|
@@ -1364,6 +1385,7 @@
|
|
|
margin-left: 10px;
|
|
|
cursor: pointer;
|
|
|
"
|
|
|
+ v-if="identityCardEditFlag==1"
|
|
|
@click="identityCardNext"
|
|
|
>读卡</span
|
|
|
>
|
|
|
@@ -1802,16 +1824,18 @@ const systemUserList = ref(); // 系统用户
|
|
|
const customList = ref(); // 自定义用户
|
|
|
const keypassflag = ref(""); // 添加系统或者自定义用户
|
|
|
const cardFlag = ref(""); // 判断是添加房卡还是身份证
|
|
|
+
|
|
|
// 钥匙管理 密码管理(--------------------------------------------------------)
|
|
|
const passManagementVisible = ref(false);
|
|
|
const passManagementIndex = ref(1); // 默认选中 时效密码
|
|
|
+const passManagementEditFlag=ref(1) // 判断是添加还是编辑 1.添加 2.编辑
|
|
|
const passManagementRef = ref();
|
|
|
const passManagementRuleForm = reactive({
|
|
|
// level: '',
|
|
|
name: "",
|
|
|
phone: "",
|
|
|
- effectiveTime: "",
|
|
|
- failureTime: "",
|
|
|
+ effectiveTime: "",// 开始时间
|
|
|
+ failureTime: "",//结束时间
|
|
|
pass: "",
|
|
|
id: "",
|
|
|
});
|
|
|
@@ -1854,6 +1878,7 @@ const staffList = ref(); // 选择的员工数据
|
|
|
// 钥匙管理 添加指纹(--------------------------------------------------------)
|
|
|
const fingerprintVisible = ref(false);
|
|
|
const fingerprintRef = ref();
|
|
|
+const fingerprintEditFlag=ref(1)// 判断是1、添加还是2、编辑
|
|
|
const fingerprintprops = {
|
|
|
checkStrictly: true,
|
|
|
label: "name",
|
|
|
@@ -1932,6 +1957,7 @@ const ws = ref("");
|
|
|
// 钥匙管理 添加身份证(--------------------------------------------------------)
|
|
|
const addIdentityCardVisibleTitle = ref("添加身份证");
|
|
|
const identityCardVisible = ref(false);
|
|
|
+const identityCardEditFlag=ref(1) // 判断是添加还是编辑 1.添加 2.编辑
|
|
|
const identityCardRef = ref();
|
|
|
const identityCardRuleForm = reactive({
|
|
|
level: "",
|
|
|
@@ -2811,6 +2837,7 @@ const cancelKey = () => {
|
|
|
// 钥匙管理 密码管理(-----------------------------------------------------------------)
|
|
|
const passManagementClick = (val) => {
|
|
|
keypassflag.value = val;
|
|
|
+ passManagementEditFlag.value=1
|
|
|
// rolesList();
|
|
|
// fingerprintChangeList.value=""
|
|
|
passManagementVisible.value = true;
|
|
|
@@ -2820,9 +2847,6 @@ const passManagementClick = (val) => {
|
|
|
passManagementRuleForm.effectiveTime = "";
|
|
|
passManagementRuleForm.failureTime = "";
|
|
|
passManagementRuleForm.pass = "";
|
|
|
- nextTick(() => {
|
|
|
- passManagementRef.value.resetFields();
|
|
|
- });
|
|
|
};
|
|
|
const cancelPassManagement = () => {
|
|
|
passManagementVisible.value = false;
|
|
|
@@ -2839,7 +2863,8 @@ const passManagementSend = (formEl) => {
|
|
|
formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
if (keypassflag.value == "系统") {
|
|
|
- let data = {
|
|
|
+ if(passManagementEditFlag.value==1){
|
|
|
+ let data = {
|
|
|
permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
@@ -2849,8 +2874,8 @@ const passManagementSend = (formEl) => {
|
|
|
equipmentType: keyData.equipmentType, //设备id
|
|
|
passWord: passManagementRuleForm.pass, // 密码
|
|
|
type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
- };
|
|
|
- let res = await axios({
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/unlocking-employee/savePassWord",
|
|
|
headers: {
|
|
|
@@ -2858,9 +2883,9 @@ const passManagementSend = (formEl) => {
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
data: data,
|
|
|
- });
|
|
|
- console.log(res, "系统添加密码");
|
|
|
- if (res.data.code == 200) {
|
|
|
+ });
|
|
|
+ console.log(res, "系统添加密码");
|
|
|
+ if (res.data.code == 200) {
|
|
|
passManagementVisible.value = false;
|
|
|
keyListData();
|
|
|
ElMessage({
|
|
|
@@ -2869,16 +2894,51 @@ const passManagementSend = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
showClose: true,
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
+ }
|
|
|
+ }else if(passManagementEditFlag.value==2){
|
|
|
+ let data = {
|
|
|
+ unlockingAdminId: passManagementRuleForm.id, //系统用户钥匙id
|
|
|
+ startTime: passManagementRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: passManagementRuleForm.failureTime, //结束时间
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/unlocking-employee/updateLock",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ console.log(res, "员工编辑密码时效");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ passManagementVisible.value = false;
|
|
|
+ keyListData();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
} else if (keypassflag.value == "自定义") {
|
|
|
- let data = {
|
|
|
+ if(passManagementEditFlag.value==1){
|
|
|
+ let data = {
|
|
|
permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
@@ -2889,8 +2949,8 @@ const passManagementSend = (formEl) => {
|
|
|
equipmentType: keyData.equipmentType, //设备id
|
|
|
passWord: passManagementRuleForm.pass, // 密码
|
|
|
type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
- };
|
|
|
- let res = await axios({
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/unlocking-custom/savePassWord",
|
|
|
headers: {
|
|
|
@@ -2898,9 +2958,9 @@ const passManagementSend = (formEl) => {
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
data: data,
|
|
|
- });
|
|
|
- console.log(res, "自定义添加密码");
|
|
|
- if (res.data.code == 200) {
|
|
|
+ });
|
|
|
+ console.log(res, "自定义添加密码");
|
|
|
+ if (res.data.code == 200) {
|
|
|
passManagementVisible.value = false;
|
|
|
keyListData();
|
|
|
ElMessage({
|
|
|
@@ -2909,13 +2969,47 @@ const passManagementSend = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
showClose: true,
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
+ }
|
|
|
+ }else if(passManagementEditFlag.value==2){
|
|
|
+ let data = {
|
|
|
+ unlockingAdminId: passManagementRuleForm.id, //系统用户钥匙id
|
|
|
+ startTime: passManagementRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: passManagementRuleForm.failureTime, //结束时间
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/unlocking-custom/updateLock",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ console.log(res, "员工编辑密码时效");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ passManagementVisible.value = false;
|
|
|
+ keyListData();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
@@ -2945,6 +3039,102 @@ const randomCipher = async () => {
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
+// (员工)编辑密码,指纹,卡片,身份证时效
|
|
|
+const fingerprintEdit=(row)=>{
|
|
|
+ console.log(row,'编辑密码,指纹,卡片,身份证时效');
|
|
|
+ passManagementEditFlag.value=2
|
|
|
+ if(row.lockStatus==1){
|
|
|
+ passManagementVisible.value = true;
|
|
|
+ keypassflag.value ="系统"
|
|
|
+ // passManagementRuleForm.level = "";
|
|
|
+ // passManagementRuleForm.name = "";
|
|
|
+ passManagementRuleForm.name = row.employeeUserId;
|
|
|
+ passManagementRuleForm.effectiveTime = row.startTime;
|
|
|
+ passManagementRuleForm.failureTime = row.endTime;
|
|
|
+ passManagementRuleForm.pass = row.passWord;
|
|
|
+ passManagementRuleForm.id = row.id;
|
|
|
+ }else if(row.lockStatus==2){
|
|
|
+ addIdentityCardVisibleTitle.value = "编辑房卡";
|
|
|
+ keypassflag.value = '系统'
|
|
|
+ identityCardEditFlag.value=2
|
|
|
+ identityCardVisible.value = true;
|
|
|
+ identityCardRuleForm.name = row.employeeUserId;
|
|
|
+ identityCardRuleForm.icCard = row.card;
|
|
|
+ identityCardRuleForm.effectiveTime = row.startTime;
|
|
|
+ identityCardRuleForm.failureTime = row.endTime;
|
|
|
+ identityCardRuleForm.id=row.id
|
|
|
+ }else if(row.lockStatus==4){
|
|
|
+ addIdentityCardVisibleTitle.value = "编辑身份证";
|
|
|
+ keypassflag.value = '系统'
|
|
|
+ identityCardEditFlag.value=2
|
|
|
+ identityCardVisible.value = true;
|
|
|
+ identityCardRuleForm.name = row.employeeUserId;
|
|
|
+ identityCardRuleForm.icCard = row.card;
|
|
|
+ identityCardRuleForm.effectiveTime = row.startTime;
|
|
|
+ identityCardRuleForm.failureTime = row.endTime;
|
|
|
+ identityCardRuleForm.id=row.id
|
|
|
+ }else if(row.lockStatus==3){
|
|
|
+ addIdentityCardVisibleTitle.value = "编辑指纹";
|
|
|
+ keypassflag.value = '系统'
|
|
|
+ fingerprintEditFlag.value=2
|
|
|
+ fingerprintVisible.value = true;
|
|
|
+ fingerprintRuleForm.name = row.employeeUserId;
|
|
|
+ fingerprintRuleForm.fingerprintNum = row.fingerprintData;
|
|
|
+ fingerprintRuleForm.effectiveTime = row.startTime;
|
|
|
+ fingerprintRuleForm.failureTime = row.endTime;
|
|
|
+ fingerprintRuleForm.id=row.id
|
|
|
+ }
|
|
|
+}
|
|
|
+// (自定义)编辑密码,指纹,卡片,身份证时效
|
|
|
+const customFingerprintEdit=(row)=>{
|
|
|
+ console.log(row,'编辑密码,指纹,卡片,身份证时效');
|
|
|
+ passManagementEditFlag.value=2
|
|
|
+ if(row.lockStatus==1){
|
|
|
+ passManagementVisible.value = true;
|
|
|
+ keypassflag.value ="自定义"
|
|
|
+ // passManagementRuleForm.level = "";
|
|
|
+ // passManagementRuleForm.name = "";
|
|
|
+ passManagementRuleForm.name = row.name;
|
|
|
+ passManagementRuleForm.effectiveTime = row.startTime;
|
|
|
+ passManagementRuleForm.failureTime = row.endTime;
|
|
|
+ passManagementRuleForm.pass = row.passWord;
|
|
|
+ passManagementRuleForm.phone = row.phone;
|
|
|
+ passManagementRuleForm.id = row.id;
|
|
|
+ }else if(row.lockStatus==2){
|
|
|
+ addIdentityCardVisibleTitle.value = "编辑房卡";
|
|
|
+ keypassflag.value = '自定义'
|
|
|
+ identityCardEditFlag.value=2
|
|
|
+ identityCardVisible.value = true;
|
|
|
+ identityCardRuleForm.name = row.name;
|
|
|
+ identityCardRuleForm.phone = row.phone;
|
|
|
+ identityCardRuleForm.icCard = row.card;
|
|
|
+ identityCardRuleForm.effectiveTime = row.startTime;
|
|
|
+ identityCardRuleForm.failureTime = row.endTime;
|
|
|
+ identityCardRuleForm.id=row.id
|
|
|
+ }else if(row.lockStatus==4){
|
|
|
+ addIdentityCardVisibleTitle.value = "编辑身份证";
|
|
|
+ keypassflag.value = '自定义'
|
|
|
+ identityCardEditFlag.value=2
|
|
|
+ identityCardVisible.value = true;
|
|
|
+ identityCardRuleForm.name = row.name;
|
|
|
+ identityCardRuleForm.phone = row.phone;
|
|
|
+ identityCardRuleForm.icCard = row.card;
|
|
|
+ identityCardRuleForm.effectiveTime = row.startTime;
|
|
|
+ identityCardRuleForm.failureTime = row.endTime;
|
|
|
+ identityCardRuleForm.id=row.id
|
|
|
+ }else if(row.lockStatus==3){
|
|
|
+ addIdentityCardVisibleTitle.value = "编辑指纹";
|
|
|
+ keypassflag.value = '自定义'
|
|
|
+ fingerprintEditFlag.value=2
|
|
|
+ fingerprintVisible.value = true;
|
|
|
+ fingerprintRuleForm.name = row.name;
|
|
|
+ fingerprintRuleForm.phone = row.phone;
|
|
|
+ fingerprintRuleForm.fingerprintNum = row.fingerprintData;
|
|
|
+ fingerprintRuleForm.effectiveTime = row.startTime;
|
|
|
+ fingerprintRuleForm.failureTime = row.endTime;
|
|
|
+ fingerprintRuleForm.id=row.id
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
// // 获取管理端角色信息
|
|
|
// const rolesList = async () => {
|
|
|
@@ -3126,7 +3316,8 @@ const fingerprintconfig = (formEl) => {
|
|
|
formEl.validate(async (valid, fields) => {
|
|
|
if (valid) {
|
|
|
if (keypassflag.value == "系统") {
|
|
|
- let data = {
|
|
|
+ if(passManagementEditFlag.value==1){
|
|
|
+ let data = {
|
|
|
permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
@@ -3136,8 +3327,8 @@ const fingerprintconfig = (formEl) => {
|
|
|
luid: keyData.equipmentType, //设备id
|
|
|
fingerprintData: fingerprintRuleForm.fingerprintNum, //指纹特征值
|
|
|
type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
- };
|
|
|
- let res = await axios({
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/unlocking-employee/saveFingerprint",
|
|
|
headers: {
|
|
|
@@ -3145,9 +3336,9 @@ const fingerprintconfig = (formEl) => {
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
data: data,
|
|
|
- });
|
|
|
- console.log(res, "系统添加指纹钥匙");
|
|
|
- if (res.data.code == 200) {
|
|
|
+ });
|
|
|
+ console.log(res, "系统添加指纹钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
fingerprintVisible.value = false;
|
|
|
keyListData();
|
|
|
ElMessage({
|
|
|
@@ -3156,16 +3347,52 @@ const fingerprintconfig = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }else if(passManagementEditFlag.value==2){
|
|
|
+ let data = {
|
|
|
+ unlockingAdminId: fingerprintRuleForm.id, //系统用户钥匙id
|
|
|
+ startTime: fingerprintRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: fingerprintRuleForm.failureTime, //结束时间
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/unlocking-employee/updateLock",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ console.log(res, "系统编辑指纹钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ fingerprintVisible.value = false;
|
|
|
+ keyListData();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
showClose: true,
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
} else if (keypassflag.value == "自定义") {
|
|
|
- let data = {
|
|
|
+ if(passManagementEditFlag.value==1){
|
|
|
+ let data = {
|
|
|
permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
@@ -3176,8 +3403,8 @@ const fingerprintconfig = (formEl) => {
|
|
|
luid: keyData.equipmentType, //设备id
|
|
|
fingerprintData: fingerprintRuleForm.fingerprintNum, //指纹特征值
|
|
|
type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
- };
|
|
|
- let res = await axios({
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/unlocking-custom/saveFingerprint",
|
|
|
headers: {
|
|
|
@@ -3185,9 +3412,9 @@ const fingerprintconfig = (formEl) => {
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
data: data,
|
|
|
- });
|
|
|
- console.log(res, "自定义添加指纹钥匙");
|
|
|
- if (res.data.code == 200) {
|
|
|
+ });
|
|
|
+ console.log(res, "自定义添加指纹钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
fingerprintVisible.value = false;
|
|
|
keyListData();
|
|
|
ElMessage({
|
|
|
@@ -3196,13 +3423,47 @@ const fingerprintconfig = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
showClose: true,
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
+ }
|
|
|
+ }else if(passManagementEditFlag.value==2){
|
|
|
+ let data = {
|
|
|
+ unlockingAdminId: fingerprintRuleForm.id, //系统用户钥匙id
|
|
|
+ startTime: fingerprintRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: fingerprintRuleForm.failureTime, //结束时间
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/unlocking-custom/updateLock",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ console.log(res, "自定义编辑指纹钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ fingerprintVisible.value = false;
|
|
|
+ keyListData();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -3303,6 +3564,7 @@ const identityCardClick = (val, card) => {
|
|
|
// fingerprintChangeList.value=""
|
|
|
|
|
|
identityCardVisible.value = true;
|
|
|
+ identityCardEditFlag.value=1
|
|
|
identityCardRuleForm.level = "";
|
|
|
identityCardRuleForm.name = "";
|
|
|
identityCardRuleForm.phone = "";
|
|
|
@@ -3310,9 +3572,9 @@ const identityCardClick = (val, card) => {
|
|
|
identityCardRuleForm.cardType = "";
|
|
|
identityCardRuleForm.effectiveTime = "";
|
|
|
identityCardRuleForm.failureTime = "";
|
|
|
- nextTick(() => {
|
|
|
- identityCardRef.value.resetFields();
|
|
|
- });
|
|
|
+ // nextTick(() => {
|
|
|
+ // identityCardRef.value.resetFields();
|
|
|
+ // });
|
|
|
};
|
|
|
const cancelIdentityCard = () => {
|
|
|
identityCardVisible.value = false;
|
|
|
@@ -3392,7 +3654,8 @@ const identityCardConfig = (formEl) => {
|
|
|
} else if (cardFlag.value == "身份证") {
|
|
|
identityCardRuleForm.cardType = 1;
|
|
|
}
|
|
|
- let data = {
|
|
|
+ if(identityCardEditFlag.value==1){
|
|
|
+ let data = {
|
|
|
permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
@@ -3403,9 +3666,9 @@ const identityCardConfig = (formEl) => {
|
|
|
card: identityCardRuleForm.icCard, //指纹特征值
|
|
|
cardType: identityCardRuleForm.cardType, //指纹特征值
|
|
|
type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
- };
|
|
|
-
|
|
|
- let res = await axios({
|
|
|
+ };
|
|
|
+
|
|
|
+ let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/unlocking-employee/saveCard",
|
|
|
headers: {
|
|
|
@@ -3413,9 +3676,9 @@ const identityCardConfig = (formEl) => {
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
data: data,
|
|
|
- });
|
|
|
- console.log(res, "系统添加卡片钥匙");
|
|
|
- if (res.data.code == 200) {
|
|
|
+ });
|
|
|
+ console.log(res, "系统添加卡片钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
loading.close();
|
|
|
identityCardVisible.value = false;
|
|
|
keyListData();
|
|
|
@@ -3425,7 +3688,7 @@ const identityCardConfig = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
loading.close();
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
@@ -3433,27 +3696,65 @@ const identityCardConfig = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
+ }
|
|
|
+ }else if(identityCardEditFlag.value==2){
|
|
|
+ let data = {
|
|
|
+ startTime: identityCardRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: identityCardRuleForm.failureTime, //结束时间
|
|
|
+ unlockingAdminId: identityCardRuleForm.id, //用户id
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/unlocking-employee/updateLock",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ console.log(res, "编辑添加卡片时效");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ loading.close();
|
|
|
+ identityCardVisible.value = false;
|
|
|
+ keyListData();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ loading.close();
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
} else if (keypassflag.value == "自定义") {
|
|
|
if (cardFlag.value == "房卡") {
|
|
|
identityCardRuleForm.cardType = 0; // 0:房卡 1:身份证
|
|
|
} else if (cardFlag.value == "身份证") {
|
|
|
identityCardRuleForm.cardType = 1;
|
|
|
}
|
|
|
- let data = {
|
|
|
- permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
- adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
- houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
- startTime: identityCardRuleForm.effectiveTime, // 开始时间
|
|
|
- endTime: identityCardRuleForm.failureTime, //结束时间
|
|
|
- userName: identityCardRuleForm.name, //用户id
|
|
|
- phone: identityCardRuleForm.phone, //用户id
|
|
|
- luid: keyData.equipmentType, //设备id
|
|
|
- card: identityCardRuleForm.icCard, //指纹特征值
|
|
|
- cardType: identityCardRuleForm.cardType, //指纹特征值
|
|
|
- type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
- };
|
|
|
- let res = await axios({
|
|
|
+ if(identityCardEditFlag.value==1){
|
|
|
+ let data = {
|
|
|
+ permissionSettingId: sessionStorage.getItem("permissionSettingId"), //权限表id
|
|
|
+ adminId: sessionStorage.getItem("id"), //管理员id
|
|
|
+ houseNumberId: keyData.houseNumberId, //房间号id
|
|
|
+ startTime: identityCardRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: identityCardRuleForm.failureTime, //结束时间
|
|
|
+ userName: identityCardRuleForm.name, //用户id
|
|
|
+ phone: identityCardRuleForm.phone, //用户id
|
|
|
+ luid: keyData.equipmentType, //设备id
|
|
|
+ card: identityCardRuleForm.icCard, //指纹特征值
|
|
|
+ cardType: identityCardRuleForm.cardType, //指纹特征值
|
|
|
+ type: "4", //1:管理员用户,2:普通用户(永久),4:时效性用户,5:一次性时效密码用户,100:时效性无网络密码用户
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
method: "post",
|
|
|
url: api.value + "/unlocking-custom/saveCard",
|
|
|
headers: {
|
|
|
@@ -3461,9 +3762,9 @@ const identityCardConfig = (formEl) => {
|
|
|
user_head: sessionStorage.getItem("userhead"),
|
|
|
},
|
|
|
data: data,
|
|
|
- });
|
|
|
- console.log(res, "自定义添加卡片钥匙");
|
|
|
- if (res.data.code == 200) {
|
|
|
+ });
|
|
|
+ console.log(res, "自定义编辑卡片钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
loading.close();
|
|
|
identityCardVisible.value = false;
|
|
|
keyListData();
|
|
|
@@ -3473,7 +3774,7 @@ const identityCardConfig = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
loading.close();
|
|
|
ElMessage({
|
|
|
type: "error",
|
|
|
@@ -3481,7 +3782,44 @@ const identityCardConfig = (formEl) => {
|
|
|
message: res.data.message,
|
|
|
center: true,
|
|
|
});
|
|
|
+ }
|
|
|
+ }else if(identityCardEditFlag.value==2){
|
|
|
+ let data = {
|
|
|
+ unlockingAdminId:identityCardRuleForm.id,
|
|
|
+ startTime: identityCardRuleForm.effectiveTime, // 开始时间
|
|
|
+ endTime: identityCardRuleForm.failureTime, //结束时间
|
|
|
+ };
|
|
|
+ let res = await axios({
|
|
|
+ method: "post",
|
|
|
+ url: api.value + "/unlocking-custom/updateLock",
|
|
|
+ headers: {
|
|
|
+ token: sessionStorage.getItem("token"),
|
|
|
+ user_head: sessionStorage.getItem("userhead"),
|
|
|
+ },
|
|
|
+ data: data,
|
|
|
+ });
|
|
|
+ console.log(res, "自定义编辑身份证钥匙");
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ loading.close();
|
|
|
+ identityCardVisible.value = false;
|
|
|
+ keyListData();
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ loading.close();
|
|
|
+ ElMessage({
|
|
|
+ type: "error",
|
|
|
+ showClose: true,
|
|
|
+ message: res.data.message,
|
|
|
+ center: true,
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
} else if (keypassflag.value == "总卡") {
|
|
|
let data = {
|
|
|
adminId: sessionStorage.getItem("id"), //管理员id
|