ZaiZai 1 anno fa
parent
commit
99c902d82c
3 ha cambiato i file con 176 aggiunte e 18 eliminazioni
  1. 84 0
      src/api/modules/funding/budget.js
  2. 15 15
      src/router/modules/base.js
  3. 77 3
      src/views/funding/budget.vue

+ 84 - 0
src/api/modules/funding/budget.js

@@ -0,0 +1,84 @@
+import { HcApi } from '../../request/index'
+
+export default {
+    //分页
+    async getPage(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/page',
+            method: 'get',
+            params: form,
+        })
+    },
+    //修改
+    async edit(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/update',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //新增
+    async add(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/add',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //删除
+    async remove(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/delete',
+            method: 'post',
+            params: form,
+        }, false)
+    },
+    //获取详情
+    async getDetail(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/detail',
+            method: 'get',
+            params: form,
+        })
+    },
+    //新增确认选择清单
+    async getSelectForm(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/selectForm',
+            method: 'post',
+            data: form,
+        }, false)
+    },
+    //新增添加清单
+    async addForm(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/addForm',
+            method: 'get',
+            params: form,
+        })
+    },
+    //新增-获取变更申请部位
+    async getChangeNode(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/getChangeNode',
+            method: 'get',
+            params: form,
+        })
+    },
+    //下达变更
+    async executeChange(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/executeChange',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+    //撤销变更
+    async annulChange(form) {
+        return HcApi({
+            url: '/api/blade-meter/changeTokenForm/annulChange',
+            method: 'get',
+            params: form,
+        }, false)
+    },
+}

+ 15 - 15
src/router/modules/base.js

@@ -257,6 +257,20 @@ export default [
                     },
                 ],
             },
+            {
+                path: '/debit-pay/funding',
+                name: 'debit-pay-funding',
+                redirect: '/debit-pay/funding/budget',
+                meta: { title: '资金预算' },
+                children: [
+                    {
+                        path: '/debit-pay/funding/budget',
+                        name: 'debit-pay-funding-budget',
+                        meta: { title: '资金预算计划' },
+                        component: () => import('~src/views/funding/budget.vue'),
+                    },
+                ],
+            },
             {
                 path: '/debit-pay/material',
                 name: 'debit-pay-material',
@@ -737,21 +751,7 @@ export default [
             },
         ],
     },
-    {
-        path: '/funding',
-        name: 'funding',
-        redirect: '/funding/budget',
-        meta: { title: '资金预算' },
-        component: Layout,
-        children: [
-            {
-                path: '/funding/budget',
-                name: 'funding-budget',
-                meta: { title: '资金预算计划' },
-                component: () => import('~src/views/funding/budget.vue'),
-            },
-        ],
-    },
+
     {
         path: '/user',
         name: 'user',

+ 77 - 3
src/views/funding/budget.vue

@@ -1,11 +1,85 @@
 <template>
-    <div>
-        111
-    </div>
+    <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>
+    </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 mainApi from '~api/funding/budget'
 
+const store = useAppStore()
+const projectId = ref(store.getProjectId)
+
+defineOptions({
+    name: 'FundingBudget',
+})
+
+onActivated(() => {
+    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 addRowClick = () => {
+
+}
+
+//修改数据
+const editRowClick = (row) => {
+
+}
+
+//删除数据
+const delRowClick = (row) => {
+
+}
 </script>
 
 <style scoped lang="scss">