Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
Milestone 1: Fix various bugs and update flow (#371)
Browse files Browse the repository at this point in the history
Milestone 1: Fix various bugs and update flow

Co-authored-by: Lê Thị Thảo Trâm <sawa.kisei@gmail.com>
  • Loading branch information
phamhongphuc and sawakisei committed Jun 2, 2019
2 parents 800a4c0 + 9b67c10 commit e09e068
Show file tree
Hide file tree
Showing 20 changed files with 677 additions and 597 deletions.
7 changes: 6 additions & 1 deletion uit.hotel.client/.stylelintrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"plugins": ["stylelint-scss"],
"plugins": [
"stylelint-scss",
"stylelint-order",
"stylelint-config-rational-order/plugin"
],
"extends": [
"stylelint-config-standard",
"stylelint-config-rational-order",
"stylelint-config-recommended-scss",
"stylelint-config-prettier"
],
Expand Down
2 changes: 1 addition & 1 deletion uit.hotel.client/assets/scss/before/variables/color.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $body-bg: #f2f2f2;
$body-color: lighten(#212529, 25%);
$gray: #f5f6fa;
$blue: #507af2;
$green: #c2f2d7;
$green: #28a745;
$light-blue: #bde7ff;
$dark-blue: #9abeff;
$light-red: #f39190;
Expand Down
4 changes: 4 additions & 0 deletions uit.hotel.client/assets/scss/global/components/table.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.table {
margin-bottom: 0;
& + .table-after {
padding: map-get($spacers, 3);
text-align: center;
}
}

.table-cell-middle {
Expand Down
10 changes: 7 additions & 3 deletions uit.hotel.client/components/graphql/query.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ export default class extends Vue {
> div > .query-text {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
margin: auto;
padding: map-get($spacers, 3);
}
&.query-fill {
display: flex;
flex: 1;
flex-basis: auto;
flex-grow: 0;
flex-shrink: 1;
overflow: hidden;
@include row-like;
> div {
Expand All @@ -68,8 +72,8 @@ export default class extends Vue {
background-color: $white;
border-radius: $border-radius;
box-shadow: $box-shadow-sm;
> div {
width: fit-content;
> div:not(.table-after):not(.query-text) {
min-width: fit-content;
padding: map-get($spacers, 2);
}
}
Expand Down
7 changes: 6 additions & 1 deletion uit.hotel.client/components/popup-context/popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
<div ref="popup" class="popup-modal m-3" @click.stop>
<div class="popup-modal-title">
<div class="text">{{ title }}</div>
<b-button variant="white" class="close" @click="close">
<b-button
variant="white"
class="close shadow-none"
@click="close"
>
<icon- class="m-0 w-auto" i="x" />
</b-button>
</div>
Expand Down Expand Up @@ -84,6 +88,7 @@ export default class extends mixins<ClickawayMixin>(ClickawayMixin) {
min-height: $input-height;
padding: 0;
border: none;
border-radius: 0 $border-radius 0 0;
}
}
}
Expand Down
144 changes: 74 additions & 70 deletions uit.hotel.client/pages/business/bill.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,76 +29,80 @@
class="row"
child-class="col m-2 p-0 bg-white rounded shadow-sm overflow-auto"
>
<b-table
slot-scope="{ data: { bills } }"
:items="billsFilter(bills)"
:fields="[
{
key: 'index',
label: '#',
class: 'table-cell-id text-center',
sortable: true,
},
{
key: 'time',
label: 'Thời gian chốt hóa đơn',
tdClass: 'w-100',
},
{
key: 'bookings',
label: 'Phòng',
class: 'text-right text-nowrap',
},
{
key: 'receipts',
label: 'Số lần',
class: 'text-right',
},
{
key: 'totalReceipts',
label: 'Đã thanh toán',
class: 'text-right',
},
{
key: 'total',
label: 'Tổng cộng',
class: 'text-right',
},
]"
class="table-style"
@row-clicked="
(bill, $index, $event) => {
$event.stopPropagation();
$refs.context_bill.open(currentEvent || $event, {
bill,
});
currentEvent = null;
}
"
>
<template slot="index" slot-scope="data">
{{ data.index + 1 }}
</template>
<template slot="time" slot-scope="{ value }">
{{
moment(value).year() === 1
? 'Chưa chốt hóa đơn'
: toDate(value)
}}
</template>
<template slot="bookings" slot-scope="{ value }">
{{ value.length }} phòng
</template>
<template slot="receipts" slot-scope="{ value }">
{{ value.length }} lần
</template>
<template slot="totalReceipts" slot-scope="{ item }">
{{ toMoney(sumReceipts(item.receipts)) }}
</template>
<template slot="total" slot-scope="{ value }">
{{ toMoney(value) }}
</template>
</b-table>
<template slot-scope="{ data: { bills } }">
<b-table
:items="billsFilter(bills)"
:fields="[
{
key: 'index',
label: '#',
class: 'table-cell-id text-center',
sortable: true,
},
{
key: 'time',
label: 'Thời gian chốt hóa đơn',
tdClass: 'w-100',
},
{
key: 'bookings',
label: 'Phòng',
class: 'text-right text-nowrap',
},
{
key: 'receipts',
label: 'Số lần',
class: 'text-right',
},
{
key: 'totalReceipts',
label: 'Đã thanh toán',
class: 'text-right',
},
{
key: 'total',
label: 'Tổng cộng',
class: 'text-right',
},
]"
class="table-style"
@row-clicked="
(bill, $index, $event) => {
$event.stopPropagation();
$refs.context_bill.open(currentEvent || $event, {
bill,
});
currentEvent = null;
}
"
>
<template slot="index" slot-scope="data">
{{ data.index + 1 }}
</template>
<template slot="time" slot-scope="{ value }">
{{
moment(value).year() === 1
? 'Chưa chốt hóa đơn'
: toDate(value)
}}
</template>
<template slot="bookings" slot-scope="{ value }">
{{ value.length }} phòng
</template>
<template slot="receipts" slot-scope="{ value }">
{{ value.length }} lần
</template>
<template slot="totalReceipts" slot-scope="{ item }">
{{ toMoney(sumReceipts(item.receipts)) }}
</template>
<template slot="total" slot-scope="{ value }">
{{ toMoney(value) }}
</template>
</b-table>
<div v-if="billsFilter(bills).length === 0" class="table-after">
Không tìm thấy hóa đơn nào
</div>
</template>
</query->
<context-manage-bill- ref="context_bill" :refs="$refs" />
<popup-receipt-add- ref="receipt_add" />
Expand Down
122 changes: 63 additions & 59 deletions uit.hotel.client/pages/business/rate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,65 +21,69 @@
class="row"
child-class="col m-2 p-0 bg-white rounded shadow-sm overflow-auto"
>
<b-table
slot-scope="{ data: { rates } }"
:items="ratesFilter(rates)"
:fields="[
{
key: 'index',
label: '#',
class: 'table-cell-id text-center',
sortable: true,
},
{
key: 'dayRate',
label: 'Tên giá cơ bản',
tdClass: 'w-100',
},
{
key: 'createDate',
label: 'Ngày tạo',
tdClass: 'text-nowrap text-left',
},
{
key: 'effectiveStartDate',
label: 'Có hiệu lực từ',
tdClass: 'text-nowrap text-center',
},
{
key: 'roomKind',
label: 'Loại phòng',
tdClass: 'text-nowrap text-center',
},
]"
class="table-style"
@row-clicked="
(rate, $index, $event) => {
$event.stopPropagation();
$refs.context_rate.open(currentEvent || $event, {
rate,
rates,
});
currentEvent = null;
}
"
>
<template slot="index" slot-scope="data">
{{ data.index + 1 }}
</template>
<template slot="createDate" slot-scope="{ value }">
{{ toDate(value) }}
</template>
<template slot="effectiveStartDate" slot-scope="{ value }">
{{ toDate(value) }}
</template>
<template slot="dayRate" slot-scope="{ value }">
{{ toMoney(value) }}
</template>
<template slot="roomKind" slot-scope="{ value }">
{{ value.name }}
</template>
</b-table>
<template slot-scope="{ data: { rates } }">
<b-table
:items="ratesFilter(rates)"
:fields="[
{
key: 'index',
label: '#',
class: 'table-cell-id text-center',
sortable: true,
},
{
key: 'dayRate',
label: 'Tên giá cơ bản',
tdClass: 'w-100',
},
{
key: 'createDate',
label: 'Ngày tạo',
tdClass: 'text-nowrap text-left',
},
{
key: 'effectiveStartDate',
label: 'Có hiệu lực từ',
tdClass: 'text-nowrap text-center',
},
{
key: 'roomKind',
label: 'Loại phòng',
tdClass: 'text-nowrap text-center',
},
]"
class="table-style"
@row-clicked="
(rate, $index, $event) => {
$event.stopPropagation();
$refs.context_rate.open(currentEvent || $event, {
rate,
rates,
});
currentEvent = null;
}
"
>
<template slot="index" slot-scope="data">
{{ data.index + 1 }}
</template>
<template slot="createDate" slot-scope="{ value }">
{{ toDate(value) }}
</template>
<template slot="effectiveStartDate" slot-scope="{ value }">
{{ toDate(value) }}
</template>
<template slot="dayRate" slot-scope="{ value }">
{{ toMoney(value) }}
</template>
<template slot="roomKind" slot-scope="{ value }">
{{ value.name }}
</template>
</b-table>
<div v-if="ratesFilter(rates).length === 0" class="table-after">
Không tìm thấy giá nào
</div>
</template>
</query->
<context-manage-rate- ref="context_rate" :refs="$refs" />
<popup-rate-add- ref="rate_add" />
Expand Down

0 comments on commit e09e068

Please sign in to comment.