2018-06-11 15:16:25 +05:30
|
|
|
<template>
|
2019-10-24 10:47:01 +05:30
|
|
|
<div class="py-10 flex-1 bg-white">
|
2019-10-13 17:33:01 +05:30
|
|
|
<div class="px-12">
|
|
|
|
<h1 class="text-2xl font-semibold">{{ _('Setup your organization') }}</h1>
|
|
|
|
<p class="text-gray-600">{{ _('These settings can be changed later') }}</p>
|
|
|
|
</div>
|
|
|
|
<div class="px-8 mt-5">
|
|
|
|
<div class="border-t">
|
|
|
|
<div
|
|
|
|
class="grid border-b text-xs"
|
|
|
|
style="grid-template-columns: 1fr 2fr"
|
|
|
|
v-for="df in fields"
|
|
|
|
>
|
|
|
|
<div class="py-2 pl-4 text-gray-600 flex items-center">{{ df.label }}</div>
|
|
|
|
<div class="py-2 pr-4">
|
|
|
|
<FormControl
|
|
|
|
size="small"
|
|
|
|
:df="df"
|
|
|
|
:value="doc[df.fieldname]"
|
|
|
|
@change="value => doc.set(df.fieldname, value)"
|
|
|
|
/>
|
|
|
|
</div>
|
2018-07-14 18:45:21 +05:30
|
|
|
</div>
|
|
|
|
</div>
|
2018-06-11 15:16:25 +05:30
|
|
|
</div>
|
2019-10-13 17:33:01 +05:30
|
|
|
<div class="px-8 flex justify-end mt-5">
|
|
|
|
<Button @click="submit" type="primary" class="text-white text-sm">{{ _('Next') }}</Button>
|
|
|
|
</div>
|
2018-07-14 18:45:21 +05:30
|
|
|
</div>
|
2018-06-11 15:16:25 +05:30
|
|
|
</template>
|
|
|
|
<script>
|
2018-07-05 15:44:49 +05:30
|
|
|
import frappe from 'frappejs';
|
2019-10-13 17:33:01 +05:30
|
|
|
import FormControl from '@/components/Controls/FormControl';
|
|
|
|
import Button from '@/components/Button';
|
2018-06-11 15:16:25 +05:30
|
|
|
|
|
|
|
export default {
|
2018-07-14 18:45:21 +05:30
|
|
|
name: 'SetupWizard',
|
|
|
|
data() {
|
|
|
|
return {
|
2019-02-18 11:52:20 +05:30
|
|
|
meta: frappe.getMeta('SetupWizard'),
|
2019-10-13 17:33:01 +05:30
|
|
|
doc: {}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
provide() {
|
|
|
|
return {
|
|
|
|
doctype: 'SetupWizard',
|
|
|
|
name: 'SetupWizard'
|
2018-07-14 18:45:21 +05:30
|
|
|
};
|
|
|
|
},
|
|
|
|
components: {
|
2019-10-13 17:33:01 +05:30
|
|
|
FormControl,
|
|
|
|
Button
|
2018-07-14 18:45:21 +05:30
|
|
|
},
|
2019-07-24 16:24:34 +05:30
|
|
|
async beforeMount() {
|
|
|
|
this.doc = await frappe.newDoc({ doctype: 'SetupWizard' });
|
2018-07-14 18:45:21 +05:30
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async submit() {
|
2018-10-05 11:05:20 +05:30
|
|
|
try {
|
2018-10-23 18:12:36 +05:30
|
|
|
frappe.events.trigger('SetupWizard:setup-complete', this.doc);
|
2018-10-05 11:05:20 +05:30
|
|
|
} catch (e) {
|
|
|
|
console.error(e);
|
|
|
|
}
|
2018-07-14 18:45:21 +05:30
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
fields() {
|
2019-10-13 17:33:01 +05:30
|
|
|
return this.meta.getQuickEditFields();
|
2018-06-11 15:16:25 +05:30
|
|
|
}
|
2018-07-14 18:45:21 +05:30
|
|
|
}
|
|
|
|
};
|
2018-06-11 15:16:25 +05:30
|
|
|
</script>
|