This commit is contained in:
parent
d06c26c3c8
commit
5c867a496d
2 changed files with 112 additions and 92 deletions
|
|
@ -661,96 +661,115 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- วิธีการรับชำระ -->
|
<!-- วิธีการรับชำระ -->
|
||||||
<section
|
<template v-if="payment.paymentStatus === 'PaymentSuccess'">
|
||||||
class="q-px-md q-py-xs text-weight-medium row items-center"
|
<section
|
||||||
style="background-color: hsla(var(--info-bg) / 0.1)"
|
class="q-px-md q-py-xs text-weight-medium row items-center"
|
||||||
>
|
style="background-color: hsla(var(--info-bg) / 0.1)"
|
||||||
{{ $t('quotation.receiptDialog.paymentMethod') }}
|
>
|
||||||
</section>
|
{{ $t('quotation.receiptDialog.paymentMethod') }}
|
||||||
<div
|
</section>
|
||||||
class="surface-2 q-px-md q-py-sm row q-col-gutter-sm items-center"
|
|
||||||
>
|
<q-form
|
||||||
<SelectInput
|
class="column full-height"
|
||||||
id="input-payment-channel"
|
@submit.prevent
|
||||||
for="input-payment-channel"
|
@submit="triggerSubmit(payment.id)"
|
||||||
:readonly="
|
>
|
||||||
readonly ||
|
<div
|
||||||
(!formPaymentMethod[i].isEdit && !!payment.channel)
|
class="surface-2 q-px-md q-py-sm row q-col-gutter-sm items-center"
|
||||||
"
|
>
|
||||||
v-model="formPaymentMethod[i].channel"
|
<SelectInput
|
||||||
class="col-md-2 col-6"
|
id="input-payment-channel"
|
||||||
:option="[
|
for="input-payment-channel"
|
||||||
{
|
:readonly="
|
||||||
label: $t('creditNote.label.Cash'),
|
readonly ||
|
||||||
value: 'Cash',
|
(!formPaymentMethod[i].isEdit && !!payment.channel)
|
||||||
},
|
"
|
||||||
{
|
v-model="formPaymentMethod[i].channel"
|
||||||
label: $t('creditNote.label.BankTransfer'),
|
class="col-md-2 col-6"
|
||||||
value: 'BankTransfer',
|
:rules="[
|
||||||
},
|
(val: string) => !!val || $t('form.error.required'),
|
||||||
]"
|
]"
|
||||||
:label="$t('quotation.receiptDialog.paymentMethod')"
|
:option="[
|
||||||
@update:model-value="
|
{
|
||||||
() => {
|
label: $t('creditNote.label.Cash'),
|
||||||
if (formPaymentMethod[i].channel === 'Cash') {
|
value: 'Cash',
|
||||||
formPaymentMethod[i].reference = null;
|
},
|
||||||
formPaymentMethod[i].account = null;
|
{
|
||||||
}
|
label: $t('creditNote.label.BankTransfer'),
|
||||||
}
|
value: 'BankTransfer',
|
||||||
"
|
},
|
||||||
/>
|
]"
|
||||||
<q-input
|
:label="$t('quotation.receiptDialog.paymentMethod')"
|
||||||
v-if="formPaymentMethod[i].channel === 'BankTransfer'"
|
@update:model-value="
|
||||||
dense
|
() => {
|
||||||
outlined
|
if (formPaymentMethod[i].channel === 'Cash') {
|
||||||
class="col-md-3 col-6"
|
formPaymentMethod[i].reference = null;
|
||||||
v-model="formPaymentMethod[i].reference"
|
formPaymentMethod[i].account = null;
|
||||||
:readonly="
|
}
|
||||||
readonly ||
|
}
|
||||||
(!formPaymentMethod[i].isEdit && !!payment.channel)
|
"
|
||||||
"
|
/>
|
||||||
:label="$t('quotation.refNo')"
|
<q-input
|
||||||
/>
|
v-if="formPaymentMethod[i].channel === 'BankTransfer'"
|
||||||
<SelectInput
|
dense
|
||||||
v-if="formPaymentMethod[i].channel === 'BankTransfer'"
|
outlined
|
||||||
id="select-payment-account"
|
class="col-md-3 col-6"
|
||||||
for="select-payment-account"
|
v-model="formPaymentMethod[i].reference"
|
||||||
:readonly="
|
:readonly="
|
||||||
readonly ||
|
readonly ||
|
||||||
(!formPaymentMethod[i].isEdit && !!payment.channel)
|
(!formPaymentMethod[i].isEdit && !!payment.channel)
|
||||||
"
|
"
|
||||||
v-model="formPaymentMethod[i].account"
|
:label="$t('quotation.refNo')"
|
||||||
class="col"
|
:rules="[
|
||||||
:option="accountOpt"
|
(val: string) => !!val || $t('form.error.required'),
|
||||||
:label="$t('quotation.bankAccount')"
|
]"
|
||||||
/>
|
hide-bottom-space
|
||||||
<div class="q-ml-auto">
|
/>
|
||||||
<UndoButton
|
<SelectInput
|
||||||
v-if="formPaymentMethod[i].isEdit"
|
v-if="formPaymentMethod[i].channel === 'BankTransfer'"
|
||||||
icon-only
|
id="select-payment-account"
|
||||||
@click="
|
for="select-payment-account"
|
||||||
() => {
|
:readonly="
|
||||||
formPaymentMethod[i].isEdit = false;
|
readonly ||
|
||||||
formPaymentMethod[i].channel = payment.channel;
|
(!formPaymentMethod[i].isEdit && !!payment.channel)
|
||||||
formPaymentMethod[i].reference = payment.reference;
|
"
|
||||||
formPaymentMethod[i].account = payment.account;
|
v-model="formPaymentMethod[i].account"
|
||||||
}
|
class="col"
|
||||||
"
|
:option="accountOpt"
|
||||||
/>
|
:label="$t('quotation.bankAccount')"
|
||||||
<SaveButton
|
:rules="[
|
||||||
v-if="!payment.channel || formPaymentMethod[i].isEdit"
|
(val: string) => !!val || $t('form.error.required'),
|
||||||
icon-only
|
]"
|
||||||
@click="triggerSubmit(payment.id)"
|
/>
|
||||||
/>
|
<div class="q-ml-auto">
|
||||||
<EditButton
|
<UndoButton
|
||||||
v-if="
|
v-if="formPaymentMethod[i].isEdit"
|
||||||
payment.channel && formPaymentMethod[i].isEdit === false
|
icon-only
|
||||||
"
|
@click="
|
||||||
icon-only
|
() => {
|
||||||
@click="formPaymentMethod[i].isEdit = true"
|
formPaymentMethod[i].isEdit = false;
|
||||||
/>
|
formPaymentMethod[i].channel = payment.channel;
|
||||||
</div>
|
formPaymentMethod[i].reference = payment.reference;
|
||||||
</div>
|
formPaymentMethod[i].account = payment.account;
|
||||||
|
}
|
||||||
|
"
|
||||||
|
/>
|
||||||
|
<SaveButton
|
||||||
|
v-if="!payment.channel || formPaymentMethod[i].isEdit"
|
||||||
|
icon-only
|
||||||
|
type="submit"
|
||||||
|
/>
|
||||||
|
<EditButton
|
||||||
|
v-if="
|
||||||
|
payment.channel && formPaymentMethod[i].isEdit === false
|
||||||
|
"
|
||||||
|
icon-only
|
||||||
|
@click="formPaymentMethod[i].isEdit = true"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</q-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- อัปโหลดใบเสร็จ -->
|
<!-- อัปโหลดใบเสร็จ -->
|
||||||
<section
|
<section
|
||||||
|
|
|
||||||
|
|
@ -378,7 +378,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(
|
||||||
|
|
@ -404,7 +404,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();
|
||||||
|
|
@ -1139,6 +1139,7 @@ async function submitAccepted() {
|
||||||
<PaymentForm
|
<PaymentForm
|
||||||
v-if="view === QuotationStatus.PaymentPending"
|
v-if="view === QuotationStatus.PaymentPending"
|
||||||
is-debit-note
|
is-debit-note
|
||||||
|
:branch-id="quotationData?.registeredBranchId"
|
||||||
:readonly="isRoleInclude(['sale', 'head_of_sale'])"
|
:readonly="isRoleInclude(['sale', 'head_of_sale'])"
|
||||||
:data="debitNoteData"
|
:data="debitNoteData"
|
||||||
@fetch-status="
|
@fetch-status="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue