zhengyiming
6 天以前 85f7bdb64b1f8b0fdaf58355a4f3fc389ec26ad0
feat: 新增审核撤回日志
4个文件已修改
2个文件已添加
326 ■■■■■ 已修改文件
src/constants/enum.ts 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/index.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/log.ts 145 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/hooks/useOpenLogHooks.ts 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/MaterialReview/MaterialReReviewList.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/MaterialReview/MaterialReview.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/constants/enum.ts
@@ -98,3 +98,98 @@
  [ExternalSystem.JYB]: '江佑共保运营端',
  [ExternalSystem.flexjob]: '灵工系统运营端',
};
export enum OperateHistoryTypeEnum {
  /**
   * 认证用户日志
   */
  CertifiedUser = 10,
  /**
   * 平台用户日志
   */
  PlatformUser = 11,
  /**
   * 用户认证审核日志
   */
  UserCertificationAudit = 12,
  /**
   * 公告日志
   */
  SystemNotice = 13,
  /**
   * 资讯管理日志
   */
  InformationForManage = 14,
  /**
   * 资讯审核日志
   */
  InformationWaitForCheck = 15,
  /**
   * 开户管理日志
   */
  WalletAccountOpen = 16,
  /**
   * 转账审核对单日志
   */
  alletSingleTransfer = 17,
  /**
   * 充值审核
   */
  WalletRecharge = 18,
  /**
   * 账户管理
   */
  AccountManage = 19,
  /**
   * 认证管理
   */
  UserCertificationManage = 20,
  /**
   * 批量转账审核日志
   */
  AuditWalletBatchTransfer = 21,
  /**
   * 行业机构审核日志
   */
  IndustryBodyAudit = 22,
  /**
   * 行业配套审核日志
   */
  IndustryMatingAudit = 23,
  /**
   * 甲方企业审核日志
   */
  FirstPartyCompanyAudit = 24,
  /**
   * 人资公司审核日志
   */
  ParkOrHRAudit = 25,
  /**
   * 行业机构管理日志
   */
  IndustryBodyManage = 26,
  /**
   * 行业配套管理日志
   */
  IndustryMatingManage = 27,
  /**
   * 甲方企业管理日志
   */
  FirstPartyCompanyManage = 28,
  /**
   * 人资公司管理日志
   */
  ParkOrHRManage = 29,
  /**
   * 客户管理日志
   */
  CustomerManage = 30,
  /**
   * 奖励配置日志
   */
  ParkRewardManage = 31,
  /**
   * 客户模板操作日志
   */
  CustomerContractTemplate = 32,
}
src/hooks/index.ts
@@ -11,3 +11,5 @@
export * from './table';
export * from './fourStreams';
export * from './industrialPark';
export * from './log';
export * from './useOpenLogHooks';
src/hooks/log.ts
New file
@@ -0,0 +1,145 @@
import * as operateHistoryServices from '@/services/api/OperateHistory';
import { OrderInputType } from '@bole-core/core';
import { useTable } from '@bole-core/components';
import { MaybeRef } from 'vue';
import { OperateHistoryTypeEnum } from '@/constants';
export enum OperateType {
  /**
   * 审核
   */
  Audit = 1,
  /**
   * 入账
   */
  Account = 2,
  /**
   * 上传发票
   */
  Invoice = 3,
}
export const OperateTypeText = {
  [OperateType.Audit]: '审核',
  [OperateType.Account]: '入账',
  [OperateType.Invoice]: '上传发票',
};
export type UseTableLogListOptions = {
  relationId: MaybeRef<string>;
  operateType?: MaybeRef<number>;
};
export function useTableLogList({ relationId, operateType }: UseTableLogListOptions) {
  const BaseState = {
    loading: true,
  };
  const state = reactive({ ...BaseState });
  const { getDataSource: getList, proTableProps } = useTable(
    async ({ pageIndex, pageSize }) => {
      try {
        let params: API.GetOperateHistoryInput = {
          pageModel: {
            rows: pageSize,
            page: pageIndex,
            orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
          },
          relationId: unref(relationId),
        };
        const _operateType = unref(operateType);
        if (_operateType) {
          params.operateName = OperateTypeText[_operateType];
        }
        let res = await operateHistoryServices.getOperateHistoryByRelationId(params, {
          showLoading: !state.loading,
        });
        return res;
      } catch (error) {}
    },
    {
      queryKey: ['operateHistoryServices/getOperateHistoryByRelationId'],
      columnsRenderProps: {
        creationTime: {
          type: 'date',
          format: 'YYYY-MM-DD HH:mm:ss',
        },
      },
    }
  );
  const OperateHistoryTableColumns: API.CustomModuleColumnDto[] = [
    { id: '1', enCode: 'creatorName', name: '操作人' },
    { id: '2', enCode: 'creationTime', name: '操作时间', width: 180 },
    { id: '3', enCode: 'operateName', name: '操作' },
    { id: '4', enCode: 'operateContent', name: '操作内容' },
  ];
  return {
    state,
    getList,
    proTableProps,
    OperateHistoryTableColumns,
  };
}
export type UseTableLogListByTypeOptions = {
  relationId: MaybeRef<string>;
  operateHistoryType?: MaybeRef<OperateHistoryTypeEnum>;
};
export function useTableLogListByType({
  relationId,
  operateHistoryType,
}: UseTableLogListByTypeOptions) {
  const BaseState = {
    loading: true,
  };
  const state = reactive({ ...BaseState });
  const { getDataSource: getList, proTableProps } = useTable(
    async ({ pageIndex, pageSize }) => {
      try {
        let params: API.QueryOperateHistoryByTypeInput = {
          pageModel: {
            rows: pageSize,
            page: pageIndex,
            orderInput: [{ property: 'creationTime', order: OrderInputType.Desc }],
          },
          typeId: unref(relationId),
          operateHistoryType: unref(operateHistoryType),
        };
        let res = await operateHistoryServices.getOperateHistoryByType(params, {
          showLoading: !state.loading,
        });
        return res;
      } catch (error) {}
    },
    {
      queryKey: ['operateHistoryServices/getOperateHistoryByRelationId'],
      columnsRenderProps: {
        creationTime: {
          type: 'date',
          format: 'YYYY-MM-DD HH:mm:ss',
        },
      },
    }
  );
  const OperateHistoryTableColumns: API.CustomModuleColumnDto[] = [
    { id: '1', enCode: 'creatorName', name: '操作人' },
    { id: '2', enCode: 'creationTime', name: '操作时间', width: 180 },
    { id: '3', enCode: 'operateName', name: '操作' },
    { id: '4', enCode: 'operateContent', name: '操作内容' },
  ];
  return {
    state,
    getList,
    proTableProps,
    OperateHistoryTableColumns,
  };
}
src/hooks/useOpenLogHooks.ts
New file
@@ -0,0 +1,62 @@
import { useDialog } from '@bole-core/components';
import { OperateHistoryTypeEnum } from '@/constants';
type UseAdvertisementListOptions = {
  operateType?: MaybeRef<number>;
};
export function useOpenLogDialog(options: UseAdvertisementListOptions = {}) {
  const { operateType } = options;
  const relationId = ref('');
  const { dialogProps, dialogState } = useDialog();
  async function openLogDialog(_relationId: string) {
    relationId.value = _relationId;
    await nextTick();
    dialogState.dialogVisible = true;
  }
  const logDialogProps = computed(() => {
    return {
      ...dialogProps.value,
      relationId: relationId.value,
      operateType: unref(operateType),
    };
  });
  return {
    logDialogProps,
    openLogDialog,
  };
}
type UseOpenLogByTypeDialogOptions = {
  operateHistoryType?: MaybeRef<OperateHistoryTypeEnum>;
};
export function useOpenLogByTypeDialog(options: UseOpenLogByTypeDialogOptions = {}) {
  const { operateHistoryType } = options;
  const relationId = ref('');
  const { dialogProps, dialogState } = useDialog();
  async function openLogDialog(_relationId: string) {
    relationId.value = _relationId;
    await nextTick();
    dialogState.dialogVisible = true;
  }
  const logDialogProps = computed(() => {
    return {
      ...dialogProps.value,
      relationId: relationId.value,
      operateHistoryType: unref(operateHistoryType),
    };
  });
  return {
    logDialogProps,
    openLogDialog,
  };
}
src/views/MaterialReview/MaterialReReviewList.vue
@@ -61,6 +61,7 @@
      </ProTableV2>
      <ParkBountyApplyRedoDialog v-bind="dialogProps" />
    </AppContainer>
    <OperateHistoryLogDialog v-bind="logDialogProps" />
  </LoadingLayout>
