修改请假日期判断

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 data: config
}) })
} }
export function queryHisDateApi(username) { // 根据username获取最新请假结束日期
return https({
url: '/CxcQxj/cxcQxj/queryHisDate',
method: 'get',
data: {
username
}
})
}

View File

@ -2,8 +2,8 @@
"name" : "数智产销", "name" : "数智产销",
"appid" : "__UNI__9F097F0", "appid" : "__UNI__9F097F0",
"description" : "", "description" : "",
"versionName": "1.1.4", "versionName" : "1.1.6",
"versionCode": 20250121, "versionCode" : 20250207,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {
@ -120,3 +120,4 @@
"vueVersion" : "3" "vueVersion" : "3"
} }
/* */ /* */

View File

@ -109,7 +109,8 @@
} from '@/api/api.js'; } from '@/api/api.js';
import { import {
qjAddApi, qjAddApi,
queryZwmcAndExaApi queryZwmcAndExaApi,
queryHisDateApi
} from '@/api/pages.js'; } from '@/api/pages.js';
import { import {
queryDepByCode, queryDepByCode,
@ -177,7 +178,7 @@
} }
onLoad(() => { onLoad(() => {
loadData() loadData()
getTomorrowDate() // getTomorrowDate()
}) })
const select = (e) => { const select = (e) => {
@ -274,21 +275,39 @@
proxy.$toast(res.message); 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) => { const bindType = (e) => {
typeIndex.value = e.detail.value typeIndex.value = e.detail.value
} }
const getTomorrowDate = () => { const getTomorrowDate = (e) => {
let today = new Date(); let tomorrow;
let tomorrow = new Date(today); if (e) {
tomorrow.setDate(today.getDate() + 1); // Date
// yyyy-mm-dd const dateParts = e.split('-').map(Number);
let year = tomorrow.getFullYear(); tomorrow = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
let month = String(tomorrow.getMonth() + 1).padStart(2, '0'); // 01 } else {
let day = String(tomorrow.getDate()).padStart(2, '0'); // 使
beginTime.value = year + '-' + month + '-' + day; 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> </script>

View File

@ -98,17 +98,17 @@
}); });
/*生产环境 begin */ /*生产环境 begin */
// loginApi({ loginApi({
// username: un, username: un,
// password: pw, password: pw,
// ip: getDeviceIp() ip: getDeviceIp()
/*生产环境 end */ /*生产环境 end */
/*开发环境 begin */ /*开发环境 begin */
localLoginApi({ // localLoginApi({
username: username.value, // username: username.value,
password: password.value, // password: password.value,
captcha: 'app' // captcha: 'app'
/*开发环境 end */ /*开发环境 end */
}).then((loginres) => { }).then((loginres) => {
if (loginres.success) { if (loginres.success) {