components list-item
parent
694af4c837
commit
54f34af5cf
|
|
@ -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>
|
||||||
|
|
@ -1,10 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="请假申请">
|
<CuNavbar title="请假申请"></CuNavbar>
|
||||||
<template #right>
|
|
||||||
<view class="text-24rpx text-white" @click="submit">提交</view>
|
|
||||||
</template>
|
|
||||||
</CuNavbar>
|
|
||||||
<view class="card-shadow px-base">
|
<view class="card-shadow px-base">
|
||||||
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
|
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
|
||||||
<uv-form-item required label="请假类别" prop="type_id">
|
<uv-form-item required label="请假类别" prop="type_id">
|
||||||
|
|
@ -47,6 +43,9 @@
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
</uv-form>
|
</uv-form>
|
||||||
</view>
|
</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-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
|
||||||
<uv-datetime-picker
|
<uv-datetime-picker
|
||||||
placeholder="请选择日期"
|
placeholder="请选择日期"
|
||||||
|
|
|
||||||
|
|
@ -1,50 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base" v-if="detail">
|
<view class="px-base" v-if="detail">
|
||||||
<CuNavbar title="请假详情">
|
<CuNavbar title="请假详情">
|
||||||
<template #right>
|
<template v-if="actions.length > 0" #right>
|
||||||
<uv-icon v-if="columns[0].length > 0" color="white" @click="open" name="more-dot-fill"></uv-icon>
|
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<BaseData :data="detail" :colums="columns" />
|
||||||
<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>
|
|
||||||
</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>
|
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -53,24 +17,42 @@ import CuNavbar from "@/components/cu-navbar/index"
|
||||||
import { http } from "@/utils/request"
|
import { http } from "@/utils/request"
|
||||||
import { onLoad } from "@dcloudio/uni-app"
|
import { onLoad } from "@dcloudio/uni-app"
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
import BaseData from '../audits/base-data'
|
||||||
|
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const columns = ref([[]])
|
const actions = ref([
|
||||||
|
{ name: '修改', value: 'edit' },
|
||||||
|
{ name: '删除', value: 'delete' },
|
||||||
|
])
|
||||||
const detail = ref()
|
const detail = ref()
|
||||||
const pickerRef = ref(null)
|
const pickerRef = ref(null)
|
||||||
const id = ref(0)
|
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 = () => {
|
const open = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
}
|
}
|
||||||
const confirmPicker = e => {
|
const confirmPicker = e => {
|
||||||
console.log(e)
|
if (e.value == 'edit') {
|
||||||
if (e.value[0] === "删除") {
|
return uni.navigateTo({
|
||||||
modalRef.value.open()
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/ask-leave/create?id=${id.value}`
|
url: `/pages/ask-leave/create?id=${id.value}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (e.value == 'delete') {
|
||||||
|
return modalRef.value.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -94,19 +76,12 @@ const onSubmit = async () => {
|
||||||
}
|
}
|
||||||
onLoad(options => {
|
onLoad(options => {
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
http
|
http.get(`/hr/holidays/${options.id}`).then(res => {
|
||||||
.request({
|
detail.value = res
|
||||||
url: `/hr/holidays/${options.id}`,
|
|
||||||
method: "GET",
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
detail.value = res
|
|
||||||
|
|
||||||
const options = []
|
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
|
||||||
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
|
actions.value = []
|
||||||
options.push('修改', '删除')
|
}
|
||||||
}
|
})
|
||||||
columns.value = [options]
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,7 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="请假申请">
|
<CuNavbar title="请假申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view
|
<view @click="goPath('/pages/ask-leave/create')" class="text-24rpx text-white">申请</view>
|
||||||
@click="goPath('/pages/ask-leave/create')"
|
|
||||||
class="text-24rpx text-white"
|
|
||||||
>申请</view
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -27,26 +23,18 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view
|
<ListItem
|
||||||
v-for="item in list" :key="item.id"
|
v-for="item in list" :key="item.id"
|
||||||
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
|
title="请假申请"
|
||||||
@click="applyDetail(item)"
|
:status-text="item.workflow_check.check_status_text"
|
||||||
>
|
:status-color="statusFun( item.workflow_check.check_status,'statusExpense','color')"
|
||||||
<view class="text-30rpx">请假申请</view>
|
:body="[
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{ label:'请假类型', value: item.type.name },
|
||||||
<view class="text-24rpx w-140rpx">请假类型</view>
|
{ label:'请假事由', value: item.reason },
|
||||||
<view class="">{{ item.type?.name }}</view>
|
{ label:'申请时间', value: item.created_format },
|
||||||
</view>
|
]"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
@click.stop="applyDetail(item)"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -60,30 +48,19 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view
|
<ListItem
|
||||||
v-for="item in list" :key="item.id"
|
v-for="item in list" :key="item.id"
|
||||||
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
|
title="请假申请"
|
||||||
@click="checkDetail(item)"
|
:status-text="item.check_status_text"
|
||||||
>
|
:status-color="statusFun( item.check_status,'statusExpense','color')"
|
||||||
<view class="text-30rpx">请假申请</view>
|
:body="[
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{ label:'申请人', value: item.check.subject.employee.name },
|
||||||
<view class="text-24rpx w-140rpx">申请人</view>
|
{ label:'请假类型', value: item.check.subject.type.name },
|
||||||
<view class="">{{ item.check.subject.employee.name }}</view>
|
{ label:'请假事由', value: item.check.subject.reason },
|
||||||
</view>
|
{ label:'申请时间', value: item.check.subject.created_format },
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
]"
|
||||||
<view class="text-24rpx w-140rpx">请假类型</view>
|
@click.stop="checkDetail(item)"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -96,6 +73,8 @@ 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 statusFun from '@/utils/status'
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: '我的请假',
|
name: '我的请假',
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base" v-if="detail">
|
<view class="px-base" v-if="detail">
|
||||||
<CuNavbar title="出差详情">
|
<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>
|
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<BaseData :data="detail" :colums="columns" />
|
||||||
<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>
|
|
||||||
</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>
|
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -63,23 +18,42 @@ import { http } from "@/utils/request"
|
||||||
import { onLoad } from "@dcloudio/uni-app"
|
import { onLoad } from "@dcloudio/uni-app"
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
||||||
|
import BaseData from '../audits/base-data'
|
||||||
|
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const columns = ref([[]])
|
const actions = ref([
|
||||||
const detail = 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 pickerRef = ref(null)
|
||||||
const id = ref(0)
|
const id = ref(0)
|
||||||
const open = () => {
|
const open = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
}
|
}
|
||||||
const confirmPicker = e => {
|
const confirmPicker = e => {
|
||||||
console.log(e)
|
if (e.value == 'edit') {
|
||||||
if (e.value[0] === "删除") {
|
return uni.navigateTo({
|
||||||
modalRef.value.open()
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/business/create?id=${id.value}`
|
url: `/pages/business/create?id=${id.value}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (e.value == 'delete') {
|
||||||
|
return modalRef.value.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -113,11 +87,9 @@ onLoad(options => {
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
detail.value = res
|
detail.value = res
|
||||||
const options = []
|
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
|
||||||
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
|
actions.value = []
|
||||||
options.push('修改', '删除')
|
|
||||||
}
|
}
|
||||||
columns.value = [options]
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -27,22 +27,18 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="text-30rpx">出差报备</view>
|
v-for="item in list" :key="item.id"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
title="出差报备"
|
||||||
<view class="text-24rpx w-120rpx text-right mr-20rpx">目的地:</view>
|
:status-text="item.workflow_check.check_status_text"
|
||||||
<view class="">{{ item.address }}</view>
|
:status-color="statusFun(item.workflow_check.check_status, 'statusExpense', 'color')"
|
||||||
</view>
|
:body="[
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{label: '目的地: ', value: item.address},
|
||||||
<view class="text-24rpx w-140rpx">出差事由:</view>
|
{label: '出差事由: ', value: item.reason},
|
||||||
<view class="">{{ item.reason }}</view>
|
{label: '申请时间: ', value: item.created_format},
|
||||||
</view>
|
]"
|
||||||
<view class="flex items-center text-hex-999999 flex">
|
@click="applyDetail(item)"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -57,26 +53,19 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="text-30rpx">出差报备</view>
|
v-for="item in list" :key="item.id"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
title="出差报备"
|
||||||
<view class="text-24rpx w-120rpx text-right mr-20rpx">申请人:</view>
|
:status-text="item.check_status_text"
|
||||||
<view class="">{{ item.check.subject.employee.name }}</view>
|
:status-color="statusFun(item.check_status, 'statusExpense', 'color')"
|
||||||
</view>
|
:body="[
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{label: '申请人: ', value: item.check.subject.employee.name},
|
||||||
<view class="text-24rpx w-120rpx text-right mr-20rpx">目的地:</view>
|
{label: '目的地: ', value: item.check.subject.address},
|
||||||
<view class="">{{ item.check.subject.address }}</view>
|
{label: '出差事由: ', value: item.check.subject.reason},
|
||||||
</view>
|
{label: '申请时间: ', value: item.check.subject.created_format},
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
]"
|
||||||
<view class="text-24rpx w-140rpx">出差事由:</view>
|
@click="checkDetail(item)"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -89,6 +78,8 @@ 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 statusFun from "@/utils/status"
|
||||||
|
import ListItem from '@/components/list-item'
|
||||||
|
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: '出差申请',
|
name: '出差申请',
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,17 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base" v-if="detail">
|
<view class="px-base" v-if="detail">
|
||||||
<CuNavbar title="合同详情">
|
<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>
|
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view
|
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
||||||
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 class="py-20rpx flex items-center justify-between">
|
|
||||||
<view>上传人</view>
|
<view>上传人</view>
|
||||||
<view class="text-hex-999999">{{ detail.employee.name }}</view>
|
<view class="text-hex-999999">{{ detail.employee.name }}</view>
|
||||||
</view>
|
</view>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<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 class="py-20rpx flex items-center justify-between">
|
||||||
<view>电话号码</view>
|
<view>电话号码</view>
|
||||||
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
|
<view class="text-hex-999999">{{ detail.employee.phone }}</view>
|
||||||
|
|
@ -55,21 +50,11 @@
|
||||||
<view v-if="detail.workflow_check.check_status == 4" class="py-20rpx">
|
<view v-if="detail.workflow_check.check_status == 4" class="py-20rpx">
|
||||||
<view>未通过原因</view>
|
<view>未通过原因</view>
|
||||||
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_remarks }}</view>
|
<view class="text-hex-999999 mt-20rpx">{{ detail.workflow_check.check_remarks }}</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<uv-picker
|
<uv-action-sheet ref="pickerRef" :actions="actions" @select="confirmPicker" />
|
||||||
ref="pickerRef"
|
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
||||||
:columns="columns"
|
|
||||||
@confirm="confirmPicker"
|
|
||||||
></uv-picker>
|
|
||||||
<uv-modal
|
|
||||||
ref="modalRef"
|
|
||||||
title="提示"
|
|
||||||
content="确定删除吗?"
|
|
||||||
@confirm="onSubmit"
|
|
||||||
:showCancelButton="true"
|
|
||||||
></uv-modal>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -78,23 +63,38 @@ import { http } from '@/utils/request'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
|
import BaseData from '../audits/base-data'
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const columns = ref([[]])
|
const actions = ref([
|
||||||
|
{ name: '修改', value: 'edit' },
|
||||||
|
{ name: '删除', value: 'delete' },
|
||||||
|
])
|
||||||
const detail = ref()
|
const detail = ref()
|
||||||
const pickerRef = ref(null)
|
const pickerRef = ref(null)
|
||||||
const id = ref(0)
|
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 = () => {
|
const open = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
}
|
}
|
||||||
const confirmPicker = (e) => {
|
const confirmPicker = (e) => {
|
||||||
console.log(e)
|
if (e.value == 'edit') {
|
||||||
if (e.value[0] === '删除') {
|
return uni.navigateTo({
|
||||||
modalRef.value.open()
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/contract/create?id=${id.value}`,
|
url: `/pages/contract/create?id=${id.value}`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (e.value == 'delete') {
|
||||||
|
return modalRef.value.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -128,11 +128,9 @@ onLoad((options) => {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
detail.value = res
|
detail.value = res
|
||||||
const options = []
|
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
|
||||||
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
|
actions.value = []
|
||||||
options.push('修改', '删除')
|
|
||||||
}
|
}
|
||||||
columns.value = [options]
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,7 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="我的合同">
|
<CuNavbar title="我的合同">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view
|
<view @click="goPath('/pages/contract/create')" class="text-24rpx text-white">上传</view>
|
||||||
@click="goPath('/pages/contract/create')"
|
|
||||||
class="text-24rpx text-white"
|
|
||||||
>上传</view
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -30,19 +26,17 @@
|
||||||
>
|
>
|
||||||
<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="applyDetail(item)">
|
<ListItem
|
||||||
<view class="flex items-center justify-between">
|
v-for="item in list" :key="item.id"
|
||||||
<view class="text-30rpx">{{ item.name }}</view>
|
:title="item.name"
|
||||||
</view>
|
:status-text="item.workflow_check.check_status_text"
|
||||||
<uv-scroll-list v-if="item.images" :indicator="false">
|
:status-color="statusFun(item.workflow_check.check_status,'statusExpense','color')"
|
||||||
<view class="space-x-15rpx flex">
|
:images="item.images"
|
||||||
<view v-for="(url, index) in item?.images ?? []" :key="index">
|
:body="[
|
||||||
<image :src="url + ''" mode="heightFix" style="height: 160rpx"></image>
|
{ label: '创建时间', value: item.created_format }
|
||||||
</view>
|
]"
|
||||||
</view>
|
@click.stop="applyDetail(item)"
|
||||||
</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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -57,25 +51,18 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<ListItem
|
||||||
<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)">
|
v-for="item in list" :key="item.id"
|
||||||
<view class="flex items-center justify-between">
|
:title="item.check.subject.name"
|
||||||
<view class="text-30rpx">{{ item.check.subject.name }}</view>
|
:status-text="item.check_status_text"
|
||||||
</view>
|
:status-color="statusFun(item.check_status,'statusExpense','color')"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
:images="item.check.subject.images"
|
||||||
<view class="text-24rpx w-120rpx text-right mr-20rpx">申请人:</view>
|
:body="[
|
||||||
<view class="">{{ item.check.subject.employee.name }}</view>
|
{ label: '创建人', value: item.check.subject.employee.name },
|
||||||
</view>
|
{ label: '创建时间', value: item.check.subject.created_format }
|
||||||
<uv-scroll-list v-if="item.check.subject.images" :indicator="false">
|
]"
|
||||||
<view class="space-x-15rpx flex">
|
@click.stop="checkDetail(item)"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -88,6 +75,7 @@ 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 statusFun from '@/utils/status'
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,8 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { http } from '@/utils/request'
|
import { http } from '@/utils/request'
|
||||||
|
|
||||||
const actionlist = ref([
|
const actionlist = ref([
|
||||||
{
|
{name: '修改', value: 'edit'},
|
||||||
name: '删除',
|
{name: '删除', value: 'delete'},
|
||||||
value: 'delete',
|
|
||||||
},
|
|
||||||
])
|
])
|
||||||
|
|
||||||
const colums = [
|
const colums = [
|
||||||
|
|
@ -58,7 +56,7 @@ const colums = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "申请时间",
|
title: "申请时间",
|
||||||
dataIndex: "created_at_format"
|
dataIndex: "created_format"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '报销分类',
|
title: '报销分类',
|
||||||
|
|
@ -96,7 +94,11 @@ const open = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const select = (e) => {
|
const select = (e) => {
|
||||||
console.log(e)
|
if (e.value == 'edit') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/expense-account/submit?id=${id.value}`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad((option) => {
|
onLoad((option) => {
|
||||||
|
|
@ -107,6 +109,9 @@ onLoad((option) => {
|
||||||
const getDetail = () => {
|
const getDetail = () => {
|
||||||
http.get(`/reimbursements/${id.value}`).then((res) => {
|
http.get(`/reimbursements/${id.value}`).then((res) => {
|
||||||
data.value = res
|
data.value = res
|
||||||
|
if ([2,3].indexOf(res.workflow_check.check_status) != -1) {
|
||||||
|
actionlist.value = []
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -25,26 +25,19 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="flex items-center justify-between">
|
v-for="item in list"
|
||||||
<view class="text-30rpx"> {{ item.type?.name }} </view>
|
:key="item.id"
|
||||||
<view :style="{color: statusFun(item.workflow_check?.check_status,'statusExpense','color'),}" class="text-24rpx">{{ item.workflow_check?.check_status_text }}</view>
|
:title="item.type?.name"
|
||||||
</view>
|
:status-text="item.workflow_check?.check_status_text"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
:status-color="statusFun(item.workflow_check?.check_status,'statusExpense','color')"
|
||||||
<view class="w-140rpx">报销金额</view>
|
:body="[
|
||||||
<view class="text-primary">{{ item.expense }}</view>
|
{ label: '报销金额: ', value: item.expense },
|
||||||
</view>
|
{ label: '报销原因: ', value: item.reason },
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{ label: '报销时间: ', value: item.created_format },
|
||||||
<view class="w-140rpx">报销时间</view>
|
]"
|
||||||
<view class="text-hex-333">{{ timeFormat(item.created_at) }}</view>
|
@click="applyDetail(item)"
|
||||||
</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>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -58,26 +51,20 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="flex items-center justify-between">
|
v-for="item in list"
|
||||||
<view class="text-30rpx"> {{ item.check.subject.type.name }} </view>
|
:key="item.id"
|
||||||
<view :style="{color: statusFun(item.check_status,'statusExpense','color'),}" class="text-24rpx">{{ item.check_status_text }}</view>
|
:title="item.check.subject.type?.name"
|
||||||
</view>
|
:status-text="item.check_status_text"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
:status-color="statusFun(item.check_status,'statusExpense','color')"
|
||||||
<view class="w-140rpx">报销金额</view>
|
:body="[
|
||||||
<view class="text-primary">{{ item.check.subject.expense }}</view>
|
{ label: '申请人: ', value: item.check.subject.employee.name },
|
||||||
</view>
|
{ label: '报销金额: ', value: item.check.subject.expense },
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{ label: '报销原因: ', value: item.check.subject.reason },
|
||||||
<view class="w-140rpx">报销时间</view>
|
{ label: '报销时间: ', value: item.check.subject.created_format },
|
||||||
<view class="text-hex-333">{{ timeFormat(item.check.subject.created_at) }}</view>
|
]"
|
||||||
</view>
|
@click="checkDetail(item)"
|
||||||
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -92,6 +79,7 @@ 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 { timeFormat } from '@climblee/uv-ui/libs/function'
|
||||||
import statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
@ -111,7 +99,7 @@ const tabList = ref([
|
||||||
{
|
{
|
||||||
name: '报销审核',
|
name: '报销审核',
|
||||||
apiUrl: '/workflow',
|
apiUrl: '/workflow',
|
||||||
params: { subject_type: 'reimbursements', include: 'check.subject.type' },
|
params: { subject_type: 'reimbursements', include: 'check.subject.type,check.subject.employee' },
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,7 @@
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<uv-form-item label="报销凭证" prop="photos" required>
|
<uv-form-item label="报销凭证" prop="photos" required>
|
||||||
<view class="text-right w-full text-hex-999"
|
<view class="text-right w-full text-hex-999">{{ form.photos.length }}/9</view>
|
||||||
>{{ form.photos.length }}/9</view
|
|
||||||
>
|
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<view class="w-full">
|
<view class="w-full">
|
||||||
<uv-upload
|
<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()
|
getTypes()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="补卡申请">
|
<CuNavbar title="补卡申请">
|
||||||
<template #right>
|
|
||||||
<view class="text-24rpx text-white" @click="submit">提交</view>
|
|
||||||
</template>
|
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view class="card-shadow px-base">
|
<view class="card-shadow px-base">
|
||||||
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
|
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
|
||||||
|
|
@ -51,6 +48,9 @@
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
</uv-form>
|
</uv-form>
|
||||||
</view>
|
</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-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
|
||||||
<uv-datetime-picker
|
<uv-datetime-picker
|
||||||
v-model="value"
|
v-model="value"
|
||||||
|
|
@ -128,7 +128,7 @@ onLoad(options => {
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
formRef.value.validate().then(res => {
|
formRef.value.validate().then(res => {
|
||||||
modalRef.value.open()
|
modalRef.value.open()
|
||||||
})
|
}).catch(error => {})
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base" v-if="detail">
|
<view class="px-base" v-if="detail">
|
||||||
<CuNavbar title="补卡详情">
|
<CuNavbar title="补卡详情">
|
||||||
<template v-if="!isEdit" #right>
|
<template v-if="actions.length > 0" #right>
|
||||||
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
||||||
<BaseData :colums="detailColumns" :data="detail"></BaseData>
|
<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>
|
</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>
|
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -74,11 +21,18 @@ import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
||||||
import BaseData from '@/pages/audits/base-data.vue'
|
import BaseData from '@/pages/audits/base-data.vue'
|
||||||
|
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const columns = [["修改", "删除"]]
|
const actions = ref([
|
||||||
|
{ name: '修改', value: 'edit' },
|
||||||
|
{ name: '删除', value: 'delete' },
|
||||||
|
])
|
||||||
const detail = ref()
|
const detail = ref()
|
||||||
const pickerRef = ref(null)
|
const pickerRef = ref(null)
|
||||||
const id = ref(0)
|
const id = ref(0)
|
||||||
const detailColumns = [
|
const detailColumns = [
|
||||||
|
{
|
||||||
|
title: "审核状态",
|
||||||
|
dataIndex: "workflow_check.check_status_text"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "申请人",
|
title: "申请人",
|
||||||
dataIndex: "employee.name"
|
dataIndex: "employee.name"
|
||||||
|
|
@ -122,13 +76,12 @@ const open = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
}
|
}
|
||||||
const confirmPicker = e => {
|
const confirmPicker = e => {
|
||||||
console.log(e)
|
if (e.value == 'edit') {
|
||||||
if (e.value[0] === "删除") {
|
|
||||||
modalRef.value.open()
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/make-card/create?id=${id.value}`
|
url: `/pages/make-card/create?id=${id.value}`
|
||||||
})
|
})
|
||||||
|
} else if (e.value == 'delete') {
|
||||||
|
modalRef.value.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
|
|
@ -153,16 +106,11 @@ const onSubmit = async () => {
|
||||||
}
|
}
|
||||||
onLoad(options => {
|
onLoad(options => {
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
http
|
http.get(`/hr/sign-repairs/${options.id}`).then(res => {
|
||||||
.request({
|
detail.value = res
|
||||||
url: `/hr/sign-repairs/${options.id}`,
|
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
|
||||||
method: "GET",
|
actions.value = []
|
||||||
header: {
|
}
|
||||||
Accept: "application/json"
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(res => {
|
|
||||||
detail.value = res
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,7 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="补卡申请">
|
<CuNavbar title="补卡申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view
|
<view @click="goPath('/pages/make-card/create')" class="text-24rpx text-white">申请</view>
|
||||||
@click="goPath('/pages/make-card/create')"
|
|
||||||
class="text-24rpx text-white"
|
|
||||||
>申请</view
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -27,9 +23,19 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<ListItem
|
||||||
<Item :item="item" :type="0"></Item>
|
v-for="item in list" :key="item.id"
|
||||||
</view>
|
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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -43,30 +49,20 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view
|
<ListItem
|
||||||
v-for="item in list" :key="item.id"
|
v-for="item in list" :key="item.id"
|
||||||
class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx"
|
title="补卡申请"
|
||||||
@click="checkDetail(item)"
|
:status-text="item.check_status_text"
|
||||||
>
|
:status-color="statusFun(item.check_status,'statusExpense','color')"
|
||||||
<view class="text-30rpx">补卡申请</view>
|
:body="[
|
||||||
<view class="text-24rpx text-hex-999999">
|
{ label: '申请人: ', value: item.check.subject.employee.name },
|
||||||
<text class="text-24rpx w-140rpx inline-block">申请人: </text>
|
{ label: '补卡时间: ', value: item.check.subject.date_format },
|
||||||
<text class="">{{ item.check.subject.employee.name }}</text>
|
{ label: '补卡类别: ', value: item.check.subject.sign_time_text },
|
||||||
</view>
|
{ label: '补卡原因: ', value: item.check.subject.reason },
|
||||||
<view class="text-24rpx text-hex-999999">
|
{ label: '申请时间: ', value: item.check.subject.created_format },
|
||||||
<text class="text-24rpx w-140rpx inline-block">补卡原因:</text>
|
]"
|
||||||
<text class="">{{ item.check.subject.reason }}</text>
|
@click.stop="checkDetail(item)"
|
||||||
</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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -78,8 +74,8 @@ import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow, onLoad } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, onShow, onLoad } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from '@/components/mescroll-api/more.vue'
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
import Item from './components/item.vue'
|
|
||||||
import statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: '我的补卡',
|
name: '我的补卡',
|
||||||
|
|
@ -120,6 +116,12 @@ const tabChange = ({ index }) => {
|
||||||
scrollToLastY()
|
scrollToLastY()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const applyDetail = (item) => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/make-card/detail?id=${item.id}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const checkDetail = (item) => {
|
const checkDetail = (item) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`,
|
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`,
|
||||||
|
|
|
||||||
|
|
@ -1,59 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base" v-if="detail">
|
<view class="px-base" v-if="detail">
|
||||||
<CuNavbar title="加班审核">
|
<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>
|
<uv-icon color="white" @click="open" name="more-dot-fill"></uv-icon>
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
||||||
<view class="py-20rpx flex items-center justify-between">
|
<BaseData :data="detail" :colums="columns" />
|
||||||
<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>
|
|
||||||
</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>
|
<uv-modal ref="modalRef" title="提示" content="确定删除吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -62,24 +17,42 @@ import CuNavbar from "@/components/cu-navbar/index"
|
||||||
import { http } from "@/utils/request"
|
import { http } from "@/utils/request"
|
||||||
import { onLoad } from "@dcloudio/uni-app"
|
import { onLoad } from "@dcloudio/uni-app"
|
||||||
import { ref } from "vue"
|
import { ref } from "vue"
|
||||||
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
import BaseData from '../audits/base-data'
|
||||||
|
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const columns = ref([[]])
|
const actions = ref([
|
||||||
const detail = ref()
|
{ name: '修改', value: 'edit' },
|
||||||
|
{ name: '删除', value: 'delete' },
|
||||||
|
])
|
||||||
|
const detail = ref({})
|
||||||
const pickerRef = ref(null)
|
const pickerRef = ref(null)
|
||||||
const id = ref(0)
|
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 = () => {
|
const open = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
}
|
}
|
||||||
const confirmPicker = e => {
|
const confirmPicker = e => {
|
||||||
console.log(e)
|
if (e.value == 'edit') {
|
||||||
if (e.value[0] === "删除") {
|
return uni.navigateTo({
|
||||||
modalRef.value.open()
|
|
||||||
} else {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/overtime/create?id=${id.value}`
|
url: `/pages/overtime/create?id=${id.value}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (e.value == 'delete') {
|
||||||
|
return modalRef.value.open()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
try {
|
try {
|
||||||
|
|
@ -113,11 +86,9 @@ onLoad(options => {
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
detail.value = res
|
detail.value = res
|
||||||
const options = []
|
if ([2, 3].indexOf(res.workflow_check.check_status) != -1) {
|
||||||
if ([1,4,5].indexOf(res.workflow_check.check_status) != -1) {
|
actions.value = []
|
||||||
options.push('修改', '删除')
|
|
||||||
}
|
}
|
||||||
columns.value = [options]
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,7 @@
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="加班申请">
|
<CuNavbar title="加班申请">
|
||||||
<template #right>
|
<template #right>
|
||||||
<view
|
<view @click="goPath('/pages/overtime/create')" class="text-24rpx text-white">申请</view>
|
||||||
@click="goPath('/pages/overtime/create')"
|
|
||||||
class="text-24rpx text-white"
|
|
||||||
>申请</view
|
|
||||||
>
|
|
||||||
</template>
|
</template>
|
||||||
</CuNavbar>
|
</CuNavbar>
|
||||||
<uv-sticky bgColor="#fff">
|
<uv-sticky bgColor="#fff">
|
||||||
|
|
@ -27,22 +23,19 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="text-30rpx">加班报备</view>
|
v-for="item in list" :key="item.id"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
title="加班报备"
|
||||||
<view class="text-24rpx w-140rpx">加班日期:</view>
|
:status-text="item.workflow_check.check_status_text"
|
||||||
<view class="">{{ item.date_format }}</view>
|
:status-color="statusFun( item.workflow_check.check_status,'statusExpense','color')"
|
||||||
</view>
|
:body="[
|
||||||
<view class="flex items-center text-hex-999999 flex">
|
{ label:'加班日期: ', value: item.date_format },
|
||||||
<view class="text-24rpx w-140rpx">加班时间:</view>
|
{ label:'加班时间: ', value: item.start_format + '-' + item.end_format },
|
||||||
<view class="text-24rpx">{{ item.start_format }} - {{ item.end_format }}</view>
|
{ label:'加班事由: ', value: item.reason },
|
||||||
</view>
|
{ label:'申请时间: ', value: item.created_format },
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
]"
|
||||||
<view class="text-24rpx w-140rpx">加班事由:</view>
|
@click.stop="applyDetail(item)"
|
||||||
<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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -57,26 +50,20 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="text-30rpx">加班报备</view>
|
v-for="item in list" :key="item.id"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
title="加班报备"
|
||||||
<view class="text-24rpx w-140rpx">申请人:</view>
|
:status-text="item.workflow_check.check_status_text"
|
||||||
<view class="">{{ item.check.subject.employee.name }}</view>
|
:status-color="statusFun( item.workflow_check.check_status,'statusExpense','color')"
|
||||||
</view>
|
:body="[
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{ label:'申请人: ', value: item.check.subject.employee.name },
|
||||||
<view class="text-24rpx w-140rpx">加班日期:</view>
|
{ label:'加班日期: ', value: item.check.subject.date_format },
|
||||||
<view class="">{{ item.check.subject.date_format }}</view>
|
{ label:'加班时间: ', value: item.check.subject.start_format + '-' + item.check.subject.end_format },
|
||||||
</view>
|
{ label:'加班事由: ', value: item.check.subject.reason },
|
||||||
<view class="flex items-center text-hex-999999 flex">
|
{ label:'申请时间: ', value: item.check.subject.created_format },
|
||||||
<view class="text-24rpx w-140rpx">加班时间:</view>
|
]"
|
||||||
<view class="text-24rpx">{{ item.check.subject.start_format }} - {{ item.check.subject.end_format }}</view>
|
@click.stop="checkDetail(item)"
|
||||||
</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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -89,6 +76,8 @@ 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 statusFun from "@/utils/status"
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
name: '我的加班',
|
name: '我的加班',
|
||||||
|
|
|
||||||
|
|
@ -1,51 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="px-base">
|
<view class="px-base">
|
||||||
<CuNavbar title="任务详情"></CuNavbar>
|
<CuNavbar title="任务详情"></CuNavbar>
|
||||||
<view
|
<view class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx">
|
||||||
class="mt-30rpx card-shadow bg-white rounded-19rpx px-base text-[#333333] text-27rpx"
|
<BaseData :data="data" :colums="baseColums" />
|
||||||
>
|
|
||||||
<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>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -54,7 +12,12 @@ import { onLoad } from '@dcloudio/uni-app'
|
||||||
import { http } from '@/utils/request'
|
import { http } from '@/utils/request'
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { timeFormat } from '@climblee/uv-ui/libs/function'
|
import { timeFormat } from '@climblee/uv-ui/libs/function'
|
||||||
|
import BaseData from '@/pages/audits/base-data'
|
||||||
const baseColums = [
|
const baseColums = [
|
||||||
|
{
|
||||||
|
title: '审核状态',
|
||||||
|
dataIndex: 'taskable.status_text',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '申请人',
|
title: '申请人',
|
||||||
dataIndex: 'taskable.store_master.name',
|
dataIndex: 'taskable.store_master.name',
|
||||||
|
|
@ -80,38 +43,20 @@ const baseColums = [
|
||||||
{
|
{
|
||||||
title: '清洁结果',
|
title: '清洁结果',
|
||||||
dataIndex: 'taskable.photos',
|
dataIndex: 'taskable.photos',
|
||||||
|
labelPosition: 'top',
|
||||||
|
type: 'album'
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
const id = ref(null)
|
const id = ref(null)
|
||||||
const data = ref({})
|
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) => {
|
onLoad((opt) => {
|
||||||
id.value = opt.id
|
id.value = opt.id
|
||||||
getDetail()
|
getDetail()
|
||||||
})
|
})
|
||||||
|
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
const resdata = await http.get(`/tasks/${id.value}`, {
|
const resdata = await http.get(`/tasks/${id.value}`)
|
||||||
params: {
|
|
||||||
id: id.value,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
data.value = resdata
|
data.value = resdata
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,16 +22,18 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="flex items-center justify-between">
|
v-for="item in list"
|
||||||
<view class="text-30rpx">{{ item.name }}</view>
|
:key="item.id"
|
||||||
<view class="text-24rpx" :style="{color: statusFun(item.taskable.status, 'task_hygienes' ,'color')}">{{ item.taskable.status_text }}</view>
|
:title="item.name"
|
||||||
</view>
|
:status-text="item.taskable.status_text"
|
||||||
<view class="text-24rpx text-hex-999999">
|
:status-color="statusFun(item.taskable.status, 'statusExpense' ,'color')"
|
||||||
任务时间:{{ timeFormat(item.start_at, 'yyyy年mm月dd日') }} -
|
:body="[
|
||||||
{{ timeFormat(item.end_at, 'yyyy年mm月dd日') }}
|
{label: '任务时间: ', value: item.start_format + '-' + item.end_format},
|
||||||
</view>
|
{label: '提交时间: ', value: item.created_format},
|
||||||
</view>
|
]"
|
||||||
|
@click.stop="applyClick(item)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -45,16 +47,18 @@
|
||||||
>
|
>
|
||||||
<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)">
|
<ListItem
|
||||||
<view class="flex items-center justify-between">
|
v-for="item in list"
|
||||||
<view class="text-30rpx">{{ item.check.subject.task.name }}</view>
|
:key="item.id"
|
||||||
<view class="text-24rpx" :style="{color: statusFun(item.check_status, 'statusExpense' ,'color')}">{{ item.check_status_text }}</view>
|
:title="item.check.subject.task.name"
|
||||||
</view>
|
:status-text="item.check_status_text"
|
||||||
<view class="text-24rpx text-hex-999999">
|
:status-color="statusFun(item.check_status, 'statusExpense' ,'color')"
|
||||||
任务时间:{{ timeFormat(item.check.subject.task.start_at, 'yyyy年mm月dd日') }} -
|
:body="[
|
||||||
{{ timeFormat(item.check.subject.task.end_at, 'yyyy年mm月dd日') }}
|
{label: '任务时间: ', value: item.check.subject.task.start_format + '-' + item.check.subject.task.end_format},
|
||||||
</view>
|
{label: '提交时间: ', value: item.check.subject.task.created_format},
|
||||||
</view>
|
]"
|
||||||
|
@click.stop="checkClick(item)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -68,6 +72,7 @@ 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 statusFun from '@/utils/status'
|
||||||
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
const mescrollItem0 = ref(null)
|
const mescrollItem0 = ref(null)
|
||||||
const mescrollItem1 = ref(null)
|
const mescrollItem1 = ref(null)
|
||||||
|
|
|
||||||
|
|
@ -22,25 +22,24 @@
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<uv-form-item
|
<uv-form-item
|
||||||
label="清洁结果"
|
label="清洁结果"
|
||||||
labelPosition="top"
|
|
||||||
prop="photos"
|
prop="photos"
|
||||||
required
|
required
|
||||||
>
|
>
|
||||||
<template #right>{{ form.photos.length }} / {{ maxCount }}</template>
|
<view class="text-right w-full text-hex-999">{{ form.photos.length }}/{{ maxCount }}</view>
|
||||||
<view class="w-full mt-15rpx">
|
|
||||||
<uv-upload
|
|
||||||
:maxCount="maxCount"
|
|
||||||
multiple
|
|
||||||
:fileList="form.photos"
|
|
||||||
@afterRead="afterRead"
|
|
||||||
@delete="deletePic"
|
|
||||||
name="photos"
|
|
||||||
></uv-upload>
|
|
||||||
</view>
|
|
||||||
</uv-form-item>
|
</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>
|
</uv-form>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-100rpx">
|
<view class="mt-20rpx">
|
||||||
<uv-button type="primary" @click="submit">提交</uv-button>
|
<uv-button type="primary" @click="submit">提交</uv-button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
@ -61,6 +60,7 @@ import { http } from '@/utils/request'
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const id = ref(0)
|
const id = ref(0)
|
||||||
|
const info = ref({})
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
description: '',
|
description: '',
|
||||||
|
|
@ -78,6 +78,7 @@ const rules = reactive({
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
http.get(`/tasks/${id.value}`).then(res => {
|
http.get(`/tasks/${id.value}`).then(res => {
|
||||||
|
info.value = res
|
||||||
if (res.taskable) {
|
if (res.taskable) {
|
||||||
form.description = res.taskable.description
|
form.description = res.taskable.description
|
||||||
if (res.taskable.photos && res.taskable.photos.length > 0) {
|
if (res.taskable.photos && res.taskable.photos.length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -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>
|
|
||||||
|
|
@ -1,15 +1,297 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
|
import BaseData from '../audits/base-data.vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import commone from './commone.vue'
|
import { http } from '@/utils/request'
|
||||||
import { ref } from 'vue'
|
import { ref, reactive, computed, onBeforeMount } from 'vue'
|
||||||
const id = ref(0)
|
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) => {
|
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>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,53 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
|
import BaseData from '../audits/base-data.vue'
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import commone from './commone.vue'
|
import commone from './commone.vue'
|
||||||
import { ref } from '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) => {
|
onLoad((options) => {
|
||||||
id.value = options.id
|
http.get(`/hr/promotion/${options.id}`).then(res => {
|
||||||
|
data.value = res
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,18 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<ListItem
|
||||||
<Item :type="0" :item="item" :options="[1]"> </Item>
|
v-for="item in list"
|
||||||
</view>
|
: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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -34,9 +43,18 @@
|
||||||
>
|
>
|
||||||
<template v-slot="{ list }">
|
<template v-slot="{ list }">
|
||||||
<view class="space-y-15rpx p-base">
|
<view class="space-y-15rpx p-base">
|
||||||
<view v-for="(item, i) in list" :key="i">
|
<ListItem
|
||||||
<Item :type="1" :item="item" :options="[2]"> </Item>
|
v-for="item in list"
|
||||||
</view>
|
: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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -50,28 +68,19 @@
|
||||||
>
|
>
|
||||||
<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" @click="checkDetail(item)" class="card-shadow bg-white rounded-19rpx p-base space-y-10rpx">
|
<ListItem
|
||||||
<view class="flex items-center justify-between">
|
v-for="item in list"
|
||||||
<view class="text-30rpx"> {{ item.check.subject.job.name }}</view>
|
:key="item.id"
|
||||||
<view class="text-24rpx" :style="{ color: statusFun(item.check_status, 'statusExpense', 'color')}">{{ item.check_status_text }}</view>
|
:title="item.check.subject.job.name"
|
||||||
</view>
|
:status-text="item.check_status_text"
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
:status-color="statusFun(item.check_status, 'statusExpense', 'color')"
|
||||||
<view class="w-140rpx">推荐人</view>
|
:body="[
|
||||||
<view class="">{{ item.check.subject.invitor.name }}</view>
|
{ label: '申请人: ', value: item.check.subject.employee.name },
|
||||||
</view>
|
{ label: '推荐人: ', value: item.check.subject.invitor.name },
|
||||||
<view class="text-24rpx text-hex-999999 flex">
|
{ label: '申请时间: ', value: item.check.subject.created_format },
|
||||||
<view class="w-140rpx">申请人</view>
|
]"
|
||||||
<view class="">{{ item.check.subject.employee.name }}</view>
|
@click.stop="checkDetail(item)"
|
||||||
</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>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
</MescrollItem>
|
</MescrollItem>
|
||||||
|
|
@ -83,9 +92,9 @@ import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
||||||
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
import useMescrollMore from '@/uni_modules/mescroll-uni/hooks/useMescrollMore.js'
|
||||||
import MescrollItem from '@/components/mescroll-api/more.vue'
|
import MescrollItem from '@/components/mescroll-api/more.vue'
|
||||||
import Item from './components/item.vue'
|
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from '@dcloudio/uni-app'
|
||||||
import statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
const tabList = ref([
|
const tabList = ref([
|
||||||
{
|
{
|
||||||
|
|
@ -132,6 +141,22 @@ const tabChange = ({ index }) => {
|
||||||
scrollToLastY()
|
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) => {
|
const checkDetail = (item) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`
|
url: `/pages/audits/detail?id=${item.id}&type=${item.check.subject_type}`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue