修改bug

main
ihzero 2024-04-27 08:59:54 +08:00
parent 5057e9579c
commit 6c1b67d865
16 changed files with 384 additions and 118 deletions

View File

@ -3,13 +3,9 @@ import { useUserStoreWithOut } from '@/store/modules/user'
export default {
onLaunch: function () {
const userStore = useUserStoreWithOut()
// if (userStore.isLogin) {
// userStore.fetchUserInfo()
// } else {
// uni.navigateTo({
// url: '/pages/login/index',
// })
// }
if (userStore.isLogin) {
userStore.fetchUserInfo()
}
// #ifdef APP-PLUS
if (userStore.isLogin) {
plus.navigator.closeSplashscreen()

View File

@ -172,6 +172,12 @@
"navigationBarTitleText": "报销管理"
}
},
{
"path": "detail",
"style": {
"navigationBarTitleText": "报销详情"
}
},
{
"path": "submit",
"style": {

View File

@ -1,42 +1,47 @@
<template>
<uv-form labelWidth="160rpx">
<template v-for="(item, i) in columsList" :key="i">
<uv-form-item
v-if="item.type == 'album'"
:label="item.title"
labelPosition="top"
>
<!-- {{ item.value }} -->
<view class="mt-20rpx w-full">
<uv-album
multipleSize="190rpx"
singleSize="190rpx"
:urls="item.value"
:rowCount="3"
space="18rpx"
:showMore="false"
></uv-album>
</view>
</uv-form-item>
<uv-form-item
v-else
:label="item.title"
:labelPosition="item.labelPosition"
>
<view
class="w-full text-hex-999"
:style="[addStyle(item.customStyle)]"
:class="[
[item.labelPosition == 'top' ? 'text-left mt-10rpx' : 'text-right'],
]"
>{{ item.value }}</view
<template v-if="item.show">
<uv-form-item
v-if="item.type == 'album'"
:label="item.title"
labelPosition="top"
>
</uv-form-item>
<uv-line
v-if="i < columsList.length - 1 && (item?.bottomBorder || true)"
color="#f5f5f5"
></uv-line>
<!-- {{ item.value }} -->
<view class="mt-20rpx w-full">
<uv-album
multipleSize="190rpx"
singleSize="190rpx"
:urls="item.value"
:rowCount="3"
space="18rpx"
:showMore="false"
></uv-album>
</view>
</uv-form-item>
<uv-form-item
v-else
:label="item.title"
:labelPosition="item.labelPosition"
>
<view
class="w-full text-hex-999"
:style="[addStyle(item.customStyle)]"
:class="[
[
item.labelPosition == 'top'
? 'text-left mt-10rpx'
: 'text-right',
],
]"
>{{ item.value }}</view
>
</uv-form-item>
<uv-line
v-if="i < columsList.length - 1 && (item?.bottomBorder || true)"
color="#f5f5f5"
></uv-line>
</template>
</template>
</uv-form>
</template>
@ -58,14 +63,19 @@ const props = defineProps({
const columsList = computed(() => {
const arr = []
props.colums.forEach((e) => {
const { dataIndex, format } = e
const { dataIndex, format, isShow } = e
let str = getValue(props.data, dataIndex)
let show = true
if (isFunction(format)) {
str = format(str)
}
if (isFunction(isShow)) {
show = isShow(props.data)
}
arr.push({
...e,
value: str,
show: show,
})
})
return arr

View File

@ -2,15 +2,15 @@ import { timeFormat } from '@climblee/uv-ui/libs/function'
export default {
//清洁任务
task_hygienes: [
{
title: '申请人',
dataIndex: 'name',
},
// {
// title: '申请人',
// dataIndex: 'name',
// },
{
title: '所属门店',
dataIndex: 'taskable.store.address',
borderBottom: false,
labelPosition: 'top'
dataIndex: 'taskable.store.title',
// borderBottom: false,
// labelPosition: 'top'
},
{
title: '电话号码',

View File

@ -1,12 +1,42 @@
<template>
<view>
<view class="p-base">
<CuNavbar title="审核流程"></CuNavbar>
<view class="list">
<view class="item flex" v-for="item in list" :key="item.id">
<view class="name">{{ item.check_name }}</view>
<view v-if="item.check_status != 1" class="status bg-red">{{ item.check_status_text }}</view>
<view v-if="item.checked_at" class="time text-gray">{{ item.checked_at }}</view>
</view>
<view class="card-shadow bg-white p-base">
<uv-steps direction="column">
<uv-steps-item
v-for="item in list"
:key="item.id"
:title="item.check_status_text"
:desc="timeFormat(item.checked_at, 'yyyy-mm-dd hh:MM:ss')"
>
<template #icon>
<view class="w-31rpx h-31rpx rounded-full mt-4rpx"
:class="[item.check_status==2 || item.check_status==3 ? 'bg-blue' : 'bg-gray-300']"
></view>
</template>
<template #title>
<view class="space-y-6rpx">
<view class="flex items-center space-x-14rpx">
<view> {{ item.check_name }}</view>
</view>
<view
v-if="item.checked_at"
class="text-24rpx"
:style="{
color: statusFun(item.check_status, 'statusExpense', 'color'),
}"
>{{ item.check_status_text }}</view
>
</view>
</template>
<template #desc>
<view v-if="item.checked_at" class="text-22rpx text-hex-999">
{{ timeFormat(item.checked_at, 'yyyy-mm-dd hh:MM:ss') }}
</view>
</template>
</uv-steps-item>
</uv-steps>
</view>
</view>
</template>
@ -14,13 +44,18 @@
import CuNavbar from '@/components/cu-navbar/index'
import { http } from '@/utils/request'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { computed, ref } from 'vue'
import { timeFormat } from '@climblee/uv-ui/libs/function'
import statusFun from '@/utils/status'
const list = ref([])
// const currentStop = computed(()=>list.value.filter(e=>e.check_status>=3))
onLoad((options) => {
http.get(`/workflow/${options.id}/logs`, { params: { subject_type: options.type } }).then(res => {
list.value = res
})
http
.get(`/workflow/${options.id}/logs`, {
params: { subject_type: options.type },
})
.then((res) => {
list.value = res
})
})
</script>

View File

@ -0,0 +1,95 @@
<template>
<view>
<CuNavbar title="报销详情">
<template #right>
<uv-icon
v-if="data?.workflow_check?.check_status == 4"
color="white"
@click="open"
name="more-dot-fill"
></uv-icon>
</template>
</CuNavbar>
<view class="px-base mt-30rpx">
<view class="card-shadow bg-white rounded-19rpx px-base">
<BaseData :colums="colums" :data="data"></BaseData>
</view>
</view>
<uv-action-sheet
ref="actionSheet"
:actions="actionlist"
@select="select"
cancelText="取消"
>
</uv-action-sheet>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index.vue'
import BaseData from '@/pages/audits/base-data.vue'
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/request'
const actionlist = ref([
{
name: '删除',
value: 'delete',
},
])
const colums = [
{
title: '审核状态',
dataIndex: 'workflow_check.check_status_text',
},
{
title: '未通过理由',
dataIndex: 'workflow_check.check_remarks',
isShow: (item) => {
return item?.workflow_check?.check_status == 4
},
},
{
title: '报销分类',
dataIndex: 'type.name',
},
{
title: '报销金额',
dataIndex: 'expense',
},
{
title: '报销原因',
dataIndex: 'reason',
labelPosition: 'top',
},
{
title: '报销凭证',
dataIndex: 'photos',
type: 'album',
},
]
const actionSheet = ref(null)
const data = ref(null)
const id = ref(null)
const open = () => {
actionSheet.value.open()
}
const select = (e) => {
console.log(e)
}
onLoad((option) => {
id.value = option.id
getDetail()
})
const getDetail = () => {
http.get(`/reimbursements/${id.value}`).then((res) => {
data.value = res
})
}
</script>

View File

@ -19,7 +19,7 @@
@change="tabChange"
></uv-tabs>
</uv-sticky>
<view class="px-base space-y-20rpx mt-30rpx">
<view class="">
<MescrollItem
ref="mescrollItem0"
:top="88"
@ -28,7 +28,11 @@
:apiUrl="tabList[0].apiUrl"
>
<template v-slot="{ list }">
<Item v-for="item in list" :key="item.id" :item="item" @click="detail" />
<view class="space-y-15rpx p-base">
<view v-for="item in list" :key="item.id">
<Item :item="item" />
</view>
</view>
</template>
</MescrollItem>
<MescrollItem
@ -40,7 +44,14 @@
:params="tabList[1].params"
>
<template v-slot="{ list }">
<Item v-for="item in list" :key="item.id" :item="item" @click="checkDetail" />
<view class="space-y-15rpx p-base">
<view v-for="item in list" :key="item.id">
<Item
:item="item"
:type="tabList[1].params.subject_type"
status="statusExpense"
/> </view
></view>
</template>
</MescrollItem>
</view>
@ -48,13 +59,9 @@
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import { http } from '@/utils/request'
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import { timeFormat } from '@climblee/uv-ui/libs/function'
import statusFun from '@/utils/status'
import MescrollItem from '@/components/mescroll-api/more.vue'
import Item from './item.vue'
@ -76,7 +83,7 @@ const tabList = ref([
{
name: '报销审核',
apiUrl: '/workflow',
params: { subject_type: 'reimbursements', include: 'employee,type' }
params: { subject_type: 'reimbursements' },
},
])
@ -90,13 +97,4 @@ const goPath = (url) => {
url,
})
}
//
const detail = (item) => {
console.log(item.id)
}
//
const checkDetail = (item) => {
console.log(item.id)
}
</script>

View File

@ -1,16 +1,23 @@
<template>
<view class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click="detail(item)">
<view
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
@click="detail(item)"
>
<view class="flex items-center justify-between">
<view class="text-30rpx"> {{ item.type?.name }} </view>
<view :style="[
{
color: statusFun(
item.workflow_check?.check_status,
'statusExpense',
'color'
),
},
]" class="text-24rpx">{{ item.workflow_check?.check_status_text }}</view>
<view
:style="[
{
color: statusFun(
item.workflow_check?.check_status,
status || 'statusExpense',
'color'
),
},
]"
class="text-24rpx"
>{{ item.workflow_check?.check_status_text }}</view
>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">报销金额</view>
@ -35,9 +42,20 @@ const emits = defineEmits(['click'])
const props = defineProps({
item: Object,
type: String,
status: String,
})
const detail = (item) => {
emits('click', item)
let url
if (props.type) {
url = `/pages/audits/detail?id=${props.item.id}&type=${props.type}`
} else {
url = `/pages/expense-account/detail?id=${props.item.id}`
}
uni.navigateTo({
url: url,
})
}
</script>
</script>

View File

@ -57,6 +57,7 @@
placeholder="请选择日期"
ref="datetimePicker"
mode="datetime"
:maxDate="new Date().getTime()"
@confirm="confirmDatePicker"
>
</uv-datetime-picker>
@ -69,7 +70,7 @@ import { ref, reactive, computed } from "vue"
import { onLoad } from "@dcloudio/uni-app"
import { http } from "@/utils/request"
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
const columns = [["上班补卡", "班补卡"]]
const columns = [["上班补卡", "班补卡"]]
const formRef = ref(null)
const datetimePicker = ref(null)
const pickerRef = ref(null)
@ -154,6 +155,7 @@ const onSubmit = async () => {
title: "提交成功",
icon: "none"
})
uni.$emit("make-card:update")
formRef.value.resetFields()
uni.navigateBack()
} catch (error) {

View File

@ -54,7 +54,7 @@
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import { ref } from 'vue'
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
import { onPageScroll, onReachBottom, onShow,onLoad } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import MescrollItem from '@/components/mescroll-api/more.vue'
import Item from './components/item.vue'
@ -80,6 +80,14 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
onPageScroll,
onReachBottom
)
onLoad(()=>{
uni.$on('make-card:update',()=>{
getMescroll(0).resetUpScroll()
})
})
const goPath = (url) => {
uni.navigateTo({
url,

View File

@ -45,6 +45,7 @@ const opList = [
icon: 'folder',
title: '提成数据',
url: '/pages/data/brokerage/index',
rouls: ['store'],
},
],
},
@ -55,7 +56,7 @@ const opList = [
icon: 'photo-fill',
title: '员工管理',
url: '/pages/user/index',
rouls: ['admin'],
rouls: ['store', 'admin', 'store_user'],
},
{
icon: 'lock',

View File

@ -0,0 +1,59 @@
<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>
</view>
</view>
<uv-line></uv-line>
</view>
</view>
<view class="h-100rpx"></view>
</uv-popup>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { http } from '@/utils/request'
const props = defineProps({
id: [Number, String],
})
const popup = ref(null)
const list = ref([])
onMounted(() => {
getStore()
})
const emit = defineEmits(['change'])
const handleClick = (e) => {
emit('change', e)
}
const getStore = () => {
http.get('/auth/stores').then((res) => {
list.value = res
})
}
const open = () => {
popup.value.open()
}
const close = () => {
popup.value.close()
}
defineExpose({ open, close })
</script>

View File

@ -25,7 +25,7 @@
<uv-line color="#f5f5f5"></uv-line>
<view class="flex justify-between items-center min-h-88rpx">
<view class="text-hex-999">门店</view>
<view class="" v-if="detail.store">{{ detail.store.address }}</view>
<view class="" v-if="detail.store">{{ detail.store.title }}</view>
<view class="" v-else></view>
</view>
<uv-line color="#f5f5f5"></uv-line>

View File

@ -1,10 +1,6 @@
<template>
<view class="p-base">
<CuNavbar :title="title">
<!-- <template #right>
<view class="text-white">保存</view>
</template> -->
</CuNavbar>
<CuNavbar :title="title"></CuNavbar>
<view class="card-shadow px-base">
<uv-form
labelPosition="left"
@ -14,6 +10,23 @@
errorType="toast"
labelWidth="150rpx"
>
<template v-if="isEdit">
<uv-form-item label="门店" prop="" @click="showStoreSelect">
<uv-input
disabled
disabledColor="#ffffff"
placeholder="请选择门店"
inputAlign="right"
:border="`none`"
v-model="form.store"
>
</uv-input>
<template v-slot:right>
<uv-icon name="arrow-right"></uv-icon>
</template>
</uv-form-item>
</template>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="姓名" prop="name">
<uv-input
placeholder="请输入姓名"
@ -36,16 +49,18 @@
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<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 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="请输入登录密码"
@ -56,9 +71,6 @@
>
</uv-input>
</uv-form-item>
<uv-form-item :required="!isEdit" label="门店" prop="password">
</uv-form-item>
</uv-form>
</view>
<view class="mt-100rpx">
@ -72,6 +84,12 @@
@confirm="onSubmit"
:showCancelButton="true"
></uv-modal>
<StorePopup
:id="form.store_id"
ref="storeRef"
@change="storeChange"
></StorePopup>
</view>
</template>
<script setup>
@ -80,6 +98,8 @@ import { ref, reactive, computed } from 'vue'
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'
const storeRef = ref(null)
const formRef = ref(null)
const modalRef = ref(null)
const id = ref(0)
@ -90,6 +110,8 @@ const form = reactive({
username: '',
password: '',
confirm_password: '',
store_id: '',
store: '',
})
const rules = computed(() => {
return {
@ -118,17 +140,28 @@ const rules = computed(() => {
})
onLoad((options) => {
id.value = options.id
if(isEdit.value) getDetail()
if (isEdit.value) getDetail()
})
const isEdit = computed(() => !!id.value)
const title = computed(() => (isEdit.value ? '员工修改' : '员工添加'))
const storeChange = (data) => {
form.store_id = data.id
form.store = data.title
storeRef.value.close()
}
const submit = () => {
formRef.value.validate().then((res) => {
modalRef.value.open()
})
}
const showStoreSelect = () => {
// uni.$emit('showStoreSelect')
storeRef.value.open()
}
const onSubmit = () => {
if (isEdit.value) {
updateUser()
@ -186,7 +219,7 @@ const getDetail = () => {
phone: res.phone,
username: res.username,
}
Object.assign(form, info)
Object.assign(form, info, { store: res.store?.title })
})
}
</script>

View File

@ -77,7 +77,7 @@ const tabList = ref([
},
{
name: '推荐列表',
apiUrl: '/hr/promotion/apply',
apiUrl: '/hr/promotion/invite',
},
{
name: '审核列表',
@ -99,7 +99,9 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
)
onLoad(() => {
uni.$on('work:submit', getMescroll(tabIndex.value))
uni.$on('work:submit', ()=>{
getMescroll(tabIndex.value).resetUpScroll()
})
})
const goPath = (url) => {

View File

@ -139,6 +139,9 @@ const data = {
value: 4,
name: '未完成',
color: '#999999'
}],
job_text:[{
}]
}
export default function (value, status, key) {