fix: refs #8370 change param rely on month
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
gitea/salix-front/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
parent
e18a1a6176
commit
ce5c21f4fa
|
@ -345,17 +345,35 @@ const getMailStates = async (date) => {
|
||||||
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
|
const url = `WorkerTimeControls/${route.params.id}/getMailStates`;
|
||||||
const month = date.getMonth() + 1;
|
const month = date.getMonth() + 1;
|
||||||
const prevMonth = month == 1 ? 12 : month - 1;
|
const prevMonth = month == 1 ? 12 : month - 1;
|
||||||
|
const postMonth = month == 12 ? 1 : month + 1;
|
||||||
const params = {
|
const params = {
|
||||||
month,
|
month,
|
||||||
year: date.getFullYear(),
|
year: date.getFullYear(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const curMonthStates = (await axios.get(url, { params })).data;
|
const curMonthStates = (await axios.get(url, { params })).data;
|
||||||
|
|
||||||
|
if (prevMonth == 12) {
|
||||||
|
params.year = params.year - 1;
|
||||||
|
}
|
||||||
const prevMonthStates = (
|
const prevMonthStates = (
|
||||||
await axios.get(url, { params: { ...params, month: prevMonth } })
|
await axios.get(url, { params: { ...params, month: prevMonth } })
|
||||||
).data;
|
).data;
|
||||||
|
|
||||||
workerTimeControlMails.value = curMonthStates.concat(prevMonthStates);
|
if (postMonth == 1) {
|
||||||
|
params.year = date.getFullYear() + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const postMonthStates = (
|
||||||
|
await axios.get(url, {
|
||||||
|
params: { ...params, month: postMonth },
|
||||||
|
})
|
||||||
|
).data;
|
||||||
|
|
||||||
|
workerTimeControlMails.value = curMonthStates.concat(
|
||||||
|
prevMonthStates,
|
||||||
|
postMonthStates
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const showWorkerTimeForm = (propValue, formType) => {
|
const showWorkerTimeForm = (propValue, formType) => {
|
||||||
|
|
Loading…
Reference in New Issue