修改请假日期判断
This commit is contained in:
parent
7d871f7151
commit
71cdfa3116
@ -1,3 +1,3 @@
|
||||
# 开发环境
|
||||
# 请求接口地址
|
||||
VITE_REQUEST_BASE_URL = http://10.75.166.6:8080
|
||||
VITE_REQUEST_BASE_URL = http://10.75.15.249:8080
|
||||
|
10
api/pages.js
10
api/pages.js
@ -27,3 +27,13 @@ export function qjQueryByIdApi(config) { // 通过id查询请假数据 流程用
|
||||
data: config
|
||||
})
|
||||
}
|
||||
|
||||
export function queryHisDateApi(username) { // 根据username获取最新请假结束日期
|
||||
return https({
|
||||
url: '/CxcQxj/cxcQxj/queryHisDate',
|
||||
method: 'get',
|
||||
data: {
|
||||
username
|
||||
}
|
||||
})
|
||||
}
|
@ -2,8 +2,8 @@
|
||||
"name" : "数智产销",
|
||||
"appid" : "__UNI__9F097F0",
|
||||
"description" : "",
|
||||
"versionName": "1.1.4",
|
||||
"versionCode": 20250121,
|
||||
"versionName" : "1.1.6",
|
||||
"versionCode" : 20250207,
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus" : {
|
||||
@ -120,3 +120,4 @@
|
||||
"vueVersion" : "3"
|
||||
}
|
||||
/* 模块配置 */
|
||||
|
||||
|
@ -109,7 +109,8 @@
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
qjAddApi,
|
||||
queryZwmcAndExaApi
|
||||
queryZwmcAndExaApi,
|
||||
queryHisDateApi
|
||||
} from '@/api/pages.js';
|
||||
import {
|
||||
queryDepByCode,
|
||||
@ -177,7 +178,7 @@
|
||||
}
|
||||
onLoad(() => {
|
||||
loadData()
|
||||
getTomorrowDate()
|
||||
// getTomorrowDate()
|
||||
})
|
||||
|
||||
const select = (e) => {
|
||||
@ -274,21 +275,39 @@
|
||||
proxy.$toast(res.message);
|
||||
}
|
||||
})
|
||||
|
||||
queryHisDateApi(store.userinfo.username).then((res) => { // 最新请假结束日期
|
||||
if (res) {
|
||||
console.log('--0', res)
|
||||
getTomorrowDate(res);
|
||||
} else {
|
||||
console.log('--1', res)
|
||||
getTomorrowDate();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const bindType = (e) => {
|
||||
typeIndex.value = e.detail.value
|
||||
}
|
||||
|
||||
const getTomorrowDate = () => {
|
||||
let today = new Date();
|
||||
let tomorrow = new Date(today);
|
||||
tomorrow.setDate(today.getDate() + 1);
|
||||
// 格式化日期为 yyyy-mm-dd
|
||||
let year = tomorrow.getFullYear();
|
||||
let month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要加1
|
||||
let day = String(tomorrow.getDate()).padStart(2, '0');
|
||||
beginTime.value = year + '-' + month + '-' + day;
|
||||
const getTomorrowDate = (e) => {
|
||||
let tomorrow;
|
||||
if (e) {
|
||||
// 将传入的日期字符串转换为Date对象
|
||||
const dateParts = e.split('-').map(Number);
|
||||
tomorrow = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
|
||||
} else {
|
||||
// 如果没有提供日期,则使用当前日期
|
||||
tomorrow = new Date();
|
||||
}
|
||||
// 设置为明天的日期
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
// 格式化日期
|
||||
const year = tomorrow.getFullYear();
|
||||
const month = (tomorrow.getMonth() + 1).toString().padStart(2, '0');
|
||||
const day = tomorrow.getDate().toString().padStart(2, '0');
|
||||
beginTime.value = `${year}-${month}-${day}`;
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -98,17 +98,17 @@
|
||||
});
|
||||
|
||||
/*生产环境 begin */
|
||||
// loginApi({
|
||||
// username: un,
|
||||
// password: pw,
|
||||
// ip: getDeviceIp()
|
||||
loginApi({
|
||||
username: un,
|
||||
password: pw,
|
||||
ip: getDeviceIp()
|
||||
/*生产环境 end */
|
||||
|
||||
/*开发环境 begin */
|
||||
localLoginApi({
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
captcha: 'app'
|
||||
// localLoginApi({
|
||||
// username: username.value,
|
||||
// password: password.value,
|
||||
// captcha: 'app'
|
||||
/*开发环境 end */
|
||||
}).then((loginres) => {
|
||||
if (loginres.success) {
|
||||
|
Loading…
Reference in New Issue
Block a user