zhengyiming
5 天以前 368c72d678ec6a1f5b60f109911d190e9c2a2809
src/views/EnterpriseInfo/components/RewardConsumeRecordView.vue
@@ -2,16 +2,38 @@
  <LoadingLayout :loading="state.loading">
    <AppContainer>
      <ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
        <template #operationBtn-checkBtn="{ data, row }">
          <!-- <PreviewBtnV2
            class="pro-table-operation-btn"
            :url="convertApi2FormUrlBySeparator(row.payFileUrl ?? '')"
            preview-btn-text="查看凭证"
          /> -->
        </template>
      </ProTableV2>
      <ParkBountyTradeDetailFileDialog v-bind="dialogProps" />
    </AppContainer>
  </LoadingLayout>
</template>
<script setup lang="ts">
import { AppContainer, useTable, ProTableV2, defineOperationBtns } from '@bole-core/components';
import {
  AppContainer,
  useTable,
  ProTableV2,
  defineOperationBtns,
  PreviewBtnV2,
  useFormDialog,
  UploadUserFile,
} from '@bole-core/components';
import {
  convertApi2FormUrlBySeparator,
  convertApi2FormUrlObjectBySeparator,
  convertApi2FormUrlOnlyOne,
} from '@/utils';
import { OrderInputType } from '@bole-core/core';
import * as parkRewardServices from '@/services/api/ParkReward';
import { EnterpriseBountyPayTypeEnumText } from '@/constants';
import ParkBountyTradeDetailFileDialog from '../../Reward/components/ParkBountyTradeDetailFileDialog.vue';
defineOptions({
  name: 'RewardConsumeRecordView',
@@ -25,7 +47,7 @@
  },
  {
    id: '2',
    enCode: 'payType',
    enCode: 'payRemark',
    name: '消费类型',
  },
  {
@@ -36,19 +58,17 @@
  {
    id: '4',
    enCode: 'remianAmount',
    name: '奖励金余额',
    name: '资金余额',
  },
];
const operationBtns = defineOperationBtns([
  {
    data: {
      enCode: 'previewBtn',
      enCode: 'checkBtn',
      name: '查看凭证',
    },
    emits: {
      onClick: (role) => handlePreview(role),
    },
    emits: { onClick: (role) => openDialog(role) },
  },
]);
@@ -86,23 +106,40 @@
  },
  {
    defaultExtraParams: {
      orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
      orderInput: [{ property: 'id', order: OrderInputType.Desc }],
    },
    columnsRenderProps: {
      payDateTime: { type: 'date', format: 'YYYY-MM-DD HH:mm:ss' },
      amount: { type: 'money' },
      remianAmount: { type: 'money' },
      payType: { type: 'enum', valueEnum: EnterpriseBountyPayTypeEnumText },
    },
  }
);
function handlePreview(row: API.InsureBatchBillDto) {}
onMounted(async () => {
  await getList();
  state.loading = false;
});
function openDialog(row: API.GetParkCustomerBountyConsumptionOutput) {
  handleAdd({
    payAuditFileUrl: convertApi2FormUrlObjectBySeparator(row.payAuditFileUrl),
    financeAuditFileUrl: convertApi2FormUrlObjectBySeparator(row.financeAuditFileUrl),
    selfAuditFileUrl: convertApi2FormUrlObjectBySeparator(row.selfAuditFileUrl),
    payFileUrl: convertApi2FormUrlObjectBySeparator(row.payFileUrl),
    insureBillUrl: convertApi2FormUrlObjectBySeparator(row.insureBillUrl),
  });
}
const { dialogProps, handleAdd } = useFormDialog({
  defaultFormParams: {
    payAuditFileUrl: [] as UploadUserFile[],
    financeAuditFileUrl: [] as UploadUserFile[],
    selfAuditFileUrl: [] as UploadUserFile[],
    payFileUrl: [] as UploadUserFile[],
    insureBillUrl: [] as UploadUserFile[],
  },
});
</script>
<style lang="scss" scoped>