stubbed out all Food GenericModalForms

This commit is contained in:
smilerz
2021-08-30 15:05:54 -05:00
parent a1d1cbac5d
commit 52abba1f16
21 changed files with 155595 additions and 385 deletions

View File

@ -4,19 +4,19 @@
v-bind:label="label"
class="mb-3">
<generic-multiselect
@change="new_value=$event.val"
label="name"
@change="new_value=$event.val['id']"
:initial_selection="[]"
search_function="listSupermarketCategorys"
:model="model"
:multiple="false"
:sticky_options="[{'id': null,'name': $t('None')}]"
:sticky_options="sticky_options"
style="flex-grow: 1; flex-shrink: 1; flex-basis: 0"
:placeholder="$t('Shopping_Category')">
:placeholder="modelName">
</generic-multiselect>
</div>
</template>
<script>
import Vue from "vue";
import GenericMultiselect from "@/components/GenericMultiselect";
export default {
@ -24,10 +24,10 @@ export default {
components: {GenericMultiselect},
props: {
field: {type: String, default: 'You Forgot To Set Field Name'},
label: {type: String, default: 'Lookup Field'},
label: {type: String, default: ''},
value: {type: Object, default () {return {}}},
show_move: {type: Boolean, default: false},
show_merge: {type: Boolean, default: false},
model: {type: Object, default () {return {}}},
sticky_options: {type:Array, default(){return []}},
},
data() {
return {
@ -37,6 +37,11 @@ export default {
mounted() {
this.new_value = this.value.id
},
computed: {
modelName() {
return this?.model?.name ?? this.$t('Search')
}
},
watch: {
'new_value': function () {
this.$root.$emit('change', this.field, this.new_value)