parent
98dca1863c
commit
a7455690bf
|
|
@ -296,6 +296,39 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},{
|
||||||
|
"root": "pages/train-books",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "培训课件"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "培训课件"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"root": "pages/examination",
|
||||||
|
"pages": [
|
||||||
|
{
|
||||||
|
"path": "index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "培训考试"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "detail",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "培训考试"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="请假申请">
|
<CuNavbar title="请假申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view @click="goPath('/pages/ask-leave/create')" class="text-24rpx text-white">申请</view>
|
<view
|
||||||
|
@click="goPath('/pages/ask-leave/create')"
|
||||||
|
class="text-24rpx text-white"
|
||||||
|
>申请</view
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -14,7 +18,28 @@
|
||||||
@change="tabChange"
|
@change="tabChange"
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
<MescrollItem ref="mescrollItem0" :top="88" :i="0" :index="tabIndex" :apiUrl="tabList[0].apiUrl">
|
<MescrollItem
|
||||||
|
ref="mescrollItem0"
|
||||||
|
:top="88"
|
||||||
|
:i="0"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[0].apiUrl"
|
||||||
|
>
|
||||||
|
<template v-slot="{ list }">
|
||||||
|
<view class="space-y-15rpx p-base">
|
||||||
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
<Item :item="item"></Item>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</MescrollItem>
|
||||||
|
<MescrollItem
|
||||||
|
ref="mescrollItem1"
|
||||||
|
:top="88"
|
||||||
|
:i="1"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[1].apiUrl"
|
||||||
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
|
@ -26,29 +51,37 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from "@/components/cu-navbar/index"
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from "vue"
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from "@dcloudio/uni-app"
|
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from "@/uni_modules/mescroll-uni/hooks/useMescrollMore.js"
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from "@/components/mescroll-api/more.vue"
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
import Item from "./components/item.vue"
|
import Item from './components/item.vue'
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: "我的请假",
|
name: '我的请假',
|
||||||
apiUrl: "/hr/holidays"
|
apiUrl: '/hr/holidays',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "请假审核"
|
name: '请假审核',
|
||||||
}
|
apiUrl: '/workflow',
|
||||||
|
params: {
|
||||||
|
subject_type: 'holiday_applies',
|
||||||
|
},
|
||||||
|
},
|
||||||
])
|
])
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
||||||
const mescrollItems = [mescrollItem0, mescrollItem1]
|
const mescrollItems = [mescrollItem0, mescrollItem1]
|
||||||
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(mescrollItems, onPageScroll, onReachBottom)
|
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
const goPath = url => {
|
mescrollItems,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
|
)
|
||||||
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="出差申请">
|
<CuNavbar title="出差申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view @click="goPath('/pages/business/create')" class="text-24rpx text-white">申请</view>
|
<view
|
||||||
|
@click="goPath('/pages/business/create')"
|
||||||
|
class="text-24rpx text-white"
|
||||||
|
>申请</view
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -14,7 +18,30 @@
|
||||||
@change="tabChange"
|
@change="tabChange"
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
<MescrollItem ref="mescrollItem0" :top="88" :i="0" :index="tabIndex" :apiUrl="tabList[0].apiUrl">
|
<MescrollItem
|
||||||
|
ref="mescrollItem0"
|
||||||
|
:top="88"
|
||||||
|
:i="0"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[0].apiUrl"
|
||||||
|
>
|
||||||
|
<template v-slot="{ list }">
|
||||||
|
<view class="space-y-15rpx p-base">
|
||||||
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
<Item :item="item"></Item>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</MescrollItem>
|
||||||
|
|
||||||
|
<MescrollItem
|
||||||
|
ref="mescrollItem1"
|
||||||
|
:top="88"
|
||||||
|
:i="1"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[1].apiUrl"
|
||||||
|
:params="tabList[1].params"
|
||||||
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
|
@ -26,29 +53,37 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from "@/components/cu-navbar/index"
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from "vue"
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from "@dcloudio/uni-app"
|
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from "@/uni_modules/mescroll-uni/hooks/useMescrollMore.js"
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from "@/components/mescroll-api/more.vue"
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
import Item from "./components/item.vue"
|
import Item from './components/item.vue'
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: "我的请假",
|
name: '我的请假',
|
||||||
apiUrl: "/hr/offical-bussiness"
|
apiUrl: '/hr/offical-bussiness',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "请假审核"
|
name: '请假审核',
|
||||||
}
|
apiUrl: '/workflow',
|
||||||
|
params: {
|
||||||
|
subject_type: 'holiday_applies',
|
||||||
|
},
|
||||||
|
},
|
||||||
])
|
])
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
||||||
const mescrollItems = [mescrollItem0, mescrollItem1]
|
const mescrollItems = [mescrollItem0, mescrollItem1]
|
||||||
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(mescrollItems, onPageScroll, onReachBottom)
|
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
const goPath = url => {
|
mescrollItems,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
|
)
|
||||||
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
|
|
|
||||||
|
|
@ -1,32 +1,43 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click.stop="onClick">
|
<view
|
||||||
|
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
|
||||||
|
@click.stop="onClick"
|
||||||
|
>
|
||||||
<view class="flex items-center justify-between">
|
<view class="flex items-center justify-between">
|
||||||
<view class="text-30rpx">{{ item.name }}</view>
|
<view class="text-30rpx">{{ item.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-scroll-list>
|
<uv-scroll-list v-if="item.images" :indicator="false">
|
||||||
<view v-for="(item, index) in item.images" :key="index">
|
<view class="space-x-15rpx flex">
|
||||||
<image :src="item" mode="heightFix" class="mr-20rpx" style="height: 200rpx"></image>
|
<view v-for="(item, index) in item?.images ?? []" :key="index">
|
||||||
|
<image
|
||||||
|
:src="item + ''"
|
||||||
|
mode="heightFix"
|
||||||
|
style="height: 160rpx"
|
||||||
|
></image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uv-scroll-list>
|
</uv-scroll-list>
|
||||||
<view
|
<view
|
||||||
:style="{
|
:style="{
|
||||||
color: statusFun(item.workflow_check.status, 'workflow_check', 'color')
|
color: statusFun(item.workflow_check.check_status, 'workflow_check', 'color'),
|
||||||
}"
|
}"
|
||||||
class="text-24rpx"
|
class="text-24rpx"
|
||||||
>{{ statusFun(item.workflow_check.status, "workflow_check", "name") }}</view
|
>{{
|
||||||
|
statusFun(item.workflow_check.check_status, 'workflow_check', 'name')
|
||||||
|
}}</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import statusFun from "@/utils/status"
|
import statusFun from '@/utils/status'
|
||||||
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: Object
|
item: Object,
|
||||||
})
|
})
|
||||||
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/contract/detail?id=${props.item.id}`
|
url: `/pages/contract/detail?id=${props.item.id}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,34 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base" v-if="detail">
|
<view class="px-base" v-if="detail">
|
||||||
<CuNavbar title="合同详情">
|
<CuNavbar title="合同详情">
|
||||||
<template v-if="!isEdit" #right>
|
<template #right>
|
||||||
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
<view
|
||||||
|
class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx"
|
||||||
|
>
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<view class="py-20rpx flex items-center justify-between">
|
||||||
<view>上传人</view>
|
<view>上传人</view>
|
||||||
<view class="text-hex-999999">{{ detail.employee.name }}</view>
|
<view class="text-hex-999999">{{ detail.employee.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-line></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<!-- <view class="py-20rpx flex items-center justify-between">
|
<!-- <view class="py-20rpx flex items-center justify-between">
|
||||||
<view>所属门店</view>
|
<view>所属门店</view>
|
||||||
<view class="text-hex-999999">{{ detail.store.title }}</view>
|
<view class="text-hex-999999">{{ detail.store.title }}</view>
|
||||||
</view> -->
|
</view> -->
|
||||||
<uv-line></uv-line>
|
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<view class="py-20rpx flex items-center justify-between">
|
||||||
<view>电话号码</view>
|
<view>电话号码</view>
|
||||||
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
|
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-line></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<view class="py-20rpx flex items-center justify-between">
|
||||||
<view>上传时间</view>
|
<view>上传时间</view>
|
||||||
<view class="text-hex-999999">{{ timeFormat(detail.created_at, "yyyy-mm-dd hh:MM") }}</view>
|
<view class="text-hex-999999">{{
|
||||||
|
timeFormat(detail.created_at, 'yyyy-mm-dd hh:MM')
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-line></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<view class="py-20rpx flex items-center justify-between">
|
||||||
<view>合同名称</view>
|
<view>合同名称</view>
|
||||||
<view class="text-hex-999999">{{ detail.name }}</view>
|
<view class="text-hex-999999">{{ detail.name }}</view>
|
||||||
|
|
@ -33,47 +36,67 @@
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<view class="py-20rpx flex items-center justify-between">
|
||||||
<view>合同内容</view>
|
<view>合同内容</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-scroll-list>
|
<uv-scroll-list :indicator="false">
|
||||||
<view v-for="(item, index) in detail.images" :key="index">
|
<view class="space-x-15rpx flex">
|
||||||
<image :src="item" mode="heightFix" class="mr-20rpx" style="height: 200rpx"></image>
|
<view v-for="(item, index) in detail.images" :key="index">
|
||||||
|
<image
|
||||||
|
:src="item"
|
||||||
|
mode="heightFix"
|
||||||
|
style="height: 160rpx"
|
||||||
|
></image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</uv-scroll-list>
|
</uv-scroll-list>
|
||||||
</view>
|
</view>
|
||||||
<view class="h-100rpx">
|
<view class="h-100rpx">
|
||||||
<view class="fixed bottom-0 left-0 right-0 h-120rpx bg-white flex items-center px-base space-x-30rpx">
|
<view
|
||||||
|
class="fixed bottom-0 left-0 right-0 h-120rpx bg-white flex items-center px-base space-x-30rpx"
|
||||||
|
>
|
||||||
<view class="flex-1">
|
<view class="flex-1">
|
||||||
<uv-button color="#999999" shape="circle" plain block> 拒绝 </uv-button>
|
<uv-button color="#999999" shape="circle" plain block>
|
||||||
|
拒绝
|
||||||
|
</uv-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-1">
|
<view class="flex-1">
|
||||||
<uv-button type="primary" shape="circle" block> 通过 </uv-button>
|
<uv-button type="primary" shape="circle" block> 通过 </uv-button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
|
<uv-picker
|
||||||
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
ref="pickerRef"
|
||||||
|
:columns="columns"
|
||||||
|
@confirm="confirmPicker"
|
||||||
|
></uv-picker>
|
||||||
|
<uv-modal
|
||||||
|
ref="modalRef"
|
||||||
|
title="提示"
|
||||||
|
content="确定删除吗?"
|
||||||
|
@confirm="onSubmit"
|
||||||
|
:showCancelButton="true"
|
||||||
|
></uv-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from "@/components/cu-navbar/index"
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { http } from "@/utils/request"
|
import { http } from '@/utils/request'
|
||||||
import { onLoad } from "@dcloudio/uni-app"
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { ref } from "vue"
|
import { ref } from 'vue'
|
||||||
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const columns = [["修改", "删除"]]
|
const columns = [['修改', '删除']]
|
||||||
const detail = ref()
|
const detail = ref()
|
||||||
const pickerRef = ref(null)
|
const pickerRef = ref(null)
|
||||||
const id = ref(0)
|
const id = ref(0)
|
||||||
const open = () => {
|
const open = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
}
|
}
|
||||||
const confirmPicker = e => {
|
const confirmPicker = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
if (e.value[0] === "删除") {
|
if (e.value[0] === '删除') {
|
||||||
modalRef.value.open()
|
modalRef.value.open()
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/contract/create?id=${id.value}`
|
url: `/pages/contract/create?id=${id.value}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -81,14 +104,14 @@ const onSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
await http.request({
|
await http.request({
|
||||||
url: `/agreements/${id.value}`,
|
url: `/agreements/${id.value}`,
|
||||||
method: "DELETE",
|
method: 'DELETE',
|
||||||
header: {
|
header: {
|
||||||
Accept: "application/json"
|
Accept: 'application/json',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "删除成功",
|
title: '删除成功',
|
||||||
icon: "none"
|
icon: 'none',
|
||||||
})
|
})
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -97,17 +120,17 @@ const onSubmit = async () => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onLoad(options => {
|
onLoad((options) => {
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
http
|
http
|
||||||
.request({
|
.request({
|
||||||
url: `/agreements/${options.id}`,
|
url: `/agreements/${options.id}`,
|
||||||
method: "GET",
|
method: 'GET',
|
||||||
header: {
|
header: {
|
||||||
Accept: "application/json"
|
Accept: 'application/json',
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then((res) => {
|
||||||
detail.value = res
|
detail.value = res
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="我的合同">
|
<CuNavbar title="我的合同">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view @click="goPath('/pages/contract/create')" class="text-24rpx text-white">上传</view>
|
<view
|
||||||
|
@click="goPath('/pages/contract/create')"
|
||||||
|
class="text-24rpx text-white"
|
||||||
|
>上传</view
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -17,7 +21,30 @@
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
|
|
||||||
<MescrollItem ref="mescrollItem0" :top="88" :i="0" :index="tabIndex" :apiUrl="tabList[0].apiUrl">
|
<MescrollItem
|
||||||
|
ref="mescrollItem0"
|
||||||
|
:top="88"
|
||||||
|
:i="0"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[0].apiUrl"
|
||||||
|
>
|
||||||
|
<template v-slot="{ list }">
|
||||||
|
<view class="space-y-15rpx p-base">
|
||||||
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
<Item :item="item"></Item>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</MescrollItem>
|
||||||
|
|
||||||
|
<MescrollItem
|
||||||
|
ref="mescrollItem1"
|
||||||
|
:top="88"
|
||||||
|
:i="1"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[1].apiUrl"
|
||||||
|
:params="tabList[1].params"
|
||||||
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
|
@ -29,34 +56,38 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from "@/components/cu-navbar/index"
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { computed, reactive, ref } from "vue"
|
import { computed, reactive, ref } from 'vue'
|
||||||
import Item from "./components/item.vue"
|
import Item from './components/item.vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from "@dcloudio/uni-app"
|
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from "@/uni_modules/mescroll-uni/hooks/useMescrollMore.js"
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from "@/components/mescroll-api/more.vue"
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
|
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
||||||
const mescrollItems = [mescrollItem0, mescrollItem1]
|
const mescrollItems = [mescrollItem0, mescrollItem1]
|
||||||
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(mescrollItems, onPageScroll, onReachBottom)
|
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
|
mescrollItems,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
|
)
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: "我的合同",
|
name: '我的合同',
|
||||||
apiUrl: "/agreements"
|
apiUrl: '/agreements',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "合同审核",
|
name: '合同审核',
|
||||||
apiUrl: "",
|
apiUrl: '/workflow',
|
||||||
params: {
|
params: {
|
||||||
// aaa:111
|
subject_type: 'agreements',
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
])
|
])
|
||||||
const goPath = url => {
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
|
|
|
||||||
|
|
@ -28,20 +28,31 @@
|
||||||
</view>
|
</view>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
<view class="">
|
<view class="">
|
||||||
<view v-for="ob in 10" :key="ob">
|
<view v-for="(ob, i) in showList" :key="i">
|
||||||
<uv-sticky bgColor="#f5f5f5" zIndex="10" offsetTop="44" >
|
<uv-sticky bgColor="#f5f5f5" zIndex="10" offsetTop="44">
|
||||||
<view class="h-80rpx flex items-center px-base">
|
<view class="h-80rpx flex items-center px-base">
|
||||||
<TitleComp title="2024"></TitleComp>
|
<TitleComp :title="`${timeFormat(i, 'yyyy')}`"></TitleComp>
|
||||||
</view>
|
</view>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view v-for="(item, i) in 3" :key="i">
|
<view v-for="(item, i) in ob" :key="i">
|
||||||
<view class="flex items-center h-84rpx">
|
<view class="flex items-center h-84rpx">
|
||||||
<view class="w-110rpx text-primary">4月</view>
|
<view class="w-110rpx text-primary"
|
||||||
<view class="flex-1">0/150000</view>
|
>{{ timeFormat(i, 'mm') }}月</view
|
||||||
<view>未开始</view>
|
>
|
||||||
|
<view class="flex-1"
|
||||||
|
>{{ item.actual_performance }}/{{
|
||||||
|
item.expected_performance
|
||||||
|
}}</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:style="{
|
||||||
|
color: statusFun(item.status, 'shore_task_status', 'color'),
|
||||||
|
}"
|
||||||
|
>{{ statusFun(item.status, 'shore_task_status', 'name') }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
<uv-line></uv-line>
|
<uv-line v-if="i !== ob.length - 1" color="#f5f5f5"></uv-line>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -56,7 +67,7 @@ import { http } from '@/utils/request'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from 'vue'
|
||||||
|
import statusFun from '@/utils/status'
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
const tabList = [
|
const tabList = [
|
||||||
{ name: '业绩目标', value: 'future' },
|
{ name: '业绩目标', value: 'future' },
|
||||||
|
|
@ -70,6 +81,7 @@ const countData = reactive({
|
||||||
expected_performance: 0,
|
expected_performance: 0,
|
||||||
})
|
})
|
||||||
const currentTabObj = computed(() => tabList[currentTab.value])
|
const currentTabObj = computed(() => tabList[currentTab.value])
|
||||||
|
const showList = computed(() => encapsulateDataByMonth(list.value))
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getCount()
|
getCount()
|
||||||
|
|
@ -104,4 +116,13 @@ const getList = async () => {
|
||||||
})
|
})
|
||||||
list.value = resData
|
list.value = resData
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function encapsulateDataByMonth(data) {
|
||||||
|
return data.reduce((result, item) => {
|
||||||
|
const { month, ...rest } = item
|
||||||
|
result[month] = result[month] || []
|
||||||
|
result[month].push(rest)
|
||||||
|
return result
|
||||||
|
}, {})
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="补卡申请">
|
<CuNavbar title="补卡申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view @click="goPath('/pages/make-card/create')" class="text-24rpx text-white">申请</view>
|
<view
|
||||||
|
@click="goPath('/pages/make-card/create')"
|
||||||
|
class="text-24rpx text-white"
|
||||||
|
>申请</view
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -14,7 +18,29 @@
|
||||||
@change="tabChange"
|
@change="tabChange"
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
<MescrollItem ref="mescrollItem0" :top="88" :i="0" :index="tabIndex" :apiUrl="tabList[0].apiUrl">
|
<MescrollItem
|
||||||
|
ref="mescrollItem0"
|
||||||
|
:top="88"
|
||||||
|
:i="0"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[0].apiUrl"
|
||||||
|
>
|
||||||
|
<template v-slot="{ list }">
|
||||||
|
<view class="space-y-15rpx p-base">
|
||||||
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
<Item :item="item"></Item>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</MescrollItem>
|
||||||
|
<MescrollItem
|
||||||
|
ref="mescrollItem1"
|
||||||
|
:top="88"
|
||||||
|
:i="1"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[1].apiUrl"
|
||||||
|
:params="tabList[1].params"
|
||||||
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
|
@ -26,29 +52,37 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from "@/components/cu-navbar/index"
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from "vue"
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from "@dcloudio/uni-app"
|
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from "@/uni_modules/mescroll-uni/hooks/useMescrollMore.js"
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from "@/components/mescroll-api/more.vue"
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
import Item from "./components/item.vue"
|
import Item from './components/item.vue'
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: "我的补卡",
|
name: '我的补卡',
|
||||||
apiUrl: "/hr/sign-repairs"
|
apiUrl: '/hr/sign-repairs',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "补卡审核"
|
name: '补卡审核',
|
||||||
}
|
apiUrl: '/workflow',
|
||||||
|
params: {
|
||||||
|
subject_type: 'employee_sign_repairs',
|
||||||
|
},
|
||||||
|
},
|
||||||
])
|
])
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
||||||
const mescrollItems = [mescrollItem0, mescrollItem1]
|
const mescrollItems = [mescrollItem0, mescrollItem1]
|
||||||
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(mescrollItems, onPageScroll, onReachBottom)
|
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
const goPath = url => {
|
mescrollItems,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
|
)
|
||||||
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="加班申请">
|
<CuNavbar title="加班申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view @click="goPath('/pages/overtime/create')" class="text-24rpx text-white">申请</view>
|
<view
|
||||||
|
@click="goPath('/pages/overtime/create')"
|
||||||
|
class="text-24rpx text-white"
|
||||||
|
>申请</view
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -14,7 +18,30 @@
|
||||||
@change="tabChange"
|
@change="tabChange"
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
</uv-sticky>
|
</uv-sticky>
|
||||||
<MescrollItem ref="mescrollItem0" :top="88" :i="0" :index="tabIndex" :apiUrl="tabList[0].apiUrl">
|
<MescrollItem
|
||||||
|
ref="mescrollItem0"
|
||||||
|
:top="88"
|
||||||
|
:i="0"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[0].apiUrl"
|
||||||
|
>
|
||||||
|
<template v-slot="{ list }">
|
||||||
|
<view class="space-y-15rpx p-base">
|
||||||
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
<Item :item="item"></Item>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</MescrollItem>
|
||||||
|
|
||||||
|
<MescrollItem
|
||||||
|
ref="mescrollItem1"
|
||||||
|
:top="88"
|
||||||
|
:i="1"
|
||||||
|
:index="tabIndex"
|
||||||
|
:apiUrl="tabList[1].apiUrl"
|
||||||
|
:params="tabList[1].params"
|
||||||
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<view v-for="(item, i) in list" :key="i">
|
||||||
|
|
@ -26,29 +53,37 @@
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from "@/components/cu-navbar/index"
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from "vue"
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from "@dcloudio/uni-app"
|
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from "@/uni_modules/mescroll-uni/hooks/useMescrollMore.js"
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from "@/components/mescroll-api/more.vue"
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
import Item from "./components/item.vue"
|
import Item from './components/item.vue'
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: "我的加班",
|
name: '我的加班',
|
||||||
apiUrl: "/hr/overtimes"
|
apiUrl: '/hr/overtimes',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "加班审核"
|
name: '加班审核',
|
||||||
}
|
apiUrl: '/workflow',
|
||||||
|
params: {
|
||||||
|
subject_type: 'overtime_applies',
|
||||||
|
},
|
||||||
|
},
|
||||||
])
|
])
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
||||||
const mescrollItems = [mescrollItem0, mescrollItem1]
|
const mescrollItems = [mescrollItem0, mescrollItem1]
|
||||||
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(mescrollItems, onPageScroll, onReachBottom)
|
const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
const goPath = url => {
|
mescrollItems,
|
||||||
|
onPageScroll,
|
||||||
|
onReachBottom
|
||||||
|
)
|
||||||
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<view>
|
<view>
|
||||||
<Cell title="当前版本" :isLink="false">
|
<Cell title="当前版本" :isLink="false">
|
||||||
<view class="flex justify-end text-hex-999999 text-24rpx px-base">
|
<view class="flex justify-end text-hex-999999 text-24rpx px-base">
|
||||||
v1.0.0
|
v{{ varsion }}
|
||||||
</view>
|
</view>
|
||||||
</Cell>
|
</Cell>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -26,7 +26,10 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import Cell from '@/components/cell/index'
|
import Cell from '@/components/cell/index'
|
||||||
|
import { sys } from '@climblee/uv-ui/libs/function';
|
||||||
|
import { computed } from 'vue';
|
||||||
|
const sysInfo = sys()
|
||||||
|
const varsion = computed(() => sysInfo.appVersion)
|
||||||
const goPath = (url) => {
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
<template>
|
||||||
|
<uv-scroll-list
|
||||||
|
:indicator="true"
|
||||||
|
indicatorColor="#fff0f0"
|
||||||
|
indicatorActiveColor="#f56c6c"
|
||||||
|
>
|
||||||
|
<view>
|
||||||
|
<template v-for="(item, i) in list" :key="i">
|
||||||
|
<view v-if="i == 0" class="flex items-center w-full text-24rpx b-solid b-b-1px">
|
||||||
|
<view class="w-140rpx text-center flex-none"> 日期 </view>
|
||||||
|
<view class="w-300rpx text-center leading-60rpx flex-none b-r-solid b-r-1px b-l-solid b-l-1px">
|
||||||
|
<view class="h-60rpx b-b-solid b-1px">总账</view>
|
||||||
|
<view class="h-60rpx grid grid-cols-3">
|
||||||
|
<view>销售</view>
|
||||||
|
<view>支出</view>
|
||||||
|
<view>新增客户</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="text-center leading-60rpx w-140rpx flex-none"
|
||||||
|
v-for="(ty, j) in item.lottery_types"
|
||||||
|
:key="j"
|
||||||
|
>
|
||||||
|
<view class="b-b-solid b-1px">{{ ty.name }}</view>
|
||||||
|
<view class="grid grid-cols-2">
|
||||||
|
<view>{{ ty.sales }}</view>
|
||||||
|
<view>{{ ty.expenditure }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view
|
||||||
|
class="flex justify-between text-center text-24rpx items-center card-shadow bg-white rounded-19rpx h-80rpx"
|
||||||
|
>
|
||||||
|
<view class="flex-1 w-140rpx flex-none">{{
|
||||||
|
timeFormat(item.date, 'mm-dd')
|
||||||
|
}}</view>
|
||||||
|
<!-- 总账 -->
|
||||||
|
<view class="flex-1">{{ item.ledger.sales }}</view>
|
||||||
|
<view class="flex-1">{{ item.ledger.expenditure }}</view>
|
||||||
|
<view class="flex-1">{{ item.ledger.new_customers }}</view>
|
||||||
|
<!-- 种类 -->
|
||||||
|
<template v-for="(ty, j) in item.lottery_types" :key="j">
|
||||||
|
<view class="flex-1">{{ ty.sales }}</view>
|
||||||
|
<view class="flex-1">{{ ty.expenditure }}</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
</uv-scroll-list>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { timeFormat } from '@climblee/uv-ui/libs/function'
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view
|
||||||
|
class="flex justify-between text-center text-28rpx items-center h-80rpx"
|
||||||
|
>
|
||||||
|
<view class="flex-1">排名</view>
|
||||||
|
<view class="flex-1">门店</view>
|
||||||
|
<view class="flex-1">累计客户</view>
|
||||||
|
<view class="flex-1">销售额</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="flex justify-between text-center text-24rpx items-center bg-white rounded-19rpx h-80rpx"
|
||||||
|
v-for="(item, i) in list"
|
||||||
|
:key="i"
|
||||||
|
>
|
||||||
|
<view class="flex-1">{{ item.ranking }}</view>
|
||||||
|
<view class="flex-1">{{ item.store.title }}</view>
|
||||||
|
<view class="flex-1">{{ item.expenditure }}</view>
|
||||||
|
<view class="flex-1">{{ item.sales }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { timeFormat } from '@climblee/uv-ui/libs/function'
|
||||||
|
const props = defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
@ -37,57 +37,66 @@
|
||||||
:lineColor="'#ee2c37'"
|
:lineColor="'#ee2c37'"
|
||||||
:list="tabsList"
|
:list="tabsList"
|
||||||
:scrollable="false"
|
:scrollable="false"
|
||||||
|
:current="tabIndex"
|
||||||
|
@change="tabChange"
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
<view class="text-center text-28rpx"> 2024-03-21 至 2024-03-21 </view>
|
|
||||||
|
<view class="text-center text-28rpx" v-if="tabIndex != 0"
|
||||||
|
>{{ currentTabs.start }} 至 {{ currentTabs.end }}
|
||||||
|
</view>
|
||||||
|
<view class="text-center text-28rpx" v-else>{{ currentTabs.start }}</view>
|
||||||
<view class="flex my-20rpx items-center">
|
<view class="flex my-20rpx items-center">
|
||||||
<view class="text-center flex-1">
|
<view class="text-center flex-1">
|
||||||
<view>销售金额</view>
|
<view>销售金额</view>
|
||||||
<view class="font-600">991122</view>
|
<view class="font-600">{{ ledger.sales }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="h-60rpx">
|
<view class="h-60rpx">
|
||||||
<uv-line direction="col"></uv-line>
|
<uv-line direction="col"></uv-line>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center flex-1">
|
<view class="text-center flex-1">
|
||||||
<view>销售金额</view>
|
<view>兑奖金额</view>
|
||||||
<view class="font-600">991122</view>
|
<view class="font-600">{{ ledger.sales }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="h-60rpx">
|
<view class="h-60rpx">
|
||||||
<uv-line direction="col"></uv-line>
|
<uv-line direction="col"></uv-line>
|
||||||
</view>
|
</view>
|
||||||
<view class="text-center flex-1">
|
<view class="text-center flex-1">
|
||||||
<view>销售涨幅</view>
|
<view>销售涨幅</view>
|
||||||
<view class="text-primary font-600">+20%</view>
|
<view class="text-primary font-600"
|
||||||
|
>{{ ledger.sales_growth_rate }}%</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-tabs
|
<uv-tabs
|
||||||
|
@change="tabChange1"
|
||||||
:lineColor="'#ee2c37'"
|
:lineColor="'#ee2c37'"
|
||||||
:list="[{ name: '销售统计' }, { name: '门店统计' }]"
|
:list="[{ name: '销售统计' }, { name: '门店统计' }]"
|
||||||
:scrollable="false"
|
:scrollable="false"
|
||||||
|
:current="tabIndex1"
|
||||||
></uv-tabs>
|
></uv-tabs>
|
||||||
|
<template v-if="tabIndex1 == 0">
|
||||||
|
<List0 :list="list"></List0>
|
||||||
|
</template>
|
||||||
|
<template v-if="tabIndex1 == 1">
|
||||||
|
<List1 :list="list"></List1>
|
||||||
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
|
import { onShow } from '@dcloudio/uni-app'
|
||||||
|
import { http } from '@/utils/request'
|
||||||
|
import List0 from './components/list0.vue'
|
||||||
|
import List1 from './components/list1.vue'
|
||||||
|
const tabIndex1 = ref(0)
|
||||||
|
const tabIndex = ref(0)
|
||||||
|
const tabsList = ref(generateTimeArray())
|
||||||
|
const list = ref([])
|
||||||
|
const currentTabs = computed(() => tabsList.value[tabIndex.value])
|
||||||
|
|
||||||
const tabsList = ref([
|
|
||||||
{
|
|
||||||
name: '昨日',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '本周',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '上周',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '本月',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '上月',
|
|
||||||
},
|
|
||||||
])
|
|
||||||
const dropDownData = reactive({
|
const dropDownData = reactive({
|
||||||
area: {
|
area: {
|
||||||
label: '全部区域',
|
label: '全部区域',
|
||||||
|
|
@ -134,9 +143,31 @@ const dropDownData = reactive({
|
||||||
})
|
})
|
||||||
|
|
||||||
const result = ref([])
|
const result = ref([])
|
||||||
|
const ledger = ref({
|
||||||
|
expenditure: '0',
|
||||||
|
sales: '0',
|
||||||
|
sales_growth_rate: '0',
|
||||||
|
})
|
||||||
|
|
||||||
const activeName = ref('area')
|
const activeName = ref('area')
|
||||||
|
|
||||||
|
onShow(() => {
|
||||||
|
getCount()
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
const getCount = async () => {
|
||||||
|
const resData = await http.get('/statistics/ledger', {
|
||||||
|
params: {
|
||||||
|
start_at: currentTabs.value.start,
|
||||||
|
end_at: currentTabs.value.end,
|
||||||
|
before_start_at: currentTabs.value.start,
|
||||||
|
before_end_at: currentTabs.value.end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
ledger.value = resData
|
||||||
|
}
|
||||||
|
|
||||||
const selectMenu = (e) => {
|
const selectMenu = (e) => {
|
||||||
const { name, active, type } = e
|
const { name, active, type } = e
|
||||||
activeName.value = name
|
activeName.value = name
|
||||||
|
|
@ -150,4 +181,75 @@ const selectMenu = (e) => {
|
||||||
dropDownData[activeName.value].activeIndex = 0
|
dropDownData[activeName.value].activeIndex = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateTimeRange(name, start, end) {
|
||||||
|
start = timeFormat(start, 'yyyy-mm-dd')
|
||||||
|
end = timeFormat(end, 'yyyy-mm-dd')
|
||||||
|
return { name, start, end }
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStartOfWeek(date) {
|
||||||
|
const dayOfWeek = date.getDay()
|
||||||
|
const diff = date.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1) // 如果今天是周日,从上周一开始
|
||||||
|
return new Date(date.setDate(diff))
|
||||||
|
}
|
||||||
|
|
||||||
|
function getStartOfMonth(date) {
|
||||||
|
return new Date(date.getFullYear(), date.getMonth(), 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateTimeArray() {
|
||||||
|
const today = new Date()
|
||||||
|
const yesterday = new Date(today)
|
||||||
|
yesterday.setDate(today.getDate() - 1)
|
||||||
|
|
||||||
|
const currentWeekStart = getStartOfWeek(today) // 获取本周第一天
|
||||||
|
const currentWeekEnd = new Date(today)
|
||||||
|
currentWeekEnd.setDate(currentWeekStart.getDate() + 6)
|
||||||
|
|
||||||
|
const lastWeekStart = new Date(currentWeekStart)
|
||||||
|
lastWeekStart.setDate(currentWeekStart.getDate() - 7)
|
||||||
|
const lastWeekEnd = new Date(currentWeekEnd)
|
||||||
|
lastWeekEnd.setDate(currentWeekEnd.getDate() - 7)
|
||||||
|
|
||||||
|
const currentMonthStart = getStartOfMonth(today) // 获取本月第一天
|
||||||
|
const currentMonthEnd = new Date(today.getFullYear(), today.getMonth() + 1, 0)
|
||||||
|
|
||||||
|
const lastMonthStart = new Date(currentMonthStart)
|
||||||
|
lastMonthStart.setMonth(lastMonthStart.getMonth() - 1)
|
||||||
|
const lastMonthEnd = new Date(currentMonthEnd)
|
||||||
|
lastMonthEnd.setMonth(lastMonthEnd.getMonth() - 1)
|
||||||
|
|
||||||
|
return [
|
||||||
|
generateTimeRange('昨日', yesterday, yesterday),
|
||||||
|
generateTimeRange('本周', currentWeekStart, currentWeekEnd),
|
||||||
|
generateTimeRange('上周', lastWeekStart, lastWeekEnd),
|
||||||
|
generateTimeRange('本月', currentMonthStart, currentMonthEnd),
|
||||||
|
generateTimeRange('上月', lastMonthStart, lastMonthEnd),
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
const tabChange = (e) => {
|
||||||
|
list.value = []
|
||||||
|
tabIndex.value = e.index
|
||||||
|
getCount()
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const tabChange1 = (e) => {
|
||||||
|
list.value = []
|
||||||
|
tabIndex1.value = e.index
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
const url = tabIndex1.value == 0 ? '/statistics/sales' : '/statistics/stores'
|
||||||
|
const resData = await http.get(url, {
|
||||||
|
params: {
|
||||||
|
start_at: currentTabs.value.start,
|
||||||
|
end_at: currentTabs.value.end,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
list.value = resData
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -22,14 +22,14 @@
|
||||||
<view class="">{{ item.job.name }}</view>
|
<view class="">{{ item.job.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<template v-if="options?.includes(item.promotion_status)">
|
<!-- <template v-if="options?.includes(item.promotion_status)">
|
||||||
<view class="py-10rpx">
|
<view class="py-10rpx">
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-end items-center">
|
<view class="flex justify-end items-center">
|
||||||
<uv-button type="primary" size="mini">去提交</uv-button>
|
<uv-button type="primary" size="mini">去提交</uv-button>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template> -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,24 @@ const data = {
|
||||||
name: '已取消',
|
name: '已取消',
|
||||||
color: '#999999'
|
color: '#999999'
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
shore_task_status: [{
|
||||||
|
value: 1,
|
||||||
|
name: '未开始',
|
||||||
|
color: '#f56c6c'
|
||||||
|
}, {
|
||||||
|
value: 2,
|
||||||
|
name: '待完成',
|
||||||
|
color: '#f56c6c'
|
||||||
|
}, {
|
||||||
|
value: 3,
|
||||||
|
name: '已完成',
|
||||||
|
color: '#3c9cff'
|
||||||
|
}, {
|
||||||
|
value: 4,
|
||||||
|
name: '未完成',
|
||||||
|
color: '#999999'
|
||||||
|
}]
|
||||||
}
|
}
|
||||||
export default function (value, status, key) {
|
export default function (value, status, key) {
|
||||||
if (!status) {
|
if (!status) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue