wupengfei
3 天以前 07e6a938f7993abf056dc4b106d4ad4fc6354bb5
src/views/Reward/RewardGrantRegister.vue
@@ -11,6 +11,7 @@
              :reset="reset"
              :operationBtns="registerOperationBtns"
              :column="rewardGrantRegisterColumns"
              :showFinanceStatus="true"
            >
              <template #btn>
                <el-button type="primary" link @click="downloadTemp()">下载模板</el-button>
@@ -34,7 +35,6 @@
          </ChunkCellV2>
        </DetailView>
        <template #footer>
          <el-button @click="handleBack">取消</el-button>
          <el-button @click="handleBack" type="primary">确认</el-button>
        </template>
      </PageFormLayout>
@@ -61,7 +61,6 @@
import { useQuery } from '@tanstack/vue-query';
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import { useRouteView } from '@/hooks';
import { useIndustrialParkDropDownList } from '@/hooks/industrialPark';
import {
  CustomerApplyFileTypeListItem,
  EnterpriseApplyFileUtils,
@@ -79,7 +78,7 @@
import RegisterGrantDialog from './components/RegisterGrantDialog.vue';
import BatchRegisterDialog from './components/BatchRegisterDialog.vue';
import UploadFileDialog from './components/UploadFileDialog.vue';
import { downloadFileByUrl } from '@/utils';
import { convertFormUrl2ApiBySeparator, downloadFileByUrl } from '@/utils';
import { Message } from '@bole-core/core';
import { ImportParkBountyDataHeaderMap } from './constants';
@@ -96,9 +95,12 @@
  parkTypeName: '',
  applyMonth: '',
  applySumAmount: 0,
  financeSumAmount: 0,
  settleSumAmount: 0,
  parkCollectFileList: [] as CustomerApplyFileTypeListItem[],
  calculationFileList: [] as CustomerApplyFileTypeListItem[],
  suportEnterpriseUpload: false,
  suportPlatRecharge: false,
});
const { extraParamState, paginationState, getList, reset, proTableProps } =
@@ -115,6 +117,13 @@
    },
    emits: {
      onClick: (row) => openRegisterGrantDialog(row),
    },
    extraProps: {
      hide: (row: API.ParkBountyApplyTransferDetailInfo) =>
        !(
          row.settleStatus === SettleStatusEnum.WaitForSettle ||
          row.financeStatus === FinanceStatusEnum.WaitForIncome
        ),
    },
  },
  {
@@ -145,26 +154,27 @@
    form.parkTypeName = data.parkTypeName;
    form.applyMonth = data.applyMonth;
    form.applySumAmount = data.applySumAmount;
    form.financeSumAmount = data.financeSumAmount;
    form.settleSumAmount = data.settleSumAmount;
    form.parkCollectFileList = EnterpriseApplyFileUtils.convertApiFileToParkCollectFileList(
      data.listFiles
    );
    form.calculationFileList = EnterpriseApplyFileUtils.convertApiFileToParkCollectFileList(
      data.collectCountListFiles
    );
    form.suportEnterpriseUpload = data.suportEnterpriseUpload;
    form.suportPlatRecharge = data.suportPlatRecharge;
    getList();
  },
});
const { getIndustrialParkTypeNameById } = useIndustrialParkDropDownList();
const { dialogProps: dialogMaterialFileProps, handleAdd: handleMaterialFileAdd } = useFormDialog({
  defaultFormParams: {
    list: [] as TransferFileEnumInRewardGrandTableItem[],
  },
});
function openMaterialFileDialog(row: API.GetParkBountyApplyListOutput) {
function openMaterialFileDialog(row: API.ParkBountyApplyTransferDetailInfo) {
  handleMaterialFileAdd({
    list: FourStreamsMaterialUtils.initApplyRewardGrandFileList(row),
  });
@@ -179,42 +189,88 @@
  defaultFormParams: {
    incomeType: '' as any as IncomeTypeEnum,
    parkBountyApplyId: '',
    parkBountyApplyDetailId: '',
    fileUrl: [] as UploadUserFile[],
    financeSumAmount: 0,
    amount: 0,
    showSuportPlatRecharge: false,
    showSuportFiscalRecharge: false,
  },
});
function openRegisterGrantDialog(row?: API.GetParkBountyApplyListOutput) {
function openRegisterGrantDialog(row?: API.ParkBountyApplyTransferDetailInfo) {
  handleRegisterGrantEdit({
    incomeType: '' as any as IncomeTypeEnum,
    fileUrl: [] as UploadUserFile[],
    showSuportPlatRecharge: row.settleStatus === SettleStatusEnum.WaitForSettle,
    showSuportFiscalRecharge: row.financeStatus === FinanceStatusEnum.WaitForIncome,
    parkBountyApplyId: row.id,
    financeSumAmount: 0,
    parkBountyApplyId: row.parkBountyApplyId,
    parkBountyApplyDetailId: row.parkBountyApplyDetailId,
    amount: 0,
  });
}
async function handleRegisterGrant() {}
async function handleRegisterGrant() {
  if (editRegisterForm.incomeType === IncomeTypeEnum.Fiscal) {
    await parkBountyApplyFinanceReg();
  } else {
    await parkBountyApplyTransferReg();
  }
}
const { dialogProps: dialogUploadFileProps, handleAdd: handleUploadFileAdd } = useFormDialog({
async function parkBountyApplyFinanceReg() {
  try {
    let params: API.ParkBountyApplyRechargeInput = {
      parkBountyApplyDetailId: editRegisterForm.parkBountyApplyDetailId,
      bountyAmount: editRegisterForm.amount,
      parkBountyApplyId: editRegisterForm.parkBountyApplyId,
      financeToFileUrl: convertFormUrl2ApiBySeparator(editRegisterForm.fileUrl),
    };
    let res = await parkBountyApplyServices.parkBountyApplyFinanceReg(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
async function parkBountyApplyTransferReg() {
  try {
    let params: API.ParkBountyApplyTransferInput = {
      parkBountyApplyDetailId: editRegisterForm.parkBountyApplyDetailId,
      transferToAmount: editRegisterForm.amount,
      parkBountyApplyId: editRegisterForm.parkBountyApplyId,
      transferToFileUrl: convertFormUrl2ApiBySeparator(editRegisterForm.fileUrl),
    };
    let res = await parkBountyApplyServices.parkBountyApplyTransferReg(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
const {
  dialogProps: dialogUploadFileProps,
  handleAdd: handleUploadFileAdd,
  editForm: uploadFileForm,
} = useFormDialog({
  onConfirm: handleImportParkBountyData,
  defaultFormParams: {
    parkBountyApplyId: '',
    url: [] as UploadUserFile[],
    certificateUrl: [] as UploadUserFile[],
    financeToFileUrl: [] as UploadUserFile[],
    transferToFileUrl: [] as UploadUserFile[],
  },
});
async function handleImportParkBountyData(response: UploadUserFile) {
  try {
    let params: API.ImportBountyApplyDataInput = {
      parkBountyApplyId: id,
      parkBountyApplyId: uploadFileForm.parkBountyApplyId,
      url: response.url,
      financeToFileUrl: convertFormUrl2ApiBySeparator(uploadFileForm.financeToFileUrl),
      transferToFileUrl: convertFormUrl2ApiBySeparator(uploadFileForm.transferToFileUrl),
    };
    let res = await parkBountyApplyServices.importParkBountyData(params, {
    let res = await parkBountyApplyServices.importParkBountyDataReg(params, {
      timeout: 100000000,
    });
    if (res.error.length > 0) {
@@ -233,7 +289,8 @@
  handleUploadFileAdd({
    parkBountyApplyId: id,
    url: [] as UploadUserFile[],
    certificateUrl: [] as UploadUserFile[],
    financeToFileUrl: [] as UploadUserFile[],
    transferToFileUrl: [] as UploadUserFile[],
  });
}
@@ -241,7 +298,7 @@
  try {
    handleBatchRegisterAdd({
      parkBountyApplyId: id,
      showSuportPlatRecharge: false,
      showSuportPlatRecharge: form.suportPlatRecharge,
    });
  } catch (error) {}
}
@@ -260,11 +317,49 @@
    parkBountyApplyId: '',
    showSuportPlatRecharge: false,
    certificateUrl: [] as UploadUserFile[],
    fileUrl: [] as UploadUserFile[],
  },
});
async function handleBatchRegister() {}
async function handleBatchRegister() {
  if (batchRegisterEditForm.incomeType === IncomeTypeEnum.Fiscal) {
    await parkBountyApplyBatchFinanceReg();
  } else {
    await parkBountyApplyBatchTransferReg();
  }
}
async function parkBountyApplyBatchFinanceReg() {
  try {
    let params: API.ParkBountyApplyBatchFinanceInput = {
      parkBountyApplyDetailId: batchRegisterEditForm.parkBountyApplyDetailIds,
      financeToAmount: batchRegisterEditForm.amount,
      parkBountyApplyId: id,
      financeToFileUrl: convertFormUrl2ApiBySeparator(batchRegisterEditForm.fileUrl),
    };
    let res = await parkBountyApplyServices.parkBountyApplyBatchFinanceReg(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
async function parkBountyApplyBatchTransferReg() {
  try {
    let params: API.ParkBountyApplyBatchTransferInput = {
      parkBountyApplyDetailId: batchRegisterEditForm.parkBountyApplyDetailIds,
      transferToAmount: batchRegisterEditForm.amount,
      parkBountyApplyId: id,
      transferToFileUrl: convertFormUrl2ApiBySeparator(batchRegisterEditForm.fileUrl),
    };
    let res = await parkBountyApplyServices.parkBountyApplyBatchTransferReg(params);
    if (res) {
      Message.successMessage('操作成功');
      getList(paginationState.pageIndex);
    }
  } catch (error) {}
}
function downloadTemp() {
  downloadFileByUrl(BountyBatchApplyTransferTemp, '登记模板');