refactor: quotation card badge color & constant

This commit is contained in:
puriphatt 2024-11-22 16:46:05 +07:00
parent 063439c1c6
commit 9105dcf7fe
3 changed files with 12 additions and 8 deletions

View file

@ -7,14 +7,7 @@ import { formatNumberDecimal, commaInput } from 'stores/utils';
import BadgeComponent from 'components/BadgeComponent.vue';
import KebabAction from 'components/shared/KebabAction.vue';
const hslaColors: Record<string, string> = {
Issued: '--orange-5-hsl',
Accepted: '--pink-6-hsl',
Expired: '--cyan-7-hsl',
PaymentInProcess: '--purple-7-hsl',
PaymentSuccess: '--orange-11-hsl',
ProcessComplete: '--blue-10-hsl',
};
import { hslaColors } from 'src/pages/05_quotation/constants';
const props = withDefaults(
defineProps<{

View file

@ -11,6 +11,7 @@ import { useNavigator } from 'src/stores/navigator';
import useFlowStore from 'src/stores/flow';
import useMyBranch from 'stores/my-branch';
import { useQuotationForm } from './form';
import { hslaColors } from './constants';
// NOTE Import Types
import { CustomerBranchCreate } from 'stores/customer/types';
@ -652,6 +653,7 @@ async function storeDataLocal(id: string) {
item.row.createdBy.lastName
"
:total-price="item.row.finalPrice"
:badge-color="hslaColors[item.row.quotationStatus] || ''"
@preview="storeDataLocal(item.row.id)"
@view="
() => {

View file

@ -126,3 +126,12 @@ export const columnQuotation = [
] satisfies QTableProps['columns'];
export const fieldSelectedOption = [{ label: 'general.type', value: 'value' }];
export const hslaColors: Record<string, string> = {
Issued: '--orange-5-hsl',
Accepted: '--pink-6-hsl',
Expired: '--cyan-7-hsl',
PaymentInProcess: '--purple-7-hsl',
PaymentSuccess: '--green-8-hsl',
ProcessComplete: '--blue-6-hsl',
};