-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from Billing-Wise/K5P-68/feat/청구컴포넌트
[feat] 청구컴포넌트
- Loading branch information
Showing
45 changed files
with
2,136 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<i class="bi bi-calendar4-range calendar-icon" @click="triggerDateInput"></i> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ResetIconBtnVue', | ||
props: { | ||
func: Function | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.calendar-icon { | ||
@include base-icon; | ||
// cursor: pointer; | ||
color: white; | ||
font-size: 20px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<button class="theme-btn" @click="func"> | ||
<span>{{ title }}</span> | ||
</button> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'ThmemBtnVue', | ||
props: { | ||
title: String, | ||
func: Function | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.theme-btn { | ||
@include flex-box(row, center, 10px); | ||
@include base-button(); | ||
padding: 10px 20px; | ||
background-color: $warning-color; | ||
color: white; | ||
border: none; | ||
font-size: 18px; | ||
font-weight: bold; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<i class="bi bi-calendar4-range calendar-icon" @click="triggerDateInput"></i> | ||
<input | ||
type="date" | ||
ref="dateInput" | ||
:value="modelValue" | ||
@input="updateValue($event.target.value)" | ||
style="visibility: hidden; position: absolute;" | ||
> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'CalendarDateInputVue', | ||
props: { | ||
modelValue: String, | ||
}, | ||
methods: { | ||
triggerDateInput() { | ||
this.$refs.dateInput.showPicker(); | ||
}, | ||
updateValue(value) { | ||
this.$emit('update:modelValue', value); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.calendar-icon { | ||
@include base-icon; | ||
// cursor: pointer; | ||
color: white; | ||
font-size: 20px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<template> | ||
<transition name="fade"> | ||
<div v-if="isVisible" class="modal-overlay"> | ||
<div class="modal-content"> | ||
<ModalHeaderVue :title="title" :closeModal="closeModal" /> | ||
<div class="modal-main"> | ||
<TitleSelectVue title="결제 수단" :selectedIdx="invoiceCreateStore.paymentTypeIdx" | ||
:keywordArr="invoiceCreateStore.paymentType" :choiceFunc="setPaymentType" /> | ||
<InfoInputVue title="청구금" v-model="chargeAmount" type="number" /> | ||
<InfoInputVue title="약정일" type="date" v-model="contractDate" /> | ||
<InfoInputVue title="납부기한" type="date" v-model="dueDate" /> | ||
</div> | ||
<ModalFooterVue :title="title" :errorMsg="errorMsg" :func="createInvoice" /> | ||
</div> | ||
</div> | ||
</transition> | ||
</template> | ||
|
||
<script> | ||
import ModalHeaderVue from '../../common/modal/ModalHeader.vue'; | ||
import ModalFooterVue from '../../common/modal/ModalFooter.vue'; | ||
import InfoInputVue from '@/components/common/input/InfoInput.vue'; | ||
import TitleSelectVue from '@/components/common/select/TitleSelect.vue'; | ||
import { useInvoiceCreateStore } from '@/stores/invoice/invoiceCreate'; | ||
import { useContractDetailStore } from '@/stores/contract/contractDetail'; | ||
import { mapStores } from 'pinia'; | ||
import { createInvoice } from '@/utils/invoice'; | ||
export default { | ||
name: 'InvoiceCreateModalVue', | ||
components: { | ||
ModalHeaderVue, | ||
ModalFooterVue, | ||
InfoInputVue, | ||
TitleSelectVue | ||
}, | ||
props: { | ||
'isVisible': Boolean, | ||
'closeModal': Function, | ||
}, | ||
data() { | ||
return { | ||
title: '청구 생성', | ||
errorMsg: '', | ||
} | ||
}, | ||
computed: { | ||
...mapStores(useInvoiceCreateStore), | ||
...mapStores(useContractDetailStore), | ||
chargeAmount: { | ||
get() { | ||
return this.invoiceCreateStore.data.chargeAmount; | ||
}, | ||
set(value) { | ||
this.invoiceCreateStore.data.chargeAmount = value; | ||
} | ||
}, | ||
contractDate: { | ||
get() { | ||
return this.invoiceCreateStore.data.contractDate; | ||
}, | ||
set(value) { | ||
this.invoiceCreateStore.data.contractDate = value; | ||
} | ||
}, | ||
dueDate: { | ||
get() { | ||
return this.invoiceCreateStore.data.dueDate; | ||
}, | ||
set(value) { | ||
this.invoiceCreateStore.data.dueDate = value; | ||
} | ||
}, | ||
}, | ||
watch: { | ||
isVisible(newVal) { | ||
if (newVal) this.selectContact(); | ||
}, | ||
}, | ||
methods: { | ||
// 현재 데이터 표시 | ||
selectContact() { | ||
this.invoiceCreateStore.$reset(); | ||
this.invoiceCreateStore.setContract(this.contractDetailStore.data) | ||
}, | ||
setPaymentType(idx) { | ||
this.invoiceCreateStore.setPaymentTypeIdx(idx) | ||
}, | ||
async createInvoice() { | ||
const result = await createInvoice(); | ||
if (result.code === 200) { | ||
this.$router.push(`/invoice/${result.data}`); | ||
} else { | ||
this.errorMsg = result.message; | ||
} | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import '@/assets/scss/component/modal.scss'; | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<template> | ||
<table class="contract-table"> | ||
<thead> | ||
<TableHaederVue :store="invoiceListStore" | ||
:excludeColumnArr="['contractId', 'itemName', 'memberName', 'createdAt', 'paymentType']" /> | ||
<ContractInvoiceTableFilterVue /> | ||
</thead> | ||
<tbody> | ||
<ContractInvoiceTableRowVue v-for="(invoice, idx) in invoiceListStore.invoiceList" :key="idx" :invoiceData="invoice" /> | ||
</tbody> | ||
</table> | ||
</template> | ||
|
||
<script> | ||
import { mapActions, mapStores } from 'pinia'; | ||
import { useInvoiceListStore } from '@/stores/invoice/invoiceList'; | ||
import { getInvoiceList } from '@/utils/invoice'; | ||
import TableHaederVue from '@/components/common/table/TableHaeder.vue'; | ||
import ContractInvoiceTableFilterVue from './ContractInvoiceTableFilter.vue'; | ||
import ContractInvoiceTableRowVue from './ContractInvoiceTableRow.vue'; | ||
export default { | ||
name: 'ContractInvoiceTableVue', | ||
components: { | ||
TableHaederVue, | ||
ContractInvoiceTableFilterVue, | ||
ContractInvoiceTableRowVue | ||
}, | ||
computed: { | ||
...mapStores(useInvoiceListStore), | ||
}, | ||
methods: { | ||
...mapActions(useInvoiceListStore, ['setColumnSort']), | ||
async getInvoiceList() { | ||
const result = await getInvoiceList(); | ||
if (result.code !== 200) { | ||
// 예외 처리 | ||
} | ||
}, | ||
setupWatchers() { | ||
this.$watch('invoiceListStore.size', this.getInvoiceList); | ||
this.$watch('invoiceListStore.page', this.getInvoiceList); | ||
this.$watch('invoiceListStore.columns', this.getInvoiceList, { deep: true }); | ||
this.invoiceListStore.filters.forEach(filter => { | ||
if (filter.data !== 'itemName' && filter.data !== 'memberName') { | ||
this.$watch(() => filter.value, this.getInvoiceList); | ||
} | ||
}); | ||
}, | ||
}, | ||
async mounted() { | ||
this.invoiceListStore.$reset(); | ||
this.invoiceListStore.setFilter('contractId', this.$route.params.id); | ||
await this.getInvoiceList(); | ||
this.setupWatchers(); | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import "@/assets/scss/component/table.scss"; | ||
.contract-table { | ||
@include base-table(); | ||
} | ||
</style> |
Oops, something went wrong.