Commit 716588d1 authored by xinzhedeai's avatar xinzhedeai

add:访客页面

parent b800848e
# 页面标题 # 页面标题
VUE_APP_TITLE = 高区应急管理平台 VUE_APP_TITLE = 人员定位系统
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
......
# 页面标题 # 页面标题
VUE_APP_TITLE = 高区应急管理平台 VUE_APP_TITLE = 人员定位系统
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
......
# 页面标题 # 页面标题
VUE_APP_TITLE = 高区应急管理平台 VUE_APP_TITLE = 人员定位系统
BABEL_ENV = production BABEL_ENV = production
......
...@@ -3,26 +3,24 @@ import request from '@/utils/request' ...@@ -3,26 +3,24 @@ import request from '@/utils/request'
// 查询人员信息列表 // 查询人员信息列表
export function listInfo(query) { export function listInfo(query) {
return request({ return request({
url: '/person/info/getRemoteVisitorInfoList', url: '/person/info/getPersonList',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 解绑卡 // 解绑卡
export function unbindCard(data) { export function unbindCard(data) {
return request({ return request({
url: '/person/info/giveback', url: '/person/info/unbindCard',
method: 'put', method: 'put',
data: data data: data
}) })
} }
// 新增人员信息 // 新增人员信息
export function addInfo(data) { export function addInfo(data) {
return request({ return request({
url: '/person/info/addRemoteVisitorInfo', url: '/person/info/addPerson',
method: 'post', method: 'post',
data: data data: data
}) })
...@@ -31,17 +29,23 @@ export function addInfo(data) { ...@@ -31,17 +29,23 @@ export function addInfo(data) {
// 修改人员信息 // 修改人员信息
export function updateInfo(data) { export function updateInfo(data) {
return request({ return request({
url: '/person/info/updateRemoteVisitorInfo', url: '/person/info/updatePerson',
method: 'put', method: 'put',
data: data data: data
}) })
} }
export function getInfo(id) {
return request({
url: '/person/info/getPersonById/' + id,
method: 'get'
})
}
// 删除人员信息 // 删除人员信息
export function delInfo(data) { export function delInfo(id) {
return request({ return request({
url: '/person/info/deleteRemoteVisitorInfo', url: '/person/info/deletePerson/' + id,
method: 'delete', method: 'delete',
data: data
}) })
} }
...@@ -72,10 +72,12 @@ ...@@ -72,10 +72,12 @@
<el-table-column label="性别" align="center" prop="sex" /> <el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="身份证号" align="center" prop="idCard" /> <el-table-column label="身份证号" align="center" prop="idCard" />
<el-table-column label="联系方式" align="center" prop="phone" /> <el-table-column label="联系方式" align="center" prop="phone" />
<el-table-column label="来访单位1" align="center" prop="dept" /> <el-table-column label="来访单位" align="center" prop="company" />
<el-table-column label="定位卡号" align="center" prop="cardId" /> <el-table-column label="定位卡号" align="center" prop="cardId" />
<el-table-column label="来访时间1" align="center" prop="dept" /> <el-table-column label="来访时间" align="center" prop="visitTime" />
<el-table-column label="离开时间1" align="center" prop="idCard" /> <el-table-column label="离开时间" align="center" prop="leaveTime" />
<el-table-column label="来访状态" align="center" prop="visitorStatus" />
<el-table-column <el-table-column
label="操作" label="操作"
align="center" align="center"
...@@ -85,7 +87,7 @@ ...@@ -85,7 +87,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.laifangStatus == 'Y'" v-if="scope.row.visitorStatus == 'Y'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-link" icon="el-icon-link"
...@@ -93,7 +95,7 @@ ...@@ -93,7 +95,7 @@
>离开</el-button >离开</el-button
> >
<el-button <el-button
v-if="scope.row.laifangStatus == 'N'" v-if="scope.row.visitorStatus == 'N'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-unlock" icon="el-icon-unlock"
...@@ -162,10 +164,10 @@ ...@@ -162,10 +164,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="出生日期" prop="birth"> <el-form-item label="出生日期" prop="birthTime">
<el-date-picker <el-date-picker
clearable clearable
v-model="form.birth" v-model="form.birthTime"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="" placeholder=""
...@@ -185,24 +187,28 @@ ...@@ -185,24 +187,28 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="来访单位" prop="seniority"> <el-form-item label="来访单位" prop="company">
<el-input v-model="form.seniority" placeholder="" /> <el-input v-model="form.company" placeholder="" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="来访时间" prop="hireDate"> <el-form-item label="来访时间" prop="visitTime">
<el-datetime-picker <el-date-picker
clearable clearable
v-model="form.hireDate" v-model="form.visitTime"
type="date" type="datetime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择入职日期" format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择来访时间"
:picker-options="visitTimeOptions"
default-time="00:00:00"
style="width: 100%"
> >
</el-datetime-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row v-if="dialogType !== 'dimission' && dialogType !== 'return'"> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="" /> <el-input v-model="form.remark" type="textarea" placeholder="" />
...@@ -215,47 +221,6 @@ ...@@ -215,47 +221,6 @@
<el-button @click="cancel">关 闭</el-button> <el-button @click="cancel">关 闭</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 定位卡绑定对话框 -->
<el-dialog
:title="'定位卡绑定 - ' + bindForm.realName"
:visible.sync="bindOpen"
width="500px"
append-to-body
>
<el-form
ref="bindForm"
:model="bindForm"
:rules="bindRules"
label-width="80px"
>
<el-form-item label="姓名" prop="realName">
<el-input
v-model="bindForm.realName"
disabled
placeholder="人员姓名"
/>
</el-form-item>
<el-form-item label="定位卡号" prop="cardId">
<el-select
v-model="bindForm.cardId"
placeholder="请选择定位卡号"
clearable
>
<el-option
v-for="item in cardIdOptions"
:key="item.cardId"
:label="item.cardId"
:value="item.cardId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitBindForm">确 定</el-button>
<el-button @click="cancelBind">关 闭</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -265,7 +230,7 @@ import { ...@@ -265,7 +230,7 @@ import {
delInfo, delInfo,
addInfo, addInfo,
updateInfo, updateInfo,
unbindCard, getInfo,
getCardList, // 引入获取定位卡号列表的接口 getCardList, // 引入获取定位卡号列表的接口
} from "@/api/jinrun/fangke"; } from "@/api/jinrun/fangke";
import { getDict } from "@/api/jinrun/common"; import { getDict } from "@/api/jinrun/common";
...@@ -274,34 +239,6 @@ export default { ...@@ -274,34 +239,6 @@ export default {
name: "Info", name: "Info",
data() { data() {
return { return {
deptOptions: [
{
label: "部门1",
value: "1",
},
{
label: "部门2",
value: "2",
},
],
// 绑定卡对话框
bindOpen: false,
// 绑定卡表单
bindForm: {
personId: null,
realName: null,
cardId: null,
personType: "staff",
},
// 绑定卡表单校验
bindRules: {
cardId: [
{ required: true, message: "请选择定位卡号", trigger: "change" },
],
},
dialogType: "",
// 人员类型下拉列表数据
personTypeOptions: [],
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组 // 选中数组
...@@ -324,21 +261,18 @@ export default { ...@@ -324,21 +261,18 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
personType: "staff", personType: "2",
realName: null, realName: null,
cardId: null, cardId: null,
jobNumber: null, jobNumber: null,
}, },
// 表单参数 // 表单参数
form: { form: {
personType: "staff", personType: "2",
sex: "", // 默认选择男 sex: "", // 默认选择男
}, },
// 表单校验 // 表单校验
rules: { rules: {
personType: [
{ required: true, message: "人员类型不能为空", trigger: "change" },
],
realName: [ realName: [
{ required: true, message: "姓名不能为空", trigger: "blur" }, { required: true, message: "姓名不能为空", trigger: "blur" },
], ],
...@@ -347,21 +281,23 @@ export default { ...@@ -347,21 +281,23 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getPersonTypeOptions();
// 获取定位卡号列表
this.getCardIdList(); this.getCardIdList();
}, },
methods: { methods: {
/** 解绑卡按钮操作 */ // 来访时间选择器配置
visitTimeOptions: {
// 设置可选择的时间范围为当前时间之前
disabledDate(time) {
return time.getTime() > Date.now();
},
// 可以根据需要添加更多配置
},
handleLeave(row) { handleLeave(row) {
this.$modal this.$modal
.confirm("是否确认离开?") .confirm("是否确认离开?")
.then(function () { .then(function () {
return unbindCard({ return unbindCard(row.personId);
personId: row.personId,
personType: row.personType,
});
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
...@@ -369,52 +305,11 @@ export default { ...@@ -369,52 +305,11 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
/** 绑定卡按钮操作 */
handleHistory(row) { handleHistory(row) {
// 跳转到李麒麟页面 // 跳转到李麒麟页面
window.open("https://www.baidu.com"); window.open("https://www.baidu.com");
}, },
/** 取消绑定卡对话框 */
cancelBind() {
this.bindOpen = false;
this.bindForm = {
personId: null,
realName: null,
cardId: null,
personType: "staff",
};
},
/** 提交绑定卡表单 */
submitBindForm() {
this.$refs["bindForm"].validate((valid) => {
if (valid) {
bindCard(this.bindForm)
.then((response) => {
this.$modal.msgSuccess("绑定成功");
this.bindOpen = false;
this.getList();
})
.catch((error) => {
this.$modal.msgError("绑定失败,请重试");
console.error("绑定卡失败:", error);
});
}
});
},
/** 获取人员类型下拉列表数据 */
getPersonTypeOptions() {
// 调用数据字典接口
getDict({ dictType: "staff_type" })
.then((response) => {
this.personTypeOptions = response.data;
})
.catch((error) => {
this.$modal.msgError("获取人员类型数据失败");
console.error("获取人员类型数据失败:", error);
});
},
/** 获取定位卡号列表数据 */ /** 获取定位卡号列表数据 */
getCardIdList() { getCardIdList() {
getCardList() getCardList()
...@@ -431,7 +326,7 @@ export default { ...@@ -431,7 +326,7 @@ export default {
getList() { getList() {
this.loading = true; this.loading = true;
listInfo(this.queryParams).then((response) => { listInfo(this.queryParams).then((response) => {
this.infoList = response.data; this.infoList = response.records || [];
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
...@@ -444,83 +339,7 @@ export default { ...@@ -444,83 +339,7 @@ export default {
// 表单重置 // 表单重置
reset() { reset() {
this.form = { this.form = {
createBy: null, sex: "", // 默认选择男
createTime: null,
updateTime: null,
remark: null,
personId: null,
personType: null,
personTypeName: null,
staffType: null,
staffTypeName: null,
positionIconType: null,
positionIconTypeName: null,
realName: null,
phone: null,
sex: "",
birth: null,
email: null,
nativePlace: null,
nation: null,
maritalStatus: null,
politicsStatus: null,
healthStatus: null,
idType: null,
idNumber: null,
personIc: null,
personCode: null,
personSource: null,
company: null,
companyName: null,
administratorName: null,
administratorPhone: null,
jobNumber: null,
jobStatus: null,
hireDate: null,
hireDateAlias: null,
dimissionDate: null,
officePhone: null,
duty: null,
professionalTitle: null,
professionalTitleNumber: null,
seniority: null,
experience: null,
yearPlusExperience: null,
highestEducation: null,
highestDegree: null,
profession: null,
school: null,
diplomaNumber: null,
cengNumber: null,
accessory: null,
accessoryList: null,
contractorId: null,
contractorName: null,
receiveLeader: null,
receivePhone: null,
gateThrough: null,
leaveTime: null,
visitorStatus: null,
visitTime: null,
process: null,
lastUpdateDate: null,
lastCreateDate: null,
updateFail: null,
onlineStatus: null,
inOutStatus: null,
cardType: null,
cardTypeName: null,
cardId: null,
icCardId: null,
cardPower: null,
personPhoto: null,
photoSign: null,
deptName: null,
reservationEntryStartTime: null,
reservationEntryEndTime: null,
reservationVisitingTime: null,
curUserName: null,
visitorId: null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
...@@ -550,41 +369,21 @@ export default { ...@@ -550,41 +369,21 @@ export default {
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();
listInfo({ getInfo(row.personId).then((response) => {
pageNum: 1,
pageSize: 1,
personId: row.personId,
}).then((response) => {
this.form = response.data[0]; this.form = response.data[0];
this.open = true; this.open = true;
this.title = "修改员工信息"; this.title = "修改员工信息";
this.dialogType = "update";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate((valid) => { this.$refs["form"].validate((valid) => {
if (valid) { if (valid) {
this.form.personType = "staff"; this.form.personType = "2"; // 访客
// 创建一个表单数据的副本,避免直接修改原表单 // 创建一个表单数据的副本,避免直接修改原表单
const formData = { ...this.form }; const formData = { ...this.form };
// 根据 deptId 查找对应的部门名称
if (
formData.deptId &&
this.deptOptions &&
this.deptOptions.length > 0
) {
const deptItem = this.deptOptions.find(
(item) => item.value === formData.deptId
);
if (deptItem) {
formData.deptName = deptItem.label; // 添加部门名称参数
}
}
if (formData.personId != null) { if (formData.personId != null) {
updateInfo(formData).then((response) => { updateInfo(formData).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
...@@ -607,10 +406,7 @@ export default { ...@@ -607,10 +406,7 @@ export default {
this.$modal this.$modal
.confirm("是否确认删除该数据项?") .confirm("是否确认删除该数据项?")
.then(function () { .then(function () {
return delInfo({ return delInfo(row.personId);
personIds: [row.personId],
personType: row.personType,
});
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
......
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