预算书-财政拨款、年度预算表 功能添加 10.31

master
zhc077 3 weeks ago
parent 02ff92b78b
commit 67280d2a92
  1. 63
      jeecgboot-vue3/src/views/projectApplication/kejigongguan/yusuanshu/NianDuYuSuanDemo.vue

@ -4,23 +4,15 @@
<thead>
<tr>
<th rowspan="2" style="width: 300px; position: relative">
<div
style="
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
"
>
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)">
<!-- <a-button @click="save" type="primary">Primary Button</a-button>-->
<th>单位名称</th>
单位名称
</div>
</th>
<th colspan="3">分年预算</th>
<th rowspan="2">合计</th>
</tr>
<tr>
<th><a-date-picker v-model:value="data.year1" picker="year" /></th>
<th><a-date-picker v-model:value="data.year2" picker="year" /></th>
<th><a-date-picker v-model:value="data.year3" picker="year" /></th>
@ -39,16 +31,17 @@
</div>
<div class="button-container">
<a-button type="primary" @click="handleSubmit">保存</a-button>
<a-button type="primary" @click="router.back();">返回</a-button>
<a-button type="primary" @click="router.back()">返回</a-button>
</div>
</template>
<script setup>
import {ref,onMounted,computed} from 'vue'
import {useRoute, useRouter} from "vue-router";
import {saveOrUpdate} from "@/views/projectAnnualBudget/ProjectAnnualBudget.api";
import {defHttp} from "@/utils/http/axios";
import {useMessage} from "@/hooks/web/useMessage";
import { ref, onMounted, computed } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { saveOrUpdate } from '@/views/projectAnnualBudget/ProjectAnnualBudget.api';
import { defHttp } from '@/utils/http/axios';
import { useMessage } from '@/hooks/web/useMessage';
import dayjs from 'dayjs';
const { createMessage } = useMessage();
const router = useRouter();
@ -62,11 +55,12 @@ const data = ref({
year2Value: 0,
year3Value: 0,
departName: '',
totalAmount:''
})
totalAmount: '',
});
onMounted(() => {
loadData();
})
// data.value.year1 = dayjs('2018/01/01','YYYY/MM/DD')
});
const handleSubmit = async () => {
let params = {
@ -78,13 +72,12 @@ const handleSubmit = async () => {
year3Value: data.value.year3Value,
departName: data.value.departName,
totalAmount: Number(data.value.year1Value) + Number(data.value.year2Value) + Number(data.value.year3Value),
}
};
params.projectId = route.query.id;
defHttp
.post({
defHttp.post({
url: '/projectAnnualBudget/projectAnnualBudget/add/' + route.query.id,
params: params,
})
});
/*.then(() => {
// createMessage.success(``);
// loadData();
@ -92,7 +85,7 @@ const handleSubmit = async () => {
.finally(() => {
// loading.value = false;
});*/
}
};
//
async function loadData() {
@ -102,24 +95,28 @@ async function loadData() {
.get({
//
url: '/projectAnnualBudget/projectAnnualBudget/queryByProjectId/' + route.query.id,
}).then((result) => {
data.value.year1Value = result.year1Value
data.value.year2Value = result.year2Value
data.value.year3Value = result.year3Value
data.value.departName = result.departName
console.log("the data()",JSON.stringify(result))
})
.then((result) => {
data.value.year1Value = result.year1Value;
data.value.year2Value = result.year2Value;
data.value.year3Value = result.year3Value;
data.value.departName = result.departName;
data.value.year1 = dayjs(result.year1, 'YYYY');
data.value.year2 = dayjs(result.year3, 'YYYY');
data.value.year3 = dayjs(result.year3, 'YYYY');
console.log('the data()', JSON.stringify(result));
// total
// pagination.total = result.total;
// dataSource
// dataSource.value = result.records;
// //
// selectedRows.value = [];
})
});
}
const Amount = computed(() => {
return Number(data.value.year1Value) + Number(data.value.year2Value) + Number(data.value.year3Value)
})
return Number(data.value.year1Value) + Number(data.value.year2Value) + Number(data.value.year3Value);
});
</script>
<style scoped lang="less">

Loading…
Cancel
Save