You need to sign in or sign up before continuing.
Commit 7eb165c2 authored by xinzhedeai's avatar xinzhedeai

add:解绑卡

parent cd184045
import request from '@/utils/request'
// 查询人员信息列表
export function listInfo(query) {
return request({
url: '/person/info/getRemoteVisitorInfoList',
method: 'get',
params: query
})
}
// 解绑卡
export function unbindCard(data) {
return request({
url: '/person/info/giveback',
method: 'put',
data: data
})
}
// 新增人员信息
export function addInfo(data) {
return request({
url: '/person/info/addRemoteVisitorInfo',
method: 'post',
data: data
})
}
// 修改人员信息
export function updateInfo(data) {
return request({
url: '/person/info/updateRemoteVisitorInfo',
method: 'put',
data: data
})
}
// 删除人员信息
export function delInfo(data) {
return request({
url: '/person/info/deleteRemoteVisitorInfo',
method: 'delete',
data: data
})
}
......@@ -8,12 +8,11 @@ export function listInfo(query) {
params: query
})
}
// 查询人员信息详细
export function getInfoDict(data) {
// 解绑卡
export function unbindCard(data) {
return request({
url: '/person/info/getRemotePersonInfoById',
method: 'post',
url: '/person/info/unbindCard',
method: 'put',
data: data
})
}
......
......@@ -165,6 +165,21 @@ export const constantRoutes = [
]
},
// 访客列表
{
path: '/person',
component: EmptyLayout,
redirect: 'noredirect',
children: [
{
path: 'fangke',
component: () => import('@/views/person/fangke'),
name: 'fangke',
meta: { title: '访客列表', icon: 'dashboard', }
}
]
},
{
path: '/user',
component: Layout,
......
......@@ -684,7 +684,7 @@ import {
delInfo,
addInfo,
updateInfo,
} from "@/api/jinrun/renyuan";
} from "@/api/jinrun/yuangong";
export default {
name: "Info",
data() {
......
......@@ -319,6 +319,7 @@
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
>
<template slot-scope="scope">
<el-button
......@@ -335,6 +336,13 @@
@click="handleDelete(scope.row)"
>删除</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-unlock"
@click="handleUnbindCard(scope.row)"
>解绑卡</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -684,7 +692,8 @@ import {
delInfo,
addInfo,
updateInfo,
} from "@/api/jinrun/renyuan";
unbindCard,
} from "@/api/jinrun/fangke";
export default {
name: "Info",
data() {
......@@ -711,7 +720,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
personType: null,
personType: "visitor",
personTypeName: null,
staffType: null,
staffTypeName: null,
......@@ -946,6 +955,22 @@ export default {
}
});
},
/** 解绑卡按钮操作 */
handleUnbindCard(row) {
this.$modal
.confirm("是否确认解绑该人员的卡?")
.then(function () {
return unbindCard({
personId: row.personId,
personType: row.personType,
});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("解绑卡成功");
})
.catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
......
......@@ -1129,7 +1129,7 @@ import {
delInfo,
addInfo,
updateInfo,
} from "@/api/jinrun/renyuan";
} from "@/api/jinrun/yuangong";
export default {
name: "Info",
data() {
......
......@@ -319,6 +319,8 @@
label="操作"
align="center"
class-name="small-padding fixed-width"
fixed="right"
width="180"
>
<template slot-scope="scope">
<el-button
......@@ -335,6 +337,13 @@
@click="handleDelete(scope.row)"
>删除</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-unlock"
@click="handleUnbindCard(scope.row)"
>解绑卡</el-button
>
</template>
</el-table-column>
</el-table>
......@@ -357,7 +366,7 @@
placeholder="请输入内容"
/>
</el-form-item>
<el-form-item label="人员类型名称" prop="personType">
<!-- <el-form-item label="人员类型名称" prop="personType">
<el-select
v-model="form.personType"
placeholder="请选择人员类型"
......@@ -370,7 +379,7 @@
:value="item.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-form-item> -->
<el-form-item label="员工类型名称" prop="staffTypeName">
<el-input
v-model="form.staffTypeName"
......@@ -686,8 +695,14 @@
</template>
<script>
import { listInfo, delInfo, addInfo, updateInfo } from "@/api/jinrun/renyuan";
import { getDict } from "@/api/jinrun/common";
import {
listInfo,
delInfo,
addInfo,
updateInfo,
unbindCard,
} from "@/api/jinrun/yuangong";
// import { getDict } from "@/api/jinrun/common";
export default {
name: "Info",
......@@ -791,7 +806,9 @@ export default {
visitorId: null,
},
// 表单参数
form: {},
form: {
personType: "staff",
},
// 表单校验
rules: {
personType: [
......@@ -802,22 +819,22 @@ export default {
},
created() {
this.getList();
this.getPersonTypeOptions();
// this.getPersonTypeOptions();
},
methods: {
/** 获取人员类型下拉列表数据 */
getPersonTypeOptions() {
// 调用数据字典接口
getDict({ dictType: "person_type" })
.then((response) => {
this.personTypeOptions = response.data;
})
.catch((error) => {
this.$modal.msgError("获取人员类型数据失败");
console.error("获取人员类型数据失败:", error);
});
},
// /** 获取人员类型下拉列表数据 */
// getPersonTypeOptions() {
// // 调用数据字典接口
// getDict({ dictType: "person_type" })
// .then((response) => {
// this.personTypeOptions = response.data;
// })
// .catch((error) => {
// this.$modal.msgError("获取人员类型数据失败");
// console.error("获取人员类型数据失败:", error);
// });
// },
/** 查询人员信息列表 */
getList() {
this.loading = true;
......@@ -940,8 +957,12 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
getInfo(row).then((response) => {
this.form = response.data;
listInfo({
pageNum: 1,
pageSize: 1,
personId: row.personId,
}).then((response) => {
this.form = response.data[0];
this.open = true;
this.title = "修改人员信息";
});
......@@ -950,6 +971,7 @@ export default {
submitForm() {
this.$refs["form"].validate((valid) => {
if (valid) {
this.form.personType = "staff";
if (this.form.personId != null) {
updateInfo(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
......@@ -966,10 +988,26 @@ export default {
}
});
},
/** 解绑卡按钮操作 */
handleUnbindCard(row) {
this.$modal
.confirm("是否确认解绑该人员的卡?")
.then(function () {
return unbindCard({
personId: row.personId,
personType: row.personType,
});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("解绑卡成功");
})
.catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm('是否确认删除人员信息编号为"' + row.personIds + '"的数据项?')
.confirm("是否确认删除该数据项?")
.then(function () {
return delInfo({
personIds: [row.personId],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment