|
@@ -20,45 +20,51 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { nextTick, ref, watch } from 'vue'
|
|
|
-
|
|
|
+import mainApi from '~api/static/actual.js'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
const props = defineProps({
|
|
|
cur: {
|
|
|
type: [String, Number],
|
|
|
default: '',
|
|
|
},
|
|
|
+checkyear:{
|
|
|
+ type: [String, Number],
|
|
|
+ default: '',
|
|
|
+},
|
|
|
})
|
|
|
|
|
|
const tabsKey = ref(props.cur)
|
|
|
+const year = ref('')
|
|
|
|
|
|
//监听
|
|
|
watch(() => [
|
|
|
props.cur,
|
|
|
-], ([key]) => {
|
|
|
+props.checkyear,
|
|
|
+], ([key, checkyear]) => {
|
|
|
tabsKey.value = key
|
|
|
-console.log(key)
|
|
|
+year.value = checkyear
|
|
|
+ if (key === 'month') {
|
|
|
+ console.log('获取月度计划')
|
|
|
+ budgetAndPracticalByMonth()
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
|
|
|
const tableData = ref([
|
|
|
-// { time:'一月', beginremain:'2000' },
|
|
|
-// { time:'二月', beginremain:'2000' },
|
|
|
-// { time:'三月', beginremain:'2000' },
|
|
|
-// { time:'四月', beginremain:'2000' },
|
|
|
-// { time:'五月', beginremain:'2000' },
|
|
|
-// { time:'六月', beginremain:'2000' },
|
|
|
-// { time:'七月', beginremain:'2000' },
|
|
|
-// { time:'八月', beginremain:'2000' },
|
|
|
-// { time:'九月', beginremain:'2000' },
|
|
|
-// { time:'十月', beginremain:'2000' },
|
|
|
-// { time:'十一月', beginremain:'2000' },
|
|
|
-// { time:'十二月', beginremain:'2000' },
|
|
|
-// { time:'总计', beginremain:'2000' },
|
|
|
-{ time:'一月', income1:1000, disburse1:1000, income2:2000, disburse2:2000, income3:300, disburse3:3000 },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
])
|
|
|
+//获取月度统计
|
|
|
+const budgetAndPracticalByMonth = async () => {
|
|
|
+ const { error, code, data } = await mainApi.budgetAndPracticalByMonth(
|
|
|
+ { year:year.value },
|
|
|
+ )
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
const tableColData = ref([
|
|
|
{
|
|
|
id:'time',
|