bug修复
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
This commit is contained in:
@@ -40,13 +40,15 @@ const ListEdit: React.FC<ListFormProps> = (props) => {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(() => {
|
||||
form.resetFields();
|
||||
if (props.values) {
|
||||
form.setFieldsValue({
|
||||
...props.values,
|
||||
});
|
||||
if (props.open) {
|
||||
form.resetFields();
|
||||
if (props.values) {
|
||||
form.setFieldsValue({
|
||||
...props.values,
|
||||
});
|
||||
}
|
||||
}
|
||||
}, [form, props]);
|
||||
}, [form, props.values?.companyId, props.open]);
|
||||
|
||||
const handleCancel = () => {
|
||||
props.onCancel();
|
||||
@@ -55,6 +57,7 @@ const ListEdit: React.FC<ListFormProps> = (props) => {
|
||||
|
||||
const handleFinish = async (values: Record<string, any>) => {
|
||||
await props.onSubmit(values as API.CompanyList.Company);
|
||||
return true;
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -146,8 +146,19 @@ function ManagementList() {
|
||||
{
|
||||
title: '公司行业',
|
||||
dataIndex: 'industry',
|
||||
valueType: 'text',
|
||||
valueType: 'treeSelect',
|
||||
align: 'center',
|
||||
fieldProps: {
|
||||
fieldNames: { label: 'label', value: 'id', children: 'children' },
|
||||
treeDefaultExpandAll: false,
|
||||
showSearch: true,
|
||||
allowClear: true,
|
||||
placeholder: '请选择行业',
|
||||
},
|
||||
request: async () => {
|
||||
const res = await getCmsIndustryTreeList();
|
||||
return (res?.data || []) as any;
|
||||
},
|
||||
render: (_, record) => {
|
||||
return <DictTag enums={industryEnum} value={record.industry} />;
|
||||
},
|
||||
@@ -170,6 +181,24 @@ function ManagementList() {
|
||||
valueEnum: companyNatureEnum,
|
||||
render: (_, record) => <DictTag enums={companyNatureEnum} value={record.companyNature} />,
|
||||
},
|
||||
{
|
||||
title: '法定代表人',
|
||||
dataIndex: 'legalPerson',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '联系人',
|
||||
dataIndex: 'contactPerson',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
dataIndex: 'contactPersonPhone',
|
||||
valueType: 'text',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: '公司位置',
|
||||
dataIndex: 'location',
|
||||
@@ -329,6 +358,9 @@ function ManagementList() {
|
||||
};
|
||||
})
|
||||
}
|
||||
search={{
|
||||
defaultCollapsed: false,
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
type="primary"
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useModel } from '@umijs/max';
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import { DictValueEnumObj } from '@/components/DictTag';
|
||||
import { getCmsCompanyList } from '@/services/company/list';
|
||||
import { getCmsJobDetail } from '@/services/Management/list';
|
||||
import { getCmsJobDetail, delCmsJobContact } from '@/services/Management/list';
|
||||
import { getJobTitleTreeSelect } from '@/services/common/jobTitle';
|
||||
import ProFromMap from '@/components/ProFromMap';
|
||||
import { parseCommaSeparatedTags, serializeCommaSeparatedTags } from '@/utils/jobDetailTags';
|
||||
@@ -262,6 +262,7 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
description: values.description,
|
||||
jobContactList: (values.jobContactList ?? []).map(
|
||||
(item: API.ManagementList.ContactPerson) => ({
|
||||
id: item.id,
|
||||
contactPerson: item.contactPerson,
|
||||
contactPersonPhone: item.contactPersonPhone,
|
||||
position: item.position,
|
||||
@@ -772,7 +773,13 @@ const listEdit: React.FC<ListFormProps> = (props) => {
|
||||
type="text"
|
||||
danger
|
||||
icon={<MinusCircleOutlined />}
|
||||
onClick={() => remove(name)}
|
||||
onClick={async () => {
|
||||
const contactId = form.getFieldValue(['jobContactList', name, 'id']);
|
||||
if (contactId) {
|
||||
await delCmsJobContact(String(contactId));
|
||||
}
|
||||
remove(name);
|
||||
}}
|
||||
style={{ marginBottom: 0 }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -40,6 +40,12 @@ export async function delCmsJobIds(ids: string) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function delCmsJobContact(ids: string) {
|
||||
return request<API.ManagementList.ManagePageResult>(`/api/cms/jobcontact/${ids}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
|
||||
export async function exportCmsJob(params?: API.ManagementList.ListParams) {
|
||||
return downLoadXlsx(`/api/cms/job/export`, { params }, `job_data_${new Date().getTime()}.xlsx`);
|
||||
}
|
||||
|
||||
1
src/types/Management/list.d.ts
vendored
1
src/types/Management/list.d.ts
vendored
@@ -1,5 +1,6 @@
|
||||
declare namespace API.ManagementList {
|
||||
export interface ContactPerson {
|
||||
id?: number;
|
||||
contactPerson?: string;
|
||||
contactPersonPhone?: string;
|
||||
position?: string;
|
||||
|
||||
Reference in New Issue
Block a user