refactor(04): remove type from 04
This commit is contained in:
parent
2e72cb3071
commit
eec5325806
4 changed files with 420 additions and 326 deletions
|
|
@ -51,7 +51,10 @@ defineEmits<{
|
||||||
class="full-width q-py-xs"
|
class="full-width q-py-xs"
|
||||||
:class="{
|
:class="{
|
||||||
'clickable-node': typeTree === 'product' || node.isHeadOffice,
|
'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,
|
'active-node': expandedTree[expandedTree.length - 1] === node.id,
|
||||||
}"
|
}"
|
||||||
v-touch-hold.mouse="() => $emit('handleHold', node)"
|
v-touch-hold.mouse="() => $emit('handleHold', node)"
|
||||||
|
|
@ -65,7 +68,7 @@ defineEmits<{
|
||||||
<div class="row col items-center justify-between full-width no-wrap">
|
<div class="row col items-center justify-between full-width no-wrap">
|
||||||
<q-icon
|
<q-icon
|
||||||
v-if="
|
v-if="
|
||||||
(node.type === 'group' && node._count.type > 0) ||
|
node.type === 'group' ||
|
||||||
(node.isHeadOffice && node._count.branch !== 0)
|
(node.isHeadOffice && node._count.branch !== 0)
|
||||||
"
|
"
|
||||||
name="mdi-triangle-down"
|
name="mdi-triangle-down"
|
||||||
|
|
@ -75,7 +78,10 @@ defineEmits<{
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="col row"
|
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' : ''}`"
|
:style="`padding-left:${(node.type === 'group' && node._count.type === 0) || (node.isHeadOffice && node._count.branch === 0) ? '36px' : ''}`"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
|
|
@ -101,7 +107,7 @@ defineEmits<{
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
<q-btn
|
<q-btn
|
||||||
v-if="typeTree === 'product'"
|
v-if="typeTree === 'product' && !node.actionDisabled"
|
||||||
icon="mdi-eye-outline"
|
icon="mdi-eye-outline"
|
||||||
:id="`btn-tree-eye-${node.name}`"
|
:id="`btn-tree-eye-${node.name}`"
|
||||||
size="sm"
|
size="sm"
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -271,7 +271,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
|
|
||||||
// Product
|
// Product
|
||||||
|
|
||||||
async function fetchStatsProduct(opts?: { productTypeId?: string }) {
|
async function fetchStatsProduct(opts?: { productGroupId?: string }) {
|
||||||
const params = new URLSearchParams();
|
const params = new URLSearchParams();
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(opts || {})) {
|
for (const [k, v] of Object.entries(opts || {})) {
|
||||||
|
|
@ -296,7 +296,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
productTypeId?: string;
|
productGroupId?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
},
|
},
|
||||||
flow?: {
|
flow?: {
|
||||||
|
|
@ -428,7 +428,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
productTypeId?: string;
|
productGroupId?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
},
|
},
|
||||||
flow?: {
|
flow?: {
|
||||||
|
|
@ -545,7 +545,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
serviceId: string,
|
serviceId: string,
|
||||||
data: Partial<ServiceCreate & { status: string }>,
|
data: Partial<ServiceCreate & { status: string }>,
|
||||||
) {
|
) {
|
||||||
const { image, code, productTypeId, ...payload } = data;
|
const { image, code, productGroupId, ...payload } = data;
|
||||||
|
|
||||||
if (payload.status === 'CREATED') {
|
if (payload.status === 'CREATED') {
|
||||||
delete payload.status;
|
delete payload.status;
|
||||||
|
|
@ -736,7 +736,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
|
||||||
query?: string;
|
query?: string;
|
||||||
page?: number;
|
page?: number;
|
||||||
pageSize?: number;
|
pageSize?: number;
|
||||||
productTypeId?: string;
|
productGroupId?: string;
|
||||||
status?: string;
|
status?: string;
|
||||||
},
|
},
|
||||||
flow?: {
|
flow?: {
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ export interface TreeProduct {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Service {
|
export interface Service {
|
||||||
productTypeId: string;
|
productGroupId: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
updatedBy: UpdatedBy;
|
updatedBy: UpdatedBy;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
|
|
@ -62,7 +62,7 @@ export interface ServiceCreate {
|
||||||
code: string;
|
code: string;
|
||||||
image?: File;
|
image?: File;
|
||||||
status?: Status;
|
status?: Status;
|
||||||
productTypeId: string;
|
productGroupId: string;
|
||||||
registeredBranchId: string | null;
|
registeredBranchId: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ export interface ServiceById {
|
||||||
code: string;
|
code: string;
|
||||||
id: string;
|
id: string;
|
||||||
imageUrl: 'string';
|
imageUrl: 'string';
|
||||||
productTypeId: string;
|
productGroupId: string;
|
||||||
registeredBranchId: string;
|
registeredBranchId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,12 +136,14 @@ export interface WorkItems {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductList {
|
export interface ProductList {
|
||||||
|
expenseType: string;
|
||||||
|
vatIncluded: boolean;
|
||||||
remark: string;
|
remark: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
updatedBy: UpdatedBy;
|
updatedBy: UpdatedBy;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
createdBy: CreatedBy;
|
createdBy: CreatedBy;
|
||||||
productTypeId: string;
|
productGroupId: string;
|
||||||
status: Status;
|
status: Status;
|
||||||
serviceCharge: number;
|
serviceCharge: number;
|
||||||
agentPrice: number;
|
agentPrice: number;
|
||||||
|
|
@ -156,8 +158,10 @@ export interface ProductList {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductCreate {
|
export interface ProductCreate {
|
||||||
|
expenseType: string;
|
||||||
|
vatIncluded: boolean;
|
||||||
registeredBranchId: string;
|
registeredBranchId: string;
|
||||||
productTypeId: string;
|
productGroupId: string;
|
||||||
remark: string;
|
remark: string;
|
||||||
serviceCharge: number;
|
serviceCharge: number;
|
||||||
agentPrice: number;
|
agentPrice: number;
|
||||||
|
|
@ -171,7 +175,7 @@ export interface ProductCreate {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ProductUpdate {
|
export interface ProductUpdate {
|
||||||
productTypeId: string;
|
productGroupId: string;
|
||||||
remark: string;
|
remark: string;
|
||||||
serviceCharge: number;
|
serviceCharge: number;
|
||||||
agentPrice: number;
|
agentPrice: number;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue