205 lines
5.6 KiB
Vue
Raw Normal View History

<route lang="json5" type="page">
{
layout: 'default',
style: {
navigationStyle: 'custom'
}
}
</route>
<template>
<TopNavigation title="添加考勤组"></TopNavigation>
2025-01-03 15:49:27 +08:00
<BottomPop
:show="showType"
title="考勤类型"
:onclose="
() => {
showType = false
typeIndex = typeSelectIndex
}
"
:onSure="
() => {
typeSelectIndex = typeIndex
}
"
>
<template v-slot:child>
<view class="px-4">
<view
class="bg-white rounded-1 mt-2"
@click="typeIndex = index"
v-for="(item, index) in typeList"
:key="index"
>
<view class="flex flex-row items-center p-3 box-border">
<view class="flex flex-1 flex-col flex-justify-items-start">
<view class="">{{ item.title }}</view>
<view class="mt-1 text-3.3">{{ item.desc }}</view>
<view class="mt-1 text-2.8 color-gray">{{ item.desc2 }}</view>
</view>
<view v-show="typeIndex == index">
<wd-icon name="check" class="color-[#3372FA] mr-2"></wd-icon>
</view>
</view>
</view>
</view>
</template>
</BottomPop>
<BottomPop
:show="showWay"
title="打卡方式选择"
:onclose="
() => {
showWay = false
}
"
noSure
>
<template v-slot:child>
<view class="px-4">
<view class="bg-white rounded-1 mt-2">
<view
class="flex flex-row items-center p-3 box-border"
2025-01-06 10:19:07 +08:00
@click="
() => {
wayIndex = index
showWay = false
}
"
2025-01-03 15:49:27 +08:00
v-for="(item, index) in wayList"
:key="index"
>
<view class="flex flex-1 flex-col flex-justify-items-start">
<view class="">{{ item.title }}</view>
<view class="mt-1 text-2.8 color-gray">{{ item.desc }}</view>
</view>
<view v-show="wayIndex == index">
<wd-icon name="check" class="color-[#3372FA] mr-2"></wd-icon>
</view>
</view>
</view>
</view>
</template>
</BottomPop>
<view class="h-[calc(100vh-60px)] p-3 box-border">
<view class="bg-white rounded-1.2 mt-2">
<CommonItem text="考勤组名称" isMust value="有多少">
<template v-slot:child>
<input
2025-01-06 10:19:07 +08:00
class="text-right w-100%"
v-model="name"
placeholder="必填"
2025-01-03 15:49:27 +08:00
placeholder-class="color-gray"
@input="nameInput()"
:maxlength="15"
/>
</template>
</CommonItem>
2025-01-03 15:49:27 +08:00
<CommonItem
@click="
() => {
showType = true
}
"
text="考勤类型"
noLine
:value="typeList[typeSelectIndex].title"
></CommonItem>
</view>
<view class="bg-white rounded-1.2 mt-2">
<CommonItem text="考勤人员" isMust value=""></CommonItem>
<CommonItem text="考勤时间" noLine value="周一至周五,09:00-17:00"></CommonItem>
</view>
<view class="bg-white rounded-1.2 mt-2">
2025-01-03 15:49:27 +08:00
<CommonItem
@click="
() => {
showWay = true
}
"
text="打卡方式"
2025-01-06 10:19:07 +08:00
:value="wayList[wayIndex].title"
2025-01-03 15:49:27 +08:00
></CommonItem>
2025-01-06 10:19:07 +08:00
<CommonItem
text="打卡设备"
:isMust="wayIndex == 0"
:noLine="wayIndex == 0"
value=""
hint="未选择"
></CommonItem>
<CommonItem text="打卡地点" v-show="wayIndex == 1" value="" hint="未设置"></CommonItem>
<CommonItem text="打卡WIFI" v-show="wayIndex == 1" noLine value="" hint="未设置"></CommonItem>
</view>
<view @click="goOtsideRule()" v-show="wayIndex == 1" class="bg-white rounded-1.2 mt-2">
<CommonItem text="外勤规则" noLine value="允许外勤卡" hint=""></CommonItem>
</view>
<view class="bg-white rounded-1.2 mt-2">
2025-01-06 10:19:07 +08:00
<CommonItem text="加班统计规则" noLine value="未开启" hint=""></CommonItem>
</view>
<view class="fixed bottom-0 left-0 w-full p-3 box-border">
<wd-button block>保存</wd-button>
</view>
</view>
</template>
<script lang="ts" setup>
2025-01-03 15:49:27 +08:00
import BottomPop from '@/components/BottomPop/BottomPop.vue'
import CommonItem from '@/components/CommonItemItem/CommonItem.vue'
2025-01-03 15:49:27 +08:00
const showType = ref(false)
const typeIndex = ref(0)
const typeSelectIndex = ref(0)
const showWay = ref(false)
const wayIndex = ref(0)
const name = ref('')
const nameInput = () => {
console.log(name.value)
}
2025-01-03 15:49:27 +08:00
const typeList = [
{
title: '固定班制',
desc: '人员每周按照相同时间上下班',
desc2: '适用于办公室坐班,例如每周一至五上班,朝9晚5'
},
{
title: '自由班制',
desc: '无固定上下班时间,可随时打卡',
desc2: '适用于计时工种、灵活用工等'
},
{
title: '排班制',
desc: '排班制人员按每日所排班次上下班',
desc2: '适用于工厂、门店等,例如三班倒、做—休一'
}
]
const wayList = [
{
title: '设备打卡',
desc: '适用于内勤打卡,有效避免打卡等作弊行为'
},
{
title: '设备+手机打卡',
desc: '选择后可开启外勤打卡'
}
]
2025-01-06 10:19:07 +08:00
const outsideRule = {
allow: false,
takePhoto: false,
remark: false,
selectPhoto: false
}
const goOtsideRule = () => {
uni.navigateTo({
url: '/pages/attendance/attendance-add-group/outside-rules'
})
}
</script>
<style lang="scss" scoped>
page {
background-color: #f6f8fc;
}
</style>