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