fix floating errors

This commit is contained in:
Mohit Panjwani
2020-12-31 12:16:04 +05:30
parent 0f1d7627ea
commit b55f8e5391
11 changed files with 498 additions and 466 deletions

View File

@ -1,20 +1,20 @@
<template>
<base-page>
<!-- Page Header -->
<sw-page-header class="mb-3" :title="pageTitle">
<sw-page-header :title="pageTitle" class="mb-3">
<sw-breadcrumb slot="breadcrumbs">
<sw-breadcrumb-item to="/admin/dashboard" :title="$t('general.home')" />
<sw-breadcrumb-item to="/admin/items" :title="$tc('items.item', 2)" />
<sw-breadcrumb-item :title="$t('general.home')" to="/admin/dashboard" />
<sw-breadcrumb-item :title="$tc('items.item', 2)" to="/admin/items" />
<sw-breadcrumb-item
v-if="$route.name === 'items.edit'"
to="#"
:title="$t('items.edit_item')"
to="#"
active
/>
<sw-breadcrumb-item
v-else
to="#"
:title="$t('items.new_item')"
to="#"
active
/>
</sw-breadcrumb>
@ -59,11 +59,11 @@
<sw-input-group :label="$t('items.unit')" class="mb-4">
<sw-select
v-model="formData.unit"
class="mt-2"
:options="itemUnits"
:searchable="true"
:show-labels="false"
:placeholder="$t('items.select_a_unit')"
class="mt-2"
label="name"
>
<div
@ -89,12 +89,12 @@
>
<sw-select
v-model="formData.taxes"
class="mt-2"
:options="getTaxTypes"
:searchable="true"
:show-labels="false"
:allow-empty="true"
:multiple="true"
class="mt-2"
track-by="tax_type_id"
label="tax_name"
/>
@ -187,7 +187,7 @@ export default {
return this.formData.price / 100
},
set: function (newValue) {
this.formData.price = newValue * 100
this.formData.price = Math.round(newValue * 100)
},
},

View File

@ -2,8 +2,8 @@
<base-page>
<sw-page-header :title="$t('items.title')">
<sw-breadcrumb slot="breadcrumbs">
<sw-breadcrumb-item to="dashboard" :title="$t('general.home')" />
<sw-breadcrumb-item to="#" :title="$tc('items.item', 2)" active />
<sw-breadcrumb-item :title="$t('general.home')" to="dashboard" />
<sw-breadcrumb-item :title="$tc('items.item', 2)" to="#" active />
</sw-breadcrumb>
<template slot="actions">
@ -50,9 +50,9 @@
v-model="filters.unit"
:options="itemUnits"
:searchable="true"
class="mt-2"
:show-labels="false"
:placeholder="$t('items.select_a_unit')"
class="mt-2"
label="name"
autocomplete="off"
/>
@ -225,8 +225,8 @@
<dot-icon slot="activator" />
<sw-dropdown-item
tag-name="router-link"
:to="`items/${row.id}/edit`"
tag-name="router-link"
>
<pencil-icon class="h-5 mr-3 text-gray-600" />
{{ $t('general.edit') }}
@ -356,7 +356,7 @@ export default {
let data = {
search: this.filters.name !== null ? this.filters.name : '',
unit_id: this.filters.unit !== null ? this.filters.unit.id : '',
price: this.filters.price * 100,
price: Math.round(this.filters.price * 100),
orderByField: sort.fieldName || 'created_at',
orderBy: sort.order || 'desc',
page,