components list-item

main
panliang 2024-04-28 15:12:11 +08:00
parent 694af4c837
commit 54f34af5cf
25 changed files with 828 additions and 1127 deletions

View File

@ -0,0 +1,46 @@
<template>
<view class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx">
<view class="flex items-center justify-between pb-10rpx">
<view class="text-30rpx">{{ title }}</view>
<view class="text-24rpx" :style="{color: statusColor}">{{ statusText }}</view>
</view>
<template v-if="body && body.length > 0">
<uv-line />
<view class="body text-hex-999999 text-28rpx">
<view v-for="(item, i) in body" :key="i" class="body-item flex mt-10rpx">
<view class="label mr-10rpx">{{ item.label }}</view>
<view class="value">{{ item.value }}</view>
</view>
</view>
</template>
<template v-if="images && images.length > 0">
<uv-scroll-list :indicator="false">
<view class="space-x-15rpx flex">
<view v-for="(url, index) in images" :key="index">
<image :src="url" mode="heightFix" style="height: 160rpx"></image>
</view>
</view>
</uv-scroll-list>
</template>
<slot name="footer"></slot>
</view>
</template>
<script setup>
import { ref } from 'vue'
const props = defineProps({
title: [String, Number],
statusText: [String, Number],
statusColor: {
type: String,
default: '#3c9cff'
},
body: Array,
images: Array,
})
</script>
<style scoped>
.uv-scroll-list {
padding-bottom: 0;
}
</style>

View File

@ -1,10 +1,6 @@
<template>
<view>
<CuNavbar title="请假申请">
<template #right>
<view class="text-24rpx text-white" @click="submit"></view>
</template>
</CuNavbar>
<CuNavbar title="请假申请"></CuNavbar>
<view class="card-shadow px-base">
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
<uv-form-item required label="请假类别" prop="type_id">
@ -47,6 +43,9 @@
</uv-form-item>
</uv-form>
</view>
<view class="mt-20rpx px-base">
<uv-button type="primary" @click="submit"></uv-button>
</view>
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
<uv-datetime-picker
placeholder="请选择日期"

View File

