main
ihzero 2024-04-30 23:27:05 +08:00
parent a3a1e62425
commit a8820eeaa9
12 changed files with 101 additions and 52 deletions

View File

@ -6,7 +6,6 @@ export default {
if (userStore.isLogin) {
userStore.fetchUserInfo()
}
console.log(userStore.isLogin);
// #ifdef APP-PLUS
if (userStore.isLogin) {
plus.navigator.closeSplashscreen()

View File

@ -1,13 +1,20 @@
<template>
<view class="relative">
<view class="relative box-content">
<view>
<slot></slot>
</view>
<uv-badge
absolute
:offset="[0, 0]"
type="error"
max="99"
:value="value"
absolute
:offset="[0, 0]"
type="error"
max="99"
:absolute="true"
:value="value"
:color="color"
:bgColor="bgColor"
customStyle="transform:translate(50%,-50%);"
></uv-badge>
<slot></slot>
</view>
</template>
<script setup>
@ -18,5 +25,13 @@ const props = defineProps({
value: {
type: [Number, String],
},
bgColor:{
type: String,
default: '#ee2c37',
},
color:{
type: String,
default: '#ee2c37',
}
})
</script>

View File

@ -50,7 +50,7 @@
<view class="h-40vh flex-center flex-col">
<view
:disabled="noCheck"
:disabled="noCheck && maxDistance!=0"
@click="clockIn"
class="w-220rpx h-220rpx rounded-full overflow-hidden card-shadow1 flex-center btn"
>
@ -118,7 +118,10 @@ const form = reactive({
const rules = ref({})
const noCheck = computed(() => {
return isGPS.value || !detail.enable
return !isGPS.value || !detail.value.enable
})
const maxDistance = computed(() => {
return detail.value.maxDistance
})
const timeConfirm = ({ value }) => {
@ -139,10 +142,10 @@ const getLoca = async () => {
type: 'wgs84',
fail: (err) => {
isGPS.value = false
uni.showToast({
icon: 'none',
title: '定位失败,请检查手机定位权限是否开启',
})
// uni.showToast({
// icon: 'none',
// title: '',
// })
},
success: (res) => {
isGPS.value = true
@ -150,7 +153,7 @@ const getLoca = async () => {
complete: async (e) => {
position.value = {
lat: e.latitude,
lng: e.longitude,
lon: e.longitude,
...e
}
initLo()
@ -159,7 +162,12 @@ const getLoca = async () => {
}
const initLo = async () => {
const resdata = await http.get('/hr/sign/info', position.value)
console.log(position.value);
const resdata = await http.get('/hr/sign/info',{
params: {
...position.value
}
})
detail.value = resdata
form.type = resdata.type
form.sign_time = timeList.value[0].find((e) => e.value == resdata.time)?.name
@ -203,7 +211,7 @@ const goPage = (url) => {
.btn {
&[disabled='true'] {
@apply opacity-70 pointer-events-none;
@apply bg-hex-999 pointer-events-none;
}
}
</style>

View File

@ -17,6 +17,12 @@
>
<uv-steps current="0" dot direction="column">
<uv-steps-item title="上班打卡">
<template #icon>
<view
class="w-16rpx h-16rpx rounded-full"
:style="{background: current.first_time ? '#3c9cff' : '#999'}"
></view>
</template>
<template #desc>
<view class="text-24rpx text-hex-999">{{
current.first_time
@ -38,7 +44,7 @@
<view
@click="goC"
class="flex text-24rpx mt-10rpx"
v-if="current?.sign_status == 2"
v-if="current?.sign_status == 2 || current?.sign_status == 3"
>
<view class="text-hex-3c9cff">补卡申请></view>
<view>补卡申请</view>
@ -95,8 +101,8 @@ const onChangeDay = (e) => {
const goC = () => {
// /pages/make-card/create
let type
if(!current.value.last_time) type = 1
if(!current.value.first_time) type = 2
if (!current.value.last_time) type = 1
if (!current.value.first_time) type = 2
uni.navigateTo({
url: `/pages/make-card/create?date=${current.value.date}&type=${type}`,
})

View File

@ -38,7 +38,7 @@ const { mescrollItem } = useMescrollComp(onPageScroll, onReachBottom)
onLoad(() => {
uni.$on('examination:onRefresh', () => {
mescrollItem?.value?.refresh()
mescrollItem?.value?.getMescroll()?.resetUpScroll()
})
})

View File

@ -8,15 +8,15 @@
</template>
</CuNavbar>
<view class="bg-primary p-base text-center text-white relative">
<view class="absolute top-20rpx right-20rpx z-888" @click="goPath('/pages/message/index')">
<uv-icon
color="#fff"
size="48rpx"
name="chat"
></uv-icon>
<view
class="absolute top-20rpx right-20rpx z-888"
@click="goPath('/pages/message/index')"
>
<cu-badge :value="unread_notifications" color="#fff" bgColor="transparent">
<uv-icon color="#fff" size="48rpx" name="chat"></uv-icon>
</cu-badge>
</view>
<swiper>
<swiper-item>
<view class="mt-60rpx">昨日累计金额</view>
@ -82,8 +82,13 @@ import { onShow } from '@dcloudio/uni-app'
import { timeFormat } from '@climblee/uv-ui/libs/function'
import StoreDown from './components/store-down.vue'
import { useUserStore } from '@/store/modules/user'
import cuBadge from '@/components/cu-badge/index.vue'
import checkPermission from '@/utils/permission'
const userStore = useUserStore()
const userInfo = computed(() => userStore.userInfo)
const unread_notifications = computed(
() => userInfo.value.unread_notifications || 0
)
const opts = {
color: ['#ee2c37'],
dataLabel: false,
@ -129,11 +134,13 @@ const list = ref([
const tabIndex = ref(0)
const detail = ref({
yesday_ledger: {},
current_month_ledger:{}
current_month_ledger: {},
})
const chartData = ref({})
const yesday_ledger = computed(() => detail.value.yesday_ledger || {})
const current_month_ledger = computed(() => detail.value.current_month_ledger || {})
const current_month_ledger = computed(
() => detail.value.current_month_ledger || {}
)
const trends_of_30days = computed(() => detail.value.trends_of_30days || [])
const yesterday = computed(() => {
@ -173,6 +180,7 @@ const updateData = () => {
onShow(() => {
getData()
userStore.fetchUserInfo()
})
const getData = (e = {}) => {

View File

@ -43,15 +43,15 @@
@click="goPath('/pages/clockout/index')"
>
<image
class="w-40rpx h-40rpx"
class="w-40px h-40rpx"
src="@/static/images/rl.svg"
></image>
</view>
<cu-badge :value="unread_notifications">
<cu-badge color="white" :value="unread_notifications">
<uv-icon
@click="goPath('/pages/message/index')"
color="#8a8a8a"
size="48rpx"
size="54rpx"
name="chat"
></uv-icon>
</cu-badge>
@ -95,6 +95,7 @@ import contractIcon from '@/static/images/contract.svg'
import booksIcon from '@/static/images/books.svg'
import examinationIcon from '@/static/images/examination.svg'
import cuBadge from '@/components/cu-badge/index.vue'
import { onShow } from '@dcloudio/uni-app'
const userStore = useUserStore()
const userInfo = computed(() => userStore.userInfo)
@ -102,6 +103,10 @@ const unread_notifications = computed(
() => userInfo.value.unread_notifications || 0
)
onShow(() => {
userStore.fetchUserInfo()
})
const opList = [
{
title: '门店数据',

View File

@ -43,7 +43,7 @@
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="请输入加班事由" prop="reason" labelPosition="top">
<uv-textarea :customStyle="{ padding: '0' }" v-model="form.reason" count placeholder="请输入" :border="`none`" :maxlength="200"></uv-textarea>
<uv-textarea :customStyle="{ padding: '0' }" v-model="form.reason" count placeholder="请输入加班事由" :border="`none`" :maxlength="200"></uv-textarea>
</uv-form-item>
</uv-form>
</view>

View File

@ -1,7 +1,7 @@
<template>
<view>
<CuNavbar :isBack="isBack" title="数据上报"></CuNavbar>
<CuNavbar :isBack="isBack || false" title="数据上报"></CuNavbar>
<view
:class="[
checkPermission(['store']) && form.allow_rereport
@ -202,6 +202,14 @@ import { timeFormat } from '@climblee/uv-ui/libs/function/index'
import { add } from '@/utils/index'
import checkPermission from '@/utils/permission'
import { onShow } from '@dcloudio/uni-app'
const props = defineProps({
isBack: {
type: Boolean,
default: false
}
})
const calendars = ref(null)
const modalRef = ref(null)
const formRef = ref(null)
@ -211,6 +219,7 @@ const userInfo = computed(() => userStore.userInfo || {})
const store = computed(() => userInfo.value.store)
const endDate = timeFormat(new Date(), 'yyyy-mm-dd')
const form = reactive({
date: endDate,
items: [],
@ -250,12 +259,7 @@ const rules = reactive({
},
})
const props = defineProps({
isBack: {
type: Boolean,
default: false,
},
})
const style = computed(() => {
const style = {}
style.bottom = addUnit(sys().windowBottom, 'px')

View File

@ -29,7 +29,7 @@
<view class="line-clamp-1 flex-1">
{{ item.name }}
</view>
<view @click="downloadFile(item.url)">
<view @click="downloadFile(item.value)">
<uv-icon size="40rpx" name="download"></uv-icon>
</view>
</view>

View File

@ -115,7 +115,7 @@ const select = (e) => {
modalOptin.content = '是否确认删除该员工?'
modalOptin.confirm = onDelete
modalRef.value.open()
}else if(value === 'store'){
} else if (value === 'store') {
uni.navigateTo({
url: `/pages/user/update?id=${id.value}&type=store`,
})
@ -123,13 +123,15 @@ const select = (e) => {
}
const onDelete = () => {
http.delete(`/hr/employee/${id.value}`).then((res) => {
uni.$emit('user:onRefresh')
uni.showToast({
title: '删除成功',
duration: 2000,
icon: 'none',
})
uni.navigateBack()
uni.$emit('user:onRefresh')
setTimeout(() => {
uni.navigateBack()
}, 2000)
})
}
const onQuick = () => {

View File

@ -183,14 +183,15 @@ const updateUser = async () => {
await http.put(`/hr/employee/${id.value}`, {
...form,
})
uni.$emit('user:onRefresh')
uni.navigateBack()
formRef.value.resetFields()
uni.showToast({
title: '修改成功',
duration: 2000,
icon: 'none',
})
uni.$emit('user:onRefresh')
setTimeout(() => {
uni.navigateBack()
formRef.value.resetFields()
}, 2000)
} catch (error) {
} finally {
loading.value = false
@ -211,6 +212,7 @@ const addUser = async () => {
duration: 2000,
icon: 'none',
})
uni.$emit('user:onRefresh')
} catch (error) {
} finally {
loading.value = false