From 8dc019eab5d2265454d903fe71555d05481ea401 Mon Sep 17 00:00:00 2001 From: weiwei Date: Wed, 30 Jul 2025 12:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=80=E7=BA=A6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/invitation/applyRecord.vue | 107 ----------------- src/pages/invitation/invitation.vue | 121 ------------------- src/pages/invitation/invitationRecord.vue | 106 ----------------- src/pages/tabbar/invitation.vue | 23 +++- src/pages/tabbar/invitationRecord.vue | 138 +++++++++++++++++++++- src/sheep/api/invitation.ts | 32 +++-- 6 files changed, 181 insertions(+), 346 deletions(-) delete mode 100644 src/pages/invitation/applyRecord.vue delete mode 100644 src/pages/invitation/invitation.vue delete mode 100644 src/pages/invitation/invitationRecord.vue diff --git a/src/pages/invitation/applyRecord.vue b/src/pages/invitation/applyRecord.vue deleted file mode 100644 index 10ebc14..0000000 --- a/src/pages/invitation/applyRecord.vue +++ /dev/null @@ -1,107 +0,0 @@ - - - diff --git a/src/pages/invitation/invitation.vue b/src/pages/invitation/invitation.vue deleted file mode 100644 index c5fc834..0000000 --- a/src/pages/invitation/invitation.vue +++ /dev/null @@ -1,121 +0,0 @@ - - - diff --git a/src/pages/invitation/invitationRecord.vue b/src/pages/invitation/invitationRecord.vue deleted file mode 100644 index b6d5430..0000000 --- a/src/pages/invitation/invitationRecord.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - diff --git a/src/pages/tabbar/invitation.vue b/src/pages/tabbar/invitation.vue index 7eaf64d..3d927be 100644 --- a/src/pages/tabbar/invitation.vue +++ b/src/pages/tabbar/invitation.vue @@ -128,14 +128,31 @@ const rules: Record = { companyName: [{ required: true, message: "请输入来访公司名称" }], vStartDate: [{ required: true, message: "请选择拜访开始时间" }], vEndDate: [{ required: true, message: "请选择拜访离开时间" }], - // deptId: [{ required: true, message: "请选择拜访部门" }], - // reasonValue: [{ required: true, message: "请选择拜访原因" }], + deptId: [{ required: true, message: "请选择拜访部门" }], + reasonValue: [{ required: true, message: "请选择拜访原因" }], } // 表单提交 const onsubmit = (evt: TM.FORM_SUBMIT_RESULT) => { console.log("校验结果:", evt) if (!evt.isPass) return - uni.showModal({ title: "提示", content: "确认提交吗?", confirmColor: "#0094ff" }) + uni.showModal({ + title: "提示", + content: "确认提交吗?", + confirmColor: "#0094ff", + success: async () => { + try { + const { code, data, msg } = await invitationApi.saveInvitation(form) + if (code == 0) { + uni.showToast({ title: "提交成功", icon: "success" }) + uni.switchTab({ url: "/pages/tabbar/invitationRecord" }) + return + } + uni.showToast({ title: msg || "提交失败", icon: "none" }) + } catch (error: any) { + uni.showToast({ title: error.message || "提交失败", icon: "none" }) + } + }, + }) } diff --git a/src/pages/tabbar/invitationRecord.vue b/src/pages/tabbar/invitationRecord.vue index a79b335..4a22d0a 100644 --- a/src/pages/tabbar/invitationRecord.vue +++ b/src/pages/tabbar/invitationRecord.vue @@ -1,3 +1,137 @@ - + + + diff --git a/src/sheep/api/invitation.ts b/src/sheep/api/invitation.ts index bced8fd..ef4bd87 100644 --- a/src/sheep/api/invitation.ts +++ b/src/sheep/api/invitation.ts @@ -7,11 +7,29 @@ export default { url: `/integrated/app/visitor/getDictListByType?type=${type}`, method: "GET", }), -} -// const updateCheckStatus = () => { -// request({ -// url: `/integrated/visitors/app/updateCheckStatus?id=1950037876011745282&checkStatus=2`, -// method: "GET", -// }) -// } + // 保存访客邀约 + saveInvitation: (data: any): Promise => + request({ + url: `/integrated/visitors/app/saveYY`, + method: "POST", + data, + }), + + // 获取访客邀约列表 + // type为1:主动申请 type为2:邀约 type为3:后台创建 + getInvitationRecord: (params: { current: number; size: number; checkStatus?: string; type?: number }): Promise => + request({ + url: `/integrated/visitors/app/yy/page`, + method: "GET", + params, + }), + + // 更新审核状态通过 2:通过 3:拒绝 + updateCheckStatus: (params: { id: string; checkStatus: number | string }): Promise => + request({ + url: `/integrated/visitors/app/updateCheckStatus`, + method: "GET", + params, + }), +}