|
@@ -85,7 +85,6 @@ onActivated(() => {
|
|
|
projectId.value = store.getProjectId
|
|
|
contractId.value = store.getContractId
|
|
|
getYearDatas()
|
|
|
- getTableData()
|
|
|
})
|
|
|
|
|
|
//搜索表单
|
|
@@ -98,7 +97,30 @@ const getYearDatas = async () => {
|
|
|
projectId: projectId.value,
|
|
|
contractId: contractId.value,
|
|
|
})
|
|
|
- yearDatas.value = getArrValue(data)
|
|
|
+ const res = getArrValue(data)
|
|
|
+ yearDatas.value = res
|
|
|
+ if (res.length > 0) {
|
|
|
+ formPeriodId.value = res[0].id
|
|
|
+ getDataApi()
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//获取相关数据
|
|
|
+const getDataApi = () => {
|
|
|
+ getTableData()
|
|
|
+ getMeterMonth()
|
|
|
+}
|
|
|
+
|
|
|
+//获取已经计量月份
|
|
|
+const meterMonth = ref([])
|
|
|
+const getMeterMonth = async () => {
|
|
|
+ const { data } = await mainApi.getMeterMonth({
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ formPeriodId: formPeriodId.value,
|
|
|
+ })
|
|
|
+ console.log(data)
|
|
|
+ meterMonth.value = getArrValue(data)
|
|
|
}
|
|
|
|
|
|
//表格数据
|
|
@@ -161,7 +183,3 @@ const tableEditSave = async () => {
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-
|
|
|
-<style scoped lang="scss">
|
|
|
-
|
|
|
-</style>
|