2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00

Merge branch 'move-to-vue' of https://github.com/frappe/accounting into move-to-vue

This commit is contained in:
Suraj Shetty 2018-06-25 14:04:48 +05:30
commit a5766b7516
6 changed files with 22 additions and 24 deletions

View File

@ -1,3 +1,3 @@
module.exports = { module.exports = {
'General Ledger': require('./GeneralLedger/viewConfig') 'general-ledger': require('./GeneralLedger/viewConfig')
} }

View File

@ -4,7 +4,7 @@
<router-view /> <router-view />
</frappe-desk> </frappe-desk>
<router-view v-else name="setup" /> <router-view v-else name="setup" />
<frappe-modal ref="modal" :show="showModal" v-bind="modalOptions" /> <frappe-modal ref="modal" :show="showModal" v-bind="modalOptions" @close-modal="showModal = false"/>
</div> </div>
</template> </template>

View File

@ -15,12 +15,12 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<component :is="footerComponent" v-bind="footerProps"/> <component :is="footerComponent" v-bind="footerProps"/>
<button type="button" class="btn btn-secondary" @click="closeModal">Close</button> <f-button secondary @click="closeModal">Close</f-button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="modal-backdrop show" v-show="show"></div> <div class="modal-backdrop show" v-show="show" @click="closeModal"></div>
</div> </div>
</template> </template>
<script> <script>
@ -57,7 +57,7 @@ export default {
}, },
methods: { methods: {
closeModal() { closeModal() {
this.$modal.hide(); this.$emit('close-modal');
} }
} }
}; };

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="p-4"> <div class="p-4">
<h4 class="pb-2">{{ reportName }}</h4> <h4 class="pb-2">{{ reportConfig.title }}</h4>
<report-filters v-if="reportConfig.filterFields.length" :filters="reportConfig.filterFields" @change="getReportData"></report-filters> <report-filters v-if="reportConfig.filterFields.length" :filters="reportConfig.filterFields" @change="getReportData"></report-filters>
<div class="pt-2" ref="datatable" v-once></div> <div class="pt-2" ref="datatable" v-once></div>
</div> </div>
@ -14,18 +14,16 @@ import frappe from 'frappejs'
import FrappeControl from './controls/FrappeControl' import FrappeControl from './controls/FrappeControl'
import ReportFilters from './ReportFilters' import ReportFilters from './ReportFilters'
import utils from 'frappejs/client/ui/utils' import utils from 'frappejs/client/ui/utils'
import getReportViewConfig from '../../reports/view' import reportViewConfig from '../../reports/view'
export default { export default {
props: ['reportName'], props: ['reportName'],
data() {
return {
'reportConfig': getReportViewConfig[this.reportName]
}
},
computed: { computed: {
reportColumns() { reportColumns() {
return utils.convertFieldsToDatatableColumns(this.reportConfig.getColumns()) return utils.convertFieldsToDatatableColumns(this.reportConfig.getColumns())
},
reportConfig() {
return reportViewConfig[this.reportName]
} }
}, },
methods: { methods: {

View File

@ -34,8 +34,6 @@ export default {
isActive(item) { isActive(item) {
if (this.$route.params.doctype) { if (this.$route.params.doctype) {
return this.$route.params.doctype === item.label; return this.$route.params.doctype === item.label;
} else if(this.$route.params.reportName) {
return this.$route.params.reportName === item.label;
} }
const route = item.route.slice(1); const route = item.route.slice(1);
return this.$route.path === route; return this.$route.path === route;

View File

@ -1,39 +1,41 @@
const { _ } = require('frappejs/utils');
export default [ export default [
{ {
items: [ items: [
{ {
label: 'ToDo', route: '#/list/ToDo' label: _('ToDo'), route: '#/list/ToDo'
}, },
{ {
label: 'Event', route: '#/list/Event' label: _('Event'), route: '#/list/Event'
} }
] ]
}, },
{ {
title: 'Masters', title: _('Masters'),
items: [ items: [
{ {
label: 'Item', route: '#/list/Item' label: _('Item'), route: '#/list/Item'
}, },
{ {
label: 'Party', route: '#/list/Party' label: _('Party'), route: '#/list/Party'
}, },
{ {
label: 'Invoice', route: '#/list/Invoice' label: _('Invoice'), route: '#/list/Invoice'
}, },
{ {
label: 'Tax', route: '#/list/Tax' label: _('Tax'), route: '#/list/Tax'
}, },
{ {
label: 'Account', route: '#/list/Account' label: _('Account'), route: '#/list/Account'
} }
] ]
}, },
{ {
title: 'Reports', title: _('Reports'),
items: [ items: [
{ {
label: 'General Ledger', route: '#/report/General Ledger' label: _('General Ledger'), route: '#/report/general-ledger'
} }
] ]
} }