请假详情
This commit is contained in:
parent
3c1c9e9b7f
commit
d510a9a734
2
env/.env.development
vendored
2
env/.env.development
vendored
@ -4,5 +4,5 @@ NODE_ENV = 'development'
|
||||
VITE_DELETE_CONSOLE = false
|
||||
# 是否开启sourcemap
|
||||
VITE_SHOW_SOURCEMAP = true
|
||||
VITE_SERVER_BASEURL = 'http://10.75.15.247:8080/jeecg-boot'
|
||||
VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
|
||||
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
@ -47,4 +47,22 @@ export function countByOrgApi(params : object) {
|
||||
method: 'GET',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/*通过id查询请假数据*/
|
||||
export function queryByIdApi(id : string) {
|
||||
return http({
|
||||
url: '/CxcQxj/cxcQxj/queryById',
|
||||
method: 'GET',
|
||||
data: { id }
|
||||
})
|
||||
}
|
||||
|
||||
/*销假*/
|
||||
export function editApi(config : object ) {
|
||||
return http({
|
||||
url: '/CxcQxj/cxcQxj/edit',
|
||||
method: 'PUT',
|
||||
data: config
|
||||
})
|
||||
}
|
@ -103,8 +103,9 @@
|
||||
const minEndtime = ref(0)
|
||||
/**返回的最新一条请假结束时间*/
|
||||
const resDate = ref('')
|
||||
const uploadUrl = ref(getEnvBaseUrl() + '/sys/common/upload?appPath=职工请假/' + userStore.userInfo.department + '/' +
|
||||
userStore.userInfo.realname)
|
||||
const loading = ref(false)
|
||||
const uploadUrl = getEnvBaseUrl() + '/sys/common/upload?appPath=职工请假/' + userStore.userInfo.department + '/' +
|
||||
userStore.userInfo.realname
|
||||
const columnChange = ({
|
||||
selectedItem,
|
||||
resolve,
|
||||
@ -154,6 +155,7 @@
|
||||
}
|
||||
|
||||
const handleSubmit = () => {
|
||||
if(loading.value) return
|
||||
form.value.validate().then(({
|
||||
valid,
|
||||
errors
|
||||
@ -176,6 +178,7 @@
|
||||
title: '提示',
|
||||
})
|
||||
.then(() => {
|
||||
loading.value = true
|
||||
addApi(submitData).then(res => {
|
||||
if (res.success) {
|
||||
startMutilProcess(res.message)
|
||||
@ -184,7 +187,9 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
128
src/pages-humanResource/absence/detail.vue
Normal file
128
src/pages-humanResource/absence/detail.vue
Normal file
@ -0,0 +1,128 @@
|
||||
<route lang="json5" type="page">
|
||||
{
|
||||
layout: 'default',
|
||||
style: {
|
||||
navigationStyle: 'custom',
|
||||
navigationBarTitleText: '请假详情',
|
||||
},
|
||||
}
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="请假详情">
|
||||
<wd-cell-group border>
|
||||
<wd-cell title="职工姓名" :value="info.username_dictText" />
|
||||
<wd-cell title="所属单位" :value="info.sysOrgCode_dictText" />
|
||||
<wd-cell title="联系方式" :value="info.phone" />
|
||||
<wd-cell title="请假类型" :value="info.type" />
|
||||
<wd-cell title="请假开始时间" :value="info.begintime" />
|
||||
<wd-cell title="请假结束时间" :value="info.endtime" />
|
||||
<wd-cell title="请假天数" :value="info.days + '天'" />
|
||||
<wd-cell title="出发地" :value="info.departure" />
|
||||
<wd-cell title="目的地" :value="info.destination" />
|
||||
<wd-cell title="请假原因" :value="info.reason" />
|
||||
<wd-cell title="附件" v-if="info.path">
|
||||
<template v-for="(img, index) in joy" :key="index">
|
||||
<wd-img :width="100" :height="100" :src="img" :enable-preview="true" />
|
||||
</template>
|
||||
</wd-cell>
|
||||
<wd-cell title="销假时间" :value="info.resumptiontime" v-if="info.resumptiontime && info.bpmStatus == '3'" />
|
||||
<view v-if="!info.resumptiontime && info.bpmStatus == '3'">
|
||||
<wd-calendar label="销假时间" prop="resumptiontime" v-model="resumptiontime" :min-date="minDate"/>
|
||||
<view class="footer">
|
||||
<wd-button type="primary" size="large" @click="handleSubmit" block>销假</wd-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</wd-cell-group>
|
||||
</PageLayout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
useMessage,
|
||||
useToast
|
||||
} from 'wot-design-uni'
|
||||
import {
|
||||
queryByIdApi,
|
||||
editApi
|
||||
} from '@/api/humanResource/absence'
|
||||
import {
|
||||
imgUrl
|
||||
} from '@/utils/index'
|
||||
import {
|
||||
useUserStore
|
||||
} from '@/store/user'
|
||||
|
||||
const message = useMessage()
|
||||
const toast = useToast()
|
||||
const userStore = useUserStore();
|
||||
const info = ref({})
|
||||
const path = ref([])
|
||||
const joy = ref([])
|
||||
const resumptiontime = ref(0)
|
||||
const minDate = ref(0)
|
||||
const queryById = (e) => {
|
||||
queryByIdApi(e).then((res) => {
|
||||
if (res.success) {
|
||||
info.value = res.result.records[0]
|
||||
minDate.value = dateStringToTimestamp(info.value.begintime)
|
||||
joy.value = info.value.path.split(',').map(path => imgUrl(path))
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleSubmit = () => {
|
||||
if (!resumptiontime.value) return toast.warning('请选择销假时间!')
|
||||
editApi({
|
||||
id: info.value.id,
|
||||
begintime: formatDate(info.value.begintime),
|
||||
endtime: formatDate(info.value.endtime),
|
||||
resumptiontime: formatDate(resumptiontime.value),
|
||||
type: info.value.type
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
toast.success(res.message)
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 1000)
|
||||
} else {
|
||||
toast.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function formatDate(date) {
|
||||
date = new Date(date)
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 将日期字符串转换为13位时间戳(支持yyyymmdd和yyyy-mm-dd格式)
|
||||
* @param {string} dateStr
|
||||
* @returns {number} 13位时间戳(毫秒)
|
||||
*/
|
||||
function dateStringToTimestamp(dateStr) {
|
||||
const date = new Date();
|
||||
const normalized = dateStr.replace(/-/g, '');
|
||||
date.setFullYear(
|
||||
parseInt(normalized.substring(0, 4)),
|
||||
parseInt(normalized.substring(4, 6)) - 1,
|
||||
parseInt(normalized.substring(6, 8))
|
||||
);
|
||||
date.setHours(0, 0, 0, 0);
|
||||
return date.getTime();
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
queryById(options.id)
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.footer {
|
||||
padding: 12px;
|
||||
}
|
||||
</style>
|
@ -9,7 +9,7 @@
|
||||
</route>
|
||||
<template>
|
||||
<PageLayout navTitle="请假信息">
|
||||
<wd-card>
|
||||
<wd-card style="margin-top: 10px;">
|
||||
<wd-row>
|
||||
<wd-col :span="12"><uni-title title="所属单位" align="left" type="h5"></uni-title></wd-col>
|
||||
<wd-col :span="12"><uni-title title="重置" align="right" type="h5" color="#666666"
|
||||
@ -17,7 +17,8 @@
|
||||
</wd-row>
|
||||
<wd-row>
|
||||
<wd-col :span="24">
|
||||
|
||||
<SelectDept label="" v-model="orgCode" @change="Search" rowKey="orgCode" :multiple="false">
|
||||
</SelectDept>
|
||||
</wd-col>
|
||||
</wd-row>
|
||||
<wd-row>
|
||||
@ -42,7 +43,7 @@
|
||||
</wd-row>
|
||||
<l-echart ref="chart" />
|
||||
</wd-card>
|
||||
<view v-for="(item, i) in list" :key="i">
|
||||
<view v-for="(item, i) in list" :key="i" @click="jump(`./detail?id=${item.id}`)">
|
||||
<wd-card :title="item.username_dictText+'的'+item.type+'申请'">
|
||||
<view class="card-content">
|
||||
<view class="meta-info">
|
||||
@ -58,15 +59,12 @@
|
||||
</PageLayout>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
listApi,
|
||||
countByOrgApi
|
||||
} from '@/api/humanResource/absence'
|
||||
import * as echarts from 'echarts';
|
||||
import SelectDept from '@/components/SelectDept/SelectDept'
|
||||
const chart = ref(null);
|
||||
const chartOption = ref({});
|
||||
const list = ref([]) //请假信息列表
|
||||
@ -75,13 +73,14 @@
|
||||
const type = ref('') //图表点击事件 请假类别
|
||||
const range = ref([]) //日期查询
|
||||
const timeout = ref(null)
|
||||
const orgCode = ref('')
|
||||
let pageNo = 1
|
||||
let pageSize = 10
|
||||
let loading = false
|
||||
|
||||
const queryLeave = (e) => {
|
||||
let param = {
|
||||
// sysOrgCode: orgCode.value,
|
||||
sysOrgCode: orgCode.value,
|
||||
begin: range.value[0],
|
||||
end: range.value[1],
|
||||
type: type.value,
|
||||
@ -158,7 +157,7 @@
|
||||
}
|
||||
|
||||
function reset() {
|
||||
// orgCode.value = null
|
||||
orgCode.value = ''
|
||||
range.value = []
|
||||
type.value = ''
|
||||
// username.value = ''
|
||||
@ -167,6 +166,12 @@
|
||||
queryLeave()
|
||||
}
|
||||
|
||||
const jump = (url) => {
|
||||
uni.navigateTo({
|
||||
url: url
|
||||
});
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
getList()
|
||||
});
|
||||
|
@ -25,12 +25,6 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref
|
||||
} from 'vue'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app';
|
||||
import {
|
||||
useAppStore
|
||||
} from '@/store'
|
||||
|
@ -39,8 +39,7 @@
|
||||
<script setup>
|
||||
import {
|
||||
onLoad,
|
||||
onReachBottom,
|
||||
onPullDownRefresh
|
||||
onReachBottom
|
||||
} from '@dcloudio/uni-app'
|
||||
import {
|
||||
queryDocumentApi,
|
||||
@ -202,13 +201,6 @@
|
||||
getList(1)
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
pageNo = 1
|
||||
list.value = []
|
||||
getList(1)
|
||||
uni.stopPullDownRefresh()
|
||||
})
|
||||
|
||||
onLoad((options) => {
|
||||
type.value = options.title
|
||||
getList(1)
|
||||
|
@ -336,6 +336,15 @@
|
||||
"navigationBarTitleText": "请假申请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "absence/detail",
|
||||
"type": "page",
|
||||
"layout": "default",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "请假详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "absence/index",
|
||||
"type": "page",
|
||||
|
1
src/types/uni-pages.d.ts
vendored
1
src/types/uni-pages.d.ts
vendored
@ -32,6 +32,7 @@ interface NavigateToOptions {
|
||||
"/pages-operate/file/index" |
|
||||
"/pages-operate/sc/index" |
|
||||
"/pages-humanResource/absence/add" |
|
||||
"/pages-humanResource/absence/detail" |
|
||||
"/pages-humanResource/absence/index" |
|
||||
"/pages-integrated/duty/index" |
|
||||
"/pages-politics/health/add" |
|
||||
|
@ -420,4 +420,8 @@ function weatherRequest(params : { lat ?: number; lon ?: number; q ?: string })
|
||||
// })
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
export const imgUrl = (url : string) => {
|
||||
return getEnvBaseUrl() + '/sys/common/static/' + `/${url}`
|
||||
}
|
Loading…
Reference in New Issue
Block a user