Commit a52e73a8 authored by xinzhedeai's avatar xinzhedeai

add:bug修改 离开接口对接

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