修改目录结构;调整组件路径;访客邀约页面;

This commit is contained in:
weiwei committed 2025-07-29 19:34:46 +08:00
1 parent 3d6ea75b46
commit a813da33ee
16 files changed
+504 -532

No files matched your search

File renamed without changes.
+3
View File
@@ -0,0 +1,3 @@
<template></template>
<script setup lang="ts"></script>
File renamed without changes.
+3 -3
View File
@@ -40,10 +40,10 @@ const moduleList = [
launchParam: "flowStatistics",
},
{
pagePath: "/pages/tabbar/visitor",
pagePath: "/pages/tabbar/invitation",
text: "访客",
iconPath: "/static/tabbar/visitor-select.png",
launchParam: "visitor",
iconPath: "/static/tabbar/invitation-select.png",
launchParam: "invitation",
},
{
pagePath: "/pages/tabbar/message",
+141
View File
@@ -0,0 +1,141 @@
<template>
<crud-layout mainIsScroll bg="/static/page/blue-bg.png">
<view class="h-20rpx" />
<tm-sheet margin="[0]">
<view class="mx-auto mb-1 text-center text-lg">访客邀约</view>
<tm-alert :border="['2']" :borderColor="['#89c0ff']" :darkBorderColor="['#3b5066']">访客邀约请填写以下信息</tm-alert>
<tm-form @submit="onsubmit" v-model="form" :rules="rules" direction="vertical">
<tm-form-item name="name" label="访客姓名">
<tm-input color="transparent" v-model.trim="form.name" placeholder="请输入真实姓名" />
</tm-form-item>
<tm-form-item name="mobile" label="访客手机号">
<tm-input color="transparent" v-model.trim="form.mobile" placeholder="请输入访客手机号" />
</tm-form-item>
<tm-form-item name="companyName" label="来访公司名称">
<tm-input color="transparent" v-model.trim="form.companyName" placeholder="来访公司名称" />
</tm-form-item>
<tm-form-item name="vStartDate" label="拜访开始时间">
<tm-picker-date
v-model="form.vStartDate"
v-model:modelStr="_timestr"
type="minute"
start="2020-01-01 00:00"
end="2080-01-01 23:59"
>
<tm-input
:modelValue="form.vStartDate"
placeholder="请选择拜访开始时间"
style="pointer-events: none"
disabled
color="transparent"
>
<template v-slot:rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</tm-picker-date>
</tm-form-item>
<tm-form-item name="vEndDate" label="拜访离开时间">
<tm-picker-date v-model="form.vEndDate" v-model:modelStr="_timestr" type="minute" start="2020-01-01 00:00" end="2080-01-01 23:59">
<tm-input
:modelValue="form.vEndDate"
placeholder="请选择拜访离开时间"
style="pointer-events: none"
disabled
color="transparent"
>
<template v-slot:rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</tm-picker-date>
</tm-form-item>
<tm-form-item name="deptId" label="拜访部门">
<tm-drawer :show-close="true" :show-footer="true" size="auto" title="请选择拜访部门">
<template #trigger>
<tm-input :modelValue="form.deptId" placeholder="请选择拜访部门" style="pointer-events: none" disabled color="transparent">
<template v-slot:rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</template>
<tm-text color="#999999">精致美观的对话框,可全局配置风格</tm-text>
</tm-drawer>
</tm-form-item>
<tm-form-item name="reasonValue" label="拜访原因">
<tm-picker v-model="form.reasonValue" v-model:modelStr="_pingtaistr" rangText="reasonValue" :list="visitorReasonList">
<tm-input :modelValue="_pingtaistr" placeholder="请选择拜访原因" style="pointer-events: none" disabled color="transparent">
<template #rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</tm-picker>
</tm-form-item>
<tm-form-item name="isOtherPeople" label="是否可随行人员" direction="horizontal" labelWidth="500">
<tm-switch v-model="form.isOtherPeople" />
</tm-form-item>
<tm-form-item name="isDrive" label="是否可驾驶车辆" direction="horizontal" labelWidth="500">
<tm-switch v-model="form.isDrive" />
</tm-form-item>
<tm-button form-type="submit" block>提交</tm-button>
</tm-form>
</tm-sheet>
</crud-layout>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app"
import { reactive, ref } from "vue"
import { invitationApi } from "@/sheep/api/index"
const form = reactive({
name: "",
mobile: "",
companyName: "",
vStartDate: "",
vEndDate: "",
deptId: "",
reasonValue: "",
isOtherPeople: true,
isDrive: true,
})
const _timestr = ref("2025-01-01")
const _pingtaistr = ref("")
const visitorReasonList = ref([])
onLoad(() => {
const app = getApp()
app._initTabbar()
getVisitorReasonList()
})
// 获取拜访原因列表
const getVisitorReasonList = async () => {
const { code, data } = await invitationApi.getDictListByType("1")
if (code == 0 && data) {
visitorReasonList.value = data
return
}
visitorReasonList.value = []
}
const rules: Record<string, TM.FORM_RULE[]> = {
name: [{ required: true, message: "姓名2到5个字符", rule: /^.{2,5}$/ }],
mobile: [{ required: true, message: "请输入正确的手机号", rule: /^(?:(?:\+|00)86)?1\d{10}$/ }],
companyName: [{ required: true, message: "请输入来访公司名称" }],
vStartDate: [{ required: true, message: "请选择拜访开始时间" }],
vEndDate: [{ 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" })
}
</script>
+3
View File
@@ -0,0 +1,3 @@
<template></template>
<script setup lang="ts"></script>
-49
View File
@@ -1,49 +0,0 @@
<template>
<crud-layout mainIsScroll bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<tm-sheet :margin="[0]">
<view class="flex-row items-center justify-center flex-wrap">
<view class="w-half flex justify-center py-2 rounded-1">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200" @click="router.jump('/pages/visitor/apply')">
<image class="w-80 h-80 px-2 pt-2" src="@/static/page/货柜详情.svg" />
<tm-text font-size="32">访客申请</tm-text>
</view>
</view>
<view class="w-half flex justify-center py-2 rounded-1">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200" @click="router.jump('/pages/visitor/applyRecord')">
<image class="w-80 h-80 px-2 pt-2" src="@/static/page/货柜详情.svg" />
<tm-text font-size="32">申请记录</tm-text>
</view>
</view>
<view class="w-half flex justify-center py-2 rounded-1">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200" @click="router.jump('/pages/visitor/invitation')">
<image class="w-80 h-80 px-2 pt-2" src="@/static/page/货柜详情.svg" />
<tm-text font-size="32">访客邀约</tm-text>
</view>
</view>
<view class="w-half flex justify-center py-2 rounded-1">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200" @click="router.jump('/pages/visitor/invitationRecord')">
<image class="w-80 h-80 px-2 pt-2" src="@/static/page/货柜详情.svg" />
<tm-text font-size="32">邀约记录</tm-text>
</view>
</view>
<view class="w-half flex justify-center py-2 rounded-1">
<view class="w-half text-center rounded-1 active:bg-#e8e8e8 duration-200">
<image class="w-80 h-80 px-2 pt-2" src="@/static/page/货柜详情.svg" />
<tm-text font-size="32">核销</tm-text>
</view>
</view>
</view>
</tm-sheet>
</crud-layout>
</template>
<script setup lang="ts">
import { onLoad } from "@dcloudio/uni-app"
import { router } from "@/sheep"
onLoad(() => {
const app = getApp()
app._initTabbar()
})
</script>
-174
View File
@@ -1,174 +0,0 @@
<template>
<crud-layout mainIsScroll bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<tm-sheet margin="[0, 20]">
<view class="mx-auto text-center text-lg">访客申请</view>
<tm-text color="#999999" class="bg-#FFF7E6 p-1 pl-2 my-1">!访客需要填写以下验证信息</tm-text>
<tm-form @submit="onsubmit" v-model="form" :rules="rules">
<tm-form-item name="username" label="您的姓名">
<tm-input color="transparent" v-model="form.username" placeholder="姓名" />
</tm-form-item>
<tm-form-item name="username" label="联系方式">
<tm-input color="transparent" v-model="form.username" placeholder="联系方式" />
</tm-form-item>
<tm-form-item name="username" label="公司名称">
<tm-input color="transparent" v-model="form.username" placeholder="公司名称" />
</tm-form-item>
<tm-form-item name="pingtai" label="拜访原因">
<tm-picker
v-model="form.pingtai"
v-model:modelStr="_pingtaistr"
rangText="name"
:list="[
{ id: 1, name: '1111' },
{ id: 2, name: '2222' },
{ id: 3, name: '3333' },
]"
>
<tm-input :modelValue="_pingtaistr" placeholder="请选择拜访原因" style="pointer-events: none" disabled color="transparent">
<template v-slot:rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</tm-picker>
</tm-form-item>
<tm-form-item name="username" label="随行人员">
<view class="flex items-center" v-for="(v, i) in form.entourage" :key="i">
<tm-input color="transparent" v-model="form.entourage[i].username" placeholder="姓名" />
&nbsp;
<tm-input color="transparent" v-model="form.entourage[i].phone" placeholder="手机号" />
&nbsp;
<view class="w-80rpx">
<tm-button v-if="i > 0 && i < 6" color="error" size="s" btnIcon width="40" rounded @click="removeEntourage(i)">—</tm-button>
</view>
</view>
<tm-button skin="thin" block size="s" class="my-2" @click="addEntourage">添加</tm-button>
</tm-form-item>
<tm-form-item name="username" label="车牌号">
<view v-for="(v, i) in form.carPlate" :key="i" class="flex items-center">
<tm-input color="transparent" v-model="form.carPlate[i]" :placeholder="`车牌号${i + 1}`" />
&nbsp;
<view class="w-80rpx">
<tm-button v-if="i > 0 && i < 6" color="error" size="s" btnIcon width="40" rounded @click="removeCarPlate(i)">—</tm-button>
</view>
</view>
<tm-button skin="thin" block size="s" class="my-2" @click="addCarPlate">添加</tm-button>
</tm-form-item>
<tm-form-item name="pingtai" label="到访单位">
<tm-picker
v-model="form.pingtai"
v-model:modelStr="_pingtaistr"
rangText="name"
:list="[
{ id: 1, name: '1111' },
{ id: 2, name: '2222' },
{ id: 3, name: '3333' },
]"
>
<tm-input :modelValue="_pingtaistr" placeholder="请选择到访单位" style="pointer-events: none" disabled color="transparent">
<template v-slot:rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</tm-picker>
</tm-form-item>
<tm-form-item name="username" label="接待人">
<tm-input color="transparent" v-model="form.username" placeholder="接待人" />
</tm-form-item>
<tm-form-item name="time" label="到访时间">
<tm-picker-date v-model="form.time" v-model:modelStr="_timestr" type="minute" start="2020-01-01 00:00" end="2080-01-01 23:59">
<tm-input :modelValue="form.time" placeholder="请选择到访时间" style="pointer-events: none" disabled color="transparent">
<template v-slot:rightIcon>
<tm-icon name="arrow-right-s-line"></tm-icon>
</template>
</tm-input>
</tm-picker-date>
</tm-form-item>
<tm-form-item name="textarea" label="备注">
<tm-input v-model="form.textarea" :maxlength="100" placeholder="请输入" type="textarea" show-char-count color="transparent">
</tm-input>
</tm-form-item>
<hr class="mb-4" />
<tm-button form-type="submit" block>提交</tm-button>
</tm-form>
</tm-sheet>
<view class="h-30rpx" />
</crud-layout>
</template>
<script setup lang="ts">
import { reactive, ref } from "vue"
const form = reactive({
username: "",
price: "",
checkbox: [],
radio: "",
time: "2024-6-5",
pingtai: [],
store: 0,
score: 0,
textarea: "",
entourage: [
{
username: "",
phone: "",
},
],
carPlate: [""],
})
const _timestr = ref(form.time)
const _pingtaistr = ref("")
const rules: Record<string, TM.FORM_RULE[]> = {
username: [{ required: true, message: "姓名2到5个字符", rule: /^.{2,5}$/ }],
address: [
{ required: true, message: "地址不能为空" },
{ required: true, message: "长度要小于3", max: 2 },
],
price: [{ required: true, message: "价格要大于等于99", type: "number", min: 99 }],
checkbox: [{ required: true }],
radio: [{ required: true }],
time: [{ required: true, type: "date" }],
pingtai: [{ required: true }],
store: [{ required: true, min: 1, max: 100, message: "介于1-100之间" }],
score: [{ required: true, min: 5, max: 5, message: "必须打5分哦" }],
textarea: [{ required: true, max: 100, message: "请输入内容" }],
}
// 添加随从
const addEntourage = () => {
if (form.entourage.length > 5) return uni.showToast({ title: "最多添加6个随从", icon: "none" })
form.entourage.push({
username: "",
phone: "",
})
}
// 移除随从
const removeEntourage = (index: number) => {
form.entourage.splice(index, 1)
}
// 添加车牌号
const addCarPlate = () => {
if (form.carPlate.length > 3) return uni.showToast({ title: "最多添加4个车牌", icon: "none" })
form.carPlate.push("")
}
// 移除车牌号
const removeCarPlate = (index: number) => {
form.carPlate.splice(index, 1)
}
// 表单提交
const onsubmit = (evt: TM.FORM_SUBMIT_RESULT) => {
console.log("校验结果:", evt)
if (!evt.isPass) return
uni.showModal({ title: "提示", content: "确认提交吗?", confirmColor: "#0094ff" })
}
</script>