修改请假日期判断

This commit is contained in:
yangzhq68909 2025-02-07 10:26:15 +08:00
parent 7d871f7151
commit 71cdfa3116
5 changed files with 171 additions and 141 deletions

View File

@ -1,3 +1,3 @@
# 开发环境
# 请求接口地址
VITE_REQUEST_BASE_URL = http://10.75.166.6:8080
VITE_REQUEST_BASE_URL = http://10.75.15.249:8080

View File

@ -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
}
})
}

View File

@ -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"
}
/* */

View File

@ -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'); // 01
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>

View File

@ -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) {