141 lines
2.9 KiB
TypeScript
141 lines
2.9 KiB
TypeScript
import request from '@/sheep/utils/request'
|
|
|
|
const visitorApi = {
|
|
// 保存访客信息
|
|
save: (data: any) =>
|
|
request({
|
|
url: "/integrated/visitors/app/save",
|
|
method: "POST",
|
|
data,
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 获取部门树形数据
|
|
getSimpleTree: () =>
|
|
request({
|
|
url: "/admin/dept/simpleTree",
|
|
method: "GET",
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 获取访客记录列表
|
|
getVisitorList: (params: {
|
|
current: number;
|
|
size: number;
|
|
checkStatus?: string;
|
|
}) =>
|
|
request({
|
|
url: "/integrated/visitors/app/sq/page",
|
|
method: "GET",
|
|
params,
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 取消访客预约
|
|
cancelVisitor: (id: string) =>
|
|
request({
|
|
url: "/integrated/visitors/app/cancelVisitor",
|
|
method: "GET",
|
|
params: { id },
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 获取拜访原因字典
|
|
getDictListByType: (type: number) =>
|
|
request({
|
|
url: '/integrated/visitors/app/getDictListByType',
|
|
method: 'GET',
|
|
params: { type },
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 保存访客邀约
|
|
saveYY: (data: any) =>
|
|
request({
|
|
url: "/integrated/visitors/app/saveYY",
|
|
method: "POST",
|
|
data,
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 获取邀约记录列表
|
|
getVisitorYYList: (params: {
|
|
current: number;
|
|
size: number;
|
|
checkStatus?: string;
|
|
}) =>
|
|
request({
|
|
url: "/integrated/visitors/app/yy/page",
|
|
method: "GET",
|
|
params,
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 接受访客邀约
|
|
acceptVisitor: (id: string) =>
|
|
request({
|
|
url: "/integrated/visitors/app/acceptYY",
|
|
method: "GET",
|
|
params: { id },
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 拒绝访客邀约
|
|
rejectVisitor: (id: string) =>
|
|
request({
|
|
url: "/integrated/visitors/app/rejectYY",
|
|
method: "GET",
|
|
params: { id },
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 更新访客邀约状态
|
|
updateCheckStatus: (params: { id: string; checkStatus: string }) =>
|
|
request({
|
|
url: "/integrated/visitors/app/updateCheckStatus",
|
|
method: "GET",
|
|
params,
|
|
custom: {
|
|
showLoading: false,
|
|
},
|
|
}),
|
|
|
|
// 获取访客详情
|
|
getVisitorDetail: (params: { token: string }) => {
|
|
return request({
|
|
url: '/integrated/visitors/app/get/visitorDetail',
|
|
method: 'GET',
|
|
params
|
|
})
|
|
},
|
|
|
|
// 访客核销
|
|
verifyVisitor: (params: { token: string }) => {
|
|
return request({
|
|
url: '/integrated/visitors/app/verify',
|
|
method: 'POST',
|
|
data: params
|
|
})
|
|
}
|
|
}
|
|
|
|
export default visitorApi
|