<template>
|
<LoadingLayout :loading="state.loading">
|
<AppContainer>
|
<ProTableQueryFilterBar @on-reset="reset">
|
<template #query>
|
<QueryFilterItem tip-content="实名状态">
|
<FieldRadio
|
v-model="extraParamState.realVerifyStatus"
|
:value-enum="[
|
{
|
value: false,
|
label: '未实名',
|
},
|
{
|
value: true,
|
label: '已实名',
|
},
|
]"
|
buttonStyle
|
showAllBtn
|
@change="getList()"
|
/>
|
</QueryFilterItem>
|
<QueryFilterItem tip-content="最近录用时间">
|
<FieldDatePicker
|
v-model="extraParamState.nearlyHireDateTime"
|
type="daterange"
|
range-separator="~"
|
start-placeholder="开始时间"
|
end-placeholder="结束时间"
|
clearable
|
@change="getList()"
|
></FieldDatePicker>
|
</QueryFilterItem>
|
<QueryFilterItem tip-content="最近签约时间">
|
<FieldDatePicker
|
v-model="extraParamState.nearlySignDateTime"
|
type="daterange"
|
range-separator="~"
|
start-placeholder="开始时间"
|
end-placeholder="结束时间"
|
clearable
|
@change="getList()"
|
></FieldDatePicker>
|
</QueryFilterItem>
|
<QueryFilterItem>
|
<SearchInput
|
v-model="extraParamState.searchKeys"
|
style="width: 300px"
|
placeholder="姓名/手机/身份证号/客户"
|
@on-click-search="getList"
|
@keyup.enter="getList()"
|
>
|
</SearchInput>
|
</QueryFilterItem>
|
</template>
|
</ProTableQueryFilterBar>
|
<ProTableV2 v-bind="proTableProps" :columns="column" :operationBtns="operationBtns">
|
</ProTableV2>
|
</AppContainer>
|
<CPersonDetailDialog v-bind="dialogProps"></CPersonDetailDialog>
|
</LoadingLayout>
|
</template>
|
|
<script setup lang="ts">
|
import {
|
ProTableQueryFilterBar,
|
OperationBtnType,
|
ProTableV2,
|
SearchInput,
|
LoadingLayout,
|
AppContainer,
|
QueryFilterItem,
|
useTable,
|
useFormDialog,
|
FieldRadio,
|
FieldDatePicker,
|
UploadUserFile,
|
} from '@bole-core/components';
|
import { useAccess, useGlobalEventContext } from '@/hooks';
|
import * as flexEnterpriseWokerServices from '@/services/api/FlexEnterpriseWoker';
|
import { Gender } from '@/constants';
|
import CPersonDetailDialog from './components/CPersonDetailDialog.vue';
|
import { OrderInputType } from '@bole-core/core';
|
import { convertApi2FormUrlOnlyOne, format } from '@/utils';
|
import { ModelValueType } from 'element-plus';
|
|
defineOptions({
|
name: 'CPersonManageList',
|
});
|
|
const operationBtnMap: Record<string, OperationBtnType> = {
|
detailBtn: { emits: { onClick: (role) => openDialog(role) } },
|
};
|
|
const { checkSubModuleItemShow, column, operationBtns } = useAccess({
|
operationBtnMap,
|
});
|
|
const eventContext = useGlobalEventContext();
|
|
eventContext.addEvent('enterprise:add', () => {
|
getList();
|
});
|
|
eventContext.addEvent('enterprise:edit', () => {
|
getList(paginationState.pageIndex);
|
});
|
|
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.GetUserClientForBackInput = {
|
pageModel: {
|
rows: pageSize,
|
page: pageIndex,
|
orderInput: extraParamState.orderInput,
|
},
|
searchKeys: extraParamState.searchKeys,
|
nearlyHireDateTimeBegin: format(
|
extraParamState.nearlyHireDateTime?.[0] ?? '',
|
'YYYY-MM-DD 00:00:00'
|
),
|
nearlyHireDateTimeEnd: format(
|
extraParamState.nearlyHireDateTime?.[1] ?? '',
|
'YYYY-MM-DD 23:59:59'
|
),
|
nearlySignDateTimeBegin: format(
|
extraParamState.nearlySignDateTime?.[0] ?? '',
|
'YYYY-MM-DD 00:00:00'
|
),
|
nearlySignDateTimeEnd: format(
|
extraParamState.nearlySignDateTime?.[1] ?? '',
|
'YYYY-MM-DD 23:59:59'
|
),
|
realVerifyStatus: extraParamState.realVerifyStatus,
|
};
|
|
let res = await flexEnterpriseWokerServices.getUserClientList(params, {
|
showLoading: !state.loading,
|
});
|
return res;
|
} catch (error) {
|
console.log('error: ', error);
|
}
|
},
|
{
|
defaultExtraParams: {
|
searchKeys: '',
|
realVerifyStatus: '' as any as boolean,
|
nearlyHireDateTime: [] as unknown as ModelValueType,
|
nearlySignDateTime: [] as unknown as ModelValueType,
|
orderInput: [{ property: 'userId', order: OrderInputType.Desc }],
|
},
|
queryKey: ['flexEnterpriseWokerServices/getUserClientList'],
|
columnsRenderProps: {
|
realVerifyStatus: {
|
type: 'enum',
|
valueEnum: [
|
{ label: '已实名', value: true },
|
{ label: '未实名', value: false },
|
],
|
},
|
realVerifyTime: { type: 'date' },
|
},
|
}
|
);
|
|
async function openDialog(row?: API.GetUserClientForBackOutput) {
|
const res = await getUserDetailForBack('98ac4c01-3598-ebf3-fa7d-3a189bb6b587');
|
handleEdit({
|
userId: row.userId ?? '98ac4c01-3598-ebf3-fa7d-3a189bb6b587',
|
name: res.name,
|
idNumber: res.idNumber,
|
contactPhone: res.contactPhone,
|
age: res.age,
|
certificateFrontImgUrl: res.certificateFrontImgUrl
|
? convertApi2FormUrlOnlyOne(res.certificateFrontImgUrl)
|
: [],
|
certificateBackImgUrl: res.certificateBackImgUrl
|
? convertApi2FormUrlOnlyOne(res.certificateBackImgUrl)
|
: [],
|
|
genderType: Gender.Female,
|
tabType: 'user',
|
});
|
}
|
|
const { dialogProps, handleEdit } = useFormDialog({
|
defaultFormParams: {
|
userId: '',
|
name: '',
|
idNumber: '',
|
contactPhone: '',
|
age: 0,
|
genderType: '' as any as Gender,
|
certificateFrontImgUrl: [] as UploadUserFile[],
|
certificateBackImgUrl: [] as UploadUserFile[],
|
|
tabType: '',
|
},
|
});
|
|
async function getUserDetailForBack(userId: string) {
|
try {
|
return await flexEnterpriseWokerServices.getUserDetailForBack({ userId: userId });
|
} catch (error) {}
|
}
|
</script>
|