refactor(04): remove type from 04

This commit is contained in:
puriphatt 2024-09-04 09:48:29 +07:00
parent 2e72cb3071
commit eec5325806
4 changed files with 420 additions and 326 deletions

View file

@ -51,7 +51,10 @@ defineEmits<{
class="full-width q-py-xs"
:class="{
'clickable-node': typeTree === 'product' || node.isHeadOffice,
'cursor-pointer': node.type === 'group' || node.type === 'type',
'cursor-pointer':
node.type === 'group' ||
node.type === 'type' ||
node.type === 'productService',
'active-node': expandedTree[expandedTree.length - 1] === node.id,
}"
v-touch-hold.mouse="() => $emit('handleHold', node)"
@ -65,7 +68,7 @@ defineEmits<{
<div class="row col items-center justify-between full-width no-wrap">
<q-icon
v-if="
(node.type === 'group' && node._count.type > 0) ||
node.type === 'group' ||
(node.isHeadOffice && node._count.branch !== 0)
"
name="mdi-triangle-down"
@ -75,7 +78,10 @@ defineEmits<{
/>
<div
class="col row"
:class="{ 'q-pl-sm': node.type === 'type' }"
:class="{
'q-pl-sm q-py-xs':
node.type === 'type' || node.type === 'productService',
}"
:style="`padding-left:${(node.type === 'group' && node._count.type === 0) || (node.isHeadOffice && node._count.branch === 0) ? '36px' : ''}`"
>
<span
@ -101,7 +107,7 @@ defineEmits<{
>
<slot></slot>
<q-btn
v-if="typeTree === 'product'"
v-if="typeTree === 'product' && !node.actionDisabled"
icon="mdi-eye-outline"
:id="`btn-tree-eye-${node.name}`"
size="sm"

File diff suppressed because it is too large Load diff

View file

@ -271,7 +271,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
// Product
async function fetchStatsProduct(opts?: { productTypeId?: string }) {
async function fetchStatsProduct(opts?: { productGroupId?: string }) {
const params = new URLSearchParams();
for (const [k, v] of Object.entries(opts || {})) {
@ -296,7 +296,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
query?: string;
page?: number;
pageSize?: number;
productTypeId?: string;
productGroupId?: string;
status?: string;
},
flow?: {
@ -428,7 +428,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
query?: string;
page?: number;
pageSize?: number;
productTypeId?: string;
productGroupId?: string;
status?: string;
},
flow?: {
@ -545,7 +545,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
serviceId: string,
data: Partial<ServiceCreate & { status: string }>,
) {
const { image, code, productTypeId, ...payload } = data;
const { image, code, productGroupId, ...payload } = data;
if (payload.status === 'CREATED') {
delete payload.status;
@ -736,7 +736,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
query?: string;
page?: number;
pageSize?: number;
productTypeId?: string;
productGroupId?: string;
status?: string;
},
flow?: {

View file

@ -14,7 +14,7 @@ export interface TreeProduct {
}
export interface Service {
productTypeId: string;
productGroupId: string;
updatedAt: string;
updatedBy: UpdatedBy;
createdAt: string;
@ -62,7 +62,7 @@ export interface ServiceCreate {
code: string;
image?: File;
status?: Status;
productTypeId: string;
productGroupId: string;
registeredBranchId: string | null;
}
@ -112,7 +112,7 @@ export interface ServiceById {
code: string;
id: string;
imageUrl: 'string';
productTypeId: string;
productGroupId: string;
registeredBranchId: string;
}
@ -136,12 +136,14 @@ export interface WorkItems {
}
export interface ProductList {
expenseType: string;
vatIncluded: boolean;
remark: string;
updatedAt: string;
updatedBy: UpdatedBy;
createdAt: string;
createdBy: CreatedBy;
productTypeId: string;
productGroupId: string;
status: Status;
serviceCharge: number;
agentPrice: number;
@ -156,8 +158,10 @@ export interface ProductList {
}
export interface ProductCreate {
expenseType: string;
vatIncluded: boolean;
registeredBranchId: string;
productTypeId: string;
productGroupId: string;
remark: string;
serviceCharge: number;
agentPrice: number;
@ -171,7 +175,7 @@ export interface ProductCreate {
}
export interface ProductUpdate {
productTypeId: string;
productGroupId: string;
remark: string;
serviceCharge: number;
agentPrice: number;