修改bug

main
ihzero 2024-04-29 22:06:32 +08:00
parent 74f0c91935
commit 29cb357a1b
15 changed files with 233 additions and 150 deletions

View File

@ -22,7 +22,8 @@
/* */
"modules" : {
"VideoPlayer" : {},
"Camera" : {}
"Camera" : {},
"Geolocation" : {}
},
/* */
"distribute" : {
@ -52,7 +53,12 @@
},
/* SDK */
"sdkConfigs" : {
"ad" : {}
"ad" : {},
"geolocation" : {
"system" : {
"__platform__" : [ "ios", "android" ]
}
}
},
"icons" : {
"android" : {

View File

@ -51,6 +51,12 @@
"navigationBarTitleText": "消息"
}
},
{
"path": "pages/message/detail",
"style": {
"navigationBarTitleText": "消息详情"
}
},
{
"path": "pages/clockout/index",
"style": {

View File

@ -130,6 +130,7 @@ onLoad(() => {
})
const getLoca = async () => {
// uni.openLocation
uni.getLocation({
type: 'wgs84',
fail: (err) => {

View File

@ -31,14 +31,14 @@
<view v-for="(ob, i) in showList" :key="i">
<uv-sticky bgColor="#f5f5f5" zIndex="10" offsetTop="44">
<view class="h-80rpx flex items-center px-base">
<TitleComp :title="`${timeFormat(i, 'yyyy')}`"></TitleComp>
<TitleComp :title="i"></TitleComp>
</view>
</uv-sticky>
<view class="card">
<view v-for="(item, i) in ob" :key="i">
<view class="flex items-center h-84rpx">
<view class="w-110rpx text-primary"
>{{ timeFormat(i, 'mm') }}</view
>{{ timeFormat(item.month, 'mm') }}</view
>
<view class="flex-1"
>{{ item.actual_performance }}/{{
@ -118,11 +118,13 @@ const getList = async () => {
}
function encapsulateDataByMonth(data) {
return data.reduce((result, item) => {
const { month, ...rest } = item
result[month] = result[month] || []
result[month].push(rest)
return result
return data.reduce((groupedData, item) => {
const year = timeFormat(new Date(item.month), 'yyyy')
groupedData[year] = groupedData[year] || []
groupedData[year].push(item)
return groupedData
}, {})
}
</script>

View File

@ -160,6 +160,7 @@ const getData = (e={}) => {
if(!checkPermission(['admin'])){
e.store_id = userStore?.userInfo?.store?.id
}
console.log(e.store_id);
http
.get('/statistics/dashboard', {
params: {

View File

@ -1,19 +1,15 @@
<template>
<view class="card-shadow p-base">
<view class="card-shadow p-base relative" @click="onClick">
<view class="flex items-center justify-between">
<view>{{ statusFun('system', 'messages', 'name') }}</view>
<view>{{ statusFun(item.type, 'messages', 'name') }}</view>
<view class="text-hex-999 text-24rpx">{{
timeFormat(item?.created_at, 'mm月dd日 hh:MM')
}}</view>
</view>
<view class="mt-14rpx text-hex-999 text-26rpx"> {{item?.content}} </view>
<!-- <view
v-if="item?.type != 'system'"
class="text-right text-hex-999 text-22rpx flex items-center justify-end"
>
<view>查看详情</view>
<uv-icon name="arrow-right" size="16rpx"></uv-icon>
</view> -->
<view class="mt-14rpx text-hex-999 text-26rpx"> {{ item?.content }} </view>
<view class="absolute right-10rpx top-10rpx" v-if="item.is_read == 0">
<uv-badge :isDot="true" type="error"></uv-badge>
</view>
</view>
</template>
<script setup>
@ -25,4 +21,13 @@ const props = defineProps({
default: () => {},
},
})
const onClick = () => {
props.item.is_read = 1
const { additional } = props.item
const { subject_id, subject_type } = additional.workflow_check
uni.navigateTo({
url: `/pages/audits/detail?id=${subject_id}&type=${subject_type}`,
})
}
</script>

View File

@ -0,0 +1,25 @@
<template>
<view>
<CuNavbar title="消息详情"></CuNavbar>
<view></view>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import { http } from '@/utils/request'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
const detail = ref({})
const id = ref(0)
onLoad((op) => {
id.value = op.id
getDetail()
})
const getDetail = () => {
http.get(`/message/messages/${id.value}`).then((res) => {
detail.value = res
})
}
</script>

View File

@ -1,6 +1,6 @@
<template>
<view>
<CuNavbar :isBack="false" title="数据上报"></CuNavbar>
<CuNavbar :isBack="isBack" title="数据上报"></CuNavbar>
<view
:class="[
@ -90,7 +90,7 @@
type="digit"
:border="`none`"
v-model="form.expenditure"
placeholder="请输入总账兑奖金额"
:placeholder="`请输入总账${store?.is_lottery_store ? '兑奖' : '支出'}金额`"
></uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
@ -147,7 +147,7 @@
</view>
<view class="h-130rpx">
<view
class="fixed bottom-0 left-0 right-0 h-120rpx bg-white flex-center box-border px-base"
class="fixed z-10 bottom-0 left-0 right-0 h-120rpx bg-white flex-center box-border px-base"
:style="style"
>
<view class="w-full">
@ -233,15 +233,15 @@ const rules = reactive({
},
sales: {
required: true,
message: '请输入销售额',
message: '请输入总账销售合计',
},
expenditure: {
required: true,
message: '请输入支出额',
message:`请输入总账${store.value?.is_lottery_store?'兑奖':'支出'}金额`,
},
new_customers: {
required: true,
message: '请输入新增客户数',
message: '请输入微信新增人数',
},
photos: {
type: 'array',
@ -294,7 +294,13 @@ const onSubmit = async () => {
})
.then((res) => {
uni.$emit('refresh')
uni.navigateBack()
uni.showToast({
title: '提交成功',
icon: 'none',
})
if (props.isBack) {
uni.navigateBack()
}
})
}
@ -328,7 +334,6 @@ const getTypeList = () => {
message: `请输入${item.name}兑奖金额`,
}
})
console.log(rules)
})
}
@ -399,7 +404,6 @@ const salesChange = async () => {
const sales = val.reduce((a, b) => {
return add(a, b?.sales ?? 0)
}, 0)
console.log(sales)
form.sales = sales || null
}

View File

@ -8,75 +8,75 @@
<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"
class="flex items-center w-full text-24rpx"
>
<view class="w-140rpx text-center flex-none"> 日期 </view>
<view class="w-140rpx text-center flex-none h-120rpx flex-center td"> 日期 </view>
<view
class="w-300rpx text-center leading-60rpx flex-none b-r-solid b-r-1px b-l-solid b-l-1px"
class="w-400rpx text-center leading-60rpx flex-none "
>
<view class="h-60rpx b-b-solid b-1px">总账</view>
<view class="h-60rpx td">总账</view>
<template v-if="checkPermission(['admin'])">
<view class="h-60rpx grid grid-cols-3">
<view>销售</view>
<view>支出</view>
<view>新增客户</view>
<view class="td">销售</view>
<view class="td">支出</view>
<view class="td">新增客户</view>
</view>
</template>
<template v-else-if="isLotteryStore">
<view class="h-60rpx grid grid-cols-2">
<view>销售</view>
<view>兑奖</view>
<view class="td">销售</view>
<view class="td">兑奖</view>
</view>
</template>
<template v-else>
<view class="h-60rpx grid grid-cols-2">
<view>销售</view>
<view>支出</view>
<view class="td">销售</view>
<view class="td">支出</view>
</view>
</template>
</view>
<view
class="text-center leading-60rpx w-140rpx flex-none"
class="text-center leading-60rpx w-200rpx flex-none"
v-for="(ty, j) in item.lottery_types"
:key="j"
>
<view class="b-b-solid b-1px">{{ ty.name }}</view>
<view class="td">{{ ty.name }}</view>
<view class="grid grid-cols-2">
<view>{{ ty.sales }}</view>
<view>{{ ty.expenditure }}</view>
<view class="td">销售</view>
<view class="td">兑奖</view>
</view>
</view>
</view>
<view
class="flex justify-between text-center text-24rpx items-center card-shadow bg-white rounded-19rpx h-80rpx"
class="flex justify-between text-center text-24rpx items-center card-shadow bg-white rounded-19rpx"
>
<view class="flex-1 w-140rpx flex-none">{{
<view class="flex-1 w-140rpx flex-none td flex-center h-60rpx">{{
timeFormat(item.date, 'mm-dd')
}}</view>
<!-- 总账 -->
<view class="w-300rpx flex flex-none">
<view class="w-400rpx flex flex-none">
<template v-if="checkPermission(['admin'])">
<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>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.sales }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.expenditure }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.new_customers }}</view>
</template>
<template v-else-if="isLotteryStore">
<view class="flex-1">{{ item.ledger.sales }}</view>
<view class="flex-1">{{ item.ledger.expenditure }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.sales }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.expenditure }}</view>
</template>
<template v-else>
<view class="flex-1">{{ item.ledger.sales }}</view>
<view class="flex-1">{{ item.ledger.expenditure }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.sales }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ item.ledger.expenditure }}</view>
</template>
</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>
<view class="flex-1 td h-60rpx flex-center">{{ ty.sales }}</view>
<view class="flex-1 td h-60rpx flex-center">{{ ty.expenditure }}</view>
</template>
</view>
</template>
@ -102,3 +102,11 @@ const props = defineProps({
},
})
</script>
<style lang="scss" scoped>
.tr {
border: 0.5px solid #f5f5f5;
}
.td{
border: 0.5px solid #f5f5f5;
}
</style>

View File

@ -18,35 +18,33 @@
>{{ currentC.start }} {{ currentC.end }}
</view>
<view class="text-center text-28rpx" v-else>{{ currentC.start }}</view>
<view class="flex my-20rpx items-center">
<view class="text-center flex-1">
<view v-if="!isLotteryStore">
<view>兑奖金额</view>
</view>
<view v-else></view>
<view class="font-600">{{ ledger.sales }}</view>
<view class="flex my-20rpx items-center table">
<view class="text-center flex-1 tr">
<view class="flex-center h-80rpx">销售金额</view>
<view class="font-600 flex-center h-80rpx">{{ ledger.sales }}</view>
</view>
<view class="h-60rpx">
<uv-line direction="col"></uv-line>
</view>
<view class="text-center flex-1">
<view v-if="!isLotteryStore || checkPermission(['admin'])">
<view class="text-center flex-1 tr">
<view class="flex-center h-80rpx" v-if="!isLotteryStore || checkPermission(['admin'])">
<view>支出金额</view>
</view>
<view v-else></view>
<view class="font-600">{{ ledger.sales }}</view>
<view class="flex-center h-80rpx" v-else></view>
<view class="font-600 flex-center h-80rpx">{{ ledger.expenditure }}</view>
</view>
<view class="h-60rpx">
<uv-line direction="col"></uv-line>
</view>
<view class="text-center flex-1">
<view>销售涨幅</view>
<view class="font-600"
:class="[ ledger.sales_growth_rate < 0 ? 'text-primary' : 'text-green' ]"
<view class="text-center flex-1 tr">
<view class="flex-center h-80rpx">销售涨幅</view>
<view
class="font-600 flex-center h-80rpx"
:class="[
ledger.sales_growth_rate < 0 ? 'text-primary' : 'text-green',
]"
>{{ ledger.sales_growth_rate }}%</view
>
</view>
</view>
<uv-tabs
@change="tabChange1"
:lineColor="'#ee2c37'"
@ -272,3 +270,12 @@ const getList = async () => {
list.value = resData
}
</script>
<style lang="scss">
.table {
display: flex;
// border: 1px solid;
}
.tr {
border: 0.5px solid #f5f5f5;
}
</style>

