mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'master'
This commit is contained in:
@ -6,7 +6,6 @@
|
||||
value-prop="id"
|
||||
label="name"
|
||||
:filter-results="false"
|
||||
:min-chars="1"
|
||||
resolve-on-load
|
||||
:delay="500"
|
||||
:searchable="true"
|
||||
|
||||
@ -2,6 +2,21 @@
|
||||
import DashboardStats from '../dashboard/DashboardStats.vue'
|
||||
import DashboardChart from '../dashboard/DashboardChart.vue'
|
||||
import DashboardTable from '../dashboard/DashboardTable.vue'
|
||||
import { useUserStore } from '@/scripts/stores/user'
|
||||
import { onMounted } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
const userStore = useUserStore()
|
||||
const router = useRouter()
|
||||
|
||||
onMounted(() => {
|
||||
if (route.meta.ability && !userStore.hasAbilities(route.meta.ability)) {
|
||||
router.push({ name: 'account.settings' })
|
||||
} else if (route.meta.isOwner && !userStore.currentUser.is_owner) {
|
||||
router.push({ name: 'account.settings' })
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@ -179,10 +179,7 @@
|
||||
</template>
|
||||
|
||||
<template #cell-name="{ row }">
|
||||
<BaseText
|
||||
:text="row.data.customer.name"
|
||||
:length="30"
|
||||
/>
|
||||
<BaseText :text="row.data.customer.name" :length="30" />
|
||||
</template>
|
||||
|
||||
<!-- Invoice Number -->
|
||||
|
||||
@ -50,12 +50,16 @@
|
||||
<BaseInputGroup :label="$tc('items.unit')" class="text-left">
|
||||
<BaseMultiselect
|
||||
v-model="filters.unit_id"
|
||||
:options="itemStore.itemUnits"
|
||||
label="name"
|
||||
:placeholder="$t('items.select_a_unit')"
|
||||
class="w-full"
|
||||
value-prop="id"
|
||||
track-by="name"
|
||||
:filter-results="false"
|
||||
label="name"
|
||||
resolve-on-load
|
||||
:delay="500"
|
||||
searchable
|
||||
class="w-full"
|
||||
:options="searchUnits"
|
||||
/>
|
||||
</BaseInputGroup>
|
||||
|
||||
@ -298,6 +302,12 @@ function setFilters() {
|
||||
refreshTable()
|
||||
}
|
||||
|
||||
async function searchUnits(search) {
|
||||
let res = await itemStore.fetchItemUnits({ search })
|
||||
|
||||
return res.data.data
|
||||
}
|
||||
|
||||
async function fetchData({ page, filter, sort }) {
|
||||
let data = {
|
||||
search: filters.name,
|
||||
|
||||
@ -514,8 +514,9 @@ function selectNewCustomer(id) {
|
||||
|
||||
if (route.params.id) params.model_id = route.params.id
|
||||
|
||||
paymentStore.currentPayment.invoice_id = null
|
||||
|
||||
paymentStore.currentPayment.invoice_id = selectedInvoice.value = null
|
||||
paymentStore.currentPayment.amount = 100
|
||||
invoiceList.value = []
|
||||
paymentStore.getNextNumber(params, true)
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user