</template>
@@ -85,7 +86,12 @@
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import _ from 'lodash';
import { ModelValueType } from 'element-plus';
import { useAccess, useGlobalEventContext, useIndustrialParkDropDownList } from '@/hooks';
import {
  useAccess,
  useGlobalEventContext,
  useIndustrialParkDropDownList,
  useOpenLogDialog,
} from '@/hooks';
import ParkBountyApplyRedoDialog from './components/ParkBountyApplyRedoDialog.vue';
defineOptions({
@@ -116,6 +122,7 @@
        row.outReCheckStatus !== BountyCheckStatusEnum.CheckPassed,
    },
  },
  logBtn: { emits: { onClick: (role) => openLogDialog(role.id) } },
};
const { checkSubModuleItemShow, column, operationBtns } = useAccess({
@@ -243,4 +250,6 @@
    }
  } catch (error) {}
}
const { openLogDialog, logDialogProps } = useOpenLogDialog();
</script>
src/views/MaterialReview/MaterialReview.vue
@@ -61,6 +61,7 @@
      </ProTableV2>
      <ParkBountyApplyRedoDialog v-bind="dialogProps" />
    </AppContainer>
    <OperateHistoryLogDialog v-bind="logDialogProps" />
  </LoadingLayout>
</template>
@@ -85,7 +86,12 @@
import * as parkBountyApplyServices from '@/services/api/ParkBountyApply';
import _ from 'lodash';
import { ModelValueType } from 'element-plus';
import { useAccess, useGlobalEventContext, useIndustrialParkDropDownList } from '@/hooks';
import {
  useAccess,
  useGlobalEventContext,
  useIndustrialParkDropDownList,
  useOpenLogDialog,
} from '@/hooks';
import ParkBountyApplyRedoDialog from './components/ParkBountyApplyRedoDialog.vue';
defineOptions({
@@ -116,6 +122,7 @@
        row.outCheckStatus !== BountyCheckStatusEnum.CheckPassed,
    },
  },
  logBtn: { emits: { onClick: (role) => openLogDialog(role.id) } },
};
const { checkSubModuleItemShow, column, operationBtns } = useAccess({
@@ -234,6 +241,8 @@
    }
  } catch (error) {}
}
const { openLogDialog, logDialogProps } = useOpenLogDialog();
</script>
<style lang="scss" scoped>