Wizard page re-factoring..
This commit is contained in:
@ -13,42 +13,35 @@
|
||||
<script>
|
||||
export default {
|
||||
name: "Wizard",
|
||||
|
||||
created() {
|
||||
let self = this;
|
||||
this.translations = wizard_translations;
|
||||
this.company = wizard_company;
|
||||
this.currencies = wizard_currencies;
|
||||
this.currency_codes = wizard_currency_codes;
|
||||
this.taxes = wizard_taxes;
|
||||
this.modules = wizard_modules;
|
||||
|
||||
window
|
||||
.axios({
|
||||
method: "GET",
|
||||
url: url + "/wizard/data",
|
||||
})
|
||||
.then((response) => {
|
||||
let data = response.data.data;
|
||||
Object.keys(this.currency_codes).map((key) => {
|
||||
return this.currency_codes[key];
|
||||
});
|
||||
|
||||
for (let item in data) {
|
||||
self[item] = data[item];
|
||||
}
|
||||
|
||||
Object.keys(data.currency_codes).map((key) => {
|
||||
return data.currency_codes[key];
|
||||
});
|
||||
|
||||
self.page_loaded = false;
|
||||
});
|
||||
this.page_loaded = false;
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
currencies: [],
|
||||
currency_codes: [],
|
||||
taxes: [],
|
||||
modules: {},
|
||||
company: {},
|
||||
translations: {
|
||||
company: {},
|
||||
currencies: {},
|
||||
taxes: {},
|
||||
finish: {},
|
||||
},
|
||||
company: {},
|
||||
currencies: [],
|
||||
currency_codes: [],
|
||||
taxes: [],
|
||||
modules: {},
|
||||
page_loaded: true
|
||||
};
|
||||
},
|
||||
|
@ -1,115 +1,117 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1 class="text-white">
|
||||
{{ translations.company.title }}
|
||||
</h1>
|
||||
<div class="card">
|
||||
<div class="card-header wizard-header p-3">
|
||||
<el-steps :active="active" finish-status="success" align-center>
|
||||
<el-step :title="translations.company.title"></el-step>
|
||||
<el-step :title="translations.currencies.title"></el-step>
|
||||
<el-step :title="translations.taxes.title"></el-step>
|
||||
<el-step :title="translations.finish.title"></el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
<form ref="form" class="w-100">
|
||||
<div class="card-body">
|
||||
<div class="document-loading" v-if="pageLoad">
|
||||
<div>
|
||||
<i class="fas fa-spinner fa-pulse fa-7x"></i>
|
||||
<div>
|
||||
<h1 class="text-white">
|
||||
{{ translations.company.title }}
|
||||
</h1>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header wizard-header p-3">
|
||||
<el-steps :active="active" finish-status="success" align-center>
|
||||
<el-step :title="translations.company.title"></el-step>
|
||||
<el-step :title="translations.currencies.title"></el-step>
|
||||
<el-step :title="translations.taxes.title"></el-step>
|
||||
<el-step :title="translations.finish.title"></el-step>
|
||||
</el-steps>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-4">
|
||||
<div class="col-12 mb-4">
|
||||
<base-input
|
||||
:label="translations.company.api_key"
|
||||
name="api_key"
|
||||
data-name="api_key"
|
||||
:placeholder="translations.company.api_key"
|
||||
prepend-icon="fas fa-key"
|
||||
v-model="company.api_key"
|
||||
/>
|
||||
<p class="mb-0 mt--3">
|
||||
<small>
|
||||
<div>
|
||||
<a href="https://akaunting.com/dashboard" target="_blank"
|
||||
>Click here</a
|
||||
>
|
||||
to get your API key.
|
||||
</div>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-6 mb-4">
|
||||
<base-input
|
||||
type="text"
|
||||
:label="translations.company.tax_number"
|
||||
name="tax_number"
|
||||
data-name="tax_number"
|
||||
:placeholder="translations.company.tax_number"
|
||||
prepend-icon="fas fa-percent"
|
||||
v-model="company.tax_number"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6 mb-4">
|
||||
<akaunting-date
|
||||
:title="translations.company.financial_start"
|
||||
data-name="financial_start"
|
||||
:placeholder="translations.company.financial_start"
|
||||
icon="fas fa-calendar"
|
||||
:date-config="{
|
||||
dateFormat: 'd-m',
|
||||
allowInput: true,
|
||||
altInput: true,
|
||||
altFormat: 'j F',
|
||||
}"
|
||||
v-model="real_date"
|
||||
></akaunting-date>
|
||||
</div>
|
||||
<div class="col-12 mb-4">
|
||||
<base-input :label="translations.company.address">
|
||||
<textarea
|
||||
class="form-control"
|
||||
name="address"
|
||||
data-name="address"
|
||||
rows="3"
|
||||
:placeholder="translations.company.address"
|
||||
v-model="company.address"
|
||||
></textarea>
|
||||
</base-input>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<label class="form-control-label">{{
|
||||
translations.company.logo
|
||||
}}</label>
|
||||
<akaunting-dropzone-file-upload
|
||||
ref="dropzoneWizard"
|
||||
preview-classes="single"
|
||||
:attachments="logo"
|
||||
:v-model="logo"
|
||||
>
|
||||
</akaunting-dropzone-file-upload>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form ref="form" class="w-100 mb-0">
|
||||
<div class="card-body">
|
||||
<div class="document-loading" v-if="pageLoad">
|
||||
<div>
|
||||
<i class="fas fa-spinner fa-pulse fa-7x"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-12 mb-4">
|
||||
<base-input
|
||||
:label="translations.company.api_key"
|
||||
name="api_key"
|
||||
data-name="api_key"
|
||||
:placeholder="translations.company.api_key"
|
||||
prepend-icon="fas fa-key"
|
||||
v-model="company.api_key"
|
||||
/>
|
||||
|
||||
<p class="mb-0 mt--3">
|
||||
<small>
|
||||
<div>
|
||||
<a href="https://akaunting.com/dashboard" target="_blank">Click here</a>
|
||||
to get your API key.
|
||||
</div>
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<base-input
|
||||
type="text"
|
||||
:label="translations.company.tax_number"
|
||||
name="tax_number"
|
||||
data-name="tax_number"
|
||||
:placeholder="translations.company.tax_number"
|
||||
prepend-icon="fas fa-percent"
|
||||
v-model="company.tax_number"
|
||||
/>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<akaunting-date
|
||||
:title="translations.company.financial_start"
|
||||
data-name="financial_start"
|
||||
:placeholder="translations.company.financial_start"
|
||||
icon="fas fa-calendar"
|
||||
:date-config="{
|
||||
dateFormat: 'd-m',
|
||||
allowInput: true,
|
||||
altInput: true,
|
||||
altFormat: 'j F',
|
||||
}"
|
||||
v-model="real_date"
|
||||
></akaunting-date>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<base-input :label="translations.company.address">
|
||||
<textarea
|
||||
class="form-control"
|
||||
name="address"
|
||||
data-name="address"
|
||||
rows="3"
|
||||
:placeholder="translations.company.address"
|
||||
v-model="company.address"
|
||||
></textarea>
|
||||
</base-input>
|
||||
</div>
|
||||
|
||||
<div class="col-3 mb-0">
|
||||
<label class="form-control-label">{{ translations.company.logo }}</label>
|
||||
<akaunting-dropzone-file-upload
|
||||
ref="dropzoneWizard"
|
||||
preview-classes="single"
|
||||
:attachments="logo"
|
||||
:v-model="logo"
|
||||
>
|
||||
</akaunting-dropzone-file-upload>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<base-button
|
||||
id="button"
|
||||
type="success"
|
||||
native-type="button"
|
||||
@click="onEditSave()"
|
||||
>{{ translations.company.save }}</base-button>
|
||||
|
||||
<base-button type="white" native-type="submit" @click="next()">{{ translations.company.skip }}</base-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-right">
|
||||
<base-button
|
||||
id="button"
|
||||
type="success"
|
||||
native-type="button"
|
||||
@click="onEditSave()"
|
||||
>{{ translations.company.save }}</base-button
|
||||
>
|
||||
<base-button type="white" native-type="submit" @click="next()">{{
|
||||
translations.company.skip
|
||||
}}</base-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
Reference in New Issue
Block a user