Merge branch 'devCorrected' into 'beta'
Dev corrected See merge request fedeo/software!14
This commit is contained in:
@@ -205,12 +205,14 @@ const createItem = async () => {
|
||||
let ret = null
|
||||
|
||||
if(props.inModal) {
|
||||
ret = await dataStore.createNewItem(type,item.value,true)
|
||||
ret = await useEntities(type).create(item.value, true)
|
||||
|
||||
} else {
|
||||
ret = await useEntities(type).create(item.value)//dataStore.createNewItem(type,item.value)
|
||||
}
|
||||
|
||||
emit('returnData', ret)
|
||||
modal.close()
|
||||
}
|
||||
|
||||
const updateItem = async () => {
|
||||
|
||||
@@ -35,10 +35,10 @@ const item = ref({})
|
||||
const setupPage = async () => {
|
||||
if(props.mode === "show") {
|
||||
//Load Data for Show
|
||||
item.value = await useSupabaseSelectSingle(props.type, props.id, dataType.supabaseSelectWithInformation || "*")
|
||||
item.value = await useEntities(props.type).selectSingle(props.id, dataType.supabaseSelectWithInformation || "*")
|
||||
} else if(props.mode === "edit") {
|
||||
//Load Data for Edit
|
||||
const data = JSON.stringify((await supabase.from(props.type).select().eq("id", props.id).single()).data)
|
||||
const data = JSON.stringify(await useEntities(props.type).selectSingle(props.id)/*(await supabase.from(props.type).select().eq("id", props.id).single()).data*/)
|
||||
//await useSupabaseSelectSingle(type, route.params.id)
|
||||
item.value = data
|
||||
|
||||
@@ -48,7 +48,7 @@ const setupPage = async () => {
|
||||
|
||||
} else if(props.mode === "list") {
|
||||
//Load Data for List
|
||||
items.value = await useSupabaseSelect(props.type, dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false)
|
||||
items.value = await useEntities(props.type).select(dataType.supabaseSelectWithInformation || "*", dataType.supabaseSortColumn,dataType.supabaseSortAscending || false)
|
||||
}
|
||||
|
||||
loaded.value = true
|
||||
|
||||
@@ -77,11 +77,7 @@ const texttemplates = ref([])
|
||||
const units = ref([])
|
||||
const tenantUsers = ref([])
|
||||
|
||||
|
||||
const loaded = ref(false)
|
||||
const setupPage = async () => {
|
||||
|
||||
|
||||
const setupData = async () => {
|
||||
letterheads.value = (await useEntities("letterheads").select("*")).filter(i => i.documentTypes.length === 0 || i.documentTypes.includes(itemInfo.value.type))
|
||||
createddocuments.value = await useEntities("createddocuments").select("*")
|
||||
projects.value = await useEntities("projects").select("*")
|
||||
@@ -97,6 +93,13 @@ const setupPage = async () => {
|
||||
tenantUsers.value = (await useNuxtApp().$api(`/api/tenant/users`, {
|
||||
method: "GET"
|
||||
})).users
|
||||
}
|
||||
|
||||
const loaded = ref(false)
|
||||
const setupPage = async () => {
|
||||
|
||||
await setupData()
|
||||
|
||||
if (productcategories.value.length > 0) selectedProductcategorie.value = productcategories.value[0].id
|
||||
if (servicecategories.value.length > 0) selectedServicecategorie.value = servicecategories.value[0].id
|
||||
|
||||
@@ -1203,6 +1206,7 @@ const getDocumentData = async () => {
|
||||
const showDocument = ref(false)
|
||||
const uri = ref("")
|
||||
const generateDocument = async () => {
|
||||
showDocument.value = false
|
||||
const path = letterheads.value.find(i => i.id === itemInfo.value.letterhead).path
|
||||
|
||||
uri.value = await useFunctions().useCreatePDF(await getDocumentData(), path)
|
||||
@@ -1474,7 +1478,7 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
||||
|
||||
if (product && product.id) {
|
||||
row.product = product.id
|
||||
product.value = await useEntities("products").select("*")
|
||||
products.value = await useEntities("products").select("*")
|
||||
}
|
||||
|
||||
if (row.service) {
|
||||
|
||||
Reference in New Issue
Block a user