main
commit
4a45fb37ed
|
|
@ -178,6 +178,7 @@ const onSubmit = async () => {
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
|
@ -98,6 +98,14 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
onPageScroll,
|
onPageScroll,
|
||||||
onReachBottom
|
onReachBottom
|
||||||
)
|
)
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
uni.$on('refresh', () => {
|
||||||
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const goPath = (url) => {
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ export default {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "申请时间",
|
title: "申请时间",
|
||||||
dataIndex: "check.subject.created_at_format"
|
dataIndex: "check.subject.created_format"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '报销分类',
|
title: '报销分类',
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,11 @@ const onConfirm = async () => {
|
||||||
status: !modelOptions.isValue,
|
status: !modelOptions.isValue,
|
||||||
remarks: modelOptions.isValue ? value.value : '',
|
remarks: modelOptions.isValue ? value.value : '',
|
||||||
})
|
})
|
||||||
uni.$emit('audits:onRefresh')
|
uni.$emit('refresh', { index: 'check' })
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {}
|
} catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onTg = () => {
|
const onTg = () => {
|
||||||
|
|
|
||||||
|
|
@ -3,43 +3,23 @@
|
||||||
<CuNavbar title="审核流程"></CuNavbar>
|
<CuNavbar title="审核流程"></CuNavbar>
|
||||||
<view class="card-shadow bg-white p-base">
|
<view class="card-shadow bg-white p-base">
|
||||||
<uv-steps direction="column">
|
<uv-steps direction="column">
|
||||||
<uv-steps-item
|
<uv-steps-item v-for="item in list" :key="item.id">
|
||||||
v-for="item in list"
|
|
||||||
:key="item.id"
|
|
||||||
:title="item.check_status_text"
|
|
||||||
:desc="timeFormat(item.checked_at, 'yyyy-mm-dd hh:MM:ss')"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<view
|
<view class="w-31rpx h-31rpx rounded-full mt-4rpx" :class="[item.check_status == 2 || item.check_status == 3? 'bg-blue': 'bg-gray-300']"></view>
|
||||||
class="w-31rpx h-31rpx rounded-full mt-4rpx"
|
|
||||||
:class="[
|
|
||||||
item.check_status == 2 || item.check_status == 3
|
|
||||||
? 'bg-blue'
|
|
||||||
: 'bg-gray-300',
|
|
||||||
]"
|
|
||||||
></view>
|
|
||||||
</template>
|
</template>
|
||||||
<template #title>
|
<template #title>
|
||||||
<view class="space-y-6rpx">
|
<view class="space-y-6rpx">
|
||||||
<view class="flex items-center space-x-14rpx">
|
<view class="flex items-center space-x-14rpx">
|
||||||
<view> {{ item.check_user ? item.check_user.name : item.check_name }}</view>
|
<view> {{ item.check_user ? item.check_user.name : item.check_name }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view v-if="item.check_status > 1" class="text-26rpx" :style="{ color: statusFun(item.check_status, 'statusExpense', 'color')}">
|
||||||
class="text-24rpx"
|
{{ item.check_status == 2 ? '待审核' : item.check_status_text }}
|
||||||
:style="{
|
</view>
|
||||||
color: statusFun(item.check_status, 'statusExpense', 'color'),
|
<view class="text-26rpx text-red" v-if="item.check_status == 4">{{item.remarks}}</view>
|
||||||
}"
|
|
||||||
>{{ item.check_status_text }}</view
|
|
||||||
>
|
|
||||||
<view class="text-24rpx text-hex-999" v-if="item.check_status == 4">{{
|
|
||||||
item.remarks
|
|
||||||
}}</view>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<template #desc>
|
<template #desc>
|
||||||
<view v-if="item.checked_at" class="text-22rpx text-hex-999">
|
<view v-if="item.checked_at" class="text-26rpx text-hex-999">{{ item.checked_format }}</view>
|
||||||
{{ timeFormat(item.checked_at, 'yyyy-mm-dd hh:MM:ss') }}
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
</uv-steps-item>
|
</uv-steps-item>
|
||||||
</uv-steps>
|
</uv-steps>
|
||||||
|
|
@ -54,12 +34,9 @@ import { computed, ref } from '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'
|
||||||
const list = ref([])
|
const list = ref([])
|
||||||
// const currentStop = computed(()=>list.value.filter(e=>e.check_status>=3))
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
http
|
http.get(`/workflow/${options.id}/logs`).then((res) => {
|
||||||
.get(`/workflow/${options.id}/logs`)
|
list.value = res
|
||||||
.then((res) => {
|
})
|
||||||
list.value = res
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ const onSubmit = async () => {
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 statusFun from "@/utils/status"
|
import statusFun from "@/utils/status"
|
||||||
|
|
@ -103,6 +103,13 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
onPageScroll,
|
onPageScroll,
|
||||||
onReachBottom
|
onReachBottom
|
||||||
)
|
)
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
uni.$on('refresh', () => {
|
||||||
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
})
|
||||||
|
})
|
||||||
const goPath = (url) => {
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
|
|
|
||||||
|
|
@ -11,18 +11,19 @@
|
||||||
<uv-input placeholder="请输入合同名称" inputAlign="right" :border="`none`" v-model="form.name"> </uv-input>
|
<uv-input placeholder="请输入合同名称" inputAlign="right" :border="`none`" v-model="form.name"> </uv-input>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<uv-form-item label="合同照片" labelPosition="top" prop="images" required>
|
<uv-form-item label="合同照片" prop="images" required>
|
||||||
<view class="w-full mt-15rpx">
|
<view class="text-right w-full text-hex-999">{{ form.images.length }}/{{ maxCount }}</view>
|
||||||
<uv-upload
|
|
||||||
:maxCount="9"
|
|
||||||
multiple
|
|
||||||
:fileList="form.images"
|
|
||||||
@afterRead="afterRead"
|
|
||||||
@delete="deletePic"
|
|
||||||
name="images"
|
|
||||||
></uv-upload>
|
|
||||||
</view>
|
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
|
<view class="w-full">
|
||||||
|
<uv-upload
|
||||||
|
:maxCount="maxCount"
|
||||||
|
multiple
|
||||||
|
:fileList="form.images"
|
||||||
|
@afterRead="afterRead"
|
||||||
|
@delete="deletePic"
|
||||||
|
name="images"
|
||||||
|
></uv-upload>
|
||||||
|
</view>
|
||||||
</uv-form>
|
</uv-form>
|
||||||
</view>
|
</view>
|
||||||
<uv-modal ref="modalRef" title="提示" content="确定提交吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
<uv-modal ref="modalRef" title="提示" content="确定提交吗?" @confirm="onSubmit" :showCancelButton="true"></uv-modal>
|
||||||
|
|
@ -37,6 +38,7 @@ const formRef = ref(null)
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const id = ref(0)
|
const id = ref(0)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const maxCount = ref(50)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
name: "",
|
name: "",
|
||||||
images: []
|
images: []
|
||||||
|
|
@ -100,7 +102,7 @@ const onSubmit = async () => {
|
||||||
})
|
})
|
||||||
form.images = []
|
form.images = []
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
uni.$emit("task:submit")
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
|
@ -100,6 +100,14 @@ const tabList = ref([
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
uni.$on('refresh', () => {
|
||||||
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const goPath = (url) => {
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ const onSubmit = async () => {
|
||||||
await http.post(`/train/examinations/${id.value}/answer`, {
|
await http.post(`/train/examinations/${id.value}/answer`, {
|
||||||
answers: answer.value,
|
answers: answer.value,
|
||||||
})
|
})
|
||||||
// uni.$emit('examination:onRefresh')
|
uni.$emit('examination:onRefresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ const { mescrollItem } = useMescrollComp(onPageScroll, onReachBottom)
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
uni.$on('examination:onRefresh', () => {
|
uni.$on('examination:onRefresh', () => {
|
||||||
mescrollItem.value?.refresh()
|
mescrollItem?.value?.refresh()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
v-for="item in list"
|
v-for="item in list"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:title="item.check.subject.type?.name"
|
:title="item.check.subject.type?.name"
|
||||||
:status-text="item.check_status_text"
|
:status-text="item.check_status == 2 ? '待审核' : item.check_status_text"
|
||||||
:status-color="statusFun(item.check_status,'statusExpense','color')"
|
:status-color="statusFun(item.check_status,'statusExpense','color')"
|
||||||
:body="[
|
:body="[
|
||||||
{ label: '申请人: ', value: item.check.subject.employee.name },
|
{ label: '申请人: ', value: item.check.subject.employee.name },
|
||||||
|
|
@ -74,10 +74,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 { timeFormat } from '@climblee/uv-ui/libs/function'
|
|
||||||
import statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
import ListItem from '@/components/list-item/index'
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
|
|
@ -103,6 +102,13 @@ const tabList = ref([
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
uni.$on('refresh', () => {
|
||||||
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
tabIndex.value = index
|
tabIndex.value = index
|
||||||
scrollToLastY()
|
scrollToLastY()
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,8 @@
|
||||||
labelPosition="left"
|
labelPosition="left"
|
||||||
>
|
>
|
||||||
<uv-form-item label="报销分类" required prop="reimbursement_type_id">
|
<uv-form-item label="报销分类" required prop="reimbursement_type_id">
|
||||||
<view
|
<view @click="openType" keyName="name" class="h-full w-full flex justify-end">
|
||||||
@click="openType"
|
<view :class="{'text-gray': !type.name }">{{ type.name ?? '请选择' }}</view>
|
||||||
keyName="name"
|
|
||||||
class="h-full w-full flex justify-end"
|
|
||||||
>
|
|
||||||
{{ type.name }}
|
|
||||||
<uv-icon name="arrow-right"></uv-icon>
|
<uv-icon name="arrow-right"></uv-icon>
|
||||||
</view>
|
</view>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
|
|
@ -29,6 +25,7 @@
|
||||||
type="digit"
|
type="digit"
|
||||||
input-align="right"
|
input-align="right"
|
||||||
v-model="form.expense"
|
v-model="form.expense"
|
||||||
|
@blur="handleBlurExpense"
|
||||||
></uv-input>
|
></uv-input>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
|
|
@ -94,6 +91,7 @@ const type = ref({})
|
||||||
const modalRef = ref(null)
|
const modalRef = ref(null)
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
|
const id = ref(null)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
reimbursement_type_id: '',
|
reimbursement_type_id: '',
|
||||||
expense: '',
|
expense: '',
|
||||||
|
|
@ -112,13 +110,7 @@ const rules = reactive({
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
type: 'number',
|
type: 'number',
|
||||||
min: 0.01,
|
min: 0,
|
||||||
max: 22,
|
|
||||||
message: '报销金额不能小于0.01',
|
|
||||||
},{
|
|
||||||
validator: (rule, value) => {
|
|
||||||
return value > 0
|
|
||||||
},
|
|
||||||
message: '报销金额不能小于0',
|
message: '报销金额不能小于0',
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
@ -132,8 +124,8 @@ const rules = reactive({
|
||||||
|
|
||||||
onLoad((e) => {
|
onLoad((e) => {
|
||||||
if (e.id) {
|
if (e.id) {
|
||||||
|
id.value = e.id
|
||||||
http.get(`reimbursements/${e.id}`).then(res => {
|
http.get(`reimbursements/${e.id}`).then(res => {
|
||||||
console.log(res)
|
|
||||||
type.value = res.type
|
type.value = res.type
|
||||||
form.reimbursement_type_id = res.reimbursement_type_id
|
form.reimbursement_type_id = res.reimbursement_type_id
|
||||||
form.expense = res.expense
|
form.expense = res.expense
|
||||||
|
|
@ -148,27 +140,36 @@ onLoad((e) => {
|
||||||
getTypes()
|
getTypes()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const handleBlurExpense = (e) => {
|
||||||
|
form.expense = Math.floor(e * 100) / 100
|
||||||
|
}
|
||||||
|
|
||||||
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 () => {
|
||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const resData = await http.post('/reimbursements', {
|
const params = {
|
||||||
reimbursement_type_id: form.reimbursement_type_id,
|
reimbursement_type_id: form.reimbursement_type_id,
|
||||||
expense: form.expense,
|
expense: form.expense,
|
||||||
reason: form.reason,
|
reason: form.reason,
|
||||||
photos: form.photos.map((item) => item.url),
|
photos: form.photos.map((item) => item.url),
|
||||||
})
|
}
|
||||||
|
if (id.value) {
|
||||||
|
await http.put(`/reimbursements/${id.value}`, params)
|
||||||
|
} else {
|
||||||
|
await http.post('/reimbursements', params)
|
||||||
|
}
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交成功',
|
title: '提交成功',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
uni.$emit('ex:submit', resData)
|
uni.$emit('refresh', { index: 0 })
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<CuNavbar title="补卡申请"> </CuNavbar>
|
<CuNavbar title="补卡申请">
|
||||||
|
</CuNavbar>
|
||||||
<view class="card-shadow px-base">
|
<view class="card-shadow px-base">
|
||||||
<uv-form
|
<uv-form labelPosition="left" :model="form" :rules="rules" ref="formRef" errorType="toast" labelWidth="250rpx">
|
||||||
labelPosition="left"
|
|
||||||
:model="form"
|
|
||||||
:rules="rules"
|
|
||||||
ref="formRef"
|
|
||||||
errorType="toast"
|
|
||||||
labelWidth="250rpx"
|
|
||||||
>
|
|
||||||
<uv-form-item required label="补卡时间" prop="date">
|
<uv-form-item required label="补卡时间" prop="date">
|
||||||
<uv-input
|
<uv-input
|
||||||
placeholder="请选择日期"
|
placeholder="请选择日期"
|
||||||
|
|
@ -22,14 +16,10 @@
|
||||||
</uv-input>
|
</uv-input>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<uv-form-item
|
<uv-form-item required label="补卡类型" prop="sign_time">
|
||||||
required
|
|
||||||
label="补卡类型"
|
|
||||||
@click="openPicker"
|
|
||||||
prop="sign_time"
|
|
||||||
>
|
|
||||||
<uv-input
|
<uv-input
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
|
@click="openPicker"
|
||||||
readonly
|
readonly
|
||||||
inputAlign="right"
|
inputAlign="right"
|
||||||
:border="`none`"
|
:border="`none`"
|
||||||
|
|
@ -38,19 +28,8 @@
|
||||||
</uv-input>
|
</uv-input>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<uv-form-item
|
<uv-form-item required label="补卡理由" prop="reason" labelPosition="top">
|
||||||
required
|
<uv-textarea v-model="form.reason" count placeholder="请输入" :border="`none`" :maxlength="200"></uv-textarea>
|
||||||
label="补卡理由"
|
|
||||||
prop="reason"
|
|
||||||
labelPosition="top"
|
|
||||||
>
|
|
||||||
<uv-textarea
|
|
||||||
v-model="form.reason"
|
|
||||||
count
|
|
||||||
placeholder="请输入"
|
|
||||||
:border="`none`"
|
|
||||||
:maxlength="200"
|
|
||||||
></uv-textarea>
|
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-line color="#f5f5f5"></uv-line>
|
<uv-line color="#f5f5f5"></uv-line>
|
||||||
<uv-form-item label="外勤" prop="isOutSide">
|
<uv-form-item label="外勤" prop="isOutSide">
|
||||||
|
|
@ -58,13 +37,7 @@
|
||||||
<uv-switch size="20" v-model="form.isOutSide"></uv-switch>
|
<uv-switch size="20" v-model="form.isOutSide"></uv-switch>
|
||||||
</view>
|
</view>
|
||||||
</uv-form-item>
|
</uv-form-item>
|
||||||
<uv-form-item
|
<uv-form-item v-if="form.isOutSide" required label="外勤事由" prop="outside_remarks" labelPosition="top">
|
||||||
v-if="form.isOutSide"
|
|
||||||
required
|
|
||||||
label="外勤事由"
|
|
||||||
prop="outside_remarks"
|
|
||||||
labelPosition="top"
|
|
||||||
>
|
|
||||||
<uv-textarea
|
<uv-textarea
|
||||||
v-model="form.outside_remarks"
|
v-model="form.outside_remarks"
|
||||||
count
|
count
|
||||||
|
|
@ -78,11 +51,7 @@
|
||||||
<view class="mt-20rpx px-base">
|
<view class="mt-20rpx px-base">
|
||||||
<uv-button type="primary" @click="submit">提交</uv-button>
|
<uv-button type="primary" @click="submit">提交</uv-button>
|
||||||
</view>
|
</view>
|
||||||
<uv-picker
|
<uv-picker ref="pickerRef" :columns="columns" @confirm="confirmPicker"></uv-picker>
|
||||||
ref="pickerRef"
|
|
||||||
:columns="columns"
|
|
||||||
@confirm="confirmPicker"
|
|
||||||
></uv-picker>
|
|
||||||
<uv-datetime-picker
|
<uv-datetime-picker
|
||||||
v-model="value"
|
v-model="value"
|
||||||
placeholder="请选择日期"
|
placeholder="请选择日期"
|
||||||
|
|
@ -92,22 +61,16 @@
|
||||||
@confirm="confirmDatePicker"
|
@confirm="confirmDatePicker"
|
||||||
>
|
>
|
||||||
</uv-datetime-picker>
|
</uv-datetime-picker>
|
||||||
<uv-modal
|
<uv-modal ref="modalRef" title="提示" content="确定提交吗?" @confirm="onSubmit" :showCancelButton="true"></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 CuNavbar from "@/components/cu-navbar/index"
|
||||||
import { ref, reactive, computed } from 'vue'
|
import { ref, reactive, computed } from "vue"
|
||||||
import { onLoad } from '@dcloudio/uni-app'
|
import { onLoad } from "@dcloudio/uni-app"
|
||||||
import { http } from '@/utils/request'
|
import { http } from "@/utils/request"
|
||||||
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
import { timeFormat } from "@climblee/uv-ui/libs/function/index"
|
||||||
const columns = [['上班补卡', '下班补卡']]
|
const columns = [["上班补卡", "下班补卡"]]
|
||||||
const formRef = ref(null)
|
const formRef = ref(null)
|
||||||
const datetimePicker = ref(null)
|
const datetimePicker = ref(null)
|
||||||
const pickerRef = ref(null)
|
const pickerRef = ref(null)
|
||||||
|
|
@ -116,11 +79,11 @@ const value = ref(Number(new Date()))
|
||||||
const id = ref(0)
|
const id = ref(0)
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
date: '',
|
date: "",
|
||||||
sign_time: '',
|
sign_time: "",
|
||||||
reason: '',
|
reason: "",
|
||||||
outside_remarks: '',
|
outside_remarks: "",
|
||||||
isOutSide: false,
|
isOutSide: false
|
||||||
})
|
})
|
||||||
const openPicker = () => {
|
const openPicker = () => {
|
||||||
pickerRef.value.open()
|
pickerRef.value.open()
|
||||||
|
|
@ -128,75 +91,72 @@ const openPicker = () => {
|
||||||
const openDatePicker = () => {
|
const openDatePicker = () => {
|
||||||
datetimePicker.value.open()
|
datetimePicker.value.open()
|
||||||
}
|
}
|
||||||
const confirmDatePicker = (e) => {
|
const confirmDatePicker = e => {
|
||||||
form.date = timeFormat(e.value, 'yyyy-mm-dd hh:MM')
|
form.date = timeFormat(e.value, "yyyy-mm-dd hh:MM")
|
||||||
}
|
}
|
||||||
const confirmPicker = (e) => {
|
const confirmPicker = e => {
|
||||||
form.sign_time = e.value[0]
|
form.sign_time = e.value[0]
|
||||||
}
|
}
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
date: [{ required: true, message: '请选择时间' }],
|
date: [{ required: true, message: "请选择时间" }],
|
||||||
sign_time: [{ required: true, message: '请选择类型' }],
|
sign_time: [{ required: true, message: "请选择类型" }],
|
||||||
reason: [{ required: true, message: '请输入补卡理由' }],
|
reason: [{ required: true, message: "请输入补卡理由" }],
|
||||||
outside_remarks: [{ required: true, message: '请输入补卡理由' }],
|
outside_remarks: [{ required: true, message: "请输入补卡理由" }]
|
||||||
})
|
})
|
||||||
onLoad((options) => {
|
onLoad(options => {
|
||||||
id.value = options.id
|
id.value = options.id
|
||||||
if (id.value) {
|
if (id.value) {
|
||||||
http
|
http
|
||||||
.request({
|
.request({
|
||||||
url: `/hr/sign-repairs/${options.id}`,
|
url: `/hr/sign-repairs/${options.id}`,
|
||||||
method: 'GET',
|
method: "GET",
|
||||||
header: {
|
header: {
|
||||||
Accept: 'application/json',
|
Accept: "application/json"
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then(res => {
|
||||||
value.value = res.date * 1000
|
value.value = res.date * 1000
|
||||||
form.date = timeFormat(res.date, 'yyyy-mm-dd hh:MM')
|
form.date = timeFormat(res.date, "yyyy-mm-dd hh:MM")
|
||||||
form.reason = res.reason
|
form.reason = res.reason
|
||||||
form.isOutSide = res.sign_type == 1 ? false : true
|
form.isOutSide = res.sign_type == 1 ? false : true
|
||||||
form.outside_remarks = res.outside_remarks
|
form.outside_remarks = res.outside_remarks
|
||||||
form.sign_time = res.sign_time == 1 ? '上班补卡' : '下班补卡'
|
form.sign_time = res.sign_time == 1 ? "上班补卡" : "下班补卡"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
formRef.value
|
formRef.value.validate().then(res => {
|
||||||
.validate()
|
modalRef.value.open()
|
||||||
.then((res) => {
|
}).catch(error => {})
|
||||||
modalRef.value.open()
|
|
||||||
})
|
|
||||||
.catch((error) => {})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const onSubmit = async () => {
|
const onSubmit = async () => {
|
||||||
if (loading.value) return
|
if (loading.value) return
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
let url = id.value ? `/hr/sign-repairs/${id.value}` : '/hr/sign-repairs'
|
let url = id.value ? `/hr/sign-repairs/${id.value}` : "/hr/sign-repairs"
|
||||||
let method = id.value ? 'PUT' : 'POST'
|
let method = id.value ? "PUT" : "POST"
|
||||||
await http.request({
|
await http.request({
|
||||||
url: url,
|
url: url,
|
||||||
method: method,
|
method: method,
|
||||||
header: {
|
header: {
|
||||||
Accept: 'application/json',
|
Accept: "application/json"
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
date: form.date,
|
date: form.date,
|
||||||
sign_time: form.sign_time == '上班补卡' ? 1 : 2,
|
sign_time: form.sign_time == "上班补卡" ? 1 : 2,
|
||||||
reason: form.reason,
|
reason: form.reason,
|
||||||
outside_remarks: form.outside_remarks,
|
outside_remarks: form.outside_remarks,
|
||||||
sign_type: form.isOutSide ? 2 : 1,
|
sign_type: form.isOutSide ? 2 : 1
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '提交成功',
|
title: "提交成功",
|
||||||
icon: 'none',
|
icon: "none"
|
||||||
})
|
})
|
||||||
uni.$emit('make-card:update')
|
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -101,8 +101,9 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
)
|
)
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
uni.$on('make-card:update', () => {
|
uni.$on('refresh', () => {
|
||||||
getMescroll(0).resetUpScroll()
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -176,6 +176,7 @@ const onSubmit = async () => {
|
||||||
icon: "none"
|
icon: "none"
|
||||||
})
|
})
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 statusFun from "@/utils/status"
|
import statusFun from "@/utils/status"
|
||||||
|
|
@ -101,6 +101,13 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
onPageScroll,
|
onPageScroll,
|
||||||
onReachBottom
|
onReachBottom
|
||||||
)
|
)
|
||||||
|
onLoad(() => {
|
||||||
|
uni.$on('refresh', () => {
|
||||||
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const goPath = (url) => {
|
const goPath = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url,
|
url,
|
||||||
|
|
|
||||||
|
|
@ -271,13 +271,8 @@ const onSubmit = async () => {
|
||||||
data: params,
|
data: params,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
uni.$emit('revert:submit', res)
|
uni.$emit('refresh')
|
||||||
getData()
|
uni.navigateBack()
|
||||||
uni.showToast({
|
|
||||||
title: '提交成功',
|
|
||||||
duration: 2000,
|
|
||||||
icon: 'none',
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
|
@ -98,6 +98,13 @@ const tabList = ref([
|
||||||
},
|
},
|
||||||
])
|
])
|
||||||
|
|
||||||
|
onLoad(() => {
|
||||||
|
uni.$on('refresh', () => {
|
||||||
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
const tabChange = ({ index }) => {
|
const tabChange = ({ index }) => {
|
||||||
tabIndex.value = index
|
tabIndex.value = index
|
||||||
scrollToLastY()
|
scrollToLastY()
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ const onSubmit = async () => {
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
uni.$emit('task:submit')
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -282,7 +282,7 @@ const onSubmit = async () => {
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
})
|
})
|
||||||
formRef.value.resetFields()
|
formRef.value.resetFields()
|
||||||
uni.$emit('work:submit')
|
uni.$emit('refresh')
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
|
||||||
|
|
@ -89,10 +89,9 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import CuNavbar from '@/components/cu-navbar/index'
|
import CuNavbar from '@/components/cu-navbar/index'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onPageScroll, onReachBottom, onShow } from '@dcloudio/uni-app'
|
import { onPageScroll, onReachBottom, 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 { onLoad } from '@dcloudio/uni-app'
|
|
||||||
import statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
import ListItem from '@/components/list-item/index'
|
import ListItem from '@/components/list-item/index'
|
||||||
|
|
||||||
|
|
@ -126,8 +125,10 @@ const { tabIndex, getMescroll, scrollToLastY } = useMescrollMore(
|
||||||
)
|
)
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
uni.$on('work:submit', () => {
|
uni.$on('refresh', () => {
|
||||||
getMescroll(tabIndex.value).resetUpScroll()
|
mescrollItem0?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem1?.value?.getMescroll()?.resetUpScroll()
|
||||||
|
mescrollItem2?.value?.getMescroll()?.resetUpScroll()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue