ZaiZai 1 year ago
parent
commit
b6274e01e7
3 changed files with 113 additions and 1 deletions
  1. 7 1
      src/router/modules/base.js
  2. 0 0
      src/views/funding/modules/plan-data.vue
  3. 106 0
      src/views/funding/plan.vue

+ 7 - 1
src/router/modules/base.js

@@ -260,9 +260,15 @@ export default [
             {
                 path: '/debit-pay/funding',
                 name: 'debit-pay-funding',
-                redirect: '/debit-pay/funding/budget',
+                redirect: '/debit-pay/funding/plan',
                 meta: { title: '资金预算' },
                 children: [
+                    {
+                        path: '/debit-pay/funding/plan',
+                        name: 'debit-pay-funding-plan',
+                        meta: { title: '资金预算期' },
+                        component: () => import('~src/views/funding/plan.vue'),
+                    },
                     {
                         path: '/debit-pay/funding/budget',
                         name: 'debit-pay-funding-budget',

+ 0 - 0
src/views/funding/modules/budget-data.vue → src/views/funding/modules/plan-data.vue


+ 106 - 0
src/views/funding/plan.vue

@@ -0,0 +1,106 @@
+<template>
+    <hc-card title="资金预算计划">
+        <template #extra>
+            <el-button hc-btn type="primary" @click="addRowClick">新增</el-button>
+        </template>
+        <hc-table :column="tableColumn" :datas="tableData" :loading="tableLoading" :is-index="false">
+            <template #action="{ row }">
+                <el-link type="success" @click="editRowClick(row)">修改</el-link>
+                <el-link type="danger" @click="delRowClick(row)">删除</el-link>
+            </template>
+        </hc-table>
+        <template #action>
+            <hc-pages :pages="searchForm" @change="pageChange" />
+        </template>
+        <!-- 新增/修改 -->
+        <HcPlanData v-model="isBudgetDataShow" :info="budgetRowData" @finish="getTableData" />
+    </hc-card>
+</template>
+
+<script setup>
+import { onActivated, ref } from 'vue'
+import { useAppStore } from '~src/store'
+import { HcDelMsg } from 'hc-vue3-ui'
+import { getArrValue } from 'js-fast-way'
+import HcPlanData from './modules/plan-data.vue'
+import mainApi from '~api/funding/budget'
+
+//获取全局变量
+const store = useAppStore()
+const projectId = ref(store.getProjectId)
+const contractId = ref(store.getContractId)
+
+defineOptions({
+    name: 'FundingBudget',
+})
+
+//选项卡被激活
+onActivated(() => {
+    projectId.value = store.getProjectId
+    contractId.value = store.getContractId
+    getTableData()
+})
+
+//搜索表单
+const searchForm = ref({ current: 1, size: 20, total: 0 })
+
+//分页
+const pageChange = ({ current, size }) => {
+    searchForm.value.current = current
+    searchForm.value.size = size
+    getTableData()
+}
+
+//表格数据
+const tableData = ref([
+    { key1:'2023-11', key2: '2024-04' },
+])
+const tableColumn = ref([
+    { key: 'key1', name: '开始时间' },
+    { key: 'key2', name: '结束时间' },
+    { key: 'action', name: '操作', width: 140, align: 'center' },
+])
+
+//获取表格数据
+const tableLoading = ref(false)
+const getTableData = async () => {
+    /*tableLoading.value = true
+    const { data } = await mainApi.getPage({
+        ...searchForm.value,
+        projectId: projectId.value,
+    })
+    tableLoading.value = false
+    tableData.value = getArrValue(data?.records)
+    searchForm.value.total = data['total'] || 0*/
+}
+
+//新增/修改弹窗
+const isBudgetDataShow = ref(false)
+const budgetRowData = ref({})
+
+//新增数据
+const addRowClick = () => {
+    budgetRowData.value = {}
+    isBudgetDataShow.value = true
+}
+
+//修改数据
+const editRowClick = (row) => {
+    budgetRowData.value = row
+    isBudgetDataShow.value = true
+}
+
+//删除数据
+const delRowClick = (row) => {
+    HcDelMsg(async (resolve) => {
+        console.log('删除中...')
+        setTimeout(() => {
+            resolve() //关闭弹窗的回调
+        }, 3000)
+    })
+}
+</script>
+
+<style scoped lang="scss">
+
+</style>