修改历史代码
parent
adb6a79d8f
commit
8ec2de142b
|
|
@ -1,211 +0,0 @@
|
|||
/** 资质备案:前后端字段与分页格式适配 */
|
||||
|
||||
import { formatDate, normalizeDateValue, toApiDate, toDayjs } from "../../utils/dateFormat";
|
||||
import { parseUploadFileList } from "../../utils/mockUpload";
|
||||
import { asId, normalizeQueryIds } from "../enterpriseInfo/idUtil";
|
||||
import { fromPageResponse, fromSingleResponse, toPageQuery } from "../enterpriseInfo/adapter";
|
||||
|
||||
export { fromPageResponse, fromSingleResponse, toPageQuery };
|
||||
|
||||
export function toFilingListRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingTerritoryCode: data.filingTerritoryCode,
|
||||
filingTerritoryName: data.filingTerritoryName,
|
||||
filingUnitName: data.filingUnitName,
|
||||
filingNo: data.filingNo || (data.id ? String(data.id) : ""),
|
||||
businessScope: data.businessScope,
|
||||
filingStatusCode: data.filingStatusCode,
|
||||
filingStatusName: data.filingStatusName,
|
||||
applyTypeCode: data.applyTypeCode,
|
||||
applyTypeName: data.applyTypeName,
|
||||
changeCount: Number(data.changeCount ?? 0),
|
||||
originFilingId: asId(data.originFilingId),
|
||||
rejectReason: data.rejectReason,
|
||||
submitTime: formatDate(data.submitTime),
|
||||
approveTime: formatDate(data.approveTime),
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingBasicForm(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
businessScope: data.businessScope,
|
||||
filingTerritoryCode: data.filingTerritoryCode,
|
||||
filingTerritoryName: data.filingTerritoryName,
|
||||
filingUnitName: data.filingUnitName,
|
||||
filingUnitTypeCode: data.filingUnitTypeCode,
|
||||
filingUnitTypeName: data.filingUnitTypeName,
|
||||
filingNo: data.filingNo,
|
||||
registerAddress: data.registerAddress,
|
||||
officeAddress: data.officeAddress,
|
||||
creditCode: data.creditCode,
|
||||
qualCertNo: data.qualCertNo,
|
||||
legalPersonPhone: data.legalPersonPhone,
|
||||
contactPhone: data.contactPhone,
|
||||
infoDisclosureUrl: data.infoDisclosureUrl,
|
||||
fixedAssetAmount: data.fixedAssetAmount,
|
||||
workplaceArea: data.workplaceArea,
|
||||
archiveRoomArea: data.archiveRoomArea,
|
||||
fulltimeEvaluatorCount: data.fulltimeEvaluatorCount,
|
||||
registeredEngineerCount: data.registeredEngineerCount,
|
||||
unitIntro: data.unitIntro,
|
||||
attachmentUrl: data.attachmentUrl,
|
||||
attachments: parseUploadFileList(data.attachmentUrl, "备案附件.pdf"),
|
||||
filingStatusCode: data.filingStatusCode,
|
||||
filingStatusName: data.filingStatusName,
|
||||
applyTypeCode: data.applyTypeCode,
|
||||
originFilingId: asId(data.originFilingId),
|
||||
};
|
||||
}
|
||||
|
||||
export function fromFilingBasicForm(values = {}) {
|
||||
const territoryName = values.filingTerritoryName || values.filingTerritoryCode;
|
||||
const unitTypeName = values.filingUnitTypeName || values.filingUnitTypeCode;
|
||||
return normalizeQueryIds({
|
||||
id: asId(values.id),
|
||||
businessScope: values.businessScope,
|
||||
filingTerritoryCode: territoryName,
|
||||
filingTerritoryName: territoryName,
|
||||
filingUnitName: values.filingUnitName,
|
||||
filingUnitTypeCode: unitTypeName,
|
||||
filingUnitTypeName: unitTypeName,
|
||||
filingNo: values.filingNo,
|
||||
registerAddress: values.registerAddress,
|
||||
officeAddress: values.officeAddress,
|
||||
creditCode: values.creditCode,
|
||||
qualCertNo: values.qualCertNo,
|
||||
legalPersonPhone: values.legalPersonPhone,
|
||||
contactPhone: values.contactPhone,
|
||||
infoDisclosureUrl: values.infoDisclosureUrl,
|
||||
fixedAssetAmount: values.fixedAssetAmount,
|
||||
workplaceArea: values.workplaceArea,
|
||||
archiveRoomArea: values.archiveRoomArea,
|
||||
fulltimeEvaluatorCount: values.fulltimeEvaluatorCount,
|
||||
registeredEngineerCount: values.registeredEngineerCount,
|
||||
unitIntro: values.unitIntro,
|
||||
attachmentUrl: values.attachmentUrl,
|
||||
});
|
||||
}
|
||||
|
||||
export function toFilingDetail(data = {}) {
|
||||
return {
|
||||
...toFilingBasicForm(data),
|
||||
materials: (data.materials || []).map(toFilingMaterialRow),
|
||||
commitment: data.commitment ? toFilingCommitmentForm(data.commitment, data.filingUnitName) : null,
|
||||
personnelList: (data.personnelList || []).map(toFilingPersonnelRow),
|
||||
equipmentList: (data.equipmentList || []).map(toFilingEquipmentRow),
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingMaterialRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sortOrder: data.sortOrder,
|
||||
materialContent: data.materialContent,
|
||||
materialFormat: data.materialFormat,
|
||||
requiredFlag: data.requiredFlag,
|
||||
uploadStatusCode: data.uploadStatusCode,
|
||||
uploadStatusName: data.uploadStatusName,
|
||||
attachmentDesc: data.attachmentDesc,
|
||||
attachmentUrl: data.attachmentUrl,
|
||||
materialRemark: data.materialRemark,
|
||||
};
|
||||
}
|
||||
|
||||
export function parseCommitmentNames(content = "", filingUnitName = "") {
|
||||
const withComma = String(content).match(/本人是(.+?),是(.+?)法定代表人/);
|
||||
if (withComma) {
|
||||
return {
|
||||
legalRepName: withComma[1]?.trim() || "",
|
||||
filingUnitName: withComma[2]?.trim() || filingUnitName || "",
|
||||
};
|
||||
}
|
||||
const legacy = String(content).match(/本人是(.+?)是(.+?)法定代表人/);
|
||||
return {
|
||||
legalRepName: legacy?.[1]?.trim() || "",
|
||||
filingUnitName: legacy?.[2]?.trim() || filingUnitName || "",
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingCommitmentForm(data = {}, filingUnitName = "") {
|
||||
const parsed = parseCommitmentNames(data.commitmentContent, filingUnitName);
|
||||
const legalRepPersonnelId = data.legalRepPersonnelId ? String(asId(data.legalRepPersonnelId)) : "";
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
commitmentContent: data.commitmentContent,
|
||||
legalRepPersonnelId,
|
||||
legalRepName: data.legalRepName || parsed.legalRepName,
|
||||
filingUnitName: parsed.filingUnitName || filingUnitName,
|
||||
legalRepSignatureUrl: data.legalRepSignatureUrl,
|
||||
signDate: toDayjs(data.signDate),
|
||||
signatureFiles: parseUploadFileList(data.legalRepSignatureUrl, "电子签名.jpg"),
|
||||
};
|
||||
}
|
||||
|
||||
export function fromFilingCommitmentForm(values = {}, filingId) {
|
||||
const personnelId = asId(values.legalRepPersonnelId);
|
||||
return {
|
||||
id: asId(values.id),
|
||||
filingId: asId(filingId),
|
||||
commitmentContent: values.commitmentContent,
|
||||
legalRepSignatureUrl: values.legalRepSignatureUrl,
|
||||
signDate: toApiDate(values.signDate),
|
||||
legalRepPersonnelId: personnelId || null,
|
||||
legalRepName: values.legalRepName || "",
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingPersonnelRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sourcePersonnelId: asId(data.sourcePersonnelId),
|
||||
personName: data.personName,
|
||||
personTypeName: data.personTypeName,
|
||||
positionName: data.positionName,
|
||||
titleName: data.titleName,
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingEquipmentRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sourceEquipmentId: asId(data.sourceEquipmentId),
|
||||
deviceName: data.deviceName,
|
||||
deviceModel: data.deviceModel,
|
||||
manufacturer: data.manufacturer,
|
||||
calibrationReportUrl: data.calibrationReportUrl,
|
||||
};
|
||||
}
|
||||
|
||||
export function toChangeHistory(data = {}) {
|
||||
return {
|
||||
changeCount: Number(data.changeCount ?? 0),
|
||||
records: (data.records || []).map((item, index) => ({
|
||||
id: asId(item.id),
|
||||
index: index + 1,
|
||||
changeItemName: item.changeItemName,
|
||||
changeTime: formatDate(item.changeTime),
|
||||
operatorName: item.operatorName,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingPageQuery(params = {}, extra = {}) {
|
||||
const query = toPageQuery(params, {
|
||||
filingUnitName: "filingUnitName",
|
||||
filingTerritoryName: "filingTerritoryCode",
|
||||
filingNo: "filingNo",
|
||||
filingStatus: "filingStatusCode",
|
||||
});
|
||||
if (query.filingTerritoryCode) {
|
||||
query.filingTerritoryName = query.filingTerritoryCode;
|
||||
}
|
||||
// 列表 orgId 由后端从登录上下文解析,避免 session orgInfoId 与 token orgId 不一致导致查不到暂存数据
|
||||
delete query.orgId;
|
||||
return { ...query, ...extra };
|
||||
}
|
||||
|
|
@ -1,20 +1,238 @@
|
|||
/** 资质备案:接口定义与前后端字段适配 */
|
||||
|
||||
import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
|
||||
import {
|
||||
fromFilingBasicForm,
|
||||
fromFilingCommitmentForm,
|
||||
fromPageResponse,
|
||||
fromSingleResponse,
|
||||
toChangeHistory,
|
||||
toFilingDetail,
|
||||
toFilingListRow,
|
||||
toFilingPageQuery,
|
||||
} from "./adapter";
|
||||
import { fromPageResponse, fromSingleResponse, toPageQuery } from "../enterpriseInfo/adapter";
|
||||
import { apiGet, apiPost, apiPostDelete, safeAction, safePageResult } from "../enterpriseInfo/http";
|
||||
import { asId } from "../enterpriseInfo/idUtil";
|
||||
import { resolveUploadFileId } from "../../utils/mockUpload";
|
||||
import { asId, normalizeQueryIds } from "../enterpriseInfo/idUtil";
|
||||
import { formatDate, toApiDate, toDayjs } from "../../utils/dateFormat";
|
||||
import { parseUploadFileList, resolveUploadFileId } from "../../utils/mockUpload";
|
||||
|
||||
// ─── 工具 ───
|
||||
|
||||
const APPLY_TYPE_APPLICATION = 1;
|
||||
|
||||
// ─── 字段映射:列表行 ───
|
||||
|
||||
export function toFilingListRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingTerritoryCode: data.filingTerritoryCode,
|
||||
filingTerritoryName: data.filingTerritoryName,
|
||||
filingUnitName: data.filingUnitName,
|
||||
filingNo: data.filingNo || (data.id ? String(data.id) : ""),
|
||||
businessScope: data.businessScope,
|
||||
filingStatusCode: data.filingStatusCode,
|
||||
filingStatusName: data.filingStatusName,
|
||||
applyTypeCode: data.applyTypeCode,
|
||||
applyTypeName: data.applyTypeName,
|
||||
changeCount: Number(data.changeCount ?? 0),
|
||||
originFilingId: asId(data.originFilingId),
|
||||
rejectReason: data.rejectReason,
|
||||
submitTime: formatDate(data.submitTime),
|
||||
approveTime: formatDate(data.approveTime),
|
||||
};
|
||||
}
|
||||
|
||||
// ─── 字段映射:基本表单 ───
|
||||
|
||||
export function toFilingBasicForm(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
businessScope: data.businessScope,
|
||||
filingTerritoryCode: data.filingTerritoryCode,
|
||||
filingTerritoryName: data.filingTerritoryName,
|
||||
filingUnitName: data.filingUnitName,
|
||||
filingUnitTypeCode: data.filingUnitTypeCode,
|
||||
filingUnitTypeName: data.filingUnitTypeName,
|
||||
filingNo: data.filingNo,
|
||||
registerAddress: data.registerAddress,
|
||||
officeAddress: data.officeAddress,
|
||||
creditCode: data.creditCode,
|
||||
qualCertNo: data.qualCertNo,
|
||||
legalPersonPhone: data.legalPersonPhone,
|
||||
contactPhone: data.contactPhone,
|
||||
infoDisclosureUrl: data.infoDisclosureUrl,
|
||||
fixedAssetAmount: data.fixedAssetAmount,
|
||||
workplaceArea: data.workplaceArea,
|
||||
archiveRoomArea: data.archiveRoomArea,
|
||||
fulltimeEvaluatorCount: data.fulltimeEvaluatorCount,
|
||||
registeredEngineerCount: data.registeredEngineerCount,
|
||||
unitIntro: data.unitIntro,
|
||||
attachmentUrl: data.attachmentUrl,
|
||||
attachments: parseUploadFileList(data.attachmentUrl, "备案附件.pdf"),
|
||||
filingStatusCode: data.filingStatusCode,
|
||||
filingStatusName: data.filingStatusName,
|
||||
applyTypeCode: data.applyTypeCode,
|
||||
originFilingId: asId(data.originFilingId),
|
||||
};
|
||||
}
|
||||
|
||||
export function fromFilingBasicForm(values = {}) {
|
||||
const territoryName = values.filingTerritoryName || values.filingTerritoryCode;
|
||||
const unitTypeName = values.filingUnitTypeName || values.filingUnitTypeCode;
|
||||
return normalizeQueryIds({
|
||||
id: asId(values.id),
|
||||
businessScope: values.businessScope,
|
||||
filingTerritoryCode: territoryName,
|
||||
filingTerritoryName: territoryName,
|
||||
filingUnitName: values.filingUnitName,
|
||||
filingUnitTypeCode: unitTypeName,
|
||||
filingUnitTypeName: unitTypeName,
|
||||
filingNo: values.filingNo,
|
||||
registerAddress: values.registerAddress,
|
||||
officeAddress: values.officeAddress,
|
||||
creditCode: values.creditCode,
|
||||
qualCertNo: values.qualCertNo,
|
||||
legalPersonPhone: values.legalPersonPhone,
|
||||
contactPhone: values.contactPhone,
|
||||
infoDisclosureUrl: values.infoDisclosureUrl,
|
||||
fixedAssetAmount: values.fixedAssetAmount,
|
||||
workplaceArea: values.workplaceArea,
|
||||
archiveRoomArea: values.archiveRoomArea,
|
||||
fulltimeEvaluatorCount: values.fulltimeEvaluatorCount,
|
||||
registeredEngineerCount: values.registeredEngineerCount,
|
||||
unitIntro: values.unitIntro,
|
||||
attachmentUrl: values.attachmentUrl,
|
||||
});
|
||||
}
|
||||
|
||||
// ─── 字段映射:详情 ───
|
||||
|
||||
export function toFilingDetail(data = {}) {
|
||||
return {
|
||||
...toFilingBasicForm(data),
|
||||
materials: (data.materials || []).map(toFilingMaterialRow),
|
||||
commitment: data.commitment ? toFilingCommitmentForm(data.commitment, data.filingUnitName) : null,
|
||||
personnelList: (data.personnelList || []).map(toFilingPersonnelRow),
|
||||
equipmentList: (data.equipmentList || []).map(toFilingEquipmentRow),
|
||||
};
|
||||
}
|
||||
|
||||
// ─── 字段映射:材料 ───
|
||||
|
||||
export function toFilingMaterialRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sortOrder: data.sortOrder,
|
||||
materialContent: data.materialContent,
|
||||
materialFormat: data.materialFormat,
|
||||
requiredFlag: data.requiredFlag,
|
||||
uploadStatusCode: data.uploadStatusCode,
|
||||
uploadStatusName: data.uploadStatusName,
|
||||
attachmentDesc: data.attachmentDesc,
|
||||
attachmentUrl: data.attachmentUrl,
|
||||
materialRemark: data.materialRemark,
|
||||
};
|
||||
}
|
||||
|
||||
// ─── 字段映射:承诺书 ───
|
||||
|
||||
export function parseCommitmentNames(content = "", filingUnitName = "") {
|
||||
const withComma = String(content).match(/本人是(.+?),是(.+?)法定代表人/);
|
||||
if (withComma) {
|
||||
return {
|
||||
legalRepName: withComma[1]?.trim() || "",
|
||||
filingUnitName: withComma[2]?.trim() || filingUnitName || "",
|
||||
};
|
||||
}
|
||||
const legacy = String(content).match(/本人是(.+?)是(.+?)法定代表人/);
|
||||
return {
|
||||
legalRepName: legacy?.[1]?.trim() || "",
|
||||
filingUnitName: legacy?.[2]?.trim() || filingUnitName || "",
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingCommitmentForm(data = {}, filingUnitName = "") {
|
||||
const parsed = parseCommitmentNames(data.commitmentContent, filingUnitName);
|
||||
const legalRepPersonnelId = data.legalRepPersonnelId ? String(asId(data.legalRepPersonnelId)) : "";
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
commitmentContent: data.commitmentContent,
|
||||
legalRepPersonnelId,
|
||||
legalRepName: data.legalRepName || parsed.legalRepName,
|
||||
filingUnitName: parsed.filingUnitName || filingUnitName,
|
||||
legalRepSignatureUrl: data.legalRepSignatureUrl,
|
||||
signDate: toDayjs(data.signDate),
|
||||
signatureFiles: parseUploadFileList(data.legalRepSignatureUrl, "电子签名.jpg"),
|
||||
};
|
||||
}
|
||||
|
||||
export function fromFilingCommitmentForm(values = {}, filingId) {
|
||||
const personnelId = asId(values.legalRepPersonnelId);
|
||||
return {
|
||||
id: asId(values.id),
|
||||
filingId: asId(filingId),
|
||||
commitmentContent: values.commitmentContent,
|
||||
legalRepSignatureUrl: values.legalRepSignatureUrl,
|
||||
signDate: toApiDate(values.signDate),
|
||||
legalRepPersonnelId: personnelId || null,
|
||||
legalRepName: values.legalRepName || "",
|
||||
};
|
||||
}
|
||||
|
||||
// ─── 字段映射:人员 / 装备 ───
|
||||
|
||||
export function toFilingPersonnelRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sourcePersonnelId: asId(data.sourcePersonnelId),
|
||||
personName: data.personName,
|
||||
personTypeName: data.personTypeName,
|
||||
positionName: data.positionName,
|
||||
titleName: data.titleName,
|
||||
};
|
||||
}
|
||||
|
||||
export function toFilingEquipmentRow(data = {}) {
|
||||
return {
|
||||
id: asId(data.id),
|
||||
filingId: asId(data.filingId),
|
||||
sourceEquipmentId: asId(data.sourceEquipmentId),
|
||||
deviceName: data.deviceName,
|
||||
deviceModel: data.deviceModel,
|
||||
manufacturer: data.manufacturer,
|
||||
calibrationReportUrl: data.calibrationReportUrl,
|
||||
};
|
||||
}
|
||||
|
||||
// ─── 字段映射:变更历史 ───
|
||||
|
||||
export function toChangeHistory(data = {}) {
|
||||
return {
|
||||
changeCount: Number(data.changeCount ?? 0),
|
||||
records: (data.records || []).map((item, index) => ({
|
||||
id: asId(item.id),
|
||||
index: index + 1,
|
||||
changeItemName: item.changeItemName,
|
||||
changeTime: formatDate(item.changeTime),
|
||||
operatorName: item.operatorName,
|
||||
})),
|
||||
};
|
||||
}
|
||||
|
||||
// ─── 查询参数映射 ───
|
||||
|
||||
export function toFilingPageQuery(params = {}, extra = {}) {
|
||||
const query = toPageQuery(params, {
|
||||
filingUnitName: "filingUnitName",
|
||||
filingTerritoryName: "filingTerritoryCode",
|
||||
filingNo: "filingNo",
|
||||
filingStatus: "filingStatusCode",
|
||||
});
|
||||
if (query.filingTerritoryCode) {
|
||||
query.filingTerritoryName = query.filingTerritoryCode;
|
||||
}
|
||||
delete query.orgId;
|
||||
return { ...query, ...extra };
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════
|
||||
// 接口 Action
|
||||
// ═══════════════════════════════════════════════════
|
||||
|
||||
export async function fetchQualFilingDetail(id) {
|
||||
const res = await apiGet("/safety-eval/qual-filing/detail", { id: asId(id) });
|
||||
return fromSingleResponse(res, toFilingDetail);
|
||||
|
|
|
|||
|
|
@ -497,6 +497,11 @@ function StaffFormModal({
|
|||
<Input placeholder="请输入专业" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item name="joinWorkDate" label="参加工作日期">
|
||||
<DatePicker placeholder="请选择参加工作日期" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
|
|||
|
|
@ -1,22 +1,57 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form, message } from "antd";
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
||||
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
||||
import { safeListRequest } from "~/utils";
|
||||
import FilingListTable from "../../FilingListTable";
|
||||
import { goFilingForm } from "../../filingPaths";
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
function FiledManageListPage(props) {
|
||||
const [searchForm] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(safeListRequest(props.qualFilingFiledPage), { form: searchForm });
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
||||
const getData = async (pagination) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const params = {
|
||||
...router.query,
|
||||
current: pagination?.current || router.query.current || 1,
|
||||
pageSize: pagination?.pageSize || router.query.pageSize || 10,
|
||||
};
|
||||
const res = await props.qualFilingFiledPage(params);
|
||||
if (res?.success !== false) {
|
||||
setDataSource(res?.data || []);
|
||||
setTotal(res?.totalCount || 0);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("[FiledManage] list failed:", err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
searchForm.setFieldsValue(router.query);
|
||||
getData();
|
||||
}, []);
|
||||
|
||||
const handleSearch = (values) => {
|
||||
router.query = { ...router.query, ...values, current: 1, pageSize: 10 };
|
||||
getData();
|
||||
};
|
||||
|
||||
const handlePageChange = (pagination) => {
|
||||
router.query = { ...router.query, current: pagination.current, pageSize: pagination.pageSize };
|
||||
getData(pagination);
|
||||
};
|
||||
|
||||
const handleCreate = () => {
|
||||
goFilingForm({ mode: FILING_FORM_MODE.FILED });
|
||||
};
|
||||
|
|
@ -28,12 +63,16 @@ function FiledManageListPage(props) {
|
|||
listDesc="对已备案资质进行周期性填报与维护。"
|
||||
createLabel="资质备案填报"
|
||||
mode={FILING_FORM_MODE.FILED}
|
||||
tableProps={tableProps}
|
||||
dataSource={dataSource}
|
||||
total={total}
|
||||
loading={loading}
|
||||
scrollY={props.scrollY}
|
||||
searchForm={searchForm}
|
||||
onSearch={() => getData()}
|
||||
onSearch={handleSearch}
|
||||
onPageChange={handlePageChange}
|
||||
onCreate={handleCreate}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_QUAL_FILING], true)(FiledManageListPage);
|
||||
export default Connect([NS_QUAL_FILING], true)(AntdTableFuncControl(FiledManageListPage));
|
||||
|
|
|
|||
|
|
@ -1,19 +1,44 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Form, Modal, message } from "antd";
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
||||
import { FILING_FORM_MODE } from "~/enumerate/qualFilingOptions";
|
||||
import { safeListRequest } from "~/utils";
|
||||
import FilingListTable from "../../FilingListTable";
|
||||
import { goFilingForm } from "../../filingPaths";
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
function FilingApplicationListPage(props) {
|
||||
const [searchForm] = Form.useForm();
|
||||
const { tableProps, getData } = useTable(safeListRequest(props.qualFilingPage), { form: searchForm });
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
||||
const getData = async (pagination) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const params = {
|
||||
...router.query,
|
||||
current: pagination?.current || router.query.current || 1,
|
||||
pageSize: pagination?.pageSize || router.query.pageSize || 10,
|
||||
};
|
||||
const res = await props.qualFilingPage(params);
|
||||
if (res?.success !== false) {
|
||||
setDataSource(res?.data || []);
|
||||
setTotal(res?.totalCount || 0);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("[FilingApplication] list failed:", err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
searchForm.setFieldsValue(router.query);
|
||||
getData();
|
||||
const onVisible = () => {
|
||||
if (document.visibilityState === "visible") {
|
||||
|
|
@ -24,6 +49,16 @@ function FilingApplicationListPage(props) {
|
|||
return () => document.removeEventListener("visibilitychange", onVisible);
|
||||
}, []);
|
||||
|
||||
const handleSearch = (values) => {
|
||||
router.query = { ...router.query, ...values, current: 1, pageSize: 10 };
|
||||
getData();
|
||||
};
|
||||
|
||||
const handlePageChange = (pagination) => {
|
||||
router.query = { ...router.query, current: pagination.current, pageSize: pagination.pageSize };
|
||||
getData(pagination);
|
||||
};
|
||||
|
||||
const handleCreate = () => {
|
||||
goFilingForm({ mode: FILING_FORM_MODE.APPLICATION });
|
||||
};
|
||||
|
|
@ -53,13 +88,17 @@ function FilingApplicationListPage(props) {
|
|||
listDesc="机构提交资质备案申请,填写备案基本信息、材料、人员及装备清单。"
|
||||
createLabel="申请备案"
|
||||
mode={FILING_FORM_MODE.APPLICATION}
|
||||
tableProps={tableProps}
|
||||
dataSource={dataSource}
|
||||
total={total}
|
||||
loading={loading}
|
||||
scrollY={props.scrollY}
|
||||
searchForm={searchForm}
|
||||
onSearch={() => getData()}
|
||||
onSearch={handleSearch}
|
||||
onPageChange={handlePageChange}
|
||||
onCreate={handleCreate}
|
||||
onDelete={handleDelete}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_QUAL_FILING], true)(FilingApplicationListPage);
|
||||
export default Connect([NS_QUAL_FILING], true)(AntdTableFuncControl(FilingApplicationListPage));
|
||||
|
|
|
|||
|
|
@ -1,28 +1,63 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import { tools } from "@cqsjjb/jjb-common-lib";
|
||||
import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
|
||||
import { NS_QUAL_FILING } from "~/enumerate/namespace";
|
||||
import {
|
||||
FILING_FORM_MODE,
|
||||
canStartFilingChange,
|
||||
} from "~/enumerate/qualFilingOptions";
|
||||
import { safeListRequest } from "~/utils";
|
||||
import ChangeHistoryModal from "../../FilingForm/components/ChangeHistoryModal";
|
||||
import FilingListTable from "../../FilingListTable";
|
||||
import { goFilingForm } from "../../filingPaths";
|
||||
|
||||
const { router } = tools;
|
||||
|
||||
function FilingChangeListPage(props) {
|
||||
const [searchForm] = Form.useForm();
|
||||
const [historyRecord, setHistoryRecord] = useState(null);
|
||||
const [startingId, setStartingId] = useState("");
|
||||
const { tableProps, getData } = useTable(safeListRequest(props.qualFilingChangePage), { form: searchForm });
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
|
||||
const getData = async (pagination) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const params = {
|
||||
...router.query,
|
||||
current: pagination?.current || router.query.current || 1,
|
||||
pageSize: pagination?.pageSize || router.query.pageSize || 10,
|
||||
};
|
||||
const res = await props.qualFilingChangePage(params);
|
||||
if (res?.success !== false) {
|
||||
setDataSource(res?.data || []);
|
||||
setTotal(res?.totalCount || 0);
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("[FilingChange] list failed:", err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
searchForm.setFieldsValue(router.query);
|
||||
getData();
|
||||
}, []);
|
||||
|
||||
const handleSearch = (values) => {
|
||||
router.query = { ...router.query, ...values, current: 1, pageSize: 10 };
|
||||
getData();
|
||||
};
|
||||
|
||||
const handlePageChange = (pagination) => {
|
||||
router.query = { ...router.query, current: pagination.current, pageSize: pagination.pageSize };
|
||||
getData(pagination);
|
||||
};
|
||||
|
||||
const handleStartChange = async (record) => {
|
||||
setStartingId(record.id);
|
||||
try {
|
||||
|
|
@ -36,8 +71,7 @@ function FilingChangeListPage(props) {
|
|||
id: res.data.draftFilingId,
|
||||
originFilingId: record.id,
|
||||
});
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
setStartingId("");
|
||||
}
|
||||
};
|
||||
|
|
@ -50,11 +84,15 @@ function FilingChangeListPage(props) {
|
|||
listDesc="对已备案资质发起变更申请,查看变更次数与变更明细。"
|
||||
mode={FILING_FORM_MODE.CHANGE}
|
||||
showChangeCount
|
||||
tableProps={tableProps}
|
||||
dataSource={dataSource}
|
||||
total={total}
|
||||
loading={loading}
|
||||
scrollY={props.scrollY}
|
||||
searchForm={searchForm}
|
||||
onSearch={() => getData()}
|
||||
onSearch={handleSearch}
|
||||
onPageChange={handlePageChange}
|
||||
onChangeCountClick={(record) => setHistoryRecord(record)}
|
||||
extraActions={(record) => (
|
||||
extraActions={(record) =>
|
||||
canStartFilingChange(record.filingStatusCode) ? (
|
||||
<Button
|
||||
type="link"
|
||||
|
|
@ -65,7 +103,7 @@ function FilingChangeListPage(props) {
|
|||
修改备案信息
|
||||
</Button>
|
||||
) : null
|
||||
)}
|
||||
}
|
||||
/>
|
||||
<ChangeHistoryModal
|
||||
open={!!historyRecord}
|
||||
|
|
@ -76,4 +114,4 @@ function FilingChangeListPage(props) {
|
|||
);
|
||||
}
|
||||
|
||||
export default Connect([NS_QUAL_FILING], true)(FilingChangeListPage);
|
||||
export default Connect([NS_QUAL_FILING], true)(AntdTableFuncControl(FilingChangeListPage));
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import Upload from "zy-react-library/components/Upload";
|
||||
import { Upload, Button } from "antd";
|
||||
import { UploadOutlined } from "@ant-design/icons";
|
||||
import { parseUploadFileList, resolveUploadFileId } from "~/utils/mockUpload";
|
||||
|
||||
export default function FilingUpload({
|
||||
|
|
@ -16,13 +17,16 @@ export default function FilingUpload({
|
|||
accept={accept}
|
||||
disabled={disabled}
|
||||
fileList={fileList}
|
||||
onChange={(files) => {
|
||||
if (disabled) {
|
||||
return;
|
||||
}
|
||||
onChange?.(files);
|
||||
beforeUpload={() => false}
|
||||
onChange={(info) => {
|
||||
if (disabled) return;
|
||||
onChange?.(info.fileList);
|
||||
}}
|
||||
/>
|
||||
>
|
||||
{(!fileList || fileList.length < maxCount) && (
|
||||
<Button icon={<UploadOutlined />}>上传</Button>
|
||||
)}
|
||||
</Upload>
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,35 +1,55 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Modal, Table } from "antd";
|
||||
import { Button, Form, Input, Modal, Table } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_EQUIP_INFO } from "~/enumerate/namespace";
|
||||
import { safeListRequest } from "~/utils";
|
||||
|
||||
function OrgEquipmentSelectModalInner(props) {
|
||||
const { open, onCancel, onConfirm, existingIds = [] } = props;
|
||||
const [searchForm] = Form.useForm();
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
|
||||
|
||||
const { tableProps, getData } = useTable(safeListRequest(props.equipInfoList), {
|
||||
form: searchForm,
|
||||
transform: (formData) => ({ likeDeviceName: formData.deviceName }),
|
||||
const getData = async (page = 1, pageSize = 10) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const values = searchForm.getFieldsValue();
|
||||
const res = await props.equipInfoList({
|
||||
current: page,
|
||||
pageSize,
|
||||
likeDeviceName: values.deviceName || undefined,
|
||||
});
|
||||
if (res?.success !== false) {
|
||||
setDataSource(res?.data || []);
|
||||
setPagination((prev) => ({ ...prev, current: page, pageSize, total: res?.totalCount || 0 }));
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("[OrgEquipmentSelectModal] list failed:", err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
setSelectedRowKeys([]);
|
||||
searchForm.resetFields();
|
||||
getData();
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
const handleSearch = () => {
|
||||
getData(1, pagination.pageSize);
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
const ids = selectedRowKeys.filter((id) => !existingIds.includes(String(id)));
|
||||
if (!ids.length) {
|
||||
Modal.warning({ title: "提示", content: "请选择至少一项未添加的装备" });
|
||||
return;
|
||||
}
|
||||
const rows = (tableProps.dataSource || []).filter((row) => ids.includes(row.id));
|
||||
const rows = dataSource.filter((row) => ids.includes(row.id));
|
||||
onConfirm?.(ids, rows);
|
||||
};
|
||||
|
||||
|
|
@ -43,14 +63,19 @@ function OrgEquipmentSelectModalInner(props) {
|
|||
onOk={handleOk}
|
||||
okText="确认添加"
|
||||
>
|
||||
<Search
|
||||
form={searchForm}
|
||||
options={[{ name: "deviceName", label: "装备名称", placeholder: "关键字搜索" }]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Form form={searchForm} layout="inline" style={{ marginBottom: 16 }}>
|
||||
<Form.Item name="deviceName">
|
||||
<Input placeholder="关键字搜索" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" onClick={handleSearch}>搜索</Button>
|
||||
<Button style={{ marginLeft: 8 }} onClick={() => { searchForm.resetFields(); getData(); }}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Table
|
||||
{...tableProps}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
dataSource={dataSource}
|
||||
rowSelection={{
|
||||
selectedRowKeys,
|
||||
onChange: setSelectedRowKeys,
|
||||
|
|
@ -58,6 +83,12 @@ function OrgEquipmentSelectModalInner(props) {
|
|||
disabled: existingIds.includes(String(record.id)),
|
||||
}),
|
||||
}}
|
||||
pagination={{
|
||||
...pagination,
|
||||
showSizeChanger: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
onChange: (page, pageSize) => getData(page, pageSize),
|
||||
}}
|
||||
columns={[
|
||||
{ title: "装备名称", dataIndex: "deviceName" },
|
||||
{ title: "规格型号", dataIndex: "deviceModel" },
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, Input, Modal, Space, Table } from "antd";
|
||||
import { Button, Form, Input, Modal, Table } from "antd";
|
||||
import { useEffect, useState } from "react";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_STAFF_INFO } from "~/enumerate/namespace";
|
||||
import { safeListRequest } from "~/utils";
|
||||
import StaffViewModal from "~/pages/Container/EnterpriseInfo/PersonnelInfo/StaffViewModal";
|
||||
|
||||
function OrgPersonnelSelectModalInner(props) {
|
||||
|
|
@ -12,26 +9,49 @@ function OrgPersonnelSelectModalInner(props) {
|
|||
const [searchForm] = Form.useForm();
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState([]);
|
||||
const [viewId, setViewId] = useState("");
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [dataSource, setDataSource] = useState([]);
|
||||
const [pagination, setPagination] = useState({ current: 1, pageSize: 10, total: 0 });
|
||||
|
||||
const { tableProps, getData } = useTable(safeListRequest(props.staffInfoList), {
|
||||
form: searchForm,
|
||||
transform: (formData) => ({ likeStaffName: formData.staffName }),
|
||||
const getData = async (page = 1, pageSize = 10) => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const values = searchForm.getFieldsValue();
|
||||
const res = await props.staffInfoList({
|
||||
current: page,
|
||||
pageSize,
|
||||
likeStaffName: values.staffName || undefined,
|
||||
});
|
||||
if (res?.success !== false) {
|
||||
setDataSource(res?.data || []);
|
||||
setPagination((prev) => ({ ...prev, current: page, pageSize, total: res?.totalCount || 0 }));
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn("[OrgPersonnelSelectModal] list failed:", err);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
setSelectedRowKeys([]);
|
||||
searchForm.resetFields();
|
||||
getData();
|
||||
}
|
||||
}, [open]);
|
||||
|
||||
const handleSearch = () => {
|
||||
getData(1, pagination.pageSize);
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
const ids = selectedRowKeys.filter((id) => !existingIds.includes(String(id)));
|
||||
if (!ids.length) {
|
||||
Modal.warning({ title: "提示", content: "请选择至少一名未添加的人员" });
|
||||
return;
|
||||
}
|
||||
const rows = (tableProps.dataSource || []).filter((row) => ids.includes(row.id));
|
||||
const rows = dataSource.filter((row) => ids.includes(row.id));
|
||||
onConfirm?.(ids, rows);
|
||||
};
|
||||
|
||||
|
|
@ -46,14 +66,19 @@ function OrgPersonnelSelectModalInner(props) {
|
|||
onOk={handleOk}
|
||||
okText="确认添加"
|
||||
>
|
||||
<Search
|
||||
form={searchForm}
|
||||
options={[{ name: "staffName", label: "人员姓名", placeholder: "关键字搜索" }]}
|
||||
onFinish={getData}
|
||||
/>
|
||||
<Form form={searchForm} layout="inline" style={{ marginBottom: 16 }}>
|
||||
<Form.Item name="staffName">
|
||||
<Input placeholder="关键字搜索" allowClear />
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Button type="primary" onClick={handleSearch}>搜索</Button>
|
||||
<Button style={{ marginLeft: 8 }} onClick={() => { searchForm.resetFields(); getData(); }}>重置</Button>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<Table
|
||||
{...tableProps}
|
||||
rowKey="id"
|
||||
loading={loading}
|
||||
dataSource={dataSource}
|
||||
rowSelection={{
|
||||
selectedRowKeys,
|
||||
onChange: setSelectedRowKeys,
|
||||
|
|
@ -61,6 +86,12 @@ function OrgPersonnelSelectModalInner(props) {
|
|||
disabled: existingIds.includes(String(record.id)),
|
||||
}),
|
||||
}}
|
||||
pagination={{
|
||||
...pagination,
|
||||
showSizeChanger: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
onChange: (page, pageSize) => getData(page, pageSize),
|
||||
}}
|
||||
columns={[
|
||||
{ title: "人员姓名", dataIndex: "staffName" },
|
||||
{ title: "类型", dataIndex: "personType" },
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Button, Form, Space, Tag, Typography } from "antd";
|
||||
import Search from "zy-react-library/components/Search";
|
||||
import Table from "zy-react-library/components/Table";
|
||||
import { Button, Form, Tag, Table, Typography, Select } from "antd";
|
||||
import SearchForm from "@cqsjjb/jjb-react-admin-component/SearchForm";
|
||||
import ControlWrapper from "@cqsjjb/jjb-react-admin-component/ControlWrapper";
|
||||
import TableAction from "@cqsjjb/jjb-react-admin-component/TableAction";
|
||||
import { CHONGQING_DISTRICTS } from "~/enumerate/enterpriseOptions";
|
||||
import {
|
||||
FILING_FORM_MODE,
|
||||
|
|
@ -9,15 +10,17 @@ import {
|
|||
isQualFilingEditable,
|
||||
QUAL_FILING_STATUS_COLOR,
|
||||
} from "~/enumerate/qualFilingOptions";
|
||||
import { CHANGE_COUNT_STYLE, formSelectField, getChangeCount } from "~/utils/enterpriseForm";
|
||||
import { CHANGE_COUNT_STYLE, getChangeCount } from "~/utils/enterpriseForm";
|
||||
import { goFilingForm } from "./filingPaths";
|
||||
|
||||
const SEARCH_COL = { xs: 24, sm: 12, md: 8, lg: 6 };
|
||||
|
||||
export default function FilingListTable({
|
||||
tableProps,
|
||||
dataSource,
|
||||
total,
|
||||
loading,
|
||||
searchForm,
|
||||
onSearch,
|
||||
onPageChange,
|
||||
scrollY,
|
||||
mode,
|
||||
showChangeCount = false,
|
||||
onChangeCountClick,
|
||||
|
|
@ -82,16 +85,13 @@ export default function FilingListTable({
|
|||
columns.push({
|
||||
title: "操作",
|
||||
width: 180,
|
||||
fixed: "right",
|
||||
render: (_, record) => (
|
||||
<Space size="small">
|
||||
<TableAction>
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => goFilingForm({
|
||||
mode,
|
||||
id: record.id,
|
||||
readOnly: true,
|
||||
})}
|
||||
onClick={() => goFilingForm({ mode, id: record.id, readOnly: true })}
|
||||
>
|
||||
查看
|
||||
</Button>
|
||||
|
|
@ -108,37 +108,82 @@ export default function FilingListTable({
|
|||
{mode === FILING_FORM_MODE.APPLICATION && isQualFilingEditable(record.filingStatusCode) && onDelete && (
|
||||
<Button type="link" size="small" danger onClick={() => onDelete(record)}>删除</Button>
|
||||
)}
|
||||
</Space>
|
||||
</TableAction>
|
||||
),
|
||||
});
|
||||
|
||||
return (
|
||||
<PageLayout
|
||||
title={listTitle}
|
||||
title={
|
||||
listDesc ? (
|
||||
<div>
|
||||
<span>{listTitle}</span>
|
||||
<div className="pageLayout-extra">{listDesc}</div>
|
||||
</div>
|
||||
) : (
|
||||
listTitle
|
||||
)
|
||||
}
|
||||
extra={onCreate && (
|
||||
<Button type="primary" onClick={onCreate}>{createLabel}</Button>
|
||||
)}
|
||||
>
|
||||
{listDesc && (
|
||||
<p style={{ margin: 0, marginBottom: 24, color: "rgba(0, 0, 0, 0.45)" }}>{listDesc}</p>
|
||||
)}
|
||||
<Search
|
||||
<SearchForm
|
||||
style={{ marginBottom: 24 }}
|
||||
form={searchForm}
|
||||
values={{ filingStatus: "" }}
|
||||
options={[
|
||||
{ name: "filingUnitName", label: "备案单位", placeholder: "关键字搜索", colProps: SEARCH_COL },
|
||||
formSelectField("filingTerritoryName", "备案属地", [{ label: "全部", value: "" }, ...CHONGQING_DISTRICTS], {
|
||||
colProps: SEARCH_COL,
|
||||
}),
|
||||
{ name: "filingNo", label: "备案编号", placeholder: "关键字搜索", colProps: SEARCH_COL },
|
||||
formSelectField("filingStatus", "备案状态", statusOptions, {
|
||||
colProps: SEARCH_COL,
|
||||
componentProps: { allowClear: false, showSearch: false },
|
||||
}),
|
||||
loading={loading}
|
||||
formLine={[
|
||||
<Form.Item key="filingUnitName" name="filingUnitName">
|
||||
<ControlWrapper.Input label="备案单位" placeholder="关键字搜索" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="filingTerritoryName" name="filingTerritoryName">
|
||||
<ControlWrapper.Select
|
||||
label="备案属地"
|
||||
placeholder="全部"
|
||||
allowClear
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
{CHONGQING_DISTRICTS.map((d) => (
|
||||
<Select.Option key={d.value} value={d.value}>{d.label}</Select.Option>
|
||||
))}
|
||||
</ControlWrapper.Select>
|
||||
</Form.Item>,
|
||||
<Form.Item key="filingNo" name="filingNo">
|
||||
<ControlWrapper.Input label="备案编号" placeholder="关键字搜索" allowClear />
|
||||
</Form.Item>,
|
||||
<Form.Item key="filingStatus" name="filingStatus">
|
||||
<ControlWrapper.Select
|
||||
label="备案状态"
|
||||
placeholder="全部"
|
||||
allowClear={false}
|
||||
showSearch={false}
|
||||
style={{ width: "100%" }}
|
||||
>
|
||||
{statusOptions.map((opt) => (
|
||||
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
|
||||
))}
|
||||
</ControlWrapper.Select>
|
||||
</Form.Item>,
|
||||
]}
|
||||
onFinish={() => onSearch?.({ type: "search" })}
|
||||
onFinish={(values) => onSearch(values)}
|
||||
onReset={(values) => onSearch(values)}
|
||||
/>
|
||||
<Table
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
dataSource={dataSource}
|
||||
loading={loading}
|
||||
scroll={{ y: scrollY }}
|
||||
pagination={{
|
||||
total,
|
||||
showSizeChanger: true,
|
||||
showQuickJumper: true,
|
||||
showTotal: (t) => `共 ${t} 条`,
|
||||
}}
|
||||
onChange={(pagination) => {
|
||||
if (onPageChange) onPageChange(pagination);
|
||||
}}
|
||||
/>
|
||||
<Table {...tableProps} columns={columns} />
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue