diff --git a/src/stores/product-service/index.ts b/src/stores/product-service/index.ts index 6e81a2c9..6d97b91f 100644 --- a/src/stores/product-service/index.ts +++ b/src/stores/product-service/index.ts @@ -19,8 +19,9 @@ import { ProductOnWork, WorkCreate, ServiceAndProduct, + TreeProduct, } from './types'; -import { ref } from 'vue'; +import { computed, ref } from 'vue'; import useFlowStore from '../flow'; import useMyBranchStore from 'src/stores/my-branch'; @@ -28,6 +29,8 @@ import useMyBranchStore from 'src/stores/my-branch'; const useProductServiceStore = defineStore('api-product-service', () => { const useMyBranch = useMyBranchStore(); + const recordTreeProductType = ref>({}); + // Product Type const flowStore = useFlowStore(); @@ -91,6 +94,9 @@ const useProductServiceStore = defineStore('api-product-service', () => { if (!res) return false; if (res.status === 200) { + if (!!opts?.productGroupId) { + recordTreeProductType.value[opts?.productGroupId] = res.data.result; + } return res.data; } @@ -771,6 +777,7 @@ const useProductServiceStore = defineStore('api-product-service', () => { return { workNameItems, + recordTreeProductType, fetchStatsProductType, fetchListProductServiceByIdType,