refactor: handle name prefix
This commit is contained in:
parent
c4305730b0
commit
3f414b156a
1 changed files with 7 additions and 0 deletions
|
|
@ -7,11 +7,13 @@ import SelectInput from '../shared/SelectInput.vue';
|
|||
import { QSelect } from 'quasar';
|
||||
import { Branch } from 'src/stores/branch/types';
|
||||
import { CustomerBranch } from 'src/stores/customer/types';
|
||||
import useOptionStore from 'stores/options';
|
||||
|
||||
const { locale } = useI18n({ useScope: 'global' });
|
||||
const branchStore = useBranchStore();
|
||||
const customerStore = useCustomerStore();
|
||||
|
||||
const optionStore = useOptionStore();
|
||||
const branchId = defineModel<string>('branchId');
|
||||
const customerBranchId = defineModel<string>('customerBranchId');
|
||||
const agentPrice = defineModel<boolean>('agentPrice');
|
||||
|
|
@ -81,6 +83,7 @@ async function init(val: string, type: 'branch' | 'customer') {
|
|||
label: v.registerName || `${v.firstName} ${v.lastName}` || '-',
|
||||
labelEN:
|
||||
v.registerNameEN || `${v.firstNameEN} ${v.lastNameEN}` || '-',
|
||||
namePrefix: v.namePrefix,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
|
@ -163,6 +166,10 @@ onMounted(async () => {
|
|||
|
||||
<q-item clickable v-bind="scope.itemProps">
|
||||
<q-item-section>
|
||||
{{
|
||||
optionStore.mapOption(scope.opt.namePrefix) ||
|
||||
$t('general.company')
|
||||
}}
|
||||
{{ locale === 'eng' ? scope.opt.labelEN : scope.opt.label }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue