refactor: แก้เงื่อนไข
This commit is contained in:
parent
2296a65c80
commit
ea4234a313
1 changed files with 5 additions and 1 deletions
|
|
@ -4,6 +4,7 @@ import { CustomerBranchCreate } from 'stores/customer/types';
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
readonly?: boolean;
|
readonly?: boolean;
|
||||||
|
edit?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const customerBranch = defineModel<CustomerBranchCreate[]>('customerBranch', {
|
const customerBranch = defineModel<CustomerBranchCreate[]>('customerBranch', {
|
||||||
|
|
@ -94,6 +95,7 @@ function close(index: number) {
|
||||||
:key="index"
|
:key="index"
|
||||||
:name="index"
|
:name="index"
|
||||||
:label="`${$t('customerBranchFormTab')} `"
|
:label="`${$t('customerBranchFormTab')} `"
|
||||||
|
:disable="tab !== index && edit"
|
||||||
@click="tab = index"
|
@click="tab = index"
|
||||||
no-caps
|
no-caps
|
||||||
:class="tab === index ? '' : 'bordered-b bordered-r'"
|
:class="tab === index ? '' : 'bordered-b bordered-r'"
|
||||||
|
|
@ -116,7 +118,9 @@ function close(index: number) {
|
||||||
<q-tab-panels v-model="tab" class="rounded-borders">
|
<q-tab-panels v-model="tab" class="rounded-borders">
|
||||||
<q-tab-panel
|
<q-tab-panel
|
||||||
:id="`tab-branch-${index}`"
|
:id="`tab-branch-${index}`"
|
||||||
v-for="(v, index) in customerBranch"
|
v-for="(v, index) in customerBranch.sort(
|
||||||
|
(a, b) => (a.branchNo ?? 0) - (b.branchNo ?? 0),
|
||||||
|
)"
|
||||||
:key="index"
|
:key="index"
|
||||||
:name="index"
|
:name="index"
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue