Compare commits

..

No commits in common. "9e0fbd41d41b382286dc86bc4a7c22fac6604558" and "c2b770628a45b844523304ea36e220ee89c6a89b" have entirely different histories.

10 changed files with 214 additions and 170 deletions

View File

@ -17,80 +17,67 @@ export default {
}, },
{ {
title: '所属门店', title: '所属门店',
dataIndex: 'check.subject.store.title', dataIndex: 'taskable.store.title',
// borderBottom: false, // borderBottom: false,
// labelPosition: 'top' // labelPosition: 'top'
}, },
{ {
title: '电话号码', title: '电话号码',
dataIndex: 'check.subject.store_master.phone', dataIndex: '',
}, },
{ {
title: '申请时间', title: '申请时间',
dataIndex: 'check.subject.created_at', dataIndex: 'created_at',
format: timeFormat, format: timeFormat,
}, },
{ {
title: '清洁范围', title: '清洁范围',
dataIndex: 'check.subject.description', dataIndex: 'taskable.description',
labelPosition: 'top', labelPosition: 'top',
}, },
{ {
title: '清洁结果', title: '清洁结果',
dataIndex: 'check.subject.photos', dataIndex: 'taskable.photos',
type: 'album', type: 'album',
}, },
], ],
params: { include: 'check.subject.task,check.subject.storeMaster,check.subject.store' }
}, },
//报销 //报销
reimbursements: { reimbursements: {
params: { params: {
include: 'check.subject.type,check.subject.employee,check.subject.store', include: 'employee,store,type',
}, },
data: [ data: [
{ {
title: "申请人", title: '审核状态',
dataIndex: "check.subject.employee.name" dataIndex: 'workflow_check.check_status_text',
}, },
{ {
title: "所属门店", title: '未通过理由',
dataIndex: "check.subject.store.title" dataIndex: 'workflow_check.check_remarks',
}, labelPosition: 'top',
{ isShow: (item) => {
title: "电话号码", return item?.workflow_check?.check_status == 4
dataIndex: "check.subject.employee.phone" },
},
{
title: "申请时间",
dataIndex: "check.subject.created_at_format"
}, },
{ {
title: '报销分类', title: '报销分类',
dataIndex: 'check.subject.type.name', dataIndex: 'type.name',
}, },
{ {
title: '报销金额', title: '报销金额',
dataIndex: 'check.subject.expense', dataIndex: 'expense',
}, },
{ {
title: '报销原因', title: '报销原因',
dataIndex: 'check.subject.reason', dataIndex: 'reason',
labelPosition: 'top', labelPosition: 'top',
}, },
{ {
title: '报销凭证', title: '报销凭证',
dataIndex: 'check.subject.photos', dataIndex: 'photos',
type: 'album', type: 'album',
}, },
{
title: '未通过原因',
dataIndex: 'remarks',
labelPosition: 'top',
isShow: (item) => {
return item?.check_status == 4
},
},
] ]
}, },
//升职 //升职

View File

