From f06a17ee543e35bf2e17f2348e137faab42e1255 Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期二, 02 九月 2025 16:47:00 +0800 Subject: [PATCH] feat: 页面 --- src/views/FinanceManage/FinanceManageList.vue | 53 -------- src/views/FinanceManage/BalanceManage.vue | 135 ++++++++++++++++++++++ src/views/FinanceManage/components/BalanceDetailDialog.vue | 141 +++++++++++++++++++++++ src/views/FinanceManage/components/FinanceDetailDialog.vue | 26 ++-- 4 files changed, 289 insertions(+), 66 deletions(-) diff --git a/src/views/FinanceManage/BalanceManage.vue b/src/views/FinanceManage/BalanceManage.vue new file mode 100644 index 0000000..92ffa1d --- /dev/null +++ b/src/views/FinanceManage/BalanceManage.vue @@ -0,0 +1,135 @@ +<template> + <LoadingLayout :loading="state.loading"> + <AppContainer> + <ProTableQueryFilterBar @on-reset="reset"> + <template #query> + <QueryFilterItem> + <FieldSelect + placeholder="鎵�灞炲叕鍙�" + v-model="extraParamState.status" + :value-enum="[]" + @change="getList()" + /> + </QueryFilterItem> + <QueryFilterItem tip-content="浣欓鑼冨洿"> + <el-input-number + v-model="extraParamState.minAmount" + placeholder="浣欓鏈�灏忛噾棰�" + size="small" + style="width: 150px" + :controls="false" + />~ + <el-input-number + v-model="extraParamState.maxAmount" + placeholder="浣欓鏈�澶ч噾棰�" + size="small" + style="width: 150px" + :controls="false" + /> + </QueryFilterItem> + <QueryFilterItem> + <SearchInput + v-model="extraParamState.keyword" + style="width: 260px" + placeholder="濮撳悕/鎵嬫満鍙�/韬唤璇佸彿" + @on-click-search="getList" + > + </SearchInput> + </QueryFilterItem> + </template> + </ProTableQueryFilterBar> + <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> + </ProTableV2> + </AppContainer> + <BalanceDetailDialog v-bind="dialogProps" /> + </LoadingLayout> +</template> + +<script setup lang="ts"> +import { + ProTableQueryFilterBar, + OperationBtnType, + ProTableV2, + SearchInput, + LoadingLayout, + AppContainer, + QueryFilterItem, + useTable, + useFormDialog, + FieldSelect, +} from '@bole-core/components'; +import { useAccess } from '@/hooks'; +import * as enterpriseServices from '@/services/api/enterprise'; +import BalanceDetailDialog from './components/BalanceDetailDialog.vue'; + +defineOptions({ + name: 'BalanceManage', +}); + +const operationBtnMap: Record<string, OperationBtnType> = { + detailBtn: { emits: { onClick: (role) => openDialog(role) } }, +}; + +const { column, operationBtns } = useAccess({ + operationBtnMap, +}); + +const router = useRouter(); +const BaseState = { + loading: true, +}; + +const state = reactive({ ...BaseState }); + +onMounted(async () => { + await getList(); + state.loading = false; +}); + +const { + getDataSource: getList, + proTableProps, + paginationState, + extraParamState, + reset, +} = useTable( + async ({ pageIndex, pageSize }, extraParamState) => { + try { + let params: API.GetEnterprisesQuery = { + pageModel: { + rows: pageSize, + page: pageIndex, + orderInput: extraParamState.orderInput, + }, + // searchKeys: extraParamState.keyword, + }; + let res = await enterpriseServices.getEnterprises(params, { + showLoading: !state.loading, + }); + return res; + } catch (error) {} + }, + { + defaultExtraParams: { + keyword: '', + status: '', + minAmount: null as number, + maxAmount: null as number, + orderInput: [{ property: 'id', order: EnumPagedListOrder.Asc }], + }, + columnsRenderProps: {}, + } +); + +const { dialogProps, handleEdit, editForm } = useFormDialog({ + defaultFormParams: { + id: '', + }, +}); + +function openDialog(row) { + handleEdit({ + id: row.id, + }); +} +</script> diff --git a/src/views/FinanceManage/FinanceManageList.vue b/src/views/FinanceManage/FinanceManageList.vue index fc1c742..183bcca 100644 --- a/src/views/FinanceManage/FinanceManageList.vue +++ b/src/views/FinanceManage/FinanceManageList.vue @@ -1,54 +1,6 @@ <template> <LoadingLayout :loading="state.loading"> <AppContainer> - <ProTableQueryFilterBar @on-reset="reset"> - <template #query> - <QueryFilterItem tip-content="鍙戝竷鐘舵��"> - <FieldRadio - v-model="extraParamState.status" - :value-enum="[ - { value: true, label: '鍙戝竷涓�' }, - { value: false, label: '宸插仠姝�' }, - ]" - buttonStyle - showAllBtn - @change="getList()" - /> - </QueryFilterItem> - <QueryFilterItem tip-content="鎺ㄨ崘鐘舵��"> - <FieldRadio - v-model="extraParamState.status" - :value-enum="[ - { value: true, label: '宸叉帹鑽�' }, - { value: false, label: '鏈帹鑽�' }, - ]" - buttonStyle - showAllBtn - @change="getList()" - /> - </QueryFilterItem> - <QueryFilterItem tip-content="鍙戝竷鏃堕棿"> - <FieldDatePicker - v-model="extraParamState.beginDate" - type="daterange" - range-separator="~" - start-placeholder="寮�濮嬫棩鏈�" - end-placeholder="缁撴潫鏃ユ湡" - clearable - @change="getList()" - ></FieldDatePicker> - </QueryFilterItem> - <QueryFilterItem> - <SearchInput - v-model="extraParamState.keyword" - style="width: 260px" - placeholder="浠诲姟鍚嶇О" - @on-click-search="getList" - > - </SearchInput> - </QueryFilterItem> - </template> - </ProTableQueryFilterBar> <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns"> </ProTableV2> </AppContainer> @@ -58,16 +10,11 @@ <script setup lang="ts"> import { - ProTableQueryFilterBar, OperationBtnType, ProTableV2, - SearchInput, LoadingLayout, AppContainer, - QueryFilterItem, useTable, - FieldDatePicker, - FieldRadio, useFormDialog, } from '@bole-core/components'; import { useAccess } from '@/hooks'; diff --git a/src/views/FinanceManage/components/BalanceDetailDialog.vue b/src/views/FinanceManage/components/BalanceDetailDialog.vue new file mode 100644 index 0000000..a81d09f --- /dev/null +++ b/src/views/FinanceManage/components/BalanceDetailDialog.vue @@ -0,0 +1,141 @@ +<template> + <ProDialog title="浣欓鏄庣粏" v-model="visible" destroy-on-close draggable> + <ProDialogTableWrapper :height="500"> + <ProTableQueryFilterBar @on-reset="reset"> + <template #query> + <QueryFilterItem> + <FieldSelect + v-model="extraParamState.status" + :valueEnum="[]" + clearable + filterable + placeholder="浜ゆ槗绫诲瀷" + /> + </QueryFilterItem> + <QueryFilterItem tip-content="鏌ヨ鏃ユ湡"> + <FieldDatePicker + v-model="extraParamState.creationTime" + type="daterange" + range-separator="~" + start-placeholder="璧峰鏃ユ湡" + end-placeholder="鎴鏃ユ湡" + clearable + @change="getList()" + ></FieldDatePicker> + </QueryFilterItem> + </template> + </ProTableQueryFilterBar> + <ProTableV2 v-bind="proTableProps" :columns="columns" :showOperationColumn="false"> + </ProTableV2> + </ProDialogTableWrapper> + </ProDialog> +</template> + +<script setup lang="ts"> +import { + defineColumns, + ProDialog, + useTable, + ProDialogTableWrapper, + QueryFilterItem, + FieldDatePicker, + FieldSelect, + ProTableV2, + ProTableQueryFilterBar, +} from '@bole-core/components'; +import * as enterpriseServices from '@/services/api/enterprise'; +import { ModelValueType } from 'element-plus'; + +defineOptions({ + name: 'FinanceDetailDialog', +}); + +type Form = { + id?: string; +}; + +const visible = defineModel({ type: Boolean }); +const form = defineModel<Form>('form'); + +const emit = defineEmits<{ + (e: 'update:modelValue', value: boolean): void; + (e: 'onCancel'): void; +}>(); + +const columns = defineColumns([ + { + id: '1', + enCode: 'name', + name: '浜ゆ槗鏃堕棿', + }, + { + id: '2', + enCode: 'name', + name: '鏀跺叆', + }, + { + id: '3', + enCode: 'name', + name: '鏀嚭', + }, + { + id: '4', + enCode: 'name', + name: '璐︽埛浣欓', + }, + { + id: '4', + enCode: 'name', + name: '瀵规柟甯愬彿/鎴峰悕', + }, + { + id: '4', + enCode: 'name', + name: '鐢ㄩ��', + }, +]); + +watch( + () => visible.value, + (value) => { + if (value) { + getList(); + } + } +); + +const { + getDataSource: getList, + proTableProps, + paginationState, + extraParamState, + reset, +} = useTable( + async ({ pageIndex, pageSize }, extraParamState) => { + try { + let params: API.GetEnterprisesQuery = { + pageModel: { + rows: pageSize, + page: pageIndex, + orderInput: extraParamState.orderInput, + }, + // searchKeys: extraParamState.keyword, + }; + let res = await enterpriseServices.getEnterprises(params); + return res; + } catch (error) {} + }, + { + defaultExtraParams: { + status: '', + creationTime: [] as unknown as ModelValueType, + orderInput: [{ property: 'id', order: EnumPagedListOrder.Asc }], + }, + columnsRenderProps: {}, + } +); +</script> + +<style lang="scss" scoped> +@use '@/style/common.scss' as *; +</style> diff --git a/src/views/FinanceManage/components/FinanceDetailDialog.vue b/src/views/FinanceManage/components/FinanceDetailDialog.vue index 899ce02..ffa1459 100644 --- a/src/views/FinanceManage/components/FinanceDetailDialog.vue +++ b/src/views/FinanceManage/components/FinanceDetailDialog.vue @@ -18,7 +18,7 @@ }); type Form = { - name?: string; + id?: string; }; const visible = defineModel({ type: Boolean }); @@ -34,62 +34,62 @@ columns: [ { label: '浠樻浜鸿处鎴�', - key: 'name', + key: 'id', type: 'text', }, { label: '鏀舵浜鸿处鎴�', - key: 'name', + key: 'id', type: 'text', }, { label: '浠樻浜哄悕绉�', - key: 'name', + key: 'id', type: 'text', }, { label: '鏀舵浜哄悕绉�', - key: 'name', + key: 'id', type: 'text', }, { label: '浠樻浜哄紑鎴疯', - key: 'name', + key: 'id', type: 'text', }, { label: '鏀舵浜哄紑鎴疯', - key: 'name', + key: 'id', type: 'text', }, { label: '甯佺', - key: 'name', + key: 'id', type: 'text', }, { label: '浜ゆ槗閲戦', - key: 'name', + key: 'id', type: 'money', }, { label: '鐢ㄩ��', - key: 'name', + key: 'id', type: 'text', }, { label: '鎽樿', - key: 'name', + key: 'id', type: 'text', }, { label: '浜ゆ槗鏃堕棿', - key: 'name', + key: 'id', type: 'text', }, { label: '浜ゆ槗鐘舵��', - key: 'name', + key: 'id', type: 'text', }, ], -- Gitblit v1.9.1