refactor: add input virtual
This commit is contained in:
parent
37ebd3d880
commit
7b3f28e67d
1 changed files with 39 additions and 0 deletions
|
|
@ -1,4 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { isRoleInclude } from 'src/stores/utils';
|
||||||
|
|
||||||
const code = defineModel<string>('code');
|
const code = defineModel<string>('code');
|
||||||
const branchCount = defineModel<number>('branchCount', { default: 0 });
|
const branchCount = defineModel<number>('branchCount', { default: 0 });
|
||||||
const codeSubBranch = defineModel<string>('codeSubBranch');
|
const codeSubBranch = defineModel<string>('codeSubBranch');
|
||||||
|
|
@ -7,6 +9,7 @@ const name = defineModel<string>('name');
|
||||||
const abbreviation = defineModel<string>('abbreviation');
|
const abbreviation = defineModel<string>('abbreviation');
|
||||||
const nameEN = defineModel<string>('nameEN');
|
const nameEN = defineModel<string>('nameEN');
|
||||||
const typeBranch = defineModel<string>('typeBranch');
|
const typeBranch = defineModel<string>('typeBranch');
|
||||||
|
const virtual = defineModel<boolean>('virtual');
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
title?: string;
|
title?: string;
|
||||||
|
|
@ -153,6 +156,42 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
:error-message="$t('form.error.required')"
|
:error-message="$t('form.error.required')"
|
||||||
for="input-name-en"
|
for="input-name-en"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<q-select
|
||||||
|
v-if="
|
||||||
|
typeBranch !== 'headOffice' &&
|
||||||
|
isRoleInclude(['head_of_admin', 'head_of_account'])
|
||||||
|
"
|
||||||
|
outlined
|
||||||
|
use-input
|
||||||
|
fill-input
|
||||||
|
emit-value
|
||||||
|
map-options
|
||||||
|
hide-selected
|
||||||
|
hide-bottom-space
|
||||||
|
input-debounce="0"
|
||||||
|
option-label="label"
|
||||||
|
option-value="value"
|
||||||
|
class="col-2"
|
||||||
|
dense
|
||||||
|
for="input-branch-status"
|
||||||
|
:readonly="readonly || isRoleInclude(['head_of_account'])"
|
||||||
|
:options="['Virtual', 'Branch']"
|
||||||
|
:hide-dropdown-icon="readonly"
|
||||||
|
:label="$t('general.branchStatus')"
|
||||||
|
:model-value="virtual ? 'Virtual' : 'Branch'"
|
||||||
|
@update:model-value="(v) => (virtual = v === 'Virtual')"
|
||||||
|
:rules="[(val) => val && val.length > 0]"
|
||||||
|
:error-message="$t('form.error.required')"
|
||||||
|
>
|
||||||
|
<template v-slot:no-option>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section class="text-grey">
|
||||||
|
{{ $t('general.noData') }}
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
</template>
|
||||||
|
</q-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue