请假提交流程
This commit is contained in:
parent
3c54607ab7
commit
2c842209fa
6
env/.env.development
vendored
6
env/.env.development
vendored
@ -4,7 +4,5 @@ NODE_ENV = 'development'
|
|||||||
VITE_DELETE_CONSOLE = false
|
VITE_DELETE_CONSOLE = false
|
||||||
# 是否开启sourcemap
|
# 是否开启sourcemap
|
||||||
VITE_SHOW_SOURCEMAP = true
|
VITE_SHOW_SOURCEMAP = true
|
||||||
|
VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
|
||||||
#VITE_SERVER_BASEURL = 'http://10.75.15.249:8080/jeecg-boot'
|
#VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
||||||
|
|
||||||
VITE_SERVER_BASEURL = 'https://36.112.48.190/jeecg-boot'
|
|
@ -176,7 +176,6 @@
|
|||||||
|
|
||||||
.pageContent {
|
.pageContent {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
overflow: hidden;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background-color: #f1f1f1;
|
background-color: #f1f1f1;
|
||||||
|
@ -69,6 +69,9 @@
|
|||||||
import {
|
import {
|
||||||
getEnvBaseUrl
|
getEnvBaseUrl
|
||||||
} from '@/utils/index'
|
} from '@/utils/index'
|
||||||
|
import {
|
||||||
|
startMutilProcessApi
|
||||||
|
} from '@/api/process'
|
||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
@ -174,12 +177,11 @@
|
|||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
addApi(submitData).then(res => {
|
addApi(submitData).then(res => {
|
||||||
console.log('----', res)
|
if (res.success) {
|
||||||
// if (res.success) {
|
startMutilProcess(res.message)
|
||||||
// startMutilProcess(res.message)
|
} else {
|
||||||
// } else {
|
|
||||||
toast.warning(res.message)
|
toast.warning(res.message)
|
||||||
// }
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.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) {
|
function formatDate(date) {
|
||||||
date = new Date(date)
|
date = new Date(date)
|
||||||
const year = date.getFullYear()
|
const year = date.getFullYear()
|
||||||
@ -226,10 +246,7 @@
|
|||||||
examineleader.value = '审批领导';
|
examineleader.value = '审批领导';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
toast.warning(res.message)
|
||||||
title: res.message,
|
|
||||||
icon: 'error'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
handleClickLeft()
|
handleClickLeft()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
@ -242,10 +259,7 @@
|
|||||||
queryHisDateApi(userStore.userInfo.username).then(res => {
|
queryHisDateApi(userStore.userInfo.username).then(res => {
|
||||||
if (ress == '员工') { // 员工需要先销假,才能新增请假信息
|
if (ress == '员工') { // 员工需要先销假,才能新增请假信息
|
||||||
if (res.endtime != null && res.resumptiontime == null) {
|
if (res.endtime != null && res.resumptiontime == null) {
|
||||||
uni.showToast({
|
toast.warning('请先销假上一条请假信息!')
|
||||||
title: '请先销假上一条请假信息!',
|
|
||||||
icon: 'error'
|
|
||||||
})
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 2000)
|
}, 2000)
|
||||||
@ -259,57 +273,49 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
resDate.value = res.resumptiontime ? dateStringToTimestamp(res.resumptiontime) :
|
resDate.value = res.resumptiontime ? dateStringToTimestamp(res.resumptiontime) :
|
||||||
res.endtime ? dateStringToTimestamp(res.endtime, 1) : null
|
res.endtime ? dateStringToTimestamp(res.endtime, 2) : null
|
||||||
queryMinDate();
|
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格式)
|
* 将日期字符串转换为13位时间戳(支持yyyymmdd和yyyy-mm-dd格式)
|
||||||
* @param {string} dateStr
|
* @param {string} dateStr
|
||||||
* @returns {number} 13位时间戳(毫秒)
|
* @returns {number} 13位时间戳(毫秒)
|
||||||
*/
|
*/
|
||||||
function dateStringToTimestamp(dateStr, flag) {
|
function dateStringToTimestamp(dateStr, flag) {
|
||||||
if (dateStr != null) {
|
const date = new Date();
|
||||||
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);
|
|
||||||
// 如果flag为1,则增加一天
|
|
||||||
if (flag === 1) {
|
if (flag === 1) {
|
||||||
date.setDate(date.getDate() + 1);
|
date.setDate(date.getDate() + 1);
|
||||||
|
} else if (dateStr) {
|
||||||
|
const normalized = dateStr.replace(/-/g, '');
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
date.setHours(0, 0, 0, 0);
|
||||||
return date.getTime();
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const begintimeConfirm = () => {
|
const begintimeConfirm = () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user