dev_1.0.1
tangjie 2026-07-06 16:49:57 +08:00
parent 8e6c5c1b69
commit 19e4771369
4 changed files with 75 additions and 41 deletions

View File

@ -1,5 +1,13 @@
import { Connect } from "@cqsjjb/jjb-dva-runtime";
import { Button, Descriptions, Form, message, Modal, Table, Upload } from "antd";
import {
Button,
Descriptions,
Form,
message,
Modal,
Table,
Upload,
} from "antd";
import { useEffect, useState } from "react";
import FormBuilder from "zy-react-library/components/FormBuilder";
import AddIcon from "zy-react-library/components/Icon/AddIcon";
@ -11,7 +19,9 @@ import { AntdTableFuncControl } from "@cqsjjb/jjb-common-decorator/antd";
import { tools } from "@cqsjjb/jjb-common-lib";
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
import useGetFile from "zy-react-library/hooks/useGetFile";
import CertPreviewImg, { CertTooltipPreviewImg } from "~/components/CertPreviewImg";
import CertPreviewImg, {
CertTooltipPreviewImg,
} from "~/components/CertPreviewImg";
import { NS_ORG_QUALIFICATION_CERT } from "~/enumerate/namespace";
import { QUALIFICATION_INDUSTRY_OPTIONS } from "~/enumerate/enterpriseOptions";
import { formSelectField } from "~/utils/enterpriseForm";
@ -124,6 +134,18 @@ function QualificationCertPage(props) {
</div>
</div>
}
extra={
<Button
type="primary"
icon={<AddIcon />}
onClick={() => {
setCurrentId("");
setAddModalOpen(true);
}}
>
新增证书
</Button>
}
>
<SearchForm
style={{ marginBottom: 24 }}
@ -131,7 +153,11 @@ function QualificationCertPage(props) {
loading={loading}
formLine={[
<Form.Item key="likeCertName" name="likeCertName">
<ControlWrapper.Input label="证书名称" placeholder="请输入证书名称" allowClear />
<ControlWrapper.Input
label="证书名称"
placeholder="请输入证书名称"
allowClear
/>
</Form.Item>,
<Form.Item key="validDate" name="validDate">
<ControlWrapper.DatePicker.RangePicker label="证书有效期" />
@ -149,19 +175,6 @@ function QualificationCertPage(props) {
}}
/>
<div style={{ marginBottom: 16, display: "flex", justifyContent: "flex-end" }}>
<Button
type="primary"
icon={<AddIcon />}
onClick={() => {
setCurrentId("");
setAddModalOpen(true);
}}
>
新增证书
</Button>
</div>
<Table
rowKey="id"
columns={[
@ -170,19 +183,25 @@ function QualificationCertPage(props) {
{
title: "证书有效期",
width: 220,
render: (_, record) => `${record.validStartDate ?? ""} ~ ${record.validEndDate ?? ""}`,
render: (_, record) =>
`${record.validStartDate ?? ""} ~ ${record.validEndDate ?? ""}`,
},
{ title: "证书编号", dataIndex: "certNo" },
{
title: "状态",
width: 80,
render: (_, record) => (isQualificationEnabled(record) ? "启用" : "禁用"),
render: (_, record) =>
isQualificationEnabled(record) ? "启用" : "禁用",
},
{
title: "照片",
width: 100,
render: (_, record) =>
record.certImgFiles?.length ? <CertTooltipPreviewImg files={record.certImgFiles} /> : <span></span>,
record.certImgFiles?.length ? (
<CertTooltipPreviewImg files={record.certImgFiles} />
) : (
<span></span>
),
},
{
title: "操作",
@ -303,8 +322,13 @@ function CertFormModal({
}
const data = { ...res.data };
data.issueDate = toDayjs(data.issueDate);
data.validDate = [toDayjs(data.validStartDate), toDayjs(data.validEndDate)];
data.certImgs = data.certImgFiles?.length ? data.certImgFiles : mockUploadFileList("证书图片.jpg");
data.validDate = [
toDayjs(data.validStartDate),
toDayjs(data.validEndDate),
];
data.certImgs = data.certImgFiles?.length
? data.certImgFiles
: mockUploadFileList("证书图片.jpg");
form.setFieldsValue(data);
setDetailLoading(false);
@ -376,10 +400,15 @@ function CertFormModal({
showActionButtons={false}
onFinish={handleSubmit}
options={[
formSelectField("certType", "证照类型", QUALIFICATION_INDUSTRY_OPTIONS, {
rules: [{ required: true, message: "请选择证照类型" }],
colProps: { span: 24 },
}),
formSelectField(
"certType",
"证照类型",
QUALIFICATION_INDUSTRY_OPTIONS,
{
rules: [{ required: true, message: "请选择证照类型" }],
colProps: { span: 24 },
},
),
{
name: "certName",
label: "证书名称",
@ -405,7 +434,10 @@ function CertFormModal({
name: "validDate",
label: "证书有效期",
render: FORM_ITEM_RENDER_ENUM.DATE_RANGE,
rules: [{ required: true, message: "请选择证书有效期" }, dateRangeRule()],
rules: [
{ required: true, message: "请选择证书有效期" },
dateRangeRule(),
],
},
{
name: "remark",
@ -500,4 +532,7 @@ function CertViewModal({ open, currentId, requestDetails, onCancel }) {
);
}
export default Connect([NS_ORG_QUALIFICATION_CERT], true)(AntdTableFuncControl(QualificationCertPage));
export default Connect(
[NS_ORG_QUALIFICATION_CERT],
true,
)(AntdTableFuncControl(QualificationCertPage));

View File

@ -13,10 +13,11 @@ function EnterpriseInfo(props) {
if (!orgInfoId) {
props.orgInfoGet().then((res) => {
setOrgInfoId(res?.data?.id);
sessionStorage.setItem("orgInfoId", res?.data?.id);
});
}
}, []);
console.log(props.location.pathname);
if(props.location.pathname.includes('EnterpriseInfo/OrgInfo')){
return props.children;

View File

@ -49,12 +49,7 @@ function FilingFormPage(props) {
const detailRef = useRef(null);
const readOnly = query.readOnly;
const listMode =
mode === FILING_FORM_MODE.FILED
? "filed"
: mode === FILING_FORM_MODE.CHANGE
? "change"
: "application";
const saveActionHint =
mode === FILING_FORM_MODE.FILED
@ -143,28 +138,30 @@ function FilingFormPage(props) {
setSubmitting(true);
const currentDetail = collectCurrentDetail();
const word= mode === "change" ? "Change" : "";
const body = {
[`qualFiling${mode === "change" ? "Change" : ""}AddCmd`]: {
[`qualFiling${word}AddCmd`]: {
...currentDetail,
filingStatusCode: config.isSaveDraft ? 5 : 2,
applyTypeCode: mode === "application" ? 1 : 2,
applyTypeCode: mode === "application" ? 1 : 3,
},
};
const params = body[`qualFiling${mode === "change" ? "Change" : ""}AddCmd`];
const params = body[`qualFiling${word}AddCmd`];
if (params.materials) {
body[`qualFilingMaterial${mode === "change" ? "Change" : ""}AddCmds`] = params.materials;
body[`qualFilingMaterial${word}AddCmds`] = params.materials;
delete params.materials;
}
if (params.personnelList) {
body[`qualFilingPersonnel${mode === "change" ? "Change" : ""}AddCmds`] = params.personnelList;
body[`qualFilingPersonnel${word}AddCmds`] = params.personnelList;
delete params.personnelList;
}
if (params.equipmentList) {
body[`qualFilingEquipment${mode === "change" ? "Change" : ""}AddCmds`] = params.equipmentList;
body[`qualFilingEquipment${word}AddCmds`] = params.equipmentList;
delete params.equipmentList;
}
if (params.commitment) {
body[`qualFilingCommitment${mode === "change" ? "Change" : ""}AddCmd`] = params.commitment;
body[`qualFilingCommitment${word}AddCmd`] = params.commitment;
delete params.commitment;
}

View File

@ -12,6 +12,7 @@ function QualApplication(props) {
if (!orgInfoId) {
props.orgInfoGet().then((res) => {
setOrgInfoId(res?.data?.id);
sessionStorage.setItem("orgInfoId", res?.data?.id);
});
}
}, []);