Merge branch 'develop'
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s
Some checks failed
Spell Check / Spell Check with Typos (push) Failing after 5s
This commit is contained in:
commit
d44850a9ae
6 changed files with 37 additions and 49 deletions
|
|
@ -159,42 +159,6 @@ function formatCode(input: string | undefined, type: 'code' | 'number') {
|
||||||
]"
|
]"
|
||||||
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 class="col-12 row q-col-gutter-sm">
|
<div class="col-12 row q-col-gutter-sm">
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,13 @@ export const createSelect = <T extends Record<string, any>>(
|
||||||
let previousSearch = '';
|
let previousSearch = '';
|
||||||
|
|
||||||
watch(value, (v) => {
|
watch(value, (v) => {
|
||||||
if (!v || (cache && cache.find((opt) => opt[valueField] === v))) return;
|
if (!v) return;
|
||||||
|
|
||||||
|
if (cache && cache.find((opt) => opt[valueField] === v)) {
|
||||||
|
valueOption.value = cache.find((opt) => opt[valueField] === v);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
getSelectedOption();
|
getSelectedOption();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -63,7 +69,15 @@ export const createSelect = <T extends Record<string, any>>(
|
||||||
const currentValue = value.value;
|
const currentValue = value.value;
|
||||||
|
|
||||||
if (!currentValue) return;
|
if (!currentValue) return;
|
||||||
if (selectOptions.value.find((v) => v[valueField] === currentValue)) return;
|
|
||||||
|
const option = selectOptions.value.find(
|
||||||
|
(v) => v[valueField] === currentValue,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (option) {
|
||||||
|
valueOption.value = option;
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (valueOption.value && valueOption.value[valueField] === currentValue) {
|
if (valueOption.value && valueOption.value[valueField] === currentValue) {
|
||||||
return selectOptions.value.unshift(valueOption.value);
|
return selectOptions.value.unshift(valueOption.value);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -799,7 +799,7 @@ export default {
|
||||||
branch: 'สาขาที่ออกใบเสนอราคา',
|
branch: 'สาขาที่ออกใบเสนอราคา',
|
||||||
branchVirtual: 'จุดรับบริการที่ออกใบเสนอราคา',
|
branchVirtual: 'จุดรับบริการที่ออกใบเสนอราคา',
|
||||||
customer: 'ลูกค้า',
|
customer: 'ลูกค้า',
|
||||||
newCustomer: 'ลูกค้าใหม่',
|
newCustomer: 'แรงงานใหม่',
|
||||||
employeeList: 'รายชื่อแรงงาน',
|
employeeList: 'รายชื่อแรงงาน',
|
||||||
employee: 'แรงงาน',
|
employee: 'แรงงาน',
|
||||||
employeeName: 'ชื่อ-นามสกุล แรงงาน',
|
employeeName: 'ชื่อ-นามสกุล แรงงาน',
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,8 @@ const emit = defineEmits<{
|
||||||
const selectedProductGroup = defineModel<string>('selectedProductGroup', {
|
const selectedProductGroup = defineModel<string>('selectedProductGroup', {
|
||||||
default: '',
|
default: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const selectedProductGroupOption = ref<ProductGroup | undefined>();
|
||||||
const model = defineModel<boolean>();
|
const model = defineModel<boolean>();
|
||||||
const inputSearch = defineModel<string>('inputSearch');
|
const inputSearch = defineModel<string>('inputSearch');
|
||||||
const productGroup = defineModel<ProductGroup[]>('productGroup', {
|
const productGroup = defineModel<ProductGroup[]>('productGroup', {
|
||||||
|
|
@ -569,14 +571,18 @@ watch(
|
||||||
{{
|
{{
|
||||||
productGroup.find(
|
productGroup.find(
|
||||||
(g) => g.id === selectedProductGroup,
|
(g) => g.id === selectedProductGroup,
|
||||||
)?.name || '-'
|
)?.name ||
|
||||||
|
selectedProductGroupOption?.name ||
|
||||||
|
'-'
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
<span class="text-caption app-text-muted">
|
<span class="text-caption app-text-muted">
|
||||||
{{
|
{{
|
||||||
productGroup.find(
|
productGroup.find(
|
||||||
(g) => g.id === selectedProductGroup,
|
(g) => g.id === selectedProductGroup,
|
||||||
)?.code || '-'
|
)?.code ||
|
||||||
|
selectedProductGroupOption?.code ||
|
||||||
|
'-'
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -862,13 +868,13 @@ watch(
|
||||||
<span class="q-pr-sm">
|
<span class="q-pr-sm">
|
||||||
{{ $t('productService.group.title') }}
|
{{ $t('productService.group.title') }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<SelectProductGroup
|
<SelectProductGroup
|
||||||
class="col-md-4 col-12"
|
class="col-md-4 col-12"
|
||||||
:class="{ 'q-mb-sm': $q.screen.lt.md }"
|
:class="{ 'q-mb-sm': $q.screen.lt.md }"
|
||||||
id="product-group-select"
|
id="product-group-select"
|
||||||
clearable
|
clearable
|
||||||
v-model:value="selectedProductGroup"
|
v-model:value="selectedProductGroup"
|
||||||
|
v-model:value-option="selectedProductGroupOption"
|
||||||
:placeholder="
|
:placeholder="
|
||||||
!selectedProductGroup
|
!selectedProductGroup
|
||||||
? $t('general.select', {
|
? $t('general.select', {
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@ function handleCheckAll() {
|
||||||
/> -->
|
/> -->
|
||||||
<AvatarGroup
|
<AvatarGroup
|
||||||
:data="[
|
:data="[
|
||||||
...responsiblePerson(props.row.quotation).user.map((v) => ({
|
...(responsiblePerson(props.row.quotation)?.user.map((v) => ({
|
||||||
name:
|
name:
|
||||||
$i18n.locale === 'eng'
|
$i18n.locale === 'eng'
|
||||||
? `${v.firstNameEN} ${v.lastNameEN}`
|
? `${v.firstNameEN} ${v.lastNameEN}`
|
||||||
|
|
@ -324,11 +324,11 @@ function handleCheckAll() {
|
||||||
? `/no-img-man.png`
|
? `/no-img-man.png`
|
||||||
: `/no-img-female.png`
|
: `/no-img-female.png`
|
||||||
: `${baseUrl}/user/${v.id}/profile-image/${v.selectedImage}`,
|
: `${baseUrl}/user/${v.id}/profile-image/${v.selectedImage}`,
|
||||||
})),
|
})) || []),
|
||||||
...responsiblePerson(props.row.quotation).group.map((g) => ({
|
...(responsiblePerson(props.row.quotation)?.group.map((g) => ({
|
||||||
name: `${$t('general.group')} ${g.group}`,
|
name: `${$t('general.group')} ${g.group}`,
|
||||||
imgUrl: '/img-group.png',
|
imgUrl: '/img-group.png',
|
||||||
})),
|
})) || []),
|
||||||
]"
|
]"
|
||||||
></AvatarGroup>
|
></AvatarGroup>
|
||||||
</q-td>
|
</q-td>
|
||||||
|
|
|
||||||
|
|
@ -386,7 +386,7 @@ async function assignFormData(id: string) {
|
||||||
selectedProductGroup.value =
|
selectedProductGroup.value =
|
||||||
data.productServiceList[0]?.product.productGroup?.id || '';
|
data.productServiceList[0]?.product.productGroup?.id || '';
|
||||||
|
|
||||||
((previousValue = {
|
(previousValue = {
|
||||||
id: data.id || undefined,
|
id: data.id || undefined,
|
||||||
debitNoteQuotationId: data.debitNoteQuotationId || undefined,
|
debitNoteQuotationId: data.debitNoteQuotationId || undefined,
|
||||||
productServiceList: structuredClone(
|
productServiceList: structuredClone(
|
||||||
|
|
@ -412,7 +412,7 @@ async function assignFormData(id: string) {
|
||||||
quotationId: data.debitNoteQuotationId,
|
quotationId: data.debitNoteQuotationId,
|
||||||
remark: data.remark || undefined,
|
remark: data.remark || undefined,
|
||||||
}),
|
}),
|
||||||
(currentFormData.value = structuredClone(previousValue)));
|
(currentFormData.value = structuredClone(previousValue));
|
||||||
|
|
||||||
assignProductServiceList();
|
assignProductServiceList();
|
||||||
assignSelectedWorker();
|
assignSelectedWorker();
|
||||||
|
|
@ -1046,7 +1046,11 @@ async function submitAccepted() {
|
||||||
:status-active="i.active?.()"
|
:status-active="i.active?.()"
|
||||||
:status-done="i.status === 'done'"
|
:status-done="i.status === 'done'"
|
||||||
:status-waiting="i.status === 'waiting'"
|
:status-waiting="i.status === 'waiting'"
|
||||||
@click="i.handler()"
|
@click="
|
||||||
|
() => {
|
||||||
|
if (pageState.mode !== 'create') i.handler();
|
||||||
|
}
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
</nav>
|
</nav>
|
||||||
<!-- #TODO add goToQuotation as @goto-quotation-->
|
<!-- #TODO add goToQuotation as @goto-quotation-->
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue