test fix
This commit is contained in:
parent
463405b955
commit
10b1f82bf3
|
@ -412,7 +412,8 @@ class TgBot:
|
||||||
return
|
return
|
||||||
|
|
||||||
if update.effective_message.text == "/inv":
|
if update.effective_message.text == "/inv":
|
||||||
del context.chat_data["inv"]
|
if 'inv' in context.chat_data:
|
||||||
|
del context.chat_data["inv"]
|
||||||
context.chat_data["step"] = "name"
|
context.chat_data["step"] = "name"
|
||||||
current_ter_id = context.chat_data.get("terdeep_value", None)
|
current_ter_id = context.chat_data.get("terdeep_value", None)
|
||||||
current_ter = await TerritoryItem.objects.aget(id=current_ter_id)
|
current_ter = await TerritoryItem.objects.aget(id=current_ter_id)
|
||||||
|
@ -423,6 +424,7 @@ class TgBot:
|
||||||
),
|
),
|
||||||
reply_markup=ReplyKeyboardMarkup([[KeyboardButton(current_ter.name)]]),
|
reply_markup=ReplyKeyboardMarkup([[KeyboardButton(current_ter.name)]]),
|
||||||
)
|
)
|
||||||
|
return
|
||||||
|
|
||||||
if current_step == "name":
|
if current_step == "name":
|
||||||
if not context.chat_data.get("inv", None):
|
if not context.chat_data.get("inv", None):
|
||||||
|
|
|
@ -2,11 +2,6 @@
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const links = [
|
const links = [
|
||||||
{
|
|
||||||
label: 'DEV Связь с 1с',
|
|
||||||
icon: 'i-heroicons-beaker',
|
|
||||||
to: '/organization'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: 'Список ТМЦ (шаблоны)',
|
label: 'Список ТМЦ (шаблоны)',
|
||||||
icon: 'i-heroicons-archive-box',
|
icon: 'i-heroicons-archive-box',
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { apiBase, makeColumns } from '~/helpers';
|
|
||||||
import type { ApiTypeList } from '~/helpers';
|
|
||||||
|
|
||||||
const headers = new Headers();
|
|
||||||
headers.append("Content-Type", "application/json");
|
|
||||||
|
|
||||||
const { data } = await useFetch<ApiTypeList>(`${apiBase}/partner/`, { headers })
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<div class="mb-4">
|
|
||||||
<UButton icon="i-heroicons-plus" to="/organization/new">Новая инвентаризация</UButton>
|
|
||||||
</div>
|
|
||||||
<div class="mb-4">
|
|
||||||
<UTable :rows="data?.results" :columns="makeColumns(['id', 'name', 'external_id', 'total_inventory'])">
|
|
||||||
<template #name-data="{ row }">
|
|
||||||
<NuxtLink :to="`/organization/p_${row.id}`">{{ row.name }}</NuxtLink>
|
|
||||||
</template>
|
|
||||||
</UTable>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<template>
|
|
||||||
<Edit />
|
|
||||||
</template>
|
|
|
@ -1,15 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { apiBase } from '~/helpers';
|
|
||||||
import type { ApiPartner, ApiTypeList } from '~/helpers';
|
|
||||||
|
|
||||||
const headers = new Headers();
|
|
||||||
headers.append("Content-Type", "application/json");
|
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
const { data: partner } = await useFetch<ApiPartner>(`${apiBase}/partner/${route.params.org_id}`, { headers })
|
|
||||||
const { data: elements } = await useFetch<ApiTypeList>(`${apiBase}/element?inventory_id=${route.params.inv_id}`, { headers })
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<Edit :elements="elements?.results" :inventory="route.params.org_id" :partner="partner?.external_id"/>
|
|
||||||
</template>
|
|
|
@ -1,42 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { apiBase, makeColumns } from '~/helpers';
|
|
||||||
import type { ApiTypeList } from '~/helpers';
|
|
||||||
|
|
||||||
const headers = new Headers();
|
|
||||||
headers.append("Content-Type", "application/json");
|
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
const inventory = ref()
|
|
||||||
const elements = ref()
|
|
||||||
onMounted(async () => {
|
|
||||||
const inventory_data = await $fetch<ApiTypeList>(`${apiBase}/inventory/${route.params.inv_id}`, { headers })
|
|
||||||
inventory.value = inventory_data
|
|
||||||
|
|
||||||
const elements_data = await $fetch<ApiTypeList>(`${apiBase}/element?inventory_id=${route.params.inv_id}`, { headers })
|
|
||||||
elements.value = elements_data
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<UCard class="mb-4" v-if="inventory">
|
|
||||||
<template #header>
|
|
||||||
Инвентаризация <strong>{{ inventory.name }}</strong>
|
|
||||||
</template>
|
|
||||||
<ul class="flex flex-col gap-2">
|
|
||||||
<li>Всего элементов: {{ inventory.total_elements }}</li>
|
|
||||||
</ul>
|
|
||||||
<template #footer>
|
|
||||||
<UButton icon="i-heroicons-plus"
|
|
||||||
:to="`/organization/p_${route.params.org_id}/i_${route.params.inv_id}/edit`">
|
|
||||||
Добавить элемент</UButton>
|
|
||||||
</template>
|
|
||||||
</UCard>
|
|
||||||
<div class="mb-4">
|
|
||||||
<UTable :rows="elements?.results"
|
|
||||||
:columns="makeColumns(['id', 'external_id', 'element_id', 'photo', 'additional_text'])">
|
|
||||||
<template #external_id-data="{ row }">
|
|
||||||
<Element :id="row.external_id" />
|
|
||||||
</template>
|
|
||||||
</UTable>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
|
@ -1,57 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { apiBase, makeColumns } from '~/helpers';
|
|
||||||
import type { ApiPartner, ApiTypeList } from '~/helpers';
|
|
||||||
|
|
||||||
const headers = new Headers();
|
|
||||||
headers.append("Content-Type", "application/json");
|
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
const partner = ref()
|
|
||||||
const partnerRemote = ref()
|
|
||||||
const inventory = ref()
|
|
||||||
onMounted(async () => {
|
|
||||||
const partner_data = await $fetch<ApiPartner>(`${apiBase}/partner/${route.params.org_id}`, { headers })
|
|
||||||
partner.value = partner_data
|
|
||||||
|
|
||||||
const partnerRemote_data = await $fetch<ApiPartner>(`${apiBase}/partner/external/${partner_data.external_id}`, { headers })
|
|
||||||
partnerRemote.value = partnerRemote_data
|
|
||||||
|
|
||||||
const inventory_data = await $fetch<ApiTypeList>(`${apiBase}/inventory?partner_id=${route.params.org_id}`, { headers })
|
|
||||||
inventory.value = inventory_data
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<UCard class="mb-4" v-if="partner">
|
|
||||||
<template #header>
|
|
||||||
Контрагент <strong>{{ partner.name }}</strong>
|
|
||||||
</template>
|
|
||||||
<ul class="flex flex-col gap-2">
|
|
||||||
<li>Всего инвентаризаций: {{ partner.total_inventory }}</li>
|
|
||||||
<li>1C ID: {{ partner.external_id }}
|
|
||||||
<ul class="p-4">
|
|
||||||
<template v-for="(value, name) in partnerRemote">
|
|
||||||
<li>{{ name }}: {{ value }}</li>
|
|
||||||
</template>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<template #footer>
|
|
||||||
<UButton icon="i-heroicons-plus"
|
|
||||||
:to="`/organization/p_${route.params.org_id}/new`">
|
|
||||||
Новая инвентаризацию</UButton>
|
|
||||||
</template>
|
|
||||||
</UCard>
|
|
||||||
<div class="mb-4">
|
|
||||||
<UTable :rows="inventory?.results" :columns="makeColumns(['id', 'name', 'created_at', 'total_elements',])">
|
|
||||||
<template #name-data="{ row }">
|
|
||||||
<NuxtLink :to="`/organization/p_${route.params.org_id}/i_${row.id}`">
|
|
||||||
{{ row.name }}
|
|
||||||
</NuxtLink>
|
|
||||||
</template>
|
|
||||||
<template #created_at-data="{ row }">
|
|
||||||
{{ new Date(row.created_at).toLocaleString('ru-RU') }}
|
|
||||||
</template>
|
|
||||||
</UTable>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
|
@ -1,22 +0,0 @@
|
||||||
<script setup lang="ts">
|
|
||||||
import { apiBase, } from '~/helpers';
|
|
||||||
import type { ApiPartner } from '~/helpers';
|
|
||||||
|
|
||||||
const headers = new Headers();
|
|
||||||
headers.append("Content-Type", "application/json");
|
|
||||||
|
|
||||||
const route = useRoute()
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
const partner_data = await $fetch<ApiPartner>(`${apiBase}/partner/${route.params.org_id}`, { headers })
|
|
||||||
const prepader_data = {
|
|
||||||
partner: partner_data.external_id,
|
|
||||||
partner_name: partner_data.name,
|
|
||||||
}
|
|
||||||
const data = await $fetch(`${apiBase}/inventory/`, { method: 'POST', body: JSON.stringify(prepader_data) })
|
|
||||||
navigateTo(`/organization/p_${data.partner.id}/i_${data.inventory.id}/edit`)
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
Создается инвентаризация..
|
|
||||||
</template>
|
|
Loading…
Reference in New Issue