ZaiZai 1 year ago
parent
commit
1eba7a399c
2 changed files with 32 additions and 6 deletions
  1. 8 0
      src/api/modules/funding/index.js
  2. 24 6
      src/views/funding/budget.vue

+ 8 - 0
src/api/modules/funding/index.js

@@ -33,4 +33,12 @@ export default {
             data: form,
         })
     },
+    //获取已经计量月份
+    async getMeterMonth(form) {
+        return HcApi({
+            url: '/api/blade-meter/formPeriod/getMeterMonth',
+            method: 'get',
+            params: form,
+        })
+    },
 }

+ 24 - 6
src/views/funding/budget.vue

@@ -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>