styling..

This commit is contained in:
Cüneyt Şentürk 2021-05-30 17:17:37 +03:00
parent 1d3cbadcb5
commit 03fce57394
4 changed files with 371 additions and 340 deletions

View File

@ -116,25 +116,31 @@ import WizardAction from "./../../mixins/wizardAction";
export default { export default {
name: "Company", name: "Company",
mixins: [WizardAction], mixins: [WizardAction],
components: { components: {
[Step.name]: Step, [Step.name]: Step,
[Steps.name]: Steps, [Steps.name]: Steps,
AkauntingDropzoneFileUpload, AkauntingDropzoneFileUpload,
AkauntingDate, AkauntingDate,
}, },
props: { props: {
company: { company: {
type: [Object, Array], type: [Object, Array],
}, },
translations: { translations: {
type: [Object, Array], type: [Object, Array],
}, },
url: { url: {
type: String, type: String,
default: "text", default: "text",
}, },
}, },
data() { data() {
return { return {
active: 0, active: 0,
@ -142,28 +148,25 @@ export default {
real_date: "", real_date: "",
}; };
}, },
mounted() { mounted() {
let company_data = this.company; let company_data = this.company;
this.onDataWatch(company_data); this.onDataWatch(company_data);
}, },
watch: {
company: function (company) {
this.onDataWatch(company);
},
},
methods: { methods: {
onDataWatch(company) { onDataWatch(company) {
if (Object.keys(company).length) { if (Object.keys(company).length) {
let logo_arr = [ let logo_arr = [{
{
id: company.logo.id, id: company.logo.id,
name: company.logo.filename + "." + company.logo.extension, name: company.logo.filename + "." + company.logo.extension,
path: company.logo.path, path: company.logo.path,
type: company.logo.mime_type, type: company.logo.mime_type,
size: company.logo.size, size: company.logo.size,
downloadPath: false, downloadPath: false,
}, }];
];
this.logo.push(logo_arr); this.logo.push(logo_arr);
this.real_date = company.financial_start; this.real_date = company.financial_start;
} }
@ -175,6 +178,7 @@ export default {
if (name == "previewElement" || name == "previewTemplate") { if (name == "previewElement" || name == "previewTemplate") {
continue; continue;
} }
if (wrapper) { if (wrapper) {
if ( if (
(typeof data[name] == "object" || Array.isArray(data[name])) && (typeof data[name] == "object" || Array.isArray(data[name])) &&
@ -200,6 +204,7 @@ export default {
}; };
const formData = new FormData(this.$refs["form"]); const formData = new FormData(this.$refs["form"]);
let data_name = {}; let data_name = {};
for (let [key, val] of formData.entries()) { for (let [key, val] of formData.entries()) {
@ -215,8 +220,8 @@ export default {
} }
formData.appendRecursive(data_name); formData.appendRecursive(data_name);
window
.axios({ window.axios({
method: "POST", method: "POST",
url: url + "/wizard/companies", url: url + "/wizard/companies",
data: formData, data: formData,
@ -239,5 +244,11 @@ export default {
this.$router.push("/wizard/currencies"); this.$router.push("/wizard/currencies");
}, },
}, },
watch: {
company: function (company) {
this.onDataWatch(company);
},
},
}; };
</script> </script>

View File

@ -300,7 +300,9 @@ import WizardAction from "./../../mixins/wizardAction";
export default { export default {
name: "Currencies", name: "Currencies",
mixins: [MixinsGlobal, WizardAction], mixins: [MixinsGlobal, WizardAction],
components: { components: {
[Step.name]: Step, [Step.name]: Step,
[Steps.name]: Steps, [Steps.name]: Steps,
@ -308,26 +310,32 @@ export default {
[Option.name]: Option, [Option.name]: Option,
AkauntingRadioGroup, AkauntingRadioGroup,
}, },
props: { props: {
currencies: { currencies: {
type: [Object, Array], type: [Object, Array],
}, },
currency_codes: { currency_codes: {
type: [Object, Array], type: [Object, Array],
}, },
translations: { translations: {
type: [Object, Array], type: [Object, Array],
}, },
}, },
data() { data() {
return { return {
active: 1, active: 1,
bulk_action: new BulkAction(url + "/settings/currencies"), bulk_action: new BulkAction(url + "/settings/currencies"),
}; };
}, },
methods: { methods: {
onSwitchUpdate(item) { onSwitchUpdate(item) {
this.onStatus(item.id, event); this.onStatus(item.id, event);
this.onStatusControl(this.currencies, item.id, event); this.onStatusControl(this.currencies, item.id, event);
}, },
@ -369,8 +377,7 @@ export default {
}); });
} }
window window.axios({
.axios({
method: "GET", method: "GET",
url: url + "/settings/currencies/config", url: url + "/settings/currencies/config",
params: { params: {
@ -384,6 +391,7 @@ export default {
data.symbol_first = response.data.symbol_first; data.symbol_first = response.data.symbol_first;
data.decimal_mark = response.data.decimal_mark; data.decimal_mark = response.data.decimal_mark;
data.thousands_separator = response.data.thousands_separator; data.thousands_separator = response.data.thousands_separator;
this.model.rate = response.data.rate; this.model.rate = response.data.rate;
}, this); }, this);
}, },
@ -410,6 +418,7 @@ export default {
prev() { prev() {
if (this.active-- > 2); if (this.active-- > 2);
history.back() history.back()
this.$router.push("/wizard/companies"); this.$router.push("/wizard/companies");
}, },

View File

@ -1,5 +1,5 @@
<template> <template>
<div v-if="is_loaded"> <div>
<h1 class="text-white">{{ translations.finish.title }}</h1> <h1 class="text-white">{{ translations.finish.title }}</h1>
<div class="card"> <div class="card">
<div class="card-header wizard-header p-3"> <div class="card-header wizard-header p-3">
@ -88,20 +88,35 @@ import { Step, Steps } from "element-ui";
export default { export default {
name: "Finish", name: "Finish",
components: { components: {
[Step.name]: Step, [Step.name]: Step,
[Steps.name]: Steps, [Steps.name]: Steps,
}, },
props: {
modules: {
type: [Object, Array],
},
translations: {
type: [Object, Array],
}
},
data() {
return {
active: 3,
route_url: url,
};
},
created() { created() {
window window.axios({
.axios({
method: "PATCH", method: "PATCH",
url: url + "/wizard/finish", url: url + "/wizard/finish",
}) })
.then((response) => { .then((response) => {
if (response.status == "200") {
this.is_loaded = true;
}
}) })
.catch((error) => { .catch((error) => {
this.$notify({ this.$notify({
@ -114,25 +129,14 @@ export default {
this.prev(); this.prev();
}); });
}, },
props: {
modules: {
type: [Object, Array],
},
translations: {
type: [Object, Array],
}
},
data() {
return {
active: 3,
route_url: url,
is_loaded: false
};
},
methods: { methods: {
prev() { prev() {
if (this.active-- > 2); this.active--;
if (this.active > 2) {
this.$router.push("/wizard/taxes"); this.$router.push("/wizard/taxes");
}
}, },
finish() { finish() {

View File

@ -230,29 +230,36 @@ import WizardAction from "./../../mixins/wizardAction";
export default { export default {
name: "Taxes", name: "Taxes",
mixins: [MixinsGlobal, WizardAction], mixins: [MixinsGlobal, WizardAction],
components: { components: {
[Step.name]: Step, [Step.name]: Step,
[Steps.name]: Steps, [Steps.name]: Steps,
AkauntingRadioGroup, AkauntingRadioGroup,
}, },
props: { props: {
taxes: { taxes: {
type: [Object, Array], type: [Object, Array],
}, },
translations: { translations: {
type: [Object, Array], type: [Object, Array],
}, },
}, },
data() { data() {
return { return {
active: 2, active: 2,
bulk_action: new BulkAction(url + "/settings/taxes"), bulk_action: new BulkAction(url + "/settings/taxes"),
}; };
}, },
methods: { methods: {
onSwitchUpdate(item) { onSwitchUpdate(item) {
this.onStatus(item.id, event); this.onStatus(item.id, event);
this.onStatusControl(this.taxes, item.id, event); this.onStatusControl(this.taxes, item.id, event);
}, },