Merge branch 'razrab'
This commit is contained in:
commit
9b7ab51bdd
12 files changed
+177
-201
No files matched your search
+49
-27
@@ -13,21 +13,30 @@ from rest_framework_simplejwt.views import TokenObtainPairView
|
|||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
User = get_user_model()
|
User = get_user_model()
|
||||||
myDEBUG=True
|
myDEBUG=True
|
||||||
|
|
||||||
|
# class Authexception(Exception):
|
||||||
|
# def __init__(self, *args):
|
||||||
|
# self.message = args[0] if args else "None"
|
||||||
|
|
||||||
class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
|
class MyTokenObtainPairSerializer(TokenObtainPairSerializer):
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_token(cls, user):
|
def get_token(cls, user):
|
||||||
|
try:
|
||||||
token = super().get_token(user.userinfo)
|
token = super().get_token(user.userinfo)
|
||||||
|
|
||||||
# TODO В зависимости от базы Алексея, добавить поля или нет - надо подумать
|
# TODO В зависимости от базы Алексея, добавить поля или нет - надо подумать
|
||||||
|
|
||||||
|
|
||||||
token['user']=model_to_dict(user.userinfo)
|
token['user']=model_to_dict(user.userinfo)
|
||||||
token['user']['is_active']=user.is_active
|
token['user']['is_active']=user.is_active
|
||||||
token['user']['is_staff']=user.is_staff
|
token['user']['is_staff']=user.is_staff
|
||||||
# !ТУТ СДЕЛАТь ФОТО НАВЕРНОЕ
|
# !ТУТ СДЕЛАТь ФОТО НАВЕРНОЕ
|
||||||
# token['user']['last_login']= user.last_login
|
# token['user']['last_login']= user.last_login
|
||||||
return token
|
# print(token)
|
||||||
|
return token
|
||||||
|
except Exception as e:
|
||||||
|
print("ERRRORRRRRRRR")
|
||||||
|
print (e)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -41,29 +50,42 @@ class CustomAuth(ModelBackend):
|
|||||||
username = kwargs['username']
|
username = kwargs['username']
|
||||||
password = kwargs['password']
|
password = kwargs['password']
|
||||||
status_code=0
|
status_code=0
|
||||||
|
|
||||||
# !ТУт стучим в AD, потом к Алексею
|
# !ТУт стучим в AD, потом к Алексею
|
||||||
if myDEBUG!=True:
|
if myDEBUG!=True:
|
||||||
|
|
||||||
resp= requests.post('http://10.252.44.13:8005/getAD', json.dumps({'user': username, 'password':password, 'usercheck': username}))
|
resp= requests.post('http://10.252.44.13:8005/getAD', json.dumps({'user': username, 'password':password, 'usercheck': username}))
|
||||||
|
|
||||||
# if True:
|
# if True:
|
||||||
status_code=resp.status_code
|
status_code=resp.status_code
|
||||||
else:
|
else:
|
||||||
status_code=200
|
status_code=200
|
||||||
if status_code==200:
|
|
||||||
try:
|
|
||||||
|
|
||||||
user = DictEmployee.objects.using('user_directory').get(login=username)
|
if status_code==200:
|
||||||
if user.deleted!=1:
|
# try:
|
||||||
homeuser, created = User.objects.get_or_create(username=username)
|
|
||||||
homeuser.last_login= timezone.now()
|
user = DictEmployee.objects.using('user_directory').get(login=username)
|
||||||
user.is_active=homeuser.is_active
|
|
||||||
user.is_staff=homeuser.is_staff
|
if user.deleted!=1:
|
||||||
user.last_login=homeuser.last_login.strftime('%Y-%d-%m %H:%M:%S')
|
homeuser, created = User.objects.get_or_create(username=username)
|
||||||
homeuser.save()
|
if created:
|
||||||
homeuser.last_login=user.last_login
|
homeuser.set_unusable_password()
|
||||||
user.id=homeuser.id
|
|
||||||
homeuser.userinfo = user
|
homeuser.last_login= timezone.now()
|
||||||
return homeuser
|
user.is_active=homeuser.is_active
|
||||||
|
user.is_staff=homeuser.is_staff
|
||||||
|
user.last_login=homeuser.last_login.strftime('%Y-%d-%m %H:%M:%S')
|
||||||
|
homeuser.save()
|
||||||
|
homeuser.last_login=user.last_login
|
||||||
|
user.id=homeuser.id
|
||||||
|
homeuser.userinfo = user
|
||||||
|
# print("OOOOOOOOOOOOOOOOOOOO")
|
||||||
|
# print(homeuser)
|
||||||
|
return homeuser
|
||||||
|
|
||||||
except User.DoesNotExist:
|
# except Exception as e:
|
||||||
pass
|
# print (e)
|
||||||
|
elif status_code==403:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ class User(AbstractBaseUser, PermissionsMixin):
|
|||||||
updated_at = models.DateTimeField(auto_now=True)
|
updated_at = models.DateTimeField(auto_now=True)
|
||||||
# last_login = models.DateTimeField(auto_now=True, null=True)
|
# last_login = models.DateTimeField(auto_now=True, null=True)
|
||||||
# external=models.ForeignKey(DictEmployee,db_constraint=False, null=True, on_delete=models.PROTECT)
|
# external=models.ForeignKey(DictEmployee,db_constraint=False, null=True, on_delete=models.PROTECT)
|
||||||
objects = UserManager()
|
# objects = UserManager()
|
||||||
USERNAME_FIELD = 'username'
|
USERNAME_FIELD = 'username'
|
||||||
# REQUIRED_FIELDS = ['username']
|
# REQUIRED_FIELDS = ['username']
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|||||||
Binary file not shown.
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.22",
|
"version": "0.0.23",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.22",
|
"version": "0.0.23",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fullcalendar/core": "^6.1.8",
|
"@fullcalendar/core": "^6.1.8",
|
||||||
"@fullcalendar/daygrid": "^6.1.8",
|
"@fullcalendar/daygrid": "^6.1.8",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "front",
|
"name": "front",
|
||||||
"version": "0.0.22",
|
"version": "0.0.23",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 490 KiB After Width: | Height: | Size: 1.8 MiB |
@@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<v-alert
|
||||||
|
v-model="alert"
|
||||||
|
border="start"
|
||||||
|
variant="tonal"
|
||||||
|
closable
|
||||||
|
close-label="Close Alert"
|
||||||
|
color="deep-purple-accent-4"
|
||||||
|
title="Closable Alert"
|
||||||
|
>
|
||||||
|
Aenean imperdiet. Quisque id odio. Cras dapibus. Pellentesque ut neque. Cras dapibus.
|
||||||
|
|
||||||
|
Vivamus consectetuer hendrerit lacus. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Curabitur blandit mollis lacus. Curabitur ligula sapien, tincidunt non, euismod vitae, posuere imperdiet, leo.
|
||||||
|
</v-alert>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -1,39 +1,55 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row class="justify-center">
|
|
||||||
|
<!-- :rules="[val => (!!val && val.length > 0) || 'Добавьте файл']" -->
|
||||||
<v-col cols="12"
|
<v-row class="justify-center align-center ma-3">
|
||||||
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
|
|
||||||
>
|
<v-col cols="1" class="px-0 pt-5">
|
||||||
|
|
||||||
<v-btn
|
<my-helper :pretext="info.mess"/>
|
||||||
|
<v-icon icon="mdi-file-excel"
|
||||||
class="mr-2"
|
|
||||||
color="modal_btn"
|
color="green-darken-3"
|
||||||
@click="excelOp"
|
|
||||||
>
|
@click="excelOp"/>
|
||||||
Скачать
|
|
||||||
</v-btn>
|
|
||||||
|
</v-col>
|
||||||
<!-- <v-spacer></v-spacer> -->
|
|
||||||
<v-file-input
|
<v-col
|
||||||
:rules="[val => (!!val && val.length > 0) || 'Добавьте файл']"
|
cols="10"
|
||||||
accept=".xlsx"
|
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light px-0"
|
||||||
v-model="dailyfiles"
|
>
|
||||||
variant="underlined"
|
|
||||||
density="compact"
|
<v-file-input
|
||||||
label="Выберите файл"
|
|
||||||
class="mr-2"></v-file-input>
|
accept=".xlsx"
|
||||||
|
v-model="dailyfiles"
|
||||||
<!-- <v-spacer></v-spacer> -->
|
variant="underlined"
|
||||||
<v-btn
|
density="compact"
|
||||||
color="modal_btn"
|
label="Выберите файл"
|
||||||
@click="onPickFile">
|
hide-details
|
||||||
Загрузить
|
class="mr-2"/>
|
||||||
</v-btn>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</v-col>
|
||||||
|
<v-col cols="1" class="px-0 pb-0 pt-7">
|
||||||
|
<v-icon icon="mdi-download"
|
||||||
|
|
||||||
|
color="blue-grey-darken-2"
|
||||||
|
|
||||||
|
@click="onPickFile"/>
|
||||||
|
<!-- <v-btn
|
||||||
|
icon="mdi-download"
|
||||||
|
|
||||||
|
color="blue-grey-darken-4"
|
||||||
|
variant="plain"
|
||||||
|
@click="onPickFile"/> -->
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -48,6 +64,7 @@ export default {
|
|||||||
const visiting = ref({})
|
const visiting = ref({})
|
||||||
const info = ref({})
|
const info = ref({})
|
||||||
const t_dailyRound = ref('')
|
const t_dailyRound = ref('')
|
||||||
|
const alert = ref(false)
|
||||||
const excelOp = () => {
|
const excelOp = () => {
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
||||||
let link = document.createElement("a")
|
let link = document.createElement("a")
|
||||||
@@ -68,6 +85,7 @@ export default {
|
|||||||
})
|
})
|
||||||
showInfo.value = true
|
showInfo.value = true
|
||||||
dailyfiles.value = ''
|
dailyfiles.value = ''
|
||||||
|
alert.value = true
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -94,7 +112,8 @@ export default {
|
|||||||
info,
|
info,
|
||||||
detailRound,
|
detailRound,
|
||||||
t_dailyRound,
|
t_dailyRound,
|
||||||
showInfo
|
showInfo,
|
||||||
|
alert
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@
|
|||||||
<v-main v-else class="d-flex justify-center align-center text-h3 bg-teal-lighten-2">
|
<v-main v-else class="d-flex justify-center align-center text-h3 bg-teal-lighten-2">
|
||||||
<div>
|
<div>
|
||||||
<p class="text-center">Добро пожаловать на портал МИ ФНС по ЦОД № 2</p>
|
<p class="text-center">Добро пожаловать на портал МИ ФНС по ЦОД № 2</p>
|
||||||
<p class="mt-3 text-subtitle-1 text-center">Авторизуйтесь, для получения доступа к контенту портала</p>
|
<p class="mt-3 text-subtitle-1 text-center">Авторизуйтесь для получения доступа к контенту портала</p>
|
||||||
</div>
|
</div>
|
||||||
</v-main>
|
</v-main>
|
||||||
<v-navigation-drawer v-if="accountStore.cod2user"
|
<v-navigation-drawer v-if="accountStore.cod2user"
|
||||||
|
|||||||
@@ -82,36 +82,56 @@
|
|||||||
</v-row>
|
</v-row>
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-card
|
<v-card
|
||||||
|
|
||||||
v-else class="h-100 d-flex justify-center"
|
v-else class="h-100 d-flex justify-center"
|
||||||
:image="imageLenta"
|
:image="imageLenta"
|
||||||
>
|
>
|
||||||
|
<v-card-text class="align-self-center flex-column">
|
||||||
|
<v-file-input
|
||||||
|
v-bind="props"
|
||||||
|
accept=".xlsx"
|
||||||
|
v-model="dailyfiles"
|
||||||
|
variant="underlined"
|
||||||
|
density="compact"
|
||||||
|
label="Выберите файл"
|
||||||
|
hide-details
|
||||||
|
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</v-card-text>
|
||||||
|
|
||||||
<p class="align-self-center text-h5 text-center">
|
<!-- <p class="align-self-center text-h5 "> -->
|
||||||
<v-row justify="center">
|
<!-- <v-row justify="center"> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<v-dialog
|
<!-- <v-dialog
|
||||||
v-model="dialoground"
|
v-model="dialoground"
|
||||||
persistent
|
persistent
|
||||||
width="500"
|
width="500"
|
||||||
>
|
>
|
||||||
<template v-slot:activator="{ props }">
|
<template v-slot:activator="{ props }"> -->
|
||||||
<v-btn
|
|
||||||
color="teal-darken-2"
|
<!-- <v-btn
|
||||||
|
append-icon="mdi-note-plus"
|
||||||
|
size="large"
|
||||||
|
color="teal-darken-4"
|
||||||
|
variant="text"
|
||||||
v-bind="props"
|
v-bind="props"
|
||||||
>
|
>
|
||||||
Загрузить
|
Загрузить
|
||||||
</v-btn>
|
</v-btn> -->
|
||||||
</template>
|
|
||||||
<v-card>
|
<!-- </template> -->
|
||||||
|
<!-- <v-card>
|
||||||
<v-card-title>
|
<v-card-title>
|
||||||
<span class="text-h5">Загрузить файл</span>
|
<span class="text-h5">Загрузить файл</span>
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-container>
|
|
||||||
<load-round/>
|
<load-round/>
|
||||||
</v-container>
|
|
||||||
|
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
@@ -126,13 +146,13 @@
|
|||||||
|
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog> -->
|
||||||
|
|
||||||
|
|
||||||
</v-row>
|
<!-- </v-row> -->
|
||||||
<!-- Данные по сотрудникам не загружены -->
|
<!-- Данные по сотрудникам не загружены -->
|
||||||
<!-- <v-btn icon="mdi-calendar" size="x-large"></v-btn> -->
|
<!-- <v-btn icon="mdi-calendar" size="x-large"></v-btn> -->
|
||||||
</p>
|
<!-- </p> -->
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -157,7 +177,7 @@
|
|||||||
</v-btn>
|
</v-btn>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<my-helper :pretext="t_daily.length"/>
|
<!-- <my-helper :pretext="t_daily.length"/> -->
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
@@ -319,6 +339,7 @@
|
|||||||
const menuGetUserDialog = ref(false)
|
const menuGetUserDialog = ref(false)
|
||||||
const iduser = ref('')
|
const iduser = ref('')
|
||||||
const dialoground = ref(false)
|
const dialoground = ref(false)
|
||||||
|
const dailyfiles = ref('')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -411,7 +432,8 @@
|
|||||||
getcard,
|
getcard,
|
||||||
iduser,
|
iduser,
|
||||||
imageLenta,
|
imageLenta,
|
||||||
dialoground
|
dialoground,
|
||||||
|
dailyfiles
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,134 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-container class="my-auto">
|
|
||||||
<v-row justify="center">
|
<load-round/>
|
||||||
<!-- <v-alert
|
|
||||||
class="d-flex align-self-center"
|
|
||||||
v-model="showInfo"
|
|
||||||
:border="'start'"
|
|
||||||
variant="tonal"
|
|
||||||
type="info"
|
|
||||||
max-width="max-content"
|
|
||||||
closable>{{ info.mess }}
|
|
||||||
</v-alert> -->
|
|
||||||
<!-- v-if="!showInfo" -->
|
|
||||||
<v-col cols="7"
|
|
||||||
class="text-h6 text-grey text-center d-flex align-baseline align-self-center text--lighten-1 font-weight-light"
|
|
||||||
>
|
|
||||||
{{t_dailyRound}}
|
|
||||||
|
|
||||||
<v-btn class="mr-2" @click="detailRound">
|
|
||||||
Уточнение
|
|
||||||
</v-btn>
|
|
||||||
<v-btn
|
|
||||||
|
|
||||||
class="mr-2"
|
|
||||||
color="modal_btn"
|
|
||||||
@click="excelOp"
|
|
||||||
>
|
|
||||||
Скачать
|
|
||||||
</v-btn>
|
|
||||||
|
|
||||||
<!-- <v-spacer></v-spacer> -->
|
|
||||||
<v-file-input
|
|
||||||
:rules="[val => (!!val && val.length > 0) || 'Добавьте файл']"
|
|
||||||
accept=".xlsx"
|
|
||||||
v-model="dailyfiles"
|
|
||||||
variant="underlined"
|
|
||||||
density="compact"
|
|
||||||
label="Выберите файл"
|
|
||||||
class="mr-2"></v-file-input>
|
|
||||||
|
|
||||||
<!-- <v-spacer></v-spacer> -->
|
|
||||||
<v-btn
|
|
||||||
color="modal_btn"
|
|
||||||
@click="onPickFile">
|
|
||||||
Загрузить
|
|
||||||
</v-btn>
|
|
||||||
|
|
||||||
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
<v-row justify="center">
|
|
||||||
<v-col cols="2">
|
|
||||||
<v-alert
|
|
||||||
v-model="showInfo"
|
|
||||||
:border="'start'"
|
|
||||||
variant="tonal"
|
|
||||||
type="info"
|
|
||||||
width="max-content"
|
|
||||||
closable>
|
|
||||||
{{ info.mess }}
|
|
||||||
</v-alert>
|
|
||||||
</v-col>
|
|
||||||
</v-row>
|
|
||||||
</v-container>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { ref } from 'vue'
|
import LoadRound from '@/components/load-round.vue'
|
||||||
import { baseURL } from '@/utils/axios-api'
|
|
||||||
import {getfromserver} from '@/utils/universal_functions'
|
|
||||||
import { axiosApiInstance } from '@/utils/axios-api'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
setup(){
|
|
||||||
const dailyfiles = ref('')
|
|
||||||
const visiting = ref({})
|
|
||||||
const info = ref({})
|
|
||||||
const t_dailyRound = ref('')
|
|
||||||
const excelOp = () => {
|
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyroundup/`).then(result => {
|
|
||||||
let link = document.createElement("a")
|
|
||||||
link.href = baseURL+result.data.path
|
|
||||||
link.click()
|
|
||||||
link.remove()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
components: {
|
||||||
const onPickFile = () => {
|
LoadRound
|
||||||
|
},
|
||||||
const sdata = new FormData()
|
|
||||||
sdata.append('dailyfiles', dailyfiles.value[0])
|
|
||||||
axiosApiInstance.post(`api/general_vacation/dailyroundup/`, sdata).then(result => {
|
|
||||||
info.value = result.data
|
|
||||||
console.log(result.data, '----------------')
|
|
||||||
})
|
|
||||||
showInfo.value = true
|
|
||||||
dailyfiles.value = ''
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const detailRound = () => {
|
|
||||||
|
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=6`)
|
|
||||||
.then(data => {
|
|
||||||
console.log(data.data);
|
|
||||||
|
|
||||||
t_dailyRound.value = data.data
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const showInfo = ref(false)
|
|
||||||
|
|
||||||
return {
|
|
||||||
visiting,
|
|
||||||
excelOp,
|
|
||||||
baseURL,
|
|
||||||
dailyfiles,
|
|
||||||
onPickFile,
|
|
||||||
info,
|
|
||||||
detailRound,
|
|
||||||
t_dailyRound,
|
|
||||||
showInfo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
Binary file not shown.
Reference in new issue
Block a user