refactor: type name
This commit is contained in:
parent
548f10feab
commit
f26f6b51d6
7 changed files with 24 additions and 24 deletions
|
|
@ -4,7 +4,7 @@ import { formatNumberDecimal } from 'stores/utils';
|
|||
|
||||
import useProductServiceStore from 'stores/product-service';
|
||||
import useOptionStore from 'stores/options';
|
||||
import { Attributes, ProductList } from 'stores/product-service/types';
|
||||
import { Attributes, Product } from 'stores/product-service/types';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ withDefaults(
|
|||
|
||||
const workName = defineModel<string>('workName');
|
||||
const attributes = defineModel<Attributes>('attributes', { required: true });
|
||||
const productItems = defineModel<(ProductList & { nameEn: string })[]>(
|
||||
const productItems = defineModel<(Product & { nameEn: string })[]>(
|
||||
'productItems',
|
||||
{
|
||||
required: true,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ import {
|
|||
ProductGroup,
|
||||
ProductGroupCreate,
|
||||
ProductCreate,
|
||||
ProductList,
|
||||
Product,
|
||||
ServiceCreate,
|
||||
Service,
|
||||
ServiceById,
|
||||
|
|
@ -227,10 +227,10 @@ const productMode = ref<'group' | 'service' | 'product'>('group');
|
|||
|
||||
const productTab = ref(1);
|
||||
const productGroup = ref<ProductGroup[]>();
|
||||
const product = ref<(ProductList & { type: 'product' })[]>();
|
||||
const productIsAdd = ref<(ProductList & { type: 'product' })[]>();
|
||||
const product = ref<(Product & { type: 'product' })[]>();
|
||||
const productIsAdd = ref<(Product & { type: 'product' })[]>();
|
||||
const service = ref<(Service & { type: 'service' })[]>();
|
||||
const resultSearchProduct = ref<ProductList[]>();
|
||||
const resultSearchProduct = ref<Product[]>();
|
||||
|
||||
const productAndServiceTab = ref<'product' | 'service'>('service');
|
||||
const manageWorkNameDialog = ref(false);
|
||||
|
|
@ -460,7 +460,7 @@ const $q = useQuasar();
|
|||
|
||||
const workItems = ref<WorkItems[]>([]);
|
||||
const workNameRef = ref();
|
||||
const selectProduct = ref<ProductList[]>([]);
|
||||
const selectProduct = ref<Product[]>([]);
|
||||
const currentWorkIndex = ref<number>(0);
|
||||
|
||||
const serviceTab = ref(1);
|
||||
|
|
@ -525,7 +525,7 @@ async function searchProduct(isAdd: boolean = true) {
|
|||
flowStore.rotate();
|
||||
}
|
||||
|
||||
function selectAllProduct(list: ProductList[]) {
|
||||
function selectAllProduct(list: Product[]) {
|
||||
list
|
||||
?.filter((i) => {
|
||||
if (i.status === 'INACTIVE') {
|
||||
|
|
@ -964,7 +964,7 @@ const prevProduct = ref<ProductCreate>({
|
|||
image: undefined,
|
||||
});
|
||||
|
||||
async function assignFormDataProduct(data: ProductList) {
|
||||
async function assignFormDataProduct(data: Product) {
|
||||
productTab.value = 1;
|
||||
statusToggle.value = data.status === 'INACTIVE' ? false : true;
|
||||
profileUrl.value = `${baseUrl.value}/product/${data?.id}/image/${data?.selectedImage}`;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import {
|
|||
} from 'src/pages/03_customer-management/constant';
|
||||
import {
|
||||
ProductGroup,
|
||||
ProductList,
|
||||
Product,
|
||||
Service,
|
||||
} from 'src/stores/product-service/types';
|
||||
|
||||
|
|
@ -121,11 +121,11 @@ const router = useRouter();
|
|||
type ProductGroupId = string;
|
||||
|
||||
const productGroup = ref<ProductGroup[]>([]);
|
||||
const productList = ref<Partial<Record<ProductGroupId, ProductList[]>>>({});
|
||||
const productList = ref<Partial<Record<ProductGroupId, Product[]>>>({});
|
||||
const serviceList = ref<Partial<Record<ProductGroupId, Service[]>>>({});
|
||||
|
||||
type Id = string;
|
||||
const product = ref<Record<Id, ProductList>>({});
|
||||
const product = ref<Record<Id, Product>>({});
|
||||
const service = ref<Record<Id, Service>>({});
|
||||
|
||||
const selectedGroup = ref<ProductGroup | null>(null);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import DeleteButton from 'src/components/button/DeleteButton.vue';
|
|||
import { isRoleInclude } from 'src/stores/utils';
|
||||
import {
|
||||
ProductGroup,
|
||||
ProductList,
|
||||
Product,
|
||||
Service,
|
||||
Work,
|
||||
} from 'src/stores/product-service/types';
|
||||
|
|
@ -40,7 +40,7 @@ const inputSearch = defineModel<string>('inputSearch');
|
|||
const productGroup = defineModel<ProductGroup[]>('productGroup', {
|
||||
default: [],
|
||||
});
|
||||
const productList = defineModel<Partial<Record<ProductGroupId, ProductList[]>>>(
|
||||
const productList = defineModel<Partial<Record<ProductGroupId, Product[]>>>(
|
||||
'productList',
|
||||
{ default: {} },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import { QuotationPayload } from 'src/stores/quotations/types';
|
|||
import { Employee } from 'src/stores/employee/types';
|
||||
import {
|
||||
ProductGroup,
|
||||
ProductList,
|
||||
Product,
|
||||
Service,
|
||||
} from 'src/stores/product-service/types';
|
||||
|
||||
|
|
@ -98,11 +98,11 @@ const pageState = reactive({
|
|||
productServiceModal: false,
|
||||
});
|
||||
|
||||
const productList = ref<Partial<Record<ProductGroupId, ProductList[]>>>({});
|
||||
const productList = ref<Partial<Record<ProductGroupId, Product[]>>>({});
|
||||
const serviceList = ref<Partial<Record<ProductGroupId, Service[]>>>({});
|
||||
const productGroup = ref<ProductGroup[]>([]);
|
||||
|
||||
const product = ref<Record<Id, ProductList>>({});
|
||||
const product = ref<Record<Id, Product>>({});
|
||||
const service = ref<Record<Id, Service>>({});
|
||||
|
||||
const selectedGroupSub = ref<'product' | 'service' | null>(null);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import {
|
|||
ProductGroup,
|
||||
ProductGroupCreate,
|
||||
ProductGroupUpdate,
|
||||
ProductList,
|
||||
Product,
|
||||
ProductCreate,
|
||||
ProductUpdate,
|
||||
Service,
|
||||
|
|
@ -170,7 +170,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
const query = params.toString();
|
||||
|
||||
const res = await api.get<Pagination<ProductList[]>>(
|
||||
const res = await api.get<Pagination<Product[]>>(
|
||||
`/product${(params && '?'.concat(query)) || ''}`,
|
||||
{
|
||||
headers: { 'X-Rtid': flowStore.rtid },
|
||||
|
|
@ -222,7 +222,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
}
|
||||
|
||||
async function fetchListProductById(productId: string) {
|
||||
const res = await api.get<ProductList>(`/product/${productId}`);
|
||||
const res = await api.get<Product>(`/product/${productId}`);
|
||||
|
||||
if (!res) return false;
|
||||
|
||||
|
|
@ -534,7 +534,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
|||
|
||||
const query = params.toString();
|
||||
|
||||
const res = await api.get<Pagination<ProductList[]>>(
|
||||
const res = await api.get<Pagination<Product[]>>(
|
||||
`/work/${workId}/product${(params && '?'.concat(query)) || ''}`,
|
||||
{
|
||||
headers: {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ export interface ServiceById {
|
|||
}
|
||||
|
||||
export interface ProductOnWork {
|
||||
product: ProductList;
|
||||
product: Product;
|
||||
registeredBranchId: string;
|
||||
updatedAt: string;
|
||||
updatedBy: UpdatedBy;
|
||||
|
|
@ -131,10 +131,10 @@ export interface WorkItems {
|
|||
id: string;
|
||||
name: string;
|
||||
attributes: Attributes;
|
||||
product: (ProductList & { nameEn: string })[];
|
||||
product: (Product & { nameEn: string })[];
|
||||
}
|
||||
|
||||
export interface ProductList {
|
||||
export interface Product {
|
||||
selectedImage?: string;
|
||||
expenseType: string;
|
||||
vatIncluded: boolean;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue