dev_1.0.1
tangjie 2026-07-13 11:14:27 +08:00
parent 96d5ae9458
commit b93465309e
5 changed files with 202 additions and 136 deletions

View File

@ -10,7 +10,7 @@ module.exports = {
javaGitBranch: "dev", javaGitBranch: "dev",
// 本地联调 safetyEval-servicecontext-path: /safetyEval默认端口 8095 // 本地联调 safetyEval-servicecontext-path: /safetyEval默认端口 8095
// 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095 // 可通过环境变量覆盖: SAFETY_EVAL_API_HOST=http://192.168.x.x:8095
API_HOST: "http://192.168.0.149", API_HOST: "https://gbs-gateway.qhdsafety.com",
}, },
production: { production: {
// 应用后端分支名称,部署上线需要 // 应用后端分支名称,部署上线需要

View File

@ -25,7 +25,6 @@ function OrgAccountPage(props) {
const [editOpen, setEditOpen] = useState(false); const [editOpen, setEditOpen] = useState(false);
const [currentId, setCurrentId] = useState(null); const [currentId, setCurrentId] = useState(null);
const [detail, setDetail] = useState(null); const [detail, setDetail] = useState(null);
const [rawDetail, setRawDetail] = useState(null);
const [detailLoading, setDetailLoading] = useState(false); const [detailLoading, setDetailLoading] = useState(false);
const [editLoading, setEditLoading] = useState(false); const [editLoading, setEditLoading] = useState(false);
const [dataSource, setDataSource] = useState([]); const [dataSource, setDataSource] = useState([]);
@ -35,7 +34,19 @@ function OrgAccountPage(props) {
const getData = async () => { const getData = async () => {
setLoading(true); setLoading(true);
try { try {
const params = searchForm.getFieldsValue(); const raw = searchForm.getFieldsValue();
const params = {
...raw,
state: raw.state !== "" && raw.state !== undefined ? Number(raw.state) : undefined,
...(Array.isArray(raw.openTimeRange) && raw.openTimeRange[0] && raw.openTimeRange[1]
? {
createTimeStart: raw.openTimeRange[0].format("YYYY-MM-DD"),
createTimeEnd: raw.openTimeRange[1].format("YYYY-MM-DD"),
}
: {}),
};
delete params.openTimeRange;
Object.keys(params).forEach((k) => { if (params[k] === undefined) delete params[k]; });
const res = await safeListRequest(props.orgAccountList)(params); const res = await safeListRequest(props.orgAccountList)(params);
setDataSource(res?.data || []); setDataSource(res?.data || []);
setTotal(res?.totalCount || 0); setTotal(res?.totalCount || 0);
@ -52,7 +63,6 @@ function OrgAccountPage(props) {
setDetailLoading(true); setDetailLoading(true);
const res = await safeRequest(props.orgAccountGet, { id }); const res = await safeRequest(props.orgAccountGet, { id });
setDetail(res?.data || null); setDetail(res?.data || null);
setRawDetail(res?.raw || null);
setDetailLoading(false); setDetailLoading(false);
return res; return res;
}; };
@ -76,7 +86,7 @@ function OrgAccountPage(props) {
const enabled = isOrgAccountEnabled(record); const enabled = isOrgAccountEnabled(record);
Modal.confirm({ Modal.confirm({
title: "确认操作", title: "确认操作",
content: enabled ? `确认禁用「${record.orgName}」账号?` : `确认启用「${record.orgName}」账号?`, content: enabled ? `确认禁用「${record.unitName}」账号?` : `确认启用「${record.unitName}」账号?`,
okText: "确认", okText: "确认",
cancelText: "取消", cancelText: "取消",
onOk: async () => { onOk: async () => {
@ -99,7 +109,7 @@ function OrgAccountPage(props) {
<div> <div>
<p> <p>
确认将 确认将
<strong>{record.orgName}</strong> <strong>{record.unitName}</strong>
的密码重置为初始密码 的密码重置为初始密码
</p> </p>
<p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>初始密码a123456</p> <p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>初始密码a123456</p>
@ -124,7 +134,7 @@ function OrgAccountPage(props) {
<div> <div>
<p> <p>
确认删除 确认删除
<strong>{record.orgName}</strong> <strong>{record.unitName}</strong>
的账号 的账号
</p> </p>
<p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>此操作不可恢复请谨慎操作</p> <p style={{ color: "rgba(0,0,0,0.45)", fontSize: 12 }}>此操作不可恢复请谨慎操作</p>
@ -150,14 +160,12 @@ function OrgAccountPage(props) {
const res = await props.orgAccountModify({ const res = await props.orgAccountModify({
...values, ...values,
id: currentId, id: currentId,
raw: rawDetail,
}); });
setEditLoading(false); setEditLoading(false);
if (res?.success !== false) { if (res?.success !== false) {
message.success("保存成功"); message.success("保存成功");
setEditOpen(false); setEditOpen(false);
setCurrentId(null); setCurrentId(null);
setRawDetail(null);
editForm.resetFields(); editForm.resetFields();
await getData(); await getData();
} }
@ -165,8 +173,8 @@ function OrgAccountPage(props) {
}; };
const columns = [ const columns = [
{ title: "机构名称", dataIndex: "orgName", ellipsis: true }, { title: "机构名称", dataIndex: "unitName", ellipsis: true },
{ title: "属地", dataIndex: "district", width: 260 }, { title: "属地", dataIndex: "districtName", width: 260 },
{ {
title: "状态", title: "状态",
width: 80, width: 80,
@ -179,7 +187,7 @@ function OrgAccountPage(props) {
{ title: "开户时间", dataIndex: "createTime", width: 110 }, { title: "开户时间", dataIndex: "createTime", width: 110 },
{ {
title: "操作", title: "操作",
width: 320, width: 200,
fixed: "right", fixed: "right",
render: (_, record) => ( render: (_, record) => (
<TableAction> <TableAction>
@ -211,10 +219,10 @@ function OrgAccountPage(props) {
form={searchForm} form={searchForm}
loading={loading} loading={loading}
formLine={[ formLine={[
<Form.Item key="orgName" name="orgName"> <Form.Item key="unitName" name="unitName">
<ControlWrapper.Input label="机构名称" placeholder="关键字搜索" allowClear /> <ControlWrapper.Input label="机构名称" placeholder="关键字搜索" allowClear />
</Form.Item>, </Form.Item>,
<Form.Item key="district" name="district"> <Form.Item key="districtName" name="districtName">
<ControlWrapper.Select label="属地" placeholder="请选择属地" allowClear> <ControlWrapper.Select label="属地" placeholder="请选择属地" allowClear>
{CHONGQING_DISTRICTS.map((opt) => ( {CHONGQING_DISTRICTS.map((opt) => (
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option> <Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
@ -222,14 +230,14 @@ function OrgAccountPage(props) {
</ControlWrapper.Select> </ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="state" name="state"> <Form.Item key="state" name="state">
<ControlWrapper.Select label="状态" placeholder="请选择状态"> <ControlWrapper.Select label="状态" placeholder="请选择状态" allowClear>
{ORG_ACCOUNT_STATE_OPTIONS.map((opt) => ( {ORG_ACCOUNT_STATE_OPTIONS.map((opt) => (
<Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option> <Select.Option key={opt.value} value={opt.value}>{opt.label}</Select.Option>
))} ))}
</ControlWrapper.Select> </ControlWrapper.Select>
</Form.Item>, </Form.Item>,
<Form.Item key="openTimeRange" name="openTimeRange"> <Form.Item key="openTimeRange" name="openTimeRange">
<ControlWrapper.DatePicker.RangePicker label="开户时间" /> <ControlWrapper.DatePicker.RangePicker label="开户时间" allowClear />
</Form.Item>, </Form.Item>,
]} ]}
onReset={() => { onReset={() => {
@ -265,22 +273,22 @@ function OrgAccountPage(props) {
loading={detailLoading} loading={detailLoading}
cancelText="关闭" cancelText="关闭"
okButtonProps={{ style: { display: "none" } }} okButtonProps={{ style: { display: "none" } }}
onCancel={() => { setViewOpen(false); setDetail(null); setRawDetail(null); }} onCancel={() => { setViewOpen(false); setDetail(null); }}
> >
{detail && ( {detail && (
<Descriptions bordered column={2} size="small"> <Descriptions bordered column={2} size="small">
<Descriptions.Item label="机构名称">{detail.orgName}</Descriptions.Item> <Descriptions.Item label="机构名称">{detail.unitName}</Descriptions.Item>
<Descriptions.Item label="统一社会信用代码">{detail.creditCode}</Descriptions.Item> <Descriptions.Item label="统一社会信用代码">{detail.creditCode}</Descriptions.Item>
<Descriptions.Item label="属地">{detail.regionCountyName}</Descriptions.Item> <Descriptions.Item label="属地">{detail.districtName}</Descriptions.Item>
<Descriptions.Item label="安全生产监管行业类别">{detail.safetyIndustryCategory}</Descriptions.Item> <Descriptions.Item label="安全生产监管行业类别">{detail.safetyIndustryCategoryName}</Descriptions.Item>
<Descriptions.Item label="经营地址" span={2}>{detail.businessAddress}</Descriptions.Item> <Descriptions.Item label="经营地址" span={2}>{detail.businessAddress}</Descriptions.Item>
<Descriptions.Item label="企业状态">{detail.enterpriseStatus}</Descriptions.Item> <Descriptions.Item label="企业状态">{detail.enterpriseStatusName}</Descriptions.Item>
<Descriptions.Item label="经度/纬度">{detail.longitude}, {detail.latitude}</Descriptions.Item> <Descriptions.Item label="经度/纬度">{detail.longitude}, {detail.latitude}</Descriptions.Item>
<Descriptions.Item label="主要负责人">{detail.principal}</Descriptions.Item> <Descriptions.Item label="主要负责人">{detail.principalName}</Descriptions.Item>
<Descriptions.Item label="主要负责人电话">{detail.principalPhone}</Descriptions.Item> <Descriptions.Item label="主要负责人电话">{detail.principalPhone}</Descriptions.Item>
<Descriptions.Item label="法定代表人">{detail.legalRepresentative}</Descriptions.Item> <Descriptions.Item label="法定代表人">{detail.legalRepresentative}</Descriptions.Item>
<Descriptions.Item label="法人电话">{detail.legalRepPhone}</Descriptions.Item> <Descriptions.Item label="法人电话">{detail.legalRepresentativePhone}</Descriptions.Item>
<Descriptions.Item label="企业规模" span={2}>{detail.enterpriseScale}</Descriptions.Item> <Descriptions.Item label="企业规模" span={2}>{detail.enterpriseScaleName}</Descriptions.Item>
</Descriptions> </Descriptions>
)} )}
</Modal> </Modal>
@ -296,7 +304,6 @@ function OrgAccountPage(props) {
onCancel={() => { onCancel={() => {
setEditOpen(false); setEditOpen(false);
setCurrentId(null); setCurrentId(null);
setRawDetail(null);
editForm.resetFields(); editForm.resetFields();
}} }}
onOk={onEditSubmit} onOk={onEditSubmit}
@ -304,7 +311,7 @@ function OrgAccountPage(props) {
<Form form={editForm} layout="vertical"> <Form form={editForm} layout="vertical">
<Row gutter={16}> <Row gutter={16}>
<Col span={12}> <Col span={12}>
<Form.Item name="orgName" label="机构名称" rules={[{ required: true, message: "请输入机构名称" }]}> <Form.Item name="unitName" label="机构名称" rules={[{ required: true, message: "请输入机构名称" }]}>
<Input /> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
@ -314,12 +321,12 @@ function OrgAccountPage(props) {
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item name="regionCountyName" label="属地"> <Form.Item name="districtName" label="属地">
<Select options={CHONGQING_DISTRICTS} placeholder="请选择属地" /> <Select options={CHONGQING_DISTRICTS} placeholder="请选择属地" />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item name="safetyIndustryCategory" label="安全生产监管行业类别"> <Form.Item name="safetyIndustryCategoryName" label="安全生产监管行业类别">
<Input /> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
@ -329,7 +336,7 @@ function OrgAccountPage(props) {
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item name="enterpriseStatus" label="企业状态"> <Form.Item name="enterpriseStatusName" label="企业状态">
<Select options={ENTERPRISE_STATUS_OPTIONS} /> <Select options={ENTERPRISE_STATUS_OPTIONS} />
</Form.Item> </Form.Item>
</Col> </Col>
@ -344,7 +351,7 @@ function OrgAccountPage(props) {
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item name="principal" label="主要负责人"> <Form.Item name="principalName" label="主要负责人">
<Input /> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
@ -359,12 +366,12 @@ function OrgAccountPage(props) {
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item name="legalRepPhone" label="法人电话"> <Form.Item name="legalRepresentativePhone" label="法人电话">
<Input /> <Input />
</Form.Item> </Form.Item>
</Col> </Col>
<Col span={12}> <Col span={12}>
<Form.Item name="enterpriseScale" label="企业规模"> <Form.Item name="enterpriseScaleName" label="企业规模">
<Select options={ENTERPRISE_SCALE_OPTIONS.map((o) => ({ label: o.label, value: o.label }))} /> <Select options={ENTERPRISE_SCALE_OPTIONS.map((o) => ({ label: o.label, value: o.label }))} />
</Form.Item> </Form.Item>
</Col> </Col>
@ -375,4 +382,4 @@ function OrgAccountPage(props) {
); );
} }
export default Connect([NS_ORG_INFO], true)(AntdTableFuncControl(OrgAccountPage)); export default Connect([NS_ORG_INFO], true)(AntdTableFuncControl(OrgAccountPage));

View File

@ -5,9 +5,6 @@ import PageLayout from "@cqsjjb/jjb-react-admin-component/PageLayout";
import FilePreviewModal from "~/components/FilePreviewModal"; import FilePreviewModal from "~/components/FilePreviewModal";
import { import {
fetchRegisteredOrgDetail, fetchRegisteredOrgDetail,
fetchRegisteredOrgPersonnelCertDetail,
fetchRegisteredOrgPersonnelCertList,
fetchRegisteredOrgPersonnelDetail,
fetchRegisteredOrgPersonnelList, fetchRegisteredOrgPersonnelList,
fetchRegisteredOrgQualificationGroups, fetchRegisteredOrgQualificationGroups,
} from "~/utils/regulatorOrgInfo"; } from "~/utils/regulatorOrgInfo";
@ -16,6 +13,53 @@ import StaffViewModal from "~/components/StaffViewModal";
const LIST_PATH = "/container/supervision/basicInfo/registeredOrg/list"; const LIST_PATH = "/container/supervision/basicInfo/registeredOrg/list";
const ORG_INFO_FORM_OPTIONS = buildOrgInfoFormOptions(); const ORG_INFO_FORM_OPTIONS = buildOrgInfoFormOptions();
const GENDER_MAP = { 1: "男", 2: "女" };
/** 后端字段名 → 前端表单字段名映射 */
const BACKEND_TO_FORM_FIELD = {
unitName: "orgName",
creditCode: "creditCode",
safetyIndustryCategoryName: "safetyIndustryCategory",
districtName: "regionCountyName",
townStreet: "regionStreetName",
villageCommunity: "regionCommunityName",
longitude: "longitude",
latitude: "latitude",
registerAddress: "registerAddress",
businessAddress: "businessAddress",
ownershipTypeName: "ownershipType",
economyIndustryCode: "gbIndustryCode",
legalRepresentative: "legalRepresentative",
legalRepresentativePhone: "legalRepPhone",
principalName: "principal",
principalPhone: "principalPhone",
safetyDeptManager: "safetyDeptHead",
safetyDeptManagerPhone: "safetyDeptPhone",
safetyDeputyPhone: "safetyVpPhone",
productionDate: "productionDate",
businessStatusName: "businessStatus",
infoDisclosureUrl: "disclosureUrl",
workplaceArea: "workplaceArea",
archiveRoomArea: "archiveRoomArea",
fulltimeEvaluatorCount: "fullTimeEvaluatorCount",
registeredEngineerCount: "registeredSafetyEngineerCount",
enterpriseStatusName: "enterpriseStatus",
enterpriseScaleName: "enterpriseScale",
filingTypeName: "filingType",
filingRecordStatusName: "filingRecordStatus",
attachments: "attachments",
};
function toFormFields(backendData) {
if (!backendData) return {};
const result = {};
Object.entries(BACKEND_TO_FORM_FIELD).forEach(([backendKey, formKey]) => {
if (backendData[backendKey] !== undefined) {
result[formKey] = backendData[backendKey];
}
});
return result;
}
function parseQueryId(location) { function parseQueryId(location) {
const search = location?.search || window.location.search || ""; const search = location?.search || window.location.search || "";
@ -38,14 +82,55 @@ function MaterialsTab({ materialGroups, loading, onPreview }) {
if (loading) { if (loading) {
return <Spin />; return <Spin />;
} }
const groups = Object.entries(materialGroups || {}).map(([code, list], index) => {
const items = Array.isArray(list) ? list : [];
const scopeName = items[0]?.licenseTypeName || code || `资质${index + 1}`;
const expireDate = items.reduce((latest, item) => {
const d = item.validEndDate;
if (!d) return latest;
return !latest || d > latest ? d : latest;
}, "");
const expireWarning = expireDate
? (() => {
const end = new Date(String(expireDate).replace(/-/g, "/"));
if (Number.isNaN(end.getTime())) return false;
const diff = end.getTime() - Date.now();
return diff > 0 && diff < 90 * 24 * 3600 * 1000;
})()
: false;
return {
id: code || String(index),
scopeName,
expireDate: expireDate || "-",
expireWarning,
materials: items.map((item, idx) => {
const certImgs = item.certImageUrl
? (Array.isArray(item.certImageUrl)
? item.certImageUrl
: String(item.certImageUrl).startsWith("[")
? (() => { try { return JSON.parse(item.certImageUrl); } catch { return [{ url: item.certImageUrl }]; } })()
: [{ url: item.certImageUrl }])
: item.certImgFiles || [];
const previewUrl = certImgs[0]?.url || "";
return {
id: item.id || `${code}-${idx}`,
name: item.certName || item.licenseTypeName || "-",
required: true,
status: previewUrl ? "uploaded" : "pending",
previewUrl,
raw: item,
};
}),
};
});
return ( return (
<div> <div>
<div style={{ marginBottom: 12, color: "rgba(0,0,0,0.45)" }}> <div style={{ marginBottom: 12, color: "rgba(0,0,0,0.45)" }}>
该机构共申请 该机构共申请
<strong>{materialGroups.length}</strong> <strong>{groups.length}</strong>
个业务范围资质以下为各范围对应的申请材料清单 个业务范围资质以下为各范围对应的申请材料清单
</div> </div>
{materialGroups.map((group) => ( {groups.map((group) => (
<Card <Card
key={group.id} key={group.id}
size="small" size="small"
@ -97,17 +182,17 @@ function PersonnelTab({ personnel, loading, onView }) {
dataSource={personnel} dataSource={personnel}
columns={[ columns={[
{ title: "序号", width: 60, render: (_, __, index) => index + 1 }, { title: "序号", width: 60, render: (_, __, index) => index + 1 },
{ title: "姓名", dataIndex: "name", width: 90 }, { title: "姓名", dataIndex: "userName", width: 90 },
{ title: "性别", dataIndex: "gender", width: 60 }, { title: "性别", width: 60, render: (_, record) => GENDER_MAP[record.genderCode] || "-" },
{ title: "岗位", dataIndex: "position", width: 110 }, { title: "岗位", dataIndex: "postName", width: 110 },
{ title: "资质范围", dataIndex: "qualScope", width: 90 }, { title: "资质范围", dataIndex: "qualScope", width: 90 },
{ title: "学历", dataIndex: "education", width: 80 }, { title: "学历", dataIndex: "educationName", width: 80 },
{ {
title: "注册安全工程师", title: "注册安全工程师",
width: 120, width: 120,
render: (_, record) => ( render: (_, record) => (
<Tag color={record.registerEngineer === 1 ? "success" : "error"}> <Tag color={record.registerEngineerFlag === 1 ? "success" : "error"}>
{record.registerEngineer === 1 ? "是" : "否"} {record.registerEngineerFlag === 1 ? "是" : "否"}
</Tag> </Tag>
), ),
}, },
@ -129,7 +214,7 @@ function RegisteredOrgDetailPage(props) {
const [orgLoading, setOrgLoading] = useState(Boolean(parseQueryId(props.location))); const [orgLoading, setOrgLoading] = useState(Boolean(parseQueryId(props.location)));
const [extrasLoading, setExtrasLoading] = useState(Boolean(parseQueryId(props.location))); const [extrasLoading, setExtrasLoading] = useState(Boolean(parseQueryId(props.location)));
const [orgName, setOrgName] = useState(""); const [orgName, setOrgName] = useState("");
const [materialGroups, setMaterialGroups] = useState([]); const [materialGroups, setMaterialGroups] = useState({});
const [personnel, setPersonnel] = useState([]); const [personnel, setPersonnel] = useState([]);
const [filePreview, setFilePreview] = useState(null); const [filePreview, setFilePreview] = useState(null);
const [viewPersonnelId, setViewPersonnelId] = useState(""); const [viewPersonnelId, setViewPersonnelId] = useState("");
@ -152,7 +237,7 @@ function RegisteredOrgDetailPage(props) {
fetchRegisteredOrgQualificationGroups(id).catch((err) => { fetchRegisteredOrgQualificationGroups(id).catch((err) => {
console.warn("[RegisteredOrgDetail] qualification load failed:", err); console.warn("[RegisteredOrgDetail] qualification load failed:", err);
return []; return { data: {} };
}), }),
fetchRegisteredOrgPersonnelList(id).catch((err) => { fetchRegisteredOrgPersonnelList(id).catch((err) => {
console.warn("[RegisteredOrgDetail] personnel load failed:", err); console.warn("[RegisteredOrgDetail] personnel load failed:", err);
@ -164,10 +249,10 @@ function RegisteredOrgDetailPage(props) {
return; return;
} }
if (orgRes?.data) { if (orgRes?.data) {
form.setFieldsValue(orgRes.data); form.setFieldsValue(toFormFields(orgRes.data));
setOrgName(orgRes.data.orgName || ""); setOrgName(orgRes.data.unitName || "");
} }
setMaterialGroups(groups || []); setMaterialGroups(groups?.data || {});
setPersonnel(staffList || []); setPersonnel(staffList || []);
} }
catch (err) { catch (err) {

View File

@ -75,16 +75,16 @@ function RegisteredOrgListPage(props) {
form={searchForm} form={searchForm}
loading={loading} loading={loading}
formLine={[ formLine={[
<Form.Item key="orgName" name="orgName"> <Form.Item key="unitName" name="unitName">
<ControlWrapper.Input label="评价机构名称" allowClear placeholder="关键字搜索" /> <ControlWrapper.Input label="评价机构名称" allowClear placeholder="关键字搜索" />
</Form.Item>, </Form.Item>,
<Form.Item key="registerAddress" name="registerAddress"> <Form.Item key="registerAddress" name="registerAddress">
<ControlWrapper.Input label="注册地址" allowClear placeholder="关键字搜索" /> <ControlWrapper.Input label="注册地址" allowClear placeholder="关键字搜索" />
</Form.Item>, </Form.Item>,
<Form.Item key="filingType" name="filingType" initialValue=""> <Form.Item key="filingTypeCode" name="filingTypeCode">
<ControlWrapper.Select label="备案类型" placeholder="请选择" allowClear options={REGISTERED_ORG_FILING_TYPE_SEARCH_OPTIONS} /> <ControlWrapper.Select label="备案类型" placeholder="请选择" allowClear options={REGISTERED_ORG_FILING_TYPE_SEARCH_OPTIONS} />
</Form.Item>, </Form.Item>,
<Form.Item key="filingRecordStatus" name="filingRecordStatus" initialValue=""> <Form.Item key="filingRecordStatusCode" name="filingRecordStatusCode">
<ControlWrapper.Select label="备案状态" placeholder="请选择" allowClear options={REGISTERED_ORG_FILING_RECORD_STATUS_OPTIONS} /> <ControlWrapper.Select label="备案状态" placeholder="请选择" allowClear options={REGISTERED_ORG_FILING_RECORD_STATUS_OPTIONS} />
</Form.Item>, </Form.Item>,
]} ]}
@ -111,11 +111,11 @@ function RegisteredOrgListPage(props) {
fetchData(pag.current, pag.pageSize); fetchData(pag.current, pag.pageSize);
}} }}
columns={[ columns={[
{ title: "评价机构名称", dataIndex: "orgName", ellipsis: true }, { title: "评价机构名称", dataIndex: "unitName", ellipsis: true },
{ title: "注册地址", dataIndex: "registerAddress", ellipsis: true }, { title: "注册地址", dataIndex: "registerAddress", ellipsis: true },
{ title: "服务企业数", dataIndex: "serviceEnterpriseCount", width: 100 }, { title: "服务企业数", dataIndex: "serviceEnterpriseCount", width: 100, render: (v) => v ?? 0 },
{ title: "评价项目数", dataIndex: "evalProjectCount", width: 100 }, { title: "评价项目数", dataIndex: "evalProjectCount", width: 100, render: (v) => v ?? 0 },
{ title: "备案类型", dataIndex: "filingType", width: 100 }, { title: "备案类型", dataIndex: "filingTypeName", width: 100 },
{ {
title: "备案状态", title: "备案状态",
width: 90, width: 90,

View File

@ -1,108 +1,82 @@
import { declareRequest } from "@cqsjjb/jjb-dva-runtime"; import { declareRequest } from "@cqsjjb/jjb-dva-runtime";
import { import { Get, Post } from "@cqsjjb/jjb-common-lib/http";
fromPageResponse,
fromQualificationClassGetResponse,
fromRegulatorOrgInfoModify,
fromSingleResponse,
toOrgAccountRow,
toOrgInfoForm,
toRegisteredOrgPageQuery,
toRegisteredOrgPersonnelRow,
toRegisteredOrgRow,
toRegulatorOrgAccountPageQuery,
toStaffCertForm,
toStaffForm,
} from "../enterpriseInfo/adapter";
import { apiGet, apiPost, apiPostDelete, safeAction, safePageResult } from "../enterpriseInfo/http";
const NO_ORG_CONTEXT = { includeOrgContext: false }; // ─── declareRequest DSL ───
export const orgAccountList = declareRequest("orgInfoLoading", safePageResult(async (params) => { export const orgAccountList = declareRequest(
const query = toRegulatorOrgAccountPageQuery(params); "orgInfoLoading",
const res = await apiGet("/safetyEval/org-info/page", query, {}, NO_ORG_CONTEXT); "Get > /safetyEval/org-info/page",
return fromPageResponse(res, toOrgAccountRow); 'data: [] | res.data || [] & totalCount: 0 | res.totalCount || 0'
})); );
export const orgAccountGet = declareRequest("orgInfoLoading", safeAction(async ({ id }) => { export const orgAccountGet = declareRequest(
const res = await apiGet("/safetyEval/org-info/get", { id }, {}, NO_ORG_CONTEXT); "orgInfoLoading",
const result = fromSingleResponse(res, toOrgInfoForm); "Get > /safetyEval/org-info/get",
return { 'data: {} | res.data || {}'
...result, );
raw: res?.data ?? null,
};
}));
export const orgAccountModify = declareRequest("orgInfoLoading", safeAction(async (values) => { export const orgAccountModify = declareRequest(
const { raw, ...formValues } = values; "orgInfoLoading",
const payload = fromRegulatorOrgInfoModify(formValues, raw || {}); "Post > @/safetyEval/org-info/modify"
const res = await apiPost("/safetyEval/org-info/modify", payload, {}, NO_ORG_CONTEXT); );
return fromSingleResponse(res, toOrgInfoForm);
}));
export const orgAccountDelete = declareRequest("orgInfoLoading", safeAction(async (data) => { export const orgAccountDelete = declareRequest(
return apiPost("/safetyEval/org-info/delete", data, {}, NO_ORG_CONTEXT); "orgInfoLoading",
})); "Post > @/safetyEval/org-info/delete"
);
export const orgAccountUpdateState = declareRequest("orgInfoLoading", safeAction(async ({ id, state }) => { export const orgAccountUpdateState = declareRequest(
return apiPost("/safetyEval/org-info/update-state", { id, state }, {}, NO_ORG_CONTEXT); "orgInfoLoading",
})); "Post > @/safetyEval/org-info/update-state"
);
export const orgAccountResetPassword = declareRequest("orgInfoLoading", safeAction(async (data ) => { export const orgAccountResetPassword = declareRequest(
const url = `/safetyEval/org-info/reset-password`; "orgInfoLoading",
return apiPost(url, data, {}, NO_ORG_CONTEXT); "Post > @/safetyEval/org-info/reset-password"
})); );
export const registeredOrgList = declareRequest("orgInfoLoading", safePageResult(async (params) => { export const registeredOrgList = declareRequest(
const query = toRegisteredOrgPageQuery(params); "orgInfoLoading",
const res = await apiGet("/safetyEval/org-info/page", query, {}, NO_ORG_CONTEXT); "Get > /safetyEval/org-info/page",
return fromPageResponse(res, toRegisteredOrgRow); 'data: [] | res.data || [] & totalCount: 0 | res.totalCount || 0'
})); );
export const registeredOrgGet = declareRequest("orgInfoLoading", safeAction(async ({ id }) => { export const registeredOrgGet = declareRequest(
const res = await apiGet("/safetyEval/org-info/get", { id }, {}, NO_ORG_CONTEXT); "orgInfoLoading",
return fromSingleResponse(res, toOrgInfoForm); "Get > /safetyEval/org-info/get",
})); 'data: {} | res.data || {}'
);
// ─── 直调 HTTP ───
/** 详情页直调 HTTP避免 DVA loading 与 useEffect 依赖 dispatch 函数导致反复取消 */
export async function fetchRegisteredOrgDetail(id) { export async function fetchRegisteredOrgDetail(id) {
const res = await apiGet("/safetyEval/org-info/get", { id }, {}, NO_ORG_CONTEXT); return Get("/safetyEval/org-info/get", { id }, { token: sessionStorage.getItem("token") });
return fromSingleResponse(res, toOrgInfoForm);
} }
export async function fetchRegisteredOrgQualificationGroups(orgInfoId) { export async function fetchRegisteredOrgQualificationGroups(orgInfoId) {
const res = await apiGet("/safetyEval/org-qualification/classGet", { id: orgInfoId }, {}, NO_ORG_CONTEXT); const res = await Get("/safetyEval/org-qualification/classGet", { id: orgInfoId }, { token: sessionStorage.getItem("token") });
if (res?.success === false) { if (res?.success === false) throw new Error(res?.message || "加载申请材料失败");
throw new Error(res?.message || "加载申请材料失败"); return { success: true, data: res?.data ?? {} };
}
return fromQualificationClassGetResponse(res);
} }
export async function fetchRegisteredOrgPersonnelList(orgInfoId) { export async function fetchRegisteredOrgPersonnelList(orgInfoId) {
const res = await apiGet("/safetyEval/org-personnel/page", { const res = await Get("/safetyEval/org-personnel/page", {
orgId: orgInfoId, orgId: orgInfoId, current: 1, size: 999,
current: 1, }, { token: sessionStorage.getItem("token") });
size: 999, return res?.data || [];
}, {}, NO_ORG_CONTEXT);
const page = fromPageResponse(res, toRegisteredOrgPersonnelRow);
return page?.data || [];
} }
export async function fetchRegisteredOrgPersonnelDetail({ id }) { export async function fetchRegisteredOrgPersonnelDetail({ id }) {
const res = await apiGet("/safetyEval/org-personnel/get", { id }, {}, NO_ORG_CONTEXT); return Get("/safetyEval/org-personnel/get", { id }, { token: sessionStorage.getItem("token") });
return fromSingleResponse(res, toStaffForm);
} }
export async function fetchRegisteredOrgPersonnelCertList(personnelId) { export async function fetchRegisteredOrgPersonnelCertList(personnelId) {
const res = await apiGet("/safetyEval/org-personnel-cert/page", { const res = await Get("/safetyEval/org-personnel-cert/page", {
personnelId, personnelId, current: 1, size: 999,
current: 1, }, { token: sessionStorage.getItem("token") });
size: 999, return res?.data || [];
}, {}, NO_ORG_CONTEXT);
const page = fromPageResponse(res, toStaffCertForm);
return page?.data || [];
} }
export async function fetchRegisteredOrgPersonnelCertDetail({ id }) { export async function fetchRegisteredOrgPersonnelCertDetail({ id }) {
const res = await apiGet("/safetyEval/org-personnel-cert/get", { id }, {}, NO_ORG_CONTEXT); return Get("/safetyEval/org-personnel-cert/get", { id }, { token: sessionStorage.getItem("token") });
return fromSingleResponse(res, toStaffCertForm);
} }