View File

@ -1,27 +1,28 @@
<template>
<uv-popup ref="popup" round="19rpx" mode="bottom">
<view class="py-30rpx">
<view
class="px-base"
@click="handleClick(item)"
v-for="(item, i) in list"
:key="i"
>
<view class="flex items-center">
<view class="py-10rpx flex-1">
<view class="text-28rpx"> {{ item.title }}</view>
<view class="text-hex-999 text-24rpx mt-10rpx">{{
item.address
}}</view>
</view>
<view>
<uv-icon v-if="id == item.id" name="checkbox-mark"></uv-icon>
<scroll-view class="py-30rpx" scroll-y style="max-height: 60vh">
<view class="py-30rpx">
<view
class="px-base"
@click="handleClick(item)"
v-for="(item, i) in list"
:key="i"
>
<view class="flex items-center">
<view class="py-10rpx flex-1">
<view class="text-28rpx"> {{ item.title }}</view>
<view class="text-hex-999 text-24rpx mt-10rpx">{{
item.address
}}</view>
</view>
<view>
<uv-icon size="40rpx" color="primary" v-if="id == item.id" name="checkbox-mark"></uv-icon>
</view>
</view>
<uv-line></uv-line>
</view>
<uv-line></uv-line>
</view>
</view>
<view class="h-100rpx"></view>
</scroll-view>
</uv-popup>
</template>
<script setup>

View File

@ -49,10 +49,11 @@
</view>
</template>
<script setup>
import { ref, reactive } from 'vue'
import { ref, reactive, computed } from 'vue'
import CuNavbar from '@/components/cu-navbar/index'
import { http } from '@/utils/request'
import { onLoad, onShow } from '@dcloudio/uni-app'
import checkPermission from '@/utils/permission'
const modalRef = ref(null)
const modalOptin = reactive({
title: '提示',
@ -62,20 +63,27 @@ const modalOptin = reactive({
const actionSheet = ref(null)
const id = ref(null)
const detail = ref({})
const actionlist = ref([
{
name: '编辑',
value: 'edit',
},
{
name: '离职',
value: 'quit',
},
{
name: '删除',
value: 'delete',
},
])
const actionlist = computed(() => {
return [
{
name: '编辑',
value: 'edit',
},
{
name: '离职',
value: 'quit',
},
{
name: '设置门店',
value: 'store',
rule: ['admin'],
},
{
name: '删除',
value: 'delete',
},
].filter((e) => (e.rule ? checkPermission(e.rule) : true))
})
onLoad((options) => {
id.value = options.id
})
@ -107,6 +115,10 @@ const select = (e) => {
modalOptin.content = '是否确认删除该员工?'
modalOptin.confirm = onDelete
modalRef.value.open()
}else if(value === 'store'){
uni.navigateTo({
url: `/pages/user/update?id=${id.value}&type=store`,
})
}
}
const onDelete = () => {

View File

@ -10,7 +10,7 @@
errorType="toast"
labelWidth="150rpx"
>
<template v-if="isEdit">
<template v-if="type == 'store' && checkPermission(['admin'])">
<uv-form-item label="门店" prop="" @click="showStoreSelect">
<uv-input
disabled
@ -26,51 +26,53 @@
</template>
</uv-form-item>
</template>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="姓名" prop="name">
<uv-input
placeholder="请输入姓名"
inputAlign="right"
:border="`none`"
v-model="form.name"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="手机号" prop="phone">
<uv-input
placeholder="请输入手机号"
inputAlign="right"
:border="`none`"
type="number"
maxlength="11"
v-model="form.phone"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<template v-if="!isEdit">
<uv-form-item required label="登录用户名" prop="username">
<template v-if="type == 'info'">
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="姓名" prop="name">
<uv-input
placeholder="请输入登录用户名"
placeholder="请输入姓名"
inputAlign="right"
v-model="form.username"
:border="`none`"
v-model="form.name"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="手机号" prop="phone">
<uv-input
placeholder="请输入手机号"
inputAlign="right"
:border="`none`"
type="number"
maxlength="11"
v-model="form.phone"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<template v-if="!isEdit">
<uv-form-item required label="登录用户名" prop="username">
<uv-input
placeholder="请输入登录用户名"
inputAlign="right"
v-model="form.username"
:border="`none`"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
</template>
<uv-form-item :required="!isEdit" label="登录密码" prop="password">
<uv-input
placeholder="请输入登录密码"
inputAlign="right"
type="password"
v-model="form.password"
:border="`none`"
>
</uv-input>
</uv-form-item>
</template>
<uv-form-item :required="!isEdit" label="登录密码" prop="password">
<uv-input
placeholder="请输入登录密码"
inputAlign="right"
type="password"
v-model="form.password"
:border="`none`"
>
</uv-input>
</uv-form-item>
</uv-form>
</view>
<view class="mt-100rpx">
@ -99,11 +101,13 @@ import { onLoad } from '@dcloudio/uni-app'
import { mobile } from '@climblee/uv-ui/libs/function/test'
import { http } from '@/utils/request'
import StorePopup from '@/pages/user/components/store-popup.vue'
import checkPermission from '@/utils/permission'
const storeRef = ref(null)
const formRef = ref(null)
const modalRef = ref(null)
const id = ref(0)
const loading = ref(false)
const type = ref('info')
const form = reactive({
name: '',
phone: '',
@ -140,6 +144,7 @@ const rules = computed(() => {
})
onLoad((options) => {
id.value = options.id
type.value = options.type || 'info'
if (isEdit.value) getDetail()
})
const isEdit = computed(() => !!id.value)

View File

@ -22,7 +22,7 @@ export const useUserStore = defineStore({
return new Promise((resolve, reject) => {
http.post('/auth/login', data).then(async (res) => {
this.token = res.token;
this.fetchUserInfo();
await this.fetchUserInfo();
resolve(res);
}).catch(err => {
reject(err);

View File

@ -89,7 +89,7 @@ MeScroll.prototype.extendUpScroll = function(optUp) {
callback: null, // 上拉加载的回调;function(page,mescroll){ }
page: {
num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
size: 10, // 每页数据的数量
size: 20, // 每页数据的数量
time: null // 加载第一页数据服务器返回的时间; 防止用户翻页时,后台新增了数据从而导致下一页数据重复;
},
noMoreSize: 5, // 如果列表已无数据,可设置列表的总数量要大于等于5条才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看