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