diff --git a/src/env.d.ts b/src/env.d.ts
index d27eb5a..cffc168 100644
--- a/src/env.d.ts
+++ b/src/env.d.ts
@@ -1,8 +1,8 @@
///
-declare module '*.vue' {
- import { DefineComponent } from 'vue'
- // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
- const component: DefineComponent<{}, {}, any>
- export default component
+declare module "*.vue" {
+ import { DefineComponent } from "vue"
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
+ const component: DefineComponent
+ export default component
}
diff --git a/src/pages/integrated/visitor/detail.vue b/src/pages/integrated/visitor/detail.vue
index be74412..f320cdd 100644
--- a/src/pages/integrated/visitor/detail.vue
+++ b/src/pages/integrated/visitor/detail.vue
@@ -2,8 +2,21 @@
-
- {{ alertList[detail.checkStatus].text }}
+
+ {{ alertListType2[detail.checkStatus].text }}
+
+
+ {{ alertListType1[detail.checkStatus].text }}
访客信息
@@ -16,7 +29,7 @@
{{ detail.mobile }}
- 来访公司名称
+ 访客公司名称
{{ detail.companyName }}
@@ -75,12 +88,18 @@ import { ref } from "vue"
import { onLoad } from "@dcloudio/uni-app"
import { invitationApi } from "@/sheep/api"
-const alertList = {
- 1: { color: "#2db7f5", text: "访客未接受邀约" },
+const alertListType2 = {
+ 1: { color: "#2db7f5", text: "访客还未接受邀约" },
2: { color: "#52c41a", text: "访客待到访" },
3: { color: "#f5a623", text: "访客拒绝了邀约" },
5: { color: "#f5222d", text: "您取消了邀约" },
}
+const alertListType1 = {
+ 1: { color: "#2db7f5", text: "您还未接受访客申请" },
+ 2: { color: "#52c41a", text: "访客待到访" },
+ 3: { color: "#f5a623", text: "您拒绝了访客申请" },
+ 5: { color: "#f5222d", text: "访客申请者取消了申请" },
+}
const detail = ref({})
const visitorReasonList = ref<{ title: string; id: string }[]>([])
diff --git a/src/pages/integrated/visitor/invitation-record.vue b/src/pages/integrated/visitor/invitation-record.vue
index 7883819..b4bd7b7 100644
--- a/src/pages/integrated/visitor/invitation-record.vue
+++ b/src/pages/integrated/visitor/invitation-record.vue
@@ -15,7 +15,7 @@
@scroll="pageHook.scroll"
>
-
+
-
@@ -61,27 +62,46 @@
{{ v.vstartDate + " ~ " + v.vendDate }}
-
-
- 访客手机号:{{ v.mobile }}
-
-
- 查看详情
-
- 取消邀约
-
+
+
+ 访客姓名
+ {{ v.name || "---" }}
+
+
+ 访客手机
+ {{ v.mobile || "---" }}
+
+
+ 邀请人
+ {{ v.userName || "---" }}
+
+
+ 拜访原因
+ {{ visitorReasonList.find((item) => item.id == v.reasonValue)?.title || "---" }}
+
+
+
+
+ 接受申请
+
+
+ 拒绝申请
+
+ 查看详情
+
+
+ 查看详情
+
+ 取消邀约
+
+
-
-
-
@@ -114,11 +134,11 @@ const tabs = [
{ value: "3", name: "已拒绝", disabled: false },
{ value: "5", name: "已取消", disabled: false },
]
-
+const visitorReasonList = ref<{ title: string; id: string }[]>([])
const state = reactive({
params: {
checkStatus: tabs[0].value,
- type: 2, // type为1:主动申请 type为2:邀约 type为3:后台创建
+ type: 1, // type为1:访客端主动申请 type为2:邀约端邀约 type为3:后台创建
},
})
const pageRef = ref(null)
@@ -126,6 +146,7 @@ const pageRef = ref(null)
onShow(async () => {
const isLogin = await hooks.useCheckLogin()
if (!isLogin) return
+ getVisitorReasonList()
})
const doTab = (e: any) => {
@@ -142,54 +163,41 @@ const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.params)
}
-// const onTabChange = (e: number) => {
-// state.params.type = e + 1
-// pageRef.value.reload(false)
-// }
+const onTabChange = (e: number) => {
+ state.params.type = e + 1
+ pageRef.value.reload(true)
+}
-// 审核通过/拒绝
-// const visitorCheck = async (id: string, checkStatus: number | string) => {
-// try {
-// const { code, msg } = await invitationApi.updateCheckStatus({ id, checkStatus })
-// if (code == 0) {
-// uni.showToast({ title: "操作成功", icon: "success" })
-// pageRef.value.reload(false)
-// return
-// }
-// uni.showToast({ title: msg, icon: "error" })
-// } catch (error: any) {
-// uni.showToast({ title: error.message, icon: "error" })
-// }
-// }
+// 获取拜访原因列表
+const getVisitorReasonList = async () => {
+ const { code, data } = await invitationApi.getDictListByType("1")
+ if (code == 0 && data) {
+ visitorReasonList.value = data.map((item: any) => ({ title: item.label, id: item.value }))
+ return
+ }
+ visitorReasonList.value = []
+}
+
+// 接受申请、拒绝申请、取消邀约(1:审核中 2:接受申请 3:拒绝申请 5:取消邀约)
+const visitorCheck = async (id: string, checkStatus: "1" | "2" | "3" | "5") => {
+ if (!id) return uni.showToast({ title: "id不存在", icon: "error" })
+ try {
+ uni.showLoading({ title: "加载中...", mask: true })
+ const { code, msg } = await invitationApi.updateCheckStatus({ id, checkStatus })
+ if (code != 0) return uni.showToast({ title: msg || "操作失败", icon: "error" })
+ pageRef.value.reload(false)
+ uni.showToast({ title: "操作成功", icon: "success" })
+ } finally {
+ uni.hideLoading()
+ }
+}
// 查看详情
const goDetail = (v: any) => {
+ if (!v.id || !v.token) return uni.showToast({ title: "id不存在", icon: "none" })
router.jump("/pages/integrated/visitor/detail", { id: v.id, token: v.token })
}
-// 取消邀约
-const cancel = async (v: any) => {
- if (!v.id) return uni.showToast({ title: "id不存在", icon: "error" })
-
- uni.showModal({
- title: "提示",
- content: "是否确定取消预约",
- confirmColor: "#0094ff",
- success: async (res) => {
- if (!res.confirm) return
- try {
- uni.showLoading({ title: "取消邀约中...", mask: true })
- const { code, msg } = await invitationApi.updateCheckStatus({ id: v.id, checkStatus: 5 })
- if (code != 0) return uni.showToast({ title: msg || "取消失败", icon: "error" })
- pageRef.value.reload(false)
- uni.showToast({ title: "取消成功", icon: "success" })
- } finally {
- uni.hideLoading()
- }
- },
- })
-}
-
const goInvitation = () => {
uni.redirectTo({ url: "/pages/integrated/visitor/invitation" })
}
diff --git a/src/pages/tabbar/integrated.vue b/src/pages/tabbar/integrated.vue
index f08ad30..7cc8c1b 100644
--- a/src/pages/tabbar/integrated.vue
+++ b/src/pages/tabbar/integrated.vue
@@ -95,16 +95,6 @@ onMounted(() => {
})
function goPage(item) {
- // 访客邀约功能正在开发中
- if (item.name === "visitor") {
- uni.showToast({
- title: "访客邀约功能正在开发中",
- icon: "none",
- duration: 2000,
- })
- return
- }
-
if (item.url) {
uni.navigateTo({ url: item.url })
}