请假提交流程

This commit is contained in:
yangzhq68909 2025-05-16 18:04:04 +08:00
parent 3c54607ab7
commit 2c842209fa
3 changed files with 58 additions and 55 deletions

View File

@ -4,7 +4,5 @@ NODE_ENV = 'development'
VITE_DELETE_CONSOLE = false
# 是否开启sourcemap
VITE_SHOW_SOURCEMAP = true
#VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'

View File

@ -176,7 +176,6 @@
.pageContent {
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
background-color: #f1f1f1;

View File

@ -69,6 +69,9 @@
import {
getEnvBaseUrl
} from '@/utils/index'
import {
startMutilProcessApi
} from '@/api/process'
const message = useMessage()
const toast = useToast()
@ -174,12 +177,11 @@
})
.then(() => {
addApi(submitData).then(res => {
console.log('----', res)
// if (res.success) {
// startMutilProcess(res.message)
// } else {
toast.warning(res.message)
// }
if (res.success) {
startMutilProcess(res.message)
} else {
toast.warning(res.message)
}
})
})
.catch(() => {})
@ -187,6 +189,24 @@
})
}
const startMutilProcess = (id) => {
startMutilProcessApi({
flowCode: "dev_cxc_qxj",
id,
formUrl: "modules/qxj/modules/CxcQxjBpmModel",
formUrlMobile: "leaveApplication"
}).then((res) => {
if (res.success) {
toast.success(res.message)
setTimeout(() => {
uni.navigateBack()
}, 2000)
}
}).catch((err) => {
console.log(err);
})
}
function formatDate(date) {
date = new Date(date)
const year = date.getFullYear()
@ -226,10 +246,7 @@
examineleader.value = '审批领导';
}
} else {
uni.showToast({
title: res.message,
icon: 'error'
})
toast.warning(res.message)
setTimeout(() => {
handleClickLeft()
}, 1000)
@ -242,10 +259,7 @@
queryHisDateApi(userStore.userInfo.username).then(res => {
if (ress == '员工') { //
if (res.endtime != null && res.resumptiontime == null) {
uni.showToast({
title: '请先销假上一条请假信息!',
icon: 'error'
})
toast.warning('请先销假上一条请假信息!')
setTimeout(() => {
uni.navigateBack()
}, 2000)
@ -259,57 +273,49 @@
}
}
resDate.value = res.resumptiontime ? dateStringToTimestamp(res.resumptiontime) :
res.endtime ? dateStringToTimestamp(res.endtime, 1) : null
res.endtime ? dateStringToTimestamp(res.endtime, 2) : null
queryMinDate();
});
})
}
const queryMinDate = () => {
const today = new Date();
const threeMonthsAgo = new Date(today);
threeMonthsAgo.setMonth(today.getMonth() - 3);
if (resDate.value && model.type[model.type.length - 1] !== '干部离返濮报备') {
minBegintime.value = resDate.value;
} else {
minBegintime.value = threeMonthsAgo.getTime();
}
model.begintime = resDate.value ?
(resDate.value > dateStringToTimestamp() ? resDate.value : dateStringToTimestamp()) :
dateStringToTimestamp(null, 1);
minEndtime.value = model.begintime;
};
/**
* 将日期字符串转换为13位时间戳支持yyyymmdd和yyyy-mm-dd格式
* @param {string} dateStr
* @returns {number} 13位时间戳毫秒
*/
function dateStringToTimestamp(dateStr, flag) {
if (dateStr != null) {
const date = new Date();
if (flag === 1) {
date.setDate(date.getDate() + 1);
} else if (dateStr) {
const normalized = dateStr.replace(/-/g, '');
const year = parseInt(normalized.substring(0, 4));
const month = parseInt(normalized.substring(4, 6)) - 1;
const day = parseInt(normalized.substring(6, 8));
const date = new Date(year, month, day);
// flag1
if (flag === 1) {
date.setFullYear(
parseInt(normalized.substring(0, 4)),
parseInt(normalized.substring(4, 6)) - 1,
parseInt(normalized.substring(6, 8))
);
if (flag === 2) {
date.setDate(date.getDate() + 1);
}
return date.getTime();
} else { // dateStr
const today = new Date();
today.setHours(0, 0, 0, 0);
return today.getTime();
}
}
const queryMinDate = () => {
const today = new Date(); //
if (resDate.value) {
if (model.type[model.type.length - 1] != '干部离返濮报备') {
minBegintime.value = resDate.value;
} else {
const today = new Date(); //
const sixMonthsAgo = new Date(today);
sixMonthsAgo.setMonth(today.getMonth() - 3); // 3 min-date
minBegintime.value = sixMonthsAgo.getTime();
}
model.begintime = resDate.value > dateStringToTimestamp() ? resDate.value : dateStringToTimestamp()
} else {
const today = new Date(); //
const sixMonthsAgo = new Date(today);
sixMonthsAgo.setMonth(today.getMonth() - 3); // 3 min-date
minBegintime.value = sixMonthsAgo.getTime();
// resDate
model.begintime = dateStringToTimestamp()
}
minEndtime.value = model.begintime
date.setHours(0, 0, 0, 0);
return date.getTime();
}
const begintimeConfirm = () => {