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) { if (userStore.isLogin) {
userStore.fetchUserInfo() userStore.fetchUserInfo()
} }
console.log(userStore.isLogin);
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (userStore.isLogin) { if (userStore.isLogin) {
plus.navigator.closeSplashscreen() plus.navigator.closeSplashscreen()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -43,7 +43,7 @@
</uv-form-item> </uv-form-item>
<uv-line color="#f5f5f5"></uv-line> <uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="请输入加班事由" prop="reason" labelPosition="top"> <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-item>
</uv-form> </uv-form>
</view> </view>

View File

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

View File

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

View File

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

View File

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