@ -2,7 +2,11 @@
<view> <view>
<CuNavbar title="审核详情"> <CuNavbar title="审核详情">
<template #right> <template #right>
<view class="text-sm text-white" @click="goPath(`/pages/audits/log?id=${data.check_id}`)"></view> <view
class="text-sm text-white"
@click="goPath(`/pages/audits/log?id=${id}&type=${type}`)"
>审核流程</view
>
</template> </template>
</CuNavbar> </CuNavbar>
<view class="px-base mt-30rpx"> <view class="px-base mt-30rpx">
@ -70,11 +74,20 @@ const modelOptions = reactive({
const onConfirm = async () => { const onConfirm = async () => {
try { try {
await http.post(`/workflow/${id.value}/check`, { await http.post(
status: !modelOptions.isValue, `/workflow/${id.value}/check`,
remarks: modelOptions.isValue ? value.value : '', {
}) subject_type: type.value,
// uni.$emit('audits:onRefresh') status: !modelOptions.isValue,
remarks: modelOptions.isValue ? value.value : '',
},
{
header: {
Accept: 'application/json',
},
}
)
uni.$emit('audits:onRefresh')
uni.navigateBack() uni.navigateBack()
} catch (error) {} } catch (error) {}
} }

View File

@ -25,6 +25,7 @@
<view> {{ item.check_user ? item.check_user.name : item.check_name }}</view> <view> {{ item.check_user ? item.check_user.name : item.check_name }}</view>
</view> </view>
<view <view
v-if="item.checked_at"
class="text-24rpx" class="text-24rpx"
:style="{ :style="{
color: statusFun(item.check_status, 'statusExpense', 'color'), color: statusFun(item.check_status, 'statusExpense', 'color'),
@ -57,7 +58,9 @@ const list = ref([])
// const currentStop = computed(()=>list.value.filter(e=>e.check_status>=3)) // const currentStop = computed(()=>list.value.filter(e=>e.check_status>=3))
onLoad((options) => { onLoad((options) => {
http http
.get(`/workflow/${options.id}/logs`) .get(`/workflow/${options.id}/logs`, {
params: { subject_type: options.type },
})
.then((res) => { .then((res) => {
list.value = res list.value = res
}) })

View File

@ -41,24 +41,15 @@ const actionlist = ref([
const colums = [ const colums = [
{ {
title: "审核状态", title: '审核状态',
dataIndex: "workflow_check.check_status_text", dataIndex: 'workflow_check.check_status_text',
}, },
{ {
title: "申请人", title: '未通过理由',
dataIndex: "employee.name" dataIndex: 'workflow_check.check_remarks',
}, isShow: (item) => {
{ return item?.workflow_check?.check_status == 4
title: "所属门店", },
dataIndex: "store.title"
},
{
title: "电话号码",
dataIndex: "employee.phone"
},
{
title: "申请时间",
dataIndex: "created_at_format"
}, },
{ {
title: '报销分类', title: '报销分类',
@ -78,14 +69,6 @@ const colums = [
dataIndex: 'photos', dataIndex: 'photos',
type: 'album', type: 'album',
}, },
{
title: '未通过原因',
dataIndex: 'remarks',
labelPosition: 'top',
isShow: (item) => {
return item?.check_status == 4
},
},
] ]
const actionSheet = ref(null) const actionSheet = ref(null)
const data = ref(null) const data = ref(null)

View File

@ -2,7 +2,11 @@
<view> <view>
<CuNavbar title="报销管理"> <CuNavbar title="报销管理">
<template #right> <template #right>
<view @click="goPath('/pages/expense-account/submit')" class="text-24rpx text-white">申请</view> <view
@click="goPath('/pages/expense-account/submit')"
class="text-24rpx text-white"
>申请</view
>
</template> </template>
</CuNavbar> </CuNavbar>
<uv-sticky bgColor="#fff"> <uv-sticky bgColor="#fff">
@ -25,25 +29,8 @@
> >
<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 in list" :key="item.id" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click="applyDetail(item)"> <view v-for="item in list" :key="item.id">
<view class="flex items-center justify-between"> <Item :item="item" />
<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>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">报销金额</view>
<view class="text-primary">{{ item.expense }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">报销时间</view>
<view class="text-hex-333">{{ timeFormat(item.created_at) }}</view>
</view>
<view class="text-24rpx text-hex-999999">
<view class="">
<text class="w-140rpx inline-block">报销原因:</text>
<text class="text-hex-333 leading-27rpx">{{ item.reason }}</text>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>
@ -58,27 +45,13 @@
> >
<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 in list" :key="item.id" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click="checkDetail(item)"> <view v-for="item in list" :key="item.id">
<view class="flex items-center justify-between"> <Item
<view class="text-30rpx"> {{ item.check.subject.type.name }} </view> :item="item"
<view :style="{color: statusFun(item.check_status,'statusExpense','color'),}" class="text-24rpx">{{ item.check_status_text }}</view> :type="tabList[1].params.subject_type"
</view> status="statusExpense"
<view class="text-24rpx text-hex-999999 flex"> /> </view
<view class="w-140rpx">报销金额</view> ></view>
<view class="text-primary">{{ item.check.subject.expense }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">报销时间</view>
<view class="text-hex-333">{{ timeFormat(item.check.subject.created_at) }}</view>
</view>
<view class="text-24rpx text-hex-999999">
<view class="">
<text class="w-140rpx inline-block">报销原因:</text>
<text class="text-hex-333 leading-27rpx">{{ item.check.subject.reason }}</text>
</view>
</view>
</view>
</view>
</template> </template>
</MescrollItem> </MescrollItem>
</view> </view>
@ -90,8 +63,7 @@ import { ref } from 'vue'
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app' import { onPageScroll, onReachBottom } 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 { timeFormat } from '@climblee/uv-ui/libs/function' import Item from './item.vue'
import statusFun from '@/utils/status'
const mescrollItem0 = ref(null) const mescrollItem0 = ref(null)
const mescrollItem1 = ref(null) const mescrollItem1 = ref(null)
@ -111,7 +83,7 @@ const tabList = ref([
{ {
name: '报销审核', name: '报销审核',
apiUrl: '/workflow', apiUrl: '/workflow',
params: { subject_type: 'reimbursements', include: 'check.subject.type' }, params: { subject_type: 'reimbursements', include: 'employee,store,type' },
}, },
]) ])
@ -125,16 +97,4 @@ const goPath = (url) => {
url, url,
}) })
} }
const applyDetail = (item) => {
uni.navigateTo({
url: `/pages/expense-account/detail?id=${item.id}`
})
}
const checkDetail = (item) => {
uni.navigateTo({
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`
})
}
</script> </script>

View File

@ -0,0 +1,61 @@
<template>
<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,
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>
<view class="text-primary">{{ item.expense }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">报销时间</view>
<view class="text-hex-333">{{ timeFormat(item.created_at) }}</view>
</view>
<view class="text-24rpx text-hex-999999">
<view class="">
<text class="w-140rpx inline-block">报销原因:</text>
<text class="text-hex-333 leading-27rpx">{{ item.reason }}</text>
</view>
</view>
</view>
</template>
<script setup>
import { timeFormat } from '@climblee/uv-ui/libs/function'
import statusFun from '@/utils/status'
const emits = defineEmits(['click'])
const props = defineProps({
item: Object,
type: String,
status: String,
})
const detail = (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>

View File

@ -0,0 +1,70 @@
<template>
<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="text-30rpx">{{ item.name }}</view>
<view
:style="{
color: statusFun(
item.taskable.status,
isCheck ? 'task_hygienes' : item.taskable_type,
'color'
),
}"
class="text-24rpx"
>{{
statusFun(
item.taskable.status,
isCheck ? 'task_hygienes' : item.taskable_type,
'name'
)
}}</view
>
</view>
<view class="text-24rpx text-hex-999999">
任务时间{{ timeFormat(item.start_at, 'yyyy年mm月dd日') }} -
{{ timeFormat(item.end_at, 'yyyy年mm月dd日') }}
</view>
</view>
</template>
<script setup>
import { computed } from 'vue'
import statusFun from '@/utils/status'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
const props = defineProps({
item: Object,
isCheck: Boolean,
type: String,
})
const onClick = () => {
const type = props.item.taskable_type
const { status } = props.item.taskable
let url
if (props.isCheck) {
url = `/pages/audits/detail?id=${props.item.id}&type=${type}`
} else {
if (type === 'task_hygienes') {
if (status === 2 || status == 4) {
url = `/pages/task/task_hygienes_submit?id=${props.item.id}`
} else {
url = `/pages/task/detail?id=${props.item.id}`
}
} else if (type === 'task_ledgers') {
url = `/pages/task/${type}_submit?id=${props.item.id}`
}
}
uni.navigateTo({
url: url,
})
}
const onTask = (e) => {
const type = props.item.taskable_type
uni.navigateTo({
url: `/pages/task/${type}_submit?id=${props.item.id}`,
})
}
</script>

View File

@ -57,7 +57,7 @@ import { timeFormat } from '@climblee/uv-ui/libs/function'
const baseColums = [ const baseColums = [
{ {
title: '申请人', title: '申请人',
dataIndex: 'taskable.store_master.name', dataIndex: 'name',
}, },
{ {
title: '所属门店', title: '所属门店',
@ -65,7 +65,7 @@ const baseColums = [
}, },
{ {
title: '电话号码', title: '电话号码',
dataIndex: 'taskable.store_master.phone', dataIndex: '',
}, },
{ {
title: '申请时间', title: '申请时间',

View File

@ -22,15 +22,8 @@
> >
<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 in list" :key="item.id" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click.stop="applyClick(item)"> <view v-for="(item, i) in list" :key="i">
<view class="flex items-center justify-between"> <Item :item="item"></Item>
<view class="text-30rpx">{{ item.name }}</view>
<view class="text-24rpx" :style="{color: statusFun(item.taskable.status, 'task_hygienes' ,'color')}">{{ item.taskable.status_text }}</view>
</view>
<view class="text-24rpx text-hex-999999">
任务时间{{ timeFormat(item.start_at, 'yyyy年mm月dd日') }} -
{{ timeFormat(item.end_at, 'yyyy年mm月dd日') }}
</view>
</view> </view>
</view> </view>
</template> </template>
@ -45,15 +38,12 @@
> >
<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 in list" :key="item.id" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click.stop="checkClick(item)"> <view v-for="(item, i) in list" :key="i">
<view class="flex items-center justify-between"> <Item
<view class="text-30rpx">{{ item.check.subject.task.name }}</view> :item="item"
<view class="text-24rpx" :style="{color: statusFun(item.check_status, 'statusExpense' ,'color')}">{{ item.check_status_text }}</view> isCheck
</view> :type="tabList[1].params.subject_type"
<view class="text-24rpx text-hex-999999"> ></Item>
任务时间{{ timeFormat(item.check.subject.task.start_at, 'yyyy年mm月dd日') }} -
{{ timeFormat(item.check.subject.task.end_at, 'yyyy年mm月dd日') }}
</view>
</view> </view>
</view> </view>
</template> </template>
@ -63,11 +53,10 @@
<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 { 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 statusFun from '@/utils/status'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
const mescrollItem0 = ref(null) const mescrollItem0 = ref(null)
const mescrollItem1 = ref(null) const mescrollItem1 = ref(null)
@ -87,8 +76,7 @@ const tabList = ref([
name: '任务审核', name: '任务审核',
apiUrl: '/workflow', apiUrl: '/workflow',
params: { params: {
subject_type: 'task_hygienes', subject_type: 'task_hygienes'
include: 'check.subject.task'
}, },
}, },
]) ])
@ -97,24 +85,4 @@ const tabChange = ({ index }) => {
tabIndex.value = index tabIndex.value = index
scrollToLastY() scrollToLastY()
} }
const applyClick = (item) => {
const type = item.taskable_type
const status = item.taskable.status
let url
if (status === 2 || status == 4) {
url = `/pages/task/${type}_submit?id=${item.id}`
} else {
url = `/pages/task/detail?id=${item.id}`
}
uni.navigateTo({
url: url,
})
}
const checkClick = (item) => {
uni.navigateTo({
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`,
})
}
</script> </script>

View File

@ -21,15 +21,14 @@
</uv-form-item> </uv-form-item>
<uv-line color="#f5f5f5"></uv-line> <uv-line color="#f5f5f5"></uv-line>
<uv-form-item <uv-form-item
label="清洁结果" label="报销凭证"
labelPosition="top" labelPosition="top"
prop="photos" prop="photos"
required required
> >
<template #right>{{ form.photos.length }} / {{ maxCount }}</template>
<view class="w-full mt-15rpx"> <view class="w-full mt-15rpx">
<uv-upload <uv-upload
:maxCount="maxCount" :maxCount="9"
multiple multiple
:fileList="form.photos" :fileList="form.photos"
@afterRead="afterRead" @afterRead="afterRead"
@ -66,13 +65,12 @@ const form = reactive({
description: '', description: '',
photos: [], photos: [],
}) })
const maxCount = ref(9)
const rules = reactive({ const rules = reactive({
description: [{ required: true, message: '请输入清洁范围' }], description: [{ required: true, message: '请输入清洁范围' }],
photos: { photos: {
type: 'array', type: 'array',
required: true, required: true,
message: '请上传清洁结果', message: '请上传报销凭证',
}, },
}) })
onLoad((options) => { onLoad((options) => {
@ -82,8 +80,6 @@ onLoad((options) => {
const submit = () => { const submit = () => {
formRef.value.validate().then((res) => { formRef.value.validate().then((res) => {
modalRef.value.open() modalRef.value.open()
}).catch(error => {
console.log(error)
}) })
} }
@ -94,6 +90,9 @@ const onSubmit = async () => {
await http.request({ await http.request({
url: `/tasks/${id.value}/submit`, url: `/tasks/${id.value}/submit`,
method: 'POST', method: 'POST',
header: {
Accept: 'application/json',
},
data: { data: {
task_hygiene: { task_hygiene: {
description: form.description, description: form.description,
@ -106,7 +105,7 @@ const onSubmit = async () => {
icon: 'none', icon: 'none',
}) })
formRef.value.resetFields() formRef.value.resetFields()
uni.$emit('task:submit') uni.$emit('task:submit', resData)
uni.navigateBack() uni.navigateBack()
} catch (error) { } catch (error) {
console.log(error) console.log(error)