From e3e1a34d49ba62dc81166a16ed3d877b356d51a8 Mon Sep 17 00:00:00 2001
From: wupengfei <834520024@qq.com>
Date: 星期二, 21 十月 2025 14:59:17 +0800
Subject: [PATCH] fix: bug
---
src/views/FlexJobManage/FlexJobManage.vue | 483 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 381 insertions(+), 102 deletions(-)
diff --git a/src/views/FlexJobManage/FlexJobManage.vue b/src/views/FlexJobManage/FlexJobManage.vue
index 79429e4..42637ad 100644
--- a/src/views/FlexJobManage/FlexJobManage.vue
+++ b/src/views/FlexJobManage/FlexJobManage.vue
@@ -5,11 +5,8 @@
<template #query>
<QueryFilterItem tip-content="褰曠敤鐘舵��">
<FieldRadio
- v-model="extraParamState.flexEnterpriseSettingStatus"
- :value-enum="[
- { label: '宸插綍鐢�', value: 1 },
- { label: '鏈綍鐢�', value: 0 },
- ]"
+ v-model="extraParamState.hireStatus"
+ :value-enum="EnumTaskUserHireStatusText"
buttonStyle
showAllBtn
@change="getList()"
@@ -17,43 +14,38 @@
</QueryFilterItem>
<QueryFilterItem tip-content="瀹炲悕鐘舵��">
<FieldRadio
- v-model="extraParamState.flexEnterpriseSettingStatus"
+ v-model="extraParamState.isReal"
:value-enum="[
- { label: '宸插疄鍚�', value: 1 },
- { label: '鏈疄鍚�', value: 0 },
+ { label: '宸插疄鍚�', value: true },
+ { label: '鏈疄鍚�', value: false },
]"
buttonStyle
showAllBtn
+ :all-btn-value="null"
@change="getList()"
/>
</QueryFilterItem>
<QueryFilterItem tip-content="鐏靛伐绛剧害鐘舵��">
<FieldSelect
- v-model="extraParamState.flexEnterpriseSettingStatus"
- :value-enum="[
- { label: '宸插疄鍚�', value: 1 },
- { label: '鏈疄鍚�', value: 0 },
- ]"
- buttonStyle
- showAllBtn
+ v-model="extraParamState.userSignContractStatus"
+ :value-enum="EnumTaskUserSignContractStatusText"
+ placeholder="璇烽�夋嫨鐏靛伐绛剧害鐘舵��"
+ clearable
@change="getList()"
/>
</QueryFilterItem>
<QueryFilterItem tip-content="浼佷笟绛剧害鐘舵��">
<FieldSelect
- v-model="extraParamState.flexEnterpriseSettingStatus"
- :value-enum="[
- { label: '宸插疄鍚�', value: 1 },
- { label: '鏈疄鍚�', value: 0 },
- ]"
- buttonStyle
- showAllBtn
+ v-model="extraParamState.enterpriseSignContractStatus"
+ :value-enum="EnumTaskUserSignContractStatusText"
+ placeholder="璇烽�夋嫨浼佷笟绛剧害鐘舵��"
+ clearable
@change="getList()"
/>
</QueryFilterItem>
<QueryFilterItem>
<FieldDatePicker
- v-model="extraParamState.flexEnterpriseSettingStatus"
+ v-model="extraParamState.createdTime"
type="daterange"
range-separator="~"
start-placeholder="璧峰鏃ユ湡"
@@ -65,7 +57,7 @@
</QueryFilterItem>
<QueryFilterItem>
<FieldDatePicker
- v-model="extraParamState.flexEnterpriseSettingStatus"
+ v-model="extraParamState.signContractTime"
type="daterange"
range-separator="~"
start-placeholder="璧峰鏃ユ湡"
@@ -92,6 +84,7 @@
<el-button @click="handleBatchUnSign()" type="primary">鎵归噺瑙g害</el-button>
<el-button @click="handleSendShotMessage()" type="primary">鐭俊鍙戦��</el-button>
<el-button @click="handleBatchSign()" type="primary">鎵归噺绛剧害</el-button>
+ <el-button @click="handleEnterpriseBatchSign()" type="primary">鎵归噺浼佷笟绛剧害</el-button>
</template>
</ProTableQueryFilterBar>
<ProTableV2
@@ -100,14 +93,20 @@
:operationBtns="operationBtns"
show-column-check
ref="proTable"
+ :table-props="{
+ rowKey: 'id',
+ }"
>
</ProTableV2>
</AppContainer>
<StaffInfoDialog v-bind="dialogStaffInfoProps" />
+ <StaffDetailInfoDialog v-bind="dialogStaffDetailProps" />
<BatchImportDialog
v-bind="dialogBatchImportProps"
@onDownloadTemplate="handleDownloadTemplate"
/>
+ <SendShotMessageDialog v-bind="dialogShotMessageProps" />
+ <SignDialog v-bind="dialogSignProps" />
</LoadingLayout>
</template>
@@ -127,17 +126,22 @@
defineOperationBtns,
useFormDialog,
UploadUserFile,
+ XLSXUtils,
} from '@bole-core/components';
-import * as flexEnterpriseServices from '@/services/api/FlexEnterprise';
import { FlexJobManageColumns } from './constants';
-import { FlexEnterpriseSettingStatus, Gender } from '@/constants';
-import { OrderInputType, Message } from '@bole-core/core';
-import { convertApi2FormUrlOnlyOne, downloadFileByUrl } from '@/utils';
+import { EnumTaskUserHireStatusText, EnumTaskUserSignContractStatusText } from '@/constants';
+import { Message } from '@bole-core/core';
+import { convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils';
import StaffInfoDialog from './components/StaffInfoDialog.vue';
import BatchImportDialog from './components/BatchImportDialog.vue';
+import SendShotMessageDialog from './components/SendShotMessageDialog.vue';
+import StaffDetailInfoDialog from './components/StaffDetailInfoDialog.vue';
+import SignDialog from './components/SignDialog.vue';
+import * as enterpriseEmployeeServices from '@/services/api/enterpriseEmployee';
+import { ModelValueType } from 'element-plus';
defineOptions({
- name: 'EnterpriseManageList',
+ name: 'FlexJobManageList',
});
const operationBtns = defineOperationBtns([
@@ -156,19 +160,40 @@
name: '璇︽儏',
},
emits: {
- onClick: (role) => openDialog(role, true),
+ onClick: (role: API.GetEnterpriseEmployeesQueryResultItem) =>
+ handleStaffDetailEdit({ id: role.id, tabType: 'info' }),
},
},
{
data: {
- enCode: 'signBtn',
- name: '绛剧害',
+ enCode: 'enterpriseSignBtn',
+ name: '浼佷笟绛剧害',
},
emits: {
- onClick: (role) => handleSign(role),
+ onClick: (role) => handleEnterpriseSign(role),
},
extraProps: {
- hide: (row) => false,
+ hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
+ !(
+ row.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
+ row.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
+ ),
+ },
+ },
+ {
+ data: {
+ enCode: 'inviteSignBtn',
+ name: '閭�璇风绾�',
+ },
+ emits: {
+ onClick: (role) => handleInviteSign(role),
+ },
+ extraProps: {
+ hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
+ !(
+ row.userSignContractStatus !== EnumTaskUserSignContractStatus.Pass &&
+ row.hireStatus === EnumTaskUserHireStatus.Pass
+ ),
},
},
{
@@ -180,19 +205,23 @@
onClick: (role) => handleUnSign(role),
},
extraProps: {
- hide: (row) => false,
+ hide: (row: API.GetEnterpriseEmployeesQueryResultItem) =>
+ !(
+ row.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
+ row.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Pass
+ ),
},
},
- {
- data: {
- enCode: 'delBtn',
- name: '鍒犻櫎',
- },
- props: { type: 'danger' },
- emits: {
- onClick: (role) => handleDelete(role),
- },
- },
+ // {
+ // data: {
+ // enCode: 'delBtn',
+ // name: '鍒犻櫎',
+ // },
+ // props: { type: 'danger' },
+ // emits: {
+ // onClick: (role) => handleDelete(role),
+ // },
+ // },
]);
const router = useRouter();
@@ -217,17 +246,30 @@
} = useTable(
async ({ pageIndex, pageSize }, extraParamState) => {
try {
- let params: API.GetFlexEnterpriseInput = {
+ let params: API.GetEnterpriseEmployeesQuery = {
pageModel: {
rows: pageSize,
page: pageIndex,
orderInput: extraParamState.orderInput,
},
- flexEnterpriseSettingStatus: extraParamState.flexEnterpriseSettingStatus,
- searchWord: extraParamState.searchWord,
+ keywords: extraParamState.searchWord,
+ createdTimeStart: format(extraParamState.createdTime?.[0] ?? '', 'YYYY-MM-DD 00:00:00'),
+ createdTimeEnd: format(extraParamState.createdTime?.[1] ?? '', 'YYYY-MM-DD 23:59:59'),
+ signContractTimeStart: format(
+ extraParamState.signContractTime?.[0] ?? '',
+ 'YYYY-MM-DD 00:00:00'
+ ),
+ signContractTimeEnd: format(
+ extraParamState.signContractTime?.[1] ?? '',
+ 'YYYY-MM-DD 23:59:59'
+ ),
+ hireStatus: extraParamState.hireStatus,
+ isReal: extraParamState.isReal,
+ userSignContractStatus: extraParamState.userSignContractStatus,
+ enterpriseSignContractStatus: extraParamState.enterpriseSignContractStatus,
};
- let res = await flexEnterpriseServices.getFlexEnterpriseList(params, {
+ let res = await enterpriseEmployeeServices.getEnterpriseEmployees(params, {
showLoading: !state.loading,
});
return res;
@@ -238,11 +280,30 @@
{
defaultExtraParams: {
searchWord: '',
- orderInput: [{ property: 'id', order: OrderInputType.Desc }],
- flexEnterpriseSettingStatus: '' as any as FlexEnterpriseSettingStatus,
+ orderInput: [{ property: 'createdTime', order: EnumPagedListOrder.Desc }],
+ createdTime: [] as unknown as ModelValueType,
+ signContractTime: [] as unknown as ModelValueType,
+ hireStatus: '' as any as EnumTaskUserHireStatus,
+ isReal: null as any as boolean,
+ userSignContractStatus: '' as any as EnumTaskUserSignContractStatus,
+ enterpriseSignContractStatus: '' as any as EnumTaskUserSignContractStatus,
},
- queryKey: ['flexEnterpriseServices/getFlexEnterpriseList'],
- columnsRenderProps: {},
+ queryKey: ['enterpriseEmployeeServices/getEnterpriseEmployees'],
+ columnsRenderProps: {
+ gender: { type: 'enum', valueEnum: EnumUserGenderTextForPerson },
+ hireStatus: { type: 'enum', valueEnum: EnumTaskUserHireStatusText },
+ userIsReal: {
+ formatter: (row: API.GetEnterpriseEmployeesQueryResultItem) => {
+ return row.userIsReal ? '宸插疄鍚�' : '鏈疄鍚�';
+ },
+ },
+ userSignContractStatus: { type: 'enum', valueEnum: EnumTaskUserSignContractStatusText },
+ hireTime: { type: 'date' },
+ userRealTime: { type: 'date' },
+ userSignContractTime: { type: 'date' },
+ enterpriseSignContractStatus: { type: 'enum', valueEnum: EnumTaskUserSignContractStatusText },
+ enterpriseSignContractTime: { type: 'date' },
+ },
}
);
@@ -270,45 +331,62 @@
defaultFormParams: {
id: '',
name: '',
- idNumber: '',
- phoneNumber: '',
- genderType: Gender.Male,
- age: 0,
- companyId: '',
- customerId: '',
- idFrontUrl: [] as UploadUserFile[],
- idBackUrl: [] as UploadUserFile[],
+ identity: '',
+ contactPhoneNumber: '',
+ gender: EnumUserGender.Male,
+ age: null as any as number,
+ identityImg: [] as UploadUserFile[],
+ identityBackImg: [] as UploadUserFile[],
contractUrl: [] as UploadUserFile[],
regiterTime: '',
- realVerifyTime: '',
- signTime: '',
+ userRealTime: '',
+ userSignContractTime: '',
isDetail: false,
},
});
-function openDialog(row, isDetail = false) {
- handleStaffInfoEdit({
- id: row.id,
- name: row.name,
- idNumber: row.idNumber,
- phoneNumber: row.phoneNumber,
- genderType: Gender.Male,
- age: row.age ?? 0,
- companyId: row.companyId,
- customerId: row.customerId,
- idFrontUrl: convertApi2FormUrlOnlyOne(row.idFrontUrl),
- idBackUrl: convertApi2FormUrlOnlyOne(row.idBackUrl),
- contractUrl: convertApi2FormUrlOnlyOne(row.contractUrl, {
- fileName: row.contractUrl ? row.contractUrl.split('/').pop() : '鍚堝悓',
- }),
- regiterTime: row.regiterTime,
- realVerifyTime: row.realVerifyTime,
- signTime: row.signTime,
- isDetail: isDetail,
- });
+async function openDialog(row: API.GetEnterpriseEmployeesQueryResultItem, isDetail = false) {
+ try {
+ let detail = await enterpriseEmployeeServices.getEnterpriseEmployee({ id: row.id });
+ handleStaffInfoEdit({
+ id: row.id,
+ name: row.name,
+ identity: row.identity,
+ contactPhoneNumber: row.contactPhoneNumber,
+ gender: detail.gender,
+ age: detail.age ?? null,
+ identityImg: convertApi2FormUrlOnlyOne(detail.identityImg),
+ identityBackImg: convertApi2FormUrlOnlyOne(detail.identityBackImg),
+ contractUrl: convertApi2FormUrlOnlyOne(detail.contractUrl, {
+ fileName: detail.contractUrl ? detail.contractUrl.split('/').pop() : '鍚堝悓',
+ }),
+ regiterTime: detail.applyTime ?? '',
+ userRealTime: row.userRealTime ?? '',
+ userSignContractTime: row.userSignContractTime ?? '',
+ isDetail: isDetail,
+ });
+ } catch (error) {}
}
-async function handleAddOrEdit() {}
+async function handleAddOrEdit() {
+ try {
+ let params: API.EditEnterpriseEmployeeCommand = {
+ name: staffInfoEditForm.name,
+ identity: staffInfoEditForm.identity,
+ contactPhoneNumber: staffInfoEditForm.contactPhoneNumber,
+ gender: staffInfoEditForm.gender,
+ age: staffInfoEditForm.age,
+ identityImg: staffInfoEditForm.identityImg[0]?.path ?? '',
+ identityBackImg: staffInfoEditForm.identityBackImg[0]?.path ?? '',
+ id: staffInfoEditForm.id,
+ };
+ let res = await enterpriseEmployeeServices.editEnterpriseEmployee(params);
+ if (res) {
+ Message.successMessage('鎿嶄綔鎴愬姛');
+ getList(paginationState.pageIndex);
+ }
+ } catch (error) {}
+}
const {
dialogProps: dialogBatchImportProps,
@@ -317,32 +395,233 @@
} = useFormDialog({
onConfirm: handleBatchImport,
defaultFormParams: {
- customerId: '',
- contractTemplateId: '',
- templateDataId: '',
url: [] as UploadUserFile[],
- userList: [],
},
});
-async function handleBatchImport() {}
-
-function handleDownloadTemplate() {
- downloadFileByUrl('', '鎵归噺瀵煎叆妯℃澘');
-}
-
-function handleBatchUnSign() {}
-function handleSendShotMessage() {}
-
-function handleSign(row) {}
-function handleBatchSign() {}
-async function handleUnSign(row) {
+async function handleBatchImport() {
try {
- await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�');
+ let params: API.ImportEnterpriseEmployeesCommand = {
+ excelUrl: batchImportForm.url[0]?.path ?? '',
+ };
+ let res = await enterpriseEmployeeServices.importEnterpriseEmployees(params);
+ if (res.failCount > 0) {
+ await Message.tipMessage('瀛樺湪閿欒鏁版嵁锛屾槸鍚﹀鍑猴紵');
+ XLSXUtils.exportToXLSX({
+ workbookDataList: res.errors,
+ fileName: '鐏靛伐鎵归噺瀵煎叆-閿欒鏁版嵁',
+ workbookHeaderMap: {
+ name: '濮撳悕',
+ identity: '韬唤璇佸彿',
+ contactPhoneNumber: '鎵嬫満鍙�',
+ errorMessage: '澶囨敞',
+ },
+ });
+ } else {
+ Message.successMessage('瀵煎叆鎴愬姛');
+ getList();
+ }
} catch (error) {}
}
-async function handleDelete(row) {
+const {
+ dialogProps: dialogShotMessageProps,
+ handleAdd: handleShotMessageAdd,
+ editForm: editShotMessageForm,
+} = useFormDialog({
+ onConfirm: sendMessageForSign,
+ defaultFormParams: {
+ ids: [] as string[],
+ customerId: '',
+ name: '',
+ contractTemplateId: '',
+ },
+});
+
+async function handleSendShotMessage() {
+ try {
+ const selectionRows = getSelectionRows();
+ if (selectionRows) {
+ if (
+ selectionRows.some((x) => x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass)
+ ) {
+ await Message.tipMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愪汉鍛橈紝纭瑕佺户缁彂閫佺煭淇¢�氱煡鍚楋紵');
+ }
+ handleShotMessageAdd({
+ ids: selectionRows.map((x) => x.id),
+ name: '浜哄憳绛剧害閫氶亾鐭俊',
+ });
+ }
+ } catch (error) {}
+}
+
+async function sendMessageForSign() {
+ try {
+ let params: API.SendInviteElectronSignSmsCommand = {
+ ids: editShotMessageForm.ids,
+ contractTemplateId: editShotMessageForm.contractTemplateId,
+ };
+ let res = await enterpriseEmployeeServices.sendInviteElectronSignSms(params);
+ if (res) {
+ Message.successMessage('鐭俊宸插彂閫�');
+ }
+ } catch (error) {}
+}
+
+function handleDownloadTemplate() {
+ downloadFileByUrl(ImportEnterpriseEmployeesTempPath, '鎵归噺瀵煎叆妯℃澘');
+}
+
+const {
+ dialogProps: dialogSignProps,
+ handleAdd: handleSignAdd,
+ handleEdit: handleSignEdit,
+ editForm: signEditForm,
+} = useFormDialog({
+ onConfirm: signContract,
+ defaultFormParams: {
+ ids: [] as string[],
+ contractTemplateId: '',
+ },
+});
+
+function handleInviteSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
+ if (row) {
+ handleSignEdit({
+ ids: [row.id],
+ contractTemplateId: '',
+ });
+ }
+}
+function handleBatchSign() {
+ const selectionRows = getSelectionRows();
+ if (selectionRows) {
+ const hasSigned = selectionRows?.some(
+ (x) =>
+ x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass ||
+ x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Pass ||
+ x.hireStatus === EnumTaskUserHireStatus.Wait
+ );
+ if (hasSigned) {
+ Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸茬绾﹀畬鎴愭垨鏈綍鐢ㄤ汉鍛�');
+ return;
+ }
+ handleSignAdd({
+ ids: selectionRows.map((x) => x.id),
+ contractTemplateId: '',
+ });
+ }
+}
+
+function handleEnterpriseBatchSign() {
+ const selectionRows = getSelectionRows();
+ if (selectionRows) {
+ const hasSigned = selectionRows?.some(
+ (x) =>
+ !(
+ x.userSignContractStatus === EnumTaskUserSignContractStatus.Pass &&
+ x.enterpriseSignContractStatus === EnumTaskUserSignContractStatus.Wait
+ )
+ );
+ if (hasSigned) {
+ Message.warnMessage('鍕鹃�変汉鍛樹腑鍖呭惈宸蹭紒涓氱绾︺�佹湭褰曠敤浜哄憳鎴栨湭绛剧害瀹屾垚浜哄憳');
+ return;
+ }
+ const ids = selectionRows.map((x) => x.id);
+ handleBatchEnterpriseSign(ids);
+ }
+}
+
+async function handleBatchEnterpriseSign(ids: string[]) {
+ try {
+ let res = await enterpriseEmployeeServices.batchEnterpriseSignContract({ ids: ids });
+ if (res) {
+ Message.successMessage('鎿嶄綔鎴愬姛');
+ getList(paginationState.pageIndex);
+ if (res?.errors?.length > 0) {
+ Message.tipMessage('瀛樺湪绛剧害澶辫触鐨勭伒宸ヤ俊鎭暟鎹紝鏄惁瀵煎嚭锛�').then(() => {
+ XLSXUtils.exportToXLSX({
+ workbookDataList: res.errors,
+ fileName: '绛剧害澶辫触鐏靛伐淇℃伅',
+ workbookHeaderMap: {
+ name: '濮撳悕',
+ contactPhoneNumber: '鎵嬫満鍙�',
+ identity: '韬唤璇佸彿',
+ errorMessages: '閿欒淇℃伅',
+ },
+ });
+ });
+ }
+ }
+ } catch (error) {}
+}
+
+async function signContract() {
+ try {
+ let params: API.InviteElectronSignCommand = {
+ ids: signEditForm.ids,
+ contractTemplateId: signEditForm.contractTemplateId,
+ };
+ let res = await enterpriseEmployeeServices.inviteElectronSign(params);
+ if (res) {
+ Message.successMessage('鎿嶄綔鎴愬姛');
+ getList(paginationState.pageIndex);
+ }
+ } catch (error) {}
+}
+
+async function handleEnterpriseSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
+ try {
+ let res = await enterpriseEmployeeServices.enterpriseUserElectronSign({ id: row.id });
+ if (res) {
+ window.open(res?.signContractLongUrl, '_blank');
+ }
+ } catch (error) {}
+}
+
+function handleUnSign(row: API.GetEnterpriseEmployeesQueryResultItem) {
+ stopElectronSign([row.id]);
+}
+
+function handleBatchUnSign() {
+ try {
+ const selectionRows = getSelectionRows();
+ if (selectionRows) {
+ const hasUnSigned = selectionRows?.some(
+ (x) => x.enterpriseSignContractStatus !== EnumTaskUserSignContractStatus.Pass
+ );
+ if (hasUnSigned) {
+ Message.warnMessage('鍕鹃�夋暟鎹腑鍖呭惈浼佷笟鏈绾︽垨宸茶В绾︽暟鎹�');
+ return;
+ }
+ stopElectronSign(selectionRows.map((x) => x.id));
+ }
+ } catch (error) {}
+}
+
+async function stopElectronSign(ids: string[]) {
+ try {
+ await Message.tipMessage('纭畾瑙g害鐢ㄦ埛锛�');
+ let res = await enterpriseEmployeeServices.stopElectronSign({ ids: ids });
+ if (res) {
+ Message.successMessage('鎿嶄綔鎴愬姛');
+ getList(paginationState.pageIndex);
+ }
+ } catch (error) {}
+}
+
+const {
+ dialogProps: dialogStaffDetailProps,
+ handleEdit: handleStaffDetailEdit,
+ editForm: staffDetailEditForm,
+} = useFormDialog({
+ defaultFormParams: {
+ id: '',
+ tabType: 'info',
+ },
+});
+
+async function handleDelete(row: API.GetEnterpriseEmployeesQueryResultItem) {
try {
await Message.deleteMessage();
} catch (error) {}
--
Gitblit v1.9.1