|
|
@ -4,23 +4,15 @@ |
|
|
|
<thead> |
|
|
|
<thead> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
<th rowspan="2" style="width: 300px; position: relative"> |
|
|
|
<th rowspan="2" style="width: 300px; position: relative"> |
|
|
|
<div |
|
|
|
<div style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%)"> |
|
|
|
style=" |
|
|
|
<!-- <a-button @click="save" type="primary">Primary Button</a-button>--> |
|
|
|
position: absolute; |
|
|
|
单位名称 |
|
|
|
top: 50%; |
|
|
|
|
|
|
|
left: 50%; |
|
|
|
|
|
|
|
transform: translate(-50%, -50%); |
|
|
|
|
|
|
|
" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<!-- <a-button @click="save" type="primary">Primary Button</a-button>--> |
|
|
|
|
|
|
|
<th>单位名称</th> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</th> |
|
|
|
</th> |
|
|
|
<th colspan="3">分年预算</th> |
|
|
|
<th colspan="3">分年预算</th> |
|
|
|
<th rowspan="2">合计</th> |
|
|
|
<th rowspan="2">合计</th> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<tr> |
|
|
|
|
|
|
|
|
|
|
|
<th><a-date-picker v-model:value="data.year1" picker="year" /></th> |
|
|
|
<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.year2" picker="year" /></th> |
|
|
|
<th><a-date-picker v-model:value="data.year3" picker="year" /></th> |
|
|
|
<th><a-date-picker v-model:value="data.year3" picker="year" /></th> |
|
|
@ -32,67 +24,68 @@ |
|
|
|
<td><a-input prefix="¥" suffix="RMB" v-model:value="data.year1Value" /></td> |
|
|
|
<td><a-input prefix="¥" suffix="RMB" v-model:value="data.year1Value" /></td> |
|
|
|
<td><a-input prefix="¥" suffix="RMB" v-model:value="data.year2Value" /></td> |
|
|
|
<td><a-input prefix="¥" suffix="RMB" v-model:value="data.year2Value" /></td> |
|
|
|
<td><a-input prefix="¥" suffix="RMB" v-model:value="data.year3Value" /></td> |
|
|
|
<td><a-input prefix="¥" suffix="RMB" v-model:value="data.year3Value" /></td> |
|
|
|
<td>{{Amount}}</td> |
|
|
|
<td>{{ Amount }}</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
</tbody> |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
</div> |
|
|
|
<div class="button-container" style="margin-top: 50px"> |
|
|
|
<div class="button-container"> |
|
|
|
<a-button type="primary" @click="handleSubmit">保存</a-button> |
|
|
|
<a-button type="primary" @click="handleSubmit">保存</a-button> |
|
|
|
<a-button type="primary" @click="router.back()" style="margin-left: 30px">返回</a-button> |
|
|
|
<a-button type="primary" @click="router.back();">返回</a-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<script setup> |
|
|
|
<script setup> |
|
|
|
import {ref,onMounted,computed} from 'vue' |
|
|
|
import { ref, onMounted, computed } from 'vue'; |
|
|
|
import {useRoute, useRouter} from "vue-router"; |
|
|
|
import { useRoute, useRouter } from 'vue-router'; |
|
|
|
import {saveOrUpdate} from "@/views/projectAnnualBudget/ProjectAnnualBudget.api"; |
|
|
|
import { saveOrUpdate } from '@/views/projectAnnualBudget/ProjectAnnualBudget.api'; |
|
|
|
import {defHttp} from "@/utils/http/axios"; |
|
|
|
import { defHttp } from '@/utils/http/axios'; |
|
|
|
import {useMessage} from "@/hooks/web/useMessage"; |
|
|
|
import { useMessage } from '@/hooks/web/useMessage'; |
|
|
|
|
|
|
|
import dayjs from 'dayjs'; |
|
|
|
const { createMessage } = useMessage(); |
|
|
|
const { createMessage } = useMessage(); |
|
|
|
|
|
|
|
|
|
|
|
const router = useRouter(); |
|
|
|
const router = useRouter(); |
|
|
|
const route = useRoute(); |
|
|
|
const route = useRoute(); |
|
|
|
// import moment from 'moment'; |
|
|
|
// import moment from 'moment'; |
|
|
|
const data = ref({ |
|
|
|
const data = ref({ |
|
|
|
year1:'', |
|
|
|
year1: '', |
|
|
|
year2:'', |
|
|
|
year2: '', |
|
|
|
year3:'', |
|
|
|
year3: '', |
|
|
|
year1Value:0, |
|
|
|
year1Value: 0, |
|
|
|
year2Value:0, |
|
|
|
year2Value: 0, |
|
|
|
year3Value:0, |
|
|
|
year3Value: 0, |
|
|
|
departName:'', |
|
|
|
departName: '', |
|
|
|
totalAmount:'' |
|
|
|
totalAmount: '', |
|
|
|
}) |
|
|
|
}); |
|
|
|
onMounted(()=> { |
|
|
|
onMounted(() => { |
|
|
|
loadData(); |
|
|
|
loadData(); |
|
|
|
}) |
|
|
|
// data.value.year1 = dayjs('2018/01/01','YYYY/MM/DD') |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
const handleSubmit = async () => { |
|
|
|
const handleSubmit = async () => { |
|
|
|
let params = { |
|
|
|
let params = { |
|
|
|
year1:data.value.year1.$y, |
|
|
|
year1: data.value.year1.$y, |
|
|
|
year2:data.value.year2.$y, |
|
|
|
year2: data.value.year2.$y, |
|
|
|
year3:data.value.year3.$y, |
|
|
|
year3: data.value.year3.$y, |
|
|
|
year1Value:data.value.year1Value, |
|
|
|
year1Value: data.value.year1Value, |
|
|
|
year2Value:data.value.year2Value, |
|
|
|
year2Value: data.value.year2Value, |
|
|
|
year3Value:data.value.year3Value, |
|
|
|
year3Value: data.value.year3Value, |
|
|
|
departName:data.value.departName, |
|
|
|
departName: data.value.departName, |
|
|
|
totalAmount:Number(data.value.year1Value) + Number(data.value.year2Value) + Number(data.value.year3Value), |
|
|
|
totalAmount: Number(data.value.year1Value) + Number(data.value.year2Value) + Number(data.value.year3Value), |
|
|
|
} |
|
|
|
}; |
|
|
|
params.projectId = route.query.id; |
|
|
|
params.projectId = route.query.id; |
|
|
|
defHttp |
|
|
|
defHttp.post({ |
|
|
|
.post({ |
|
|
|
url: '/projectAnnualBudget/projectAnnualBudget/add/' + route.query.id, |
|
|
|
url: '/projectAnnualBudget/projectAnnualBudget/add/'+route.query.id, |
|
|
|
params: params, |
|
|
|
params: params, |
|
|
|
}); |
|
|
|
}) |
|
|
|
/*.then(() => { |
|
|
|
/*.then(() => { |
|
|
|
// createMessage.success(`保存成功!`); |
|
|
|
// createMessage.success(`保存成功!`); |
|
|
|
// loadData(); |
|
|
|
// loadData(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
.finally(() => { |
|
|
|
// loading.value = false; |
|
|
|
// loading.value = false; |
|
|
|
});*/ |
|
|
|
});*/ |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 加载数据 |
|
|
|
// 加载数据 |
|
|
|
async function loadData() { |
|
|
|
async function loadData() { |
|
|
@ -101,31 +94,36 @@ async function loadData() { |
|
|
|
await defHttp |
|
|
|
await defHttp |
|
|
|
.get({ |
|
|
|
.get({ |
|
|
|
// 请求地址 |
|
|
|
// 请求地址 |
|
|
|
url: '/projectAnnualBudget/projectAnnualBudget/queryByProjectId/'+route.query.id, |
|
|
|
url: '/projectAnnualBudget/projectAnnualBudget/queryByProjectId/' + route.query.id, |
|
|
|
}).then((result) => { |
|
|
|
}) |
|
|
|
data.value.year1Value = result.year1Value |
|
|
|
.then((result) => { |
|
|
|
data.value.year2Value = result.year2Value |
|
|
|
data.value.year1Value = result.year1Value; |
|
|
|
data.value.year3Value = result.year3Value |
|
|
|
data.value.year2Value = result.year2Value; |
|
|
|
data.value.departName = result.departName |
|
|
|
data.value.year3Value = result.year3Value; |
|
|
|
console.log("the data()",JSON.stringify(result)) |
|
|
|
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,数据总数量 |
|
|
|
// 后台查询回来的 total,数据总数量 |
|
|
|
// pagination.total = result.total; |
|
|
|
// pagination.total = result.total; |
|
|
|
// 将查询的数据赋值给 dataSource |
|
|
|
// 将查询的数据赋值给 dataSource |
|
|
|
// dataSource.value = result.records; |
|
|
|
// dataSource.value = result.records; |
|
|
|
// // 重置选择 |
|
|
|
// // 重置选择 |
|
|
|
// selectedRows.value = []; |
|
|
|
// selectedRows.value = []; |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const Amount = computed(() => { |
|
|
|
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> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style scoped lang="less"> |
|
|
|
<style scoped lang="less"> |
|
|
|
.container { |
|
|
|
.container { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 500px; |
|
|
|
height: 500px; |
|
|
|
|
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
table { |
|
|
|
table { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|