@ -1,50 +1,14 @@
<template>
<view class="px-base" v-if="detail">
<CuNavbar title="请假详情">
<template #right>
<uv-icon v-if="columns[0].length > 0" color="white" @click="open" name="more-dot-fill"></uv-icon>
<template v-if="actions.length > 0" #right>
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
</template>
</CuNavbar>
<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>申请人</view>
<view class="text-hex-999999">{{ detail.employee.name }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>所属门店</view>
<view class="text-hex-999999">{{ detail.store.title }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>电话号码</view>
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>申请时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.created_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>请假类型</view>
<view class="text-hex-999999">{{ detail.type.name }}</view>
</view>
<view class="py-20rpx flex items-center justify-between">
<view>请假开始时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.start_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<view class="py-20rpx flex items-center justify-between">
<view>请假结束时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.end_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx">
<view>请假原因</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.reason }}</view>
</view>
<BaseData :data="detail" :colums="columns" />
</view>
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
<uv-action-sheet ref="pickerRef" :actions="actions" @select="confirmPicker" />
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
</view>
</template>
@ -53,24 +17,42 @@ import CuNavbar from "@/components/cu-navbar/index"
import { http } from "@/utils/request"
import { onLoad } from "@dcloudio/uni-app"
import { ref } from "vue"
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
import BaseData from '../audits/base-data'
const modalRef = ref(null)
const columns = ref([[]])
const actions = ref([
{ name: '修改', value: 'edit' },
{ name: '删除', value: 'delete' },
])
const detail = ref()
const pickerRef = ref(null)
const id = ref(0)
const columns = [
{ title: '审核状态', dataIndex: 'workflow_check.check_status_text' },
{ title: '拒绝原因', dataIndex: 'workflow_check.check_remarks', labelPosition: 'top', isShow: (data) => data?.workflow_check?.check_status == 4 },
{ title: '申请人', dataIndex: 'employee.name' },
{ title: '所属门店', dataIndex: 'store.title' },
{ title: '电话号码', dataIndex: 'employee.phone' },
{ title: '申请时间', dataIndex: 'created_format' },
{ title: '请假类型', dataIndex: 'type.name' },
{ title: '请假开始时间', dataIndex: 'start_format' },
{ title: '请假结束时间', dataIndex: 'end_format' },
{ title: '请假原因', dataIndex: 'reason', labelPosition: 'top' },
]
const open = () => {
pickerRef.value.open()
}
const confirmPicker = e => {
console.log(e)
if (e.value[0] === "删除") {
modalRef.value.open()
} else {
uni.navigateTo({
if (e.value == 'edit') {
return uni.navigateTo({
url: `/pages/ask-leave/create?id=${id.value}`
})
}
if (e.value == 'delete') {
return modalRef.value.open()
}
}
const onSubmit = async () => {
try {
@ -94,19 +76,12 @@ const onSubmit = async () => {
}
onLoad(options => {
id.value = options.id
http
.request({
url: `/hr/holidays/${options.id}`,
method: "GET",
})
.then(res => {
detail.value = res
http.get(`/hr/holidays/${options.id}`).then(res => {
detail.value = res
const options = []
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
options.push('修改', '删除')
}
columns.value = [options]
})
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
actions.value = []
}
})
})
</script>

View File

@ -2,11 +2,7 @@
<view>
<CuNavbar title="请假申请">
<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>
</CuNavbar>
<uv-sticky bgColor="#fff">
@ -27,26 +23,18 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view
<ListItem
v-for="item in list" :key="item.id"
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
@click="applyDetail(item)"
>
<view class="text-30rpx">请假申请</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">请假类型</view>
<view class="">{{ item.type?.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">请假事由</view>
<view class="">{{ item.reason }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx">申请时间</view>
<view class="text-24rpx">{{ item.created_format }}</view>
</view>
<view :style="{ color: statusFun( item.workflow_check.check_status,'statusExpense','color')}" class="text-24rpx">{{ item.workflow_check.check_status_text }}</view>
</view>
title="请假申请"
:status-text="item.workflow_check.check_status_text"
:status-color="statusFun( item.workflow_check.check_status,'statusExpense','color')"
:body="[
{ label:'请假类型', value: item.type.name },
{ label:'请假事由', value: item.reason },
{ label:'申请时间', value: item.created_format },
]"
@click.stop="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -60,30 +48,19 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view
<ListItem
v-for="item in list" :key="item.id"
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
@click="checkDetail(item)"
>
<view class="text-30rpx">请假申请</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">申请人</view>
<view class="">{{ item.check.subject.employee.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">请假类型</view>
<view class="">{{ item.check.subject.type.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">请假事由</view>
<view class="">{{ item.check.subject.reason }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx">申请时间</view>
<view class="text-24rpx">{{ item.check.subject.created_format }}</view>
</view>
<view :style="{ color: statusFun( item.check_status,'statusExpense','color')}" class="text-24rpx">{{ item.check_status_text }}</view>
</view>
title="请假申请"
:status-text="item.check_status_text"
:status-color="statusFun( item.check_status,'statusExpense','color')"
:body="[
{ label:'申请人', value: item.check.subject.employee.name },
{ label:'请假类型', value: item.check.subject.type.name },
{ label:'请假事由', value: item.check.subject.reason },
{ label:'申请时间', value: item.check.subject.created_format },
]"
@click.stop="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -96,6 +73,8 @@ import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import MescrollItem from '@/components/mescroll-api/more.vue'
import statusFun from '@/utils/status'
import ListItem from '@/components/list-item/index'
const tabList = ref([
{
name: '我的请假',

View File

@ -1,59 +1,14 @@
<template>
<view class="px-base" v-if="detail">
<CuNavbar title="出差详情">
<template v-if="columns[0].length > 0" #right>
<template v-if="actions.length > 0" #right>
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
</template>
</CuNavbar>
<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>申请人</view>
<view class="text-hex-999999">{{ detail.employee.name }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>所属门店</view>
<view class="text-hex-999999">{{ detail.store.title }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>电话号码</view>
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>申请时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.created_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>目的地</view>
<view class="text-hex-999999">{{ detail.address }}</view>
</view>
<view class="py-20rpx flex items-center justify-between">
<view>出差开始时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.start_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<view class="py-20rpx flex items-center justify-between">
<view>出差结束时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.end_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx">
<view>出差原因</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.reason }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>审核状态</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_status_text }}</view>
</view>
<view v-if="detail.workflow_check.check_status == 4" class="py-20rpx">
<view>未通过原因</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_remarks }}</view>
</view>
<BaseData :data="detail" :colums="columns" />
</view>
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
<uv-action-sheet ref="pickerRef" :actions="actions" @select="confirmPicker" />
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
</view>
</template>
@ -63,23 +18,42 @@ import { http } from "@/utils/request"
import { onLoad } from "@dcloudio/uni-app"
import { ref } from "vue"
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
import BaseData from '../audits/base-data'
const modalRef = ref(null)
const columns = ref([[]])
const detail = ref()
const actions = ref([
{ name: '修改', value: 'edit' },
{ name: '删除', value: 'delete' },
])
const detail = ref({})
const columns = [
{ title: '审核状态', dataIndex: 'workflow_check.check_status_text' },
{ title: '拒绝原因', dataIndex: 'workflow_check.check_remarks', labelPosition: 'top', isShow: (data) => data?.workflow_check?.check_status == 4 },
{ title: '申请人', dataIndex: 'employee.name' },
{ title: '所属门店', dataIndex: 'store.title' },
{ title: '电话号码', dataIndex: 'employee.phone' },
{ title: '目的地', dataIndex: 'address' },
{ title: '开始时间', dataIndex: 'start_format' },
{ title: '结束时间', dataIndex: 'end_format' },
{ title: '出差原因', dataIndex: 'reason', labelPosition: 'top' },
{ title: '申请时间', dataIndex: 'created_format' },
]
const pickerRef = ref(null)
const id = ref(0)
const open = () => {
pickerRef.value.open()
}
const confirmPicker = e => {
console.log(e)
if (e.value[0] === "删除") {
modalRef.value.open()
} else {
uni.navigateTo({
if (e.value == 'edit') {
return uni.navigateTo({
url: `/pages/business/create?id=${id.value}`
})
}
if (e.value == 'delete') {
return modalRef.value.open()
}
}
const onSubmit = async () => {
try {
@ -113,11 +87,9 @@ onLoad(options => {
})
.then(res => {
detail.value = res
const options = []
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
options.push('修改', '删除')
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
actions.value = []
}
columns.value = [options]
})
})
</script>

View File

@ -27,22 +27,18 @@
>
<template v-slot="{ list }">
<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 class="text-30rpx">出差报备</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-120rpx text-right mr-20rpx">目的地</view>
<view class="">{{ item.address }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">出差事由</view>
<view class="">{{ item.reason }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx"> 申请时间</view>
<view class="text-24rpx">{{ item.created_format }}</view>
</view>
<view :style="{color: statusFun(item.workflow_check.check_status, 'statusExpense', 'color')}" class="text-24rpx">{{ item.workflow_check.check_status_text }}</view>
</view>
<ListItem
v-for="item in list" :key="item.id"
title="出差报备"
:status-text="item.workflow_check.check_status_text"
:status-color="statusFun(item.workflow_check.check_status, 'statusExpense', 'color')"
:body="[
{label: '目的地: ', value: item.address},
{label: '出差事由: ', value: item.reason},
{label: '申请时间: ', value: item.created_format},
]"
@click="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -57,26 +53,19 @@
>
<template v-slot="{ list }">
<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 class="text-30rpx">出差报备</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-120rpx text-right mr-20rpx">申请人</view>
<view class="">{{ item.check.subject.employee.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-120rpx text-right mr-20rpx">目的地</view>
<view class="">{{ item.check.subject.address }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">出差事由</view>
<view class="">{{ item.check.subject.reason }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx"> 申请时间</view>
<view class="text-24rpx">{{ item.check.subject.created_format }}</view>
</view>
<view :style="{color: statusFun(item.check_status, 'statusExpense', 'color')}" class="text-24rpx">{{ item.check_status_text }}</view>
</view>
<ListItem
v-for="item in list" :key="item.id"
title="出差报备"
:status-text="item.check_status_text"
:status-color="statusFun(item.check_status, 'statusExpense', 'color')"
:body="[
{label: '申请人: ', value: item.check.subject.employee.name},
{label: '目的地: ', value: item.check.subject.address},
{label: '出差事由: ', value: item.check.subject.reason},
{label: '申请时间: ', value: item.check.subject.created_format},
]"
@click="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -89,6 +78,8 @@ import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import MescrollItem from '@/components/mescroll-api/more.vue'
import statusFun from "@/utils/status"
import ListItem from '@/components/list-item'
const tabList = ref([
{
name: '出差申请',

View File

@ -1,22 +1,17 @@
<template>
<view class="px-base" v-if="detail">
<CuNavbar title="合同详情">
<template v-if="columns[0].length > 0" #right>
<template v-if="actions.length > 0" #right>
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
</template>
</CuNavbar>
<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="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
<BaseData :data="detail" :colums="columns" />
<!-- <view class="py-20rpx flex items-center justify-between">
<view>上传人</view>
<view class="text-hex-999999">{{ detail.employee.name }}</view>
</view>
<uv-line color="#f5f5f5"></uv-line>
<!-- <view class="py-20rpx flex items-center justify-between">
<view>所属门店</view>
<view class="text-hex-999999">{{ detail.store.title }}</view>
</view> -->
<view class="py-20rpx flex items-center justify-between">
<view>电话号码</view>
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
@ -55,21 +50,11 @@
<view v-if="detail.workflow_check.check_status == 4" class="py-20rpx">
<view>未通过原因</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_remarks }}</view>
</view>
</view> -->
</view>
<uv-picker
ref="pickerRef"
:columns="columns"
@confirm="confirmPicker"
></uv-picker>
<uv-modal
ref="modalRef"
title="提示"
content="确定删除吗?"
@confirm="onSubmit"
:showCancelButton="true"
></uv-modal>
<uv-action-sheet ref="pickerRef" :actions="actions" @select="confirmPicker" />
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
</view>
</template>
<script setup>
@ -78,23 +63,38 @@ import { http } from '@/utils/request'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
import BaseData from '../audits/base-data'
const modalRef = ref(null)
const columns = ref([[]])
const actions = ref([
{ name: '修改', value: 'edit' },
{ name: '删除', value: 'delete' },
])
const detail = ref()
const pickerRef = ref(null)
const id = ref(0)
const columns = [
{ title: '审核状态', dataIndex: 'workflow_check.check_status_text' },
{ title: '拒绝原因', dataIndex: 'workflow_check.check_remarks', labelPosition: 'top', isShow: (data) => data?.workflow_check?.check_status == 4 },
{ title: '申请人', dataIndex: 'employee.name' },
{ title: '电话号码', dataIndex: 'employee.phone' },
{ title: '创建时间', dataIndex: 'created_format' },
{ title: '合同名称', dataIndex: 'name' },
{ title: '合同内容', dataIndex: 'images', type: 'album' },
]
const open = () => {
pickerRef.value.open()
}
const confirmPicker = (e) => {
console.log(e)
if (e.value[0] === '删除') {
modalRef.value.open()
} else {
uni.navigateTo({
if (e.value == 'edit') {
return uni.navigateTo({
url: `/pages/contract/create?id=${id.value}`,
})
}
if (e.value == 'delete') {
return modalRef.value.open()
}
}
const onSubmit = async () => {
try {
@ -128,11 +128,9 @@ onLoad((options) => {
})
.then((res) => {
detail.value = res
const options = []
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
options.push('修改', '删除')
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
actions.value = []
}
columns.value = [options]
})
})
</script>

View File

@ -2,11 +2,7 @@
<view>
<CuNavbar title="我的合同">
<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>
</CuNavbar>
<uv-sticky bgColor="#fff">
@ -30,19 +26,17 @@
>
<template v-slot="{ list }">
<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="applyDetail(item)">
<view class="flex items-center justify-between">
<view class="text-30rpx">{{ item.name }}</view>
</view>
<uv-scroll-list v-if="item.images" :indicator="false">
<view class="space-x-15rpx flex">
<view v-for="(url, index) in item?.images ?? []" :key="index">
<image :src="url + ''" mode="heightFix" style="height: 160rpx"></image>
</view>
</view>
</uv-scroll-list>
<view :style="{color: statusFun(item.workflow_check.check_status, 'statusExpense', 'color')}" class="text-24rpx">{{item.workflow_check.check_status_text}}</view>
</view>
<ListItem
v-for="item in list" :key="item.id"
:title="item.name"
:status-text="item.workflow_check.check_status_text"
:status-color="statusFun(item.workflow_check.check_status,'statusExpense','color')"
:images="item.images"
:body="[
{ label: '创建时间', value: item.created_format }
]"
@click.stop="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -57,25 +51,18 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="(item, i) in list" :key="i">
<view v-for="item in list" :key="item.id" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx" @click.stop="checkDetail(item)">
<view class="flex items-center justify-between">
<view class="text-30rpx">{{ item.check.subject.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-120rpx text-right mr-20rpx">申请人</view>
<view class="">{{ item.check.subject.employee.name }}</view>
</view>
<uv-scroll-list v-if="item.check.subject.images" :indicator="false">
<view class="space-x-15rpx flex">
<view v-for="(url, index) in item.check.subject.images" :key="index">
<image :src="url + ''" mode="heightFix" style="height: 160rpx"></image>
</view>
</view>
</uv-scroll-list>
<view :style="{color: statusFun(item.check_status, 'statusExpense', 'color')}" class="text-24rpx">{{item.check_status_text}}</view>
</view>
</view>
<ListItem
v-for="item in list" :key="item.id"
:title="item.check.subject.name"
:status-text="item.check_status_text"
:status-color="statusFun(item.check_status,'statusExpense','color')"
:images="item.check.subject.images"
:body="[
{ label: '创建人', value: item.check.subject.employee.name },
{ label: '创建时间', value: item.check.subject.created_format }
]"
@click.stop="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -88,6 +75,7 @@ import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import MescrollItem from '@/components/mescroll-api/more.vue'
import statusFun from '@/utils/status'
import ListItem from '@/components/list-item/index'
const mescrollItem0 = ref(null)
const mescrollItem1 = ref(null)

View File

@ -33,10 +33,8 @@ import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/request'
const actionlist = ref([
{
name: '删除',
value: 'delete',
},
{name: '修改', value: 'edit'},
{name: '删除', value: 'delete'},
])
const colums = [
@ -58,7 +56,7 @@ const colums = [
},
{
title: "申请时间",
dataIndex: "created_at_format"
dataIndex: "created_format"
},
{
title: '报销分类',
@ -96,7 +94,11 @@ const open = () => {
}
const select = (e) => {
console.log(e)
if (e.value == 'edit') {
uni.navigateTo({
url: `/pages/expense-account/submit?id=${id.value}`
})
}
}
onLoad((option) => {
@ -107,6 +109,9 @@ onLoad((option) => {
const getDetail = () => {
http.get(`/reimbursements/${id.value}`).then((res) => {
data.value = res
if ([2,3].indexOf(res.workflow_check.check_status) != -1) {
actionlist.value = []
}
})
}
</script>

View File

@ -25,26 +25,19 @@
>
<template v-slot="{ list }">
<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 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>
<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>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.type?.name"
:status-text="item.workflow_check?.check_status_text"
:status-color="statusFun(item.workflow_check?.check_status,'statusExpense','color')"
:body="[
{ label: '报销金额: ', value: item.expense },
{ label: '报销原因: ', value: item.reason },
{ label: '报销时间: ', value: item.created_format },
]"
@click="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -58,26 +51,20 @@
>
<template v-slot="{ list }">
<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 class="flex items-center justify-between">
<view class="text-30rpx"> {{ item.check.subject.type.name }} </view>
<view :style="{color: statusFun(item.check_status,'statusExpense','color'),}" class="text-24rpx">{{ item.check_status_text }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">报销金额</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>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.check.subject.type?.name"
:status-text="item.check_status_text"
:status-color="statusFun(item.check_status,'statusExpense','color')"
:body="[
{ label: '申请人: ', value: item.check.subject.employee.name },
{ label: '报销金额: ', value: item.check.subject.expense },
{ label: '报销原因: ', value: item.check.subject.reason },
{ label: '报销时间: ', value: item.check.subject.created_format },
]"
@click="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -92,6 +79,7 @@ import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js
import MescrollItem from '@/components/mescroll-api/more.vue'
import { timeFormat } from '@climblee/uv-ui/libs/function'
import statusFun from '@/utils/status'
import ListItem from '@/components/list-item/index'
const mescrollItem0 = ref(null)
const mescrollItem1 = ref(null)
@ -111,7 +99,7 @@ const tabList = ref([
{
name: '报销审核',
apiUrl: '/workflow',
params: { subject_type: 'reimbursements', include: 'check.subject.type' },
params: { subject_type: 'reimbursements', include: 'check.subject.type,check.subject.employee' },
},
])

View File

@ -47,9 +47,7 @@
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item label="报销凭证" prop="photos" required>
<view class="text-right w-full text-hex-999"
>{{ form.photos.length }}/9</view
>
<view class="text-right w-full text-hex-999">{{ form.photos.length }}/9</view>
</uv-form-item>
<view class="w-full">
<uv-upload
@ -132,7 +130,21 @@ const rules = reactive({
},
})
onLoad(() => {
onLoad((e) => {
if (e.id) {
http.get(`reimbursements/${e.id}`).then(res => {
console.log(res)
type.value = res.type
form.reimbursement_type_id = res.reimbursement_type_id
form.expense = res.expense
form.reason = res.reason
if (res.photos && res.photos.length > 0) {
form.photos = res.photos.map(item => {
return {url: item}
})
}
})
}
getTypes()
})

View File

@ -1,57 +0,0 @@
<template>
<view
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
@click="goPath"
>
<view class="text-30rpx">补卡申请</view>
<view class="text-24rpx text-hex-999999">
<text class="text-24rpx w-140rpx inline-block">补卡原因</text>
<text class="">{{ item.reason }}</text>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">补卡类别</view>
<view class="">{{ item.sign_time == 1 ? '上班打卡' : '下班打卡' }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx"> 补卡时间</view>
<view class="text-24rpx">{{ valueFormat }}</view>
</view>
<view
:style="{
color: statusFun(
item.workflow_check.check_status,
'workflow_check',
'color'
),
}"
class="text-24rpx"
>{{
statusFun(item.workflow_check.check_status, 'workflow_check', 'name')
}}</view
>
</view>
</template>
<script setup>
import statusFun from '@/utils/status'
import { computed } from 'vue'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
const props = defineProps({
item: Object,
subject_type: String,
type: Number,
})
const valueFormat = computed(() => {
return timeFormat(props.item.date, 'yyyy-mm-dd hh:MM')
})
const goPath = () => {
if (props.type == 1) {
uni.navigateTo({
url: `/pages/audits/detail?id=${props.item.id}&type=${props.subject_type}`,
})
} else {
uni.navigateTo({
url: `/pages/make-card/detail?id=${props.item.id}`,
})
}
}
</script>

View File

@ -1,9 +1,6 @@
<template>
<view>
<CuNavbar title="补卡申请">
<template #right>
<view class="text-24rpx text-white" @click="submit"></view>
</template>
</CuNavbar>
<view class="card-shadow px-base">
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
@ -51,6 +48,9 @@
</uv-form-item>
</uv-form>
</view>
<view class="mt-20rpx px-base">
<uv-button type="primary" @click="submit"></uv-button>
</view>
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
<uv-datetime-picker
v-model="value"
@ -128,7 +128,7 @@ onLoad(options => {
const submit = () => {
formRef.value.validate().then(res => {
modalRef.value.open()
})
}).catch(error => {})
}
const onSubmit = async () => {

View File

@ -1,67 +1,14 @@
<template>
<view class="px-base" v-if="detail">
<CuNavbar title="补卡详情">
<template v-if="!isEdit" #right>
<template v-if="actions.length > 0" #right>
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
</template>
</CuNavbar>
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
<BaseData :colums="detailColumns" :data="detail"></BaseData>
<!-- <view class="py-20rpx flex items-center justify-between">
<view>申请人</view>
<view class="text-hex-999999">{{ detail.employee.name }}</view>
</view>
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>所属门店</view>
<view class="text-hex-999999">{{ detail.store.title }}</view>
</view>
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>电话号码</view>
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
</view>
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>申请时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.created_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>补卡时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.date, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx">
<text class="">补卡原因</text>
<text class="text-hex-999999 mt-20rpx">{{ detail.reason }}</text>
</view>
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>是否外勤</view>
<view class="text-hex-999999">{{ detail.sign_type == 1 ? "否" : "是" }}</view>
</view>
<template v-if="detail.sign_type == 2">
<uv-line color="#f5f5f5"></uv-line>
<view class="py-20rpx">
<view>外勤事由</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.outside_remarks }}</view>
</view>
</template>
<uv-line color="#f5f5f5"></uv-line>
</view> -->
<!-- <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="flex-1">
<uv-button color="#999999" shape="circle" plain block> 拒绝 </uv-button>
</view>
<view class="flex-1">
<uv-button type="primary" shape="circle" block> 通过 </uv-button>
</view>
</view> -->
</view>
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
<uv-action-sheet ref="pickerRef" :actions="actions" @select="confirmPicker" />
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
</view>
</template>
@ -74,11 +21,18 @@ import { timeFormat } from "@climblee/uv-ui/libs/function/index"
import BaseData from '@/pages/audits/base-data.vue'
const modalRef = ref(null)
const columns = [["修改", "删除"]]
const actions = ref([
{ name: '修改', value: 'edit' },
{ name: '删除', value: 'delete' },
])
const detail = ref()
const pickerRef = ref(null)
const id = ref(0)
const detailColumns = [
{
title: "审核状态",
dataIndex: "workflow_check.check_status_text"
},
{
title: "申请人",
dataIndex: "employee.name"
@ -122,13 +76,12 @@ const open = () => {
pickerRef.value.open()
}
const confirmPicker = e => {
console.log(e)
if (e.value[0] === "删除") {
modalRef.value.open()
} else {
if (e.value == 'edit') {
uni.navigateTo({
url: `/pages/make-card/create?id=${id.value}`
})
} else if (e.value == 'delete') {
modalRef.value.open()
}
}
const onSubmit = async () => {
@ -153,16 +106,11 @@ const onSubmit = async () => {
}
onLoad(options => {
id.value = options.id
http
.request({
url: `/hr/sign-repairs/${options.id}`,
method: "GET",
header: {
Accept: "application/json"
}
})
.then(res => {
detail.value = res
})
http.get(`/hr/sign-repairs/${options.id}`).then(res => {
detail.value = res
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
actions.value = []
}
})
})
</script>

View File

@ -2,11 +2,7 @@
<view>
<CuNavbar title="补卡申请">
<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>
</CuNavbar>
<uv-sticky bgColor="#fff">
@ -27,9 +23,19 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="(item, i) in list" :key="i">
<Item :item="item" :type="0"></Item>
</view>
<ListItem
v-for="item in list" :key="item.id"
title="补卡申请"
:status-text="item.workflow_check.check_status_text"
:status-color="statusFun(item.workflow_check.check_status,'statusExpense','color')"
:body="[
{ label: '补卡时间: ', value: item.date_format },
{ label: '补卡类别: ', value: item.sign_time_text },
{ label: '补卡原因: ', value: item.reason },
{ label: '申请时间: ', value: item.created_format },
]"
@click.stop="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -43,30 +49,20 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view
<ListItem
v-for="item in list" :key="item.id"
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
@click="checkDetail(item)"
>
<view class="text-30rpx">补卡申请</view>
<view class="text-24rpx text-hex-999999">
<text class="text-24rpx w-140rpx inline-block">申请人: </text>
<text class="">{{ item.check.subject.employee.name }}</text>
</view>
<view class="text-24rpx text-hex-999999">
<text class="text-24rpx w-140rpx inline-block">补卡原因</text>
<text class="">{{ item.check.subject.reason }}</text>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">补卡类别</view>
<view class="">{{ item.check.subject.sign_time == 1 ? '上班打卡' : '下班打卡' }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx"> 补卡时间</view>
<view class="text-24rpx">{{ item.check.subject.date_format }}</view>
</view>
<view :style="{color: statusFun(item.check_status,'statusExpense','color')}" class="text-24rpx">{{ item.check_status_text }}</view>
</view>
title="补卡申请"
:status-text="item.check_status_text"
:status-color="statusFun(item.check_status,'statusExpense','color')"
:body="[
{ label: '申请人: ', value: item.check.subject.employee.name },
{ label: '补卡时间: ', value: item.check.subject.date_format },
{ label: '补卡类别: ', value: item.check.subject.sign_time_text },
{ label: '补卡原因: ', value: item.check.subject.reason },
{ label: '申请时间: ', value: item.check.subject.created_format },
]"
@click.stop="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -78,8 +74,8 @@ import { ref } from 'vue'
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'
import statusFun from '@/utils/status'
import ListItem from '@/components/list-item/index'
const tabList = ref([
{
name: '我的补卡',
@ -120,6 +116,12 @@ const tabChange = ({ index }) => {
scrollToLastY()
}
const applyDetail = (item) => {
uni.navigateTo({
url: `/pages/make-card/detail?id=${item.id}`,
})
}
const checkDetail = (item) => {
uni.navigateTo({
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`,

View File

@ -1,59 +1,14 @@
<template>
<view class="px-base" v-if="detail">
<CuNavbar title="加班审核">
<template v-if="columns[0].length > 0" #right>
<template v-if="actions.length > 0" #right>
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
</template>
</CuNavbar>
<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>申请人</view>
<view class="text-hex-999999">{{ detail.employee.name }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>所属门店</view>
<view class="text-hex-999999">{{ detail.store.title }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>电话号码</view>
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>申请时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.created_at, "yyyy-mm-dd hh:MM") }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>加班日期</view>
<view class="text-hex-999999">{{ timeFormat(detail.date, "yyyy-mm-dd") }}</view>
</view>
<view class="py-20rpx flex items-center justify-between">
<view>开始时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.start_at, "yyyy-mm-dd hh:MM").substring(10) }}</view>
</view>
<view class="py-20rpx flex items-center justify-between">
<view>结束时间</view>
<view class="text-hex-999999">{{ timeFormat(detail.end_at, "yyyy-mm-dd hh:MM").substring(10) }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx">
<view>加班原因</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.reason }}</view>
</view>
<uv-line></uv-line>
<view class="py-20rpx flex items-center justify-between">
<view>审核状态</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_status_text }}</view>
</view>
<view v-if="detail.workflow_check.check_status == 4" class="py-20rpx">
<view>未通过原因</view>
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_remarks }}</view>
</view>
<BaseData :data="detail" :colums="columns" />
</view>
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
<uv-action-sheet ref="pickerRef" :actions="actions" @select="confirmPicker" />
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
</view>
</template>
@ -62,24 +17,42 @@ import CuNavbar from "@/components/cu-navbar/index"
import { http } from "@/utils/request"
import { onLoad } from "@dcloudio/uni-app"
import { ref } from "vue"
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
import BaseData from '../audits/base-data'
const modalRef = ref(null)
const columns = ref([[]])
const detail = ref()
const actions = ref([
{ name: '修改', value: 'edit' },
{ name: '删除', value: 'delete' },
])
const detail = ref({})
const pickerRef = ref(null)
const id = ref(0)
const columns = [
{ title: '审核状态', dataIndex: 'workflow_check.check_status_text' },
{ title: '拒绝原因', dataIndex: 'workflow_check.check_remarks', labelPosition: 'top', isShow: (data) => data?.workflow_check?.check_status == 4 },
{ title: '申请人', dataIndex: 'employee.name' },
{ title: '所属门店', dataIndex: 'store.title' },
{ title: '电话号码', dataIndex: 'employee.phone' },
{ title: '申请时间', dataIndex: 'created_format' },
{ title: '加班日期', dataIndex: 'date_format' },
{ title: '开始时间', dataIndex: 'start_format' },
{ title: '结束时间', dataIndex: 'end_format' },
{ title: '请假原因', dataIndex: 'reason', labelPosition: 'top' },
]
const open = () => {
pickerRef.value.open()
}
const confirmPicker = e => {
console.log(e)
if (e.value[0] === "删除") {
modalRef.value.open()
} else {
uni.navigateTo({
if (e.value == 'edit') {
return uni.navigateTo({
url: `/pages/overtime/create?id=${id.value}`
})
}
if (e.value == 'delete') {
return modalRef.value.open()
}
}
const onSubmit = async () => {
try {
@ -113,11 +86,9 @@ onLoad(options => {
})
.then(res => {
detail.value = res
const options = []
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
options.push('修改', '删除')
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
actions.value = []
}
columns.value = [options]
})
})
</script>

View File

@ -2,11 +2,7 @@
<view>
<CuNavbar title="加班申请">
<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>
</CuNavbar>
<uv-sticky bgColor="#fff">
@ -27,22 +23,19 @@
>
<template v-slot="{ list }">
<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 class="text-30rpx">加班报备</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">加班日期</view>
<view class="">{{ item.date_format }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx">加班时间</view>
<view class="text-24rpx">{{ item.start_format }} - {{ item.end_format }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">加班事由</view>
<view class="">{{ item.reason }}</view>
</view>
<view :style="{color: statusFun(item.workflow_check.check_status, 'statusExpense', 'color')}" class="text-24rpx">{{ item.workflow_check.check_status_text }}</view>
</view>
<ListItem
v-for="item in list" :key="item.id"
title="加班报备"
:status-text="item.workflow_check.check_status_text"
:status-color="statusFun( item.workflow_check.check_status,'statusExpense','color')"
:body="[
{ label:'加班日期: ', value: item.date_format },
{ label:'加班时间: ', value: item.start_format + '-' + item.end_format },
{ label:'加班事由: ', value: item.reason },
{ label:'申请时间: ', value: item.created_format },
]"
@click.stop="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -57,26 +50,20 @@
>
<template v-slot="{ list }">
<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 class="text-30rpx">加班报备</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">申请人</view>
<view class="">{{ item.check.subject.employee.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">加班日期</view>
<view class="">{{ item.check.subject.date_format }}</view>
</view>
<view class="flex items-center text-hex-999999 flex">
<view class="text-24rpx w-140rpx">加班时间</view>
<view class="text-24rpx">{{ item.check.subject.start_format }} - {{ item.check.subject.end_format }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="text-24rpx w-140rpx">加班事由</view>
<view class="">{{ item.check.subject.reason }}</view>
</view>
<view :style="{color: statusFun(item.check_status, 'statusExpense', 'color')}" class="text-24rpx">{{ item.check_status_text }}</view>
</view>
<ListItem
v-for="item in list" :key="item.id"
title="加班报备"
:status-text="item.workflow_check.check_status_text"
:status-color="statusFun( item.workflow_check.check_status,'statusExpense','color')"
:body="[
{ label:'申请人: ', value: item.check.subject.employee.name },
{ label:'加班日期: ', value: item.check.subject.date_format },
{ label:'加班时间: ', value: item.check.subject.start_format + '-' + item.check.subject.end_format },
{ label:'加班事由: ', value: item.check.subject.reason },
{ label:'申请时间: ', value: item.check.subject.created_format },
]"
@click.stop="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -89,6 +76,8 @@ import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
import MescrollItem from '@/components/mescroll-api/more.vue'
import statusFun from "@/utils/status"
import ListItem from '@/components/list-item/index'
const tabList = ref([
{
name: '我的加班',

View File

@ -1,51 +1,9 @@
<template>
<view class="px-base">
<CuNavbar title="任务详情"></CuNavbar>
<view
class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx"
>
<template v-for="(item, i) in columsList" :key="i">
<template v-if="item.dataIndex == 'taskable.photos'">
<view class="py-20rpx">
<view>{{ item.title }}</view>
<view class="grid grid-cols-3 gap-15rpx mt-20rpx">
<view class="" v-for="op in item.value" :key="op">
<image class="w-full" mode="widthFix" :src="op"></image>
</view>
</view>
</view>
</template>
<view
v-else
class="py-20rpx flex"
:class="[
[
item.labelPosition == 'top'
? 'flex-col space-y-10rpx'
: 'items-center justify-between',
],
]"
>
<view>{{ item.title }}</view>
<view class="text-hex-999999">{{ item.value }}</view>
</view>
<uv-line color="#f5f5f5" v-if="i != columsList.length - 1"></uv-line>
</template>
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
<BaseData :data="data" :colums="baseColums" />
</view>
<!-- <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="flex-1">
<uv-button color="#999999" shape="circle" plain block>
拒绝
</uv-button>
</view>
<view class="flex-1">
<uv-button type="primary" shape="circle" block> 通过 </uv-button>
</view>
</view>
</view> -->
</view>
</template>
<script setup>
@ -54,7 +12,12 @@ import { onLoad } from '@dcloudio/uni-app'
import { http } from '@/utils/request'
import { ref, computed } from 'vue'
import { timeFormat } from '@climblee/uv-ui/libs/function'
import BaseData from '@/pages/audits/base-data'
const baseColums = [
{
title: '审核状态',
dataIndex: 'taskable.status_text',
},
{
title: '申请人',
dataIndex: 'taskable.store_master.name',
@ -80,38 +43,20 @@ const baseColums = [
{
title: '清洁结果',
dataIndex: 'taskable.photos',
labelPosition: 'top',
type: 'album'
},
]
const id = ref(null)
const data = ref({})
const columsList = computed(() => {
const arr = []
baseColums.forEach((e) => {
const { dataIndex, format } = e
let str = getValue(data.value, dataIndex)
if (isFunction(format)) {
str = format(str)
}
arr.push({
...e,
value: str,
})
})
return arr
})
onLoad((opt) => {
id.value = opt.id
getDetail()
})
const getDetail = async () => {
const resdata = await http.get(`/tasks/${id.value}`, {
params: {
id: id.value,
},
})
const resdata = await http.get(`/tasks/${id.value}`)
data.value = resdata
}

View File

@ -22,16 +22,18 @@
>
<template v-slot="{ list }">
<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 class="flex items-center justify-between">
<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>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.name"
:status-text="item.taskable.status_text"
:status-color="statusFun(item.taskable.status, 'statusExpense' ,'color')"
:body="[
{label: '任务时间: ', value: item.start_format + '-' + item.end_format},
{label: '提交时间: ', value: item.created_format},
]"
@click.stop="applyClick(item)"
/>
</view>
</template>
</MescrollItem>
@ -45,16 +47,18 @@
>
<template v-slot="{ list }">
<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 class="flex items-center justify-between">
<view class="text-30rpx">{{ item.check.subject.task.name }}</view>
<view class="text-24rpx" :style="{color: statusFun(item.check_status, 'statusExpense' ,'color')}">{{ item.check_status_text }}</view>
</view>
<view class="text-24rpx text-hex-999999">
任务时间{{ timeFormat(item.check.subject.task.start_at, 'yyyy年mm月dd日') }} -
{{ timeFormat(item.check.subject.task.end_at, 'yyyy年mm月dd日') }}
</view>
</view>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.check.subject.task.name"
:status-text="item.check_status_text"
:status-color="statusFun(item.check_status, 'statusExpense' ,'color')"
:body="[
{label: '任务时间: ', value: item.check.subject.task.start_format + '-' + item.check.subject.task.end_format},
{label: '提交时间: ', value: item.check.subject.task.created_format},
]"
@click.stop="checkClick(item)"
/>
</view>
</template>
</MescrollItem>
@ -68,6 +72,7 @@ import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js
import MescrollItem from '@/components/mescroll-api/more.vue'
import statusFun from '@/utils/status'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
import ListItem from '@/components/list-item/index'
const mescrollItem0 = ref(null)
const mescrollItem1 = ref(null)

View File

@ -22,25 +22,24 @@
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
label="清洁结果"
labelPosition="top"
prop="photos"
required
>
<template #right>{{ form.photos.length }} / {{ maxCount }}</template>
<view class="w-full mt-15rpx">
<uv-upload
:maxCount="maxCount"
multiple
:fileList="form.photos"
@afterRead="afterRead"
@delete="deletePic"
name="photos"
></uv-upload>
</view>
<view class="text-right w-full text-hex-999">{{ form.photos.length }}/{{ maxCount }}</view>
</uv-form-item>
<view class="w-full">
<uv-upload
:maxCount="maxCount"
multiple
:fileList="form.photos"
@afterRead="afterRead"
@delete="deletePic"
name="photos"
></uv-upload>
</view>
</uv-form>
</view>
<view class="mt-100rpx">
<view class="mt-20rpx">
<uv-button type="primary" @click="submit"></uv-button>
</view>
@ -61,6 +60,7 @@ import { http } from '@/utils/request'
const formRef = ref(null)
const modalRef = ref(null)
const id = ref(0)
const info = ref({})
const loading = ref(false)
const form = reactive({
description: '',
@ -78,6 +78,7 @@ const rules = reactive({
onLoad((options) => {
id.value = options.id
http.get(`/tasks/${id.value}`).then(res => {
info.value = res
if (res.taskable) {
form.description = res.taskable.description
if (res.taskable.photos && res.taskable.photos.length > 0) {

View File

@ -1,313 +0,0 @@
<template>
<view>
<CuNavbar title="升职申请">
<template v-if="!isEdit" #right>
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
</template>
</CuNavbar>
<uv-sticky bgColor="white">
<view class="p-base box-shadow text-28rpx">
<view class="flex justify-between px-10rpx">
<view>晋升职位</view>
<view>{{ detail?.job?.name }}</view>
</view>
<view class="flex justify-between mt-15rpx px-10rpx">
<view>申请人</view>
<view>{{ detail?.employee?.name }}</view>
</view>
<view class="flex justify-between mt-15rpx px-10rpx">
<view>推荐人</view>
<view>{{ detail?.invitor?.name }}</view>
</view>
</view>
</uv-sticky>
<view class="p-base" :class="isEdit ? '' : 'pointer-events-none'">
<view class="card-shadow px-base">
<uv-form
labelPosition="left"
:model="form"
:rules="rules"
ref="formRef"
errorType="toast"
labelWidth="250rpx"
>
<uv-form-item :required="isEdit" label="年龄" prop="age">
<uv-input
placeholder="请输入年龄"
inputAlign="right"
:border="`none`"
v-model="form.age"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item :required="isEdit" label="性别" prop="sex">
<uv-input
placeholder="请选择性别"
@click="openPicker"
readonly
inputAlign="right"
:border="`none`"
v-model="form.sex"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item :required="isEdit" label="学历" prop="education">
<uv-input
placeholder="请输入学历"
inputAlign="right"
:border="`none`"
v-model="form.education"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
:required="isEdit"
@click="openDatePicker"
label="首次参加工作时间"
prop="first_work_time"
>
<uv-input
placeholder="请选择日期"
:required="isEdit"
inputAlign="right"
:border="`none`"
v-model="form.first_work_time"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item :required="isEdit" label="工作年限" prop="work_years">
<uv-input
placeholder="请输入工作年限"
inputAlign="right"
:border="`none`"
v-model="form.work_years"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
:required="isEdit"
label="本公司工作年限"
prop="work_years_in_company"
>
<uv-input
placeholder="请输入本公司工作年限"
inputAlign="right"
:border="`none`"
v-model="form.work_years_in_company"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
:required="isEdit"
label="员工自评"
prop="comment_self"
labelPosition="top"
>
<uv-textarea
v-model="form.comment_self"
:customStyle="{ padding: '0' }"
count
placeholder="请输入员工自评"
:border="`none`"
:maxlength="200"
></uv-textarea>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
:required="isEdit"
label="未来计划"
prop="plans"
labelPosition="top"
>
<uv-textarea
:customStyle="{ padding: '0' }"
v-model="form.plans"
count
placeholder="请输入未来计划"
:border="`none`"
:maxlength="200"
></uv-textarea>
</uv-form-item>
<template v-if="detail.promotion_status > 1">
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
label="推荐理由"
prop="reason"
:required="isEdit"
labelPosition="top"
>
<uv-textarea
:customStyle="{ padding: '0' }"
v-model="form.reason"
count
placeholder="请输入推荐理由"
:border="`none`"
:maxlength="200"
></uv-textarea>
</uv-form-item>
</template>
</uv-form>
</view>
</view>
<view class="px-base" v-if="isEdit">
<view class="py-30rpx">
<uv-button type="primary" @click="submit"></uv-button>
</view>
</view>
<uv-picker
ref="pickerRef"
:columns="columns"
@confirm="confirmPicker"
></uv-picker>
<uv-datetime-picker
placeholder="请选择日期"
ref="datetimePicker"
mode="year-month"
@confirm="confirmDatePicker"
>
</uv-datetime-picker>
<uv-modal
ref="modalRef"
title="提示"
content="确定提交吗?"
@confirm="onSubmit"
:showCancelButton="true"
></uv-modal>
<uv-action-sheet
ref="actionSheet"
:actions="actionlist"
@select="select"
cancelText="取消"
>
</uv-action-sheet>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import { ref, reactive, computed, onBeforeMount } from 'vue'
import { http } from '@/utils/request'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
const props = defineProps({
id: {
type: [Number, String],
},
isEdit: {
type: Boolean,
},
})
const actionlist = ref([
{
name: '去提交',
value: 'submit',
},
])
const actionSheet = ref(null)
const columns = [['男', '女']]
const formRef = ref(null)
const datetimePicker = ref(null)
const pickerRef = ref(null)
const modalRef = ref(null)
const loading = ref(false)
const detail = ref({})
const form = reactive({
age: '',
sex: '',
education: '',
first_work_time: '',
work_years: '',
work_years_in_company: '',
comment_self: '',
plans: '',
reason: '',
})
const openPicker = () => {
pickerRef.value.open()
}
const openDatePicker = () => {
datetimePicker.value.open()
}
const confirmDatePicker = (e) => {
form.first_work_time = timeFormat(e.value, 'yyyy-mm')
}
const confirmPicker = (e) => {
form.sex = e.value[0]
}
const rules = reactive({
age: [{ required: true, message: '请输入年龄' }],
sex: [{ required: true, message: '请选择性别' }],
education: [{ required: true, message: '请输入学历' }],
first_work_time: [{ required: true, message: '请输入首次参加工作时间' }],
work_years: [{ required: true, message: '请输入工作年限' }],
work_years_in_company: [{ required: true, message: '请输入本公司工作年限' }],
comment_self: [{ required: true, message: '请输入员工自评' }],
plans: [{ required: true, message: '请输入未来计划' }],
reason: [{ required: true, message: '请输入推荐理由' }],
})
onBeforeMount(() => {
getDetail()
})
const submit = () => {
formRef.value.validate().then((res) => {
modalRef.value.open()
})
}
const onSubmit = async () => {
if (loading.value) return
loading.value = true
try {
const params = {
...form,
}
const resData = await http.request({
url: `/hr/promotion/${props.id}`,
method: 'POST',
data: params,
})
uni.showToast({
title: '提交成功',
icon: 'none',
})
formRef.value.resetFields()
// uni.$emit('work:submit', resData)
uni.navigateBack()
} catch (error) {
console.log(error)
} finally {
loading.value = false
}
}
const getDetail = async () => {
http.get(`/hr/promotion/${props.id}`).then((res) => {
detail.value = res
Object.assign(form, res?.employee_data || {})
})
}
const open = () => {
actionSheet.value.open()
}
const select = (e) => {
const { value } = e
if (value === 'submit') {
uni.navigateTo({
url: `/pages/work/create?id=${props.id}`,
})
}
}
</script>

View File

@ -1,87 +0,0 @@
<template>
<view
@click="onClick"
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
>
<view class="flex items-center justify-between">
<view class="text-30rpx"> {{ item.job.name }}</view>
<view
class="text-24rpx"
:style="{
color: statusFun(item.promotion_status, 'promotion_status', 'color'),
}"
>{{ item.promotion_status_text }}</view
>
</view>
<view class="text-24rpx text-hex-999999 flex" v-if="type==0 || type==2">
<view class="w-140rpx">推荐人</view>
<view class="">{{ item?.invitor?.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex" v-if="type==1 || type==2">
<view class="w-140rpx">申请人</view>
<view class="">{{ item?.employee?.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">晋升职位</view>
<view class="">{{ item.job.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">申请时间: </view>
<view class="">{{ item.created_format }}</view>
</view>
<!-- <template v-if="options?.includes(item.promotion_status)">
<view class="py-10rpx">
<uv-line color="#f5f5f5"></uv-line>
</view>
<view class="flex justify-end items-center">
<uv-button type="primary" size="mini">去提交</uv-button>
</view>
</template> -->
</view>
</template>
<script setup>
import statusFun from '@/utils/status'
const props = defineProps({
item: Object,
options: {
type: Array,
default: () => [],
},
type: {
type: Number,
default: 0,
},
subject_type: String,
})
const onOption = (e) => {}
const onClick = () => {
// tab==0
//1 =
//tab===1
//2 =
let url = ''
const tab = props.type
if (
(tab == 0 && props.item.promotion_status == 1) ||
(tab == 1 && props.item.promotion_status == 2)
) {
url = `/pages/work/create?id=${props.item.id}&type=${tab}`
} else if (tab === 2) {
url = `/pages/audits/detail?id=${props.item.id}&type=${props.subject_type}`
} else {
url = `/pages/work/detail?id=${props.item.id}`
}
goPath(url)
}
const goPath = (url) => {
uni.navigateTo({
url,
})
}
</script>

View File

@ -1,15 +1,297 @@
<template>
<view>
<commone :id="id" isEdit></commone>
<CuNavbar title="升职申请"></CuNavbar>
<uv-sticky bgColor="white">
<view class="px-base box-shadow text-28rpx">
<view class="px-base">
<BaseData :data="detail" :colums="titleColumns" />
</view>
</view>
</uv-sticky>
<view class="p-base">
<view class="card-shadow px-base">
<uv-form
labelPosition="left"
:model="form"
:rules="rules"
ref="formRef"
errorType="toast"
labelWidth="250rpx"
>
<template v-if="type == 0">
<uv-form-item required label="年龄" prop="age">
<uv-input
placeholder="请输入年龄"
inputAlign="right"
:border="`none`"
v-model="form.age"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="性别" prop="sex">
<uv-input
placeholder="请选择性别"
@click="openPicker"
readonly
inputAlign="right"
:border="`none`"
v-model="form.sex"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="学历" prop="education">
<uv-input
placeholder="请输入学历"
inputAlign="right"
:border="`none`"
v-model="form.education"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
required
@click="openDatePicker"
label="首次参加工作时间"
prop="first_work_time"
>
<uv-input
placeholder="请选择日期"
required
inputAlign="right"
:border="`none`"
v-model="form.first_work_time"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item required label="工作年限" prop="work_years">
<uv-input
placeholder="请输入工作年限"
inputAlign="right"
:border="`none`"
v-model="form.work_years"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
required
label="本公司工作年限"
prop="work_years_in_company"
>
<uv-input
placeholder="请输入本公司工作年限"
inputAlign="right"
:border="`none`"
v-model="form.work_years_in_company"
>
</uv-input>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
required
label="员工自评"
prop="comment_self"
labelPosition="top"
>
<uv-textarea
v-model="form.comment_self"
:customStyle="{ padding: '0' }"
count
placeholder="请输入员工自评"
:border="`none`"
:maxlength="200"
></uv-textarea>
</uv-form-item>
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
required
label="未来计划"
prop="plans"
labelPosition="top"
>
<uv-textarea
:customStyle="{ padding: '0' }"
v-model="form.plans"
count
placeholder="请输入未来计划"
:border="`none`"
:maxlength="200"
></uv-textarea>
</uv-form-item>
</template>
<template v-if="type == 1">
<BaseData :data="detail.employee_data" :colums="userColumns" />
<uv-line color="#f5f5f5"></uv-line>
<uv-form-item
label="推荐理由"
prop="reason"
required
labelPosition="top"
>
<uv-textarea
:customStyle="{ padding: '0' }"
v-model="form.reason"
count
placeholder="请输入推荐理由"
:border="`none`"
:maxlength="200"
></uv-textarea>
</uv-form-item>
</template>
</uv-form>
</view>
</view>
<view class="px-base">
<view class="py-30rpx">
<uv-button type="primary" @click="submit"></uv-button>
</view>
</view>
<uv-picker
ref="pickerRef"
:columns="columns"
@confirm="confirmPicker"
></uv-picker>
<uv-datetime-picker
placeholder="请选择日期"
ref="datetimePicker"
mode="year-month"
:minDate="(new Date(0)).getTime()"
@confirm="confirmDatePicker"
>
</uv-datetime-picker>
<uv-modal
ref="modalRef"
title="提示"
content="确定提交吗?"
@confirm="onSubmit"
:showCancelButton="true"
></uv-modal>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import BaseData from '../audits/base-data.vue'
import { onLoad } from '@dcloudio/uni-app'
import commone from './commone.vue'
import { ref } from 'vue'
const id = ref(0)
import { http } from '@/utils/request'
import { ref, reactive, computed, onBeforeMount } from 'vue'
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
const detail = ref({})
const actionSheet = ref(null)
const columns = [['男', '女']]
const formRef = ref(null)
const datetimePicker = ref(null)
const pickerRef = ref(null)
const modalRef = ref(null)
const loading = ref(false)
const type = ref(0)
const titleColumns = [
{ title: '晋升职位', dataIndex: 'job.name' },
{ title: '申请人', dataIndex: 'employee.name' },
{ title: '推荐人', dataIndex: 'invitor.name' },
]
const userColumns = [
{ title: '年龄', dataIndex: 'age' },
{ title: '性别', dataIndex: 'sex' },
{ title: '学历', dataIndex: 'education' },
{ title: '首次参加工作时间', dataIndex: 'first_work_time' },
{ title: '工作年限', dataIndex: 'work_years' },
{ title: '本公司工作年限', dataIndex: 'work_years_in_company' },
{ title: '员工自评', dataIndex: 'comment_self', labelPosition: 'top' },
{ title: '未来计划', dataIndex: 'plans', labelPosition: 'top' },
]
const form = reactive({
age: '',
sex: '',
education: '',
first_work_time: '',
work_years: '',
work_years_in_company: '',
comment_self: '',
plans: '',
reason: '',
})
const openPicker = () => {
pickerRef.value.open()
}
const openDatePicker = () => {
datetimePicker.value.open()
}
const confirmDatePicker = (e) => {
let date = new Date(e.value);
let month = date.getMonth() + 1
if (month < 10) {
month = '0' + month
}
form.first_work_time = date.getFullYear() + '-' + month
}
const confirmPicker = (e) => {
form.sex = e.value[0]
}
const rules = reactive({
age: [{ required: true, message: '请输入年龄' }],
sex: [{ required: true, message: '请选择性别' }],
education: [{ required: true, message: '请输入学历' }],
first_work_time: [{ required: true, message: '请输入首次参加工作时间' }],
work_years: [{ required: true, message: '请输入工作年限' }],
work_years_in_company: [{ required: true, message: '请输入本公司工作年限' }],
comment_self: [{ required: true, message: '请输入员工自评' }],
plans: [{ required: true, message: '请输入未来计划' }],
reason: [{ required: true, message: '请输入推荐理由' }],
})
onLoad((options) => {
id.value = options.id
type.value = options.type
http.get(`/hr/promotion/${options.id}`).then(res => {
detail.value = res
})
})
const submit = () => {
formRef.value.validate().then((res) => {
modalRef.value.open()
}).catch(error => {
console.log(error)
})
}
const onSubmit = async () => {
if (loading.value) return
loading.value = true
try {
const params = {
...form,
}
const resData = await http.request({
url: `/hr/promotion/${detail.value.id}`,
method: 'POST',
data: params,
})
uni.showToast({
title: '提交成功',
icon: 'none',
})
formRef.value.resetFields()
uni.$emit('work:submit')
uni.navigateBack()
} catch (error) {
console.log(error)
} finally {
loading.value = false
}
}
const open = () => {
actionSheet.value.open()
}
</script>

View File

@ -1,16 +1,53 @@
<template>
<view>
<commone :id="id"></commone>
<CuNavbar title="升职申请"></CuNavbar>
<uv-sticky bgColor="white">
<view class="px-base box-shadow text-28rpx">
<view class="px-base">
<BaseData :data="data" :colums="titleColumns" />
</view>
</view>
</uv-sticky>
<view class="p-base">
<view class="card-shadow px-base">
<BaseData :data="data.employee_data" :colums="columns" />
</view>
</view>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import BaseData from '../audits/base-data.vue'
import { onLoad } from '@dcloudio/uni-app'
import commone from './commone.vue'
import { ref } from 'vue'
const id = ref(0)
import { http } from '@/utils/request'
const data = ref({})
const titleColumns = [
{ title: '晋升职位', dataIndex: 'job.name' },
{ title: '申请人', dataIndex: 'employee.name' },
{ title: '推荐人', dataIndex: 'invitor.name' },
{ title: '状态', dataIndex: 'promotion_status_text' },
]
const columns = [
{ title: '年龄', dataIndex: 'age' },
{ title: '性别', dataIndex: 'sex' },
{ title: '学历', dataIndex: 'education' },
{ title: '首次参加工作时间', dataIndex: 'first_work_time' },
{ title: '工作年限', dataIndex: 'work_years' },
{ title: '本公司工作年限', dataIndex: 'work_years_in_company' },
{ title: '员工自评', dataIndex: 'comment_self', labelPosition: 'top' },
{ title: '未来计划', dataIndex: 'plans', labelPosition: 'top' },
{ title: '推荐理由', dataIndex: 'reason', labelPosition: 'top' },
]
onLoad((options) => {
id.value = options.id
http.get(`/hr/promotion/${options.id}`).then(res => {
data.value = res
})
})
</script>

View File

@ -19,9 +19,18 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="(item, i) in list" :key="i">
<Item :type="0" :item="item" :options="[1]"> </Item>
</view>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.job.name"
:status-text="item.promotion_status_text"
:status-color="statusFun(item.promotion_status, 'promotion_status', 'color')"
:body="[
{ label: '推荐人: ', value: item.invitor.name },
{ label: '申请时间: ', value: item.created_format },
]"
@click.stop="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -34,9 +43,18 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="(item, i) in list" :key="i">
<Item :type="1" :item="item" :options="[2]"> </Item>
</view>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.job.name"
:status-text="item.promotion_status_text"
:status-color="statusFun(item.promotion_status, 'promotion_status', 'color')"
:body="[
{ label: '申请人: ', value: item.employee.name },
{ label: '申请时间: ', value: item.created_format },
]"
@click.stop="applyDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -50,28 +68,19 @@
>
<template v-slot="{ list }">
<view class="space-y-15rpx p-base">
<view v-for="item in list" :key="item.id" @click="checkDetail(item)" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx">
<view class="flex items-center justify-between">
<view class="text-30rpx"> {{ item.check.subject.job.name }}</view>
<view class="text-24rpx" :style="{ color: statusFun(item.check_status, 'statusExpense', 'color')}">{{ item.check_status_text }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">推荐人</view>
<view class="">{{ item.check.subject.invitor.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">申请人</view>
<view class="">{{ item.check.subject.employee.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">晋升职位</view>
<view class="">{{ item.check.subject.job.name }}</view>
</view>
<view class="text-24rpx text-hex-999999 flex">
<view class="w-140rpx">申请时间: </view>
<view class="">{{ item.created_format }}</view>
</view>
</view>
<ListItem
v-for="item in list"
:key="item.id"
:title="item.check.subject.job.name"
:status-text="item.check_status_text"
:status-color="statusFun(item.check_status, 'statusExpense', 'color')"
:body="[
{ label: '申请人: ', value: item.check.subject.employee.name },
{ label: '推荐人: ', value: item.check.subject.invitor.name },
{ label: '申请时间: ', value: item.check.subject.created_format },
]"
@click.stop="checkDetail(item)"
/>
</view>
</template>
</MescrollItem>
@ -83,9 +92,9 @@ import { ref } from 'vue'
import { onPageScroll, onReachBottom, onShow } 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'
import { onLoad } from '@dcloudio/uni-app'
import statusFun from '@/utils/status'
import ListItem from '@/components/list-item/index'
const tabList = ref([
{
@ -132,6 +141,22 @@ const tabChange = ({ index }) => {
scrollToLastY()
}
const applyDetail = (item) => {
let url = ''
const tab = tabIndex.value
if (
(tab == 0 && item.promotion_status == 1) ||
(tab == 1 && item.promotion_status == 2)
) {
url = `/pages/work/create?id=${item.id}&type=${tab}`
} else if (tab === 2) {
url = `/pages/audits/detail?id=${item.id}`
} else {
url = `/pages/work/detail?id=${item.id}`
}
return uni.navigateTo({url})
}
const checkDetail = (item) => {
uni.navigateTo({
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`