brotherton-erpnext/erpnext/public/js/hub/pages/Buying.vue

54 lines
1.2 KiB
Vue
Raw Normal View History

2018-08-26 14:39:02 +00:00
<template>
<div>
<section-header>
<h4>{{ __('Buying') }}</h4>
</section-header>
<div class="row" v-if="items">
<div class="col-md-7 margin-bottom"
2018-08-26 14:39:02 +00:00
v-for="item of items"
:key="item.name"
>
<item-list-card
:item="item"
v-route="'marketplace/buying/' + item.name"
>
<div slot="subtitle">
<span>{{item.recent_message.sender}}: </span>
<span>{{item.recent_message.content}}</span>
</div>
</item-list-card>
2018-08-26 14:39:02 +00:00
</div>
</div>
2018-08-27 14:27:12 +00:00
<empty-state v-else :message="__('This page keeps track of items you want to buy from sellers.')" :centered="false" />
2018-08-26 14:39:02 +00:00
</div>
</template>
<script>
import EmptyState from '../components/EmptyState.vue';
2018-08-26 14:39:02 +00:00
import SectionHeader from '../components/SectionHeader.vue';
import ItemListCard from '../components/ItemListCard.vue';
export default {
components: {
SectionHeader,
ItemListCard,
EmptyState
2018-08-26 14:39:02 +00:00
},
data() {
return {
items: null
2018-08-26 14:39:02 +00:00
}
},
created() {
this.get_items_for_messages()
.then(items => {
this.items = items;
});
},
methods: {
get_items_for_messages() {
return hub.call('get_buying_items_for_messages', {}, 'action:send_message');
}
}
}
</script>