wupengfei
2025-04-21 524b1febe13e9305e9a27c870e09819e0e363bbd
src/views/Reward/RewardGrant.vue
@@ -48,7 +48,17 @@
      <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
      </ProTableV2>
      <RewardGrantDialog v-bind="dialogProps"></RewardGrantDialog>
      <FourStreamsMaterialFileDialog
        v-bind="dialogMaterialFileProps"
        :show-upload-btn="false"
        :show-delete-btn="false"
        :show-check-btn="false"
        downloadBtnText="查看"
        title="查看凭证"
        :BusinessTypeEnumText="ApplyTransferFileBusinessTypeEnumText"
      />
      <FinancialDialog v-bind="dialogFinancialProps"></FinancialDialog>
      <PlateformDialog v-bind="dialogPlateformProps"></PlateformDialog>
    </AppContainer>
  </LoadingLayout>
</template>
@@ -67,15 +77,21 @@
  FieldDatePicker,
  useFormDialog,
  UploadUserFile,
  bolePreview,
} from '@bole-core/components';
import { OrderInputType } from '@bole-core/core';
import { convertApi2FormUrlOnlyOne, format } from '@/utils';
import { Message, OrderInputType } from '@bole-core/core';
import { format } from '@/utils';
import { SettleStatusEnum, SettleStatusEnumText } from '@/constants';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import RewardGrantDialog from './components/RewardGrantDialog.vue';
import FinancialDialog from './components/FinancialDialog.vue';
import PlateformDialog from './components/PlateformDialog.vue';
import _ from 'lodash';
import { ModelValueType } from 'element-plus';
import { useQueryClient } from '@tanstack/vue-query';
import { FourStreamsMaterialUtils } from '@/components/commonView/utils';
import {
  ApplyTransferMaterialFileTableItem,
  ApplyTransferFileBusinessTypeEnumText,
} from '@/components/commonView/types';
defineOptions({
  name: 'RewardGrant',
@@ -100,12 +116,12 @@
  {
    id: '4',
    enCode: 'applyMonth',
    name: '申请奖励金月份',
    name: '申请平台奖励月份',
  },
  {
    id: '5',
    enCode: 'applySumAmount',
    name: '奖励金汇总金额(元)',
    name: '平台奖励汇总金额(元)',
  },
  {
    id: '6',
@@ -115,12 +131,22 @@
  {
    id: '7',
    enCode: 'settleStatus',
    name: '发放状态',
    name: '财政拨付状态',
  },
  {
    id: '8',
    enCode: 'settleTime',
    name: '发放日期',
    name: '拨付日期',
  },
  {
    id: '9',
    enCode: 'settleStatus',
    name: '平台充值状态',
  },
  {
    id: '10',
    enCode: 'settleTime',
    name: '充值日期',
  },
];
@@ -136,20 +162,41 @@
  },
  {
    data: {
      enCode: 'grantBtn',
      name: '发放',
      enCode: 'financialBtn',
      name: '财政拨付',
    },
    emits: {
      onClick: (role) => openDialog(role),
      onClick: (role) => openFinancialDialog(role),
    },
    extraProps: {
      hide: (row: API.GetParkBountyApplyListOutput) =>
        row.settleStatus === SettleStatusEnum.HasSettle,
    },
  },
  {
    data: {
      enCode: 'previewBtn',
      enCode: 'plateformBtn',
      name: '平台充值',
    },
    emits: {
      onClick: (role) => openPlateformDialog(role),
    },
    extraProps: {
      hide: (row: API.GetParkBountyApplyListOutput) =>
        row.settleStatus === SettleStatusEnum.HasSettle,
    },
  },
  {
    data: {
      enCode: 'checkBtn',
      name: '查看凭证',
    },
    emits: {
      onClick: (role) => handlePreview(role),
      onClick: (row) => openMaterialFileDialog(row),
    },
    extraProps: {
      hide: (row: API.GetParkBountyApplyListOutput) =>
        row.settleStatus === SettleStatusEnum.WaitForSettle,
    },
  },
]);
@@ -203,6 +250,7 @@
      orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
    },
    columnsRenderProps: {
      applyMonth: { type: 'date', format: 'YYYY年MM月' },
      creationTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
      settleTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
      applySumAmount: { type: 'money' },
@@ -220,36 +268,78 @@
  });
}
const { dialogProps, handleAdd, handleEdit, editForm } = useFormDialog({
  onConfirm: handleAddOrEdit,
function openMaterialFileDialog(row: API.ParkBountyApplyTransferDetailInfo) {
  handleMaterialFileAdd({
    list: FourStreamsMaterialUtils.initApplyTransferMaterialFileList(row),
  });
}
const { dialogProps: dialogMaterialFileProps, handleAdd: handleMaterialFileAdd } = useFormDialog({
  defaultFormParams: {
    list: [] as ApplyTransferMaterialFileTableItem[],
  },
});
const queryClient = useQueryClient();
const {
  dialogProps: dialogFinancialProps,
  handleEdit: handleFinancialEdit,
  editForm: editFinancialForm,
} = useFormDialog({
  onConfirm: handleFinancial,
  defaultFormParams: {
    parkBountyApplyId: '',
    amount: 0,
    settleFileUrl: [] as UploadUserFile[],
  },
});
function openDialog(row?: API.GetParkBountyApplyListOutput) {
  handleEdit({
function openFinancialDialog(row?: API.GetParkBountyApplyListOutput) {
  handleFinancialEdit({
    parkBountyApplyId: row.id,
    amount: 0,
    settleFileUrl: [] as UploadUserFile[],
  });
}
async function handleFinancial() {
  try {
    let params: API.ParkBountyApplySettleInput = {
      parkBountyApplyId: editFinancialForm.parkBountyApplyId,
      settleFileUrl: editFinancialForm.settleFileUrl.map((x) => x.path).join('|'),
    };
    let res = await parkBountyApplyServices.parkBountyApplySettle(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
      queryClient.invalidateQueries({
        queryKey: ['parkBountyApplyServices/getGoverDataBoard'],
      });
    }
  } catch (error) {}
}
const {
  dialogProps: dialogPlateformProps,
  handleEdit: handlePlateformEdit,
  editForm: editPlateformForm,
} = useFormDialog({
  onConfirm: handlePlateform,
  defaultFormParams: {
    parkBountyApplyId: '',
    amount: 0,
    settleFileUrl: [] as UploadUserFile[],
  },
});
function openPlateformDialog(row?: API.GetParkBountyApplyListOutput) {
  handlePlateformEdit({
    parkBountyApplyId: row.id,
    amount: 0,
    settleFileUrl: [] as UploadUserFile[],
  });
}
async function handleAddOrEdit() {
  try {
    let params: API.ParkBountyApplySettleInput = {
      parkBountyApplyId: editForm.parkBountyApplyId,
      settleFileUrl: editForm.settleFileUrl[0].path,
    };
    let res = await parkBountyApplyServices.parkBountyApplySettle(params);
  } catch (error) {}
}
function handlePreview(row?: API.GetParkBountyApplyListOutput) {
  bolePreview({
    fileUrl: row.parkName,
  });
}
async function handlePlateform() {}
</script>
<style lang="scss" scoped>