Merge branch 'master' of gitlab.com:mohit.panjvani/crater-web into fix_all_customer_load

This commit is contained in:
asift798
2022-02-15 18:41:57 +05:30
187 changed files with 2310 additions and 1794 deletions

View File

@ -21,7 +21,7 @@
<template #actions>
<BaseButton
v-if="isEdit && expenseStore.currentExpense.attachment_receipt"
v-if="isEdit && expenseStore.currentExpense.attachment_receipt_url"
:href="receiptDownloadUrl"
tag="a"
variant="primary-outline"
@ -319,6 +319,7 @@ const globalStore = useGlobalStore()
let isSaving = ref(false)
let isFetchingInitialData = ref(false)
const expenseValidationScope = 'newExpense'
const isAttachmentReceiptRemoved = ref(false)
const rules = computed(() => {
return {
@ -383,7 +384,7 @@ const pageTitle = computed(() =>
)
const receiptDownloadUrl = computed(() =>
isEdit.value ? `/expenses/${route.params.id}/download-receipt` : ''
isEdit.value ? `/reports/expenses/${route.params.id}/download-receipt` : ''
)
expenseStore.resetCurrentExpenseData()
@ -397,6 +398,7 @@ function onFileInputChange(fileName, file) {
function onFileInputRemove() {
expenseStore.currentExpense.attachment_receipt = null
isAttachmentReceiptRemoved.value = true
}
function openCategoryModal() {
@ -487,11 +489,14 @@ async function submitForm() {
await expenseStore.updateExpense({
id: route.params.id,
data: formData,
isAttachmentReceiptRemoved: isAttachmentReceiptRemoved.value
})
} else {
await expenseStore.addExpense(formData)
}
isSaving.value = false
expenseStore.currentExpense.attachment_receipt = null
isAttachmentReceiptRemoved.value = false
router.push('/admin/expenses')
} catch (err) {
console.error(err)