refactor: handle pay installment no
This commit is contained in:
parent
efa576b423
commit
3a63d2622c
2 changed files with 16 additions and 7 deletions
|
|
@ -3,7 +3,7 @@ import { baseUrl } from 'src/stores/utils';
|
||||||
|
|
||||||
import BadgeComponent from 'src/components/BadgeComponent.vue';
|
import BadgeComponent from 'src/components/BadgeComponent.vue';
|
||||||
|
|
||||||
import { ProductRelation } from 'src/stores/quotations/types';
|
import { ProductRelation, PayCondition } from 'src/stores/quotations/types';
|
||||||
import { Step, RequestWorkStatus } from 'src/stores/request-list/types';
|
import { Step, RequestWorkStatus } from 'src/stores/request-list/types';
|
||||||
|
|
||||||
const workStatus = [
|
const workStatus = [
|
||||||
|
|
@ -32,7 +32,9 @@ defineProps<{
|
||||||
total: number;
|
total: number;
|
||||||
paid?: number;
|
paid?: number;
|
||||||
};
|
};
|
||||||
|
installmentNo?: number;
|
||||||
paySuccess: boolean;
|
paySuccess: boolean;
|
||||||
|
payCondition: PayCondition;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
// NOTE: Function
|
// NOTE: Function
|
||||||
|
|
@ -91,9 +93,11 @@ defineProps<{
|
||||||
:label="
|
:label="
|
||||||
$q.screen.lt.sm
|
$q.screen.lt.sm
|
||||||
? undefined
|
? undefined
|
||||||
: $t(
|
: !paySuccess
|
||||||
`requestList.status.work.${status?.workStatus ?? RequestWorkStatus.Pending}`,
|
? $t('general.unavailable')
|
||||||
)
|
: $t(
|
||||||
|
`requestList.status.work.${status?.workStatus ?? RequestWorkStatus.Pending}`,
|
||||||
|
)
|
||||||
"
|
"
|
||||||
class="text-capitalize text-weight-regular product-status rounded"
|
class="text-capitalize text-weight-regular product-status rounded"
|
||||||
:class="{
|
:class="{
|
||||||
|
|
@ -169,7 +173,11 @@ defineProps<{
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
{{
|
{{
|
||||||
$t(`requestList.status.work.${status?.workStatus ?? 'Pending'}`)
|
!paySuccess
|
||||||
|
? `${$t(`quotation.payCondition.${payCondition}`)} ${payCondition.includes('Split') ? `${installmentNo}/${installmentInfo?.total} ` : ''}`
|
||||||
|
: $t(
|
||||||
|
`requestList.status.work.${status?.workStatus ?? 'Pending'}`,
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -606,6 +606,7 @@ function isInstallmentPaySuccess(installmentNo: number) {
|
||||||
</transition>
|
</transition>
|
||||||
</article>
|
</article>
|
||||||
<!-- product -->
|
<!-- product -->
|
||||||
|
|
||||||
<template
|
<template
|
||||||
v-for="(value, index) in workList?.filter((v) =>
|
v-for="(value, index) in workList?.filter((v) =>
|
||||||
v.productService.work?.attributes.workflowStep?.[
|
v.productService.work?.attributes.workflowStep?.[
|
||||||
|
|
@ -622,6 +623,8 @@ function isInstallmentPaySuccess(installmentNo: number) {
|
||||||
:status="
|
:status="
|
||||||
value.stepStatus?.find((v) => v.step === pageState.currentStep)
|
value.stepStatus?.find((v) => v.step === pageState.currentStep)
|
||||||
"
|
"
|
||||||
|
:installment-no="value.productService.installmentNo"
|
||||||
|
:pay-condition="data?.quotation.payCondition"
|
||||||
:img-url="`/product/${value.productService.productId}/image/${value.productService.product.selectedImage}`"
|
:img-url="`/product/${value.productService.productId}/image/${value.productService.product.selectedImage}`"
|
||||||
:name="value.productService.product.name"
|
:name="value.productService.product.name"
|
||||||
:code="value.productService.product.code"
|
:code="value.productService.product.code"
|
||||||
|
|
@ -683,8 +686,6 @@ function isInstallmentPaySuccess(installmentNo: number) {
|
||||||
"
|
"
|
||||||
@download="
|
@download="
|
||||||
(opt) => {
|
(opt) => {
|
||||||
console.log(opt);
|
|
||||||
|
|
||||||
triggerViewFile({
|
triggerViewFile({
|
||||||
id: opt.id,
|
id: opt.id,
|
||||||
fileName: opt.data.fileName,
|
fileName: opt.data.fileName,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue