From bd20a385dd86cf32735578c4c140a0aebf758e45 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期四, 15 五月 2025 17:15:07 +0800
Subject: [PATCH] fix: bug

---
 src/views/Reward/WithdrawalApproval.vue |  240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 240 insertions(+), 0 deletions(-)

diff --git a/src/views/Reward/WithdrawalApproval.vue b/src/views/Reward/WithdrawalApproval.vue
new file mode 100644
index 0000000..a575e10
--- /dev/null
+++ b/src/views/Reward/WithdrawalApproval.vue
@@ -0,0 +1,240 @@
+<template>
+  <LoadingLayout :loading="state.loading">
+    <AppContainer>
+      <ProTableQueryFilterBar @on-reset="reset">
+        <template #query>
+          <QueryFilterItem tip-content="鐢宠鏃堕棿">
+            <FieldDatePicker
+              v-model="extraParamState.dateTime"
+              type="daterange"
+              range-separator="~"
+              start-placeholder="寮�濮嬫棩鏈�"
+              end-placeholder="缁撴潫鏃ユ湡"
+              clearable
+              @change="getList()"
+            ></FieldDatePicker>
+          </QueryFilterItem>
+          <QueryFilterItem tip-content="瀹℃牳鐘舵��">
+            <FieldRadio
+              v-model="extraParamState.checkStatus"
+              :value-enum="EnterpriseRechargeStatusEnumText"
+              buttonStyle
+              showAllBtn
+              @change="getList()"
+            />
+          </QueryFilterItem>
+          <QueryFilterItem>
+            <SearchInput
+              v-model="extraParamState.keyWord"
+              style="width: 300px"
+              placeholder="浼佷笟鍚嶇О/鍥尯/淇$敤浠g爜"
+              @on-click-search="getList"
+            >
+            </SearchInput>
+          </QueryFilterItem>
+        </template>
+      </ProTableQueryFilterBar>
+
+      <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
+      </ProTableV2>
+      <WithdrawalApprovalAuditDialog v-bind="dialogProps"></WithdrawalApprovalAuditDialog>
+    </AppContainer>
+  </LoadingLayout>
+</template>
+
+<script setup lang="ts">
+import {
+  LoadingLayout,
+  AppContainer,
+  useTable,
+  ProTableQueryFilterBar,
+  ProTableV2,
+  defineOperationBtns,
+  SearchInput,
+  FieldRadio,
+  QueryFilterItem,
+  FieldDatePicker,
+  useFormDialog,
+  UploadUserFile,
+} from '@bole-core/components';
+import { Message, OrderInputType } from '@bole-core/core';
+import { format } from '@/utils';
+import { EnterpriseRechargeStatusEnum, EnterpriseRechargeStatusEnumText } from '@/constants';
+import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
+import WithdrawalApprovalAuditDialog from './components/WithdrawalApprovalAuditDialog.vue';
+import _ from 'lodash';
+import { ModelValueType } from 'element-plus';
+
+defineOptions({
+  name: 'WithdrawalApproval',
+});
+
+const column: API.CustomModuleColumnDto[] = [
+  {
+    id: '1',
+    enCode: 'enterpriseName',
+    name: '浼佷笟鍚嶇О',
+  },
+  {
+    id: '2',
+    enCode: 'societyCreditCode',
+    name: '缁熶竴绀句細淇$敤浠g爜',
+  },
+  {
+    id: '3',
+    enCode: 'enterpriseType',
+    name: '浼佷笟绫诲瀷',
+  },
+  {
+    id: '4',
+    enCode: 'parkName',
+    name: '鎵�灞炲洯鍖�',
+  },
+  {
+    id: '5',
+    enCode: 'parkType',
+    name: '鍥尯绫诲瀷',
+  },
+  {
+    id: '6',
+    enCode: 'creationTime',
+    name: '鐢宠鏃堕棿',
+  },
+  {
+    id: '7',
+    enCode: 'amount',
+    name: '鐢宠鎻愮幇閲戦锛堝厓锛�',
+  },
+  {
+    id: '8',
+    enCode: 'checkStatus',
+    name: '瀹℃牳鐘舵��',
+  },
+  {
+    id: '9',
+    enCode: 'checkTime',
+    name: '瀹℃牳鏃堕棿',
+  },
+];
+
+const operationBtns = defineOperationBtns([
+  {
+    data: {
+      enCode: 'detailBtn',
+      name: '璇︽儏',
+    },
+    emits: {
+      onClick: (role) => openDialog(role, true),
+    },
+    extraProps: {
+      hide: (row: API.GetEnterpriseDrawWithListOutput) =>
+        row.checkStatus === EnterpriseRechargeStatusEnum.WaitCheck,
+    },
+  },
+  {
+    data: {
+      enCode: 'auditBtn',
+      name: '瀹℃牳',
+    },
+    emits: {
+      onClick: (role) => openDialog(role),
+    },
+    extraProps: {
+      hide: (row: API.GetEnterpriseDrawWithListOutput) =>
+        row.checkStatus !== EnterpriseRechargeStatusEnum.WaitCheck,
+    },
+  },
+]);
+
+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.GetEnterpriseDrawWithListInput = {
+        pageModel: {
+          rows: pageSize,
+          page: pageIndex,
+          orderInput: extraParamState.orderInput,
+        },
+        keyWord: extraParamState.keyWord,
+        checkStatus: extraParamState.checkStatus,
+        beginDateTime: format(extraParamState.dateTime?.[0] ?? '', 'YYYY-MM-DD 00:00:00'),
+        endDateTime: format(extraParamState.dateTime?.[1] ?? '', 'YYYY-MM-DD 23:59:59'),
+      };
+      let res = await parkBountyApplyServices.getEnterpriseDrawWithList(params, {
+        showLoading: !state.loading,
+      });
+      return res;
+    } catch (error) {}
+  },
+  {
+    defaultExtraParams: {
+      keyWord: '',
+      checkStatus: '' as any as EnterpriseRechargeStatusEnum,
+      dateTime: [] as unknown as ModelValueType,
+      orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
+    },
+    columnsRenderProps: {
+      creationTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
+      checkTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
+      amount: { type: 'money' },
+      checkStatus: { type: 'enum', valueEnum: EnterpriseRechargeStatusEnumText },
+    },
+  }
+);
+
+function openDialog(row: API.GetEnterpriseDrawWithListOutput, isCheck = false) {
+  handleAdd({
+    drawWithId: row.drawWithId,
+    isCheck,
+  });
+}
+
+const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({
+  onConfirm: handleAddOrEdit,
+  defaultFormParams: {
+    drawWithId: '',
+    checkStatus: '' as any as EnterpriseRechargeStatusEnum,
+    checkRemark: '',
+    isCheck: false,
+    checkFileUrl: [] as UploadUserFile[],
+  },
+});
+
+async function handleAddOrEdit() {
+  try {
+    let params: API.CheckEnterpriseApplyDrawWithInput = {
+      applyDrawWithId: editForm.drawWithId,
+      checkStatus: editForm.checkStatus,
+      checkFileUrl: editForm.checkFileUrl?.length > 0 ? editForm.checkFileUrl[0].path : '',
+      checkRemark: editForm.checkRemark,
+    };
+    let res = await parkBountyApplyServices.checkEnterpriseApplyDrawWith(params);
+    if (res) {
+      Message.successMessage('鎿嶄綔鎴愬姛');
+      getList(paginationState.pageIndex);
+    }
+  } catch (error) {}
+}
+</script>
+
+<style lang="scss" scoped>
+@use '@/style/common.scss' as *;
+</style>

--
Gitblit v1.9.1