Commit a52e73a8 authored by xinzhedeai's avatar xinzhedeai

add:bug修改 离开接口对接

parent 9286f512
......@@ -35,6 +35,16 @@ export function updateInfo(data) {
})
}
// 离开
export function leave(data) {
return request({
url: '/person/info/visitorLeave',
method: 'put',
data: data
})
}
export function getInfo(id) {
return request({
url: '/person/info/getPersonById/' + id,
......
......@@ -255,7 +255,7 @@ import {
addInfo,
updateInfo,
getInfo,
getCardList, // 引入获取定位卡号列表的接口
leave, // 引入离开接口
} from "@/api/jinrun/fangke";
import { listUnboundCard } from "@/api/jinrun/card"; // 引入获取未绑定定位卡号列表的接口
......@@ -307,8 +307,17 @@ export default {
},
created() {
this.getList();
},
watch: {
/** 监听岗位选择变化 */
open: {
handler(newVal, oldVal) {
// 获取定位卡号列表
this.getCardIdList();
},
immediate: true, // 初始化时也调用一次
},
},
methods: {
// 来访时间选择器配置
......@@ -323,21 +332,21 @@ export default {
handleLeave(row) {
const formData = { ...row };
// 获取当前系统时间并格式化为yyyy-MM-dd HH:mm:ss格式
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, "0");
const day = String(now.getDate()).padStart(2, "0");
const hours = String(now.getHours()).padStart(2, "0");
const minutes = String(now.getMinutes()).padStart(2, "0");
const seconds = String(now.getSeconds()).padStart(2, "0");
// // 获取当前系统时间并格式化为yyyy-MM-dd HH:mm:ss格式
// const now = new Date();
// const year = now.getFullYear();
// const month = String(now.getMonth() + 1).padStart(2, "0");
// const day = String(now.getDate()).padStart(2, "0");
// const hours = String(now.getHours()).padStart(2, "0");
// const minutes = String(now.getMinutes()).padStart(2, "0");
// const seconds = String(now.getSeconds()).padStart(2, "0");
formData.leaveTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
formData.visitorStatus = 0;
// formData.leaveTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
// formData.visitorStatus = 0;
this.$modal
.confirm("是否确认离开?")
.then(function () {
return updateInfo(formData);
return leave(formData);
})
.then(() => {
this.$modal.msgSuccess("操作成功");
......
......@@ -407,7 +407,7 @@ export default {
if (value) {
// 根据选择的岗位ID查找对应的岗位对象
const positionItem = this.positionOptions.find(
(item) => item.value === value
(item) => item.value == value
);
if (positionItem) {
// 将岗位名称存储到form.positionName
......
......@@ -211,7 +211,7 @@ export default {
{
...this.queryParams,
},
`info_${new Date().getTime()}.xlsx`
`考勤记录数据_${new Date().getTime()}.xlsx`
);
},
},
......
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