x
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useInventory } from '../composables/useInventory'
|
||||
import { handleApiError } from '@/shared/notification'
|
||||
|
||||
@@ -34,6 +34,10 @@ function refreshFinance() {
|
||||
loadFinance()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
refreshFinance()
|
||||
})
|
||||
|
||||
const totalReceivable = computed(() => {
|
||||
return state.financeSummary?.total_receivable ?? 0
|
||||
})
|
||||
@@ -65,8 +69,6 @@ function getTransactionStatusLabel(status: string): string {
|
||||
}
|
||||
return map[status] || status
|
||||
}
|
||||
|
||||
refreshFinance()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -155,8 +157,8 @@ refreshFinance()
|
||||
<el-table-column label="应收余额">
|
||||
<template #default="{ row }">{{ formatCurrency(row.receivable_balance) }}</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.customerFinanceStatement.length === 0" description="暂无数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.customerFinanceStatement.length === 0" description="暂无数据" />
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 16px;">
|
||||
@@ -179,8 +181,8 @@ refreshFinance()
|
||||
<el-table-column label="应付余额">
|
||||
<template #default="{ row }">{{ formatCurrency(row.payable_balance) }}</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.supplierFinanceStatement.length === 0" description="暂无数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.supplierFinanceStatement.length === 0" description="暂无数据" />
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 16px;">
|
||||
@@ -202,8 +204,8 @@ refreshFinance()
|
||||
<el-table-column label="未结款">
|
||||
<template #default="{ row }">{{ formatCurrency(row.unsettled_amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.customerProductStatement.length === 0" description="暂无数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.customerProductStatement.length === 0" description="暂无数据" />
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-bottom: 16px;">
|
||||
@@ -225,8 +227,8 @@ refreshFinance()
|
||||
<el-table-column label="未结款">
|
||||
<template #default="{ row }">{{ formatCurrency(row.unsettled_amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.supplierProductStatement.length === 0" description="暂无数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.supplierProductStatement.length === 0" description="暂无数据" />
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
@@ -256,8 +258,8 @@ refreshFinance()
|
||||
<el-table-column label="日期">
|
||||
<template #default="{ row }">{{ formatDate(row.transaction_date) }}</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.financeTransactions.length === 0" description="暂无数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.financeTransactions.length === 0" description="暂无数据" />
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -197,8 +197,8 @@ function closeRestockModal() {
|
||||
<el-button type="danger" size="small" @click="deleteMaterial(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.materials.length === 0" description="暂无物料数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.materials.length === 0" description="暂无物料数据" />
|
||||
|
||||
<el-dialog
|
||||
v-model="showModal"
|
||||
|
||||
@@ -148,8 +148,8 @@ function closeModal() {
|
||||
<el-button type="danger" size="small" @click="deleteProduct(row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.finishedProducts.length === 0" description="暂无成品数据" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.finishedProducts.length === 0" description="暂无成品数据" />
|
||||
|
||||
<el-dialog
|
||||
v-model="showModal"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useInventory } from '../composables/useInventory'
|
||||
import { apiRequest } from '@/shared/api'
|
||||
import { addNotification, handleApiError } from '@/shared/notification'
|
||||
@@ -232,12 +232,14 @@ function closeReceiveModal() {
|
||||
}
|
||||
|
||||
async function initData() {
|
||||
await loadPurchaseOrders()
|
||||
await loadMaterials()
|
||||
await loadSuppliers()
|
||||
await loadPurchaseOrders()
|
||||
}
|
||||
|
||||
initData()
|
||||
onMounted(() => {
|
||||
initData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -324,8 +326,8 @@ initData()
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.purchaseOrders.length === 0" description="暂无采购订单" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.purchaseOrders.length === 0" description="暂无采购订单" />
|
||||
|
||||
<el-dialog
|
||||
v-model="showModal"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { ref, computed, onMounted } from 'vue'
|
||||
import { useInventory } from '../composables/useInventory'
|
||||
import { apiRequest } from '@/shared/api'
|
||||
import { addNotification, handleApiError } from '@/shared/notification'
|
||||
@@ -260,13 +260,15 @@ function closeConsumptionModal() {
|
||||
}
|
||||
|
||||
async function initData() {
|
||||
await loadProductionOrders()
|
||||
await loadCustomers()
|
||||
await loadMaterials()
|
||||
await loadFinishedProducts()
|
||||
await loadProductionOrders()
|
||||
}
|
||||
|
||||
initData()
|
||||
onMounted(() => {
|
||||
initData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -344,8 +346,8 @@ initData()
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-empty v-if="!state.loading && state.productionOrders.length === 0" description="暂无销售订单" />
|
||||
</el-table>
|
||||
<el-empty v-if="!state.loading && state.productionOrders.length === 0" description="暂无销售订单" />
|
||||
|
||||
<el-dialog
|
||||
v-model="showModal"
|
||||
|
||||
Reference in New Issue
Block a user