acquisition in type info
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import {ClipboardButton} from '@/components';
|
||||
import {getMarketType, MarketType, MarketTypeInput, useApraisalStore, useMarketTaxStore} from "@/market";
|
||||
import {AcquisitionResultTable, BuyModal, useAcquiredTypesStore} from '@/market/acquisition';
|
||||
import {AcquisitionResultTable, BuyModal} from '@/market/acquisition';
|
||||
import {ScanResultTable, toScanResult} from '@/market/scan';
|
||||
import {marketApi} from "@/mammon";
|
||||
import {acquisitionApi, marketApi} from "@/mammon";
|
||||
import {ShoppingCartIcon} from '@heroicons/vue/24/outline';
|
||||
import log from "loglevel";
|
||||
import {computed, ref, watch} from "vue";
|
||||
import {ref, watch} from "vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {routeNames} from "@/routes";
|
||||
import {computedAsync, useStorage} from "@vueuse/core";
|
||||
@@ -36,20 +36,23 @@ const result = computedAsync(async () => {
|
||||
|
||||
return toScanResult(data, item.value);
|
||||
});
|
||||
const acquiredTypesStore = useAcquiredTypesStore();
|
||||
|
||||
const acquisitions = computed(() => {
|
||||
const acquisitions = computedAsync(async () => {
|
||||
const p = price.value;
|
||||
|
||||
return !p ?[] : acquiredTypesStore.acquiredTypes
|
||||
.filter(t => t.type === item.value?.id)
|
||||
.map(i => ({
|
||||
...i,
|
||||
type: p.type,
|
||||
buy: p.buy,
|
||||
sell: p.sell
|
||||
return !p ? [] : (await acquisitionApi.findAllAcquisitions(item.value?.id, true)).data
|
||||
.map(a => ({
|
||||
id: a.acquisitionId,
|
||||
quantity: a.quantity,
|
||||
remaining: a.remaining,
|
||||
price: a.unitCost,
|
||||
date: new Date(a.datetime),
|
||||
source: a.source,
|
||||
type: p.type,
|
||||
buy: p.buy,
|
||||
sell: p.sell
|
||||
}));
|
||||
});
|
||||
}, []);
|
||||
const view = () => {
|
||||
if (!inputItem.value) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user