theo/mobile/src/views/ordering/OrderingBatches.vue
Lance Edgar 8c738d3ee8 Add very basic mobile app support for Theo
much more to come yet, but should be enough to launch a demo
2021-01-28 21:15:34 -06:00

41 lines
1.2 KiB
Vue

<template>
<byjove-model-index model-name="PurchaseBatch"
model-index-title="Ordering"
model-title="Ordering Batch"
model-title-plural="Ordering Batches"
model-path-prefix="/ordering"
model-permission-prefix="ordering"
api-index-url="/api/ordering-batches"
:api-index-sort="{field: 'id', dir: 'desc'}"
:api-index-filters="filters"
:label-renderer="renderLabel">
</byjove-model-index>
</template>
<script>
import {ByjoveModelIndex} from 'byjove'
export default {
name: 'OrderingBatches',
components: {
ByjoveModelIndex,
},
data() {
return {
filters: [
{field: 'executed', op: 'is_null'},
{or: [
{field: 'complete', op: 'is_null'},
{field: 'complete', op: 'eq', value: false},
]},
],
}
},
methods: {
renderLabel(batch) {
return `(${batch.id_str}) ${batch.vendor_display}`
},
},
}
</script>