fix [P-01]: загрузка тех кто на работе
This commit is contained in:
1 parent
9dd90589a0
commit
e1f47848d0
4 files changed
+130
-185
No files matched your search
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.85",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.85",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ckeditor/ckeditor5-build-classic": "^44.1.0",
|
"@ckeditor/ckeditor5-build-classic": "^44.1.0",
|
||||||
"@ckeditor/ckeditor5-dev-translations": "^43.0.1",
|
"@ckeditor/ckeditor5-dev-translations": "^43.0.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.85",
|
"version": "0.1.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|||||||
@@ -1,41 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="d-flex h-100 ">
|
<div class="d-flex h-100">
|
||||||
|
<v-card v-if="t_daily.length > 0" class="h-100 w-100 d-flex flex-column">
|
||||||
<v-card
|
<v-row v-for="x in t_daily" :key="x" v-show="x.position != 6">
|
||||||
v-if="t_daily.length > 0"
|
<v-divider />
|
||||||
class="h-100 w-100 d-flex flex-column"
|
|
||||||
>
|
|
||||||
|
|
||||||
<v-row
|
|
||||||
v-for="x in t_daily"
|
|
||||||
:key="x"
|
|
||||||
v-show="x.position!=6"
|
|
||||||
>
|
|
||||||
<v-divider/>
|
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-card
|
<v-card class="ma-2 d-flex flex-column" height="100" elevation="0">
|
||||||
class="ma-2 d-flex flex-column"
|
|
||||||
height="100"
|
|
||||||
elevation="0"
|
|
||||||
>
|
|
||||||
<v-card class="h-100 text-center text-black_grey bg-black_and_white">
|
<v-card class="h-100 text-center text-black_grey bg-black_and_white">
|
||||||
<v-card-title
|
<v-card-title
|
||||||
class="statstyle py-0
|
class="statstyle py-0 text-xl-overline text-lg-subtitle-1 text-md-h5 font-weight-bold bg-black_and_white"
|
||||||
text-xl-overline
|
>
|
||||||
text-lg-subtitle-1
|
{{ x.position__name }}
|
||||||
text-md-h5 font-weight-bold bg-black_and_white">
|
|
||||||
{{x.position__name}}
|
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text
|
<v-card-text
|
||||||
@click="detailRound(x.position, x.position__name)"
|
@click="detailRound(x.position, x.position__name)"
|
||||||
class="numstyle mt-2 py-0 font-weight-bold cursor-pointer bg-black_and_white"
|
class="numstyle mt-2 py-0 font-weight-bold cursor-pointer bg-black_and_white"
|
||||||
>
|
>
|
||||||
|
|
||||||
<vue3-autocounter
|
<vue3-autocounter
|
||||||
ref='counter'
|
ref="counter"
|
||||||
:startAmount='0'
|
:startAmount="0"
|
||||||
:endAmount='Number(x.user__count)'
|
:endAmount="Number(x.user__count)"
|
||||||
:duration='2'
|
:duration="2"
|
||||||
/>
|
/>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
@@ -44,9 +28,10 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-card
|
<v-card
|
||||||
v-else class="h-100 w-100 d-flex justify-center flex-column"
|
v-else
|
||||||
:image="`${burl}/media/default/didjlenta.jpg`">
|
class="h-100 w-100 d-flex justify-center flex-column"
|
||||||
|
:image="`${burl}/media/default/didjlenta.jpg`"
|
||||||
|
>
|
||||||
<v-row class="flex-grow-0">
|
<v-row class="flex-grow-0">
|
||||||
<v-col class="py-0">
|
<v-col class="py-0">
|
||||||
<v-switch
|
<v-switch
|
||||||
@@ -54,21 +39,18 @@
|
|||||||
v-model="changeData"
|
v-model="changeData"
|
||||||
class="pl-3 d-flex justify-end"
|
class="pl-3 d-flex justify-end"
|
||||||
color="white"
|
color="white"
|
||||||
@click="changeData=!changeData">
|
@click="changeData = !changeData"
|
||||||
|
>
|
||||||
</v-switch>
|
</v-switch>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="ma-3">
|
<v-row class="ma-3">
|
||||||
|
<v-card-text class="d-flex flex-column align-self-center" v-if="changeData">
|
||||||
<v-card-text class="d-flex flex-column align-self-center " v-if="changeData">
|
|
||||||
|
|
||||||
<v-file-input
|
<v-file-input
|
||||||
|
|
||||||
accept=".xlsx"
|
accept=".xlsx"
|
||||||
v-model="dailyfiles"
|
v-model="dailyfiles"
|
||||||
variant="underlined"
|
variant="underlined"
|
||||||
density="compact"
|
density="compact"
|
||||||
|
|
||||||
hide-details
|
hide-details
|
||||||
class="pt-2 ml-0 text-white"
|
class="pt-2 ml-0 text-white"
|
||||||
/>
|
/>
|
||||||
@@ -79,14 +61,11 @@
|
|||||||
size="x-large"
|
size="x-large"
|
||||||
variant="text"
|
variant="text"
|
||||||
color="teal-darken-4"
|
color="teal-darken-4"
|
||||||
:disabled="dailyfiles==0?true:false"
|
:disabled="dailyfiles == 0 ? true : false"
|
||||||
@click="onPickFile('roundfilse')"
|
@click="onPickFile('roundfilse')"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-text v-else class="w-100">
|
<v-card-text v-else class="w-100">
|
||||||
|
|
||||||
<v-row
|
<v-row
|
||||||
class="text-white text-center text-lg-h5 h-100"
|
class="text-white text-center text-lg-h5 h-100"
|
||||||
align-content="center"
|
align-content="center"
|
||||||
@@ -94,116 +73,94 @@
|
|||||||
>
|
>
|
||||||
Данные не загружены
|
Данные не загружены
|
||||||
</v-row>
|
</v-row>
|
||||||
|
</v-card-text>
|
||||||
</v-card-text>
|
|
||||||
|
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-card>
|
</v-card>
|
||||||
|
|
||||||
<div class="text-center">
|
<div class="text-center">
|
||||||
|
<v-dialog v-model="dialogDetailRound" width="500">
|
||||||
<v-dialog
|
|
||||||
v-model="dialogDetailRound"
|
|
||||||
width="500"
|
|
||||||
>
|
|
||||||
<dialog-search
|
<dialog-search
|
||||||
:idpos=idpos
|
:idpos="idpos"
|
||||||
:namepos=namepos
|
:namepos="namepos"
|
||||||
@searchClose="dialogDetailRound=!dialogDetailRound"
|
@searchClose="dialogDetailRound = !dialogDetailRound"
|
||||||
/>
|
/>
|
||||||
|
</v-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
</v-dialog>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref, onMounted,watch } from 'vue'
|
import { ref, onMounted } from 'vue';
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api';
|
||||||
import {checkremote} from '@/utils/universal_functions'
|
import { checkremote } from '@/utils/universal_functions';
|
||||||
import { spravURL } from '@/utils/axios-api'
|
import { spravURL } from '@/utils/axios-api';
|
||||||
|
|
||||||
import DialogSearch from './dialog-search.vue'
|
import DialogSearch from './dialog-search.vue';
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api';
|
||||||
import {useAccountStore} from '@/store/AccountStore'
|
import { useAccountStore } from '@/store/AccountStore';
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
DialogSearch
|
DialogSearch,
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup() {
|
||||||
const t_daily = ref('')
|
const t_daily = ref('');
|
||||||
const idpos = ref('')
|
const idpos = ref('');
|
||||||
const namepos = ref('')
|
const namepos = ref('');
|
||||||
const dialogDetailRound = ref(false)
|
const dialogDetailRound = ref(false);
|
||||||
const t_dailyRound = ref({})
|
const t_dailyRound = ref({});
|
||||||
const dailyfiles = ref([])
|
const dailyfiles = ref([]);
|
||||||
const info = ref({})
|
const info = ref({});
|
||||||
const searchname = ref('')
|
const searchname = ref('');
|
||||||
const menuGetUserDialog = ref(false)
|
const menuGetUserDialog = ref(false);
|
||||||
const iduser = ref('')
|
const iduser = ref('');
|
||||||
const result = ref({})
|
const result = ref({});
|
||||||
const changeData = ref(false)
|
const changeData = ref(false);
|
||||||
const accountStore = useAccountStore()
|
const accountStore = useAccountStore();
|
||||||
|
|
||||||
|
|
||||||
const getcard = async (idus) => {
|
const getcard = async (idus) => {
|
||||||
menuGetUserDialog.value = true
|
menuGetUserDialog.value = true;
|
||||||
iduser.value = idus
|
iduser.value = idus;
|
||||||
}
|
};
|
||||||
|
|
||||||
const detailRound = (pos, name) => {
|
const detailRound = (pos, name) => {
|
||||||
idpos.value=pos
|
idpos.value = pos;
|
||||||
namepos.value=name
|
namepos.value = name;
|
||||||
dialogDetailRound.value=!dialogDetailRound.value
|
dialogDetailRound.value = !dialogDetailRound.value;
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then(data => {
|
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then((data) => {
|
||||||
t_dailyRound.value = data.data
|
t_dailyRound.value = data.data;
|
||||||
|
|
||||||
result.value=JSON.parse(JSON.stringify(data.data.daily))
|
result.value = JSON.parse(JSON.stringify(data.data.daily));
|
||||||
|
});
|
||||||
})
|
};
|
||||||
}
|
|
||||||
|
|
||||||
const burl = baseURL.slice(0,-1)
|
|
||||||
|
|
||||||
|
const burl = baseURL.slice(0, -1);
|
||||||
|
|
||||||
const onPickFile = (ex) => {
|
const onPickFile = (ex) => {
|
||||||
const sdata = new FormData()
|
const sdata = new FormData();
|
||||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
sdata.append('dailyfiles', dailyfiles.value);
|
||||||
axiosApiInstance.post(`api/general_vacation/dailyroundup/?excel=${ex}`, sdata).then(result => {
|
axiosApiInstance
|
||||||
info.value = result.data
|
.post(`api/general_vacation/dailyroundup/?excel=${ex}`, sdata)
|
||||||
dailyfun()
|
.then((result) => {
|
||||||
})
|
info.value = result.data;
|
||||||
dailyfiles.value = ''
|
dailyfun();
|
||||||
|
});
|
||||||
|
dailyfiles.value = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
function dailyfun() {
|
||||||
|
axiosApiInstance.get('api/general_vacation/dailyload/').then((data) => {
|
||||||
|
t_daily.value = data.data.daily;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
// bgimage()
|
||||||
function dailyfun(){
|
|
||||||
|
|
||||||
axiosApiInstance.get('api/general_vacation/dailyload/')
|
|
||||||
.then(data => {
|
|
||||||
t_daily.value = data.data.daily
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
// bgimage()
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
dailyfun();
|
||||||
|
});
|
||||||
|
|
||||||
dailyfun()
|
return {
|
||||||
})
|
t_daily,
|
||||||
|
|
||||||
return {t_daily,
|
|
||||||
detailRound,
|
detailRound,
|
||||||
dialogDetailRound,
|
dialogDetailRound,
|
||||||
t_dailyRound,
|
t_dailyRound,
|
||||||
@@ -222,12 +179,10 @@ export default {
|
|||||||
changeData,
|
changeData,
|
||||||
baseURL,
|
baseURL,
|
||||||
burl,
|
burl,
|
||||||
accountStore
|
accountStore,
|
||||||
|
};
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row no-gutters class="gap ma-3 flex-column">
|
<v-row no-gutters class="gap ma-3 flex-column">
|
||||||
<v-col lg=2 class='w100 d-flex flex-column'>
|
<v-col lg="2" class="w100 d-flex flex-column">
|
||||||
<v-row no-gutters class="gap">
|
<v-row no-gutters class="gap">
|
||||||
<v-col lg=4>
|
<v-col lg="4">
|
||||||
<v-card class="h-100">
|
<v-card class="h-100">
|
||||||
<v-card-title>
|
<v-card-title> Ежедневная статистика по сотрудникам </v-card-title>
|
||||||
Ежедневная статистика по сотрудникам
|
|
||||||
</v-card-title>
|
|
||||||
<v-row no-gutters class="gap">
|
<v-row no-gutters class="gap">
|
||||||
<v-col class="flex-grow-0">
|
<v-col class="flex-grow-0">
|
||||||
<v-card-subtitle class="mt-2 align-self-end">
|
<v-card-subtitle class="mt-2 align-self-end">
|
||||||
@@ -14,11 +12,7 @@
|
|||||||
</v-card-subtitle>
|
</v-card-subtitle>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col class="flex-grow-0">
|
<v-col class="flex-grow-0">
|
||||||
<v-icon
|
<v-icon icon="mdi-file-excel" color="green-darken-3" @click="excelOp('excround')" />
|
||||||
icon="mdi-file-excel"
|
|
||||||
color="green-darken-3"
|
|
||||||
@click="excelOp('excround')"
|
|
||||||
/>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row no-gutters class="gap mt-5">
|
<v-row no-gutters class="gap mt-5">
|
||||||
@@ -27,7 +21,7 @@
|
|||||||
2. Загрузить данные на сервер
|
2. Загрузить данные на сервер
|
||||||
</v-card-subtitle>
|
</v-card-subtitle>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col >
|
<v-col>
|
||||||
<v-file-input
|
<v-file-input
|
||||||
accept=".xlsx"
|
accept=".xlsx"
|
||||||
v-model="dailyfiles"
|
v-model="dailyfiles"
|
||||||
@@ -53,67 +47,63 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue';
|
||||||
import { baseURL } from '@/utils/axios-api'
|
import { baseURL } from '@/utils/axios-api';
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
import { axiosApiInstance } from '@/utils/axios-api';
|
||||||
import { useAlertStore } from '@/store/useAlertStore'
|
import { useAlertStore } from '@/store/useAlertStore';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
setup() {
|
||||||
setup(){
|
const dailyfiles = ref([]);
|
||||||
|
const feedalert = useAlertStore().alert;
|
||||||
const dailyfiles = ref([])
|
|
||||||
const feedalert = useAlertStore().alert
|
|
||||||
|
|
||||||
const excelOp = (ex) => {
|
const excelOp = (ex) => {
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyroundup/?excel=${ex}`).then(result => {
|
axiosApiInstance.get(`api/general_vacation/dailyroundup/?excel=${ex}`).then((result) => {
|
||||||
let link = document.createElement("a")
|
let link = document.createElement('a');
|
||||||
link.href = baseURL+result.data.path
|
link.href = baseURL + result.data.path;
|
||||||
link.click()
|
link.click();
|
||||||
link.remove()
|
link.remove();
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const onPickFile = (ex) => {
|
const onPickFile = (ex) => {
|
||||||
const sdata = new FormData()
|
const sdata = new FormData();
|
||||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
sdata.append('dailyfiles', dailyfiles.value);
|
||||||
|
|
||||||
axiosApiInstance.post(`api/general_vacation/dailyroundup/?excel=${ex}`, sdata).then(result => {
|
axiosApiInstance
|
||||||
textFromAlert(result.data['mess'])
|
.post(`api/general_vacation/dailyroundup/?excel=${ex}`, sdata)
|
||||||
})
|
.then((result) => {
|
||||||
dailyfiles.value = []
|
textFromAlert(result.data['mess']);
|
||||||
}
|
});
|
||||||
|
dailyfiles.value = [];
|
||||||
|
};
|
||||||
|
|
||||||
const textFromAlert = (info) => {
|
const textFromAlert = (info) => {
|
||||||
feedalert.alert = true
|
feedalert.alert = true;
|
||||||
if (info == "Файл загружен") {
|
if (info == 'Файл загружен') {
|
||||||
feedalert.text = "Файл загружен"
|
feedalert.text = 'Файл загружен';
|
||||||
feedalert.ico = "mdi-check"
|
feedalert.ico = 'mdi-check';
|
||||||
feedalert.color ="green-darken-4"
|
feedalert.color = 'green-darken-4';
|
||||||
}
|
} else {
|
||||||
else {
|
feedalert.text = 'Ошибка загрузки';
|
||||||
feedalert.text = "Ошибка загрузки"
|
feedalert.ico = 'mdi-alert-circle-outline';
|
||||||
feedalert.ico = "mdi-alert-circle-outline"
|
feedalert.color = 'pink-accent-4';
|
||||||
feedalert.color="pink-accent-4"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
excelOp,
|
excelOp,
|
||||||
baseURL,
|
baseURL,
|
||||||
dailyfiles,
|
dailyfiles,
|
||||||
onPickFile,
|
onPickFile,
|
||||||
feedalert
|
feedalert,
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
|
};
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.mhight {
|
.mhight {
|
||||||
height: 150px;
|
height: 150px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user